/* die-cut — a poster whose shapes are windows into a live world.
   Two grounds: paper (the page, drawn by WebGL behind the DOM so it can be cut) and world (the paper parted).
   Colours: --paper, --ink (the page) · --bone, --dim (text on the world) · --dna, --dna2 (the live Design DNA's accents). */
:root {
  --m: 32px; --gut: 24px; --navh: 64px;
  --bone: #efe8d8; --dim: #a9a397; --ink2: #4a4843; --mute: #5c5954; --line: rgba(11, 11, 12, 0.14); --line-w: rgba(239, 232, 216, 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1); --snap: cubic-bezier(0.3, 1.4, 0.5, 1);
}
html.dc { background: var(--paper); color: var(--on); scroll-behavior: auto; overflow-x: clip; }
html.dc body { margin: 0; font: 400 17px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
html.dc ::selection { background: var(--dna); color: #0b0b0c; }
canvas.gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
main, .foot { position: relative; z-index: 2; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--dna); outline-offset: 3px; border-radius: 6px; }

/* ---------- labels, titles, body ---------- */
.label { margin: 0 0 18px; font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; display: flex; gap: 12px; align-items: baseline; }
.label-n { font: 400 11px/1 var(--font-mono); letter-spacing: 0.1em; opacity: 0.72; }
.t { margin: 0 0 24px; font: 800 clamp(40px, 5.1vw, 86px)/0.92 var(--font-display); letter-spacing: -0.028em; text-wrap: balance; }
.t em, .hero-t em { font: italic 400 1.04em/0.9 var(--font-serif); letter-spacing: -0.01em; }
.body p { margin: 0 0 14px; max-width: 34ch; color: var(--on-dim); }
.on-world .body p { color: var(--on-dim); }
.hint { margin: 10px 0 0; font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 23px; border: 1px solid currentColor; font: 400 14px/1 var(--font-sans); text-decoration: none; transition: background 0.2s, color 0.2s, transform 0.2s var(--snap); white-space: nowrap; background: none; color: inherit; cursor: pointer; }
.btn i { font-style: normal; transition: transform 0.25s var(--ease); }
.btn:hover i { transform: translateX(3px); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: #26262a; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; border-radius: 18px; }
.hold { position: relative; overflow: hidden; margin-top: 18px; height: 52px; padding: 0 24px; border-radius: 26px; border: 1px solid var(--on); background: none; color: var(--on); font: 400 14px/1 var(--font-sans); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold-fill { position: absolute; inset: 0; background: var(--dna); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.hold-l { position: relative; }
.hold.is-on { color: #0b0b0c; }
.hold-world { border-color: var(--on); color: var(--on); }

/* ---------- nav and HUD ---------- */
/* ink on paper, bone on the world: the chrome follows the paper itself (--cut = how far it is parted), so it never
   shows bone on paper or ink on the dark world, whatever the chapter */
:root { --on: color-mix(in srgb, var(--bone) calc(var(--chr, 0) * 100%), var(--ink)); --on-dim: color-mix(in srgb, var(--dim) calc(var(--chr, 0) * 100%), var(--ink2));
  --on-mute: color-mix(in srgb, var(--dim) calc(var(--chr, 0) * 100%), var(--mute)); --on-line: color-mix(in srgb, var(--line-w) calc(var(--chr, 0) * 100%), var(--line)); }
/* every word takes ink or bone from what is behind it. The page's state (--chr: 0 while the paper is shut, 1 once it
   has parted past half-way) colours the chrome and any copy not otherwise marked; each block of copy (.adapt, marked by
   app.js) gets its own --k while the paper parts (0 on paper, 1 on the world) and --f 0 while the parting line runs
   through it, so no line is ever grey on grey. Panels with their own ground keep theirs. */
.adapt { --kc: var(--k, var(--chr, 0));
  --on: color-mix(in srgb, color-mix(in srgb, var(--bone) calc(var(--kc) * 100%), var(--ink)) calc(var(--f, 1) * 100%), transparent);
  --on-dim: color-mix(in srgb, color-mix(in srgb, var(--dim) calc(var(--kc) * 100%), var(--ink2)) calc(var(--f, 1) * 100%), transparent);
  --on-mute: color-mix(in srgb, color-mix(in srgb, var(--dim) calc(var(--kc) * 100%), var(--mute)) calc(var(--f, 1) * 100%), transparent);
  --on-line: color-mix(in srgb, color-mix(in srgb, var(--line-w) calc(var(--kc) * 100%), var(--line)) calc(var(--f, 1) * 100%), transparent);
  color: var(--on); transition: color 0.18s; }
html.settling .adapt { transition: none !important; }   /* settled captures show the colour at rest */
.nav { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--navh); display: flex; align-items: center; gap: 28px; padding: 0 var(--m); color: var(--on); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 15px/1 var(--font-sans); letter-spacing: -0.01em; }
.mark { display: inline-block; width: 22px; height: 19px; color: currentColor; }
.mark svg, .kick-mark svg { width: 100%; height: 100%; display: block; }
.mark svg path + path, .kick-mark svg path + path { fill: var(--dna); transition: fill 0.4s; }
.links { display: flex; gap: 24px; font: 400 14px/1 var(--font-sans); }
.links a { text-decoration: none; opacity: 0.8; } .links a:hover { opacity: 1; }
.nav-r { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-in { font: 400 14px/1 var(--font-sans); text-decoration: none; }
.nav .btn-ink { background: var(--on); color: color-mix(in srgb, #0b0b0c calc(var(--chr, 0) * 100%), var(--paper)); border-color: var(--on); }
.cmdk { height: 30px; min-width: 42px; border-radius: 8px; border: 1px solid currentColor; background: none; color: inherit; font: 400 11px/1 var(--font-mono); cursor: pointer; opacity: 0.75; }
.cmdk kbd { font: inherit; }
.sound { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid currentColor; background: none; color: inherit; font: 400 11px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; opacity: 0.75; }
.hud { position: fixed; inset: 0; z-index: 15; pointer-events: none; color: var(--on); }
/* the chrome never prints over copy: a band of the ground under the nav and the ruler, and one under the HUD's labels;
   both follow the paper (paper while it is shut, the world's black while it is parted) */
.hud-band { position: absolute; left: 0; right: 0; display: block; --g: color-mix(in srgb, #060607 calc(var(--chr, 0) * 100%), var(--paper)); transition: opacity 0.3s; }
.hud-band-t { top: 0; height: calc(var(--navh) + 30px); background: linear-gradient(var(--g), var(--g) calc(var(--navh) + 12px), transparent); }
.hud-band-b { bottom: 0; height: 64px; background: linear-gradient(transparent, var(--g) 50%); --g: color-mix(in srgb, #060607 calc(var(--chr-b, var(--chr, 0)) * 100%), var(--paper)); }
.rule { position: absolute; display: block; opacity: 0.9; }
.rule-x { left: 0; top: var(--navh); width: 100%; height: 14px; }
.rule-y { left: 0; top: var(--navh); width: 14px; height: calc(100% - var(--navh)); }
.hud p { position: absolute; margin: 0; font: 400 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
/* the bottom line follows the ground under it (--chr-b, set only without WebGL, where a chapter's edge can sit between
   the nav and the bottom of the screen; with WebGL the whole screen is one ground and --chr serves both) */
.hud-tc, .hud-ch { color: color-mix(in srgb, var(--bone) calc(var(--chr-b, var(--chr, 0)) * 100%), var(--ink)); }
.hud-tc { left: var(--m); bottom: 22px; } .hud-tc b { font-weight: 400; }
.hud-ch { right: var(--m); bottom: 22px; } .hud-ch b { font-weight: 400; opacity: 0.7; margin-right: 8px; } .hud-ch b:empty { display: none; }
.hud-xy { left: 0; top: 0; transform: translate(var(--x, -200px), var(--y, -200px)); opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.cross { position: absolute; background: var(--dna); opacity: 0; transition: opacity 0.25s; }
.cross-x { left: 0; right: 0; height: 1px; top: 0; transform: translateY(var(--y, -10px)); }
.cross-y { top: 0; bottom: 0; width: 1px; left: 0; transform: translateX(var(--x, -10px)); }
html.has-pointer .cross { opacity: 0.32; } html.has-pointer .hud-xy { opacity: 0.8; }
.sel { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 1px solid var(--dna); opacity: 0; transition: opacity 0.18s, transform 0.18s var(--ease), width 0.18s var(--ease), height 0.18s var(--ease); }
.sel.is-on { opacity: 1; }
.sel i { position: absolute; width: 7px; height: 7px; background: var(--paper); border: 1px solid var(--dna); }
.sel i:nth-child(1) { left: -4px; top: -4px; } .sel i:nth-child(2) { right: -4px; top: -4px; } .sel i:nth-child(3) { left: -4px; bottom: -4px; } .sel i:nth-child(4) { right: -4px; bottom: -4px; }
.sel-l { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); background: var(--dna); color: #0b0b0c; font: 400 10px/1 var(--font-mono); padding: 4px 6px; border-radius: 4px; white-space: nowrap; letter-spacing: 0.04em; }
/* hud.js puts the tag on the first side that covers no words */
.sel[data-side="r"] .sel-l { left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
.sel[data-side="t"] .sel-l { top: auto; bottom: calc(100% + 6px); }
.sel[data-side="l"] .sel-l { left: auto; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
.sel[data-side="bl"] .sel-l { left: 0; transform: none; } .sel[data-side="br"] .sel-l { left: auto; right: 0; transform: none; }
.sel[data-side="tl"] .sel-l { left: 0; transform: none; top: auto; bottom: calc(100% + 6px); }
.sel[data-side="tr"] .sel-l { left: auto; right: 0; transform: none; top: auto; bottom: calc(100% + 6px); }

/* ---------- windows ---------- */
.win-word { min-width: 0; max-width: 100%; margin: 0; font: 800 27vw/0.8 var(--font-display); letter-spacing: -0.035em; white-space: nowrap; color: var(--ink); user-select: none; }
.win-word span { display: inline; }
html.win-live .win-word { color: transparent; }
.frame { position: relative; border-radius: 28px; }
html.no-webgl .frame, html.no-webgl .board { background: #0b0b0c url(../assets/poster.jpg) center / cover; }
.frame-tag { position: absolute; left: 0; top: -26px; font: 400 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }

/* ---------- hero ---------- */
.ch { position: relative; }
.ch-hero { min-height: 100vh; min-height: 100svh; padding: calc(var(--navh) + 5vh) var(--m) 64px; box-sizing: border-box; display: flex; flex-direction: column; }
.win-word-hero { margin-left: -0.03em; }
.hero-bottom { margin-top: auto; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: end; padding-top: 3vh; }
.hero-copy { grid-column: 1 / span 6; }
.kicker { margin: 0 0 16px; display: flex; gap: 10px; align-items: center; font: 400 11px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.kick-mark { width: 16px; height: 14px; display: inline-block; }
.hero-t { margin: 0 0 16px; font: 800 clamp(34px, 3.5vw, 58px)/0.98 var(--font-display); letter-spacing: -0.026em; text-wrap: balance; max-width: 16ch; }
.lede { margin: 0; max-width: 46ch; color: var(--on-dim); font-size: 16px; }
.entry { grid-column: 8 / span 5; background: #0e0e10; color: #efe8d8; border-radius: 16px; padding: 14px 14px 12px; box-shadow: 0 30px 60px -30px rgba(11, 11, 12, 0.5), 0 0 0 1px rgba(11, 11, 12, 0.9); }
.entry header, .entry footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.en-k { font: 400 13px/1 var(--font-sans); } .en-tag { font: 400 10px/1 var(--font-mono); letter-spacing: 0.14em; opacity: 0.55; }
.entry textarea { width: 100%; box-sizing: border-box; margin: 12px 0; min-height: 64px; resize: none; border: 1px solid #2a2a2e; background: #151518; color: #efe8d8; border-radius: 10px; padding: 10px 12px; font: 400 14px/1.45 var(--font-sans); }
.entry textarea::placeholder { color: #7c786f; }
.en-chips { display: flex; gap: 6px; flex-wrap: wrap; } .en-chips span { font: 400 11px/1 var(--font-mono); padding: 5px 8px; border: 1px solid #2d2d31; border-radius: 6px; color: #a9a397; }
.entry .btn-ink { background: var(--bone); color: #0b0b0c; border-color: var(--bone); }
.hero-more { margin: 22px 0 0; display: flex; gap: 22px; flex-wrap: wrap; font: 400 13px/1.4 var(--font-sans); }
.hero-more a { text-decoration: none; opacity: 0.75; } .hero-more a:hover { opacity: 1; }

/* ---------- pinned chapters ---------- */
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; box-sizing: border-box; padding: calc(var(--navh) + 7vh) var(--m) 8vh; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-content: start; }
.col-copy { grid-column: 1 / span 4; position: relative; z-index: 2; }
.on-world { color: var(--on); }
/* the world chapters keep their copy on the dark side of the frame; a low scrim guards it when the world swings in */
.ch-dna .pin::before, .ch-drift .pin::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 52%; background: linear-gradient(90deg, rgba(6, 6, 7, 0.62), rgba(6, 6, 7, 0.34) 58%, rgba(6, 6, 7, 0)); pointer-events: none; opacity: var(--cut, 0); }
/* (the scrim is only there while the paper is parted: --cut follows win.cut) */
.ch-bring { height: 260vh; }
.ch-bring .col-copy { grid-column: 1 / span 4; }
.frame-bring { grid-column: 6 / span 7; height: calc(100svh - var(--navh) - 16vh); }
.inputs { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--on-line); }
.inputs li { display: grid; grid-template-columns: 54px 1fr; column-gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--on-line); font-size: 14px; align-items: baseline; transition: opacity 0.4s; }
.inputs li b::after { content: ' ✓'; opacity: 0; transition: opacity 0.3s; color: var(--on); }
.inputs li.is-in b::after { opacity: 1; }
.in-tag { font: 400 10px/1 var(--font-mono); letter-spacing: 0.12em; opacity: 0.6; grid-row: span 2; padding-top: 3px; }
.in-x { font: 400 11px/1.4 var(--font-mono); color: var(--on-mute); letter-spacing: 0.04em; }
.ch-dna { height: 240vh; }
.dna-panel { grid-column: 9 / span 4; align-self: start; position: relative; z-index: 2; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 20px 20px 18px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7); }
.dna-panel header { display: flex; justify-content: space-between; font: 400 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; }
.dp-name { margin: 14px 0 12px; font: 800 30px/1 var(--font-display); letter-spacing: -0.02em; }
.dp-sw { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dp-sw i { height: 44px; border-radius: 8px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(11, 11, 12, 0.14); transition: background 0.5s; }
.dp-rows { margin: 14px 0 0; display: grid; gap: 6px; }
.dp-rows div { display: flex; justify-content: space-between; font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.dp-rows dt { font: 400 10.5px/1.6 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; } .dp-rows dd { margin: 0; }
.dp-swap-l { margin: 16px 0 8px; font: 400 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: none; color: inherit; font: 400 12.5px/1 var(--font-sans); cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip[aria-checked="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dp-cap { margin: 12px 0 0; font-size: 12.5px; color: var(--mute); }
.ch-models { height: 220vh; }
.ch-models .pin { align-content: space-between; }
.models-top { grid-column: 1 / -1; display: flex; gap: 40px; align-items: baseline; }
.models-lead { margin: 0; font: 800 clamp(30px, 3.2vw, 52px)/1 var(--font-display); letter-spacing: -0.02em; }
.win-word-2 { grid-column: 1 / -1; font-size: 17vw; line-height: 0.82; margin: 2vh 0 0 -0.02em; }
.models-bottom { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: end; }
.models-bottom .body { grid-column: 1 / span 5; }
.roles { grid-column: 8 / span 5; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--gut); }
.roles li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--on-line); font: 400 16px/1.2 var(--font-sans); }
.ch-generate { height: 280vh; }
.frame-sheet { grid-column: 6 / span 7; aspect-ratio: 16 / 10; align-self: start; }
.layer-tags { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; overflow: hidden; }
.ltag { position: absolute; left: 0; top: 0; display: flex; gap: 8px; align-items: baseline; background: var(--paper); color: var(--ink); padding: 6px 9px; border-radius: 7px; font: 400 11px/1.2 var(--font-mono); letter-spacing: 0.03em; white-space: nowrap; box-shadow: 0 0 0 1px var(--line), 0 10px 24px -14px rgba(0, 0, 0, 0.5); opacity: 0; transform: translate(var(--x, 0px), calc(var(--y, 0px) - 50%)); }
.ltag b { font: 400 11.5px/1.2 var(--font-sans); }
.ltag::before { content: ''; position: absolute; right: -9px; top: 50%; margin-top: -4.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--dna); box-shadow: 0 0 0 2px var(--paper); }
.ltag.is-r::before { right: auto; left: -9px; }
.ch-drift { height: 240vh; }
.drift-meter { position: absolute; z-index: 2; right: var(--m); bottom: 11vh; margin: 0; color: var(--on); font: 400 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
/* the meter sits over the belt where it passes low on the screen: a soft scrim of the world's black under it while the
   paper is parted (always without WebGL) */
.drift-meter::before { content: ''; position: absolute; inset: -36px -28px -36px -72px; z-index: -1; background: radial-gradient(closest-side, rgba(6, 6, 7, 0.72), rgba(6, 6, 7, 0.4) 60%, rgba(6, 6, 7, 0)); opacity: var(--k, var(--cut, 0)); pointer-events: none; }   /* its own ground (--k) while the paper parts: no haze on the paper */
.dm-now { display: flex; align-items: baseline; gap: 6px; }
.drift-meter b { font: 800 44px/1 var(--font-display); letter-spacing: -0.02em; margin: 0 2px 0 8px; }
.dm-pages { display: block; text-align: right; opacity: 0.75; } .dm-pages b { font: 400 12px/1 var(--font-mono); margin: 0 4px 0 0; letter-spacing: 0.08em; }
.ch-export { height: 260vh; }
.boards { grid-column: 6 / span 7; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 14px; align-self: start; }
.board { aspect-ratio: 16 / 10; border-radius: 8px; position: relative; }
.board span { position: absolute; left: 0; top: -17px; font: 400 9.5px/1 var(--font-mono); letter-spacing: 0.1em; opacity: 0.7; }
.code { margin: 20px 0 0; padding: 14px 16px; background: #0e0e10; color: #d8d2c4; border-radius: 12px; font: 400 12px/1.6 var(--font-mono); overflow-x: auto; max-width: 100%; }
.share { margin: 14px 0 0; display: flex; gap: 12px; align-items: baseline; font: 400 13px/1.4 var(--font-mono); }
.share-l { border-bottom: 1px solid currentColor; }
.caption { grid-column: 6 / span 7; margin: 18px 0 0; font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.ch-templates { padding: 16vh var(--m) 12vh; }
.tpl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gut); }
.tpl-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.tpl-prev { aspect-ratio: 4 / 3; border-radius: 14px; display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; transition: transform 0.4s var(--ease); }
.tpl-card:hover .tpl-prev { transform: translateY(-4px); }
.tpl-prev b { font: 800 clamp(22px, 2.4vw, 40px)/0.9 var(--font-display); letter-spacing: -0.03em; }
.tpl-athlete .tpl-prev { background: #121212; color: #f2f0ea; } .tpl-athlete .tpl-prev b { font-style: italic; }
.tpl-mono .tpl-prev { background: #d9d4c9; color: #1d1c1a; } .tpl-mono .tpl-prev b { font-weight: 400; letter-spacing: 0.3em; }
.tpl-web3 .tpl-prev { background: #140b10; color: #e2465a; }
.tpl-blank .tpl-prev { background: var(--paper) radial-gradient(circle, rgba(11,11,12,.2) 1px, transparent 1.4px) 0 0 / 16px 16px; box-shadow: inset 0 0 0 1px var(--line); color: var(--mute); }
.tpl-n { font: 400 16px/1.2 var(--font-sans); } .tpl-n em { font: 400 10px/1 var(--font-mono); font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); vertical-align: 2px; }
.tpl-d { font-size: 13.5px; color: var(--on-mute); }
.ch-cta { min-height: 110vh; padding: 12vh var(--m) 10vh; box-sizing: border-box; display: flex; align-items: center; }
.cta-in { width: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: center; }
.cta-mark { grid-column: 1 / span 6; justify-self: center; aspect-ratio: 334 / 284; width: min(100%, 520px, 70vh); color: var(--ink); }
.cta-mark svg { width: 100%; height: 100%; display: block; }
html.win-live .cta-mark svg { opacity: 0; }
.cta-copy { grid-column: 8 / span 5; }
.t-cta { font-size: clamp(44px, 5.4vw, 92px); }
.cta-sub { color: var(--on-dim); max-width: 36ch; }
.cta-b { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.sig { margin: 28px 0 0; font: italic 400 26px/1 var(--font-serif); }

/* ---------- footer ---------- */
.foot { padding: 60px var(--m) 70px; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: var(--gut); }
.foot-sig { margin: 0; display: flex; gap: 10px; align-items: center; font: 400 18px/1 var(--font-sans); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.foot-col a { text-decoration: none; opacity: 0.8; } .foot-col a:hover { opacity: 1; } .foot-col span { color: var(--on-mute); }
.foot-small, .disclosure { margin: 40px 0 0; font: 400 11.5px/1.6 var(--font-mono); color: var(--on-mute); max-width: 110ch; }
.disclosure { margin-top: 10px; }

/* ---------- command palette, toast ---------- */
.palette { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line); }
.palette::backdrop { background: rgba(11, 11, 12, 0.35); backdrop-filter: blur(2px); }
.pal-f { margin: 0; }
.palette input { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 18px 20px; font: 400 16px/1 var(--font-mono); color: inherit; outline: none; }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.pal-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.pal-list li span { font: 400 11px/1.4 var(--font-mono); opacity: 0.55; }
.pal-list li[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.pal-foot { margin: 0; padding: 10px 20px 14px; font: 400 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.55; }
.toast { position: fixed; left: 50%; bottom: 56px; z-index: 30; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font: 400 12px/1.2 var(--font-mono); letter-spacing: 0.04em; transition: opacity 0.2s, transform 0.25s var(--ease); pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- loader ---------- */
/* the loader leaves by a diagonal wipe along the mark's axis (the edge rises to the right at the bar's angle) */
.loader { position: fixed; inset: 0; z-index: 40; background: #09090a; color: #efe8d8; display: grid; place-items: center; clip-path: polygon(0% 0, 200% 0, 200% 100%, -45% 100%); transition: clip-path 1s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.2s linear 0.95s, visibility 0s linear 1.15s; }
.ld-field { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
.ld-mark { position: relative; width: min(220px, 40vw); aspect-ratio: 334 / 284; color: #efe8d8; -webkit-mask: conic-gradient(from -120deg, #000 calc(var(--p, 0) * 360deg), transparent 0); mask: conic-gradient(from -120deg, #000 calc(var(--p, 0) * 360deg), transparent 0); }
.ld-mark svg { width: 100%; height: 100%; display: block; }
.ld-mark svg path + path { fill: var(--dna); }
.ld-l { position: absolute; left: var(--m); bottom: 28px; margin: 0; font: 400 11px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; display: flex; gap: 18px; }
.ld-l b { font-weight: 400; }
html.is-loaded .loader { clip-path: polygon(145% 0, 200% 0, 200% 100%, 100% 100%); }
html.reduced .loader { transition: opacity 0.3s; } html.reduced.is-loaded .loader { opacity: 0; clip-path: none; }

/* ---------- no WebGL: the page still reads ---------- */
html.no-webgl .win-word { color: var(--ink); }
/* the chapters without WebGL: each has its own ground, so its words take their colour from it, not from the chrome's
   --chr (the paper chapters ink, the world chapters bone on the poster). The chrome follows the chapter under it:
   app.js sets --chr from the chapter under the nav and --chr-b from the one under the HUD's bottom line */
html.no-webgl .ch, html.no-webgl .foot { --on: var(--ink); --on-dim: var(--ink2); --on-mute: var(--mute); --on-line: var(--line); }
html.no-webgl .ch-dna, html.no-webgl .ch-drift { background: #0b0b0c; --on: var(--bone); --on-dim: var(--dim); --on-mute: var(--dim); --on-line: var(--line-w); }
html.no-webgl .ch-dna .pin::before, html.no-webgl .ch-drift .pin::before, html.no-webgl .drift-meter::before { opacity: 1; }
html.no-webgl .adapt { --k: 0; } html.no-webgl .ch-dna .adapt, html.no-webgl .ch-drift .adapt { --k: 1; }
html.no-webgl .ch-dna .pin, html.no-webgl .ch-drift .pin { background: #0b0b0c url(../assets/poster.jpg) center / cover; }
html.no-webgl .hud .rule, html.no-webgl .cross { display: none; }

/* ---------- short laptops (1366×768, 1280×720, a 1440 screen under its browser bars) ----------
   the word keeps its full width; the copy below it sits side by side instead of stacked, so the hero fits one screen
   and nothing runs under the HUD's timecode */
@media (min-width: 821px) and (max-height: 820px), (min-width: 821px) and (min-aspect-ratio: 17/10) {
  /* wide screens too: the word is fitted to the width, so its height grows with it (1680×882, 1920×1080) */
  .hero-bottom { padding-top: 2.4vh; }
  .hero-copy { grid-column: 1 / span 7; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); column-gap: var(--gut); align-items: end; }
  .kicker { grid-column: 1 / -1; margin-bottom: 12px; }
  .hero-t { margin: 0; font-size: clamp(32px, 3.1vw, 50px); }
  .lede { font-size: clamp(14.5px, 1.05vw, 16px); line-height: 1.5; }
  .hero-more { margin-top: 16px; }
}
@media (min-width: 821px) and (max-height: 820px) {
  .pin { padding-top: calc(var(--navh) + 52px); padding-bottom: 64px; }   /* the frames' tags stay below the ruler */
  .t { font-size: clamp(36px, min(5.1vw, 8.4vh), 86px); margin-bottom: 16px; }
  .body p { font-size: 15.5px; margin-bottom: 10px; }
  .inputs { margin-top: 18px; }
  .inputs li { grid-template-columns: 54px auto minmax(0, 1fr); padding: 7px 0; }
  .in-tag { grid-row: auto; padding-top: 0; }
  .in-x { text-align: right; }
  .frame-bring { height: calc(100svh - var(--navh) - 52px - 64px); }
}

/* ---------- phones ---------- */
@media (max-width: 820px) {
  :root { --m: 16px; --gut: 12px; --navh: 56px; }
  .links, .nav-in, .cmdk, .rule, .cross, .hud-xy, .k-only { display: none; }
  .nav { gap: 12px; } .nav-r { gap: 8px; } .sound { padding: 0 9px; } .sound [data-sound-label] { display: none; }
  .nav .btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
  .win-word-2 span { display: block; }
  .ch-hero { padding-top: calc(var(--navh) + 3vh); }
  .win-word-hero span { display: block; }
  .hero-bottom { grid-template-columns: 1fr; row-gap: 18px; }
  .hero-copy, .entry { grid-column: 1 / -1; }
  .hero-t { font-size: 30px; }
  .pin { grid-template-columns: minmax(0, 1fr); padding: calc(var(--navh) + 3vh) var(--m) 5vh; align-content: start; row-gap: 18px; }
  .frame-bring, .frame-sheet, .boards { margin-top: 24px; }
  .col-copy, .frame-bring, .frame-sheet, .boards, .caption, .dna-panel { grid-column: 1 / -1; }
  .t { font-size: 38px; margin-bottom: 14px; }
  .body p { font-size: 15px; margin-bottom: 8px; }
  .frame-bring { height: 34svh; }
  .inputs { display: none; }
  .ch-dna .pin { align-content: space-between; }
  .dna-panel { padding: 14px; } .dp-name { font-size: 22px; margin: 10px 0 8px; } .dp-sw i { height: 28px; } .dp-rows, .dp-cap { display: none; }
  .win-word-2 { font-size: 21vw; }
  .models-bottom { grid-template-columns: 1fr; row-gap: 12px; } .models-bottom .body, .roles { grid-column: 1 / -1; }
  .ch-models .pin { align-content: start; row-gap: 12px; }
  .models-top { flex-direction: column; gap: 0; }
  .boards { grid-template-columns: repeat(3, 1fr); gap: 24px 8px; }   /* each board's number sits on the paper above it */
  .board:nth-child(n + 10) { display: none; }
  .code { font-size: 10.5px; }
  .tpl { grid-template-columns: 1fr 1fr; }
  .cta-in { grid-template-columns: 1fr; row-gap: 24px; } .cta-mark, .cta-copy { grid-column: 1 / -1; } .cta-mark { max-width: 76vw; }
  .foot-top { grid-template-columns: 1fr 1fr; }
  .hud-tc, .hud-ch { bottom: 12px; transition: opacity 0.3s; }
  html[data-chapter="top"] .hud-tc, html[data-chapter="top"] .hud-ch, html[data-chapter="top"] .hud-band-b { opacity: 0; }
  .ltag { font-size: 9.5px; padding: 4px 6px; } .ltag b { font-size: 10px; }
  .drift-meter { bottom: 7vh; } .dm-now b { font-size: 32px; }
  /* the world chapters' copy stands at the top of a phone, where the planet's limb crossed it (2.1:1): the scrim covers
     it from the top down and the body is full bone */
  .ch-dna .pin::before, .ch-drift .pin::before { inset: 0; width: auto; background: linear-gradient(180deg, rgba(6, 6, 7, 0.72) 0, rgba(6, 6, 7, 0.72) 45%, rgba(6, 6, 7, 0) 72%); }
  .on-world .body p { color: var(--on); }
}
@media (prefers-reduced-motion: reduce) { .btn, .sel, .tpl-prev { transition: none; } }
