/*
 * FUSS v2 project pages: hero, intro and specs, stats, blocks, closing credits.
 * The page sits inside the rounded right panel. Its colours come from the
 * project (--cs-page, --cs-page-ink, printed by inc/v2.php).
 */

.cs {
	container-type: inline-size;
	container-name: cs;
	--cs-ink: #121117;
	--cs-cream: #fafbf7;
	--cs-line: color-mix(in srgb, currentColor 14%, transparent);
	--cs-pad: clamp(20px, 4.4cqw, 72px);
	--cs-gap: clamp(32px, 5cqw, 88px);
	--cs-g: clamp(8px, 1.15cqw, 16px);
	--cs-r: 3px;
	position: relative;
	background: var(--cs-page, #fafbf7);
	color: var(--cs-page-ink, #121117);
	font-family: "Faktum";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: geometricPrecision;
	overflow: clip;
}

:where(.cs) a {
	color: inherit;
}

:where(.cs) p {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

.csWrap {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 var(--cs-pad);
	box-sizing: border-box;
}

.csSection {
	padding: clamp(72px, 9cqw, 152px) 0;
}

/* ---------- Colour themes (stats band) ---------- */

.cs-theme-light { background: var(--cs-page, #fafbf7); color: var(--cs-page-ink, #121117); }
.cs-theme-white { background: #fff; color: var(--cs-ink); }
.cs-theme-dark { background: var(--cs-ink); color: var(--cs-cream); }
.cs-theme-brand { background: var(--cs-c1, #0029FF); color: var(--cs-t1, #fff); }
.cs-theme-brand2 { background: var(--cs-c2, #00F5C3); color: var(--cs-t2, #121117); }
.cs-theme-brand3 { background: var(--cs-c3, #FFE400); color: var(--cs-t3, #121117); }

/* ---------- Type ---------- */

.csEyebrow {
	margin: 0 0 clamp(18px, 2cqw, 28px);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .72;
}

.csStatement {
	margin: 0;
	font-size: clamp(36px, 4.3cqw, 72px);
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.csHeading {
	margin: 0;
	font-size: clamp(30px, 3.4cqw, 56px);
	font-weight: 400;
	line-height: 1.04;
	letter-spacing: -0.022em;
	text-wrap: balance;
}

.csBody {
	font-size: clamp(16px, 1.25cqw, 19px);
	line-height: 1.5;
	letter-spacing: -0.005em;
}

.csBody p + p {
	margin-top: 1em;
}

.csBody a {
	text-decoration: underline;
	text-decoration-thickness: from-font;
	text-underline-position: from-font;
}

.csHeading + .csBody,
.csStatement + .csBody {
	margin-top: clamp(20px, 2.2cqw, 32px);
}

/* ---------- Hero ---------- */

.csHero {
	position: relative;
	background: var(--cs-stage, #eeefe8);
	line-height: 0;
}

.csHeroWide video,
.csHeroTall video,
.csHeroImage {
	display: block;
	width: 100%;
	height: auto;
	background: var(--cs-stage, #eeefe8);
}

.csHeroWide video {
	aspect-ratio: 16 / 9;
}

.csHeroTall {
	display: none;
}

.csHeroTall video {
	aspect-ratio: 9 / 16;
}

.csPause {
	position: absolute;
	right: 16px;
	bottom: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 28px;
	padding: 0 12px;
	border: 1px solid rgba(18, 17, 23, .18);
	border-radius: 186px;
	background: rgba(250, 251, 247, .78);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: var(--cs-ink);
	font-family: "Faktum";
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	transition: opacity .25s;
}

.csHero:hover .csPause,
.csPause:focus-visible,
.csPause[aria-pressed="true"] {
	opacity: 1;
}

.csPauseIcon {
	position: relative;
	width: 8px;
	height: 9px;
	border-left: 2.5px solid currentColor;
	border-right: 2.5px solid currentColor;
	box-sizing: border-box;
}

.csPause[aria-pressed="true"] .csPauseIcon {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent currentColor;
}

/* Vimeo and YouTube films play like GIFs: no controls, nothing to click. */
.csEmbed {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
	isolation: isolate;
}

.csEmbed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	pointer-events: none;
}

/* ---------- Intro and specs ---------- */

.csIntroGrid {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--cs-gap);
	align-items: start;
}

.csIntroSide .csBody {
	max-width: 30em;
}

.csFacts {
	margin: clamp(28px, 3cqw, 44px) 0 0;
	padding: 0;
}

.csIntroSide .csFacts:first-child,
.csCtaGrid .csFacts {
	margin-top: 0;
}

.csFact {
	display: flex;
	justify-content: space-between;
	gap: 24px;
	padding: 13px 0 12px;
	border-top: 1px solid var(--cs-line);
	font-size: 14px;
	line-height: 1.35;
}

.csFact:last-child {
	border-bottom: 1px solid var(--cs-line);
}

/* A long label wraps before a short value does; a long value wraps within three quarters of the row. */
.csFact dt {
	flex: 0 1 auto;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .6;
	padding-top: 1px;
}

.csFact dd {
	flex: 0 0 auto;
	max-width: 75%;
	margin: 0;
	text-align: right;
}

.csFact a {
	text-decoration: underline;
	text-decoration-thickness: from-font;
	text-underline-position: from-font;
}

.csFact a:hover {
	opacity: .65;
}

/* Credits that share a role read as one group. */
.csCredits .csFact.is-same-role {
	border-top-color: transparent;
	margin-top: -8px;
}

/* ---------- Stats ---------- */

.csStats {
	--cs-line: color-mix(in srgb, currentColor 30%, transparent);
}

.csStatList {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
	gap: clamp(28px, 3cqw, 48px) clamp(20px, 2.4cqw, 40px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.csStat {
	display: flex;
	flex-direction: column;
	padding-top: clamp(18px, 2cqw, 26px);
	border-top: 1px solid var(--cs-line);
}

.csStatValue {
	font-size: clamp(44px, 6cqw, 104px);
	font-weight: 500;
	line-height: .92;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.csStatLabel {
	margin-top: clamp(14px, 1.6cqw, 22px);
	max-width: 17em;
	font-size: clamp(15px, 1.1cqw, 17px);
	line-height: 1.35;
}

.csStatNote {
	margin-top: 10px;
	font-size: 12px;
	line-height: 1.4;
	opacity: .62;
}

/* ---------- Blocks: full width, side by side, text, grid ---------- */

.csBlocks {
	display: flex;
	flex-direction: column;
	gap: var(--cs-g);
	padding: var(--cs-g);
}

.csBlock {
	margin: 0;
	min-width: 0;
}

.csMedia {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--cs-r);
}

video.csMedia {
	background: color-mix(in srgb, currentColor 6%, transparent);
}

.csSplit {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--cs-g);
	align-items: center;
}

.csCell {
	display: flex;
	flex-direction: column;
	gap: var(--cs-g);
	min-width: 0;
}

.cs-shape-square { --shape: 1 / 1; }
.cs-shape-portrait { --shape: 4 / 5; }
.cs-shape-tall { --shape: 9 / 16; }
.cs-shape-wide { --shape: 16 / 9; }

.has-shape .csMedia {
	aspect-ratio: var(--shape);
	height: auto;
	object-fit: cover;
}

.csTextCell {
	padding: clamp(24px, 4cqw, 64px) clamp(8px, 2.4cqw, 40px);
}

.csTextCell .csBody {
	max-width: 30em;
}

.csTextBlock {
	padding: clamp(48px, 7cqw, 120px) max(0px, calc(var(--cs-pad) - var(--cs-g)));
}

.csTextBlock .csHeading {
	max-width: 18em;
}

.csTextBlock .csBody {
	max-width: 36em;
}

.csGrid {
	display: grid;
	grid-template-columns: repeat(var(--cs-cols, 4), minmax(0, 1fr));
	gap: clamp(6px, .7cqw, 12px);
}

.csTile {
	margin: 0;
	overflow: hidden;
	line-height: 0;
}

.csTile img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.csGrid-tiles .csTile {
	border-radius: var(--cs-r);
	background: #fff;
}

.csGrid-tiles .csTile img,
.csGrid-bleed .csTile img {
	aspect-ratio: 1;
	object-fit: cover;
}

.csGrid-tiles .csTile:hover img {
	transform: scale(1.06);
}

.csGrid-framed .csTile {
	border-radius: var(--cs-r);
}

.csGrid-bleed {
	gap: 0;
	margin: 0 calc(var(--cs-g) * -1);
}

/* ---------- Instagram posts: square videos in Instagram's own frame ---------- */

.csInsta {
	display: grid;
	grid-template-columns: repeat(var(--cs-insta, 3), minmax(0, 440px));
	justify-content: center;
	gap: clamp(12px, 2cqw, 32px);
	padding: clamp(32px, 5cqw, 88px) 0;
}

.csInstaPost {
	overflow: hidden;
	border: 1px solid #dbdbdb;
	border-radius: var(--cs-r);
	background: #fff;
	color: #000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 18px;
}

.csInstaHead {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 8px 10px 12px;
}

.csInstaAvatar {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.csInstaHandle {
	font-weight: 600;
}

.csInstaIcon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
}

.csInstaHead .csInstaIcon {
	margin-left: auto;
}

.csInstaMedia {
	line-height: 0;
}

.csInstaMedia .csMedia {
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 0;
}

.csInstaActions {
	display: flex;
	gap: 16px;
	padding: 10px 12px 12px;
}

.csInstaActions .is-save {
	margin-left: auto;
}

/* ---------- Closing and credits ---------- */

.csCtaGrid {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--cs-gap);
	align-items: end;
}

.csButton {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: clamp(28px, 3cqw, 40px);
	padding: 15px 24px;
	border-radius: 186px;
	background: var(--cs-page-ink, #121117);
	color: var(--cs-page, #fafbf7) !important;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	transition: transform .2s, background-color .2s;
}

.csEyebrow + .csButton {
	margin-top: 0;
}

/* Credits without a heading: the label sits level with the first row. */
.csCtaGrid.is-credits {
	align-items: start;
}

.csCtaGrid.is-credits .csEyebrow {
	margin: 0;
	padding-top: 14px;
}

.csButton::after {
	content: '';
	width: 9px;
	height: 9px;
	border-top: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.csButton:hover {
	background: var(--cs-c1, #0029FF);
	color: var(--cs-t1, #fff) !important;
}

/* ---------- Next project ---------- */

.csNext {
	display: block;
	padding: clamp(56px, 7cqw, 112px) var(--cs-pad) clamp(64px, 8cqw, 128px);
	border-top: 1px solid var(--cs-line);
	color: inherit !important;
	text-decoration: none;
}

.csNextTitle {
	display: inline-block;
	font-size: clamp(48px, 7.5cqw, 132px);
	line-height: .95;
	letter-spacing: -0.035em;
	transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}

.csNext:hover .csNextTitle {
	transform: translateX(14px);
}

.csNext .csEyebrow {
	display: block;
}

/* ---------- Reveal on scroll ---------- */

.cs.has-reveal [data-reveal] {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
	transition-delay: var(--d, 0s);
}

.cs.has-reveal [data-reveal].is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.cs.has-reveal [data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.csTile img,
	.csNextTitle {
		transition: none;
	}
}

/* ---------- The older (dark) layout, while the new design is off ---------- */

body:not(.fuss-v2) .cs {
	min-height: 100vh;
}

/* ---------- Narrow screens ---------- */

@container cs (max-width: 860px) {
	.csIntroGrid,
	.csCtaGrid {
		grid-template-columns: minmax(0, 1fr);
		gap: 36px;
	}
}

@container cs (max-width: 600px) {
	.csHero:has(.csHeroTall) .csHeroWide {
		display: none;
	}

	.csHeroTall {
		display: block;
	}

	.csPause {
		opacity: 1;
	}

	/* Text next to media stacks; two pieces of media stay side by side. */
	.csSplit:has(.csTextCell) {
		grid-template-columns: minmax(0, 1fr);
	}

	.csGrid {
		grid-template-columns: repeat(min(var(--cs-cols, 4), 4), minmax(0, 1fr));
	}

	.csGrid-framed {
		grid-template-columns: repeat(min(var(--cs-cols, 4), 2), minmax(0, 1fr));
	}

	/* Instagram posts swipe sideways, like a feed, with the next post peeking in. */
	.csInsta {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 80%;
		justify-content: start;
		gap: 10px;
		margin: 0 calc(var(--cs-g) * -1);
		padding: 24px var(--cs-g);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding: 0 var(--cs-g);
		scrollbar-width: none;
	}

	.csInsta::-webkit-scrollbar {
		display: none;
	}

	.csInstaPost {
		scroll-snap-align: start;
	}

	.csFact {
		font-size: 13px;
	}
}
