/* derinerimez.com lab · North Star slice 3 (hello + five chapters; the lights open into detail panels). Palette tokens arrive from the seed through the CSSOM (main.js);
   the defaults here are the cobalt palette so the first paint is already right for most seeds. */
:root {
  --bg: #05070d; --bg-rgb: 5, 7, 13; --hi: #0e1c3a; --hi-rgb: 14, 28, 58; --text: #f2f5ff; --text-rgb: 242, 245, 255; --muted: #aab5d0;
  --accent: #ffb547; --accent-rgb: 255, 181, 71; --a: #2a56ff; --a-rgb: 42, 86, 255; --b: #86c8ff; --b-rgb: 134, 200, 255; --glow-rgb: 49, 87, 255;
  --glass-rgb: 11, 20, 40; --live: #3ddc84; --live-rgb: 61, 220, 132;
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
  --text-f: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.5, 0, .75, 0);
  --sa-b: env(safe-area-inset-bottom, 0px); --sa-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--text-f); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

/* ---------- layers ---------- */
.gl, .atmo, .scrim, .grain { position: fixed; inset: 0; pointer-events: none; }
.gl { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
html.gl-on.ready .gl { opacity: 1; }
/* no WebGL (and before the field is up): the same palette as a still gradient */
.atmo { background:
  radial-gradient(60% 45% at 68% 46%, rgba(var(--glow-rgb), .22), transparent 70%),
  radial-gradient(90% 70% at 70% 45%, rgba(var(--hi-rgb), .9), transparent 75%),
  linear-gradient(160deg, rgba(var(--a-rgb), .10), transparent 55%), var(--bg); }
html.gl-on .atmo { opacity: 0; transition: opacity 1.2s var(--ease); }
/* legibility scrim behind the words (bottom on portrait, left on landscape) */
.scrim { background: linear-gradient(to top, rgba(var(--bg-rgb), .92) 0%, rgba(var(--bg-rgb), .72) 30%, rgba(var(--bg-rgb), 0) 58%); transition: opacity .8s var(--ease); }
/* deeper scrims for the chapters with more words, and a soft pool behind the hello; cross-faded */
.scrim::before, .scrim::after { content: ""; position: fixed; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.scrim::before { background: radial-gradient(70% 34% at 50% 48%, rgba(var(--bg-rgb), .55), rgba(var(--bg-rgb), 0) 70%); }
.scrim::after { background: linear-gradient(to top, rgba(var(--bg-rgb), .94) 0%, rgba(var(--bg-rgb), .86) 42%, rgba(var(--bg-rgb), 0) 74%); }
html[data-ch="-1"] .scrim::before { opacity: 1; }
html[data-ch="2"] .scrim::after, html[data-ch="3"] .scrim::after, html[data-ch="4"] .scrim::after { opacity: 1; }
.grain { inset: -50%; opacity: .075; mix-blend-mode: overlay; background-size: 128px 128px; animation: grain 1s steps(5) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } }

/* ---------- top bar ---------- */
.top { position: fixed; z-index: 5; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--sa-t) + 14px) 18px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.mark { font: 600 15px/1 var(--sans); letter-spacing: -.01em; text-decoration: none; opacity: 0; transform: translateY(-6px); transition: opacity .5s var(--ease), transform .5s var(--ease); padding: 8px 0; }
html:not([data-ch="0"]):not([data-ch="-1"]) .mark { opacity: .92; transform: none; transition-delay: .5s; }
/* the hello: only the words; the chrome arrives with Live */
.idx-b, .prog { transition: opacity .6s var(--ease) .25s; }
html[data-ch="-1"] .idx-b, html[data-ch="-1"] .prog { opacity: 0; pointer-events: none; transition-delay: 0s; }
html[data-ch="-1"] .prog-b { pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(255, 255, 255, .11); border-radius: 999px; background: rgba(var(--glass-rgb), .5);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 30px rgba(0, 0, 0, .25); transition: transform .35s var(--ease), background .3s, border-color .3s; }
.pill:active { transform: scale(.96); }
.pill:focus-visible, .idx a:focus-visible, .mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.idx-b { height: 38px; padding: 0 15px; font: 500 13px/1 var(--text-f); letter-spacing: .01em; }
.idx-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.pill.small { height: 32px; padding: 0 13px; font-size: 13px; }

