/* ==========================================================================
   aural. — stylesheet
   1. Tokens  2. Base  3. Layout  4. Components  5. Masthead & hero
   6. Studio  7. Explore  8. Science  9. Methodology  10. Footer  11. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --maroon: #500000;
  --maroon-deep: #3a0000;
  --maroon-tint: #f4ece8;
  --ivory: #f7f4ee;
  --ivory-deep: #efeae1;
  --surface: #ffffff;
  --surface-alt: #fbfaf7;
  --ink: #242222;
  --mute: #706a65;
  --line: #ded8d0;
  --line-strong: #c9c1b6;
  --brass: #b08d57;
  --brass-ink: #7a5d31;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.8125rem; /* 13 */
  --fs-base: 0.9375rem; /* 15 */
  --fs-md: 1.0625rem; /* 17 */
  --fs-lg: 1.25rem;   /* 20 */
  --fs-xl: 1.625rem;  /* 26 */
  --fs-2xl: clamp(1.875rem, 3.2vw, 2.625rem);
  --fs-hero: clamp(2.75rem, 6.2vw, 5.25rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  --radius: 3px;
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
canvas { display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip-link {
  position: absolute; left: var(--space-4); top: -60px; z-index: 50;
  background: var(--maroon); color: var(--ivory); padding: var(--space-2) var(--space-4);
  text-decoration: none; border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 3. Layout ---------------------------------------------------------------- */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
section { position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); margin-bottom: var(--space-5); }
.kicker {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--maroon); margin-bottom: var(--space-2);
}
.section-head h2, .method-head h2 {
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl);
  line-height: 1.08; letter-spacing: -0.02em; font-variation-settings: "opsz" 96;
}
.section-lead { color: var(--mute); max-width: 60ch; margin-top: var(--space-2); }

/* 4. Components ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.01em; text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn--primary { background: var(--maroon); color: var(--ivory); }
.btn--primary:hover { background: var(--maroon-deep); }
.btn--primary:disabled { background: #8a6a66; cursor: progress; }
.btn--quiet { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--quiet:hover { border-color: var(--ink); }
.btn--quiet:disabled { color: #a49d96; border-color: var(--line); cursor: not-allowed; }
.btn--small { min-height: 34px; padding: 0 var(--space-3); font-size: var(--fs-xs); }
.btn--block { width: 100%; }
.text-link { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.text-link:hover { text-decoration-color: var(--maroon); }

.chip {
  display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; border-radius: 2px;
}
.chip--a { background: var(--maroon); color: var(--ivory); }
.chip--b { background: var(--brass); color: var(--ink); }

.select { position: relative; }
.select select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 44px;
  padding: 0 40px 0 var(--space-3); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: var(--fs-base); font-weight: 500; cursor: pointer;
  text-overflow: ellipsis;
}
.select select:hover { border-color: var(--ink); }
.select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.select--small select { min-height: 38px; font-size: var(--fs-sm); }

/* Transport: play button and timecode */
.play {
  position: relative; width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1px solid var(--maroon); background: var(--surface);
  display: grid; place-items: center; transition: background-color .15s var(--ease);
}
.play:hover:not(:disabled) { background: var(--maroon-tint); }
.play:disabled { border-color: var(--line); cursor: not-allowed; }
.play-icon {
  width: 0; height: 0; margin-left: 3px;
  border-left: 10px solid var(--maroon); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.play:disabled .play-icon { border-left-color: var(--line-strong); }
.play.is-playing { background: var(--maroon); }
.play.is-playing .play-icon {
  margin-left: 0; width: 10px; height: 12px; border: 0;
  border-left: 3px solid var(--ivory); border-right: 3px solid var(--ivory);
}
.transport { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; }
.transport-label { font-size: var(--fs-sm); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timecode { font-size: var(--fs-xs); color: var(--mute); white-space: nowrap; }

/* Waveform */
.wave {
  position: relative; width: 100%; background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.wave--lg { height: 176px; }
.wave--sm { height: 84px; }
.wave canvas { position: absolute; left: 0; top: 0; height: 100%; }
.wave .wave-base { width: 100%; }
.wave-fill { position: absolute; inset: 0 auto 0 0; width: 0; overflow: hidden; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--maroon); opacity: 0; }
.wave.has-audio { cursor: pointer; }
.wave.has-audio .playhead { opacity: 1; }
.wave:focus-visible { outline-offset: 0; }
.wave-empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-5);
  text-align: center; color: var(--mute); font-size: var(--fs-sm); pointer-events: none;
}

