/* Still Out There v2 · the universe
   The 3D scene fills the screen. The interface is a thin layer on top: a slim top bar,
   one card of words at the bottom-left, and the way forward at the bottom-right.
   White ink on space, one warm signal colour for "live" and "you are here". */

@font-face { font-family: "Geist"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/geist-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/geist-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/geist-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/geist-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }

:root {
  color-scheme: dark;
  --ink: #f2efe8;
  --ink-2: rgba(242, 239, 232, .78);
  --muted: rgba(242, 239, 232, .55);
  --line: rgba(255, 255, 255, .14);
  --glass: rgba(12, 12, 15, .82);
  --solid: #0b0b0d;
  --accent: #ff6a33;
  --sans: "Geist", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", "IBM Plex Sans Arabic", ui-monospace, Menlo, Consolas, monospace;
  --pad: clamp(18px, 3vw, 44px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1:focus, .card-host:focus { outline: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; line-height: 1.5; }
.skip { position: fixed; inset-inline-start: 8px; top: -100px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #000; }
.skip:focus { top: 8px; }
.loading { color: var(--muted); font-family: var(--mono); font-size: .875rem; }
.eyebrow { font-family: var(--mono); font-size: .6875rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--ink-2); text-wrap: pretty; }
.tag { margin-inline-start: 6px; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); font-size: .625rem; color: var(--muted); text-transform: uppercase; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .06);
  color: var(--ink); font-size: .9375rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #000; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-meta { font-family: var(--mono); font-size: .6875rem; opacity: .6; }
.play { width: 0; height: 0; border-block: 5px solid transparent; border-inline-start: 8px solid currentColor; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2px; height: 4px; background: currentColor; }
[aria-pressed="true"] .eq i { animation: eq .9s ease-in-out infinite; }
[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.3s; }
[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 50% { height: 12px; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 106, 51, .6); } 100% { box-shadow: 0 0 0 9px rgba(255, 106, 51, 0); } }
.mark { width: 12px; height: 12px; flex: none; fill: none; stroke-width: 2; vertical-align: -1px; }
.mark-silent { stroke: var(--ink-2); }
.mark-still-working { fill: var(--accent); stroke: var(--accent); }
.mark-drifting { stroke: var(--ink-2); }

/* ---------- the universe ---------- */
.space { position: fixed; inset: 0; }
.universe { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.universe:active { cursor: grabbing; }
.vignette { position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 32%, transparent 55%),
              linear-gradient(0deg, rgba(0, 0, 0, .7) 0%, transparent 30%),
              linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, transparent 14%); }
[dir="rtl"] .vignette { transform: scaleX(-1); }
body.is-side .vignette { background: linear-gradient(270deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .6) 45%, transparent 75%); }
[dir="rtl"] body.is-side .vignette, body.is-side[dir="rtl"] .vignette { transform: scaleX(-1); }
body.is-dusty .vignette { background: radial-gradient(ellipse at 60% 40%, rgba(120, 70, 35, .25), rgba(40, 20, 8, .7)), linear-gradient(90deg, rgba(0, 0, 0, .7), transparent 55%); transition: background 2s; }
body.is-quaking .space { animation: quake .16s linear infinite; }
@keyframes quake { 25% { transform: translate(3px, -1px); } 50% { transform: translate(-2px, 2px); } 75% { transform: translate(1px, 2px); } }

