.scene-page { --cream: rgb(239 230 214); --gutter: 16px; --tint: #F3EDE7; --scene-bg: #0b0a09; }
:root[data-theme="dark"] .scene-page { --tint: #2A241D; }
.scene-page[data-mode="scene"] .scene-app { --canvas: #151517; --surface: #202023; --ink: #FAFAFA; --muted: #B4B4BE; --line: #4a4a52; --focus: #FAFAFA; --tint: #2A241D; }
.scene-page { -webkit-tap-highlight-color: transparent; }
.scene-page [hidden] { display: none !important; }
:where(.scene-app) svg { display: block; flex-shrink: 0; }
:where(.scene-app) button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }

html.scene-dark, html.scene-dark body { background: #0b0a09; color-scheme: dark; }
.scene-app { position: relative; display: flex; flex-direction: column; min-height: calc(100dvh - var(--scene-header, 57px)); color: var(--ink); }
.scene-page[data-mode="scene"] { overflow: hidden; }
.scene-page[data-mode="scene"] .scene-app { position: fixed; inset: 0; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; background: var(--scene-bg); }
.scene-page[data-mode="scene"] .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 25; transition: transform .3s ease, visibility .3s; }
.scene-page[data-mode="scene"].is-immersive .site-header { transform: translateY(-100%); visibility: hidden; }
.scene-page[data-mode="scene"] .scene-bar, .scene-page[data-mode="scene"] .scene-dock,
.scene-page[data-mode="scene"] .scene-title, .scene-page[data-mode="scene"] .scene-beta,
.scene-page[data-mode="scene"] .scene-back, .scene-page[data-mode="scene"] .fs-btn { transition: opacity .35s ease, transform .3s ease; }
.scene-page[data-mode="scene"].controls-hidden .scene-dock,
.scene-page[data-mode="scene"].controls-hidden .scene-title,
.scene-page[data-mode="scene"].controls-hidden .scene-beta,
.scene-page[data-mode="scene"].controls-hidden .fs-btn { opacity: 0; pointer-events: none; }
.scene-page[data-mode="scene"].controls-hidden .scene-bar { background: transparent; }
.scene-page[data-mode="scene"].controls-hidden .scene-back { opacity: .55; }
.scene-app:fullscreen { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) {
  .scene-page .site-header, .scene-page .scene-bar, .scene-page .scene-dock, .scene-page .cap-l { transition: none !important; }
}

.scene-bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 4px var(--gutter); background: var(--canvas); border-bottom: 1px solid var(--line); }
.scene-page[data-mode="scene"] .scene-bar { position: absolute; left: 0; right: 0; top: 0; border-bottom: 0;
  padding: 4px max(var(--gutter), env(safe-area-inset-right)) 4px max(var(--gutter), env(safe-area-inset-left));
  transform: translateY(var(--scene-header, 57px));
  background: linear-gradient(to bottom, rgb(0 0 0 / .6), rgb(0 0 0 / 0)); }
.scene-page[data-mode="scene"].is-immersive .scene-bar, .scene-app:fullscreen .scene-bar { transform: none; padding-top: max(4px, env(safe-area-inset-top)); }
.scene-back { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink); text-decoration: none; }
.scene-back-label { display: inline-flex; align-items: center; gap: 6px; font: 600 .875rem/1.2 var(--sans); }
.scene-back-label::before { content: ""; width: .45rem; height: .45rem; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: 2px; }
.scene-beta { font: 600 .625rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.scene-page[data-mode="scene"] .scene-back { color: var(--cream); }
.scene-page[data-mode="scene"] .scene-beta { color: rgb(239 230 214 / .72); }
button.scene-title { margin-left: auto; min-width: 0; min-height: 44px; border: 0; background: transparent; padding: 4px 0 4px 8px;
  display: grid; grid-template-columns: auto auto; column-gap: 4px; align-items: end; justify-items: end; text-align: right;
  font: 400 .8125rem/1.25 var(--sans); color: var(--muted); }
.scene-title b { grid-column: 1 / span 2; font: 400 1rem/1.15 var(--serif); color: var(--ink); letter-spacing: -.01em; }
.scene-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-title svg { align-self: center; opacity: .8; }
.scene-page[data-mode="scene"] .scene-title { color: rgb(239 230 214 / .72); }
.scene-page[data-mode="scene"] .scene-title b { color: var(--cream); }

.scene-stage { position: relative; flex: 1 1 auto; width: 100%; height: 100%; margin: 0 auto; overflow: hidden; background: var(--scene-bg); }
@media (min-aspect-ratio: 13/20) and (min-height: 501px) {
  .scene-page[data-mode="scene"] .scene-stage { width: min(100vw, calc(100dvh * 9 / 16)); }
  .scene-page[data-mode="scene"] .scene-dock { left: 50%; right: auto; width: min(100vw, calc(100dvh * 9 / 16)); transform: translateX(-50%); }
}
@media (max-height: 500px) and (min-aspect-ratio: 13/20) {
  .scene-page[data-mode="scene"] .scene-dock { padding-top: 10px; }
  .scene-page[data-mode="scene"] .dock-in { max-width: 640px; }
  .scene-page[data-mode="scene"] .seek { height: 28px; }
  .scene-page[data-mode="scene"] .play { width: 48px; height: 48px; }
  .scene-page[data-mode="scene"] .back15 { width: 44px; height: 44px; }
  .scene-page[data-mode="scene"] .cap-txt { font-size: clamp(16px, 5.4vh, 24px); }
}
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cap { position: absolute; inset: 0; pointer-events: none; }
.cap-l { position: absolute; left: 8%; right: 8%; top: 50%; transform: translateY(-50%); text-align: center; opacity: 0; transition: opacity .25s linear, top .4s ease; }
.cap-l.on { opacity: 1; }
.cap-spk { font: 600 .6875rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: rgb(239 230 214 / .78);
  margin-bottom: .45em; text-shadow: 0 1px 2px rgb(0 0 0 / .7); }
.cap-txt { font: 400 clamp(17px, 4.9vw, 26px)/1.32 var(--serif); color: var(--cream); letter-spacing: -.003em; text-wrap: balance;
  text-shadow: 1px 1px 2px rgb(0 0 0 / .67), 0 0 14px rgb(0 0 0 / .35); }
.scene-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--cream); font: 400 .875rem var(--sans);
  background: var(--scene-bg); z-index: 2; transition: opacity .4s; text-align: center; }
