/* ==========================================================================
   The Earth Information Jukebox
   A dark listening room: near-black surfaces, warm amber for the instrument,
   cyan for the data. Type does the heavy lifting — instrument-panel mono for
   numbers, a serif for liner notes, a tight sans for titles.
   ========================================================================== */

:root {
  --bg: #06070a;
  --bg-2: #0a0c11;
  --panel: #0e1116;
  --panel-2: #12161d;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #e9ecf2;
  --ink-2: #a9b1c0;
  --ink-3: #737c8c;
  --amber: #ffb648;
  --amber-soft: rgba(255, 182, 72, 0.14);
  --amber-line: rgba(255, 182, 72, 0.45);
  --cyan: #63dbe4;
  --violet: #b18cff;
  --danger: #ff6b5e;
  --radius: 14px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1400px 720px at 78% -12%, rgba(255, 182, 72, 0.07), transparent 60%),
    radial-gradient(1000px 620px at 4% 4%, rgba(99, 219, 228, 0.06), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 680; letter-spacing: -0.018em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--cyan); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* film grain: SVG turbulence, tiled, very low opacity */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}
body.contrast::after { opacity: 0.02; }

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--amber);
  color: #16110a;
  font-weight: 650;
  text-decoration: none;
  transition: top 0.16s var(--ease);
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.noscript {
  max-width: 62ch;
  margin: 18px auto;
  padding: 16px 18px;
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ------------------------------- topbar --------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 3vw, 34px) 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 12, 17, 0.92), rgba(6, 7, 10, 0.62));
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { color: var(--amber); display: flex; }
.brand-text h1 { font-size: clamp(19px, 2.1vw, 25px); }
.tagline { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.topnav { display: flex; gap: 8px; flex-wrap: wrap; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.ghost {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 560;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.ghost:hover { color: var(--ink); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); }
.ghost[aria-pressed="true"] { color: var(--amber); border-color: var(--amber-line); background: var(--amber-soft); }
.ghost.small { padding: 6px 11px; font-size: 12px; }

.primary {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--amber);
  color: #17120a;
  font-weight: 660;
  font-size: 13px;
  transition: transform 0.12s var(--ease), filter 0.12s var(--ease);
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }
.primary[disabled] { opacity: 0.55; cursor: progress; }

/* -------------------------------- layout -------------------------------- */

.layout {
  padding: clamp(16px, 2.4vw, 30px) clamp(16px, 3vw, 34px) 40px;
  max-width: 1560px;
  margin: 0 auto;
}

/* Shelf + deck only. Keeping them in their own grid is what stops the sticky
   shelf from following the reader down into the method notes. */
.instrument {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}

/* -------------------------------- shelf --------------------------------- */

.shelf { position: sticky; top: 84px; display: grid; gap: 10px; }

.shelf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.record {
  width: 100%;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.record:hover { background: rgba(255, 255, 255, 0.035); }
.record[aria-pressed="true"] {
  background: linear-gradient(120deg, rgba(255, 182, 72, 0.12), rgba(255, 182, 72, 0.03));
  border-color: var(--amber-line);
}

.record-cover {
  position: relative;
  aspect-ratio: 1;
  border-radius: 7px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.record-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.record[aria-pressed="true"] .record-cover { box-shadow: inset 0 0 0 1px var(--amber-line), 0 0 22px rgba(255, 182, 72, 0.22); }

.record-num {
  position: absolute;
  left: 4px; bottom: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px #000;
}

.record-body { display: grid; gap: 2px; min-width: 0; }
.record-title { display: block; font-size: 13.5px; font-weight: 640; letter-spacing: -0.01em; }
.record-sub {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}
.record[aria-pressed="true"] .record-sub { color: var(--amber); }

.shelf-hint { font-size: 11.5px; color: var(--ink-3); padding: 2px 8px 0; line-height: 1.45; }

/* play the whole album */
.concert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 6px 8px 2px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--amber-line);
  background: linear-gradient(100deg, rgba(255, 182, 72, 0.18), rgba(255, 182, 72, 0.05));
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 640;
  letter-spacing: -0.005em;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}
.concert:hover { border-color: var(--amber); background: linear-gradient(100deg, rgba(255, 182, 72, 0.26), rgba(255, 182, 72, 0.08)); }
.concert:active { transform: translateY(1px); }
.concert[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: rgba(255, 182, 72, 0.14); }
.concert-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 182, 72, 0.16);
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.concert[aria-pressed="true"] .concert-dot { background: var(--amber); box-shadow: 0 0 0 5px rgba(255, 182, 72, 0.24); }
@media (prefers-reduced-motion: no-preference) {
  .concert[aria-pressed="true"] .concert-dot { animation: pulse 1.8s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 182, 72, 0.10); }
    50% { box-shadow: 0 0 0 6px rgba(255, 182, 72, 0.22); }
  }
}

