:root {
  --ground: #ECEEF0;
  --ground-2: #E2E5E9;
  --surface: #F7F8F9;
  --ink: #111316;
  --muted: #4B525C;
  --line: #C8CDD4;
  --line-strong: #9DA4AE;
  --accent: #B52F0C;
  --accent-hover: #962508;
  --deck: #14171C;
  --deck-2: #1C2028;
  --deck-ink: #EDF0F3;
  --deck-muted: #9AA3B0;
  --deck-line: #2B313C;
  --r: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  scroll-padding-top: 96px;
  -webkit-font-smoothing: antialiased;
}
a, button, input, select, textarea, section {
  scroll-margin-top: 96px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  overflow-x: clip;
}

main {
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}
main.is-leaving {
  opacity: 0.25;
  transform: translateY(6px);
}

/* Accessibility skip link & crisp focus */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--r);
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 14px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
}

/* Header & top instrument scale */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(236, 238, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.scale-strip {
  height: 6px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line-strong) 0 1px,
    transparent 1px 12px
  );
  border-bottom: 1px solid var(--line);
  opacity: 0.65;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}
.brand-word {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.brand:hover { border-bottom-color: var(--accent); transform: translateY(-1px); }
.brand-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.brand-ver {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: var(--r);
  background: var(--surface);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-link {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r);
  border: 1px solid transparent;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.nav-link:hover {
  background: var(--surface);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(17, 19, 22, 0.08);
}
.nav-link[aria-current="page"] {
  background: var(--ground-2);
  border-color: var(--line-strong);
}
.nav-link[aria-current="page"]:hover {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.nav-link--accent {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.nav-link--accent:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Mobile quick-jump subbar (visible < 680px) */
.mobile-subnav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--ground-2);
}
.mobile-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 0;
}
.mobile-subnav a {
  flex: 1 1 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink);
  text-decoration: none;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  white-space: nowrap;
}
.mobile-subnav a:hover {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0;
}
h1 {
  font-size: clamp(2.25rem, 4.7vw, 4.15rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}
h2 {
  font-size: clamp(1.65rem, 3.1vw, 2.5rem);
  line-height: 1.06;
}
h3 {
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
p { margin: 0; color: var(--muted); }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Hero & A/B Broadcast Audition Desk */
.hero {
  padding: 28px 0 46px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: start;
}
.hero-copy {
  padding-top: 6px;
  display: grid;
  gap: 18px;
}
.hero-stack {
  max-width: 780px;
  display: grid;
  gap: 18px;
}
.spec-tag {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.spec-tag strong { color: var(--ink); font-weight: 600; }
.hero-lead {
  font-size: 1.05rem;
  line-height: 1.56;
  color: var(--muted);
  max-width: 48ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.metric {
  display: grid;
  gap: 2px;
}
.metric-val {
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Industrial Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 19, 22, 0.14);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled {
  background: var(--ground-2);
  color: var(--muted);
  border-color: var(--line-strong);
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  box-shadow: 0 5px 16px rgba(17, 19, 22, 0.22);
}

.btn--dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.btn--dark:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn--sm {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 0.81rem;
}

/* Broadcast Audition Desk Panel (calibrated to sit completely inside 900px hero fold) */
.desk {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 12px 30px rgba(17, 19, 22, 0.06);
  overflow: hidden;
}
.desk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: var(--ground-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.desk-bar-title {
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(181, 47, 12, 0.16);
}
.led[data-active="true"] {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 47, 12, 0.34);
}

.desk-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 14px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 5px 9px;
  min-height: 30px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.chip:hover {
  border-color: var(--ink);
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(17, 19, 22, 0.08);
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.chip[aria-pressed="true"]:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.desk-body {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.desk-body > * { min-width: 0; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.script-input {
  width: 100%;
  min-height: 78px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.42;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  resize: vertical;
}
.script-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(181, 47, 12, 0.14);
}

.norm-box {
  padding: 8px 10px;
  min-height: 82px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink);
}
.cadence-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.cadence-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.cadence-pill strong { color: var(--accent); font-weight: 600; }

/* Recessed Oscilloscope Cavity */
.monitor {
  background: var(--deck);
  color: var(--deck-ink);
  border: 1px solid #0B0D10;
  border-radius: var(--r);
  padding: 9px 11px;
  display: grid;
  gap: 7px;
}
.monitor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--deck-muted);
}
.monitor-top strong { color: var(--deck-ink); }
.monitor-readouts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
#scope {
  display: block;
  width: 100%;
  height: 58px;
  background: #0F1216;
  border: 1px solid var(--deck-line);
  border-radius: 2px;
}
.vu-track {
  height: 5px;
  background: #232831;
  border-radius: 2px;
  overflow: hidden;
}
.vu-bar {
  height: 100%;
  width: 24%;
  background: var(--accent);
  transition: width 90ms linear;
}
.desk-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.desk-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.studio-select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
}
.speed-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 2px;
  white-space: nowrap;
}
.speed-wrap input[type="range"] {
  width: 72px;
  accent-color: var(--accent);
}
.transport-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  gap: 8px;
}
.status-line {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--muted);
  padding: 6px 10px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.status-line code {
  font-family: var(--font-mono);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0;
  min-width: 0;
}

