:root {
	--paper: #f4f9fe;
	--paper-deep: #e3effb;
	--art: #ddd3bc;
	--ink: #0e2a47;
	--ink-soft: #48627f;
	--rule: #c5d8ec;
	--accent: #1a66cc;
	--amber: #2f80ed;
	--card-ink: #0e2a47;
	--screening: #d9e9f9;
	--screening-ink: #0e2a47;
	--screening-soft: #48627f;
	--display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
	color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.7 var(--body);
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

img, video, canvas { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 0.6em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.75rem); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.prose { max-width: 70ch; }

.band { padding: clamp(56px, 9vw, 112px) 0; }
.band.paper { background: var(--paper-deep); }

.reel {
	font: 600 0.78rem/1 var(--body);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--accent);
	margin-bottom: 1.2em;
}

/* The header: the painted studio lot, then a silent-film title card. */
.hero { background: var(--paper); }
.hero canvas { width: 100%; height: auto; max-width: 1820px; margin: 0 auto; }

.title-card {
	position: relative;
	max-width: 820px;
	margin: clamp(-120px, -7vw, -24px) auto 0;
	padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 56px);
	background: rgb(255 255 255 / 0.74);
	-webkit-backdrop-filter: blur(18px) saturate(1.2);
	backdrop-filter: blur(18px) saturate(1.2);
	border: 1px solid rgb(255 255 255 / 0.9);
	border-radius: 24px;
	color: var(--card-ink);
	text-align: center;
	box-shadow: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 24px 60px rgb(14 42 71 / 0.18);
}
.title-card .kicker {
	display: inline-block;
	font: 600 0.75rem/1 var(--body);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--amber);
	padding: 0.5em 0.9em;
	border: 1px solid rgb(47 128 237 / 0.35);
	background: rgb(47 128 237 / 0.08);
	border-radius: 999px;
	margin-bottom: 1.4em;
}
.title-card h1 {
	font-size: clamp(2.5rem, 7vw, 4.6rem);
	font-weight: 750;
	letter-spacing: -0.045em;
	line-height: 1.02;
	margin-bottom: 0.45em;
}
.title-card .lede { font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.6; color: var(--ink-soft); max-width: 54ch; margin: 0 auto 1.8em; }
@media (max-width: 719px) { .title-card { margin: 0 16px; } }

.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; position: relative; }
.prose .cta { justify-content: flex-start; margin-top: 1.5em; }