/* Status lines */
[data-tone] { position: relative; }
.render-status, .capture-status { font-size: var(--fs-sm); color: var(--mute); }
.render-status { margin-top: var(--space-3); min-height: 2.6em; padding-left: 16px; }
.render-status::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong);
}
.render-status[data-tone="ready"]::before { background: var(--brass); }
.render-status[data-tone="busy"]::before { background: var(--maroon); animation: pulse 1s ease-in-out infinite; }
.render-status[data-tone="ok"]::before { background: var(--maroon); }
.render-status[data-tone="error"], .capture-status[data-tone="error"] { color: var(--maroon); font-weight: 500; }
.render-status[data-tone="error"]::before { background: var(--maroon); border-radius: 0; transform: rotate(45deg); }
.capture-status[data-tone="ok"] { color: var(--ink); }
@keyframes pulse { 50% { opacity: .25; } }

/* 5. Masthead & hero ------------------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 244, 238, .96); border-bottom: 1px solid var(--line);
}
.masthead-inner { display: flex; align-items: center; gap: var(--space-6); height: 60px; }
.wordmark {
  font-family: var(--font-display); font-weight: 600; font-size: 1.625rem; line-height: 1;
  letter-spacing: -0.045em; color: var(--ink); text-decoration: none;
  font-variation-settings: "opsz" 144, "SOFT" 0;
}
.wordmark-dot { color: var(--maroon); margin-left: 0.02em; }
.primary-nav { display: flex; gap: var(--space-5); margin-left: auto; }
.primary-nav a {
  position: relative; font-size: var(--fs-sm); font-weight: 500; text-decoration: none; color: var(--mute);
  padding: var(--space-2) 0;
}
.primary-nav a:hover, .primary-nav a.is-active { color: var(--ink); }
.primary-nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--maroon);
}
.hero { padding: clamp(28px, 3.6vw, 52px) 0 clamp(24px, 3vw, 40px); }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--space-7); align-items: end; }
.hero h1 {
  font-family: var(--font-display); font-weight: 350; font-size: var(--fs-hero);
  line-height: 1; letter-spacing: -0.022em; word-spacing: 0.04em; font-variation-settings: "opsz" 120;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--maroon); }
.hero-side { padding-bottom: 6px; border-left: 1px solid var(--line); padding-left: var(--space-6); }
.hero-lead {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(1.125rem, 1.45vw, 1.375rem);
  line-height: 1.42; letter-spacing: -0.005em; max-width: 34ch; font-variation-settings: "opsz" 24;
  text-wrap: pretty;
}
.hero-actions { display: flex; align-items: center; gap: var(--space-5); margin-top: var(--space-4); flex-wrap: wrap; }
.hero-facts { margin-top: var(--space-4); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--mute); }

/* 6. Studio ---------------------------------------------------------------- */
.studio { padding: var(--space-6) 0 var(--space-7); border-top: 1px solid var(--line); }
.steps { display: flex; gap: 0; font-size: var(--fs-sm); color: var(--mute); }
.steps li { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); border-left: 1px solid var(--line); }
.steps li:first-child { border-left: 0; }
.steps-no { font-family: var(--font-mono); font-size: var(--fs-xs); }
.steps li.is-done .steps-no { color: var(--maroon); }
.steps li.is-current { color: var(--ink); font-weight: 600; }
.steps li.is-current .steps-no { color: var(--surface); background: var(--maroon); padding: 1px 5px; border-radius: 2px; }