.scene-loading.done { opacity: 0; pointer-events: none; }
.loading-bar { width: 160px; height: 2px; background: rgb(255 255 255 / .15); margin: 10px auto 0; }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--cream); transition: width .15s; }
.scene-note { position: fixed; left: var(--gutter); right: var(--gutter); bottom: 150px; z-index: 6; max-width: 528px; margin: 0 auto;
  padding: 10px 14px; border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font: 400 .8125rem/1.4 var(--sans); text-align: center; box-shadow: 0 4px 14px rgb(0 0 0 / .18); }
.note-act { border: 0; background: transparent; padding: 0 2px; min-height: 32px; font-weight: 600; text-decoration: underline; }

.readalong { flex: 1 1 auto; width: 100%; max-width: calc(36rem + 2 * var(--gutter)); margin: 0 auto; padding: 4px var(--gutter) 220px; }
.ra-head h1 { font: 400 1.75rem/1.15 var(--serif); letter-spacing: -.02em; margin: 14px 0 2px; }
.ra-head p { margin: 0 0 18px; color: var(--muted); font-size: .8125rem; }
.ra-speech { margin: 0 0 14px; }
.ra-spk { font: 600 .6875rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 3px; }
.ra-line { display: block; text-align: left; border: 0; background: transparent; padding: 2px 8px; margin: 0 -8px;
  border-radius: 6px; font: 400 1.0625rem/1.5 var(--serif); color: var(--ink); width: calc(100% + 16px); }
button.ra-line:hover { background: var(--surface); }
.ra-line.now { background: var(--tint); box-shadow: inset 3px 0 0 var(--brand); }
.ra-skip { color: var(--muted); opacity: .6; }
.ra-sd { font: italic 400 .9375rem/1.4 var(--serif); color: var(--muted); margin: 0 0 14px; }
.ra-line.reading { background: var(--surface); }
.ra-sd.reading { color: var(--ink); }
p.ra-line { margin-top: 0; margin-bottom: 0; }
.ra-next { margin: 28px 0 0; }
.scene-page[data-mode="text"] .readalong, .scene-page[data-mode="band"] .readalong { padding-bottom: 60vh; }
.scene-page[data-mode="band"] .scene-stage { position: sticky; top: 52px; z-index: 3; flex: 0 0 auto; height: clamp(230px, 40vh, 470px); max-width: 760px; }
.scene-page[data-mode="band"] .scene-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 26px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--canvas)); }
.scene-page[data-mode="band"] .cap { display: none; }
.read-tick { display: none; }
.scene-page[data-mode="band"] .read-tick { display: block; position: fixed; left: 0; width: 10px; height: 2px; background: var(--brand); z-index: 2; pointer-events: none; }