/* ---------- chapters ---------- */
.chapters { position: relative; z-index: 2; }
html.js .chapters { position: fixed; inset: 0; pointer-events: none; }
html.js .ch { position: absolute; inset: 0; display: flex; pointer-events: none; }
html.js .ch.on { pointer-events: auto; }
html.js .ch:not(.on):not(.off) { visibility: hidden; }
/* entering (after the camera has turned): rise in, staggered; leaving: a quick lift and fade */
html.js .ch > * > * { opacity: 0; }
html.js .ch.on > * > * { animation: rise 1.1s var(--ease) both; }
html.js .ch.on > * > :nth-child(2) { animation-delay: .07s; } html.js .ch.on > * > :nth-child(3) { animation-delay: .14s; } html.js .ch.on > * > :nth-child(4) { animation-delay: .21s; }
html.js .ch.on > * > :nth-child(5) { animation-delay: .28s; } html.js .ch.on > * > :nth-child(6) { animation-delay: .35s; }
html.js .ch.off > * > * { animation: leave .34s var(--ease-in) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes leave { from { opacity: 1; transform: none; filter: none; } to { opacity: 0; transform: translateY(-16px); filter: blur(5px); } }
html.js:not(.ready) .ch > * > * { animation-play-state: paused; }

.hl { font-family: var(--sans); font-weight: 650; letter-spacing: -.035em; line-height: .98; margin: 0; text-wrap: balance; }
.ch-in { width: 100%; }

/* chapter 1 · Live */
.ch-live { align-items: flex-end; padding: 0 22px calc(var(--sa-b) + 104px); }
.face { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin-bottom: 18px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 0 0 5px rgba(var(--bg-rgb), .6), 0 0 34px rgba(var(--glow-rgb), .45); }
.ch-live .hl { font-size: clamp(42px, 11.5vw, 92px); }
.answer { font: 400 17px/1.45 var(--text-f); letter-spacing: -.005em; margin: 14px 0 0; max-width: 31ch; color: var(--text); text-wrap: pretty; }
.live { display: inline-flex; align-items: center; gap: 9px; margin: 20px 0 0; font: 500 13px/1 var(--text-f); color: var(--muted); opacity: 0; transition: opacity .6s var(--ease); }
.live.known { opacity: 1; }
.live .ln { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); letter-spacing: -.02em; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(var(--live-rgb), .18), 0 0 12px rgba(var(--live-rgb), .7); }
.live.stale .dot { background: var(--muted); box-shadow: none; }
.dot.blink { animation: blink .9s var(--ease); }
@keyframes blink { 0% { box-shadow: 0 0 0 3px rgba(var(--live-rgb), .18), 0 0 12px rgba(var(--live-rgb), .7); } 30% { box-shadow: 0 0 0 7px rgba(var(--live-rgb), .28), 0 0 22px rgba(var(--live-rgb), 1); } 100% { box-shadow: 0 0 0 3px rgba(var(--live-rgb), .18), 0 0 12px rgba(var(--live-rgb), .7); } }