.live-tuner {
  margin: 8px 0 0;
  padding: 12px 13px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  display: grid;
  gap: 9px;
}
.live-tuner legend { padding: 0 4px; }
.live-copy { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.field { display: grid; gap: 3px; }
.field > span { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.field select {
  font: inherit;
  font-size: 12px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
}
.live-status { font-size: 11px; color: var(--ink-3); }
.live-status.busy { color: var(--cyan); }
.live-status.error { color: var(--danger); }
#btn-live { justify-self: start; padding: 8px 16px; font-size: 12.5px; margin-top: 2px; }

/* --------------------------------- deck --------------------------------- */

.deck { display: grid; gap: 13px; min-width: 0; }

.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;          /* replaced per record from the frame's own shape */
  max-height: 47vh;
  min-height: 230px;
  box-shadow:
    0 0 0 1px rgba(255, 182, 72, 0.10),
    0 30px 70px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* a printed bezel, so the picture reads as a framed object */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 0 70px rgba(0, 0, 0, 0.45);
}
.stage canvas { width: 100%; height: 100%; display: block; }

.stage-top, .stage-bottom {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}
.stage-top { top: 0; background: linear-gradient(180deg, rgba(4, 5, 8, 0.88), transparent); }
.stage-bottom { bottom: 0; background: linear-gradient(0deg, rgba(4, 5, 8, 0.88), transparent); }
#stage-title { color: var(--amber); font-weight: 600; letter-spacing: 0.12em; }

/* guided tour */
.source-toggle {
  position: absolute;
  top: 44px;
  right: 13px;
  z-index: 4;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 6, 10, 0.72);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.source-toggle:hover { color: var(--ink); border-color: var(--amber-line); }
.source-toggle[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(255, 182, 72, 0.14);
}

.tour-caption {
  position: absolute;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 48px));
  margin: 0;
  padding: 15px 20px;
  border-radius: 12px;
  background: rgba(5, 6, 10, 0.86);
  border: 1px solid rgba(255, 182, 72, 0.38);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color: #f2f5fa;
  font-family: var(--serif);
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(6px);
  z-index: 3;
}
.tour-caption[hidden] { display: none; }
.tour-skip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 6, 10, 0.8);
  color: var(--ink-2);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tour-skip:hover { color: var(--ink); border-color: var(--amber-line); }
.tour-skip[hidden] { display: none; }
#stage-tempo { color: var(--ink-2); }

.filmstrip {
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 0;
  padding: 0;
}
.filmstrip li { min-width: 0; }
.filmstrip button {
  width: 100%;
  padding: 0;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  height: 64px;
  background: #000;
  border: 1px solid var(--line);
  opacity: 0.78;
  transition: opacity 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.filmstrip button:hover { opacity: 0.95; transform: translateY(-1px); }
.filmstrip button img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(1.5) contrast(1.08) saturate(1.1); }
.filmstrip button[aria-current="true"] {
  opacity: 1;
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 0 16px rgba(255, 182, 72, 0.3);
}
.filmstrip button .fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--amber);
  transform-origin: left;
  transform: scaleX(0);
}