.console {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.deck { padding: var(--space-5) var(--space-6); min-width: 0; }
.deck--capture { display: flex; flex-direction: column; }
.deck--select { border-left: 1px solid var(--line); background: var(--surface-alt); }
.deck-head { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-4); }
.deck-no { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--maroon); }
.deck-head h3 { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.deck-meta { margin-left: auto; font-size: var(--fs-xs); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-note { margin-left: auto; font-size: var(--fs-xs); color: var(--mute); max-width: 52ch; text-align: right; }

.capture-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.capture-status { flex: 1 1 220px; min-width: 0; }
.upload-btn { cursor: pointer; }
.capture-bar:has(#audioFile:focus-visible) .upload-btn { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn--record { background: var(--surface); border-color: var(--line-strong); min-width: 128px; }
.btn--record:hover { border-color: var(--maroon); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--maroon); flex: none; }
.btn--record.is-recording { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); font-variant-numeric: tabular-nums; }
.btn--record.is-recording .rec-dot { background: var(--ivory); border-radius: 1px; animation: pulse 1s ease-in-out infinite; }
.btn--record:disabled { color: #a49d96; cursor: not-allowed; border-color: var(--line); }
.btn--record:disabled .rec-dot { background: var(--line-strong); }
.deck--capture.is-dragover .wave--lg { border-color: var(--maroon); border-style: dashed; background: var(--maroon-tint); }
.player--main { flex: 1; display: flex; flex-direction: column; }
.player--main .wave--lg { flex: 1; min-height: 150px; height: auto; }
.player--main .transport { margin-top: var(--space-2); }
.player--main .timecode { margin-left: auto; }

.field { margin-bottom: var(--space-3); transition: background-color .6s var(--ease); }
.field.is-flash { background: var(--maroon-tint); }
.field label, .mini-field label {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--space-2);
}
.field-meta { margin-top: 6px; font-size: var(--fs-xs); color: var(--mute); min-height: 1.5em; }
.swap {
  display: block; margin: calc(-1 * var(--space-2)) 0 var(--space-3) auto; padding: var(--space-1) 0;
  background: none; border: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--mute);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong);
}
.swap:hover { color: var(--ink); }
.field--range { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.range-head { display: flex; justify-content: space-between; align-items: baseline; }
.range-head label { margin-bottom: 0; }
.range-head output { font-size: var(--fs-sm); color: var(--maroon); font-weight: 500; }
.range-ends { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--mute); }
input[type="range"] {
  --pct: 75%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: var(--space-2) 0 0;
  background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: linear-gradient(to right, var(--maroon) var(--pct), var(--line-strong) var(--pct));
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--maroon); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--maroon);
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--maroon); }
input[type="range"]:focus-visible { outline-offset: 4px; }

