/* Team block */

.ws-team {
	background: var(--ws-white);
}

.ws-team-shell {
	width: min(var(--ws-container), 100% - var(--ws-gutter) * 2);
	margin-inline: auto;
	padding: clamp(48px, 8vw, 96px) 0;
}

.ws-team-title {
	margin: 0 0 clamp(28px, 5vw, 40px);
	max-width: 16ch;
	font-size: clamp(2rem, 4.5vw, 3rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.03em;
	text-align: left;
	color: var(--ws-black);
}

.ws-team-layout {
	width: 100%;
}

/* ≤4 members — cards + circle on the right */
.ws-team--single-row .ws-team-layout {
	display: flex;
	align-items: stretch;
	gap: clamp(16px, 2vw, 28px);
}

.ws-team--single-row .ws-team-grid {
	flex: 1;
	min-width: 0;
}

.ws-team--single-row .ws-team-label {
	flex-shrink: 0;
	align-self: center;
}

/* 5+ members — shared 4-column grid with cards + circle on the last row */
.ws-team--multi-row .ws-team-layout {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(12px, 1.5vw, 20px);
	align-items: end;
}

.ws-team--multi-row .ws-team-grid {
	display: contents;
}

.ws-team--multi-row .ws-team-label {
	grid-column: span 2;
	justify-self: end;
	align-self: end;
}

/* Full last row (4, 8, 12…) — circle overlays the bottom-right corner */
.ws-team--multi-row.ws-team--full-rows .ws-team-label {
	position: absolute;
	right: 0;
	bottom: 0;
}

.ws-team-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(12px, 1.5vw, 20px);
}

/* 5 members — last card spans 2 columns, circle fills the rest of the row */
.ws-team--multi-row:not(.ws-team--full-rows) .ws-team-card:nth-child(4n + 1):last-child {
	grid-column: span 2;
}

.ws-team-card {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--ws-black);
	cursor: default;
	outline: none;
}

.ws-team-card-media,
.ws-team-card-img {
	width: 100%;
	height: 100%;
}

.ws-team-card-img {
	object-fit: cover;
	display: block;
	filter: grayscale(100%);
	transition: transform 0.55s ease, filter 0.55s ease;
}

.ws-team-card-img--placeholder {
	background: var(--ws-gray-light);
	min-height: 100%;
}

.ws-team-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding: clamp(16px, 2.5vw, 28px);
	background: rgba(0, 0, 0, 0);
	color: var(--ws-white);
	opacity: 0;
	transition: opacity 0.4s ease, background 0.45s ease;
	pointer-events: none;
}

.ws-team-card:hover .ws-team-overlay,
.ws-team-card:focus-within .ws-team-overlay,
.ws-team-card.is-active .ws-team-overlay,
.ws-team-card.is-revealed .ws-team-overlay {
	opacity: 1;
	background: rgba(0, 0, 0, 0.62);
}

.ws-team-card:hover .ws-team-card-img,
.ws-team-card:focus-within .ws-team-card-img,
.ws-team-card.is-active .ws-team-card-img,
.ws-team-card.is-revealed .ws-team-card-img {
	transform: scale(1.04);
	filter: grayscale(0%);
}

.ws-team-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-self: flex-end;
	min-width: 0;
}

.ws-team-name,
.ws-team-role,
.ws-team-stat {
	opacity: 0;
	transition:
		opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: 0s;
}

.ws-team-name {
	margin: 0;
	font-size: clamp(0.875rem, 1.4vw, 1.125rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	transform: translate3d(0, 22px, 0);
}

.ws-team-role {
	margin: 0;
	font-size: clamp(0.75rem, 1.1vw, 0.875rem);
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.72);
	transform: translate3d(0, 18px, 0);
}

.ws-team-card:hover .ws-team-name,
.ws-team-card:focus-within .ws-team-name,
.ws-team-card.is-active .ws-team-name,
.ws-team-card.is-revealed .ws-team-name {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition-delay: 0.08s;
}

.ws-team-card:hover .ws-team-role,
.ws-team-card:focus-within .ws-team-role,
.ws-team-card.is-active .ws-team-role,
.ws-team-card.is-revealed .ws-team-role {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition-delay: 0.22s;
}