/* chapter 2 · Paddock SimWorks: words at the bottom, the lanes above; the real photo lives in its panel */
.kick { margin: 0 0 9px; font: 600 11.5px/1 var(--text-f); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.body { margin: 12px 0 0; font: 400 16.5px/1.5 var(--text-f); color: var(--text); opacity: .9; max-width: 40ch; text-wrap: pretty; }

/* the hello: centred, large, plain; it lifts away into the field when Live arrives */
.ch-hi { align-items: center; justify-content: center; text-align: center; padding: 0 24px 4vh; }
.hi-t { font-size: clamp(54px, 15vw, 150px); letter-spacing: -.045em; }
html.js .ch-hi.on > * > * { animation: hiIn 1.3s var(--ease) both; }
html.js .ch-hi.off > * > * { animation: hiOut .75s var(--ease-in) both; }
@keyframes hiIn { from { opacity: 0; transform: translateY(14px) scale(.97); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes hiOut { from { opacity: 1; transform: none; filter: none; } to { opacity: 0; transform: translateY(-34px) scale(1.06); filter: blur(12px); } }

/* chapters 3–5: words at the bottom on a phone, on the left on a wide screen */
.ch-paddock, .ch-sys, .ch-found, .ch-hello { align-items: flex-end; padding: 0 22px calc(var(--sa-b) + 98px); }
.ch-paddock, .ch-sys, .ch-found { padding-bottom: calc(var(--sa-b) + 90px); }
.ch-paddock .hl, .ch-sys .hl, .ch-found .hl, .ch-hello .hl { font-size: clamp(31px, 8.2vw, 54px); }
.ch-paddock .body, .ch-sys .body, .ch-found .body, .ch-hello .body { margin-top: 10px; font-size: 15.5px; }

/* ---------- chapters 2–4: the words and the panel share one slot (a grid cell), the small index under them ---------- */
.ch-paddock .ch-in, .ch-sys .ch-in, .ch-found .ch-in { position: relative; max-width: 560px; }
html.js .stack { display: grid; align-items: end; }
html.js .stack > .cp, html.js .stack > .dets { grid-area: 1 / 1; min-width: 0; }
html.js .cp { transition: opacity .5s var(--ease) .12s, transform .6s var(--ease) .12s, visibility 0s 0s; }
html.js .ch.open .cp { opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity .22s var(--ease), transform .4s var(--ease), visibility 0s .22s; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 14px 0 0; font: 500 12.5px/1.3 var(--mono); letter-spacing: .01em; color: var(--muted); }
.facts > span + span::before { content: "·"; margin: 0 9px; color: rgba(var(--text-rgb), .35); }
.facts .lv { display: inline-flex; align-items: center; }
.facts .lv .dot { display: none; width: 6px; height: 6px; margin-right: 8px; }
.facts .lv.on .dot { display: inline-block; }
.facts b { color: var(--text); font-weight: 600; margin-right: .45em; font-variant-numeric: tabular-nums; }

/* the small index: names of the things you can open (≥ 44 px tall), scrolls sideways on a phone */
.items { display: flex; gap: 8px; margin: 30px -22px 0; padding: 2px 22px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding: 0 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 26px), transparent); }
.items::-webkit-scrollbar { display: none; }
.items button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 15px; border-radius: 999px; border: 1px solid rgba(var(--b-rgb), .3);
  background: rgba(var(--glass-rgb), .6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font: 600 12.5px/1 var(--mono); letter-spacing: .01em; color: var(--text);
  cursor: pointer; white-space: nowrap; transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease); }
.items button:active { transform: scale(.96); }
.items button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.items .pd { width: 6px; height: 6px; border-radius: 50%; background: var(--b); box-shadow: 0 0 7px rgba(var(--b-rgb), .9); flex: none; }
.items .dim { color: var(--muted); } .items .dim .pd { opacity: .55; box-shadow: none; }
.items .warm b { color: var(--accent); }
.items button.on { background: rgba(var(--text-rgb), .95); color: var(--bg); border-color: transparent; }
.items button.on .pd { background: var(--bg); box-shadow: none; }
.items button.on b { color: var(--bg); }
.items b { font-weight: 650; font-variant-numeric: tabular-nums; }
/* slice 4: Paddock's index is a small photo of the trailer (visible on the first screen; a tap opens the panel) */
.items button.ph { height: 62px; padding: 0 17px 0 5px; gap: 12px; border-radius: 16px; }
html.js .ch-paddock .tap-hint { bottom: 76px; }
.items .ph img { width: 96px; height: 52px; border-radius: 11px; object-fit: cover; object-position: 30% 55%; flex: none; }
.items.scale span { display: none; } /* a phone: years only (each button's text still names the role for a screen reader below) */
.items.scale span, .items.scale b { pointer-events: none; }
html.hot, html.hot body { cursor: pointer; }

/* the one-time hint, just above the index */
.tap-hint { display: none; }
html.js .tap-hint { display: flex; align-items: center; gap: 9px; position: absolute; left: 0; bottom: 58px; margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .02em; color: var(--text); pointer-events: none; }
html.js .tap-hint::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(var(--text-rgb), .8); box-shadow: 0 0 10px rgba(var(--b-rgb), .6); animation: tapring 1.9s var(--ease) infinite; }
html.js .ch > .ch-in > .tap-hint, html.js .ch.on > .ch-in > .tap-hint { opacity: 0; animation: none; transition: opacity .6s var(--ease); }
html.js .ch.on > .ch-in > .tap-hint.on { opacity: .92; }
@keyframes tapring { 0% { transform: scale(.7); opacity: 1; } 70%, 100% { transform: scale(1.5); opacity: 0; } }

