@font-face {
	font-family: "Space Grotesk";
	src: url("../assets/fonts/SpaceGrotesk.ttf") format("truetype");
	font-weight: 300 700;
	font-display: swap;
}
@font-face {
	font-family: "Geist";
	src: url("../assets/fonts/geist-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}
@font-face {
	font-family: "Geist Mono";
	src: url("../assets/fonts/geist-mono-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

:root {
	--logo-ink: #171717;
	--logo-copper: #bc563d;
	--copper: #bc563d;
	--copper-ink: #ffffff;
	--paper: #f7f8fa;
	--white: #ffffff;
	--ink: #171b22;
	--muted: #596472;
	--line: #d9dde3;
	--guide: rgba(112, 124, 140, 0.18);
	--dot: rgba(112, 124, 140, 0.3);

	/* content column: 5% side margins, max 1320px */
	--gutter: max(5%, calc((100% - 1320px) / 2));
	--rail-offset: 20px;
	--header-h: 80px;

	/* novascale-site 5 palette, used by the promise and the request form */
	--s5-ink: #171717;
	--s5-soft: #6b6762;
	--s5-faint: #9a958f;
	--s5-line-strong: #cfcac5;
	--sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--ease: cubic-bezier(.2, 0, 0, 1);

	/* dotted fabric colours (site 5's), read by js/fabric-scenes.js */
	--nf-paper: #f7f8fa;
	--nf-ink: #171717;
	--nf-soft: #6b6762;
	--nf-faint: #9a958f;
	--nf-line-strong: #cfcac5;
	--nf-copper-ink: #ffffff;
	--nf-copper-rgb: 188 86 61;
	--nf-red-rgb: 214 28 47;
	--nf-dust-rgb: 21 21 21;
	--nf-dust-alpha: .64;

	/* act 1 progress, set by js/hero-fabric.js: --p runs 0 → 1 as the hero hands over to
	   the promise; --g grows the field, --w brings the words in */
	--p: 0;
	--g: min(1, var(--p) / .45);
	--w: clamp(0, (var(--p) - .6) / .3, 1);
}

/* snap between the hero and the promise, as site 5 does */
html {
	scroll-snap-type: y mandatory;
	scroll-padding-top: var(--header-h);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
	position: relative;
	min-height: 100vh;
	font-family: "Space Grotesk", Arial, sans-serif;
	font-size: 16px;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.skip {
	position: absolute;
	left: 16px;
	top: -60px;
	z-index: 50;
	padding: 10px 14px;
	border-radius: 6px;
	background: var(--ink);
	color: var(--white);
}
.skip:focus { top: 12px; }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- page guides: dashed vertical rails just outside the content column ---------- */
.page-rails {
	position: absolute;
	inset: 0 calc(var(--gutter) - var(--rail-offset));
	z-index: 25;
	pointer-events: none;
	opacity: calc(1 - var(--g));
	background:
		repeating-linear-gradient(var(--guide) 0 10px, transparent 10px 20px) left top / 0.75px 20px repeat-y,
		repeating-linear-gradient(var(--guide) 0 10px, transparent 10px 20px) right top / 0.75px 20px repeat-y;
}

/* ---------- header ---------- */
.header-band {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--paper);
}
/* dashed rule under the header, with gaps where it crosses the rails */
.header-band::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 0.75px;
	background: repeating-linear-gradient(to right, var(--guide) 0 10px, transparent 10px 20px);
	--r: calc(var(--gutter) - var(--rail-offset));
	-webkit-mask: linear-gradient(to right, #000 calc(var(--r) - 8px), transparent 0 calc(var(--r) + 8px), #000 0 calc(100% - var(--r) - 8px), transparent 0 calc(100% - var(--r) + 8px), #000 0);
	mask: linear-gradient(to right, #000 calc(var(--r) - 8px), transparent 0 calc(var(--r) + 8px), #000 0 calc(100% - var(--r) - 8px), transparent 0 calc(100% - var(--r) + 8px), #000 0);
}

.site-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: var(--header-h);
	margin-inline: var(--gutter);
	padding-bottom: 1px;
}

.header-lead { display: flex; align-items: center; gap: 18px; min-width: 0; }

/* logo from novascale-site 5: CSS mark + "novascale" in Geist */
.brand {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 44px;
	flex: 0 0 auto;
	font-family: "Geist", "Space Grotesk", system-ui, sans-serif;
	font-size: 30px;
	font-weight: 580;
	letter-spacing: -0.06em;
	line-height: 1;
	color: var(--logo-ink);
}
.nsmark {
	--u: calc(1em / 64); /* the mark is drawn on a 64-unit grid */
	position: relative;
	flex: none;
	width: 1em;
	height: 1em;
	margin-left: calc(-10 * var(--u));
	transform: translateY(1px);
}
.nsmark-c, .nsmark-p { position: absolute; }
.nsmark-c { width: calc(24 * var(--u)); height: calc(24 * var(--u)); }
.nsmark-c b { position: absolute; background: currentColor; }
.nsmark-h { width: calc(24 * var(--u)); height: calc(8 * var(--u)); }
.nsmark-v { width: calc(8 * var(--u)); height: calc(24 * var(--u)); }
.nsmark-tl { left: calc(10 * var(--u)); top: calc(10 * var(--u)); --dx: -14; }
.nsmark-tl b { left: 0; top: 0; }
.nsmark-br { right: calc(10 * var(--u)); bottom: calc(10 * var(--u)); --dx: 14; }
.nsmark-br b { right: 0; bottom: 0; }
.nsmark-p {
	left: calc(30 * var(--u));
	top: calc(30 * var(--u));
	width: calc(12 * var(--u));
	height: calc(12 * var(--u));
	background: var(--logo-copper);
}
.nsmark-c { animation: nsmark-close .72s cubic-bezier(.2, 0, 0, 1) .18s both; }
.nsmark-p { animation: nsmark-settle .48s cubic-bezier(.2, 0, 0, 1) .62s both; }
@keyframes nsmark-close {
	from { opacity: .4; transform: translate(calc(var(--dx) * var(--u)), calc(var(--dx) * var(--u))); }
	to { opacity: 1; transform: none; }
}
@keyframes nsmark-settle {
	from { opacity: .8; transform: scale(.84); }
	to { opacity: 1; transform: none; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 450;
	line-height: 21px;
	white-space: nowrap;
	transition: box-shadow .16s ease, filter .16s ease, border-color .16s ease, transform .16s ease;
}
.button:active { transform: translateY(1px); }

/* copper button, exactly as novascale-site 5 (.button + .button-copper) */
.button-copper {
	gap: 22px;
	height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 2px;
	font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.55;
	color: var(--copper-ink);
	background: var(--copper);
	transition: background .16s, color .16s;
}
.button-copper:hover { background: color-mix(in srgb, var(--copper) 86%, var(--logo-ink)); }
.button-copper:active { transform: none; }
.button .icon {
	flex: none;
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linejoin: round;
	stroke-linecap: round;
	transition: transform .22s cubic-bezier(.2, 0, 0, 1);
}
.button:hover .icon { transform: translate(2px, -2px); }
/* hero size (site 5's .hero-actions .button) */
.hero-actions .button-copper { height: 52px; padding: 0 22px; gap: 34px; }

/* ---------- hero ---------- */
/* the field canvas sits behind the page; the header's paper covers it */
.world {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}
.world canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
main { position: relative; z-index: 1; }

.act1 { position: relative; height: 160vh; }
.act1, .act-mark { scroll-snap-align: start; }
.act-mark { position: absolute; top: calc(100% - 100vh); height: 1px; }

.hero-band {
	position: sticky;
	top: var(--header-h);
	height: calc(100vh - var(--header-h));
	overflow: hidden;
}
/* fine dot grid between the rails */
.hero-band::before {
	content: "";
	position: absolute;
	inset: 1px calc(var(--gutter) - var(--rail-offset) + 1px);
	background: radial-gradient(circle, var(--dot) 0.45px, transparent 0.5px) 0 0 / 10px 10px;
	pointer-events: none;
	opacity: calc(1 - var(--g));
}

.hero {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 48px;
	height: 100%;
	margin-inline: var(--gutter);
	padding-block: 32px;
}

.hero-copy {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	opacity: calc(1 - var(--g) * 4);
	transform: translateY(calc(var(--g) * -40px));
}
.past-hero .hero-copy { pointer-events: none; }

h1 {
	margin: 0;
	font-size: clamp(38px, 3.3vw, 48px);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.035em;
	white-space: nowrap;
}

/* the three lines share one cell and cross-fade */
.rotator {
	position: relative;
	display: grid;
	max-width: 100%;
	margin: 20px 0 0;
	font-size: 17px;
	line-height: 1.6;
	color: var(--muted);
}
.rotator-line {
	grid-area: 1 / 1;
	opacity: 0;
	transition: opacity .45s ease;
}
.rotator-line.is-active { opacity: 1; }
.rotator canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.hero-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}

.fabric {
	position: relative;
	z-index: 1;
	align-self: center;
	width: 117%;
	max-height: calc(100vh - var(--header-h) - 65px);
	aspect-ratio: 730 / 845;
	margin-left: -10%;
}

/* starts on the .fabric box (insets measured by JS) and grows to the whole band */
.stage-grow {
	position: absolute;
	top: calc(var(--s0-top, 0px) * (1 - var(--g)));
	right: calc(var(--s0-right, 0px) * (1 - var(--g)));
	bottom: calc(var(--s0-bottom, 0px) * (1 - var(--g)));
	left: calc(var(--s0-left, 0px) * (1 - var(--g)));
	z-index: 1;
	display: grid;
	place-items: center;
	overflow: hidden;
	pointer-events: none;
}

/* the promise (site 5's .words) */
.words {
	display: grid;
	gap: 18px;
	justify-items: center;
	max-width: 820px;
	padding: 8px 12px;
	text-align: center;
	font-family: var(--sans);
	color: var(--s5-ink);
	opacity: var(--w);
	transform: translateY(calc((1 - var(--w)) * 28px));
}
.words h2 {
	max-width: 16ch;
	margin: 0;
	font-size: clamp(34px, 4vw, 60px);
	font-weight: 450;
	line-height: 1.02;
	letter-spacing: -.045em;
	text-wrap: balance;
}
.words p {
	max-width: 52ch;
	margin: 0;
	font-size: 17px;
	line-height: 1.6;
	color: var(--s5-soft);
	text-wrap: pretty;
}
.label {
	display: flex;
	justify-content: center;
	gap: 12px;
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--s5-soft);
}
.label b { font-weight: 500; color: var(--copper); }


/* ---------- tablet & phone ---------- */
@media (width <= 900px) {
	:root { --header-h: 64px; }

	.page-rails { display: none; }
	.header-band::after { -webkit-mask: none; mask: none; }

	.site-header { gap: 12px; }
	.brand { gap: 8px; font-size: 26px; }


	.hero-band::before { inset: 1px 0; }
	.hero {
		grid-template-columns: 1fr;
		grid-template-rows: auto minmax(0, 1fr);
		row-gap: 20px;
		margin-inline: 20px;
		padding-block: 36px 28px;
	}
	.hero-copy { display: block; }
	h1 { font-size: clamp(32px, 9.4vw, 42px); white-space: normal; }
	.rotator { max-width: 440px; margin-top: 16px; font-size: 16px; }

	.fabric {
		width: 100%;
		height: clamp(300px, 82vw, 370px);
		max-height: none;
		aspect-ratio: auto;
		align-self: start;
		margin-left: 0;
	}
}

@media (width <= 600px) {
	.header-cta { gap: 14px; padding: 0 14px; font-size: 14px; }
	.rotator { margin-top: 18px; }
	.hero-actions { flex-wrap: wrap; gap: 10px; }
	.words { padding-inline: 24px; }
}

@media (width <= 380px) {
	.header-cta .icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.rotator-line { transition: none; }
	.nsmark-c, .nsmark-p { animation: none; }
}

/* ---------- early access: site 5's request form, in a dialog ---------- */
:root { --s5-line: #e6e2df; --s5-red: #d61c2f; }

.request-dialog {
	width: min(720px, calc(100% - 32px));
	max-width: none;
	max-height: calc(100dvh - 48px);
	padding: clamp(40px, 6vw, 64px) clamp(24px, 6vw, 56px) clamp(32px, 5vw, 48px);
	border: 0;
	border-radius: 2px;
	background: #ffffff;
	color: var(--s5-ink);
	font-family: var(--sans);
	box-shadow: 0 24px 80px rgba(23, 23, 23, .18);
	overflow: auto;
	overscroll-behavior: contain;
}
.request-dialog::backdrop {
	background: rgba(23, 23, 23, .28);
	backdrop-filter: blur(3px);
}
.request-dialog[open] { animation: request-in .32s var(--ease); }
@keyframes request-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}
html:has(.request-dialog[open]) { overflow: hidden; }

.request-close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: none;
	color: var(--s5-soft);
	cursor: pointer;
	transition: color .16s, background .16s;
}
.request-close:hover { color: var(--s5-ink); background: color-mix(in srgb, var(--s5-ink) 5%, transparent); }
.request-close:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.request-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.request-form { display: grid; gap: 56px; }
.request-form fieldset { display: grid; gap: 20px; min-width: 0; margin: 0; padding: 0; border: 0; }
.request-form legend { margin-bottom: 18px; padding: 0; font-size: 20px; letter-spacing: -.015em; color: var(--s5-ink); }
.q-n { margin-right: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--copper); vertical-align: 3px; }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-top: 1px solid var(--s5-line); }
.opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 15px 0;
	border-bottom: 1px solid var(--s5-line);
	font-size: 15px;
	color: var(--s5-soft);
	cursor: pointer;
	transition: color .22s var(--ease);
}
.opt input { position: absolute; width: 0; height: 0; opacity: 0; }
.opt i { flex: none; width: 7px; height: 7px; border: 1px solid var(--s5-faint); transition: background .22s var(--ease), border-color .22s var(--ease); }
.opt:hover { color: var(--s5-ink); }
.opt:hover i { border-color: var(--s5-soft); }
.opt:has(input:checked) { color: var(--s5-ink); }
.opt:has(input:checked) i { background: var(--copper); border-color: var(--copper); }
.opt:has(input:focus-visible) { outline: 2px solid var(--copper); outline-offset: 2px; }

.field { display: grid; gap: 2px; min-width: 0; }
.field > span { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--s5-faint); }
.field input, .field textarea {
	width: 100%;
	padding: 10px 0;
	border: 0;
	border-bottom: 1px solid var(--s5-line);
	border-radius: 0;
	background: none;
	font: inherit;
	font-size: 16px;
	color: var(--s5-ink);
	resize: none;
	field-sizing: content;
	transition: border-color .22s var(--ease);
}
.field input:hover, .field textarea:hover { border-bottom-color: var(--s5-line-strong); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--copper); }
.field input::placeholder, .field textarea::placeholder { color: var(--s5-faint); }
.field input[aria-invalid="true"] { border-bottom-color: var(--s5-red); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }

.request-form .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin: 0; }
.request-form .button-copper { cursor: pointer; }

@media (width <= 879px) {
	.request-form { gap: 44px; }
	.field-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (width <= 420px) {
	.opts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	.request-dialog[open] { animation: none; }
}