.transport {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.transport .round, .transport .play {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: color 0.14s var(--ease), background 0.14s var(--ease), transform 0.1s var(--ease);
}
.transport .round { width: 34px; height: 34px; }
.transport .round svg { width: 15px; height: 15px; fill: currentColor; }
.transport .round:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.transport .round[aria-pressed="true"] { color: var(--amber); background: var(--amber-soft); }

.transport .play {
  width: 46px; height: 46px;
  background: var(--amber);
  color: #191307;
  box-shadow: 0 6px 18px rgba(255, 182, 72, 0.25);
}
.transport .play:hover { filter: brightness(1.07); }
.transport .play:active { transform: scale(0.97); }
.transport .play svg { width: 19px; height: 19px; fill: currentColor; }
.transport .play .i-pause { display: none; }
.transport .play[aria-pressed="true"] .i-play { display: none; }
.transport .play[aria-pressed="true"] .i-pause { display: block; }

.transport-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.volume { display: flex; align-items: center; gap: 7px; color: var(--ink-3); }
.volume svg { width: 15px; height: 15px; fill: currentColor; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%;
  background: var(--amber); cursor: pointer;
}

.clock { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.04em; white-space: nowrap; }

.deck-head { display: grid; gap: 3px; }
.now-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.now-head h3 { font-family: var(--serif); font-size: clamp(21px, 2.4vw, 27px); font-weight: 600; letter-spacing: -0.01em; }
.meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.blurb { color: var(--ink-2); font-size: 13.5px; max-width: 74ch; }
.deck-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.deck-foot .narration { flex: 1 1 420px; }
.narration {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 12px;
  border-left: 2px solid var(--amber-line);
  min-height: 2.6em;
  max-width: 80ch;
}
.now-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 13px; }
.signals, .roll {
  padding: 13px 15px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}
.signals h3, .roll h3 { margin-bottom: 10px; }