/* ---------- the detail panel: a glass telemetry board (the v2 look: mono labels, thin rules, one dated figure) ---------- */
.det[hidden], .sub[hidden] { display: none !important; }
/* slice 4: the satellite field's panel: its header + a hint while the field is in focus, one build once a light is open */
.det-field.pick .fld-t, .det-field.pick .fld { display: none; }
.det-field .fld { margin: 0; color: var(--muted); }
html:not(.js) .det-field .fld { display: none; }
/* the nine labels: real buttons centred on the lights (a 64 px target each), only while the field is in focus */
.sparks { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease); }
.sparks[hidden] { display: none; }
.sparks.on { opacity: 1; }
.sparks button { position: absolute; left: -32px; top: -32px; width: 64px; height: 64px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; pointer-events: none; will-change: transform; }
.sparks.on button { pointer-events: auto; }
.sparks button::before { content: ""; position: absolute; inset: 21px; border-radius: 50%; border: 1px solid rgba(var(--text-rgb), 0); transition: border-color .3s, box-shadow .3s, inset .35s var(--ease); }
.sparks button.on::before { inset: 17px; border-color: rgba(var(--text-rgb), .75); box-shadow: 0 0 14px rgba(var(--b-rgb), .75); }
.sparks span { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); white-space: nowrap; font: 500 11.5px/1 var(--mono); letter-spacing: .01em; color: var(--muted);
  text-shadow: 0 1px 7px rgba(var(--bg-rgb), .95), 0 0 2px rgba(var(--bg-rgb), .95); transition: color .3s; }
.sparks button.on span, .sparks button:hover span { color: var(--text); }
.sparks button:focus-visible { outline: 2px solid var(--accent); outline-offset: -10px; }
/* no JS / no WebGL2 (the flat page): one scrolling column; there is no next chapter to step to */
html:not(.js) .prog, html:not(.js) .ch-hi { display: none; } /* the hello is a moment, not content: Live already carries the name */
html:not(.js) .top { position: absolute; } html:not(.js) .chapters { padding-top: calc(var(--sa-t, 0px) + 72px); }
.det { position: relative; margin: 0 0 14px; padding: 14px 16px 15px; border-radius: 16px; border: 1px solid rgba(var(--b-rgb), .3); max-width: 520px;
  background: linear-gradient(170deg, rgba(var(--glass-rgb), .84), rgba(var(--glass-rgb), .93)); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(var(--b-rgb), .05), 0 0 22px rgba(var(--glow-rgb), .14), 0 22px 60px rgba(0, 0, 0, .45); }
