:root {
  color-scheme: dark;
  --canvas: #101112;
  --panel: #181a1c;
  --control: #222528;
  --line: #393d41;
  --text: #e8e6e1;
  --muted: #b1b5b9;
  --gold: #e4bf7e;
  --selected: #352d20;
  font: 15px/1.5 system-ui, -apple-system, sans-serif;
  accent-color: var(--gold);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--text); }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1 { font-size: clamp(1.4rem, 3vw, 2.05rem); line-height: 1.2; }
h2 { font-size: 1.15rem; line-height: 1.25; }
h3 { font-size: 1rem; }
h4 { font-size: .84rem; }
a { color: var(--gold); text-underline-offset: .2em; }
button { color: inherit; font: inherit; background: var(--control); border: 1px solid var(--line); border-radius: 5px; padding: .45rem .75rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--gold); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -6rem; z-index: 2; background: var(--canvas); padding: .5rem; }
.skip:focus { top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chrome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--panel); border-bottom: 1px solid var(--line); padding: .65rem clamp(1rem, 3vw, 2.5rem); }
.brand { width: clamp(120px, 20vw, 176px); }
.brand img { width: 100%; height: auto; }
.return { font-size: .86rem; }
.workspace { width: min(100% - 2rem, 1420px); margin-inline: auto; padding: clamp(1.2rem, 3vw, 2.6rem) 0 3rem; }
.project-heading .muted { margin-top: .35rem; }
.muted { color: var(--muted); font-size: .88rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.25rem 0 1.1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.tabs button { background: transparent; min-height: 40px; }
.tabs button[aria-selected=true] { background: var(--selected); color: var(--gold); border-color: #6e5835; }
.section-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; margin-bottom: .75rem; min-height: 2.4rem; }
.section-bar a, .section-bar button { font-size: .85rem; }
.panel, .tile { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.board, .reference-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.board-list, .reference-layout > *, .assembly-layout > * { min-width: 0; }
.beat-grid, .reference-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; }
.tile { display: block; width: 100%; padding: .27rem; text-align: left; min-width: 0; }
.tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--canvas); }
.tile[aria-pressed=true] { outline: 2px solid var(--gold); outline-offset: -2px; background: var(--selected); }
.tile-label { display: flex; flex-direction: column; gap: .12rem; padding: .36rem .3rem .25rem; }
.tile-label strong { font-size: .84rem; line-height: 1.3; overflow-wrap: anywhere; }
.eyebrow, .tile-label small { color: var(--gold); font-size: .75rem; }
.inspector, .reference-detail, .clip-detail { padding: .9rem; }
.inspector { position: sticky; top: .75rem; }
.inspect-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.beat-buttons { display: flex; gap: .3rem; }
.beat-buttons button { flex: none; padding: .15rem .65rem; min-width: 38px; font-size: 1.25rem; }
.frame, #film { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0b0c0d; }
.inspector h3, .reference-detail h4, .clip-detail h4 { margin: .85rem 0 .25rem; color: var(--muted); font-size: .82rem; }
.pills, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.pills button, .actions button, .clip-detail button { font-size: .84rem; }
.actions, .clip-detail button { margin-top: .85rem; }
.demo-card { margin-bottom: .75rem; padding: .8rem; }
.demo-card p { margin: .35rem 0 .7rem; }
.demo-card .beat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.reference-grid .tile img { aspect-ratio: 4 / 3; }
.reference-preview { width: 100%; max-height: 390px; object-fit: contain; background: var(--canvas); margin-top: .65rem; }
.compare-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.compare-grid figcaption { padding: .55rem .8rem; color: var(--gold); }
.compare-notes { margin: .8rem 0 0; }
.compare-notes p { margin-top: .25rem; }
.assembly-layout { display: grid; grid-template-columns: minmax(0,2.1fr) minmax(0,1fr); gap: .75rem; align-items: start; }
@media (min-width: 761px) { #film { max-height: clamp(300px, 43vh, 590px); object-fit: contain; } }
.timeline { margin-top: .8rem; padding: .75rem; }
.timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
#play-time { color: var(--muted); font-variant-numeric: tabular-nums; }
#seek { display: block; width: 100%; margin: .75rem 0; cursor: pointer; }
.timeline-scroll { overflow-x: auto; }
.tracks { display: grid; grid-template-columns: 5.6rem minmax(770px,1fr); gap: .35rem; align-items: center; font-size: .76rem; padding: 3px; }
.visual-clips { display: flex; gap: 2px; }
.visual-clips button { flex-basis: 0; min-width: 0; padding: 0; position: relative; height: 66px; overflow: hidden; }
.visual-clips button img { width: 100%; height: 100%; object-fit: cover; }
.visual-clips button span { position: absolute; inset: auto 0 0; background: #101218e8; color: white; font-size: .7rem; white-space: nowrap; }
.visual-clips button[aria-current=true] { box-shadow: inset 0 0 0 2px var(--gold); border-color: var(--gold); }
.wave { position: relative; height: 36px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #392e20; color: #efcb91; }
.wave.music { background: #203345; color: #96b9d2; }
.wave canvas { display: block; width: 100%; height: 100%; }
.wave span { position: absolute; top: 4px; left: 4px; padding: 0 4px; background: #16191de0; color: white; border-radius: 2px; pointer-events: none; }
@media (max-width: 760px) {
  .board, .reference-layout, .assembly-layout { grid-template-columns: 1fr; }
  .inspector { position: static; grid-row: 1; }
}
@media (max-width: 440px) {
  .beat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reference-grid, .compare-grid { grid-template-columns: 1fr; }
  .reference-grid .tile { display: grid; grid-template-columns: minmax(88px,32%) 1fr; align-items: center; gap: .4rem; }
  .tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .return { font-size: .77rem; }
}