.listen {
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); padding: var(--space-5) var(--space-6);
}
.deck-head--listen { align-items: baseline; }
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.track { min-width: 0; }
.track-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.track-title { min-width: 0; flex: 1; }
.track-title h4 {
  font-family: var(--font-display); font-weight: 450; font-size: var(--fs-lg); line-height: 1.2;
  letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-title p { font-size: var(--fs-xs); color: var(--mute); }
.track .transport { margin-top: var(--space-2); }
.track-stale { margin-left: auto; font-size: var(--fs-xs); font-weight: 600; color: var(--brass-ink); }
.track.is-stale .wave { opacity: .55; }
.track.is-fresh .wave { animation: arrive .5s var(--ease); }
@keyframes arrive { from { opacity: .3; } }

.compare { margin-top: var(--space-5); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.compare-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.compare-table th, .compare-table td { text-align: left; padding: 10px var(--space-3) 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.compare-table thead th { font-size: var(--fs-xs); font-weight: 600; color: var(--mute); letter-spacing: 0.04em; padding-top: 0; }
.compare-table tbody th { font-weight: 600; width: 26%; }
.compare-table tbody th small { display: block; font-weight: 400; color: var(--mute); font-family: var(--font-mono); font-size: 11px; }
.compare-table .col-a, .compare-table .col-b { width: 17%; }
.compare-table thead .col-a { color: var(--maroon); }
.compare-table thead .col-b { color: var(--brass-ink); }
.compare-table .col-note { color: var(--mute); }
.cmp-val { display: flex; flex-direction: column; gap: 5px; }
.cmp-val .mono { font-size: var(--fs-base); white-space: nowrap; }
.cmp-bar { height: 3px; background: var(--ivory-deep); position: relative; max-width: 140px; }
.cmp-bar i { position: absolute; inset: 0 auto 0 0; background: var(--maroon); }
.col-b .cmp-bar i { background: var(--brass); }
.cmp-na { color: var(--mute); font-size: var(--fs-xs); }
.compare-note { margin-top: var(--space-3); font-size: var(--fs-xs); color: var(--mute); }

/* 7. Explore --------------------------------------------------------------- */
.explore { padding: var(--space-7) 0; border-top: 1px solid var(--line); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); flex: none; }
.segmented button {
  min-height: 38px; padding: 0 var(--space-4); border: 0; background: none;
  font-size: var(--fs-xs); font-weight: 600; color: var(--mute);
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); }

.atlas-head, .atlas-row {
  display: grid; grid-template-columns: 44px minmax(190px, 1.25fr) minmax(170px, 1fr) minmax(200px, 1.45fr) 200px;
  gap: var(--space-5); align-items: center;
}
.atlas-head {
  padding: 0 0 var(--space-2); border-bottom: 1px solid var(--ink);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute);
}
.atlas-head span:last-child { text-align: right; }
.atlas-row { position: relative; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); transition: background-color .2s var(--ease); }
.atlas-row:hover { background: rgba(255, 255, 255, .6); }
.atlas-row.is-a::before, .atlas-row.is-b::before {
  content: ""; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 3px; background: var(--maroon);
}
.atlas-row.is-b::before { background: var(--brass); }
.atlas-no { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--mute); }
.atlas-name h3 { font-family: var(--font-display); font-weight: 450; font-size: var(--fs-lg); line-height: 1.2; letter-spacing: -0.01em; }
.atlas-name p { font-size: var(--fs-xs); color: var(--mute); margin-top: 2px; }
.atlas-decay { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-3); }
.decay-track { height: 4px; background: var(--ivory-deep); position: relative; }
.decay-track i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.atlas-row.is-a .decay-track i { background: var(--maroon); }
.atlas-row.is-b .decay-track i { background: var(--brass); }
.decay-val { font-size: var(--fs-sm); min-width: 4.5ch; text-align: right; }
.atlas-desc { font-size: var(--fs-sm); line-height: 1.45; }
.atlas-desc small { display: block; margin-top: 3px; color: var(--mute); font-size: var(--fs-xs); }
.atlas-flag { color: var(--brass-ink) !important; }
.atlas-na { font-size: var(--fs-xs); color: var(--mute); }
.atlas-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.atlas-actions button {
  min-height: 34px; padding: 0 var(--space-3); border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-xs); font-weight: 600;
}
.atlas-actions button:hover { border-color: var(--ink); }
.atlas-actions button[data-use="A"][aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); }
.atlas-actions button[data-use="B"][aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.atlas-ref { font-size: var(--fs-xs); color: var(--mute); text-align: right; }
.atlas-ref a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.atlas-loading { padding: var(--space-6) 0; color: var(--mute); }

.field-section { padding: var(--space-7) 0; border-top: 1px solid var(--line); }
.field-recs { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: var(--space-7); align-items: start; }
.field-recs-intro h2 {
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.08;
  letter-spacing: -0.02em; margin-bottom: var(--space-3); font-variation-settings: "opsz" 96;
}
.field-recs-intro p:not(.kicker) { font-size: var(--fs-sm); color: var(--mute); }
.flute-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-6); border-top: 1px solid var(--ink); align-self: start; }
.flute-item { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.flute-item .play { width: 34px; height: 34px; grid-row: span 2; }
.flute-title { display: flex; justify-content: space-between; gap: var(--space-2); align-items: baseline; min-width: 0; }
.flute-title strong { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flute-title .mono { font-size: 11px; color: var(--mute); white-space: nowrap; }
.flute-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-3); margin-top: 4px; }
.flute-sub .tag { font-size: 11px; color: var(--mute); min-width: 0; white-space: nowrap; }
.flute-sub .tag.is-error { color: var(--maroon); font-weight: 600; white-space: normal; }
.flute-item.is-loading .play { border-color: var(--line-strong); animation: pulse 1s ease-in-out infinite; }
.flute-progress { flex: 1 1 96px; height: 14px; position: relative; cursor: pointer; }
.flute-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--ivory-deep); }
.flute-progress i { position: absolute; left: 0; top: 6px; height: 2px; width: 0; background: var(--maroon); }

