:root {
  color-scheme: dark;
  --background: #101919;
  --surface: #142020;
  --text: #e6eae1;
  --muted: #93a39a;
  --line: #2b3b35;
  --green: #b5e5bf;
  --gold: #f2c77e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-family: "Segoe UI", sans-serif; font-size: 14px; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, #scene-interaction:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
button:disabled { cursor: default; opacity: .4; }
.masthead { height: 82px; margin: 0 4%; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: center; gap: 13px; color: var(--text); text-decoration: none; letter-spacing: .22em; font-size: 15px; font-weight: 600; }
.brand-symbol { color: var(--green); font-size: 31px; font-weight: 400; }
.wordmark-note { color: var(--muted); border-left: 1px solid var(--line); margin-left: 12px; padding-left: 24px; font-size: 9px; letter-spacing: .17em; font-weight: 400; }
.quiet-button { border: 0; background: transparent; padding: 8px; color: var(--muted); font-size: 12px; transition: color .2s; }
.quiet-button:hover, .quiet-button[aria-pressed="true"] { color: var(--green); }
.masthead .quiet-button span { font-size: 21px; padding-left: 10px; }
main { max-width: 1800px; margin: auto; }
.scene { position: relative; height: calc(100svh - 320px); min-height: 480px; max-height: 1000px; overflow: hidden; }
#scene { display: block; width: 100%; height: 100%; pointer-events: none; }
/* A separate hit area lets the browser scroll gestures that begin over text. */
#scene-interaction { position: absolute; top: 8%; bottom: 25%; left: 34%; right: 4%; touch-action: none; cursor: grab; }
#scene-interaction:active { cursor: grabbing; }
.introduction { position: absolute; top: 9%; left: 4%; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: .19em; font-weight: 500; margin: 0 0 19px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4vw, 65px); font-weight: 400; letter-spacing: -.045em; line-height: 1.05; margin: 0 0 21px; }
.intro-copy { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0; }
.phase-indicator { position: absolute; top: 8%; right: 4%; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 30px; padding: 10px 16px; font-size: 10px; letter-spacing: .08em; background: #101919b3; }
#phase-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.phase-indicator.adding { color: var(--gold); border-color: #6d5939; }
.phase-indicator.adding #phase-dot { background: var(--gold); box-shadow: 0 0 9px #f2c77e70; }
.shape-info { position: absolute; left: 4%; bottom: 12%; max-width: 270px; }
.shape-info .eyebrow { color: var(--green); margin-bottom: 12px; }
h2 { font: 400 31px Georgia, "Times New Roman", serif; letter-spacing: -.03em; margin: 0 0 12px; }
#shape-description { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0; }
.shape-stats { display: flex; gap: 22px; margin-top: 23px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat strong { font-size: 20px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { font-size: 8px; letter-spacing: .14em; color: var(--muted); }
.scene-caption { position: absolute; bottom: 15%; left: 35%; width: 50%; text-align: center; }
.scene-caption p { margin: 0 0 9px; font: 400 19px Georgia, "Times New Roman", serif; }
.scene-caption > span { color: var(--muted); font-size: 11px; line-height: 1.6; display: block; }
.view-tools { position: absolute; right: 4%; bottom: 3%; display: flex; align-items: center; gap: 12px; }
.drag-hint { font-size: 8px; color: var(--muted); letter-spacing: .13em; margin-left: 8px; }
.orbit-icon { font-size: 16px; margin-right: 4px; }
.legend { position: absolute; left: 4%; bottom: 4.5%; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; }
.legend-dot.existing { background: var(--green); }
.legend-dot.added { background: var(--gold); margin-left: 12px; }
.playback { margin: 0 4%; padding-top: 21px; border-top: 1px solid var(--line); }
.timeline-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) var(--background); padding: 5px 0; }
.timeline-track { position: relative; min-width: 1250px; }
.path-labels { display: grid; grid-template-columns: 7fr 1fr 7fr; margin-bottom: 9px; text-align: center; color: var(--muted); font-size: 8px; letter-spacing: .15em; }
.path-group { min-width: 0; }
.path-group > span { position: sticky; left: 8px; right: 8px; display: inline-block; white-space: nowrap; }
.path-labels .active { color: var(--green); }
.origin-label { color: var(--gold); }
.stage-navigation { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 4px; }
.stage-button { min-width: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 9px 4px; text-align: center; color: var(--muted); }
.stage-button:hover { background: #ffffff05; color: var(--text); }
.stage-button.active { border-color: #55715a; background: #b5e5bf0a; color: var(--green); }
.stage-button.pivot .stage-title { color: var(--gold); }
.stage-title { display: block; font-size: 10px; white-space: nowrap; }
.stage-count { display: block; font-size: 9px; margin-top: 5px; color: var(--muted); }
.seek { --progress: 50%; appearance: none; display: block; height: 3px; width: calc(100% - (100% - 56px) / 15); margin: 23px calc((100% - 56px) / 30) 18px; border-radius: 3px; background: linear-gradient(to right, var(--green) var(--progress), var(--line) var(--progress)); cursor: pointer; }
.seek::-webkit-slider-thumb { appearance: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--background); box-shadow: 0 0 0 1px var(--green); }
.seek::-moz-range-thumb { width: 7px; height: 7px; border-radius: 50%; background: var(--green); border: 2px solid var(--background); }
.transport, .transport-left, .transport-right { display: flex; align-items: center; }
.transport { justify-content: space-between; }
.transport-left { gap: 18px; }
.play-button { min-width: 98px; padding: 10px 16px; display: flex; justify-content: center; align-items: center; gap: 11px; border: 1px solid #55715a; border-radius: 5px; color: var(--green); background: #b5e5bf0a; font-size: 11px; }
.play-button:hover { background: #b5e5bf18; }
#play-icon { font-size: 10px; }
.timecode { font-family: Consolas, monospace; font-size: 11px; color: var(--muted); }
#elapsed { color: var(--text); }
#travel-direction { color: var(--green); margin-right: 4px; }
.time-divider { padding: 0 9px; color: #577063; }
.transport-right { gap: 13px; }
.transport { flex-wrap: wrap; gap: 12px; }
.transport-right { flex-wrap: wrap; margin-left: auto; }
#music { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 8px; }
#music[aria-pressed="true"] { color: var(--green); }
#music[aria-pressed="false"] .speaker-playing, #music[aria-pressed="true"] .speaker-muted { display: none; }
.music-status { margin: 8px 0 0; min-height: 14px; text-align: right; color: var(--muted); font-size: 10px; }
.music-status.error { color: var(--gold); }
.transport-right label { font-size: 8px; letter-spacing: .17em; color: var(--muted); }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; color: var(--text); font-size: 11px; }
footer { display: flex; justify-content: space-between; margin: 26px 4% 17px; color: #83978a; font-size: 8px; letter-spacing: .13em; }
footer span:last-child { letter-spacing: .04em; }
footer a { color: inherit; text-underline-offset: 2px; }
footer a:hover { color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 1600px) { .introduction, .shape-info, .legend { left: 5%; } }
@media (max-width: 1000px) {
  .wordmark-note { display: none; }
  .drag-hint { display: none; }
  .shape-info { max-width: 220px; }
  .scene-caption { left: 34%; width: 61%; }
  .scene-caption p { font-size: 17px; }
}
@media (max-width: 640px) {
  .masthead { height: 65px; }
  .wordmark { font-size: 12px; }
  .scene { height: 610px; min-height: 610px; }
  #scene-interaction { top: 135px; bottom: 260px; left: 5%; right: 5%; }
  .introduction { top: 25px; }
  .introduction .eyebrow { font-size: 7px; margin-bottom: 13px; }
  h1 { font-size: 34px; }
  .intro-copy { display: none; }
  .phase-indicator { top: 26px; padding: 8px 11px; font-size: 8px; }
  .shape-info { bottom: 82px; max-width: none; width: 92%; }
  .shape-info .eyebrow { font-size: 8px; margin-bottom: 9px; }
  h2 { font-size: 25px; }
  #shape-description { max-width: 53%; font-size: 10px; }
  .shape-stats { position: absolute; right: 0; top: 0; gap: 17px; }
  .stat strong { font-size: 18px; }
  .stat span { font-size: 7px; }
  .scene-caption { bottom: 203px; left: 5%; width: 90%; }
  .scene-caption p { font-size: 16px; }
  .scene-caption > span { font-size: 10px; }
  .view-tools { bottom: 17px; gap: 8px; }
  .legend { bottom: 32px; font-size: 8px; gap: 5px; }
  .view-tools .quiet-button { font-size: 10px; padding: 5px; }
  .transport { flex-wrap: wrap; gap: 10px; }
  .transport-left { flex: 1 0 100%; gap: 7px; }
  .play-button { min-width: 74px; padding: 9px 10px; gap: 7px; }
  #restart span, .transport-right label { display: none; }
  .timecode { font-size: 10px; }
  .time-divider { padding: 0 4px; }
  #travel-direction { margin-right: 0; }
  .transport-right { gap: 0; margin-left: auto; }
  #music { margin-right: 10px; }
  select { max-width: 120px; padding: 7px 3px; font-size: 10px; }
  footer { font-size: 7px; margin-top: 24px; gap: 16px; }
  footer span:last-child { max-width: 140px; text-align: right; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