/* floating labels */
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; margin: -7px 0 0 -7px; padding: 0; border: 0; background: none; pointer-events: auto; transition: opacity .3s; white-space: nowrap; }
button.label { cursor: pointer; }
.label i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: rgba(0, 0, 0, .4); flex: none; }
.label.status-still-working i { border-color: var(--accent); background: var(--accent); }
.label.world i { width: 8px; height: 8px; margin: 3px; border: 0; background: var(--ink-2); }
.label span { padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); border: 1px solid var(--line); font-size: .75rem; font-weight: 500; }
.label.world span { background: none; border: 0; padding: 0; font-family: var(--mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-shadow: 0 1px 6px #000; }
button.label:hover span { background: var(--ink); color: #000; }
.label.flip { flex-direction: row-reverse; transform-origin: right; margin-left: auto; }
.label.flip { translate: calc(-100% + 14px) 0; }
.label.is-hidden { opacity: 0; pointer-events: none; }

/* ---------- top bar ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--pad) 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; justify-self: start; }
.brand-mark { position: relative; width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 50%; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.chapters { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); }
.chap { display: grid; gap: 4px; justify-items: center; padding: 6px 16px 7px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .8125rem; font-weight: 500; transition: color .2s, background .2s; }
.chap:hover { color: var(--ink); }
.chap.is-current { color: var(--ink); background: rgba(255, 255, 255, .1); }
.chap-track { display: flex; gap: 3px; }
.chap-track i { width: 10px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .18); transition: background .3s; }
.chap-track i.is-seen { background: rgba(255, 255, 255, .55); }
.chap-track i.is-here { background: var(--accent); }
.tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tool { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); color: var(--ink); font-size: .8125rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.tool:hover { background: rgba(255, 255, 255, .14); }
.map-icon { width: 12px; height: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.map-icon { background: linear-gradient(currentColor, currentColor) 0 0 / 5px 5px no-repeat, linear-gradient(currentColor, currentColor) 100% 0 / 5px 5px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 5px 5px no-repeat, linear-gradient(currentColor, currentColor) 100% 100% / 5px 5px no-repeat; }
.langs { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); }
.langs button { min-height: 30px; padding: 2px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-family: var(--mono); font-size: .6875rem; cursor: pointer; }
.langs button[lang="ar"] { font-family: var(--sans); font-size: .8125rem; }
.langs button[aria-pressed="true"] { background: var(--ink); color: #000; }
.signal { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: .75rem; color: var(--ink-2); white-space: nowrap; }
.signal i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: live 2s ease-out infinite; }
.sig-label { color: var(--ink); font-weight: 600; }

/* ---------- the card ---------- */
.card-host { position: fixed; z-index: 10; inset-inline-start: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); width: min(500px, calc(100vw - 2 * var(--pad)));
  max-height: calc(100dvh - 140px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.card-host::-webkit-scrollbar { display: none; }
body.is-side .card-host { inset-inline-start: auto; inset-inline-end: var(--pad); bottom: 110px; top: 88px; width: min(540px, calc(100vw - 2 * var(--pad))); max-height: none; }
body.is-wide .card-host { width: min(620px, calc(100vw - 2 * var(--pad))); bottom: 50%; transform: translateY(50%); }
.card { display: grid; gap: 16px; padding-bottom: 92px; text-shadow: 0 1px 14px rgba(0, 0, 0, .6); }
body.is-side .card, body.is-wide .card { padding-bottom: 0; }
.card h1 { font-size: clamp(2.6rem, 5vw, 4.6rem); font-weight: 600; line-height: .98; letter-spacing: -.045em; text-wrap: balance; }
[lang="ar"] .card h1 { letter-spacing: 0; line-height: 1.2; }
.card .eyebrow { margin-bottom: -6px; }
.card .lead { font-size: 1.0625rem; max-width: 34em; }
.thumb { justify-self: start; position: relative; display: block; width: 168px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000; cursor: zoom-in; }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s var(--ease); }
.thumb:hover img { transform: scale(1.05); }
.thumb span { position: absolute; inset-inline-start: 6px; bottom: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .7); font-size: .6875rem; font-weight: 500; text-shadow: none; }
.place { font-size: 1.25rem; color: var(--ink-2); margin-top: -8px; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .9375rem; }
.status-line strong { font-weight: 600; }
.status-still-working .status-line strong { color: var(--accent); }
.quote { font-size: 1.1875rem; line-height: 1.45; color: var(--ink); max-width: 30em; }
.now { position: relative; padding-inline-start: 18px; font-size: .875rem; color: var(--ink-2); max-width: 34em; }
.now::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: live 2s ease-out infinite; }
.now:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.tagline { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.25; color: var(--ink-2); margin-top: -6px; }
.card-start h1 { font-size: clamp(3.2rem, 8vw, 7rem); letter-spacing: -.055em; }
.card-start .lead { font-size: 1.125rem; }
.send { display: grid; gap: 10px; margin-top: 6px; }
.send-note { font-size: .875rem; color: var(--muted); max-width: 32em; }
.hold { --k: 0; position: relative; display: inline-flex; align-items: center; gap: 12px; justify-self: start; min-height: 56px; padding: 0 26px 0 20px; overflow: hidden; border: 1px solid var(--ink); border-radius: 999px;
  background: rgba(255, 255, 255, .06); color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hold-fill { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--k)); }