.button {
	display: inline-block;
	padding: 0.8em 1.3em;
	border: 1px solid rgb(127 127 127 / 0.45);
	border-radius: 12px;
	color: inherit;
	text-decoration: none;
	font: 600 0.95rem/1 var(--body);
	transition: background-color 0.15s, border-color 0.15s;
}
.button:hover { background: rgb(47 128 237 / 0.1); border-color: var(--amber); }
.button.primary { background: var(--amber); border-color: var(--amber); color: #fff; }
.button.primary:hover { background: #1f6fd8; border-color: #1f6fd8; }

/* How it works */
.steps { list-style: none; padding: 0; margin: 2.5em 0 0; display: grid; gap: 24px; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
.step {
	counter-increment: step;
	background: var(--paper);
	padding: 28px;
	border-radius: 20px;
	border: 1px solid var(--rule);
	min-width: 0;
}
.step h3::before { content: counter(step) "  "; color: var(--accent); font-variant-numeric: tabular-nums; }
.step p { margin-bottom: 0; }
.step.wide {
	grid-column: 1 / -1;
	display: grid;
	gap: 24px;
	align-items: center;
	background:
		radial-gradient(55% 75% at 88% 12%, rgb(80 150 255 / 0.4), transparent 70%),
		radial-gradient(45% 70% at 55% 105%, rgb(90 210 230 / 0.4), transparent 70%),
		var(--paper);
}
@media (min-width: 900px) { .step.wide { grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); padding: 32px; } }

/* A glass terminal window around each code sample. */
.term {
	margin: 0;
	min-width: 0;
	border-radius: 14px;
	overflow: hidden;
	background: rgb(12 22 40 / 0.86);
	-webkit-backdrop-filter: blur(20px) saturate(1.4);
	backdrop-filter: blur(20px) saturate(1.4);
	border: 1px solid rgb(255 255 255 / 0.14);
	box-shadow: 0 1px 0 rgb(255 255 255 / 0.08) inset, 0 20px 50px rgb(14 42 71 / 0.25);
}
.term-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 11px 14px;
	background: rgb(255 255 255 / 0.05);
	border-bottom: 1px solid rgb(255 255 255 / 0.08);
}
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.term-title { font: 500 0.75rem/1 var(--mono); color: rgb(255 255 255 / 0.55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term pre {
	margin: 0;
	padding: 18px 20px 20px;
	overflow-x: auto;
	color: #e6e1d8;
	font: 400 0.78rem/1.7 var(--mono);
	font-variant-ligatures: none;
	tab-size: 4;
}
.term .k { color: #ff7ab2; }
.term .f { color: #7dd3fc; }
.term .t { color: #c4b5fd; }
.term .s { color: #b5e48c; }
.term .d { color: #fbbf24; }
.term .n { color: #7dd3fc; }
.term .h { color: #fbbf24; font-weight: 600; }
.term .c { color: #7d8ca3; font-style: italic; }
code { font-family: var(--mono); font-size: 0.88em; }

/* What it unlocks */
.cards { list-style: none; padding: 0; margin: 2.5em 0 0; display: grid; gap: 20px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards li { border: 1px solid var(--rule); border-radius: 18px; padding: 24px; background: var(--paper); min-width: 0; }
.cards li:has(.looks) { grid-column: 1 / -1; }
.cards p:last-child { margin-bottom: 0; }

.tag {
	display: inline-block;
	font: 600 0.7rem/1 var(--body);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.5em 0.8em;
	border-radius: 999px;
	margin-bottom: 1em;
}
.tag.shown { background: var(--ink); color: var(--paper); }
.tag.bet { border: 1px dashed var(--ink-soft); color: var(--ink-soft); }

.looks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 1.2em; }
.looks img, .pair video, .grid4 img, .grid3 img, .demo { border-radius: 12px; }
figure { margin: 0; }
figcaption { font: 400 0.8rem/1.4 var(--mono); color: var(--ink-soft); margin-top: 0.5em; }

/* The screening room: the player */
.screening { background: var(--screening); color: var(--screening-ink); }
.screening a { color: var(--amber); }
.screening .reel { color: var(--amber); }
.screening figcaption, .screening .tape-file p { color: var(--screening-soft); }

.player { margin: 2.5em 0 4em; }
.screen {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
	border-radius: 16px;
	box-shadow: 0 0 0 1px #b9cfe6, 0 30px 70px rgb(14 42 71 / 0.25);
}
.screen .clip, .screen .key { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen .key { z-index: 1; }
.screen.playing .key { visibility: hidden; }
.hotspots { position: absolute; inset: 0; z-index: 2; }
.hotspot {
	position: absolute;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	border-radius: 4px;
}
.screen:hover .hotspot { outline: 1px dashed rgb(120 180 255 / 0.8); outline-offset: 2px; }
.screen .hotspot:hover, .hotspot:focus-visible { outline: 2px solid #7db8ff; outline-offset: 2px; }
.show-hotspots .hotspot { outline: 2px dashed #7db8ff; background: rgb(47 128 237 / 0.16); }
.hotspot:hover::after, .hotspot:focus-visible::after {
	content: attr(data-label);
	position: absolute;
	left: 0;
	top: 100%;
	margin-top: 4px;
	white-space: nowrap;
	font: 600 11px/1.3 var(--mono);
	background: var(--ink);
	color: #fff;
	padding: 2px 6px;
	pointer-events: none;
}

.start {
	position: absolute;
	z-index: 3;
	left: 50%;
	top: 50%;
	translate: -50% -50%;
	padding: 0.9em 1.6em;
	border: 1px solid rgb(255 255 255 / 0.9);
	border-radius: 999px;
	background: rgb(255 255 255 / 0.78);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	color: var(--card-ink);
	font: 600 clamp(0.9rem, 2.5vw, 1.1rem)/1 var(--display);
	white-space: nowrap;
	cursor: pointer;
}
.start:hover { background: var(--amber); color: #fff; border-color: var(--amber); }
.start[hidden] { display: none; }

.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 16px; }
.group { display: flex; flex-wrap: wrap; gap: 8px; }
.controls button, .tabs button {
	font: 600 0.85rem/1 var(--body);
	padding: 0.65em 1em;
	background: transparent;
	color: inherit;
	border: 1px solid rgb(127 127 127 / 0.5);
	border-radius: 10px;
	cursor: pointer;
}
.controls button[aria-pressed="true"] { background: var(--amber); color: #fff; border-color: var(--amber); }
.controls button:disabled { opacity: 0.4; cursor: default; }
.typing { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.typing[hidden] { display: none; }
.typing label { font: 600 0.85rem/1 var(--body); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.typing input {
	font: 400 1rem/1 var(--body);
	padding: 0.45em 0.6em;
	background: #fff;
	color: var(--screening-ink);
	border: 1px solid var(--screening-soft);
	border-radius: 10px;
	width: 14em;
	max-width: 100%;
}

.tape-file { margin-top: 18px; font-size: 0.95rem; }
.tape-file summary { cursor: pointer; }
.tape-file code { color: var(--amber); }
.words { list-style: none; padding: 0; margin: 0.6em 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.words li { font: 400 0.8rem/1.3 var(--mono); padding: 0.4em 0.7em; border: 1px solid var(--rule); background: rgb(255 255 255 / 0.6); border-radius: 8px; }

.demo { width: 100%; aspect-ratio: 16 / 9; background: #000; }

/* The tests */
.test { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--rule); }
.test > p { max-width: 70ch; }
.pair { display: grid; gap: 16px; }
@media (min-width: 720px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair video { width: 100%; aspect-ratio: 16 / 9; background: #000; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0 12px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.grid4, .grid3 { display: grid; gap: 8px; }
.grid4 { grid-template-columns: repeat(2, 1fr); }
.grid3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }
.grid4 img, .grid3 img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.row-label { font: 600 0.78rem/1 var(--body); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); margin: 1.2em 0 0.6em; }

.numbers { border-collapse: collapse; margin: 1.5em 0; font-size: 0.98rem; width: 100%; max-width: 680px; }
.numbers th, .numbers td { text-align: left; padding: 0.55em 0.8em 0.55em 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.numbers thead th { font: 600 0.75rem/1.3 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.numbers tbody th { font-weight: 600; }
.numbers .pick th, .numbers .pick td { color: var(--accent); font-weight: 600; }

/* Limits and paper */
#limits ul { padding-left: 1.2em; }
#limits li { margin-bottom: 0.7em; }
.paper-title { font: 650 clamp(1.2rem, 2.4vw, 1.5rem)/1.35 var(--display); letter-spacing: -0.02em; }

footer { padding: 40px 0 56px; font-size: 0.95rem; color: var(--ink-soft); border-top: 1px solid var(--rule); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
