/* overdrive — THE TAIL. Tokens re-skin the page and the world together. */
:root {
  --bg: #07080A; --ink: #F2F0EA; --muted: #A3A29C; --accent: #FF4A1C; --accent-ink: #0B0B0C;
  --line: color-mix(in srgb, var(--ink) 16%, transparent);
  --gut: clamp(20px, 4vw, 64px);
  --sans: 'Inter Tight', system-ui, sans-serif; --serif: 'Instrument Serif', Georgia, serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --out: cubic-bezier(.16, 1, .3, 1); --io: cubic-bezier(.77, 0, .175, 1);
}
[data-theme="1"] { --bg: #ECEAE3; --ink: #0B0B0C; --muted: #4F4E49; --accent: #2437FF; --accent-ink: #FFFFFF; }
[data-theme="2"] { --bg: #0B0A12; --ink: #F3F1FF; --muted: #A9A6BD; --accent: #E4FF3A; --accent-ink: #0B0A12; }
[data-theme="3"] { --bg: #0A1A36; --ink: #EAF0FF; --muted: #A8B6D6; --accent: #FFB020; --accent-ink: #0A1A36; }

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); overflow-x: clip; }
body { margin: 0; font: 400 17px/1.5 var(--sans); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
code { font-family: var(--mono); }
.mono { font-family: var(--mono); }
.serif, em.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
h1 em.serif, h2 em.serif { font-size: 1.04em; }

#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.no-webgl #world { display: none; }
.no-webgl body { background-image: radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 1.5px); background-size: 6px 6px; }
#wipe { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
#flash { position: fixed; inset: 0; z-index: 55; pointer-events: none; background: #fff; mix-blend-mode: difference; opacity: 0; }
#flash.on { opacity: .9; }
#cursor { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity .3s; }
#cursor.live { opacity: 1; }
#cursor i { position: absolute; width: 24px; height: 15px; margin: -7.5px 0 0 -12px; border: 1.5px solid #fff; border-radius: 2px; transition: transform .3s var(--out), background-color .2s; }
#cursor i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 8px; height: 2px; background: #fff; }
#cursor.big i { transform: scale(2.1); background: #fff; }
@media (hover: none), (pointer: coarse) { #cursor { display: none; } }

/* ---- HUD and rail */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gut); pointer-events: none; isolation: isolate; }
.hud::before { content: ''; position: absolute; inset: 0 0 -36px; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 86%, transparent) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 60%, transparent 100%); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-mark { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 44px; min-height: 44px; padding-right: 8px; color: var(--ink); text-decoration: none; font: 800 18px/1 var(--sans); letter-spacing: -.03em; }
.mark { width: 32px; height: 26px; color: var(--ink); flex: none; }
.hud-read { display: flex; gap: 10px; font-size: 11px; letter-spacing: .18em; color: color-mix(in srgb, var(--ink) 80%, var(--bg)); font-variant-numeric: tabular-nums; }
.hud-read .sep { color: var(--muted); }
.hud-right { display: flex; align-items: center; gap: 8px; }
.themes { display: flex; }
.theme-dot { width: 44px; height: 44px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.theme-dot::before { content: ''; width: 16px; height: 16px; border-radius: 3px; background: linear-gradient(135deg, var(--sw-bg) 50%, var(--sw-ac) 50%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 45%, transparent); transition: transform .15s var(--out); }
.theme-dot:hover::before { transform: scale(1.15); }
.theme-dot:active::before { transform: scale(.9); }
.theme-dot[aria-pressed="true"]::before { outline: 2px solid var(--ink); outline-offset: 3px; }
[data-theme-i="0"] { --sw-bg: #07080A; --sw-ac: #FF4A1C; }
[data-theme-i="1"] { --sw-bg: #ECEAE3; --sw-ac: #2437FF; }
[data-theme-i="2"] { --sw-bg: #0B0A12; --sw-ac: #E4FF3A; }
[data-theme-i="3"] { --sw-bg: #0A1A36; --sw-ac: #FFB020; }
.hud-btn { height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--bg) 72%, transparent); color: var(--ink); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(8px); transition: transform .12s var(--out); }
.hud-btn:active { transform: scale(.97); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; }
.eq i { width: 2px; height: 3px; background: var(--accent); }
.sound-on .eq i { animation: eq .9s ease-in-out infinite; }
.sound-on .eq i:nth-child(2) { animation-delay: -.3s; } .sound-on .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 50% { height: 11px; } }

.rail { position: fixed; right: var(--gut); top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; gap: 2px; }
.rail a { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 26px; color: var(--muted); text-decoration: none; font-size: 11px; letter-spacing: .12em; }
.rail a span { position: absolute; right: calc(100% + 8px); padding: 3px 7px; white-space: nowrap; background: color-mix(in srgb, var(--bg) 86%, transparent); opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s var(--out); text-transform: uppercase; }
.rail a b { font-weight: 400; }
.rail a:hover span, .rail a.on span { opacity: 1; transform: none; }
.rail a.on { color: var(--ink); }
.rail a.on b { color: var(--accent); }

/* ---- Chapters */
main { position: relative; z-index: 2; }
.chapter { position: relative; height: calc(var(--len) * 1vh); height: calc(var(--len) * 1svh); }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.pin::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.eyebrow { margin: 0 0 18px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.big { margin: 0; font: 900 clamp(38px, 5.8vw, 104px)/.9 var(--sans); letter-spacing: -.05em; max-width: 14ch; text-wrap: balance; }
.mid { margin: 0 0 20px; font: 900 clamp(32px, 4vw, 70px)/.92 var(--sans); letter-spacing: -.045em; max-width: 16ch; text-wrap: balance; }
.huge { margin: 0; font: 900 clamp(46px, 8.6vw, 164px)/.86 var(--sans); letter-spacing: -.055em; max-width: 11ch; text-wrap: balance; }
.lede { margin: 0 0 22px; font-size: clamp(16px, 1.2vw, 18px); color: var(--muted); max-width: 46ch; }

/* Word masks; descenders keep room below the mask */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .08em .12em; margin: 0 -.08em -.12em; }
.wi { display: inline-block; transform-origin: 0 100%; transition: transform .45s var(--io); }
/* 130%, not 110%: on tight display leading, 110% left ascender tips peeking under the mask */
.js .wi { transform: translateY(130%) rotate(5deg); }
.js .in .wi { transform: none; transition: transform .95s var(--out) calc(var(--i) * 55ms); }
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .4s, transform .4s var(--io); }
.js [data-reveal].in { opacity: 1; transform: none; transition: opacity .9s var(--out), transform 1s var(--out); }

.label { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; padding: 6px 9px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; background: color-mix(in srgb, var(--bg) 82%, transparent); border-left: 2px solid var(--accent); }
.label.in { opacity: 1; }
.label b { display: block; font-weight: 600; color: var(--ink); }
.label span { color: var(--muted); }

/* 0 · intro */
.intro .pin { display: flex; align-items: center; }
.intro .pin::before { background: radial-gradient(ellipse 70% 60% at 30% 55%, color-mix(in srgb, var(--bg) 84%, transparent) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent 85%); }
.intro-inner { width: 100%; padding-inline: var(--gut); }
.intro-title { margin: 0 0 0 -.04em; font: 900 clamp(56px, 15.2vw, 268px)/.8 var(--sans); letter-spacing: -.055em; }
.intro-title .ch { display: inline-block; }
.intro-lede { margin: 26px 0 20px; font-size: clamp(19px, 1.9vw, 28px); line-height: 1.3; max-width: 30ch; }
.intro-cmd { margin: 0; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
/* Quick install from the first screen, for people who already know they want it */
.intro-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 0 0 16px; }
.quick-copy { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-width: 216px; min-height: 54px; padding: 10px 18px; border: 0; border-radius: 4px; background: var(--accent); color: var(--accent-ink); text-align: left; cursor: pointer; transition: transform .12s var(--out), filter .15s; }
.quick-copy:hover { filter: brightness(1.08); }
.quick-copy:active { transform: scale(.97); }
.qc-k { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.qc-sub { font-size: 11px; letter-spacing: .02em; }
.quick-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.quick-link:hover { color: var(--accent); }
.slash { color: var(--accent); }
.scroll-cue { position: absolute; left: var(--gut); bottom: 22px; display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.scroll-cue i { width: 56px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ''; position: absolute; inset: 0; background: var(--accent); animation: cue 2.2s var(--io) infinite; }
@keyframes cue { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* Use cases from the first screen: a peek at real works, and the quickest way to add yours */
.intro-cases { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 16px; }
.cases-btn, .add-case { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(6px); transition: transform .12s var(--out), border-color .15s, color .15s; }
.cases-btn:hover, .add-case:hover { border-color: color-mix(in srgb, var(--ink) 55%, transparent); }
.cases-btn:active, .add-case:active { transform: scale(.97); }
.cases-n { color: var(--muted); }
.cases-thumbs { display: inline-flex; }
.cases-thumbs:empty { display: none; }
.cases-thumbs img { width: 38px; height: 24px; object-fit: cover; border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); border-radius: 2px; background: var(--bg); }
.cases-thumbs img + img { margin-left: -14px; }
.add-case { padding: 0 12px; font-size: 11px; color: var(--muted); }
.add-case:hover { color: var(--ink); }

/* The Use cases window */
.cases { width: min(1080px, calc(100vw - 32px)); max-height: min(88vh, 900px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); overscroll-behavior: contain; }
.cases::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.cases-box { display: flex; flex-direction: column; gap: 26px; padding: clamp(20px, 3vw, 36px); }
.cases-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.cases-head .mid { margin-bottom: 10px; }
.cases-lede { margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.5; color: var(--muted); }
.cases-lede .quick-link { min-height: 44px; margin-left: 6px; font-size: 11px; }
.cases-close { flex: none; }
.cases-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.case { display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; }
.case img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line); transition: border-color .15s; }
.case span { font-size: 12px; letter-spacing: .04em; }
.case b { margin-right: 6px; font-weight: 600; color: var(--accent); }
.case:hover img { border-color: var(--ink); }
.case:hover span { text-decoration: underline; text-underline-offset: 3px; }
.case-empty { grid-column: 1 / -1; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.cases-add { max-width: 520px; padding-top: 22px; border-top: 1px solid var(--line); }

/* 1 · curve */
.curve .pin::before { background: linear-gradient(172deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 30%, transparent 56%); }
.curve-copy { position: absolute; top: clamp(84px, 13vh, 140px); left: var(--gut); max-width: min(820px, 64vw); }
.curve .big { font-size: clamp(34px, 4.4vw, 78px); max-width: 17ch; }
.curve .big.second { margin-top: 16px; }
.peak-label { translate: -50% calc(-100% - 6px); }
.tail-label { translate: -100% calc(-100% - 6px); text-align: right; border-left: 0; border-right: 2px solid var(--accent); }
.curve-read { position: absolute; right: calc(var(--gut) + 64px); bottom: 26px; display: flex; align-items: baseline; gap: 14px; padding: 10px 14px; font-size: 12px; background: color-mix(in srgb, var(--bg) 84%, transparent); border: 1px solid var(--line); }
.curve-read .k { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.curve-read b { font-weight: 400; color: var(--ink); }
.curve-read .sev { padding: 2px 6px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); }
.curve-read .sev[data-sev="rare"] { color: var(--bg); background: var(--ink); }

/* 2 · bans */
.bans .pin::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 38%, transparent 60%); }
.bans-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(660px, 48vw); }
.ban-list { margin: 0; padding: 0; list-style: none; counter-reset: ban; columns: 2; column-gap: 28px; font-size: 12px; line-height: 1.3; }
.ban-list li { position: relative; counter-increment: ban; break-inside: avoid; padding: 6px 0 6px 30px; border-top: 1px solid var(--line); color: color-mix(in srgb, var(--ink) calc(100% - var(--s, 0) * 38%), var(--bg)); }
.ban-list li::before { content: counter(ban, decimal-leading-zero); position: absolute; left: 0; color: var(--muted); }
.ban-list li::after { content: ''; position: absolute; left: 28px; right: 0; top: 50%; height: 2px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--s, 0)); }
.ban-stamp { position: absolute; right: calc(var(--gut) + 64px); bottom: 26px; margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ban-stamp b { margin-right: 8px; font: 900 56px/1 var(--sans); letter-spacing: -.04em; color: var(--accent); vertical-align: -8px; font-variant-numeric: tabular-nums; }

/* 3 · pipeline */
.pipeline .pin::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 84%, transparent) 38%, transparent 62%); }
.pipe-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(560px, 44vw); }
.phases { margin: 6px 0 0; padding: 0; list-style: none; }
.phases li { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); transition: color .3s; }
.phases b { grid-row: span 2; padding-top: 4px; font-size: 12px; font-weight: 400; }
.phases .n { font: 800 19px/1.2 var(--sans); letter-spacing: -.01em; }
.phases .d { max-height: 0; overflow: hidden; opacity: 0; font-size: 15px; line-height: 1.4; color: var(--muted); transition: max-height .5s var(--io), opacity .3s, margin .5s var(--io); }
.phases li.on { color: var(--ink); }
.phases li.on b { color: var(--accent); }
.phases li.on .d { max-height: 4.5em; opacity: 1; margin-top: 4px; }
.phases li.done { color: color-mix(in srgb, var(--ink) 72%, var(--bg)); }
.gate { margin-left: 8px; padding: 2px 6px 1px; font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; vertical-align: 3px; color: var(--accent-ink); background: var(--accent); }
.gate-label { translate: 0 -100%; }