.scene-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: linear-gradient(to top, var(--canvas) 70%, transparent); color: var(--ink); }
.scene-page[data-mode="scene"] .scene-dock { position: absolute; background: linear-gradient(to top, rgb(0 0 0 / .78) 0, rgb(0 0 0 / .5) 60%, transparent); }
.dock-in { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.seek { display: block; width: 100%; height: 36px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; --p: 0%; }
.seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--ink) var(--p), var(--line) var(--p)); }
.seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; height: 12px; width: 12px; border: 0; border-radius: 50%; margin-top: -4px; background: var(--ink); }
.seek::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
.seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--ink); }
.seek::-moz-range-thumb { height: 12px; width: 12px; border: 0; border-radius: 50%; background: var(--ink); }
.times { display: flex; justify-content: space-between; margin-top: -8px; color: var(--muted); font-size: .6875rem; font-variant-numeric: tabular-nums; pointer-events: none; }
.ctrls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding-top: 2px; }
.sbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; padding: 6px; }
.back15 { position: relative; width: 52px; height: 52px; justify-self: end; }
.back15 span { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-44%); text-align: center; font-size: 11px; font-weight: 600; }
.play { width: 60px; height: 60px; border-radius: 50%; background: var(--ink); color: var(--canvas); }
.play[disabled] { opacity: .45; cursor: default; }
.fs-btn { flex: none; width: 44px; height: 44px; margin-right: -8px; color: var(--cream); }
.chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 14px;
  border: 1px solid var(--line); border-radius: 22px; background: transparent; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.scene-page[data-mode="scene"] .chip { background: rgb(0 0 0 / .25); }
.sw { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--line); transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--canvas); transition: transform .15s; }
.chip[aria-pressed="true"] .sw { background: var(--brand); }
.chip[aria-pressed="true"] .sw::after { transform: translateX(12px); background: #fff; }
.dock-read { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; gap: 8px; }
.dock-credit { max-width: 560px; margin: 2px auto 0; text-align: center; color: var(--muted); font-size: .6875rem; line-height: 1.3; }
.dock-credit:empty { display: none; }
.dock-credit a { color: inherit; }

.sheet { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; overscroll-behavior: contain; background: var(--canvas); color: var(--ink);
  border-radius: 14px 14px 0 0; padding: 6px var(--gutter) max(18px, env(safe-area-inset-bottom)); }
.scene-page[data-mode="scene"] .sheet-in { background: #1c1b1d; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.sheet-top h2 { font: 400 1.5rem/1.2 var(--serif); margin: 6px 0; }
.sheet-head { position: sticky; top: -6px; background: inherit; z-index: 1; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.recs { border: 0; margin: 0; padding: 0; min-width: 0; }
.recs legend, .act-h { font: 600 .6875rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 0; margin: 10px 0 6px; }
#rec-list { display: flex; gap: 6px; }
.rec { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 10px; font-size: .875rem; font-weight: 600; line-height: 1.2; cursor: pointer; }
.rec:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.rec:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.rec input { position: absolute; opacity: 0; pointer-events: none; }
.rec small { display: block; color: var(--muted); font-size: .6875rem; font-weight: 400; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc { display: flex; width: 100%; align-items: baseline; gap: 10px; min-height: 44px; border: 0; border-top: 1px solid var(--line); background: transparent;
  text-align: left; padding: 10px 2px; font-size: .9375rem; }
.sc b { font-weight: 600; min-width: 4.6em; }
.sc span { flex: 1; color: var(--muted); }
.sc[aria-current="true"] { background: var(--tint); box-shadow: inset 3px 0 0 var(--brand); padding-left: 12px; }
.sheet-plain { display: flex; align-items: center; min-height: 44px; margin-top: 10px; font-weight: 600; }
.scene-credits { margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; line-height: 1.45; }
.scene-credits p { margin: 0 0 6px; }
.scene-credits a { color: inherit; }
@media (prefers-reduced-motion: reduce) { .cap-l, .scene-loading, .sw, .sw::after { transition-duration: .01s; } }