.det::before { content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--b-rgb), .95), transparent); }
.det::after { content: ""; display: table; clear: both; }
html.js .det { margin: 0; }
html.js .det.on { animation: detIn .55s var(--ease) both; }
@keyframes detIn { from { opacity: 0; transform: translateY(16px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
html.js .sub:not([hidden]) { animation: fade .35s var(--ease) both; }
.dx { display: none; }
html.js .dx { display: grid; place-items: center; position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.dx svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dx:hover { color: var(--text); } .dx:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; }
.dk { display: flex; align-items: center; gap: 8px; margin: 0 40px 8px 0; font: 600 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.dk .mk { width: 7px; height: 7px; border-radius: 1.5px; background: var(--b); box-shadow: 0 0 8px rgba(var(--b-rgb), .8); flex: none; }
.dk .mk.warm { background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), .8); }
html.live-on .dk .mk.lvk { border-radius: 50%; background: var(--live); box-shadow: 0 0 9px rgba(var(--live-rgb), .9); }
.dk .stn { margin-left: auto; color: var(--muted); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.dt { font: 650 21px/1.18 var(--sans); letter-spacing: -.015em; margin: 0 0 8px; text-wrap: balance; outline: none; }
.sub .dt { margin-bottom: 5px; }
.dc { margin: 0 0 7px; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dl { margin: 0; font: 400 14.5px/1.45 var(--text-f); color: var(--text); opacity: .92; text-wrap: pretty; }
.df { display: flex; flex-wrap: wrap; gap: 10px 0; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(var(--text-rgb), .1); clear: both; }
.df > div { padding: 0 16px 0 0; margin: 0 16px 0 0; border-right: 1px solid rgba(var(--text-rgb), .1); }
.df > div:last-child { border: 0; margin: 0; padding: 0; }
.df dt { font: 500 10px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.df dd { margin: 3px 0 0; font: 650 19px/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text); }
.dn { margin: 9px 0 0; font: 500 11.5px/1.45 var(--mono); color: var(--muted); }
.on-live { display: none; }
html.live-on .df > .on-live { display: block; } html.live-on .dn > .on-live { display: inline; } html.live-on .on-stale { display: none; }
.dv { position: relative; margin: 0 0 11px; border-radius: 10px; overflow: hidden; background: rgba(var(--hi-rgb), 1); }
.dv::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); pointer-events: none; }
.dv img { width: 100%; height: 100%; object-fit: cover; }
.dv-wide { aspect-ratio: 2.3 / 1; } .dv-wide img { object-position: 30% 55%; }
.dv-strip { aspect-ratio: 2.9 / 1; }
.dv-phone { width: 76px; aspect-ratio: 600 / 1304; margin: 0; border-radius: 11px; }
/* a panel with a phone screenshot: words on the left, the screen on the right */
.det-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start; }
.det-side > * { grid-column: 1; }
.det-side > .dv-phone { grid-column: 2; grid-row: 1 / span 5; margin-top: 26px; }
.det-side > .df { margin-right: 0; }
.dv em { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: 3px 6px; border-radius: 999px; font: 600 8.5px/1 var(--text-f); font-style: normal; letter-spacing: .05em;
  text-transform: uppercase; white-space: nowrap; background: rgba(var(--bg-rgb), .82); color: var(--muted); }
.da { margin: 14px 0 0; }
.btn.sm { height: 42px; font-size: 14px; padding: 0 16px; }
.steps { display: flex; gap: 8px; margin: 12px 0 0; }
.steps { display: none; } html.js .steps { display: flex; }
.sb { width: 48px; height: 44px; border-radius: 12px; border: 1px solid rgba(var(--b-rgb), .3); background: rgba(var(--bg-rgb), .45); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb:active { transform: scale(.95); } .sb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a phone: a slightly tighter board so the object above stays in view */
@media (max-width: 699px) and (max-aspect-ratio: 85/100) {
  .det { padding: 12px 15px 13px; } .dt { font-size: 19.5px; margin-bottom: 6px; } .dl { font-size: 14px; }
  .df { margin-top: 10px; padding-top: 8px; } .df dd { font-size: 17px; } .dv { margin-bottom: 9px; }
  .dv-strip { aspect-ratio: 3.4 / 1; }
}
/* without JS every panel is plain content under its chapter */
html:not(.js) .dets { margin-top: 18px; display: grid; gap: 12px; }
html:not(.js) .sub + .sub { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(var(--text-rgb), .1); }

/* the leader: the open object on screen wired to its panel */
.leader { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); overflow: visible; }
.leader.on { opacity: 1; }
.leader path { fill: none; stroke: rgba(var(--b-rgb), .85); stroke-width: 1.25; }
.leader #ld-a { fill: none; stroke: var(--text); stroke-width: 1.25; }
.leader #ld-b { fill: var(--b); }
html.focused .ticks { opacity: .45; }

/* chapter 5 · Say hello */
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 18px; border-radius: 999px; font: 600 15px/1 var(--text-f); letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; border: 1px solid rgba(255, 255, 255, .14); background: rgba(var(--glass-rgb), .62); color: var(--text);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .3s var(--ease), background .3s; }
.btn:active { transform: scale(.96); }
.btn.pri { background: rgba(var(--text-rgb), .95); color: var(--bg); border-color: transparent; }
.btn:focus-visible, .lk:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.world { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 22px 0 0; font: 400 13px/1.3 var(--text-f); color: var(--muted); }
.world code { font: 500 12.5px var(--mono); color: var(--text); }
.lk { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--muted); text-decoration: underline; text-decoration-color: rgba(var(--text-rgb), .3); text-underline-offset: 3px; cursor: pointer; }
.lk:hover { color: var(--text); }

