/* tour.css — the Tour room. Caption/navigation and timed transferability app surface: near-black surfaces, one yellow, cyan for data. */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 100 700; font-display: swap; src: url('/assets/fonts/plex-sans-var.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('/assets/fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('/assets/fonts/plex-mono-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url('/assets/fonts/plex-mono-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-cond-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-cond-700.woff2') format('woff2'); }

:root {
  --bg-0: #07090b; --bg-1: #0c0f12; --glass: rgba(15,19,24,0.55); --glass-hi: rgba(18,22,28,0.72);
  --line: rgba(255,255,255,0.06); --line-mid: rgba(255,255,255,0.10); --line-hi: rgba(255,255,255,0.16);
  --text: #f4f5f7; --text-2: #c2c7ce; --text-3: #8a939e; --text-4: #5a626e;
  --brand: #FEF201; --brand-soft: rgba(254,242,1,0.12); --data: #6dd3ff; --data-soft: rgba(109,211,255,0.10);
  --red: #ff4e54; --claret: #b33a4b;
  --sans: 'IBM Plex Sans', -apple-system, system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg-0); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
#stage { position: fixed; inset: 0; z-index: 1; touch-action: none; }
#stage canvas { display: block; width: 100% !important; height: 100% !important; }
#grain { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0.05; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 240px 240px; }
#vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%); }

/* header — approved Emerald identity, shared with the site */
.hdr { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px clamp(16px, 3vw, 26px); background: rgba(10,12,15,0.5); backdrop-filter: saturate(140%) blur(18px); -webkit-backdrop-filter: saturate(140%) blur(18px); border-bottom: 1px solid rgba(255,255,255,0.07); }
.hdr .brand { display: flex; align-items: center; gap: 10px; }
.hdr .brand { flex-shrink: 0; }
.hdr .brand img { display: block; width: 140px; height: auto; }
.hdr nav { display: flex; align-items: center; gap: 12px clamp(14px, 2vw, 26px); }
.hdr nav a { font: 500 10px/1 var(--mono); letter-spacing: 0.14em; color: #A8B0BA; }
.hdr nav a.on { color: var(--text); }
.hdr nav a.cta { color: var(--brand); padding: 9px 14px; border: 1px solid rgba(254,242,1,0.45); border-radius: 3px; transition: background 180ms var(--ease), color 180ms var(--ease); }
.hdr nav a.cta:hover { background: var(--brand); color: #0A0C0F; }

/* HUD chip — the product's state readout */

/* caption */
#caption { position: fixed; z-index: 40; left: clamp(20px, 5vw, 72px); bottom: clamp(88px, 14vh, 150px); width: min(640px, 46vw); pointer-events: none; }
#caption::before { content: ''; position: absolute; inset: -60px -120px -60px -80px; z-index: -1; background: radial-gradient(60% 60% at 40% 55%, rgba(7,9,11,0.62), rgba(7,9,11,0) 100%); filter: blur(10px); pointer-events: none; }
#caption .eyebrow { display: flex; gap: 10px; align-items: baseline; font: 500 10px/1 var(--mono); letter-spacing: 0.16em; color: var(--text-3); margin-bottom: 14px; opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#caption .eyebrow b { color: var(--data); font-weight: 600; }
#caption h1 { margin: 0; font: 700 clamp(44px, 6.4vw, 96px)/0.92 var(--display); letter-spacing: 0.005em; text-transform: uppercase; color: var(--text); text-shadow: 0 2px 40px rgba(0,0,0,0.6); }
#caption h1 .w { display: inline-block; opacity: 0; filter: blur(14px); transform: translateY(22px); }
#caption h1 .w.acc { color: var(--data); }
#caption.in h1 .w { animation: wIn 680ms var(--ease) forwards; }
@keyframes wIn { to { opacity: 1; filter: blur(0); transform: none; } }
#caption p { margin: 18px 0 0; max-width: 52ch; font: 400 clamp(15px, 1.15vw, 18px)/1.5 var(--sans); color: var(--text-2); text-shadow: 0 1px 24px rgba(0,0,0,0.7); opacity: 0; }
#caption .hint { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 12px; border: 1px solid rgba(109,211,255,0.35); border-radius: 3px; background: rgba(7,9,11,0.45); font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--data); opacity: 0; }
#caption .hint[hidden] { display: none; }
#caption .hint::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--data); box-shadow: 0 0 8px var(--data); }
#caption.in .eyebrow { animation: fadeUp 500ms var(--ease) 60ms forwards; }
#caption.in p { animation: fadeUp 600ms var(--ease) 420ms forwards; }
#caption.in .hint { animation: fadeUp 500ms var(--ease) 720ms forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #caption h1 .w, #caption .eyebrow, #caption p, #caption .hint { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; } }

/* buttons: the tools row and the end card */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 3px; border: 1px solid var(--line-hi); font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--text); transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease); }
.btn:hover { background: rgba(255,255,255,0.06); }
.btn.brand { background: var(--brand); color: #0A0C0F; border-color: var(--brand); width: 100%; margin-top: 10px; }
.btn.brand:hover { background: #fff77a; }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* rail + tools */
#rail { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 999px; background: var(--glass); backdrop-filter: saturate(140%) blur(24px); -webkit-backdrop-filter: saturate(140%) blur(24px); border: 1px solid rgba(255,255,255,0.09); }
#rail .arrow { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line-mid); transition: background 160ms var(--ease); }
#rail .arrow:hover { background: rgba(255,255,255,0.06); color: var(--text); }
#rail ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0 4px; }
#rail ol button { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
#rail ol button i { display: block; width: 100%; height: 2px; background: rgba(255,255,255,0.16); border-radius: 2px; transition: background 200ms var(--ease), transform 200ms var(--ease); }
#rail ol button.done i { background: rgba(255,255,255,0.45); }
#rail ol button.on i { background: var(--brand); transform: scaleY(2); box-shadow: 0 0 10px rgba(254,242,1,0.45); }
#rail ol button span { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 2px); white-space: nowrap; font: 600 9px/1 var(--mono); letter-spacing: 0.14em; color: var(--text-3); opacity: 0; pointer-events: none; transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
#rail ol button:hover span, #rail ol button.on span { opacity: 1; transform: translate(-50%, -6px); }
#rail ol button.on span { color: var(--brand); }
#tools { position: fixed; z-index: 50; right: clamp(16px, 3vw, 26px); bottom: 24px; display: flex; gap: 8px; }
#tools .btn { background: var(--glass); backdrop-filter: saturate(140%) blur(24px); -webkit-backdrop-filter: saturate(140%) blur(24px); }
body.free #caption, body.free #rail { display: none; }
body.free #tools #btn-explore { color: var(--brand); border-color: rgba(254,242,1,0.5); }
#toast { position: fixed; z-index: 70; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(8px); padding: 10px 14px; border-radius: 4px; background: var(--glass-hi); border: 1px solid var(--line-mid); font: 500 10.5px/1 var(--mono); letter-spacing: 0.1em; color: var(--text); opacity: 0; transition: opacity 200ms var(--ease), transform 200ms var(--ease); pointer-events: none; }
#toast.in { opacity: 1; transform: translateX(-50%); }

/* end card */
#endcard { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(90% 70% at 50% 50%, rgba(7,9,11,0.82), rgba(7,9,11,0.97)); opacity: 0; transition: opacity 900ms var(--ease); }
#endcard[hidden] { display: none; }
#endcard.in { opacity: 1; }
#endcard .card { text-align: center; padding: 24px; }
#endcard .mark { display: block; width: 220px; height: auto; margin: 0 auto 22px; }
#endcard h2 { margin: 0; font: inherit; }
#endcard .actions { display: flex; gap: 10px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
#endcard .actions .btn.brand { width: auto; margin: 0; }

/* boot + no-WebGL */
#boot { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg-0); transition: opacity 700ms var(--ease); }
#boot.out { opacity: 0; pointer-events: none; }
#boot .wm { font: 600 12px/1 var(--mono); letter-spacing: 0.36em; color: var(--text); text-align: center; }
#boot .wm small { display: block; margin-top: 16px; font-size: 9px; letter-spacing: 0.2em; color: var(--text-4); }
#boot .prog { width: 200px; height: 1px; margin: 22px auto 0; background: rgba(255,255,255,0.1); overflow: hidden; }
#boot .prog b { display: block; width: 0; height: 100%; background: var(--brand); transition: width 240ms var(--ease); }
#boot em { display: block; margin-top: 16px; font: 500 22px/1 var(--mono); font-style: normal; letter-spacing: 0.08em; color: var(--text); font-variant-numeric: tabular-nums; }
@keyframes prog { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
#nogl { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: var(--bg-0) url('/media/hero-poster.jpg') center/cover; }
#nogl[hidden] { display: none; }
#nogl div { background: rgba(7,9,11,0.8); padding: 28px; border-radius: 6px; max-width: 420px; text-align: center; font: 400 15px/1.5 var(--sans); color: var(--text-2); }

/* phones and narrow windows: a bottom dock holds the caption, the rail sits under it */
@media (max-width: 900px), (max-height: 560px) {
  .hdr nav a:not(.cta) { display: none; }
  #dock { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; max-height: 52vh; overflow: auto; padding: 18px 16px calc(74px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(7,9,11,0) 0%, rgba(7,9,11,0.86) 18%, rgba(7,9,11,0.96) 100%); -webkit-overflow-scrolling: touch; }
  #caption { position: static; width: auto; pointer-events: auto; margin-top: 6px; }
  #caption h1 { font-size: clamp(36px, 11vw, 56px); }
  #caption p { font-size: 14px; max-width: none; margin-top: 12px; }
  #caption .hint { margin-top: 12px; }
  #caption .eyebrow { font-size: 9px; gap: 7px; }
  #caption .value { font-size: 15px; }
  #rail { bottom: calc(12px + env(safe-area-inset-bottom)); padding: 6px 8px; gap: 6px; }
  #rail ol { gap: 3px; } #rail ol button { width: 18px; height: 28px; } #rail ol button span { display: none; }
  #tools { bottom: calc(12px + env(safe-area-inset-bottom)); right: 10px; }
  #tools .btn { padding: 8px 9px; font-size: 9px; }
  #tools #btn-reset span { display: none; }
}
@media (min-width: 901px) and (min-height: 561px) { #dock { display: contents; } }

/* the app's journey: step line, value line, present mode, and the lightbox the briefing room reads a plan in */
#caption .eyebrow span:nth-child(4) { color: var(--brand); }
#caption .value { margin: 16px 0 0; max-width: 46ch; font: 600 clamp(15px, 1.25vw, 19px)/1.4 var(--sans); color: var(--text); text-shadow: 0 1px 24px rgba(0,0,0,0.7); opacity: 0; }
#caption.in .value { animation: fadeUp 600ms var(--ease) 340ms forwards; }
#caption.in p:not(.value) { animation-delay: 520ms; }
#caption .value[hidden] { display: none; }
#lightbox { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(7,9,11,0.92); opacity: 0; transition: opacity 220ms var(--ease); }
#lightbox[hidden] { display: none; }
#lightbox.in { opacity: 1; }
#lightbox figure { margin: 0; max-width: min(1400px, 92vw); }
#lightbox img { display: block; width: 100%; max-height: 78vh; object-fit: contain; border: 1px solid var(--line-mid); border-radius: 6px; background: #000; }
#lightbox figcaption { display: flex; gap: 14px; align-items: baseline; margin-top: 12px; font: 400 13px/1.4 var(--sans); color: var(--text-2); }
#lightbox figcaption b { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--brand); white-space: nowrap; }
#lightbox .lb-close { position: absolute; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-hi); font-size: 22px; color: var(--text); }
/* present mode: bigger type, no tools */
body.present .hdr, body.present #tools #btn-reset, body.present #tools #btn-explore, body.present #rail ol button span { display: none; }
body.present #caption { width: min(760px, 52vw); bottom: clamp(110px, 18vh, 200px); }
body.present #caption h1 { font-size: clamp(56px, 7.6vw, 124px); }
body.present #caption .value { font-size: clamp(17px, 1.5vw, 23px); max-width: 44ch; }
body.present #caption p:not(.value) { font-size: clamp(15px, 1.2vw, 19px); }
body.present #tools #btn-present { color: var(--brand); border-color: rgba(254,242,1,0.5); }
@media (max-width: 900px), (max-height: 560px) {
  body.present #caption { width: auto; }
}

/* rendered beats: full-bleed over the desk, crossfaded */
#film { position: fixed; inset: 0; z-index: 5; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; background: #07090b; opacity: 0; transition: opacity 700ms var(--ease); pointer-events: none; }
#film[hidden] { display: none; }
#film.in { opacity: 1; }
#film::-webkit-media-controls { display: none !important; }
@media (max-width: 900px), (max-height: 560px) { #film { height: 48vh; object-position: 60% 50%; } }

#blackout { position: fixed; inset: 0; z-index: 6; background: #07090b; opacity: 0; transition: opacity 420ms var(--ease); pointer-events: none; }
#blackout[hidden] { display: none; }
#blackout.in { opacity: 1; }

/* rooms whose subject fills the lower left: the caption moves to the top and tightens */
@media (min-width: 901px) and (min-height: 561px) {
  body.cap-top #caption { top: 78px; bottom: auto; width: min(560px, 42vw); }
  body.cap-top #caption h1 { font-size: clamp(36px, 4.4vw, 64px); }
  body.cap-top #caption .value { font-size: clamp(14px, 1.05vw, 16px); margin-top: 12px; }
  body.cap-top #caption p:not(.value) { font-size: clamp(13px, 0.95vw, 15px); margin-top: 10px; max-width: 58ch; }
  body.cap-top #caption .hint { margin-top: 12px; }
  body.cap-top #caption::before { inset: -40px -80px -40px -60px; }
}

/* §19: editorial columns leave a measured stage between caption and controls. */
@media (min-width: 901px) and (min-height: 561px) {
  #caption, body.present #caption { left: 3vw; width: 24vw; bottom: 15vh; }
  #caption h1, body.present #caption h1 { font-size: clamp(40px, 4vw, 72px); line-height: .96; }
  #caption p, body.present #caption p:not(.value) { font-size: clamp(14px, 1.05vw, 17px); line-height: 1.5; }
  #caption .value, body.present #caption .value { font-size: clamp(15px, 1.18vw, 20px); line-height: 1.4; }
  #caption .eyebrow { white-space: normal; flex-wrap: wrap; line-height: 1.5; gap: 6px; }
  body.cap-top #caption, body.present.cap-top #caption { top: 10vh; bottom: auto; width: 31vw; }
  body.cap-top #caption h1 { font-size: clamp(36px, 3.65vw, 64px); }
  body.cap-top #caption p:not(.value) { font-size: clamp(13px, .98vw, 16px); }
  body.cap-top #caption .value { font-size: clamp(14px, 1.1vw, 18px); }
  body.present #caption p:not(.value) { display: none; }
  /* the film plays full-bleed under the caption (the founder: "why are they not full screen?"); its subject sits centre-right */
  #film { object-position: 58% 50%; }
}
#caption h1, #caption p, #caption .value { text-shadow: none; }
#caption .hint::before { box-shadow: none; }
@media (max-width: 900px), (max-height: 560px) {
  #dock { max-height: 49vh; background: linear-gradient(180deg, rgba(7,9,11,.92), #07090b 70%); padding-top: 14px; }
  #caption::before { display: none; }
  #caption h1, body.present #caption h1 { font-size: 38px; }
  #caption .eyebrow { flex-wrap: wrap; white-space: normal; line-height: 1.5; }
  #caption p, body.present #caption p { font-size: 14px; }
  #caption .value, body.present #caption .value { font-size: 15px; }
  #film { top: 10vh; left: 0; width: 100%; height: 37vh; object-fit: contain; }
}
#recovery { position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; background: rgba(7,9,11,.94); color: var(--text); text-align: center; padding: 24px; }
#recovery[hidden] { display: none; }
#recovery p { font: 400 18px/1.5 var(--sans); max-width: 36ch; }
:focus-visible { outline: 2px solid var(--data); outline-offset: 4px; }
body.film-on #stage { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
[hidden], #btn-auto[hidden] { display: none !important; }
@media (min-width: 901px) and (min-height: 561px) {
  body[data-station="scouting"] #caption { width: 24vw; }
  body[data-station="scouting"] #caption h1 { font-size: clamp(36px, 3.35vw, 60px); }
}
#btn-details { display: none; }
@media (max-width: 900px), (max-height: 560px) {
  #btn-details { display: block; margin-top: 14px; padding: 6px 0; font: 500 11px/1.3 var(--mono); letter-spacing: .1em; color: var(--data); }
  #cap-p { display: none; }
  body.copy-open #cap-p { display: block; }
  #rail { bottom: calc(54px + env(safe-area-inset-bottom)); }
  #tools { bottom: calc(10px + env(safe-area-inset-bottom)); right: 16px; }
  #dock { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }
}

/* Transferability: an app modal appears as a timed beat; the canvas carries its distribution onto the monitor. */
.transfer-beat { position: fixed; inset: 0; z-index: 46; pointer-events: none; }
.transfer-beat[hidden], .phase-flight[hidden] { display: none; }
.phase-panel { position: absolute; left: 32%; right: 3%; top: 14%; bottom: 17%; display: flex; flex-direction: column; background: #101317; border: 1px solid #36434e; border-radius: 12px; box-shadow: 0 24px 70px #0009; pointer-events: auto; overflow: hidden; color: #f4f5f7; font-family: 'IBM Plex Sans', sans-serif; }
.phase-head { padding: 24px 24px 18px; border-bottom: 1px solid #29313a; }
.phase-head h2 { margin: 0 0 9px; font: 600 20px/1.25 'IBM Plex Sans', sans-serif; letter-spacing: .025em; }
.phase-head p { color: #a6b2bf; font: 400 13px/1.55 'IBM Plex Sans', sans-serif; margin: 0; max-width: 760px; }
.phase-legend { display: flex; gap: 22px; font-size: 11px; color: #c2c7ce; margin-top: 13px; }
.phase-legend span { display: inline-flex; align-items: center; gap: 6px; }
.phase-legend i { width: 7px; height: 7px; border-radius: 50%; background: #f4f5f7; }
.phase-legend .def { background: #a63a32; } .phase-legend .ball { background: #fef201; }
.phase-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #6dd3ff #1b252c; scrollbar-width: thin; padding: 20px 24px; flex: 1; min-height: 0; }
.phase-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 20px 12px; }
.phase-tile canvas { display: block; width: 100%; height: auto; border-radius: 2px; }
.phase-share { display: flex; align-items: center; gap: 7px; margin-top: 8px; font: 400 10px/1 'IBM Plex Mono', monospace; color: #6dd3ff; }
.phase-share i { flex: 1; height: 3px; background: #273541; } .phase-share b { display: block; height: 100%; background: #6dd3ff; }
.phase-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 24px; border-top: 1px solid #29313a; font: 500 9px/1.4 'IBM Plex Mono', monospace; color: #95a3b0; }
.phase-foot button { color: #6dd3ff; font: inherit; cursor: pointer; padding: 7px 0; }
.phase-flight { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.phase-panel.condensing { box-shadow: 0 12px 36px #0006; }
.phase-panel.condensing > :not(.phase-flight) { visibility: hidden; }
@media (max-width: 900px), (max-height: 560px) {
  .phase-panel { left: 12px; right: 12px; top: 88px; bottom: 145px; }
  .phase-head { padding: 18px 14px 14px; } .phase-head h2 { font-size: 16px; }
  .phase-head p { font-size: 11px; line-height: 1.45; } .phase-legend { gap: 12px; font-size: 10px; }
  .phase-scroll { padding: 16px 14px; } .phase-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 9px; }
  .phase-share { font-size: 9px; gap: 4px; } .phase-foot { padding: 10px 14px; font-size: 8px; }
  body.phase-open #dock { visibility: hidden; background: transparent; }
}

@media (prefers-reduced-motion: reduce) { body.film-on #film { pointer-events: auto; } }

/* §33: act titles and verbatim copy, with seven numbered stops and scenes inside each stop. */
#caption .act-heading { margin-bottom: 20px; }
#caption .act-heading h2 { margin: 0; font: 600 19px/1.15 var(--display); letter-spacing: .055em; color: var(--text); }
#caption .eyebrow { margin-bottom: 12px; letter-spacing: .1em; }
#caption .value, #caption #cap-p { white-space: pre-line; }
#caption #cap-p p { margin: 13px 0 0; }
#caption #cap-p .closer, #caption #cap-p .aside { font-style: italic; color: var(--text-2); }
#caption #cap-p .closer { margin-top: 18px; color: var(--data); }
#caption blockquote { margin: 18px 0 0; padding-left: 13px; border-left: 2px solid var(--data); color: var(--text); font: 600 15px/1.45 var(--sans); }
#cap-p { display: block; }
body.present #caption #cap-p p { display: block; }
#caption { scrollbar-width: thin; scrollbar-color: #53616b transparent; }
#rail { border-radius: 8px; }
#rail .act-group { display: flex; align-items: center; gap: 6px; }
#rail .act-group + .act-group { border-left: 1px solid var(--line-hi); padding-left: 9px; }
#rail .act-roman { font: 400 9px/1 var(--mono); color: var(--text-3); }
#rail ol { gap: 4px; }
#rail ol button { width: 29px; height: 32px; border-radius: 3px; }
#rail ol button b { font: 500 10px/1 var(--mono); color: var(--text-3); }
#rail ol button.on { background: var(--brand-soft); }
#rail ol button.on b { color: var(--brand); }
#rail ol button.done b { color: var(--text); }
#rail .arrow:disabled { opacity: .25; cursor: default; }
#scene-list { position: fixed; z-index: 50; left: 50%; bottom: 88px; transform: translateX(-50%); display: flex; gap: 18px; white-space: nowrap; }
#scene-list button { padding: 6px 0; border-bottom: 1px solid transparent; font: 500 9px/1.4 var(--mono); letter-spacing: .1em; color: var(--text-3); }
#scene-list button.on { color: var(--data); border-color: var(--data); }
body.free #scene-list { display: none; }
body.opening #caption .act-heading, body.opening #caption h1, body.opening #cap-value, body.opening #cap-p, body.opening #cap-num, body.opening .station-dot { display: none; }
body.opening #caption .eyebrow { color: var(--text); }
@media (min-width: 901px) and (min-height: 561px) {
  #caption, body.cap-top #caption, body.present #caption, body.present.cap-top #caption { top: 90px; bottom: auto; width: 24vw; max-height: calc(100vh - 205px); pointer-events: auto; overflow-y: auto; padding: 0 3px 6px 0; }
  #caption h1, body.cap-top #caption h1, body.present #caption h1, body[data-station="scouting"] #caption h1 { font-size: clamp(38px, 3.45vw, 62px); line-height: .98; }
  #caption p, #caption .value, body.cap-top #caption .value, body.present #caption .value, body.present #caption p:not(.value), body.cap-top #caption p:not(.value) { font-size: clamp(13px, .97vw, 16px); line-height: 1.5; }
  #caption .value { font-weight: 400; }
  body.opening #caption { top: auto; bottom: 16vh; width: 28vw; overflow: visible; }
  #caption::before { display: none; }
}
@media (max-width: 900px), (max-height: 560px) {
  #caption .act-heading { margin-bottom: 16px; }
  #caption .act-heading h2 { font-size: 20px; }
  #caption #cap-p { display: block; }
  #caption blockquote { font-size: 14px; }
  #rail { bottom: calc(48px + env(safe-area-inset-bottom)); gap: 3px; padding: 5px 6px; }
  #rail ol { padding: 0; gap: 1px; }
  #rail ol button { width: 24px; height: 30px; }
  #rail .act-group { gap: 4px; }
  #rail .act-group + .act-group { padding-left: 5px; }
  #rail .arrow { width: 30px; height: 30px; }
  #scene-list { bottom: calc(98px + env(safe-area-inset-bottom)); gap: 18px; }
  #dock { bottom: calc(128px + env(safe-area-inset-bottom)); max-height: calc(52vh - 128px - env(safe-area-inset-bottom)); padding-bottom: 20px; }
}
/* The film remains full-bleed; a quiet edge shade keeps its editorial column readable over the moving walnut. */
@media (min-width: 901px) and (min-height: 561px) {
  body.film-on::before { content: ''; position: fixed; z-index: 6; inset: 0 auto 0 0; width: 33vw; pointer-events: none; background: linear-gradient(90deg, rgba(7,9,11,.82) 55%, transparent); }
}

/* §33 Addendum 2: whole app captures, with a dedicated portrait strip above navigation. */
:root { --app-card-width: 300px; }
.phase-panel { right: calc(var(--app-card-width) + 52px); }
#app-screen { position: fixed; z-index: 48; right: clamp(16px, 3vw, 26px); bottom: 86px; width: 300px; padding: 0; overflow: hidden; border: 1px solid var(--line-hi); border-radius: 6px; background: #090c10; text-align: left; }
#app-screen-picture { display: block; width: 100%; aspect-ratio: 8 / 5; background: #050709; }
#app-screen-picture canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
#app-screen-label { display: block; padding: 10px 12px; border-top: 1px solid var(--line); font: 500 9px/1.3 var(--mono); letter-spacing: .08em; color: var(--text-2); white-space: nowrap; }
#app-screen:hover { border-color: var(--data); }
body.free #app-screen { display: none; }
@media (max-width: 1200px) and (min-width: 901px) and (min-height: 561px) { :root { --app-card-width: 240px; } #app-screen { width: 240px; } }
@media (max-width: 900px), (max-height: 560px) {
  #app-screen { right: 16px; bottom: calc(128px + env(safe-area-inset-bottom)); width: 156px; }
  #app-screen-label { padding: 7px 8px; font-size: 7px; letter-spacing: .025em; }
  #dock { bottom: calc(266px + env(safe-area-inset-bottom)); max-height: calc(52vh - 266px - env(safe-area-inset-bottom)); }
  .phase-panel { right: 12px; bottom: calc(266px + env(safe-area-inset-bottom)); }
}
