/* ===== Fonts (self-hosted, SIL Open Font License: see fonts/*-OFL.txt) ===== */
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.woff") format("woff"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Bold.woff") format("woff"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/BricolageGrotesque-Bold.woff") format("woff"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.woff") format("woff"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Bold.woff") format("woff"); font-weight: 600 800; font-display: swap; }

/* ===== Theme: change these to restyle every page ===== */
:root {
  --bg: #0f1012;          /* near-black, neutral-warm */
  --bg-alt: #141518;
  --card: #1a1b1f;
  --text: #f1ede4;        /* warm off-white */
  --muted: #a5a29a;
  --accent: #5fd4e8;      /* signal cyan: acoustics / main */
  --accent-2: #ffb84d;    /* VU-meter amber: music */
  --on-accent: #062a31;   /* text on cyan buttons */
  --border: #2c2e33;
  --border-strong: #3d4047;
  /* level zones used by the demos */
  --ok: var(--accent); --mild: #f2e35c; --warn: var(--accent-2); --bad: #ff6b5e;
  --radius: 8px;
  --max: 1100px;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;   /* dark native controls (audio player, inputs) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ===== Navigation ===== */
nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 16, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.logo { font-weight: 700; color: var(--text); letter-spacing: 0.5px; }
.logo span { color: inherit; }
.logo:hover { text-decoration: none; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav ul a { color: var(--muted); font-size: 0.95rem; padding-bottom: 4px; }
nav ul a:hover { color: var(--text); text-decoration: none; }
nav ul a.active { color: var(--text); border-bottom: 2px solid var(--accent); }

/* ===== Hero (home) and page headers ===== */
.hero { padding: 6rem 0 2rem; overflow: hidden; }
.page-head { padding: 4.5rem 0 1rem; }
.eyebrow {
  color: var(--accent); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.1; margin: 0.75rem 0 1rem; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; margin: 0.5rem 0 0.75rem; }
.hero p, .page-head p { color: var(--muted); font-size: 1.15rem; max-width: 640px; }

.buttons { display: flex; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 0.75rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid var(--border);
  color: var(--text); background: transparent; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn:hover { text-decoration: none; opacity: 0.9; }

/* Homepage waveform (drawn by site.js) */
.wave { width: 100%; height: 120px; margin-top: 3rem; opacity: 0.6; display: block; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===== Sections & cards ===== */
section { padding: 4.5rem 0; }
section.alt { background: var(--bg-alt); }
h2 { font-size: 1.9rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.lead { color: var(--muted); max-width: 700px; margin-bottom: 2.25rem; }
.subhead { margin-top: 3rem; margin-bottom: 1rem; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem;
  transition: transform 0.2s, border-color 0.2s;
}
a.card { display: block; color: var(--text); }
a.card:hover { text-decoration: none; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .more { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 1rem; display: block; }
.icon { font-size: 1.6rem; margin-bottom: 0.75rem; display: block; }

/* Music accent */
.music .eyebrow, .music .accent-text, .card.music .more { color: var(--accent-2); }
.music .card:hover, .card.music:hover { border-color: var(--accent-2); }
.music nav ul a.active { border-color: var(--accent-2); }

.music .btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #2a1803; }
/* Two-column text + list (Noise / Vibration, Mixing / Mastering) */
.split {
  display: grid; gap: 2rem 3rem; align-items: start;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.split .lead { margin-bottom: 0; }
.list { list-style: none; display: grid; gap: 0.6rem; }
.list li {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.75rem 1rem; font-size: 0.95rem;
  border-left: 3px solid var(--accent);
}
.music .list li { border-left-color: var(--accent-2); }
@media (max-width: 760px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Chips & tags */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip, .tag {
  background: var(--card); border: 1px solid var(--border);
  padding: 0.35rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; color: var(--muted); display: inline-block;
}
.tag { font-size: 0.75rem; padding: 0.15rem 0.6rem; margin-top: 1rem; }
.soon { opacity: 0.6; border-style: dashed; }

/* Video embeds */
.video {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-align: center; padding: 1rem;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.note {
  margin-top: 2rem; padding: 1rem 1.25rem; border-left: 3px solid var(--accent-2);
  background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted); font-size: 0.95rem;
}

/* ===== Interactive tools ===== */
.tool { padding: 1.75rem; }
.tool:hover { transform: none; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
input[type="number"] {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.6rem 0.75rem; font-size: 1rem; width: 110px;
  font-family: inherit;
}
input[type="number"]:focus { outline: 2px solid var(--accent); border-color: transparent; }
.result {
  margin-top: 1.25rem; font-size: 1.6rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.result small { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.btn.small { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

/* ===== Spectrum analyzer + EQ ===== */
.lab-sources { display: flex; flex-wrap: wrap; gap: 0.6rem; }
label.btn { cursor: pointer; }
.lab-msg { color: var(--muted); font-size: 0.9rem; margin: 0.9rem 0 1.5rem; min-height: 1.4em; }
.lab-card:hover { transform: none; border-color: var(--border); }
.lab-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.legend { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; }
.sw { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-left: 0.6rem; }
.sw.spec { background: var(--accent); }
.sw.eq { background: repeating-linear-gradient(90deg, var(--accent-2) 0 5px, transparent 5px 8px); }
.spec-box { position: relative; height: 340px; margin-top: 0.75rem; border-radius: 6px; overflow: hidden; background: var(--bg); }
.spec-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#player { width: 100%; margin-top: 1rem; }
.eq { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; align-items: start; margin-top: 1.25rem; }
.eq-band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; align-items: center; }
.eq-band small { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; }
.eq-on { font-weight: 600; font-size: 0.95rem; display: flex; gap: 0.4rem; align-items: center; cursor: pointer; }
.eq-on input { width: 18px; height: 18px; accent-color: var(--accent-2); }
.eq-val { font-variant-numeric: tabular-nums; color: var(--accent-2); font-weight: 600; min-width: 5.5em; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--accent-2); height: 28px; }
.lab-foot { color: var(--muted); font-size: 0.8rem; margin-top: 1rem; }
@media (max-width: 860px) {
  .eq { grid-template-columns: minmax(0, 1fr); }
  .spec-box { height: 260px; }
}

/* ===== Contact & footer ===== */
.center { text-align: center; }
.center .lead { margin: 0 auto 2rem; }
.center .buttons { justify-content: center; }
footer {
  border-top: 1px solid var(--border); padding: 2rem 0;
  color: var(--muted); font-size: 0.85rem; text-align: center;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  nav ul { gap: 0.9rem; }
  nav ul a { font-size: 0.82rem; }
  .logo { font-size: 0.9rem; }
  .hero { padding: 4rem 0 1rem; }
  .page-head { padding: 3rem 0 0.5rem; }
  section { padding: 3.25rem 0; }
}

.eq-sub { color: var(--muted); font-size: 0.85rem; padding-left: 1.6rem; }

/* ===== Collapsible tool panels ===== */
.tool-panels { display: grid; gap: 1rem; }
.tool-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.tool-panel[open] { border-color: var(--border-strong); }
.tool-panel > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem; min-height: 64px; border-radius: var(--radius);
}
.tool-panel > summary::-webkit-details-marker { display: none; }
.tool-panel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-panel > summary .icon { margin: 0; }
.tp-text { flex: 1; display: grid; }
.tp-text b { font-size: 1.15rem; }
.tp-text small { color: var(--muted); font-size: 0.9rem; }
.chev {
  width: 12px; height: 12px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.2s; margin: 0 0.4rem 0.3rem;
}
.tool-panel[open] .chev { transform: rotate(-135deg); margin-bottom: -0.3rem; }
.tp-body { padding: 0.5rem 1.4rem 1.6rem; border-top: 1px solid var(--border); }
.tp-body > .lead:first-child { margin-top: 1rem; }
.tp-body .lab-card { background: var(--bg-alt); }

/* ===== How loud is it? ===== */
.zones { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.zones span { display: flex; align-items: center; gap: 0.4rem; }
.z { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.z1 { --z: var(--ok); } .z2 { --z: var(--mild); } .z3 { --z: var(--warn); } .z4 { --z: var(--bad); }
i.z { background: var(--z); }
.loud { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.loud-read { position: sticky; top: 76px; order: 2; min-height: 320px; }
.loud-read:hover { transform: none; border-color: var(--z); }
.loud-read { border-color: var(--z); transition: border-color 0.2s; }
.db-big { font-size: clamp(3rem, 9vw, 4.5rem); font-weight: 800; line-height: 1; color: var(--z); font-variant-numeric: tabular-nums; }
.db-big span { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.lr-like { margin-top: 0.75rem; font-size: 1.05rem; color: var(--muted); }
.lr-like span { font-size: 1.5rem; vertical-align: -3px; }
.lr-like b { color: var(--text); }
.loud-read p { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }
.loud-read p b { color: var(--text); }
p.db-safe { color: var(--z); font-weight: 700; font-size: 1.05rem; }

/* The draggable meter */
.meter-wrap { position: relative; height: 560px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1.25rem; padding: 14px 0; }
.thermo {
  position: relative; height: 100%; border-radius: 999px; cursor: ns-resize; touch-action: none;
  background: var(--bg); border: 1px solid var(--border); outline: none;
}
.thermo:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.thermo:focus:not(:focus-visible) { box-shadow: none; }
.thermo::before, .thermo-fill {
  content: ""; position: absolute; inset: 4px; border-radius: 999px;
  background: linear-gradient(to top, var(--ok) 0%, var(--ok) 48%, var(--mild) 52%, var(--mild) 59%, var(--warn) 62%, var(--warn) 70%, var(--bad) 73%, #d8362b 100%);
}
.thermo::before { opacity: 0.12; }
.thermo-fill { clip-path: inset(calc(100% - var(--p, 0%)) 0 0 0 round 999px); }
.thermo-handle {
  position: absolute; left: 50%; transform: translate(-50%, 50%); pointer-events: none;
  min-width: 64px; padding: 0.3rem 0.6rem; border-radius: 999px; text-align: center;
  background: var(--text); color: var(--bg); font-weight: 800; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px var(--z), 0 6px 18px rgba(0, 0, 0, 0.5);
}
.thermo-labels { position: relative; list-style: none; height: 100%; }
.thermo-labels li { position: absolute; left: 0; right: 0; transform: translateY(50%); }
.thermo-labels button {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.82rem; cursor: pointer;
  padding: 0 0.3rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  border-radius: 6px; text-align: left;
}
.thermo-labels button:hover { color: var(--text); }
.thermo-labels button.on { color: var(--bg); background: var(--z); font-weight: 700; }
.thermo-labels button.on .tl-db { color: var(--bg); }
.tl-db { display: inline-block; width: 2.2em; text-align: right; color: var(--z); font-weight: 700; font-variant-numeric: tabular-nums; }
.db-facts { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 1.5rem; }
.db-facts .card { padding: 0.9rem 1.1rem; }
.db-facts .card:hover { transform: none; border-color: var(--border); }
.db-facts b { color: var(--accent); }
.db-facts p { font-size: 0.88rem; }
@media (max-width: 860px) {
  .loud { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .loud-read { order: 0; top: 64px; z-index: 5; background: var(--card); padding: 1rem 1.1rem; height: 222px; min-height: 0; overflow: hidden; }
  .loud-read .lr-desc, .loud-read .lr-vs { display: none; }
  .lr-like { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.95rem; margin-top: 0.5rem; }
  .lr-like span { font-size: 1.1rem; }
  .loud-read p.db-safe { font-size: 0.95rem; margin-top: 0.35rem; }
  .meter-wrap { height: 500px; grid-template-columns: 56px minmax(0, 1fr); gap: 0.9rem; }
  .db-big { font-size: 2.6rem; }
  .tool-panel > summary, .tp-body { padding-left: 1rem; padding-right: 1rem; }
}

/* Music → playground link */
.demo-link { display: flex !important; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.demo-link > span:nth-child(2) { flex: 1; display: grid; gap: 0.2rem; }
.demo-link small { color: var(--muted); font-size: 0.9rem; }
.demo-link .more { margin: 0; white-space: nowrap; }
.demo-link:hover { border-color: var(--accent-2) !important; }
.demo-link .icon { margin: 0; }
.tool-panel { scroll-margin-top: 72px; }
.music .demo-link .more { color: var(--accent-2); }

/* ===== Shake the city ===== */
.shake-box { position: relative; height: 400px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(to bottom, #17181c, var(--bg)); }
.shake-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.shake-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.75rem; text-align: center; }
.shake-status div { padding: 0.5rem; border-radius: 6px; border: 1px solid var(--border); transition: all 0.3s; }
.shake-status b { display: block; }
.shake-status small { color: var(--muted); font-size: 0.8rem; }
.shake-status span { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.shake-status .found { border-color: var(--accent); background: rgba(95, 212, 232, 0.1); }
.shake-status .found span { color: var(--accent); font-weight: 700; }
.shake-controls { display: grid; gap: 1rem; margin-top: 1.25rem; }
.shake-btns { margin-top: 0; }
@media (max-width: 600px) { .shake-box { height: 360px; } .shake-status small { display: none; } }
.shake-slider { grid-template-columns: minmax(0, 1fr) auto; }
.shake-slider input { grid-column: 1 / -1; grid-row: 2; }
.shake-slider small { grid-row: 3; }

/* ===== How much shaking is too much? ===== */
.vib-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.vib-scene { position: relative; height: 340px; border-radius: 6px; overflow: hidden; background: linear-gradient(#17181c, var(--bg)); margin-bottom: 1rem; }
.vib-scene canvas, .vib-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vib-chips { display: grid; gap: 0.75rem; margin-top: 1rem; }
.chip-label { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 0.3rem; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.5rem 0.9rem; cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.vib-side { display: grid; gap: 1rem; position: sticky; top: 76px; }
.vib-status { border-left: 4px solid var(--z, var(--accent)); }
.vib-status:hover { transform: none; }
.vib-status.ok { --z: var(--ok); } .vib-status.mild { --z: var(--mild); } .vib-status.warn { --z: var(--warn); } .vib-status.bad { --z: var(--bad); }
.vib-status small { color: var(--muted); font-size: 0.8rem; }
.vs-big { font-size: 1.25rem; font-weight: 700; color: var(--z); margin: 0.3rem 0; display: flex; gap: 0.5rem; align-items: center; }
.vs-big span { font-size: 1.6rem; }
.vib-status p { font-size: 0.9rem; }
.vib-status p b { color: var(--text); }
.vib-wave-card { margin-top: 1.25rem; }
.vib-wave { position: relative; height: 170px; margin-top: 0.75rem; border-radius: 6px; background: var(--bg); }
.vib-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.vib-nums small { display: block; color: var(--muted); font-size: 0.78rem; }
.vib-nums b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .vib-top { grid-template-columns: minmax(0, 1fr); }
  .vib-side { position: static; }
  .vib-scene { height: 280px; }
  .vib-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.vib-mini { display: none; }
@media (max-width: 860px) {
  .vib-mini { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.88rem; font-weight: 700; margin: -0.4rem 0 1rem; }
  .vib-mini .ok { color: var(--ok); } .vib-mini .mild { color: var(--mild); } .vib-mini .warn { color: var(--warn); } .vib-mini .bad { color: var(--bad); }
  .vib-chips .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-radius: 12px; }
  .vib-chips .seg button { padding: 0.5rem 0.3rem; font-size: 0.8rem; }
}
.tool-group { font-size: 1.3rem; margin: 1.5rem 0 -0.25rem; color: var(--muted); font-weight: 700; }
.tool-panels > .tool-group:first-child { margin-top: 0; }
.vib-scale { grid-column: 1 / -1; grid-row: 3; position: relative; height: 1.1rem; margin: -0.2rem 9px 0; font-size: 0.72rem; color: var(--muted); }
.vib-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.vib-scale span:first-child { transform: none; }
.vib-scale .q { transform: translateX(-100%); color: var(--bad); font-weight: 700; }
#vibration .shake-slider small { grid-row: 4; }
@media (max-width: 600px) { .vib-scale .q b { display: none; } }
@media (min-width: 601px) { .vib-scale .h100 { display: none; } }

.btn, a.card, .seg button, .tool-panel > summary { position: relative; overflow: hidden; }

/* ===== Scroll reveals (site.js adds .reveal, then .in) ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }


/* ===== Name on the homepage ===== */
.hero-name { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }

/* Credential badge */
.chip.credential { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ===== Expandable sector cards (Acoustics page) ===== */
.grid.sectors { align-items: start; }
.sector { padding: 0; }
.sector:hover { transform: none; }
.sector[open] { border-color: var(--accent); }
.sector > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.9rem;
  padding: 1.25rem 1.4rem; min-height: 64px; border-radius: var(--radius);
}
.sector > summary::-webkit-details-marker { display: none; }
.sector > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sector > summary .icon { margin: 0; }
.sec-t { flex: 1; display: grid; }
.sec-t b { font-size: 1.15rem; }
.sec-t small { color: var(--muted); font-size: 0.88rem; }
.sector[open] .chev { transform: rotate(-135deg); margin-bottom: -0.3rem; }
.sec-list { list-style: none; padding: 0 1.4rem 1.3rem; display: grid; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.sec-list li { position: relative; padding-left: 1.1rem; color: var(--muted); font-size: 0.95rem; }
.sec-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sector > summary { position: relative; overflow: hidden; }

/* ===== Bigger videos: first one full width, then two side by side ===== */
.grid.videos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid.videos > :first-child { grid-column: 1 / -1; }
@media (max-width: 700px) { .grid.videos { grid-template-columns: minmax(0, 1fr); } }

/* Open source "coming soon" block */
.card.coming { text-align: center; padding: 2.5rem 1.5rem; max-width: 560px; margin: 0 auto; }
.card.coming .icon { margin: 0 auto 0.75rem; }
.hero .hero-name { color: var(--text); }
.card.coming + .buttons { justify-content: center; }
@media (max-width: 760px) { .nav-long { display: none; } }
.grid.sectors { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.chev { flex-shrink: 0; }
/* Not-yet-available buttons */
.btn.is-soon { opacity: 0.45; cursor: default; border-style: dashed; }
.btn.is-soon small { font-weight: 500; font-size: 0.75rem; margin-left: 0.3rem; color: var(--muted); }
.lr-like small { color: var(--muted); font-size: 0.85rem; }
.meter-wrap { height: 620px; }
.tl-db { width: 4.1em; }
.lr-snd { font-size: 0.82rem !important; color: var(--muted); margin-top: 0.6rem !important; }
@media (max-width: 860px) { .lr-snd { display: none; } }

/* Reference images on the Acoustics page */
.ref-fig { margin-top: 1.75rem; }
.ref-fig img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.ref-fig figcaption { color: var(--muted); font-size: 0.78rem; margin-top: 0.5rem; }
.ref-fig.ref-small { max-width: 460px; }
.on-request { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.music-contact { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.music-contact p { color: var(--muted); margin-bottom: 1rem; }
/* "What's happening?" learning cards in the mixing playground */
.learn-title { margin-top: 2rem; }
.learn { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.learn .card { padding: 1rem 1.15rem; background: var(--bg); }
.learn .card:hover { transform: none; border-color: var(--border); }
.learn b { color: var(--accent-2); }
.learn p { margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.55; }
.learn em { color: var(--text); font-style: normal; font-weight: 600; }
.learn.crossovers b { color: var(--accent); }
.learn a { color: var(--accent); }
.demo-link.mini { padding: 1rem 1.15rem; margin-top: 1.25rem; }
.demo-link.mini b { font-size: 1rem; }
.ref-fig.ref-small + .demo-link.mini { max-width: 460px; }

/* Music page: mixer screenshot beside the Mixing / Mastering cards */
.mix-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.25rem; align-items: start; }
.mix-cards { display: grid; gap: 1.25rem; }
.mix-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.mix-shot figcaption { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }
@media (max-width: 760px) { .mix-split { grid-template-columns: minmax(0, 1fr); } }

/* ===== Sound bars next to the name (site.js) ===== */
.brand { display: flex; align-items: center; gap: 0.6rem; }
.eqbars {
  display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; padding: 0 2px;
  background: none; border: 0; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.eqbars.on { opacity: 1; pointer-events: auto; }
.eqbars span {
  display: block; width: 3px; height: 16px; border-radius: 2px; background: var(--accent);
  transform-origin: bottom; transform: scaleY(0.2); transition: transform 0.08s linear;
}
.eqbars span:nth-child(2) { background: var(--accent-2); }
.eqbars:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .eqbars span { transform: scaleY(0.7); } }

/* =====================================================================
   Style pass: typography, labels, rhythm, hero grid, focus outlines
   ===================================================================== */

/* 1. Display font for headings, mono for every reading */
h1, h2, h3, .hero-name, .logo, .tp-text b, .sec-t b, .nf .code {
  font-family: var(--font-head); letter-spacing: -0.015em;
}
h1 { font-weight: 800; }
h2 { font-weight: 700; }
.logo { letter-spacing: 0; }
.db-big, .tl-db, .thermo-handle, .eq-val, .vib-nums b, .result, .vib-scale,
.shake-status span, .lr-like small, .tag, .chip, .eq-band small b {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.chip { font-size: 0.8rem; letter-spacing: 0; }
.db-big { font-weight: 700; letter-spacing: -0.03em; }
.thermo-handle { font-weight: 700; }

/* 2. Mono uppercase eyebrow labels, and numbered labels above section headings */
.eyebrow {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.14em;
}
.tool-group {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin: 2rem 0 -0.1rem;
}

/* 3. Fluid heading sizes */
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.15; margin-bottom: 0.65rem; }
h3 { font-size: clamp(1.05rem, 1rem + 0.25vw, 1.2rem); }
.hero h1 { font-size: clamp(2.3rem, 1.4rem + 4.2vw, 4.2rem); line-height: 1.05; }
.page-head h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); line-height: 1.1; }

/* 4. Tighter corners (buttons stay pill-shaped) */
.thermo-labels button { border-radius: 4px; }

/* 5. Faint graph-paper grid behind the hero */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(241, 237, 228, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 237, 228, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 60% 55%, #000 25%, transparent 80%);
          mask-image: radial-gradient(ellipse 85% 75% at 60% 55%, #000 25%, transparent 80%);
}
body > .hero, .hero { isolation: isolate; }
.wave { opacity: 0.75; }

/* 6. More space between sections, slightly less inside cards */
section { padding: clamp(3.5rem, 2rem + 6vw, 6.5rem) 0; }
.lead { margin-bottom: 2rem; }
.card:hover { transform: translateY(-2px); }
.btn { font-weight: 600; letter-spacing: 0.01em; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.btn:not(.primary):not(.is-soon):hover { border-color: var(--accent); opacity: 1; }
.music .btn:not(.primary):not(.is-soon):hover { border-color: var(--accent-2); }
.btn.primary:hover { opacity: 1; filter: brightness(1.08); }

/* 7. Visible focus outlines for keyboard users */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.music :focus-visible { outline-color: var(--accent-2); }
:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(95, 212, 232, 0.3); color: var(--text); }
section .icon:has(+ h2) { display: block; margin-bottom: 0.9rem; }
.tl-db { width: 4.7em; font-size: 0.9em; letter-spacing: -0.02em; }

.lead.about-p { margin-bottom: 1rem; }
.lead em { font-style: normal; color: var(--text); font-weight: 600; }
.db-facts.two-up { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

/* ===== Line icons (Lucide, ISC licence) ===== */
.ico { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -0.2em; }
.btn .ico { margin-right: 0.3em; }
.lab-foot b .ico { width: 1.05em; height: 1.05em; color: var(--accent); }
.icon { color: var(--accent); line-height: 0; }
.icon .ico { width: 28px; height: 28px; vertical-align: 0; }
.card.music .icon, .music .icon { color: var(--accent-2); }
/* Small tiles behind icons in panel headers and demo links */
.tool-panel > summary .icon, .sector > summary .icon, .demo-link .icon {
  width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt);
}
.tool-panel > summary .icon .ico, .sector > summary .icon .ico, .demo-link .icon .ico { width: 22px; height: 22px; }
.demo-link.mini .icon { width: 38px; height: 38px; }
.demo-link.mini .icon .ico { width: 19px; height: 19px; }

/* =====================================================================
   Design pass 2: fewer boxes, spectrum motif, name-led hero
   ===================================================================== */

/* Lists become plain rows with hairlines and a short accent dash */
.list { gap: 0; border-top: 1px solid var(--border); }
.list li {
  position: relative; background: none; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--border); padding: 0.85rem 0 0.85rem 1.5rem;
}
.list li::before {
  content: ""; position: absolute; left: 0; top: calc(0.85rem + 0.72em);
  width: 0.7rem; height: 2px; background: var(--accent);
}
.music .list li::before { background: var(--accent-2); }

/* Explanation notes: no box, just a hairline on top. Cards stay only for things you click or use. */
.learn .card, .db-facts .card, .mix-cards .card {
  background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0;
  padding: 1rem 0 0; transform: none;
}
.learn .card:hover, .db-facts .card:hover, .mix-cards .card:hover { border-color: var(--border); transform: none; }
.learn, .db-facts { gap: 1.25rem 2rem; }
.mix-cards .card + .card { margin-top: 1.5rem; }

/* Signature motif: a strip of spectrum bars, in the page's accent colour */
.spectrum {
  height: 32px; max-width: 1100px; background: var(--accent);
  -webkit-mask: url("img/spectrum.svg") left bottom / auto 100% no-repeat;
          mask: url("img/spectrum.svg") left bottom / auto 100% no-repeat;
  opacity: 0.5;
}
.music .spectrum { background: var(--accent-2); }
.page-head .spectrum, .hero .spectrum { margin-top: 2.75rem; }
footer .spectrum { height: 20px; margin-bottom: 1.25rem; opacity: 0.35; }

/* Hero: the name is the headline, the wave runs behind it */
.hero { padding: clamp(4rem, 3rem + 5vw, 7.5rem) 0 2.5rem; }
.hero-mark { position: relative; margin: 0.9rem 0 1.4rem; }
.hero h1.hero-title {
  font-size: clamp(3rem, 1.2rem + 9vw, 7.5rem); line-height: 0.95; letter-spacing: -0.035em;
  margin: 0; max-width: none;
}
.hero-mark .wave {
  position: absolute; z-index: -1; left: 50%; width: 100vw; transform: translateX(-50%);
  top: 50%; height: 190px; margin: -95px 0 0; opacity: 0.4;
}
.hero .hero-tag {
  font-family: var(--font-head); font-weight: 700; color: var(--text);
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); line-height: 1.25; letter-spacing: -0.01em;
  max-width: 30ch; margin-bottom: 0.9rem;
}

/* ===== Field equipment photos (Acoustics page) ===== */
.gear { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.gear img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border); background: #fff;
}
.gear figcaption { margin-top: 0.75rem; }
.gear figcaption b { display: block; font-size: 0.98rem; }
.gear figcaption span { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; line-height: 1.5; }
.gear-also { color: var(--muted); font-size: 0.9rem; margin-top: 1.25rem; }

/* Grouped lists (Noise: outdoor / indoor) */
.list-label {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.6rem;
}
.list-groups .list + .list-label { margin-top: 2rem; }

/* Narrow phones: four tabs plus the name need a little less spacing.
   The name never wraps onto two lines. */
.logo, nav ul a { white-space: nowrap; }
.brand { flex-shrink: 0; }
@media (max-width: 400px) {
  nav ul { gap: 0.6rem; }
  nav ul a { font-size: 0.75rem; }
  .logo { font-size: 0.86rem; }
}
@media (max-width: 345px) {
  nav .wrap { padding-left: 14px; padding-right: 14px; }
  nav ul { gap: 0.5rem; }
  nav ul a { font-size: 0.72rem; }
  .logo { font-size: 0.82rem; }
  .eqbars:not(.on) { display: none; }
}
footer .spectrum { -webkit-mask-position: center bottom; mask-position: center bottom; }

/* Spectrum strips drawn live by site.js (the image mask stays as the no-script fallback) */
.spectrum.live { -webkit-mask: none; mask: none; background: none; }
.spectrum canvas { display: block; width: 100%; height: 100%; }

/* ===== About: text with a field photo ===== */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 2.5rem 4rem; align-items: center; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.about-photo figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 0.6rem; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-photo { max-width: 420px; }
}
