:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  color: #e8eeeb;
  background: #090c0d;
  --paper: #e8eeeb;
  --muted: rgba(224, 235, 231, .5);
  --line: rgba(213, 231, 225, .16);
  --orange: #ff7135;
  --green: #73c98e;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #090c0d; }
button, input { font: inherit; }
button { color: inherit; }
.stage { position: relative; width: 100vw; height: 100svh; min-height: 600px; overflow: hidden; isolation: isolate; background: #090c0d; }
#world-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.masthead {
  position: absolute; z-index: 8; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr); align-items: start;
  padding: clamp(20px, 3vw, 44px) clamp(22px, 4vw, 62px); pointer-events: none;
}
.brand-block { text-align: center; }
.eyebrow, .panel-kicker { margin: 0 0 7px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .22em; }
h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(23px, 2.4vw, 37px); font-weight: 500; letter-spacing: .03em; }
.menu-button { justify-self: start; pointer-events: auto; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: rgba(231,239,236,.72); font-size: 10px; font-weight: 700; letter-spacing: .12em; cursor: pointer; }
.menu-button span { margin-left: 12px; color: var(--orange); }
.stage-readout { justify-self: end; display: grid; justify-items: end; gap: 4px; }
.stage-readout span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.stage-readout strong { font-size: 21px; font-weight: 450; font-variant-numeric: tabular-nums; letter-spacing: .08em; }