.ws-team-stats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: clamp(8px, 1.2vw, 14px);
	align-self: flex-end;
	flex-shrink: 0;
}

.ws-team-stat {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	line-height: 1.1;
	transform: translate3d(24px, 0, 0);
}

.ws-team-card:hover .ws-team-stat:nth-child(1),
.ws-team-card:focus-within .ws-team-stat:nth-child(1),
.ws-team-card.is-active .ws-team-stat:nth-child(1),
.ws-team-card.is-revealed .ws-team-stat:nth-child(1) {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition-delay: 0.14s;
}

.ws-team-card:hover .ws-team-stat:nth-child(2),
.ws-team-card:focus-within .ws-team-stat:nth-child(2),
.ws-team-card.is-active .ws-team-stat:nth-child(2),
.ws-team-card.is-revealed .ws-team-stat:nth-child(2) {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition-delay: 0.26s;
}

.ws-team-card:hover .ws-team-stat:nth-child(3),
.ws-team-card:focus-within .ws-team-stat:nth-child(3),
.ws-team-card.is-active .ws-team-stat:nth-child(3),
.ws-team-card.is-revealed .ws-team-stat:nth-child(3) {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition-delay: 0.38s;
}

.ws-team-stat-value {
	font-size: clamp(1.125rem, 2vw, 1.5rem);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.ws-team-stat-label {
	font-size: clamp(0.625rem, 0.9vw, 0.75rem);
	color: rgba(255, 255, 255, 0.65);
	text-transform: lowercase;
}

.ws-team-label {
	width: clamp(108px, 11vw, 148px);
	height: clamp(108px, 11vw, 148px);
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ws-white);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 50%;
	z-index: 2;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.25s ease, transform 0.25s ease;
}

a.ws-team-label:hover {
	border-color: var(--ws-black);
	transform: translateY(-2px);
}

.ws-team-label-text {
	font-size: clamp(0.8125rem, 1.1vw, 1rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-align: center;
	color: var(--ws-black);
	max-width: 7em;
}

.ws-team--single-row.ws-team--no-label .ws-team-grid {
	flex: 1 1 100%;
}

.ws-team--multi-row.ws-team--no-label .ws-team-layout {
	display: block;
}

.ws-team--multi-row.ws-team--no-label .ws-team-grid {
	display: grid;
	width: 100%;
}

/* Mobile — 2 columns + centered circle */
@media (max-width: 1023px) {
	.ws-team-shell {
		padding: clamp(40px, 8vw, 64px) 0;
	}

	.ws-team--single-row .ws-team-layout {
		flex-direction: column;
		align-items: stretch;
		padding-bottom: clamp(64px, 16vw, 96px);
	}

	.ws-team--multi-row .ws-team-layout {
		display: block;
		padding-bottom: clamp(64px, 16vw, 96px);
	}

	.ws-team--no-label .ws-team-layout {
		padding-bottom: 0;
	}

	.ws-team--multi-row .ws-team-grid {
		display: grid;
		width: 100%;
	}

	.ws-team--multi-row .ws-team-label {
		position: relative;
		z-index: 3;
		grid-column: auto;
		justify-self: center;
		margin-top: clamp(20px, 6vw, 32px);
		margin-inline: auto;
	}

	.ws-team--multi-row.ws-team--full-rows .ws-team-label {
		position: relative;
	}

	.ws-team-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: clamp(10px, 2.5vw, 16px);
	}

	.ws-team--single-row .ws-team-label {
		position: relative;
		z-index: 3;
		align-self: center;
		margin-top: clamp(20px, 6vw, 32px);
	}

	.ws-team-overlay {
		padding: 14px;
	}

	.ws-team-stat-value {
		font-size: 1.125rem;
	}

	/* Scroll reveal — no hover dependency on touch */
	.ws-team-card.is-revealed .ws-team-overlay {
		pointer-events: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ws-team-card-img,
	.ws-team-overlay {
		transition: opacity 0.35s ease, background 0.35s ease;
	}

	.ws-team-name,
	.ws-team-role,
	.ws-team-stat {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.ws-team-card:hover .ws-team-card-img,
	.ws-team-card:focus-within .ws-team-card-img,
	.ws-team-card.is-active .ws-team-card-img,
	.ws-team-card.is-revealed .ws-team-card-img {
		transform: none;
	}
}