/* ---------- the one progression control (thumb zone) ---------- */
.prog { position: fixed; z-index: 4; left: 0; right: 0; bottom: calc(var(--sa-b) + 20px); display: flex; justify-content: center; pointer-events: none; }
.prog-b { pointer-events: auto; height: 58px; padding: 0 7px 0 20px; gap: 16px; }
.ticks { display: inline-flex; gap: 4px; }
.ticks i { width: 9px; height: 3px; border-radius: 2px; background: rgba(var(--text-rgb), .22); transition: width .6s var(--ease), background .6s; }
.ticks i:nth-child(n+3) { background: rgba(var(--text-rgb), .1); }
.ticks i.on { width: 24px; background: var(--accent); }
.prog-l { display: grid; gap: 4px; text-align: left; }
.prog-l small { font: 500 11px/1 var(--text-f); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prog-l b { font: 600 15px/1 var(--sans); letter-spacing: -.01em; }
.prog-a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--text-rgb), .94); color: var(--bg); }
.prog-a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prog-b { transition: transform .35s var(--ease), background .3s, border-color .3s, box-shadow .6s var(--ease); }
/* idle on a chapter for a few seconds: the control glows and its arrow nods; it never moves on by itself */
html.hint .prog-b { animation: hint 2.4s var(--ease) infinite; border-color: rgba(var(--accent-rgb), .45); }
html.hint .prog-a svg { animation: nudge 2.4s var(--ease) infinite; }
@keyframes hint { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 30px rgba(0, 0, 0, .25), 0 0 0 0 rgba(var(--accent-rgb), 0); }
  45% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 30px rgba(0, 0, 0, .25), 0 0 0 7px rgba(var(--accent-rgb), .14); } }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(3px); } 90% { transform: none; } }
html.nudge .prog-b { animation: shake .5s var(--ease); }
@keyframes shake { 30% { transform: translateY(-4px); } 60% { transform: translateY(2px); } }