[dir="rtl"] .hold-fill { transform-origin: right; }
.hold-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: live 2s ease-out infinite; }
.hold-label { position: relative; mix-blend-mode: difference; color: #fff; }
.hold:hover { background: rgba(255, 255, 255, .12); }
.hold.is-sent { --k: 1; }

.stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.stat-num { white-space: nowrap; }
.stat-num { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 500; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--muted); line-height: 1.35; }
.roster { display: grid; gap: 2px; }
.roster a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .05); text-decoration: none; transition: background .2s; }
.roster a:hover { background: rgba(255, 255, 255, .12); }
.roster-name { font-weight: 600; font-size: .9375rem; }
.roster-live { font-size: .75rem; color: var(--muted); text-align: end; }

/* echo */
.fire { display: flex; align-items: center; gap: 16px; }
.laser-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.clock { font-size: 1.75rem; font-weight: 500; }
.result { min-height: 2.6em; font-size: .9375rem; }

/* dust */
.tau { display: flex; align-items: baseline; gap: 12px; }
.tau-label { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.tau-num { font-size: 3.4rem; font-weight: 500; line-height: 1; transition: color .8s; }
body.is-dusty .tau-num { color: var(--accent); }
.tau-cap { font-size: .8125rem; color: var(--ink-2); max-width: 16em; line-height: 1.35; }
.seg { display: inline-flex; justify-self: start; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); }
.seg button { min-height: 34px; padding: 4px 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: .8125rem; font-weight: 500; cursor: pointer; }
.seg [aria-pressed="true"] { background: var(--ink); color: #000; }
.myth { padding: 12px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); font-size: .9375rem; }
.myth summary { cursor: pointer; color: var(--ink-2); }
.myth em { font-style: normal; color: var(--ink); font-weight: 600; }
.myth p { margin-top: 8px; color: var(--ink-2); }