/* 4 · tail */
.tail .pin::before { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, transparent 30%, transparent 58%, color-mix(in srgb, var(--bg) 94%, transparent) 100%); }
.tail-top { position: absolute; left: var(--gut); top: clamp(84px, 13vh, 140px); transition: opacity .6s var(--out); }
.tail .big { max-width: 12ch; }
.tail-rise .tail-top { opacity: 0; }
/* Without WebGL the escaped build is still shown, as a still */
.no-webgl .tail-top { opacity: 1; }
.no-webgl .tail .pin { background: var(--escaped-img, url(assets/escaped.jpg)) center 52% / min(78vw, 112vh) auto no-repeat; }
.no-webgl .tail .pin::before { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 40%, transparent) 34%, transparent 55%, color-mix(in srgb, var(--bg) 96%, transparent) 88%) !important; }
.tail-scan { position: absolute; right: calc(var(--gut) + 64px); top: clamp(84px, 13vh, 140px); margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-align: right; opacity: 0; transition: opacity .3s; }
.tail-scan.in { opacity: 1; }
.tail-scan b { display: block; font: 900 64px/1 var(--sans); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.tail-end { position: absolute; left: var(--gut); right: calc(var(--gut) + 64px); bottom: clamp(26px, 6vh, 60px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; }
.floor { margin: 0; font-size: clamp(42px, 6.4vw, 116px); line-height: .95; }
.caption { margin: 0; max-width: 44ch; font-size: 11.5px; line-height: 1.55; letter-spacing: .03em; color: var(--muted); }

/* 5 · verify */
.verify .pin::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 95%, transparent) 0%, color-mix(in srgb, var(--bg) 86%, transparent) 36%, transparent 58%); }
.verify-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(540px, 42vw); }
.verify .mid { font-size: clamp(30px, 3.4vw, 58px); max-width: 17ch; }
.odo-row { display: flex; align-items: center; gap: 18px; margin: 0 0 14px; }
.odo { font: 600 clamp(60px, 6.4vw, 112px)/.9 var(--mono); letter-spacing: -.05em; color: var(--accent); font-variant-numeric: tabular-nums; }
.odo-cap { margin: 0; max-width: 30ch; font-size: 15px; line-height: 1.4; color: var(--muted); }
.odo-cap code { color: var(--ink); font-size: .92em; }
.findings { margin: 0 0 16px; padding: 0; list-style: none; font-size: 12px; }
.findings li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.js .findings li { opacity: 0; transform: translateX(-12px); transition: opacity .3s, transform .3s var(--io); }
.js .findings li.in { opacity: 1; transform: none; transition: opacity .6s var(--out), transform .7s var(--out); }
.findings i { font-style: normal; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.findings b { font-weight: 600; }
.findings .fixed { margin-left: 6px; padding: 1px 5px; font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--ink); }
.honest { margin: 0 0 12px; font-size: clamp(22px, 1.9vw, 30px); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.checks li { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border: 1px solid var(--line); color: var(--muted); }
.checks li::before { content: ''; width: 5px; height: 5px; background: var(--accent); }

/* 6 · dial */
.dial .pin::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 74%, transparent) 42%, transparent 70%); }
.dial-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(560px, 44vw); }
.level-name { margin: 4px 0 12px; min-height: 1em; font: 900 56px/1 var(--sans); letter-spacing: -.03em; transform-origin: 0 100%; }
.dial[data-level="1"] .level-name, .dial:not([data-level]) .level-name { font: italic 400 min(46px, 11vw)/1 var(--serif); letter-spacing: 0; }
.dial[data-level="2"] .level-name { font: 400 min(54px, 12vw)/1 var(--serif); letter-spacing: -.01em; }
.dial[data-level="3"] .level-name { font-weight: 800; font-size: min(58px, 13vw); letter-spacing: -.03em; }
.dial[data-level="4"] .level-name { font-weight: 900; font-size: min(70px, 15vw); letter-spacing: -.045em; }
.dial[data-level="5"] .level-name { font-weight: 900; font-size: min(86px, 16vw); letter-spacing: -.06em; color: var(--accent); transform: skewX(-8deg); }
.level-desc { margin: 0 0 12px; max-width: 44ch; min-height: 3em; font-size: 16px; line-height: 1.45; color: var(--muted); }
.level-moment { margin: 0 0 18px; max-width: 50ch; min-height: 3em; padding-left: 12px; border-left: 2px solid var(--accent); font-size: 12px; line-height: 1.5; }
.minimal { margin: 0; max-width: 30ch; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; }
.dial-wrap { position: absolute; right: calc(var(--gut) + 124px); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 48px; }
.dial-ctl { position: relative; width: clamp(220px, 23vw, 330px); aspect-ratio: 1; border-radius: 50%; touch-action: none; cursor: grab; background: radial-gradient(circle, color-mix(in srgb, var(--bg) 88%, transparent) 0 60%, transparent 61%); }
.dial-ctl:active { cursor: grabbing; }
.dial-ctl:focus-visible { outline-offset: 8px; }
.dial-ctl svg { width: 100%; height: 100%; overflow: visible; }
.dial-track { fill: none; stroke: var(--line); stroke-width: 10; stroke-dasharray: 395.84 600; transform: rotate(135deg); transform-origin: 100px 100px; }
.dial-arc { fill: none; stroke: var(--accent); stroke-width: 10; }
#dial-ticks line { stroke: var(--muted); stroke-width: 2; }
#dial-knob line { stroke: var(--ink); stroke-width: 4; }
#dial-knob circle { fill: var(--ink); }
.dial-num { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: 600 clamp(56px, 5.6vw, 88px)/1 var(--mono); }
.dial-hint { position: absolute; left: 0; right: 0; bottom: -26px; text-align: center; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.tiers { display: flex; flex-direction: column; gap: 6px; max-width: 340px; padding: 10px 12px; font-size: 11px; letter-spacing: .04em; color: var(--muted); background: color-mix(in srgb, var(--bg) 88%, transparent); border: 1px solid var(--line); }
.tiers b { margin-right: 8px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }

/* 7 · use */
.use .pin::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 95%, transparent) 0%, color-mix(in srgb, var(--bg) 88%, transparent) 42%, transparent 66%); }
.use-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(600px, 46vw); }
.install { margin: 0 0 18px; }
.step-k { margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.step-k b { margin-right: 8px; font-weight: 400; color: var(--accent); }
.step-last { margin: 14px 0 0; }
/* Editable prompt boxes: a real text field on the ink plate, labelled so visitors know they can type */
.cmd:has(textarea) { position: relative; }
.cmd:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.cmd textarea { flex: 1; min-width: 0; margin: 0; padding: 26px 14px 12px; border: 0; outline: none; resize: none; overflow: hidden; background: transparent; color: inherit; font: 400 14px/1.45 var(--mono); field-sizing: content; }
.cmd textarea.swap { animation: swap .7s var(--out); }
@keyframes swap { from { background-color: color-mix(in srgb, var(--accent) 24%, transparent); } }
.edit-tag { position: absolute; left: 14px; top: 8px; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 62%, var(--ink)); pointer-events: none; }
.install-cmd textarea { font-size: 13px; line-height: 1.5; }
/* The email ask: optional, with a free way out */
.copy-gate { width: min(560px, calc(100vw - 32px)); }
.copy-gate .cases-box { gap: 18px; }
.copy-gate .updates-row input[type="email"] { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 14px var(--mono); }
.copy-gate .updates-row:focus-within { border-color: var(--accent); }
.copy-gate .copy { min-width: 150px; }
.gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
/* Buttons in the windows keep their words on phones (the HUD's icon-only rule must not reach them) */
.cases .hud-btn { width: auto; padding: 0 16px; }
.cases .hud-btn .lbl { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
.gate-skip { backdrop-filter: none; }
.gate-cancel { margin: 0; }
.steps { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px 1fr; font-size: 16px; line-height: 1.4; }
.steps b { padding-top: 3px; font-size: 12px; font-weight: 400; color: var(--accent); }
.steps code { padding: 1px 5px; border-radius: 3px; font-size: .86em; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.composer { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 12px; }
.modes button { min-height: 44px; padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--muted); font: 600 12px/1 var(--mono); letter-spacing: .06em; cursor: pointer; transition: background-color .15s, color .15s, transform .1s var(--out); }
.modes button:hover { color: var(--ink); }
.modes button:active { transform: scale(.97); }
.modes button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.mode-desc { margin: 0 0 10px; min-height: 2.9em; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.target { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 11px; }
.target span { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.target input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 14px var(--mono); }
.target:focus-within { border-color: var(--accent); }
.cmd { display: flex; align-items: stretch; overflow: hidden; border-radius: 4px; background: var(--ink); color: var(--bg); }
.cmd code { flex: 1; min-width: 0; padding: 12px 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.cmd .slash { color: inherit; font-weight: 600; }
.caret { display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.copy { flex: none; min-width: 88px; min-height: 44px; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: transform .1s var(--out), filter .15s; }
.copy:hover { filter: brightness(1.08); }
.copy:active { transform: scale(.97); }
.yields { margin: 10px 0 0; font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.lane-labels { position: absolute; inset: 0; pointer-events: none; }
.lane-labels span { position: absolute; left: 0; bottom: 26px; translate: -50% 0; padding: 4px 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--bg) 84%, transparent); opacity: 0; transition: opacity .3s, color .2s, background-color .2s; }
.lane-labels span.in { opacity: 1; }
.lane-labels span.sel { color: var(--bg); background: var(--ink); }

/* 8 · museum: the procession of real works on the right, the ask on the left */
.museum .pin::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 95%, transparent) 0%, color-mix(in srgb, var(--bg) 86%, transparent) 34%, transparent 56%); }
.museum-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(500px, 38vw); }
.museum .mid { max-width: 11ch; }
.museum-walk { margin: 0 0 18px; }
.sample { width: 100%; }
.sample-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sample-fields input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 14px var(--mono); }
.sample-fields input + input { border-top: 1px solid var(--line); }
.sample-fields input::placeholder { color: var(--muted); }
.sample-fields input:disabled { color: var(--muted); }
.sample .copy { min-width: 104px; }
.sample.done .updates-row { border-color: var(--accent); }
.museum-plate { margin: 0; }
/* The accession label: pinned under the centred work, like a wall label under a painting */
.museum-label { position: absolute; left: 0; top: 0; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 13px 8px; translate: -50% 0; font-size: 11px; line-height: 1.45; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; background: color-mix(in srgb, var(--bg) 88%, transparent); border-top: 2px solid var(--accent); opacity: 0; pointer-events: none; transition: opacity .3s; }
.museum-label.in { opacity: 1; pointer-events: auto; }
.museum-label.open { border-top-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.museum-label b { font-weight: 600; letter-spacing: .14em; color: var(--ink); font-variant-numeric: tabular-nums; }
.museum-label span { color: var(--muted); }
.museum-label a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px -14px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-transform: none; letter-spacing: .04em; }
.museum-label a:hover { color: var(--accent); }
.museum-label a[hidden] { display: none; }
.museum-label.docked { left: var(--gut); top: auto; bottom: 22px; translate: none; max-width: calc(100% - var(--gut) * 2); white-space: normal; }
.museum-still { display: none; }
.no-webgl .museum-still:not([hidden]) { display: block; position: absolute; right: calc(var(--gut) + 64px); top: 50%; transform: translateY(-56%); width: min(46vw, 760px); aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line); }
@media (min-width: 900px) { .museum-label.docked { left: auto; right: calc(var(--gut) + 64px); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 9 · close */
.close .pin::before { background: radial-gradient(ellipse 62% 58% at 50% 50%, color-mix(in srgb, var(--bg) 90%, transparent) 0%, color-mix(in srgb, var(--bg) 62%, transparent) 58%, transparent 85%); }
.close-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 80px var(--gut) 40px; text-align: center; }
/* Never let the column squeeze a box shut; short screens drop the extras instead (below) */
.close-inner > * { flex-shrink: 0; }
.close-mark { width: clamp(64px, 7vw, 108px); height: clamp(52px, 5.7vw, 88px); color: var(--ink); }
.close-cmd { width: min(420px, 100%); text-align: left; }
.updates { width: min(460px, 100%); text-align: left; }
.updates label { display: block; margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.updates-row { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); transition: border-color .2s; }
.updates-row:focus-within, .updates.done .updates-row { border-color: var(--accent); }
.updates input[type="email"] { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 14px var(--mono); }
.updates input::placeholder { color: var(--muted); }
.updates .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.updates button:disabled { cursor: default; filter: saturate(.6); }
.updates-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.updates-note.err { color: var(--accent); }
.updates-privacy { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
/* A 44px tap target that doesn't push the sentence's lines apart: the negative margins cancel its height */
.linkish { display: inline-flex; align-items: center; min-height: 44px; margin-block: -13px; vertical-align: middle; padding: 0 2px; border: 0; background: none; color: var(--ink); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--accent); }
.updates.removing .updates-note { display: none; }
.req { margin: 8px 0 0; max-width: 60ch; font-size: 11px; line-height: 1.5; color: var(--muted); }
.made, .facts { margin: 0; max-width: 62ch; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.made code { color: var(--ink); }
.facts { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }

/* ---- Short desktop screens */
@media (min-width: 900px) and (max-height: 780px) {
  .bans .lede, .verify .honest { display: none; }
  .phases li { padding: 5px 0; }
  .odo { font-size: 64px; }
  .findings li { padding: 4px 0; }
  .steps { margin-bottom: 14px; }
  .mode-desc { min-height: 0; }
  .close-inner { gap: 12px; padding-top: 70px; padding-bottom: 20px; }
  .close-mark { width: 56px; height: 46px; }
  .close .huge { font-size: clamp(44px, 6.4vw, 104px); }
  .close .made { display: none; }
  .museum .lede { display: none; }
}

/* ---- Phones and narrow screens */
@media (max-width: 899px) {
  .rail, .hud-read { display: none; }
  .hud { padding-top: 10px; }
  .hud-btn { width: 44px; padding: 0; justify-content: center; }
  .hud-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .curve-copy, .bans-copy, .pipe-copy, .verify-copy, .dial-copy, .use-copy, .museum-copy { top: 70px; left: var(--gut); right: var(--gut); width: auto; max-width: none; transform: none; }
  .tail-top { top: 70px; right: var(--gut); }
  .pin::before { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 90%, transparent) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 50%, color-mix(in srgb, var(--bg) 30%, transparent) 82%, transparent 100%) !important; }
  .curve .pin::before, .tail .pin::before { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 42%, transparent 64%, color-mix(in srgb, var(--bg) 80%, transparent) 100%) !important; }
  .intro .pin::before { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 40%, transparent), color-mix(in srgb, var(--bg) 82%, transparent) 60%, color-mix(in srgb, var(--bg) 60%, transparent)) !important; }
  .close .pin::before { background: radial-gradient(ellipse 90% 60% at 50% 50%, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 70%, color-mix(in srgb, var(--bg) 55%, transparent) 100%) !important; }
  .curve .big { font-size: clamp(30px, 8.4vw, 44px); }
  .curve-read { left: var(--gut); right: var(--gut); bottom: 18px; flex-wrap: wrap; gap: 4px 10px; }
  .peak-label, .tail-label { display: none; }
  .ban-list { columns: 1; }
  .ban-list li { padding: 4px 0 4px 30px; }
  .ban-stamp { right: var(--gut); bottom: 14px; }
  .ban-stamp b { font-size: 40px; }
  .bans .lede { font-size: 14.5px; margin-bottom: 14px; }
  .phases li { padding: 5px 0; }
  .phases .n { font-size: 16px; }
  .phases .d { font-size: 14px; }
  .gate-label { display: none; }
  .tail-scan { top: auto; bottom: 18px; right: auto; left: var(--gut); text-align: left; }
  .tail-scan b { font-size: 44px; }
  .tail-end { right: var(--gut); }
  .odo { font-size: 56px; }
  .odo-cap { font-size: 14px; }
  .findings li { grid-template-columns: 100px 1fr; gap: 8px; padding: 5px 0; }
  .findings i { font-size: 11px; letter-spacing: .06em; }
  .level-desc { font-size: 14.5px; }
  .dial-wrap { top: auto; bottom: 40px; right: auto; left: 50%; transform: translateX(-50%); }
  .dial-ctl { width: 190px; }
  .dial-num { font-size: 52px; }
  .tiers { display: none; }
  .steps li { font-size: 14px; }
  .composer { padding: 12px; }
  .mode-desc { font-size: 13.5px; min-height: 0; }
  .cmd code { font-size: 13px; padding: 10px 12px; }
  .lane-labels { display: none; }
  .museum .lede { font-size: 14.5px; margin-bottom: 12px; }
  .museum-walk { margin-bottom: 10px; }
  .no-webgl .museum-still:not([hidden]) { right: var(--gut); left: var(--gut); top: auto; bottom: 96px; transform: none; width: auto; }
  /* The install prompt already names the requirements; phones keep step 03 on screen instead */
  .use .req, .use .yields { display: none; }
}
@media (max-width: 899px) and (max-height: 760px) {
  .bans .lede, .verify .honest, .dial .minimal, .level-moment, .yields, .checks, .scroll-cue span:last-child, .close .facts, .close .made { display: none; }
  .mid { font-size: 30px; margin-bottom: 14px; }
  .eyebrow { margin-bottom: 10px; }
  .steps { gap: 4px; margin-bottom: 12px; }
  /* The use chapter carries the install prompt and the composer: trim it so step 03 stays on screen */
  .use .mode-desc, .use .req { display: none; }
  .museum .lede { display: none; }
  .museum .updates-note { font-size: 12px; }
  .install { margin-bottom: 12px; }
  .cmd textarea, .install-cmd textarea { font-size: 12px; padding: 24px 12px 9px; }
  .step-k { letter-spacing: .06em; }
  .modes { margin-bottom: 8px; }
  .target { margin-bottom: 8px; }
  .step-last { margin-top: 10px; }
}
@media (max-width: 420px) { .hud-mark span { display: none; } }
@media (max-width: 899px) and (max-height: 760px) { .intro-cases { margin-bottom: 10px; } }

/* ---- Reduced motion: the whole story, without the flights */
@media (prefers-reduced-motion: reduce) {
  .js .wi, .js .in .wi { transform: none; transition: none; }
  .js [data-reveal], .js [data-reveal].in, .js .findings li, .js .findings li.in { transform: none; transition: opacity .3s; }
  #flash, .scroll-cue i::after { display: none; }
  .caret { animation: none; }
  .phases .d { transition: none; }
}