/* 8. Science --------------------------------------------------------------- */
.science { padding: var(--space-7) 0; border-top: 1px solid var(--line); background: var(--ivory-deep); }
.science-pick { display: flex; gap: var(--space-4); align-items: flex-end; flex-wrap: wrap; }
.mini-field { width: 220px; }
.viz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 var(--space-6); gap: var(--space-5); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button {
  position: relative; background: none; border: 0; padding: var(--space-4) 0; white-space: nowrap;
  font-size: var(--fs-sm); font-weight: 600; color: var(--mute);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--maroon); }
.viz-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.viz-figure { padding: var(--space-5) var(--space-6) var(--space-4); min-width: 0; }
.viz-figure canvas { width: 100%; height: 340px; }
.viz-legend { display: flex; gap: var(--space-5); flex-wrap: wrap; margin-top: var(--space-3); font-size: var(--fs-xs); color: var(--mute); }
.viz-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.viz-legend i { width: 14px; height: 3px; display: inline-block; }
.viz-read { border-left: 1px solid var(--line); padding: var(--space-5) var(--space-6); background: var(--surface-alt); }
.viz-read h3 { font-family: var(--font-display); font-weight: 450; font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.viz-read p { font-size: var(--fs-sm); }
.viz-how { color: var(--mute); margin-top: var(--space-4); }
.readout { margin-top: var(--space-4); border-top: 1px solid var(--line); }
.readout div { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.readout dt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readout dd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.disclosure { border-top: 1px solid var(--line); }
.disclosure summary {
  list-style: none; cursor: pointer; padding: var(--space-4) var(--space-6);
  font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; gap: var(--space-3);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: "+"; font-family: var(--font-mono); color: var(--maroon); width: 1ch; }
.disclosure[open] summary::before { content: "−"; }
.disclosure-body { padding: 0 var(--space-6) var(--space-6); }
.tech-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4) var(--space-6); }
.tech-list dt { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--maroon); margin-bottom: 4px; }
.tech-list dd { font-size: var(--fs-sm); color: var(--mute); }

/* 9. Methodology ----------------------------------------------------------- */
.method { padding: var(--space-7) 0; border-top: 1px solid var(--line); }
.method-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: var(--space-7); }
.method-head { align-self: start; position: sticky; top: 88px; }
.doc-links { margin-top: var(--space-5); border-top: 1px solid var(--ink); }
.doc-links li { border-bottom: 1px solid var(--line); }
.doc-links a { display: flex; justify-content: space-between; padding: var(--space-3) 0; font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.doc-links a::after { content: "↗"; color: var(--maroon); }
.doc-links a:hover { color: var(--maroon); }
.method-body { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-6); }
.method-body h3 { display: flex; gap: var(--space-3); align-items: baseline; font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--space-2); }
.method-body h3 .mono { font-size: var(--fs-xs); color: var(--maroon); font-weight: 400; }
.method-body p { font-size: var(--fs-sm); color: #4a4542; }
.method-caveat { border-left: 2px solid var(--brass); padding-left: var(--space-4); }

/* 10. Footer --------------------------------------------------------------- */
.site-foot { background: var(--ivory); border-top: 2px solid var(--maroon); padding: var(--space-6) 0 var(--space-4); color: var(--mute); }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr; gap: var(--space-6); align-items: start; }
.wordmark--foot { font-size: 1.75rem; }
.foot-brand p { font-size: var(--fs-sm); margin-top: var(--space-2); max-width: 40ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--fs-sm); padding-top: 6px; }
.foot-nav a { text-decoration: none; color: var(--ink); font-weight: 500; }
.foot-nav a:hover { color: var(--maroon); }
.foot-note { font-family: var(--font-mono); font-size: var(--fs-xs); padding-top: 6px; }
.foot-credit {
  margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--line);
  font-family: var(--font-display); font-style: italic; font-size: var(--fs-sm); color: var(--ink);
}