/* sounds */
.sound { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); text-shadow: none; }
.sound-kicker { font-family: var(--mono); font-size: .625rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.sound h3 { font-size: 1rem; font-weight: 600; }
.sound-row { display: flex; align-items: center; gap: 14px; }
.sound-bars { display: flex; align-items: center; gap: 2px; height: 26px; flex: 1; }
.sound-bars i { flex: 1; max-width: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.sound.playing .sound-bars i { background: var(--ink); animation: bar 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -71ms); }
@keyframes bar { 30% { height: 24px; } 60% { height: 9px; } }
.sound figcaption { font-size: .8125rem; color: var(--ink-2); }
.sound details { font-size: .8125rem; color: var(--muted); }
.sound summary { cursor: pointer; }
.sound audio { display: none; }
.sound .fine { font-size: .6875rem; color: var(--muted); }
.btn-sound { min-width: 84px; justify-content: center; }

/* finale */
.card-finale { gap: 18px; padding: 28px; border-radius: 22px; background: rgba(8, 8, 10, .72); border: 1px solid var(--line); text-shadow: none; }
.card-finale h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
.rc-controls { display: grid; gap: 8px; justify-items: start; }
.rc-controls .fine { font-size: .75rem; color: var(--muted); }
.rc-list { display: grid; }
.rc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); transition: opacity .6s var(--ease); }
.rc-name { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.rc-name:hover { text-decoration: underline; }
.rc-year { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.playing .rc-row { opacity: .4; }
.rc-row.speaking { opacity: 1 !important; }
.rc-row.speaking .rc-name::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: live 2s ease-out infinite; }
.rc-row.done { opacity: .2 !important; }
.rc-row.done.status-still-working { opacity: 1 !important; }
.rc-row.done.status-still-working .rc-name { color: var(--accent); }
.rc-caption { min-height: 2.6em; color: var(--ink-2); font-size: .9375rem; }
.rc-end { font-size: 1.125rem; font-weight: 600; }
.payoff { display: grid; gap: 8px; justify-items: start; padding: 18px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.payoff-line { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }

/* ---------- pager ---------- */
.pager { position: fixed; z-index: 20; inset-inline-end: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); display: grid; justify-items: end; gap: 10px; }
.where { font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-shadow: 0 1px 8px #000; }
.pager-btns { display: flex; align-items: center; gap: 10px; }
.round { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); font-size: 1.125rem; cursor: pointer; }
.round:hover { background: rgba(255, 255, 255, .16); }
.next { display: inline-flex; align-items: center; gap: 18px; min-height: 56px; padding: 6px 10px 6px 24px; border: 0; border-radius: 999px; background: var(--ink); color: #000; cursor: pointer; text-align: start; transition: transform .25s var(--ease), background .2s; }
[dir="rtl"] .next { padding: 6px 24px 6px 10px; }
.next:hover { background: #fff; transform: translateX(3px); }
.next-text { display: grid; line-height: 1.2; }
.next-hint { font-family: var(--mono); font-size: .625rem; text-transform: uppercase; letter-spacing: .1em; opacity: .55; }
#next-name { font-weight: 600; font-size: 1rem; }
.next-arrow { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #000; color: var(--ink); font-size: 1.1rem; }
[dir="rtl"] .next-arrow, [dir="rtl"] .round span { transform: scaleX(-1); }
body.is-side .pager { bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); }

/* ---------- flight readout ---------- */
.flight { position: fixed; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; text-align: center; pointer-events: none; text-shadow: 0 2px 20px #000; }
.flight-clock { font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 500; line-height: 1.05; }
.flight-km { font-size: .875rem; color: var(--ink-2); min-height: 1.4em; }
.flight-note { font-size: .75rem; color: var(--muted); max-width: 26em; margin-top: 6px; }

/* ---------- map ---------- */
.map { position: fixed; inset: 0; z-index: 40; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 28px) var(--pad) 48px; background: rgba(4, 4, 6, .9); backdrop-filter: blur(20px); }
.map-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 16px; margin-bottom: 28px; }
.map-head h2 { font-size: 2.2rem; font-weight: 600; letter-spacing: -.035em; }
.map-head p { grid-row: 2; }
.map-head .icon-btn { grid-row: 1 / 3; grid-column: 2; }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.map-col h3 { padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 600; }
.map-col h3 .num { font-size: .75rem; }
.map-stop { display: grid; grid-template-columns: 46px 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 12px; padding: 8px; border-radius: 12px; text-decoration: none; }
.map-stop:hover { background: rgba(255, 255, 255, .07); }
.map-stop img, .map-thumb { grid-row: span 2; width: 46px; height: 46px; object-fit: cover; border-radius: 8px; background: rgba(255, 255, 255, .06); }
.map-name { font-weight: 600; font-size: .9375rem; }
.map-meta { display: flex; align-items: center; gap: 6px; grid-column: 2; font-size: .75rem; color: var(--muted); }
.map-tag { grid-row: span 2; grid-column: 3; font-size: .75rem; color: var(--muted); }
.map-tag.here { font-family: var(--mono); font-size: .625rem; text-transform: uppercase; color: var(--accent); }
.map-stop.is-here { background: rgba(255, 255, 255, .09); }

/* ---------- layers: story, photo, sources ---------- */
#layer { position: fixed; inset: 0; z-index: 50; background: rgba(4, 4, 6, .9); backdrop-filter: blur(24px); }
.lightbox { position: absolute; inset: 0; display: grid; place-items: center; padding: 64px var(--pad); }
.lightbox figure { display: grid; gap: 14px; max-width: min(1100px, 100%); }
.lightbox img { max-height: 74vh; width: auto; margin: 0 auto; border-radius: 6px; }
.lightbox img.pixelated { image-rendering: pixelated; min-width: min(90vw, 700px); }
.lightbox figcaption { font-size: .9375rem; color: var(--ink-2); max-width: 52em; }
.lightbox-close { position: absolute; top: 20px; inset-inline-end: 20px; }
.story, .sheet { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; }
.sheet { grid-template-rows: auto 1fr; }
.story-top, .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--pad) 14px; }
.story-close { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .06); cursor: pointer; font-weight: 500; font-size: .875rem; }
.story-close:hover { background: rgba(255, 255, 255, .14); }
.story-who { display: flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.story-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; }
.story-rail { display: grid; align-content: start; gap: 2px; padding: 24px 14px; }
.story-rail button { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; width: 100%; padding: 10px 14px; border: 0; border-radius: 12px; background: none; color: var(--muted); text-align: start; cursor: pointer; font-size: .9375rem; }
.story-rail button:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.rail-n { font-family: var(--mono); font-size: .6875rem; }
.story-rail .done button { color: var(--ink-2); }
.story-rail .now button { background: rgba(255, 255, 255, .1); color: var(--ink); font-weight: 600; }
.story-rail .now .rail-n { color: var(--accent); }
.story-stage { display: grid; overflow-y: auto; min-height: 0; padding: 36px var(--pad) 40px; }
.chapter { grid-area: 1 / 1; display: grid; gap: 22px; align-content: start; max-width: 760px; }
.chapter-num { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.roman { color: var(--accent); }
.chapter-title { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 600; line-height: 1; letter-spacing: -.045em; }
[lang="ar"] .chapter-title { letter-spacing: 0; line-height: 1.25; }
.chapter-body { display: grid; gap: 22px; }
.narr { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.sentence { transition: color .3s, background-color .3s; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.is-listening .sentence { color: var(--muted); }
.is-listening .sentence.read { color: var(--ink-2); }
.sentence.reading { color: #000 !important; background: var(--ink); }
.sister { display: grid; gap: 8px; padding: 18px; border-radius: 16px; background: rgba(255, 255, 255, .06); }
.sister h3 { font-size: 1rem; font-weight: 600; }
.sister .narr { font-size: 1.0625rem; }
.chapter-media { display: grid; gap: 10px; }
.chapter-media img { max-height: 50vh; width: auto; border-radius: 8px; }
.chapter-media img[src*="opportunity"] { image-rendering: pixelated; min-width: min(100%, 440px); }
.chapter-media figcaption { font-size: .875rem; color: var(--ink-2); max-width: 48em; }
.facts-wrap { display: grid; gap: 14px; }
.facts-toggle { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 16px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .06); cursor: pointer; font-weight: 500; font-size: .875rem; }
.facts-toggle:hover, .facts-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.facts-n { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #000; font-family: var(--mono); font-size: .75rem; }
.facts { display: grid; gap: 12px; }
.facts ul { display: grid; gap: 10px; }
.facts li { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: .9375rem; }
.facts .src { margin-top: 6px; font-family: var(--mono); font-size: .6875rem; color: var(--muted); }
.facts .fine { font-size: .8125rem; color: var(--muted); }
.story-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 12px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 16px); }
.btn-listen { min-width: 140px; justify-content: center; }
.story-voice { flex-basis: 100%; text-align: center; font-size: .6875rem; color: var(--muted); }
.chapter-end { align-content: center; min-height: 50vh; }
.end-tag { font-size: 1.5rem; color: var(--ink-2); }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-body { overflow-y: auto; padding: 24px var(--pad) 80px; display: grid; gap: 14px; align-content: start; max-width: 860px; }
.sheet-body h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 600; letter-spacing: -.04em; }
.sheet-body h2 { margin-top: 18px; font-size: 1.0625rem; font-weight: 600; }
.bullets { list-style: disc; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.src-list { counter-reset: s; }
.src-list li { counter-increment: s; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.src-list li::before { content: counter(s, decimal-leading-zero); display: inline-block; width: 2.6em; font-family: var(--mono); font-size: .6875rem; color: var(--muted); }

/* first paint */
body:not(.is-ready) .top, body:not(.is-ready) .pager { opacity: 0; }
.top, .pager { transition: opacity .8s var(--ease); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) { .signal { display: none; } }
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; grid-template-areas: "brand tools" "chapters chapters"; row-gap: 10px; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .brand { grid-area: brand; font-size: .9375rem; }
  .tools { grid-area: tools; }
  .tool:not(.icon-tool) span:last-child { display: none; }
  .tool { padding: 6px 12px; }
  .chapters { grid-area: chapters; justify-self: stretch; justify-content: space-between; }
  .chap { padding: 5px 8px 6px; font-size: .75rem; flex: 1; }
  .vignette { background: linear-gradient(0deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .7) 38%, transparent 62%), linear-gradient(180deg, rgba(0, 0, 0, .6) 0%, transparent 18%); }
  [dir="rtl"] .vignette { transform: none; }
  body.is-side .vignette { background: linear-gradient(0deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .8) 60%, rgba(0, 0, 0, .3)); }
  .card-host, body.is-side .card-host, body.is-wide .card-host { inset-inline: 16px; width: auto; top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); max-height: 44dvh; transform: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent); mask-image: linear-gradient(to bottom, #000 88%, transparent); }
  body.is-wide .card-host { max-height: 62dvh; }
  .card-machine .small.muted { display: none; }
  .card .stat-label br { display: none; }
  .chap { white-space: nowrap; font-size: .6875rem; }
  body.is-side .card-host { top: 120px; max-height: none; }
  .card { padding-bottom: 8px; gap: 12px; }
  .card h1 { font-size: 2.1rem; }
  .card-start h1 { font-size: 3rem; }
  .quote { font-size: 1.0625rem; }
  .card .lead { font-size: .9375rem; }
  .pager { inset-inline: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); grid-template-columns: 1fr; justify-items: stretch; }
  .where { display: none; }
  .pager-btns { justify-content: space-between; }
  .next { flex: 1; justify-content: space-between; min-height: 56px; }
  .round { flex: none; }
  .map-grid { grid-template-columns: 1fr; }
  .story-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .story-rail { display: flex; overflow-x: auto; padding: 4px 12px; }
  .story-rail button { grid-template-columns: auto; padding: 8px 12px; white-space: nowrap; }
  .rail-t { display: none; }
  .story-rail .now .rail-t { display: inline; }
  .story-rail .now button { grid-template-columns: auto auto; gap: 8px; }
  .story-who .muted { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- loading curtain ---------- */
.boot { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 18px; background: #000; color: var(--ink-2); }
.boot-mark { position: relative; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; }
.boot-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); animation: live 2s ease-out infinite; }
.boot-text { font-size: .875rem; letter-spacing: .02em; }
.boot-line { width: 140px; height: 1px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.boot-line i { display: block; width: 40%; height: 100%; background: var(--ink); animation: boot 1.4s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.icon-tool { padding: 6px 12px; }
.icon-tool[aria-pressed="false"] .eq i { height: 2px; opacity: .5; }
.icon-tool[aria-pressed="true"] .eq i { animation: eq 1.2s ease-in-out infinite; }
.icon-tool[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.4s; }
.icon-tool[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.8s; }

/* ---------- the machine speaks ---------- */
.voice { display: grid; gap: 14px; justify-items: start; }
.voice-line { font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.4; font-weight: 500; letter-spacing: -.01em; max-width: 26em; min-height: 2.9em; text-wrap: pretty; }
.voice-line.speaking { color: #fff; }
.voice-line.in { animation: line-in .5s var(--ease); }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.btn-voice { min-width: 132px; justify-content: center; }
.btn-voice .eq i, .btn-sound .eq i { height: 4px; }
.btn-sound[aria-pressed="true"] { background: rgba(255, 106, 51, .18); border-color: var(--accent); }
.actions .thumb { width: 44px; height: 44px; border-radius: 999px; padding: 0; }
.actions .thumb img { height: 100%; aspect-ratio: auto; }
.actions .thumb span { display: none; }
.hint { font-size: .8125rem; color: var(--muted); }
.card .stat-label br { display: none; }

/* ---------- "more about this" ---------- */
.info { font-size: .8125rem; color: var(--muted); text-shadow: none; }
.info summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 4px 0; }
.info summary::-webkit-details-marker { display: none; }
.info summary:hover { color: var(--ink); }
.info-i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid currentColor; font-family: var(--mono); font-size: .625rem; font-style: normal; }
.info-body { display: grid; gap: 6px; margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); color: var(--ink-2); max-width: 34em; }