/* ---------- chapter index ---------- */
.idx { border: 0; padding: 0; margin: auto auto 0; width: min(560px, 100%); max-height: 88vh; background: transparent; color: var(--text); }
.idx::backdrop { background: rgba(var(--bg-rgb), .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.idx-in { margin: 10px; padding: 18px 18px calc(var(--sa-b) + 14px); border-radius: 26px; background: rgba(var(--glass-rgb), .92); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.idx[open] .idx-in { animation: sheet .5s var(--ease) both; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.idx-h { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; font: 600 13px/1 var(--text-f); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(var(--text-rgb), .08); display: grid; place-items: center; cursor: pointer; }
.x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.idx-l { list-style: none; margin: 0; padding: 0; }
.idx-l a { display: grid; grid-template-columns: 40px 1fr auto; align-items: baseline; gap: 4px; padding: 15px 4px; text-decoration: none; border-top: 1px solid rgba(255, 255, 255, .07); }
.idx-l .no { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.idx-l b { font: 600 21px/1.1 var(--sans); letter-spacing: -.02em; }
.idx-l small { font-size: 12.5px; color: var(--muted); }
.idx-l [aria-current] b { color: var(--accent); }
.seed { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 0; padding: 14px 4px 0; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 13px; color: var(--muted); }
.seed b { font-weight: 500; color: var(--text); }
.seed code { font: 500 12.5px var(--mono); }
.idx-f { margin: 14px 4px 0; font-size: 13px; }
.idx-f a { color: var(--muted); }

.toast { position: fixed; z-index: 9; left: 50%; bottom: calc(var(--sa-b) + 92px); transform: translate(-50%, 10px); margin: 0; padding: 10px 16px; border-radius: 999px;
  background: rgba(var(--text-rgb), .95); color: var(--bg); font: 600 13px/1 var(--text-f); opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); max-width: 90vw; overflow-wrap: anywhere; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.nos { position: relative; z-index: 3; padding: 20px; }

/* ---------- wide screens: words (and panels) bottom-left, the field on the right ---------- */
@media (min-aspect-ratio: 85/100) {
  .scrim { background: linear-gradient(to right, rgba(var(--bg-rgb), .85) 0%, rgba(var(--bg-rgb), .55) 32%, rgba(var(--bg-rgb), 0) 56%); }
  .top { padding: calc(var(--sa-t) + 22px) clamp(22px, 4vw, 56px) 0; }
  .ch-live, .ch-hello { align-items: center; padding: 0 0 40px clamp(28px, 7vw, 120px); }
  .ch-paddock, .ch-sys, .ch-found { align-items: flex-end; padding: 0 clamp(28px, 7vw, 120px) calc(var(--sa-b) + 104px); }
  .ch-paddock .hl, .ch-sys .hl, .ch-found .hl, .ch-hello .hl { font-size: clamp(36px, 3.6vw, 56px); }
  .ch-paddock .body, .ch-sys .body, .ch-found .body, .ch-hello .body { font-size: clamp(16.5px, 1.25vw, 19px); max-width: 36ch; }
  .ch-paddock .ch-in, .ch-sys .ch-in, .ch-found .ch-in { max-width: 520px; }
  .items { margin: 30px 0 0; padding: 2px 0; overflow: visible; gap: 6px; -webkit-mask-image: none; mask-image: none; }
  .items button { padding: 0 13px; }
  .det { max-width: 480px; } .dt { font-size: 23px; } .dl { font-size: 15.5px; }
  .dv-phone { width: 88px; }
  .dv-wide { aspect-ratio: 16 / 9; }
  .scrim::after { background: linear-gradient(to right, rgba(var(--bg-rgb), .9) 0%, rgba(var(--bg-rgb), .7) 38%, rgba(var(--bg-rgb), 0) 64%); }
  .scrim::before { background: radial-gradient(46% 40% at 50% 50%, rgba(var(--bg-rgb), .5), rgba(var(--bg-rgb), 0) 70%); }
  .ch-in { max-width: 600px; }
  .face { width: 72px; height: 72px; margin-bottom: 24px; }
  .ch-live .hl { font-size: clamp(56px, 6.6vw, 104px); }
  .answer { font-size: clamp(19px, 1.55vw, 23px); margin-top: 20px; }
  .live { margin-top: 28px; font-size: 14px; }
}
/* a vertical year scale beside the strata, wherever there is room for 9 rows of 44 px */
@media (min-width: 700px) and (min-height: 640px) {
  .items.scale { position: fixed; z-index: 3; right: clamp(18px, 4vw, 56px); top: calc(50% - 206px); flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 0; padding: 0 0 0 1px;
    overflow: visible; -webkit-mask-image: none; mask-image: none; border-left: 1px solid rgba(var(--text-rgb), .18); }
  html.js .ch-found .tap-hint { position: fixed; left: auto; bottom: auto; right: clamp(18px, 4vw, 56px); top: calc(50% - 240px); }
  .items.scale button { position: relative; height: 44px; padding: 0 14px 0 20px; border: 0; border-radius: 0 10px 10px 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    gap: 12px; color: var(--muted); font-size: 12.5px; }
  .items.scale button::before { content: ""; position: absolute; left: -1px; top: 50%; width: 10px; height: 1px; background: rgba(var(--text-rgb), .45); transition: width .4s var(--ease), background .3s; }
  .items.scale span { display: inline; font: 500 12.5px/1 var(--text-f); letter-spacing: 0; }
  .items.scale b { color: var(--text); font-size: 13px; }
  .items.scale .warm { padding-left: 34px; } .items.scale .warm::before { width: 24px; background: rgba(var(--accent-rgb), .7); }
  .items.scale button:hover { color: var(--text); background: rgba(var(--glass-rgb), .55); }
  .items.scale button.on { background: rgba(var(--glass-rgb), .8); color: var(--text); }
  .items.scale button.on::before { width: 16px; height: 2px; margin-top: -1px; background: var(--accent); }
  .items.scale button.on b { color: var(--accent); }
}

/* ---------- reduced motion: cross-fades only ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .ch.on > * > * { animation: fade .2s linear both !important; }
  html.js .ch.off > * > * { animation: fade .2s linear reverse both !important; }
  html.js .det.on, html.js .sub:not([hidden]) { animation: fade .2s linear both !important; }
  html.js .cp, html.js .ch.open .cp { transform: none !important; transition: opacity .2s linear, visibility 0s .2s !important; }
  .grain, .prog-a svg, html.nudge .prog-b, html.hint .prog-b, html.js .tap-hint::before { animation: none !important; }
  html.hint .prog-b { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 4px rgba(var(--accent-rgb), .16); }
  html.js .ch-hi.on > * > * { animation: fade .2s linear both !important; } html.js .ch-hi.off > * > * { animation: fade .2s linear reverse both !important; }
  .gl { transition: opacity .2s linear; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- tablet portrait: phone layout, larger type ---------- */
@media (max-aspect-ratio: 85/100) and (min-width: 700px) {
  .ch-live { padding: 0 56px calc(var(--sa-b) + 128px); }
  .ch-hello { padding: 0 56px calc(var(--sa-b) + 124px); }
  .ch-paddock, .ch-sys, .ch-found { padding: 0 56px calc(var(--sa-b) + 112px); }
  .ch-paddock .ch-in, .ch-sys .ch-in, .ch-found .ch-in { max-width: 640px; }
  .ch-paddock .hl, .ch-sys .hl, .ch-found .hl, .ch-hello .hl { font-size: 54px; }
  .ch-paddock .body, .ch-sys .body, .ch-found .body, .ch-hello .body { font-size: 19px; max-width: 36ch; }
  .items { margin: 32px -56px 0; padding: 2px 56px; scroll-padding: 0 56px; gap: 10px; }
  .items button { height: 46px; font-size: 13.5px; padding: 0 17px; }
  .items.scale { top: calc(var(--sa-t) + 104px); }
  html.js .ch-found .tap-hint { top: calc(var(--sa-t) + 74px); }
  .det { max-width: 640px; padding: 18px 20px 19px; } .dt { font-size: 25px; } .dl { font-size: 17px; } .df dd { font-size: 22px; } .dk { font-size: 12px; } .dn { font-size: 12.5px; }
  .dv-phone { width: 92px; }
  .tap-hint { font-size: 13px; }
  .face { width: 76px; height: 76px; margin-bottom: 24px; }
  .answer { font-size: 22px; max-width: 34ch; margin-top: 20px; }
  .live { font-size: 15px; margin-top: 26px; }
  .body { font-size: 19px; }
  .top { padding: calc(var(--sa-t) + 22px) 32px 0; }
  .prog { bottom: calc(var(--sa-b) + 32px); }
}

/* ---------- short landscape (a phone on its side): face off, fewer words, the panel without pictures ---------- */
@media (min-aspect-ratio: 85/100) and (max-height: 560px) {
  .top { padding-top: calc(var(--sa-t) + 10px); }
  .ch-live, .ch-hello { align-items: center; padding: 52px 0 78px max(24px, env(safe-area-inset-left, 0px)); }
  .ch-paddock, .ch-sys, .ch-found { align-items: flex-end; padding: 52px 0 72px max(24px, env(safe-area-inset-left, 0px)); }
  .ch-paddock .ch-in, .ch-sys .ch-in, .ch-found .ch-in { max-width: min(640px, 72vw); }
  .ch-paddock .hl, .ch-sys .hl, .ch-found .hl, .ch-hello .hl { font-size: 28px; }
  .ch-paddock .body, .ch-sys .body, .ch-found .body { display: none; }
  .facts { margin-top: 10px; }
  .items { margin-top: 26px; } .items button { height: 44px; }
  .tap-hint { bottom: 54px; }
  .det { max-width: min(560px, 62vw); padding: 11px 14px 12px; } .dt { font-size: 18px; margin-bottom: 5px; } .dl { font-size: 13.5px; }
  .dv, .dn { display: none; } .df { margin-top: 8px; padding-top: 7px; } .df dd { font-size: 16px; } .steps { margin-top: 8px; } .sb { height: 40px; }
  .ch-hello .body { font-size: 15px; } .cta { margin-top: 12px; } .btn { height: 42px; } .world { margin-top: 12px; }
  .hi-t { font-size: 64px; }
  .face { display: none; }
  .ch-live .hl { font-size: 44px; }
  .answer { font-size: 15.5px; margin-top: 10px; max-width: 46ch; }
  .live { margin-top: 12px; }
  .body { font-size: 15px; margin-top: 8px; }
  .kick { margin-bottom: 6px; }
  .prog { bottom: calc(var(--sa-b) + 10px); }
  .prog-b { height: 50px; }
  .prog-a { width: 38px; height: 38px; }
}
