/* NurdHub — the 3D experience shell, ported from intelligysoftware.com.
 *
 * Two layouts share one document:
 *   - default (no JS, no module support, no WebGL, or html.no-webgl): the beats
 *     flow top to bottom as a normal page, and the stage layers are hidden;
 *   - html.xp (set by the head script and confirmed by initShell): a fixed
 *     canvas stage with the beats layered over it, driven by scroll.
 * Every fixed-stage rule is scoped under html.xp so the fallback never needs
 * its own overrides. Single dark world by design: one machine in a dark room.
 */

:root {
  color-scheme: dark;
  --void: #050608;
  --ink: #e9eef4;
  --dim: #8b97a7;
  --faint: #4a5566;
  --cyan: #ff8a3d;   /* NurdHub orange; the token keeps the intelligy name so ported rules read the same */
  --blue: #7cc8ff;
  --gold: #d8b46a;
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Outfit", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, serif;
}

/* Self-hosted Latin variable cuts of the Google fonts (#59), so no page contacts
   Google; assets/fonts/OFL.txt carries their licence. Newsreader keeps its opsz axis. */
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("assets/fonts/familjen-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("assets/fonts/newsreader-latin-opsz.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 500; font-display: swap; src: url("assets/fonts/outfit-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--void); color: var(--ink); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-weight: 300; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- Type (both layouts) ---------- */
.wm { margin: 0; font: 600 clamp(58px, 12vw, 148px)/.86 var(--display); letter-spacing: -.045em; }
.wm .i { color: var(--cyan); }
.beat h2 { margin: 10px 0 0; font: 600 clamp(28px, 4.2vw, 52px)/1.02 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.beat p { margin: 14px 0 0; font: 300 clamp(16px, 1.45vw, 20px)/1.55 var(--body); color: #cfd8e3; max-width: 33rem; text-wrap: pretty; }
.kicker { font: 400 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
/* The start cue (#74): a tappable pill whose copy and icon name the device's gesture.
   Mouse by default; the touch query below swaps in "Swipe up" and a rising chevron. */
.cue {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 20px 0 16px; margin-top: 26px;
  border: 1px solid rgba(255,138,61,.45); border-radius: 999px; background: rgba(5,6,8,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 400 12.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); text-decoration: none; text-shadow: none;
  transition: border-color .3s, background-color .3s, box-shadow .3s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.cue:hover { border-color: var(--cyan); background: rgba(255,138,61,.08); }
.cue:active { background: rgba(255,138,61,.14); }
.cue-touch { display: none; }
.cue-icon { position: relative; flex: none; box-sizing: border-box; width: 12px; height: 18px; border: 1.5px solid var(--cyan); border-radius: 7px; }
.cue-icon::after {
  content: ""; position: absolute; left: 50%; top: 3px; width: 2px; height: 4px; margin-left: -1px; border-radius: 1px;
  background: var(--cyan); animation: cue-wheel 2.4s cubic-bezier(.45,0,.55,1) infinite;
}
/* The idle nudge; separate "far" keyframes because Safari does not reliably restart a running animation. */
.cue.nudge { border-color: var(--cyan); animation: cue-ping 2.4s cubic-bezier(.2,.7,.2,1) infinite; }
.cue.nudge .cue-icon::after { animation-name: cue-wheel-far; }
@keyframes cue-wheel { 0% { transform: translateY(0); opacity: 1; } 70%, 100% { transform: translateY(5px); opacity: 0; } }
@keyframes cue-wheel-far { 0% { transform: translateY(0); opacity: 1; } 70%, 100% { transform: translateY(8px); opacity: 0; } }
@keyframes cue-rise { 0%, 100% { transform: translateY(3px) rotate(45deg); opacity: .45; } 50% { transform: translateY(-3px) rotate(45deg); opacity: 1; } }
@keyframes cue-rise-far { 0%, 100% { transform: translateY(6px) rotate(45deg); opacity: .45; } 50% { transform: translateY(-6px) rotate(45deg); opacity: 1; } }
@keyframes cue-ping { 0% { box-shadow: 0 0 0 0 rgba(255,138,61,.35); } 70%, 100% { box-shadow: 0 0 0 10px rgba(255,138,61,0); } }

.beat.close { text-align: center; }
.beat.close .wm { font-size: clamp(52px, 9vw, 120px); }
.beat.close .era a { color: var(--ink); text-underline-offset: 3px; }
.beat.close .era a:hover { color: var(--cyan); }
.beat.close .era { margin: 16px auto 0; font: 400 11px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); max-width: none; }
.beat.close .mail { display: inline-block; margin: 12px auto 0; font: 400 15px/1 var(--mono); color: var(--ink); text-decoration: none; user-select: all; }
.beat.close .mail:hover { color: var(--cyan); }
/* The legal line (#59): the close beat in html.xp, the page's last line in the static layout. */
.beat.close .legal { margin: 22px auto 0; font: 400 10.5px/1.6 var(--mono); letter-spacing: .12em; color: var(--dim); max-width: none; }
.legal a { color: var(--ink); text-underline-offset: 3px; }
.legal a:hover { color: var(--cyan); }

/* ---------- Release card (mounted by shell.js only when NEWS has a released entry) ---------- */
.dispatch {
  margin-top: 18px; display: grid; gap: 6px; max-width: 26rem; padding: 12px 14px;
  border: 1px solid rgba(216,180,106,.35); border-radius: 10px; background: rgba(10,12,16,.72); text-shadow: none;
  color: inherit; text-decoration: none;
}
.dispatch:hover { border-color: rgba(216,180,106,.7); }
.dispatch .d-k { font: 500 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.dispatch .d-k::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(216,180,106,.7); animation: beacon 1.8s ease-out infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(216,180,106,.7); } 100% { box-shadow: 0 0 0 10px rgba(216,180,106,0); } }
.dispatch b { font: 500 16px/1.35 var(--display); color: var(--ink); }
.dispatch .d-meta { font: 400 11px/1.4 var(--mono); color: var(--dim); }

/* ---------- Product caption (filled by the product ring, epic #40 child 4) ---------- */
.pc-inner { transition: opacity .35s ease, transform .35s ease; }
.pc-inner.swap { opacity: 0; transform: translateY(8px); }
.pc-top { display: flex; gap: 14px; align-items: center; }
.pc-idx { font: 400 11px/1 var(--mono); letter-spacing: .16em; color: var(--faint); font-variant-numeric: tabular-nums; }
.status { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(216,180,106,.45); border-radius: 999px; padding: 5px 10px; }
.status:empty { display: none; }

/* ---------- Principals (filled by epic #40 child 5) ---------- */
.people-row { margin-top: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.people-row:empty { display: none; }
.person { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border-radius: 12px; background: rgba(7,9,12,.72); border: 1px solid rgba(255,255,255,.06); text-shadow: none; }
.person img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; filter: grayscale(.25) contrast(1.05); }
.person .role { display: block; font: 400 10px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.person b { display: block; margin-top: 6px; font: 600 18px/1.2 var(--display); color: var(--ink); }
.person p { margin: 8px 0 0; font: 300 13.5px/1.5 var(--body); color: #c3ccd7; }

/* ---------- Domains and their standards (the "What we do" beat, #43) ---------- */
.domain-list { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.domain-list:empty { display: none; }
.domain-list li { padding-left: 14px; border-left: 1px solid rgba(216,180,106,.35); }
.domain-list b { display: block; font: 600 17px/1.25 var(--display); color: var(--ink); }
.domain-list span { display: block; margin-top: 4px; font: 400 10.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* ---------- The office floor (scene 5) and the product list ---------- */
.legend { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font: 400 10.5px/1.4 var(--mono); letter-spacing: .08em; color: var(--dim); text-shadow: none; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px; border: 1.5px solid currentColor; }
.legend .lp { border-radius: 50%; color: var(--gold); }
.legend .la { border-radius: 3px; color: #a585f5; }
.legend .lf { width: 18px; height: 0; border: 0; border-top: 2px dashed var(--gold); vertical-align: 3px; }
.product-list { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.product-list:empty { display: none; }
.product-list b { font: 600 16px/1.3 var(--display); color: var(--ink); }
.product-list span { font: 400 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
#pc-release:empty { display: none; }

/* ---------- Press release pages (/news/) ---------- */
.news { max-width: 42rem; margin: 0 auto; padding: 10vh 1.5rem; }
.news h1 { margin: 12px 0 0; font: 600 clamp(30px, 4.5vw, 48px)/1.08 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.news p, .news li { font: 300 17px/1.6 var(--body); color: #cfd8e3; }
.news .kicker a { color: var(--cyan); text-decoration: none; }
.news-list { padding: 0; list-style: none; display: grid; gap: 10px; }
.news-list time { margin-left: 10px; font: 400 11px/1 var(--mono); color: var(--dim); }
.news h2 { margin: 36px 0 0; font: 600 20px/1.25 var(--display); letter-spacing: -.01em; }
.news ul { padding-left: 1.2rem; }
body.news-page .legal { max-width: 42rem; margin: 0 auto; padding: 0 1.5rem 8vh; font: 400 10.5px/1.6 var(--mono); letter-spacing: .12em; color: var(--dim); }

/* ---------- The pause control (#59, WCAG 2.2.2) ---------- */
/* Only the film shows it; main.js drops [hidden] once the stage exists. */
.motion-toggle { display: none; }
html.xp .motion-toggle:not([hidden]) {
  position: fixed; z-index: 5; top: calc(env(safe-area-inset-top, 0px) + 14px); right: max(16px, 2.4vw);
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 11px;
  border: 1px solid rgba(233,238,244,.16); border-radius: 999px; background: rgba(5,6,8,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 400 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); cursor: pointer;
  transition: color .25s, border-color .25s, background-color .25s; appearance: none;
}
html.xp .motion-toggle:hover { color: var(--ink); border-color: rgba(233,238,244,.32); }
html.xp .motion-toggle[aria-pressed="true"] { color: var(--ink); border-color: rgba(255,138,61,.55); background: rgba(255,138,61,.10); }
.mt-icon {
  flex: none; width: 10px; height: 10px; background: currentColor;
  clip-path: polygon(0 0, 36% 0, 36% 100%, 64% 100%, 64% 0, 100% 0, 100% 100%, 0 100%);
  transition: clip-path .22s cubic-bezier(.2,.7,.2,1);
}
/* Both glyphs have 8 points, so the pause bars fold into the play triangle. */
.motion-toggle[aria-pressed="true"] .mt-icon { color: var(--cyan); clip-path: polygon(8% 0, 54% 25%, 54% 75%, 54% 75%, 54% 25%, 100% 50%, 100% 50%, 8% 100%); }
/* Paused: the CSS loops hold too. */
html[data-motion="paused"] .cue-icon::after, html[data-motion="paused"] .cue.nudge, html[data-motion="paused"] .dispatch .d-k::before { animation-play-state: paused; }

/* ---------- The next-chapter button (#74) ---------- */
/* Film only, like the pause control; shell.js bindNextStop adds .show after 1.2 s of stillness. */
.next-stop { display: none; }
html.xp .next-stop:not([hidden]) {
  position: fixed; z-index: 5; right: max(16px, 2.4vw); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(233,238,244,.16); border-radius: 50%; background: rgba(5,6,8,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--dim); cursor: pointer; appearance: none;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .3s cubic-bezier(.2,.7,.2,1), transform .3s cubic-bezier(.2,.7,.2,1), color .25s, border-color .25s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
html.xp .next-stop.show { opacity: 1; pointer-events: auto; transform: none; }
html.xp .next-stop:hover, html.xp .next-stop:focus-visible { color: var(--ink); border-color: rgba(255,138,61,.55); }
.ns-icon {
  width: 10px; height: 10px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.next-stop:hover .ns-icon, .next-stop:focus-visible .ns-icon { transform: translateY(0) rotate(45deg); }

/* ---------- Default layout: a normal readable page ---------- */
#stage, #flash, #labels, .rail-nav, #scroll { display: none; }
.beat { max-width: 42rem; margin: 0 auto; padding: 12vh 1.5rem; opacity: 1; }
/* The static page has no pause control, so its loops stop within 5 s (WCAG 2.2.2). */
html:not(.xp) .cue-icon::after, html:not(.xp) .dispatch .d-k::before { animation-iteration-count: 2; animation-fill-mode: forwards; }
html:not(.xp) .beat[data-beat="product"] .pc-inner { display: none; }

/* ---------- html.xp: the fixed stage ---------- */
html.xp #stage { display: block; position: fixed; inset: 0; z-index: 0; }
html.xp #stage canvas { display: block; width: 100%; height: 100%; }
html.xp #scroll { display: block; height: 1260vh; }   /* timeline.js SCROLL_VH: (SCREENS + 1) × 100 */

html.xp #flash {
  display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,246,236,1) 0%, rgba(255,190,140,.85) 32%, rgba(70,30,10,0) 78%);
}
html.xp #flash.rm { background: var(--void); }

html.xp #labels { display: block; position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
html.xp .node-label { position: absolute; left: 0; top: 0; white-space: nowrap; text-align: center; opacity: 0; will-change: transform, opacity; }
html.xp .node-label b { display: block; font: 500 15px/1.2 var(--display); letter-spacing: .01em; color: var(--ink); text-shadow: 0 0 18px rgba(4,6,10,.95); }
html.xp .node-label span { display: block; margin-top: 5px; font: 400 10px/1.35 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
html.xp .node-label.portal b { font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
html.xp .node-label.office b { font: 500 13px/1.2 var(--display); }
html.xp .node-label.office span { margin-top: 4px; font-size: 9px; letter-spacing: .14em; color: var(--dim); }
html.xp .node-label.office.person b { font-size: 15px; color: var(--gold); }
html.xp .node-label.office.person span { color: var(--gold); }
/* The ring shows one product at a time; the full list stays the beat's accessible text. */
html.xp .product-list { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* The 3D labels carry the list visually; it stays the beat's accessible text. */
html.xp .domain-list { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

html.xp .beats { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
html.xp .beat {
  position: absolute; left: max(16px, 5vw); right: max(16px, 5vw); max-width: 36rem; margin: 0; padding: 0;
  opacity: 0; will-change: opacity, transform;
  text-shadow: 0 0 28px rgba(4,6,10,.95), 0 0 2px rgba(4,6,10,.9);
}
/* Tappable before the first frame; applyBeats' inline style takes over once frames run. */
html.xp .beat.hero { bottom: max(48px, 9vh); opacity: 1; pointer-events: auto; }
html.xp .beat.b1, html.xp .beat.b2 { bottom: max(56px, 12vh); }
html.xp .beat.b3 { bottom: max(48px, 8vh); }
html.xp .beat.product { display: block; bottom: max(40px, 7vh); max-width: 34rem; }
html.xp .beat.people { top: calc(env(safe-area-inset-top, 0px) + 12vh); max-width: 46rem; }
html.xp .beat.close { bottom: max(48px, 10vh); left: 0; right: 0; max-width: none; }
html.xp .beat.floor { bottom: max(40px, 7vh); max-width: 30rem; }
/* Wide screens: the floor plan sits between the text column and the rail. */
@media (min-aspect-ratio: 23/20) {
  html.xp .beat.floor { top: 22vh; bottom: auto; max-width: min(30rem, 31vw); }
  html.xp .beats .beat.people { max-width: min(27rem, 33vw); top: calc(env(safe-area-inset-top, 0px) + 8vh); }
  html.xp .beat.people .people-row { grid-template-columns: 1fr; gap: 12px; }
  html.xp .beat.people .person p { font-size: 12.5px; }
}

html.xp .rail {
  position: fixed; z-index: 4; right: max(16px, 2.4vw); top: 50%; transform: translateY(-50%);
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
}
html.xp .rail-nav { display: block; }
html.xp .rail button {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 6px 0;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  font: 400 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  transition: color .35s;
}
html.xp .rail button::after { content: ""; width: 16px; height: 1px; background: currentColor; transition: width .35s, background .35s; }
html.xp .rail button:hover { color: var(--dim); }
html.xp .rail li.on button { color: var(--ink); }
html.xp .rail li.on button::after { width: 34px; background: var(--cyan); }

@media (max-width: 720px) {
  .people-row { grid-template-columns: 1fr; gap: 12px; }
  .person p { font-size: 12.5px; }
  html.xp .beat.people { top: calc(env(safe-area-inset-top, 0px) + 64px); }
}
@media (max-width: 640px) {
  /* Clear the next-chapter button's 44px column; .beat.close keeps right: 0 by specificity. */
  html.xp .beat { right: calc(max(16px, 2.4vw) + 52px); }
  /* Visually hidden, still the button's accessible name. */
  html.xp .rail button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  /* Long notes wrap instead of clipping off a phone's edges. */
  html.xp .node-label { white-space: normal; max-width: 62vw; }
  html.xp .node-label b { font-size: 13px; white-space: nowrap; }
  html.xp .node-label span { font-size: 9px; }
  html.xp .node-label.office span { display: none; }
  html.xp .node-label.office b { font-size: 11px; }
  /* The pause control becomes an icon-only circle; the label stays its accessible name. */
  html.xp .motion-toggle:not([hidden]) { width: 40px; height: 40px; padding: 0; justify-content: center; }
  html.xp .motion-toggle .mt-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
/* Short landscape screens (phones on their side): smaller type, the floor text starts higher,
   and the principals sit side by side under their lit seats (#58). floor.js SHORT_H must match. */
@media (max-height: 500px) and (orientation: landscape) {
  html.xp .beat h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.04; margin-top: 8px; }
  html.xp .beat > p, html.xp .pc-inner > p { margin-top: 10px; font-size: 14.5px; line-height: 1.45; }
  html.xp .beats .beat.floor { top: calc(env(safe-area-inset-top, 0px) + 14px); bottom: auto; }
  html.xp .beat.floor .legend { display: none; }
  html.xp .beats .beat.people { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); right: max(64px, 8vw); max-width: 46rem; }
  html.xp .beat.people .people-row { margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  html.xp .beat.people .person { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  html.xp .beat.people .person img { width: 56px; height: 56px; }
  html.xp .beat.people .person b { margin-top: 4px; font-size: 16px; }
  html.xp .beat.people .person p { margin-top: 6px; font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
  /* Visually hidden, still the button's accessible name. */
  html.xp .rail button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  html.xp .motion-toggle:not([hidden]) { top: calc(env(safe-area-inset-top, 0px) + 10px); }
}
@media (max-height: 500px) and (orientation: landscape) and (min-width: 641px) {
  html.xp .motion-toggle:not([hidden]) { height: 28px; }
}
/* Portrait: the bottom copy in scenes 1–2 sits over the lit screen and cryostat; a soft scrim keeps it legible (#58). */
@media (orientation: portrait) {
  html.xp .beat.hero::before, html.xp .beat.b1::before, html.xp .beat.b2::before {
    content: ""; position: absolute; z-index: -1; top: -96px; bottom: -30vh; left: calc(-1 * max(16px, 5vw)); width: 100vw; pointer-events: none;
    background: linear-gradient(to bottom, rgba(5,6,8,0), rgba(5,6,8,.62) 96px, rgba(5,6,8,.8));
  }
}
/* Touch screens (#74): "Swipe up" and a rising chevron. By media query, not UA, since iPad Safari reports a Mac.
   Before the reduced-motion block: its animation rule has the same specificity, so source order decides. */
@media (hover: none) and (pointer: coarse) {
  .cue-touch { display: inline; }
  .cue-mouse { display: none; }
  .cue-icon { width: 12px; height: 12px; border: 0; border-radius: 0; }
  .cue-icon::after {
    left: 50%; top: 50%; width: 8px; height: 8px; margin: -2px 0 0 -4px;
    border-top: 1.5px solid var(--cyan); border-left: 1.5px solid var(--cyan); background: none; border-radius: 0;
    animation: cue-rise 2.4s cubic-bezier(.45,0,.55,1) infinite;
  }
  .cue.nudge .cue-icon::after { animation-name: cue-rise-far; }
}
/* Touch rail: readable labels and finger-sized targets; short landscape keeps its compact rail. */
@media (hover: none) and (pointer: coarse) and (min-height: 501px) {
  html.xp .rail button { color: var(--dim); min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .cue-icon::after, .cue.nudge .cue-icon::after, .cue.nudge { animation: none; }
  html.xp .next-stop:not([hidden]) { transition: none; transform: none; }
  /* The chevron is a rotated corner, so it keeps its rotation and only loses the 2px drop. */
  .ns-icon, .next-stop:hover .ns-icon, .next-stop:focus-visible .ns-icon { transition: none; transform: rotate(45deg); }
  .dispatch .d-k::before { animation: none; }
  .mt-icon, html.xp .motion-toggle:not([hidden]) { transition: none; }
}

/* ---------- NurdHub ---------- */
.wm .hub { color: var(--cyan); }
.byline { display: inline-flex; align-items: center; gap: 9px; font: 400 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-bottom: 16px; }
.byline b { font: 600 14px/1 var(--display); letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.byline img { width: 18px; height: 18px; }
.byline.center { margin: 18px auto 0; }
.beat .lede { margin-top: 18px; font: 500 clamp(22px, 2.6vw, 34px)/1.15 var(--display); color: var(--ink); letter-spacing: -.01em; }
.beat h2.big { font-size: clamp(40px, 6.4vw, 84px); letter-spacing: -.035em; }
.beat p b { font-weight: 500; color: var(--ink); }
.gap-list, .view-list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 34rem; }
.gap-list li { padding-left: 14px; border-left: 1px solid rgba(255,138,61,.4); font: 300 clamp(15px, 1.3vw, 18px)/1.45 var(--body); color: #cfd8e3; }
.view-list li { font: 300 15px/1.4 var(--body); color: #c3ccd7; transition: opacity .35s; }
html.xp .view-list li { opacity: .38; }
html.xp .view-list li.on { opacity: 1; }
html.xp .view-list li.on b { color: var(--cyan); }
.view-list b { display: inline-block; min-width: 11.5em; font: 600 16px/1.3 var(--display); color: var(--ink); }
.legend i { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.cta { display: inline-flex; align-items: center; min-height: 46px; margin-top: 22px; padding: 0 22px; border-radius: 999px; background: var(--cyan); color: #140a04; font: 600 15px/1 var(--display); text-decoration: none; text-shadow: none; }
.cta:hover { background: #ffa264; }
html.xp .beat.low { bottom: max(48px, 9vh); }
html.xp .beat.top { top: calc(env(safe-area-inset-top, 0px) + 9vh); }
html.xp .beat.hero { bottom: max(48px, 10vh); }
html.xp .node-label.county b { font: 500 13px/1.2 var(--display); }
html.xp .node-label.county span { margin-top: 4px; font-size: 9.5px; letter-spacing: .14em; color: var(--dim); }
html.xp .node-label.hub b { font: 600 13px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); }
html.xp .node-label.event { text-align: left; padding: 9px 12px 10px; border-left: 2px solid var(--cyan); background: rgba(5,8,12,.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html.xp .node-label.event span { margin: 0 0 5px; font: 500 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
html.xp .node-label.event b { font: 500 15px/1.25 var(--display); text-shadow: none; }
html.xp .node-label.report b { font: 600 15px/1.2 var(--display); }
html.xp .node-label.report span { color: var(--blue); }
html.xp .node-label.packet b { font: 600 11px/1 var(--mono); letter-spacing: .18em; color: #fff; padding: 5px 8px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; background: rgba(5,8,12,.6); }
html.xp .node-label.trust b { font: 500 16px/1.2 var(--display); }
html.xp .node-label.trust span { color: var(--cyan); }
@media (max-width: 640px) {
  html.xp .node-label.county span { display: none; }
  .view-list b { min-width: 0; }
  html.xp .view-list span { display: none; }
  html.xp .view-list { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
}
/* Portrait: copy over the lit county gets the same soft scrim as the intelligy hero. */
@media (orientation: portrait) {
  html.xp .beat.low::before {
    content: ""; position: absolute; z-index: -1; top: -96px; bottom: -30vh; left: calc(-1 * max(16px, 5vw)); width: 100vw; pointer-events: none;
    background: linear-gradient(to bottom, rgba(3,6,11,0), rgba(3,6,11,.62) 96px, rgba(3,6,11,.82));
  }
}