/* 11. Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .atlas-head { display: none; }
  .atlas-row {
    grid-template-columns: 36px 1fr auto;
    grid-template-areas: "no name actions" "no decay decay" "no desc desc";
    gap: var(--space-2) var(--space-4);
  }
  .atlas-no { grid-area: no; align-self: start; padding-top: 4px; }
  .atlas-name { grid-area: name; }
  .atlas-decay, .atlas-na { grid-area: decay; max-width: 420px; }
  .atlas-desc { grid-area: desc; }
  .atlas-actions, .atlas-ref { grid-area: actions; }
  .atlas-row.is-a::before, .atlas-row.is-b::before { left: -10px; }
  .tech-list { grid-template-columns: 1fr 1fr; }
  .field-recs { grid-template-columns: 1fr; gap: var(--space-5); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .hero-side { border-left: 0; padding-left: 0; }
  .section-head, .section-head--split { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .console { grid-template-columns: 1fr; }
  .deck--select { border-left: 0; border-top: 1px solid var(--line); }
  .tracks { grid-template-columns: 1fr; }
  .deck-head--listen { flex-wrap: wrap; }
  .deck-note { margin-left: 0; text-align: left; flex-basis: 100%; }
  .viz-body { grid-template-columns: 1fr; }
  .viz-read { border-left: 0; border-top: 1px solid var(--line); }
  .method-grid { grid-template-columns: 1fr; }
  .method-head { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-6); }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .field-recs { gap: var(--space-4); }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .masthead-inner { gap: var(--space-4); height: 56px; }
  .wordmark { font-size: 1.45rem; }
  .studio, .explore, .science, .field-section, .method { padding: 36px 0; }
  .section-head { margin-bottom: var(--space-4); }
  .primary-nav { gap: var(--space-4); }
  .primary-nav a { font-size: var(--fs-xs); }
  .steps li { padding: 0 var(--space-3); }
  .steps li:first-child { padding-left: 0; }
  .deck, .listen { padding: var(--space-4); }
  .player--main .wave--lg { min-height: 124px; }
  .capture-bar .btn { flex: 1 1 0; }
  .capture-status { flex-basis: 100%; }
  .compare-table thead .col-note, .compare-table td.col-note { display: none; }
  .compare-table tbody th { width: auto; }
  .atlas-row { grid-template-columns: 28px 1fr; grid-template-areas: "no name" "no decay" "no desc" "no actions"; }
  .atlas-actions, .atlas-ref { justify-content: flex-start; text-align: left; }
  .atlas-actions button { flex: 1; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 0 var(--space-2); }
  .flute-list { grid-template-columns: 1fr; }
  .science-pick { width: 100%; }
  .mini-field { width: 100%; }
  .tabs { padding: 0 var(--space-4); }
  .viz-figure { padding: var(--space-4); }
  .viz-read { padding: var(--space-4); }
  .viz-figure canvas { height: 320px; }
  .disclosure summary { padding: var(--space-4); }
  .disclosure-body { padding: 0 var(--space-4) var(--space-4); }
  .tech-list { grid-template-columns: 1fr; }
  .method-body { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: var(--space-3); }
}
