/* ───────── Principia · studio UI ───────── */
@font-face { font-family: "Instrument Serif"; src: url(../fonts/instrument-serif-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(../fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #070708;
  --ink: #ece5d6;
  --ink-2: #b9b2a5;
  --ink-3: #807a71;
  --line: rgba(236, 229, 214, 0.09);
  --line-2: rgba(236, 229, 214, 0.16);
  --glass: rgba(16, 16, 18, 0.66);
  --glass-2: rgba(22, 22, 25, 0.82);
  --brass: #b48d55;
  --accent: #f2b84b;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px;
  --blur: blur(18px) saturate(1.25);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --gutter: 18px;
  --t-gold: #f2b84b; --t-coral: #ff6f5e; --t-sky: #5cb8ff; --t-mint: #5fe0a6; --t-lilac: #b79cff; --t-rose: #ff8fc0; --t-ivory: #efe9dc;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > .flash, #ui > .watch-banner { pointer-events: none; }
.hidden { display: none !important; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 28px; }

/* ── generic ── */
.glass { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.btn { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em; transition: background .2s, color .2s, border-color .2s, transform .2s, opacity .2s; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-primary { background: var(--ink); color: #111; }
.btn-primary:not(:disabled):hover { background: #fff; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:not(:disabled):hover { border-color: rgba(236,229,214,.4); background: rgba(255,255,255,.04); }
.ico-play { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; display: inline-block; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background .2s, color .2s; position: relative; }
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.icon-btn.on { color: var(--ink); background: rgba(255,255,255,.08); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); right: 0; white-space: nowrap; font-size: 11.5px; color: var(--ink); background: var(--glass-2); border: 1px solid var(--line); padding: 5px 9px; border-radius: 8px; pointer-events: none; z-index: 5; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ── intro ── */
#intro { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 30%, rgba(18,17,16,.55), rgba(5,5,6,.92) 70%); transition: opacity 1.2s ease, visibility 1.2s; }
#intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-inner { text-align: center; max-width: 640px; padding: 24px; }
.intro-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 18px; }
.intro-title { font-family: var(--serif); font-weight: 400; font-size: clamp(64px, 12vw, 148px); line-height: .9; margin: 0; letter-spacing: .01em; }
.intro-lede { font-size: 16px; line-height: 1.6; color: var(--ink-2); margin: 26px auto 0; max-width: 470px; }
.intro-load { margin: 34px auto 0; width: 260px; display: grid; gap: 10px; justify-items: center; transition: opacity .6s; }
.intro-bar { width: 100%; height: 1px; background: var(--line-2); overflow: hidden; }
.intro-bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width .3s; }
#load-text { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.ready .intro-load { opacity: 0; height: 0; margin: 0; overflow: hidden; }
.intro-actions { display: flex; gap: 12px; justify-content: center; margin-top: 34px; }
.intro-hint { font-size: 12px; color: var(--ink-3); margin-top: 26px; }
.intro-lang { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; font-size: 12px; color: var(--ink-3); }
.intro-lang button { padding: 4px 8px; border-radius: 6px; color: var(--ink-3); font-size: 12px; letter-spacing: .02em; transition: color .2s, background .2s; }
.intro-lang button:hover { color: var(--ink); }
.intro-lang button.on { color: var(--ink); background: rgba(255,255,255,.08); }
.credit { position: fixed; right: max(var(--gutter), env(safe-area-inset-right, 0px)); bottom: max(var(--gutter), env(safe-area-inset-bottom, 0px)); z-index: 60; font-family: var(--mono); font-weight: 500; font-size: 9.5px; line-height: 14px; letter-spacing: .16em; color: var(--ink-3); text-decoration: none; padding: 0 2px; border-radius: 3px; transition: color .2s; }
.credit:hover, .credit:focus-visible { color: var(--ink); }
/* only when a bottom bar fills the whole width: tuck the credit under it */
body.credit-low .credit { bottom: max(var(--gutter), env(safe-area-inset-bottom, 0px)); }
#intro .credit-intro { display: none; }

/* ── top bar ── */
#top { position: absolute; top: var(--gutter); left: var(--gutter); right: var(--gutter); display: flex; align-items: center; gap: 14px; pointer-events: none; z-index: 15; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px 8px 12px; border-radius: 12px; }
.brand-mark { font-family: var(--serif); font-size: 24px; line-height: 1; letter-spacing: .02em; }
.brand-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.brand:hover .brand-mark { color: #fff; }
.home-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 12px; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; transition: opacity .35s, transform .35s, background .2s, border-color .2s; }
.home-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.home-btn:hover { background: rgba(32,32,36,.82); border-color: var(--line-2); }
.home-btn.out { opacity: 0; transform: translateX(-8px); pointer-events: none; width: 0; padding: 0; margin-left: -14px; border-width: 0; overflow: hidden; }
.edge-nav { position: absolute; top: var(--en-y, 50%); display: flex; align-items: center; min-height: 46px; min-width: 46px; padding: 0; border-radius: 23px; background: rgba(12,12,14,.72); border: 1px solid var(--line-2); color: var(--ink); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 10px 30px rgba(0,0,0,.35); transform: translateY(-50%); transition: opacity .4s, border-color .2s, background .2s; z-index: 4; overflow: hidden; }
.edge-nav.prev { left: var(--en-l, 370px); }
.edge-nav.next { right: var(--en-r, 340px); flex-direction: row-reverse; }
.edge-nav .en-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.edge-nav .en-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.edge-nav .en-label { display: grid; gap: 2px; max-width: 0; max-height: 0; opacity: 0; padding-block: 0; white-space: nowrap; text-align: left; transition: max-width .35s cubic-bezier(.2,.8,.2,1), opacity .25s, padding .35s; }
.edge-nav.next .en-label { text-align: right; }
.edge-nav .en-label small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c, var(--ink-3)); }
.edge-nav .en-label b { font-family: var(--serif); font-weight: 400; font-size: 18px; line-height: 1.1; color: var(--ink); }
.edge-nav .en-label i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.edge-nav:hover, .edge-nav:focus-visible { border-color: color-mix(in srgb, var(--c, #fff) 55%, transparent); background: rgba(16,16,19,.88); }
.edge-nav:hover .en-label, .edge-nav:focus-visible .en-label { max-width: 300px; max-height: 80px; opacity: 1; padding-block: 8px; }
.edge-nav.prev:hover .en-label, .edge-nav.prev:focus-visible .en-label { padding-right: 18px; }
.edge-nav.next:hover .en-label, .edge-nav.next:focus-visible .en-label { padding-left: 18px; }
.edge-nav.out { opacity: 0; pointer-events: none; }
.strip { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; border-radius: 12px; margin-left: 4px; transition: opacity .4s; }
.strip.dim { opacity: .35; pointer-events: none; }
.strip .t-btn { width: 28px; height: 28px; }
.s-wing { display: flex; align-items: center; gap: 2px; padding: 0 6px; border-left: 1px solid var(--line); height: 22px; }
.s-wing:first-of-type { border-left: 0; }
.s-rom { font-family: var(--serif); font-size: 14px; color: var(--ink-3); margin-right: 4px; min-width: 14px; text-align: center; }
.s-dot { width: 12px; height: 12px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.s-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--c) 55%, #444); transition: transform .2s, background .2s, box-shadow .2s; }
.s-dot:hover::after { transform: scale(1.5); background: var(--c); }
.s-dot.on::after { background: var(--c); transform: scale(1.4); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent), 0 0 12px var(--c); }
.s-title { display: inline-flex; gap: 8px; align-items: baseline; padding-left: 10px; border-left: 1px solid var(--line); margin-left: 2px; width: 200px; white-space: nowrap; overflow: hidden; }
.s-title b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--c, var(--ink-3)); }
.s-title span { font-family: var(--serif); font-size: 17px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.wings { display: flex; gap: 2px; padding: 4px; border-radius: 12px; margin-left: 4px; }
.wing-btn { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; transition: background .2s, color .2s; white-space: nowrap; }
.wing-btn i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .9; }
.wing-btn:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.wing-btn.on { color: var(--ink); background: rgba(255,255,255,.08); }
.tools { margin-left: auto; display: flex; gap: 2px; padding: 4px; border-radius: 12px; }
.tools .sep { width: 1px; margin: 8px 4px; background: var(--line-2); }
.tour-btn { height: 30px; padding: 0 12px 0 11px; border-radius: 8px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); white-space: nowrap; }
.tour-btn:hover { background: rgba(255,255,255,.06); }
.tour-btn .ico-play { border-left-width: 7px; border-top-width: 4.5px; border-bottom-width: 4.5px; }

/* ── exhibit card (left) ── */
#card { position: absolute; left: var(--gutter); top: 78px; width: 336px; max-height: calc(100% - 78px - var(--deck-h, 90px) - 2 * var(--gutter) - 6px); display: flex; flex-direction: column; overflow: hidden; transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .5s; }
#card.out, #eq.out, #deck.out { opacity: 0; pointer-events: none; }
#card.out { transform: translateX(-24px); }
.card-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.card-num { display: flex; align-items: center; gap: 10px; }
.card-num .c-fold { margin-left: auto; margin-right: -6px; }
.card-num b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--ink-2); letter-spacing: .1em; flex: none; white-space: nowrap; }
.card-num .bar { flex: none; }
.card-num .c-wing { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-num .bar { width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.card-title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.02; margin: 10px 0 6px; letter-spacing: .005em; }
.card-q { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.3; color: var(--ink-2); margin: 0; }
.tabs { display: flex; gap: 2px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 8px 10px 11px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase; transition: color .2s; }
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.card-body { padding: 16px 20px 18px; overflow-y: auto; font-size: 13.5px; line-height: 1.62; color: var(--ink-2); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.card-body p { margin: 0 0 11px; }
.card-body strong { color: var(--ink); font-weight: 560; }
.card-body em { color: var(--ink); }
.card-body .katex { font-size: 1.06em; color: var(--ink); }
.watch { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line); margin: 4px 0 12px; }
.watch .eye { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--accent); }
.watch .eye svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.watch p { margin: 0; color: var(--ink); }
.card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 14px 18px 16px; border-top: 1px solid var(--line); }
/* the two ways into an exhibit: the first thing a visitor reaches for */
.cta-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; height: 42px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; letter-spacing: .005em; white-space: nowrap; color: #121212; background: var(--accent); border: 1px solid var(--accent); box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .15s ease, filter .2s, box-shadow .2s, background .2s; }
.cta-btn > span:not(.ico-play) { overflow: hidden; text-overflow: ellipsis; }
.cta-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 90%, transparent), inset 0 1px 0 rgba(255,255,255,.4); }
.cta-btn:active { transform: none; filter: brightness(.96); }
.cta-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cta-btn svg { flex: none; width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cta-btn.ghost { color: var(--ink); background: color-mix(in srgb, var(--accent) 15%, rgba(10,10,12,.4)); border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: none; }
.cta-btn.ghost:hover { background: color-mix(in srgb, var(--accent) 26%, rgba(10,10,12,.4)); box-shadow: 0 10px 26px -14px color-mix(in srgb, var(--accent) 80%, transparent); }
.cta-btn .ico-play { flex: none; border-left-width: 8px; border-top-width: 5px; border-bottom-width: 5px; }
/* a soft pulse when an exhibit opens, so the eye finds them */
@keyframes cta-call { 0%, 100% { box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent), 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 60% { box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent), 0 0 0 9px transparent; } }
#card.called .a-predict { animation: cta-call 1.6s ease-out .5s 2; }
@media (prefers-reduced-motion: reduce) { #card.called .a-predict { animation: none; } }
.lang-btn span { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; padding: 3px 5px; border: 1px solid var(--line-2); border-radius: 6px; line-height: 1; }
.lang-btn:hover span { border-color: rgba(236,229,214,.4); }
#card.folded .tabs, #card.folded .card-body { display: none; }
#card.folded .card-head { border-bottom: 0; }
.read-more { margin-top: 2px; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink); transition: background .2s, border-color .2s; }
.chip-btn:hover { background: rgba(255,255,255,.05); border-color: rgba(236,229,214,.35); }
.chip-btn.accent { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chip-btn.accent:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chip-btn .ico-play { border-left-width: 7px; border-top-width: 4.5px; border-bottom-width: 4.5px; }
.real { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.real .kicker { display: block; margin-bottom: 6px; }

/* prove stepper */
.steps { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.step { min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.step:hover { border-color: var(--line-2); }
.step.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.step-n { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-3); }
.step-tex { margin: 6px 0 4px; color: var(--ink); overflow-x: auto; overflow-y: hidden; }
.step-tex .katex-display { margin: 0; text-align: left; }
.step-tex .katex-display > .katex { text-align: left; }
.step-text { color: var(--ink-2); }
.step:not(.on) .step-text { display: none; }

/* ── living equation (right) ── */
#eq { position: absolute; right: var(--gutter); top: 78px; width: 322px; padding: 14px 16px 12px; max-height: calc(100% - 78px - var(--deck-h, 90px) - 2 * var(--gutter) - 6px); overflow-y: auto; scrollbar-width: none; transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .5s; }
#eq.out { transform: translateX(24px); }
.eq-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.eq-head .kicker { margin-right: auto; }
.eq-dots { display: inline-flex; gap: 3px; }
.eq-dot { width: 20px; height: 20px; border-radius: 6px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.eq-dot:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.eq-dot.on { color: var(--ink); border-color: var(--line-2); background: rgba(255,255,255,.06); }
.fold-btn { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-3); transition: background .2s, color .2s, transform .3s; }
.fold-btn:hover { color: var(--ink); background: rgba(255,255,255,.07); }
.fold-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(180deg); transition: transform .3s; }
.folded .fold-btn svg { transform: none; }
.eq-main { margin: 8px 0 2px; font-size: 19px; color: var(--ink); min-height: 52px; display: grid; }
.eq-line { grid-area: 1 / 1; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .3s, transform .3s, visibility .3s; align-self: center; }
.eq-line.on { opacity: 1; visibility: visible; transform: none; }
.eq-main .katex-display { margin: 0.25em 0; }
.eq-hint { font-size: 11.5px; color: var(--ink-3); margin: 0 0 10px; }
[data-term] { transition: opacity .25s, color .25s, text-shadow .25s; cursor: default; }
/* KaTeX stacks tall invisible struts over fractions; let pointer events fall through to the linked symbols */
.katex .vlist, .katex .vlist > span, .katex .pstrut, .katex .vlist-t, .katex .vlist-r { pointer-events: none; }
.katex [data-term], .katex [data-term] * { pointer-events: auto; }
.eq-main [data-term], .step-tex [data-term], .card-body [data-term] { cursor: pointer; }
.eq-main.hovering [data-term]:not(.hl), .readouts.hovering .ro:not(.hl) { opacity: .4; }
[data-term].hl { text-shadow: 0 0 14px currentColor; }
/* readouts: the four key numbers as tiles, the rest as rows behind "All readouts" */
.readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.ro { display: grid; align-content: space-between; gap: 4px; min-width: 0; padding: 8px 9px 8px; border-radius: 9px; background: rgba(255,255,255,.028); border: 1px solid var(--line); transition: background .2s, opacity .25s, border-color .2s; }
.ro:hover, .ro.hl { background: rgba(255,255,255,.055); border-color: color-mix(in srgb, var(--c, #fff) 35%, transparent); }
.ro .ro-l { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.ro i { flex: none; width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.ro .ro-l span { font-size: 11px; line-height: 1.3; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ro b { font-family: var(--mono); font-weight: 500; font-size: 16px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ro.long b { font-size: 13px; }
.ro.xlong b { font-size: 11.5px; }
.ro b small { color: var(--ink-3); font-weight: 400; font-size: 10.5px; margin-left: 3px; }
.ro.ro-extra { display: none; grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; padding: 6px 9px; }
.ro.ro-extra b { font-size: 12.5px; text-align: right; }
.ro.ro-extra .ro-l span { -webkit-line-clamp: 1; }
.readouts.show-all .ro.ro-extra { display: grid; }
.ro-more, .read-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--ink-2); padding: 4px 6px 4px 2px; border-radius: 6px; }
.ro-more:hover, .read-more:hover { color: var(--ink); }
.ro-more svg, .read-more svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.ro-more.open svg, .read-more.open svg { transform: rotate(180deg); }
#eq.folded .eq-rest { display: none; }
#eq.folded .eq-main { margin-bottom: 0; }

/* ── control deck (bottom) ── */
#deck { position: absolute; left: 50%; bottom: var(--gutter); transform: translateX(calc(-50% + var(--dx, 0px))); display: flex; align-items: stretch; width: max-content; max-width: calc(100% - 2 * var(--gutter)); transition: opacity .5s, transform .6s cubic-bezier(.2,.8,.2,1); }
#deck.out { transform: translate(calc(-50% + var(--dx, 0px)), 20px); }
.deck-controls { display: flex; flex-wrap: nowrap; row-gap: 10px; column-gap: 18px; padding: 12px 16px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; align-items: center; min-width: 0; }
.deck-time { flex: none; }
.more-btn { display: none; flex: none; align-self: center; align-items: center; gap: 7px; height: 32px; margin-right: 12px; padding: 0 11px 0 9px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 12px; color: var(--ink); transition: background .2s, border-color .2s; }
#deck.has-more .more-btn { display: inline-flex; }
.more-btn:hover, .more-btn.on { background: rgba(255,255,255,.07); border-color: rgba(236,229,214,.35); }
.more-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }
.more-btn b { font-family: var(--mono); font-weight: 500; font-size: 10.5px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
.more-pop { position: absolute; z-index: 12; display: grid; gap: 12px; width: max-content; min-width: 240px; max-width: calc(100% - 24px); max-height: 60vh; overflow-y: auto; padding: 14px 14px 12px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .2s, transform .2s, visibility .2s; }
.more-pop.on { opacity: 1; visibility: visible; transform: none; }
.more-pop .ctl { border-left: 0; padding: 0; min-width: 220px; }
.more-pop .ctl + .ctl { border-top: 1px solid var(--line); padding-top: 12px; }
.more-pop .ctl-top.no-label { display: none; }
.deck-time { display: flex; gap: 2px; align-items: center; padding: 8px 10px; border-left: 1px solid var(--line); }
.ctl { display: grid; gap: 6px; min-width: 132px; padding: 2px 8px; flex: none; }
.ctl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ctl-label { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ctl-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.ctl-val { font-family: var(--mono); font-size: 11.5px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctl.seg-ctl { min-width: 0; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; --p: 50%; --c: var(--accent); }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--c) var(--p), rgba(236,229,214,.16) var(--p)); }
input[type=range]::-moz-range-track { height: 2px; border-radius: 2px; background: rgba(236,229,214,.16); }
input[type=range]::-moz-range-progress { height: 2px; background: var(--c); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #0d0d0f; border: 1.5px solid var(--ink); margin-top: -6px; box-shadow: 0 0 0 4px rgba(0,0,0,.25); transition: transform .15s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #0d0d0f; border: 1.5px solid var(--ink); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.seg button { height: 26px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: rgba(236,229,214,.12); color: var(--ink); }
.tog { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; height: 30px; padding: 0 4px; }
.tog .sw { width: 28px; height: 16px; border-radius: 9px; background: rgba(236,229,214,.16); position: relative; transition: background .2s; }
.tog .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.tog.on .sw { background: var(--accent); }
.tog.on .sw::after { transform: translateX(12px); background: #111; }
.tog.on { color: var(--ink); }
.act-btn { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; white-space: nowrap; color: var(--ink); transition: background .2s, border-color .2s; }
.act-btn:hover { background: rgba(255,255,255,.06); border-color: rgba(236,229,214,.35); }
.t-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); transition: background .2s, color .2s; }
.t-btn:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.t-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.t-btn svg.fill { fill: currentColor; stroke: none; }
.speed { font-family: var(--mono); }
.speed button { padding: 0 7px; font-size: 11px; }
.scrub { width: 104px; display: grid; gap: 3px; padding: 0 4px 0 8px; }
.scrub .kicker { font-size: 9px; letter-spacing: .12em; display: flex; justify-content: space-between; }
.scrub input { --c: var(--ink-2); }
.scrub.disabled { opacity: .35; pointer-events: none; }

/* ── hall map (bottom-left) ── */
#map { position: absolute; left: var(--gutter); bottom: var(--gutter); padding: 10px 12px 10px; display: grid; gap: 8px; width: 252px; transition: opacity .5s; }
.map-head { display: flex; justify-content: space-between; align-items: center; }
.map-nav { display: flex; gap: 2px; }
.map-nav .t-btn { width: 26px; height: 26px; }
.map-svg { width: 100%; height: auto; display: block; }
.map-svg .bay { cursor: pointer; }
.map-svg .bay rect { fill: rgba(236,229,214,.05); stroke: rgba(236,229,214,.12); transition: fill .2s; }
.map-svg .bay:hover rect { fill: rgba(236,229,214,.14); }
.map-svg .bay circle { transition: r .2s; }
.map-svg .bay.on rect { fill: color-mix(in srgb, var(--c) 30%, transparent); stroke: var(--c); }
.map-svg .bay text { font-family: var(--mono); font-size: 7px; fill: rgba(236,229,214,.55); pointer-events: none; }
.map-svg .bay.on text { fill: #fff; }
.map-svg .you { fill: var(--ink); }
.map-title { font-size: 12px; color: var(--ink); min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── captions (tour / narration) ── */
#caption { position: absolute; left: 50%; bottom: 84px; transform: translate(-50%, 6px); width: min(680px, calc(100% - 40px)); display: flex; justify-content: center; pointer-events: none; transition: opacity .45s, transform .45s; opacity: 0; z-index: 7; }
#caption.on { opacity: 1; transform: translate(-50%, 0); }
#caption .cap-box { display: inline-block; max-width: 100%; text-align: left; padding: 11px 16px 13px; border-radius: 12px; background: rgba(9, 9, 11, .86); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
#caption p { margin: 0; font-family: var(--sans); font-weight: 450; font-size: 16.5px; line-height: 1.5; letter-spacing: -0.003em; color: var(--ink); text-wrap: pretty; }
#caption .who { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 5px; text-transform: uppercase; }
#caption .who::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--accent); }
#caption .who:empty { display: none; }
.tour-bar { position: absolute; left: 50%; bottom: var(--gutter); transform: translateX(calc(-50% + var(--dx, 0px))); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; z-index: 6; }
.tour-bar .tb-title { font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.tour-bar .tb-prog { width: 160px; height: 2px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.tour-bar .tb-prog span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }

/* ── pins (term tags & hall markers) ── */
.pin { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .3s; }
.tag { transform: translate(14px, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 4px 9px 4px 7px; border-radius: 999px; background: rgba(12,12,14,.78); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); font-size: 11.5px; color: var(--ink); white-space: nowrap; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .25s; }
.tag.show { opacity: 1; }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.tag b { font-family: var(--mono); font-weight: 500; }
.tag::before { content: ""; position: absolute; left: -14px; top: 50%; width: 12px; height: 1px; background: color-mix(in srgb, var(--c) 70%, transparent); }
.marker { width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
.overview .marker { opacity: 1; }
.marker .m-stem { position: absolute; left: -0.5px; bottom: 0; width: 1px; height: 26px; background: linear-gradient(var(--c), transparent); }
.marker .m-num { position: absolute; left: -15px; bottom: 26px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; background: rgba(10,10,12,.85); border: 1px solid var(--c); color: var(--ink); cursor: pointer; pointer-events: auto; transition: transform .2s, background .2s, color .2s; }
.marker .m-title { position: absolute; left: 0; bottom: 64px; display: grid; gap: 2px; text-align: center; color: var(--ink); background: rgba(10,10,12,.9); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); padding: 6px 12px 8px; border-radius: 9px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .2s, transform .2s; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.marker .m-title b { font-family: var(--serif); font-weight: 400; font-size: 17px; line-height: 1.15; }
.marker .m-title small { font-size: 11.5px; color: var(--ink-2); }
.marker:hover { z-index: 3; }
.marker:hover .m-num { transform: scale(1.12); background: var(--c); color: #111; }
.marker:hover .m-title { opacity: 1; transform: translate(-50%, 0); }
body:not(.overview) .marker .m-num { pointer-events: none; }

/* overview index */
#index { position: absolute; left: 50%; bottom: var(--gutter); transform: translateX(calc(-50% + var(--dx, 0px))); display: flex; align-items: stretch; width: max-content; max-width: calc(100% - 2 * var(--gutter)); transition: opacity .5s, transform .6s cubic-bezier(.2,.8,.2,1); }
#index.out { opacity: 0; pointer-events: none; transform: translate(calc(-50% + var(--dx, 0px)), 20px); }
.ix-preview { display: grid; align-content: center; grid-template-rows: auto auto 32px; gap: 3px; width: 250px; padding: 12px 18px; border-right: 1px solid var(--line); }
.ix-preview .kicker { color: var(--pc, var(--ink-3)); transition: color .2s; }
.ix-preview b { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.1; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-preview small { font-size: 12px; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ix-wings { display: flex; gap: 4px; padding: 12px 14px; overflow-x: auto; scrollbar-width: none; }
.ix-wing { display: grid; grid-template-rows: 26px auto; gap: 8px; align-content: start; padding: 0 12px; }
.ix-wing + .ix-wing { border-left: 1px solid var(--line); }
.ix-wing h3 { margin: 0; align-self: end; max-width: 140px; line-height: 13px; font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.ix-wing:has(.ix-chip:nth-child(5)) h3 { max-width: none; } /* the long wing has room for its name on one line */
.ix-wing h3 i { display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; vertical-align: middle; border-radius: 50%; background: var(--c); }
.ix-chips { display: flex; gap: 5px; }
.ix-chip { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--ink); background: rgba(10,10,12,.6); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); transition: background .15s, color .15s, transform .15s; }
.ix-chip:hover, .ix-chip:focus-visible, .ix-chip.hot { background: var(--c); color: #111; transform: scale(1.1); }
.marker.hot { z-index: 3; }
.marker.hot .m-num { transform: scale(1.12); background: var(--c); color: #111; }
.marker.hot .m-title { opacity: 1; transform: translate(-50%, 0); }

/* ── predict & reveal ── */
#predict { position: absolute; inset: 0; display: grid; place-items: center; z-index: 30; background: rgba(4,4,5,.35); opacity: 0; pointer-events: none; transition: opacity .4s; }
#predict.on { opacity: 1; pointer-events: auto; }
#predict.watching { background: transparent; pointer-events: none; }
.pr-card { width: min(520px, calc(100% - 32px)); padding: 24px 24px 20px; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s; }
#predict.watching .pr-card { transform: translateY(calc(50vh - 50% - 120px)) scale(.92); opacity: 0; }
.pr-card h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.12; margin: 10px 0 18px; }
.pr-opts { display: grid; gap: 8px; }
.pr-opt { text-align: left; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line-2); font-size: 14px; color: var(--ink); display: flex; gap: 12px; align-items: center; transition: border-color .2s, background .2s; }
.pr-opt b { font-family: var(--mono); font-size: 11px; color: var(--ink-3); width: 16px; }
.pr-opt:hover { border-color: rgba(236,229,214,.4); background: rgba(255,255,255,.04); }
.pr-opt.right { border-color: var(--t-mint); background: color-mix(in srgb, var(--t-mint) 10%, transparent); }
.pr-opt.wrong { border-color: var(--t-coral); background: color-mix(in srgb, var(--t-coral) 8%, transparent); }
.pr-verdict { font-family: var(--serif); font-size: 26px; margin: 4px 0 8px; }
.pr-explain { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.pr-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; }
.pr-score { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.watch-banner { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); padding: 9px 16px; display: flex; gap: 12px; align-items: center; font-size: 13px; z-index: 31; transition: opacity .4s; }
.watch-banner b { font-weight: 560; }

/* ── capture ── */
.cap-menu { position: absolute; top: 66px; right: var(--gutter); width: 250px; padding: 8px; z-index: 20; }
.cap-menu button { display: flex; width: 100%; gap: 12px; align-items: flex-start; text-align: left; padding: 10px 10px; border-radius: 9px; }
.cap-menu button:hover { background: rgba(255,255,255,.05); }
.cap-menu svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: var(--ink-2); fill: none; stroke-width: 1.5; }
.cap-menu b { display: block; font-weight: 520; font-size: 13px; }
.cap-menu small { color: var(--ink-3); font-size: 11.5px; }
.rec-pill { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 7px 8px 7px 14px; font-family: var(--mono); font-size: 12px; z-index: 20; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 40; transition: opacity .5s; }
.flash.on { opacity: .5; transition: none; }

#toast { position: absolute; left: 50%; top: 80px; transform: translate(-50%, -10px); padding: 9px 16px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 45; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* help */
#help { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4,4,5,.5); z-index: 35; }
.help-card { width: min(560px, calc(100% - 32px)); padding: 24px; }
.help-card h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 6px 0 16px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 13px; color: var(--ink-2); }
.keys kbd { font-family: var(--mono); font-size: 11px; color: var(--ink); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; justify-self: start; }

/* ── opening film ── */
#film { position: absolute; inset: 0; z-index: 70; pointer-events: none; display: none; overflow: hidden; }
#film.on { display: block; }
.film-black { position: absolute; inset: 0; background: #000; opacity: 1; }
.film-vignette { position: absolute; inset: 0; background: radial-gradient(130% 95% at 50% 46%, transparent 52%, rgba(0,0,0,.5) 100%); }
.film-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(to top, rgba(0,0,0,.64), rgba(0,0,0,.3) 50%, transparent); opacity: 0; transition: opacity .8s; }
.film-shade.on { opacity: 1; }
.film-title::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(1100px, 120vw); height: 520px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(0,0,0,.5), transparent); opacity: 0; transition: opacity 1.4s; z-index: -1; }
.film-title.on::before { opacity: 1; }
#film .film-controls, #film .film-progress { transition: opacity .6s; }
#film.closing .film-controls, #film.closing .film-progress { opacity: 0; pointer-events: none; }
body.in-film #ui, body.in-film #pins { opacity: 0 !important; pointer-events: none !important; transition: opacity .4s; }
body.in-film .credit { opacity: .55; }
.film-title { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 0 24px; }
.film-title .ft-kicker, .film-title .ft-title, .film-title .ft-sub { opacity: 0; filter: blur(10px); transform: translateY(10px); transition: opacity 1.4s ease, filter 1.6s ease, transform 1.8s cubic-bezier(.2,.8,.2,1), letter-spacing 3.2s cubic-bezier(.2,.8,.2,1); }
.ft-kicker { margin: 0 0 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(236,229,214,.6); }
.ft-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(72px, 12vw, 176px); line-height: .9; color: #f4ede0; letter-spacing: .14em; text-shadow: 0 0 60px rgba(242,184,75,.18); }
.ft-sub { margin: 26px 0 0; font-family: var(--sans); font-size: 17px; color: rgba(236,229,214,.78); }
.film-title.on .ft-kicker { opacity: 1; filter: none; transform: none; transition-delay: .5s; }
.film-title.on .ft-title { opacity: 1; filter: none; transform: none; letter-spacing: .02em; }
.film-title.sub .ft-sub { opacity: 1; filter: none; transform: none; }
.film-title:not(.on) .ft-kicker, .film-title:not(.on) .ft-title, .film-title:not(.sub) .ft-sub { transition-duration: .7s, .7s, .7s, 0s; }
.film-lower { position: absolute; left: max(48px, 5vw); right: 40%; bottom: 0; padding: 120px 0 calc(56px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; justify-items: start; }
.film-lower > * { opacity: 0; transform: translateY(14px); filter: blur(6px); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.8,.2,1), filter .8s ease; }
.film-lower.on > * { opacity: 1; transform: none; filter: none; }
.film-lower.on .fl-t { transition-delay: .12s; }
.film-lower.on .fl-q { transition-delay: .3s; }
.fl-k { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--c, var(--ink-2)); }
.fl-k::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--c, var(--accent)); }
.fl-t { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 66px); line-height: 1; color: #f6efe2; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.fl-q { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(18px, 1.7vw, 24px); color: rgba(236,229,214,.82); }
.film-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(236,229,214,.08); }
.film-progress span { display: block; height: 100%; background: linear-gradient(90deg, rgba(180,141,85,.4), #d9b47a); transform-origin: 0 50%; transform: scaleX(0); }
.film-controls { position: absolute; top: max(18px, env(safe-area-inset-top, 0px)); right: max(18px, env(safe-area-inset-right, 0px)); display: flex; gap: 8px; pointer-events: auto; }
.film-btn { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px; border-radius: 999px; background: rgba(10,10,12,.55); border: 1px solid rgba(236,229,214,.22); color: var(--ink); font-size: 13px; font-weight: 500; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .2s, border-color .2s; }
.film-btn:hover { background: rgba(28,28,32,.75); border-color: rgba(236,229,214,.45); }
.film-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.film-skip svg { fill: currentColor; stroke: none; }
.film-sound .w { display: none; }
.film-sound.on .w { display: inline; }
.film-sound.on .x { display: none; }
@media (max-width: 760px) {
  .film-lower { left: 20px; right: 20px; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
  .ft-sub { font-size: 15px; }
  .film-btn { height: 34px; padding: 0 12px; font-size: 12px; }
  .film-sound span { display: none; }
}

/* exploring the model: side panels step back, the deck dims */
body.exploring #card:not(.out), body.exploring #eq:not(.out) { opacity: .16; }
body.exploring #card:not(.out) { transform: translateX(-10px); }
body.exploring #eq:not(.out) { transform: translateX(10px); }
body.exploring #deck:not(.out) { opacity: .4; }
body.exploring .edge-nav:not(.out) { opacity: .35; }
#card, #eq { transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .45s; }
#card, #eq { z-index: 5; }

/* UI hidden (H) */
body.ui-hidden #ui > *:not(#caption):not(.rec-pill):not(.tour-bar) { opacity: 0 !important; pointer-events: none !important; }
body.ui-hidden #pins { opacity: 0; }

/* ── responsive ── */
@media (max-width: 1560px) {
  .brand-sub { display: none; }
  .s-title { width: 150px; }
}
@media (max-width: 1380px) {
  .s-title { display: none; }
}
/* the hall legend stays clear of the corner credit on laptop widths */
@media (max-width: 1400px) {
  .ix-preview { width: 205px; padding: 12px 16px; }
  .ix-wing { padding: 0 10px; }
  .ix-chip { width: 26px; height: 26px; font-size: 10.5px; }
  .ix-chips { gap: 4px; }
}
@media (max-width: 1280px) {
  #eq { width: 296px; }
  #card { width: 312px; }
  .s-title { width: 150px; }
  .brand-sub { display: none; }
}
@media (max-width: 1100px) {
  .tb-label { display: none; }
  .tools .opt-desk { display: none; }
  #eq { top: auto; bottom: calc(var(--deck-h, 90px) + 2 * var(--gutter)); width: 280px; max-height: 40vh; }
  .s-title { display: none; }
}
@media (max-width: 760px) {
  :root { --gutter: 10px; }
  .credit { bottom: max(3px, env(safe-area-inset-bottom, 0px)); }
  .brand-sub, .wings, .s-wing, .s-title { display: none; }
  #top { top: max(var(--gutter), env(safe-area-inset-top)); }
  #card { left: var(--gutter); right: var(--gutter); width: auto; top: auto; bottom: calc(var(--deck-h, 90px) + 2 * var(--gutter)); max-height: 46vh; }
  .deck-controls { flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px; }
  .ctl-top { min-height: 16px; }
  #card.folded .card-actions { display: none; }
  .card-actions { grid-template-columns: 1fr 1fr; }
  .cta-btn { height: 40px; font-size: 13px; }
  .card-title { font-size: 26px; margin: 6px 0 2px; }
  .card-q { font-size: 15px; }
  .card-head { padding: 12px 16px 10px; cursor: pointer; }
  #eq { left: var(--gutter); right: var(--gutter); width: auto; top: 64px; bottom: auto; padding: 10px 14px; }
  .eq-main { font-size: 16px; margin: 4px 0 0; min-height: 0; }
  .eq-hint { display: none; }
  .more-btn span { display: none; }
  #deck.has-more .more-btn { display: none; }
  #deck { bottom: calc(max(var(--gutter), env(safe-area-inset-bottom)) + 12px); flex-direction: column; }
  .deck-time { border-left: 0; border-top: 1px solid var(--line); justify-content: space-between; padding: 6px 10px; }
  .scrub { width: 90px; }
  .ctl { min-width: 130px; }
  #caption { bottom: 46%; }
  #caption p { font-size: 14.5px; }
  #caption .cap-box { padding: 9px 13px 11px; }
  #index { left: var(--gutter); right: var(--gutter); width: auto; transform: none; flex-direction: column; }
  #index.out { transform: translateY(20px); }
  .ix-preview { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .ix-preview b { font-size: 19px; }
  .tools .opt-desk { display: none; }
  .strip { padding: 4px; }
  .home-btn span { display: none; }
  .strip { display: none; }
  #top { gap: 8px; }
  .home-btn { padding: 0 11px; }
  .edge-nav { min-height: 40px; min-width: 40px; }
  .edge-nav .en-ico { width: 38px; height: 38px; }
  .edge-nav .en-label { display: none; }
  .tour-bar { left: var(--gutter); right: var(--gutter); transform: none; bottom: calc(max(var(--gutter), env(safe-area-inset-bottom)) + 12px); padding: 6px 6px 6px 12px; gap: 6px; }
  .tour-bar .tb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
  .tour-bar .tb-prog { flex: 0 1 70px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01s !important; animation: none !important; } }