.scene-picker {
  position: absolute; z-index: 7; inset: 0; display: grid; grid-template-columns: minmax(280px, .82fr) 1.18fr;
  gap: clamp(40px, 8vw, 130px); align-items: center; padding: 105px clamp(28px, 7vw, 110px) 90px;
  background: rgba(9,12,13,.97); overflow-y: auto; transition: opacity .25s, visibility .25s;
}
.scene-picker.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.picker-heading p { margin: 0 0 17px; color: var(--orange); font-size: 10px; font-weight: 750; letter-spacing: .2em; }
.picker-heading h2 { margin: 0 0 24px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(45px, 6vw, 82px); font-weight: 450; line-height: 1.01; letter-spacing: -.04em; }
.picker-heading span { display: block; width: min(430px, 100%); color: rgba(225,235,232,.55); font-size: 11px; line-height: 1.8; }
.scene-list { border-top: 1px solid var(--line); }
.scene-option {
  width: 100%; display: grid; grid-template-columns: 45px minmax(120px,.62fr) 1fr 22px; gap: 15px; align-items: center;
  padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer;
}
.scene-option .index { color: rgba(231,239,236,.32); font: 10px/1 Georgia, serif; }
.scene-option strong { font: 500 18px/1.2 Georgia, "Noto Serif SC", serif; }
.scene-option small { color: rgba(225,235,232,.48); font-size: 9px; line-height: 1.55; }
.scene-option .arrow { color: var(--orange); transform: translateX(0); transition: transform .2s; }
.scene-option:hover strong, .scene-option:focus-visible strong { color: #ff9a69; }
.scene-option:hover .arrow, .scene-option:focus-visible .arrow { transform: translateX(6px); }

.stage-rail { position: absolute; z-index: 4; left: clamp(20px,3.5vw,54px); top: 25%; display: grid; width: 155px; }
.stage-rail button { position: relative; min-height: 40px; padding: 0 0 0 22px; border: 0; background: transparent; color: rgba(224,235,231,.38); text-align: left; font-size: 9px; font-weight: 650; letter-spacing: .1em; cursor: pointer; }
.stage-rail button::before { content: ""; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; transform: translate(-50%,-50%); border: 1px solid rgba(213,232,226,.34); background: #0a0d0e; }
.stage-rail button::after { content: ""; position: absolute; left: 4px; top: calc(50% + 5px); width: 1px; height: 30px; background: var(--line); }
.stage-rail button:last-child::after { display: none; }
.stage-rail button.passed::before { background: var(--green); border-color: var(--green); }
.stage-rail button.active { color: var(--paper); transform: translateX(3px); }
.stage-rail button.active::before { width: 9px; height: 9px; background: var(--orange); border-color: #ffa074; }

.evidence-panel { position: absolute; z-index: 4; right: clamp(22px,4vw,62px); top: 25%; width: min(330px,27vw); padding-left: 18px; border-left: 1px solid var(--line); }
.evidence-panel h2 { margin: 0 0 17px; font-size: clamp(14px,1.25vw,19px); font-weight: 520; line-height: 1.45; }
.evidence-list { display: grid; gap: 9px; }
.evidence-list p { margin: 0; color: rgba(221,234,229,.64); font-size: 10px; line-height: 1.55; }
.evidence-list p.pass { color: #9ed8bd; }
.evidence-list p.fail { color: #ff9a78; }

.ledger { position: absolute; z-index: 4; right: clamp(22px,4vw,62px); bottom: 19%; min-width: 245px; display: grid; gap: 8px; padding-left: 18px; border-left: 1px solid var(--line); }
.ledger div { display: flex; justify-content: space-between; gap: 32px; }
.ledger span { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.ledger strong { color: #d5e5e0; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ledger strong.success { color: #82d2ae; }

.element-legend { position: absolute; z-index: 4; left: clamp(22px,4vw,62px); bottom: 17.5%; display: flex; gap: 14px; color: var(--muted); font-size: 9px; }
.element-legend span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 0 0; border: 1px solid currentColor; border-radius: 50%; background: currentColor; }
.fire { color:#ff7035 }.water { color:#55b9e9 }.wood { color:#72c68a }.earth { color:#d2a25b }.white { color:#eef3f1 }

.transport { position: absolute; z-index: 5; left: clamp(20px,4vw,62px); right: clamp(20px,4vw,62px); bottom: clamp(18px,3vw,38px); display: grid; grid-template-columns: 32px 62px auto minmax(120px,1fr) 112px 30px; align-items: center; gap: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.transport button { border: 0; background: transparent; cursor: pointer; }
.icon-button { font-size: 20px; opacity: .6; }.play-button { text-align: left; font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.key-button { width: 27px; height: 27px; border: 1px solid rgba(255,255,255,.2)!important; color: rgba(255,255,255,.65); font-size: 9px; }
.timeline-label, #duration-label { color: rgba(221,234,230,.42); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
#duration-label { font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 18px; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg,var(--orange) var(--progress,0%),rgba(255,255,255,.2) var(--progress,0%)); }
input[type="range"]::-webkit-slider-thumb { appearance:none; width:9px; height:9px; margin-top:-4px; border:0; border-radius:50%; background:#ff8a55; }
.orbit-hint { position:absolute; z-index:4; left:50%; bottom:12%; transform:translateX(-50%); margin:0; color:rgba(220,233,228,.35); font-size:8px; letter-spacing:.12em; pointer-events:none; white-space:nowrap; }
.loading { position:absolute; z-index:12; inset:0; display:grid; place-items:center; background:#090c0d; color:var(--muted); font-size:10px; letter-spacing:.18em; transition:opacity .25s,visibility .25s; }
.loading.hidden { opacity:0; visibility:hidden; pointer-events:none; }

@media (max-width: 900px) {
  .stage { min-height: 540px; }.masthead { padding:18px 20px; grid-template-columns:100px 1fr 82px; }.eyebrow { display:none; }
  .scene-picker { grid-template-columns:1fr; align-content:start; gap:35px; padding:100px 24px 50px; }.picker-heading h2 { font-size:48px; }.picker-heading span { max-width:520px; }
  .scene-option { grid-template-columns:32px 130px 1fr 18px; }.stage-rail { left:14px; top:24%; width:125px; }.stage-rail button { font-size:7px; min-height:32px; }.stage-rail button::after { height:22px; }
  .evidence-panel { top:auto; right:18px; bottom:21%; width:46vw; }.evidence-panel h2 { font-size:13px; margin-bottom:8px; }.evidence-list p { font-size:8px; }.ledger { display:none; }
  .element-legend { left:18px; bottom:17%; gap:7px; font-size:8px; }.transport { left:18px; right:18px; bottom:14px; grid-template-columns:28px 56px minmax(80px,1fr) 28px; }.timeline-label,#duration-label { display:none; }.orbit-hint { display:none; }
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition-duration:.01ms!important; } }