/* Sections */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.section--alt { background: var(--ground-2); }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 44ch);
  gap: 24px;
  align-items: end;
  margin-bottom: 32px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

/* Anatomy Bench Integration */
.bench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.88fr);
  gap: 28px;
  align-items: start;
}
.bench-mount { min-height: 455px; }
.bench-mount .iso-figure { margin: 0; }
.bench-mount.iso[data-theme="light"] {
  --anatomy-page: #ECEEF0;
  --anatomy-card: #F7F8F9;
  --anatomy-text: #4B525C;
  --anatomy-strong: #111316;
  --anatomy-muted: #5A626D;
  --anatomy-paper: #F7F8F9;
  --anatomy-face: #FFFFFF;
  --anatomy-top: #FFFFFF;
  --anatomy-shade-0: #D2D7DE;
  --anatomy-shade-1: #DCE0E6;
  --anatomy-shade-2: #E6E9ED;
  --anatomy-shade-3: #EFF1F4;
  --anatomy-lit-top: #FFF5F2;
  --anatomy-lit-shade: #F8DFD8;
  --anatomy-hi: #111316;
  --anatomy-mid: #6E7681;
  --anatomy-lo: #A4ACB6;
  --anatomy-faint: #CFD4DC;
  --anatomy-lit: #B52F0C;
  --anatomy-red: #B52F0C;
  --anatomy-mono: var(--font-mono);
}
.bench-mount .iso-plate {
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--line-strong);
  padding: 46px 18px 46px;
}
.bench-mount .iso-stage { cursor: ew-resize; }

.stage-list {
  display: grid;
  gap: 10px;
}
.stage-card {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  display: grid;
  gap: 5px;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.stage-card:hover {
  background: #ffffff;
  border-color: var(--ink);
  border-left-color: var(--ink);
  transform: translateX(3px);
  box-shadow: 0 6px 16px rgba(17, 19, 22, 0.08);
}
.stage-card[aria-pressed="true"] {
  background: #ffffff;
  border-color: var(--line-strong);
  border-left-color: var(--accent);
  box-shadow: 0 6px 18px rgba(17, 19, 22, 0.06);
}
.stage-card[aria-pressed="true"]:hover {
  background: #FFF9F7;
  border-color: var(--accent);
  border-left-color: var(--accent);
  box-shadow: 0 8px 20px rgba(181, 47, 12, 0.12);
}
.stage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.stage-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
}
.stage-card-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  white-space: nowrap;
}
.stage-card-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.48;
}

