/* One outer edge, one inner edge and one gap for contained sections. */
:root {
	--section-edge: clamp(20px, 6vw, 112px);
	--section-radius: clamp(20px, 2.2vw, 32px);
	--section-pad: clamp(24px, 4vw, 64px);
	--section-pad-block: clamp(44px, 5vw, 80px);
	--section-space: clamp(36px, 5vw, 80px);
	--clients-scroll-height: 120svh;
}

main#top .page-panel {
	box-sizing: border-box;
	width: calc(100% - var(--section-edge) * 2);
	max-width: 1600px;
	margin-inline: auto;
}

main#top .hero-stage > .page-panel {
	width: calc(100% - (var(--section-edge) - var(--film-frame)) * 2);
}

main#top :is(.apex-choice, .clients, .services, .selected-work).page-panel {
	padding: var(--section-pad-block) var(--section-pad) !important;
	border: 0;
	border-radius: var(--section-radius);
	background: #f5f4f0 !important;
	box-shadow: none;
}

main#top > .page-panel + .page-panel {
	margin-top: var(--section-space);
}

/* Keep the opening statement centered, with the studio in its own section. */
main#top .apex-choice--statement.page-panel {
	display: block;
	overflow: hidden;
}

.apex-choice--statement .apex-choice__statement {
	max-width: 720px;
	margin-inline: auto;
	text-align: center;
}

.apex-choice--statement .apex-choice__description {
	margin-inline: auto;
}

/* Match the film's outer frame exactly, on the white page below the logos. */
.studio-showcase {
	position: relative;
	z-index: 2;
	padding: var(--section-space) var(--film-frame) 0;
	background: #fff;
}

.studio-showcase__frame {
	position: relative;
	isolation: isolate;
	aspect-ratio: 16 / 9;
	max-width: 1600px;
	min-height: 360px;
	border-radius: var(--film-radius);
	overflow: hidden;
	margin-inline: auto;
}

.studio-showcase__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to top, rgb(17 17 17 / 66%), transparent 52%);
}

.studio-showcase__frame > img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 58%;
}

.studio-showcase__caption {
	position: absolute;
	z-index: 1;
	inset-inline: var(--film-inset);
	bottom: clamp(28px, 4vw, 64px);
	color: #fff;
	text-shadow: 0 1px 12px rgb(0 0 0 / 12%);
}

.studio-showcase__caption h2 {
	margin: 0;
	color: inherit;
	font:
		400 clamp(1.875rem, 3.6vw, 3.75rem)/1.12 Arial,
		sans-serif;
	letter-spacing: -0.035em;
}

.studio-showcase__caption p {
	max-width: 36ch;
	margin: 14px 0 0;
	color: inherit;
	font:
		400 clamp(1rem, 1.35vw, 1.25rem)/1.5 Arial,
		sans-serif;
}

/* Give the film room to breathe, then reveal the clients before dissolving to white. */
main#top .hero-stage {
	padding-bottom: var(--section-space);
}

main#top .hero-stage--motion {
	padding-bottom: calc(var(--clients-scroll-height) + 24svh);
}

main#top .hero-stage--motion .apex-choice--statement.page-panel {
	margin-top: 24svh;
}

main#top .clients.clients--after-film.page-panel {
	position: relative;
	z-index: 2;
	display: block !important;
	width: 100%;
	max-width: none;
	min-height: 0;
	margin: 0;
	padding: clamp(32px, 4vw, 56px) 0 0 !important;
	border-radius: 0;
	background: #fff !important;
}

main#top .clients.clients--on-video.page-panel {
	margin-top: calc(-1 * var(--clients-scroll-height));
	padding: 26svh 0 22svh !important;
	background: transparent !important;
}

.clients--on-video .clients__surface {
	position: sticky;
	top: 42svh;
}

.clients.page-panel .clients__surface {
	width: min(82%, 1120px);
	max-width: 1120px;
}

.clients.page-panel .clients__label {
	color: var(--client-label-color, #3f494b);
	text-align: right;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	margin: 0 0 10px !important;
}

.clients.page-panel .clients__panel {
	padding: 6px 0;
	border-radius: 0;
	background: transparent;
	overflow: hidden;
}

.clients.page-panel .client-mark {
	height: 72px;
	min-height: 72px;
	padding-block: 4px;
}

.clients.page-panel .clients__ribbons {
	display: block;
}

.clients.page-panel .clients__track {
	animation-direction: normal;
}

/* Small soft edges let marks enter and leave without a hard clipped boundary. */
.clients.page-panel .clients__ribbon {
	-webkit-mask-image: linear-gradient(
		to right,
		transparent,
		#000 3%,
		#000 97%,
		transparent
	);
	mask-image: linear-gradient(
		to right,
		transparent,
		#000 3%,
		#000 97%,
		transparent
	);
}

.clients.page-panel .clients__grid {
	flex-wrap: nowrap;
	justify-content: flex-start;
	overflow-x: auto;
}

/* Services continue on the same white page below the studio. */
main#top .services.services--on-white.page-panel {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: none;
	margin-top: 0;
	margin-inline: 0;
	padding: var(--section-pad-block) var(--section-edge) !important;
	border-radius: 0;
	background: #fff !important;
}

main#top
	.services.page-panel
	:is(.services__intro, .service-grid, .services__footer) {
	width: calc(100% - var(--section-pad) * 2);
	max-width: calc(1600px - var(--section-pad) * 2);
	margin-inline: auto;
}

main#top .editorial-break.page-panel {
	border-radius: var(--section-radius);
}

main#top .apex-contact {
	padding-inline: 0;
}

main#top .contact-layout.page-panel {
	border-radius: 0;
}

@media (max-width: 480px) {
	:root {
		--section-edge: 20px;
		--section-pad: 22px;
		--section-pad-block: 36px;
		--section-space: 32px;
	}

	.apex-choice--statement h2 {
		font-size: clamp(2rem, 8vw, 2.5rem);
	}

	.clients.page-panel .clients__surface {
		width: calc(100% - 32px);
	}
}