.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.meter { display: grid; grid-template-columns: 112px minmax(0, 1fr) 86px; gap: 10px; align-items: center; }
.meter-label { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-bar { position: relative; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.meter-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width 0.4s var(--ease);
}
.meter-value { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-value b { color: var(--ink); font-weight: 600; }
.signals-foot { margin-top: 10px; font-size: 11px; color: var(--ink-3); }

.roll-wrap { position: relative; }
#roll-canvas { width: 100%; height: 168px; display: block; border-radius: 8px; background: #05060a; }
.roll-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--ink-3);
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.roll-empty[hidden] { display: none; }

.legend { list-style: none; display: flex; gap: 12px; margin: 9px 0 0; padding: 0; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); }
.legend li { display: flex; align-items: center; gap: 5px; }
.lg { width: 9px; height: 9px; border-radius: 2px; display: block; }
.lg.pad { background: var(--violet); }
.lg.melody { background: var(--amber); }
.lg.bell { background: #fff3d0; }
.lg.bass { background: var(--cyan); }
.lg.perc { background: #8d94a4; }

/* ------------------------------ liner notes ----------------------------- */

.liner {
  margin-top: clamp(16px, 2vw, 26px);
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #11141a, #0a0c11);
  scroll-margin-top: 90px;
}
.liner[hidden] { display: none; }
.liner-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.liner-grid h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.liner-grid h4 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.liner-grid p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.program-note {
  font-family: var(--serif) !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  color: var(--ink) !important;
  padding-left: 12px;
  border-left: 2px solid var(--amber-line);
  margin: 4px 0 12px !important;
}
.liner-grid ul { margin: 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); display: grid; gap: 3px; }
.liner-grid .credit-list { list-style: none; padding: 0; }
.liner-grid .credit-list li { font-size: 12.5px; }
.liner-grid .credit-list b { color: var(--ink); font-weight: 580; }

.axis-swatch {
  height: 18px;
  border-radius: 5px;
  margin: 9px 0 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.axis-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px !important;
}
.axis-legend span:nth-child(2) { color: var(--cyan); }

.liner-grid audio {
  width: 100%;
  max-width: 320px;
  height: 34px;
  margin: 4px 0 6px;
  border-radius: 999px;
  accent-color: var(--amber);
}
.audio-hint { font-size: 11.5px !important; color: var(--ink-3) !important; line-height: 1.45; margin-top: 0 !important; }

/* -------------------------------- method -------------------------------- */

.method {
  margin-top: clamp(16px, 2vw, 26px);
  padding: clamp(18px, 2.6vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  scroll-margin-top: 90px;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  color: var(--ink);
  max-width: 78ch;
  margin: 12px 0 22px;
}
.method-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 30px; }
.method-col h3 { font-size: 12px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); margin: 16px 0 5px; }
.method-col h3:first-child { margin-top: 0; }
.method-col p { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.mapping { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mapping caption { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 9px; }
.mapping th, .mapping td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.mapping th { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); border-bottom-color: var(--line-strong); }
.mapping td:first-child { color: var(--ink); }
.mapping td:nth-child(2) { color: var(--cyan); }
.mapping td:last-child { color: var(--ink-3); }
.mapping tr.art td:first-child, .mapping tr.art td:nth-child(2) { color: var(--violet); }
.mapping tr.art td:last-child { font-style: italic; }
.method-note { margin-top: 12px; font-size: 12px; color: var(--ink-3); max-width: 62ch; }

/* -------------------------------- footer -------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 22px clamp(16px, 3vw, 34px) 40px;
  max-width: 1560px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--ink-3);
  display: grid;
  gap: 6px;
}
.foot-meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; }

/* -------------------------------- dialog -------------------------------- */

dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 22px 24px;
  max-width: 460px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(3, 4, 7, 0.72); backdrop-filter: blur(3px); }
dialog h2 { font-size: 17px; margin-bottom: 14px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0 0 18px; font-size: 13px; }
.keys dt { font-family: var(--mono); font-size: 11.5px; color: var(--amber); white-space: nowrap; }
.keys dd { margin: 0; color: var(--ink-2); }

/* ------------------------------ high contrast --------------------------- */

body.contrast {
  --bg: #000;
  --bg-2: #000;
  --panel: #050505;
  --panel-2: #0a0a0a;
  --line: rgba(255, 255, 255, 0.34);
  --line-strong: rgba(255, 255, 255, 0.7);
  --ink: #fff;
  --ink-2: #e7e7e7;
  --ink-3: #c2c2c2;
  --amber: #ffd24a;
  --cyan: #7fe8f2;
  background: #000;
}
body.contrast .stage { border-width: 2px; }
body.contrast .meter-bar { background: #333; }
body.contrast .filmstrip button { opacity: 0.85; }
body.contrast .filmstrip button[aria-current="true"] { opacity: 1; }

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 1180px) {
  .instrument { grid-template-columns: minmax(0, 1fr); }
  .shelf { position: static; }
  .shelf-list { grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .record { grid-template-columns: 48px minmax(0, 1fr); }
  .live-tuner { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
  .live-copy, .live-tuner legend { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .panels { grid-template-columns: minmax(0, 1fr); }
  .method-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 720px) {
  .topbar { position: static; }
  .stage { aspect-ratio: 4 / 3; }
  .meter { grid-template-columns: 92px minmax(0, 1fr) 72px; }
  .transport { flex-wrap: wrap; border-radius: var(--radius); justify-content: center; }
  .transport-right { margin-left: 0; width: 100%; justify-content: space-between; padding: 0 4px 3px; }
  .filmstrip { gap: 3px; }
  .filmstrip button { height: 42px; }
  .now-head h3 { font-size: 21px; }
}

/* --------------------------- motion preference -------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .filmstrip button:hover { transform: none; }
}