/* Voice Matrix */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.voice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.voice-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 19, 22, 0.07);
}
.voice-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.voice-id {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.voice-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--ground);
  color: var(--muted);
  white-space: nowrap;
}
.voice-badge--webgpu {
  border-color: rgba(181, 47, 12, 0.35);
  color: #9E2708;
  background: #FBF1EE;
}
.voice-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  padding: 3px 6px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.voice-bars span {
  flex: 1;
  background: var(--line-strong);
  border-radius: 1px;
}
.voice-card:hover .voice-bars span { background: var(--accent); }
.voice-desc { font-size: 0.84rem; color: var(--muted); flex: 1; }
.voice-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--muted);
}
.voice-more-row {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Code Console */
.code-console {
  background: var(--deck);
  color: var(--deck-ink);
  border-radius: var(--r);
  border: 1px solid #0B0D10;
  overflow: hidden;
}
.code-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--deck-2);
  border-bottom: 1px solid var(--deck-line);
  flex-wrap: wrap;
}
.code-tab-group { display: flex; gap: 6px; flex-wrap: wrap; }
.code-tab {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 11px;
  min-height: 32px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: var(--deck-muted);
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.code-tab:hover {
  color: #ffffff;
  border-color: var(--deck-muted);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.code-tab[aria-selected="true"] {
  background: var(--deck);
  border-color: var(--accent);
  color: var(--deck-ink);
}
.code-tab[aria-selected="true"]:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(181, 47, 12, 0.35);
}
.code-pre {
  margin: 0;
  padding: 18px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--deck-ink);
}
.tok-c { color: #8B96A7; }
.tok-s { color: #F0C28A; }
.tok-k { color: #F28B6B; }
.tok-f { color: #9ED0FF; }
.btn--console {
  background: transparent;
  color: var(--deck-ink);
  border-color: var(--deck-line);
  min-height: 32px;
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.btn--console:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* API Tables & Setup Cards */
.spec-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  overflow: hidden;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--ground-2);
}
.spec-table tr:last-child td { border-bottom: none; }
.spec-table code {
  font-family: var(--font-mono);
  font-size: 0.81rem;
  background: var(--ground);
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.spec-table td:first-child { white-space: nowrap; }
.spec-table td:nth-child(2) code { white-space: normal; }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.doc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.doc-card pre {
  margin: 4px 0 0 0;
  padding: 13px;
  background: var(--deck);
  color: var(--deck-ink);
  border-radius: var(--r);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 404 Signal Lost Panel */
.hero--lost { padding: 72px 0 84px; }
.lost-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

/* Footer (consistent across all routes) */
.site-footer {
  padding: 38px 0 52px;
  background: var(--ground);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 4px 2px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.footer-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.footer-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1080px) {
  .voice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero-grid,
  .bench-layout,
  .section-head,
  .doc-grid,
  .lost-grid {
    grid-template-columns: 1fr;
  }
  .hero { padding: 24px 0 42px; }
  .section { padding: 48px 0; }
}
@media (max-width: 768px) {
  /* Stacked vertical cards for API tables so zero columns clip or squeeze */
  .spec-table-wrap { border: none; background: transparent; }
  .spec-table, .spec-table tbody, .spec-table tr, .spec-table td { display: block; width: 100%; }
  .spec-table thead { display: none; }
  .spec-table tr {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    margin-bottom: 12px;
    padding: 12px 14px;
  }
  .spec-table td {
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }
  .spec-table td:first-child { white-space: normal; }
  .spec-table code { overflow-wrap: anywhere; }
  .spec-table td:last-child { border-bottom: none; padding-bottom: 2px; }
  .spec-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}
@media (max-width: 680px) {
  .wrap { width: min(1240px, 100% - 28px); }
  .header-inner { min-height: 54px; gap: 10px; }
  .brand-ver { display: none; }
  .nav-link--hide-sm { display: none; }
  .mobile-subnav { display: block; }
  .site-nav { gap: 6px; }
  .nav-link { padding: 7px 10px; font-size: 0.84rem; }
  .hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .metric-val { font-size: 0.96rem; }
  .metric-label { font-size: 0.72rem; }
  .desk-select-row { grid-template-columns: 1fr; }
  .transport-row { grid-template-columns: 1fr; }
  .voice-grid { grid-template-columns: 1fr; }
  .bench-mount { min-height: 300px; }
  .stage-card-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .code-pre { font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
}

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