:root {
	--kopylov-home-team-sticky-top: 90px;
}

body.kopylov-team-scroll-frame-enabled,
body.kopylov-team-scroll-frame-enabled .wp-site-blocks {
	overflow-anchor: none;
}

/* Team owns a white surface only after the black Portfolio surface has handed
 * the viewport over. Before that moment it stays transparent so the reveal
 * circle is the only new colour entering the viewport. */
#home-our-team {
	position: relative;
	isolation: isolate;
	min-height: 100vh;
	min-height: 100lvh;
	background-color: transparent !important;
	color: #000;
	overflow-anchor: none;
}

#home-our-team.kopylov-team-entry-active {
	z-index: 1100;
}

#home-our-team.kopylov-team-entry-complete {
	background-color: #fff !important;
	z-index: auto;
}

#home-our-team > .wp-block-column {
	position: relative;
}

#home-our-team > .wp-block-column > :not(.kopylov-team-scroll-frame) {
	position: relative;
	z-index: 1102;
}

#home-our-team.kopylov-team-entry-active > .wp-block-column > :not(.kopylov-team-scroll-frame) {
	/* Header behavior assigns the sticky items their own z-index inline. Keep
	 * Team copy above the fixed white reveal during the hand-off. */
	z-index: 1102 !important;
}

#home-team-design-h {
	margin-block-start: 0 !important;
	will-change: top;
}

#home-team-design-t1 {
	will-change: top;
}

.kopylov-team-scroll-frame {
	--kopylov-team-white-reveal-scale: 0;
	--kopylov-team-mobile-reveal-radius: 0px;
	--kopylov-team-scroll-hold-extra: 0px;
	position: absolute;
	top: calc(-1 * var(--kopylov-home-team-sticky-top));
	/* A sticky viewport needs one viewport of parent space after the last
	 * keyframe. JS adds only the missing remainder here, so the stage cannot
	 * start leaving the viewport while the scroll animation is still running. */
	bottom: calc(0px - var(--kopylov-team-scroll-hold-extra));
	left: calc(-1 * var(--kopylov-full-width-padded-desktop, 40px));
	z-index: 0;
	width: 100vw;
	pointer-events: none;
}

.kopylov-team-scroll-frame__stage {
	position: sticky;
	top: 0;
	display: block;
	height: 100vh;
	height: 100lvh;
	height: var(--kopylov-visual-viewport-height, 100lvh);
	width: 100vw;
	overflow: hidden;
	background: transparent;
}

/* The Portfolio → Team hand-off uses the same fixed viewport layer and
 * bottom-centred circular reveal as the existing dark hand-off. */
.kopylov-team-scroll-frame.is-entry-active:not(.is-entry-complete) {
	position: fixed;
	inset: 0;
	z-index: 1101;
	width: 100vw;
	height: 100vh;
	height: 100lvh;
	height: var(--kopylov-visual-viewport-height, 100lvh);
}

.kopylov-team-scroll-frame.is-entry-active:not(.is-entry-complete) .kopylov-team-scroll-frame__stage {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: var(--kopylov-visual-viewport-height, 100lvh);
}

.kopylov-team-scroll-frame__white-reveal {
	position: absolute;
	bottom: 0;
	left: 50%;
	z-index: 0;
	width: 300vmax;
	height: 300vmax;
	border-radius: 50%;
	background: #fff;
	transform: translate3d(-50%, 50%, 0) scale(var(--kopylov-team-white-reveal-scale));
	transform-origin: center;
	pointer-events: none;
	will-change: transform;
}

.kopylov-team-scroll-frame__art,
.kopylov-team-scroll-frame__tags {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.kopylov-team-scroll-frame__art {
	z-index: 1;
}

.kopylov-team-scroll-frame__tags {
	z-index: 3;
}

.kopylov-team-scroll-frame__art img,
.kopylov-team-scroll-frame__tags img {
	position: absolute;
	display: block;
	max-width: none;
	margin: 0;
	object-position: center;
	will-change: transform;
}

.kopylov-team-scroll-frame__art img {
	/* Never stretch a supplied portrait. The JS keeps the natural ratio and
	 * the frame remains responsible only for positioning and clipping. */
	object-fit: contain;
}

.kopylov-team-scroll-frame__art img[data-team-art="rock-left"],
.kopylov-team-scroll-frame__art img[data-team-art="rock-right"] {
	/* Both rock assets are shown in full. The viewport/stage may hide pixels
	 * that are outside the screen, but neither asset is cropped into a Figma
	 * frame or stretched. */
	object-fit: contain;
}

.kopylov-team-scroll-frame__tags img {
	object-fit: contain;
}

body.kopylov-team-scroll-frame-past .kopylov-team-scroll-frame__stage {
	opacity: 0;
	visibility: hidden;
}

@media (max-width: 1127px) {
	.kopylov-team-scroll-frame {
		left: calc(-1 * var(--kopylov-full-width-padded-mobile, 16px));
	}

	body.kopylov-team-scroll-frame-active #home-our-team {
		/* Keep the white reveal above Portfolio, like the existing mobile
		 * Brand → Portfolio transition. */
		z-index: 1103;
	}

	.kopylov-team-scroll-frame.is-entry-active:not(.is-entry-complete) {
		z-index: 1101;
	}

	.kopylov-team-scroll-frame.is-entry-active:not(.is-entry-complete) .kopylov-team-scroll-frame__stage {
		background: #fff;
		clip-path: circle(var(--kopylov-team-mobile-reveal-radius) at 50% 100%);
		will-change: clip-path;
	}

	.kopylov-team-scroll-frame__white-reveal {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kopylov-team-scroll-frame__white-reveal,
	.kopylov-team-scroll-frame__art img,
	.kopylov-team-scroll-frame__tags img {
		will-change: auto;
	}
}
