/* ==========================================================================
   AWIT Studio — MP3 to Karaoke MIDI Converter
   Editorial Studio Design System (Iteration 2 — Refined Craft & Responsiveness)
   ========================================================================== */

:root {
  /* Light Editorial Studio Palette (Default) */
  --bg: #f6f5f0;
  --bg-subtle: #eeece4;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: #f3f2ec;
  --border: #e2dfd5;
  --border-strong: #cbc6b8;

  --ink: #111318;
  --ink-secondary: #434a57;
  --ink-muted: #626b7c;

  /* Harmonized Brand Accents (derived from icon.png) */
  --blue: #1456e0;
  --blue-hover: #0e46bd;
  --blue-soft: rgba(20, 86, 224, 0.08);
  --blue-border: rgba(20, 86, 224, 0.22);

  --violet: #6d28d9;
  --violet-soft: rgba(109, 40, 217, 0.08);

  --amber: #b45309;
  --amber-bright: #f59e0b;
  --amber-soft: rgba(217, 119, 6, 0.1);
  --amber-border: rgba(217, 119, 6, 0.28);

  --emerald: #047857;
  --emerald-soft: rgba(4, 120, 87, 0.09);
  --emerald-border: rgba(4, 120, 87, 0.26);

  /* Hardware Studio Console Surface (Always Tactile Dark Anodized) */
  --hw-chassis: #0d1017;
  --hw-panel: #141923;
  --hw-well: #090c11;
  --hw-border: rgba(255, 255, 255, 0.1);
  --hw-border-strong: rgba(255, 255, 255, 0.18);
  --hw-ink: #f3f5f9;
  --hw-muted: #98a2b3;
  --hw-blue: #4c8dff;
  --hw-violet: #a78bfa;
  --hw-amber: #fbbf24;
  --hw-emerald: #34d399;

  /* Typography */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout & Radii */
  --max-w: 1140px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, 0.05);
  --shadow-md: 0 10px 26px -10px rgba(17, 19, 24, 0.1), 0 1px 2px rgba(17, 19, 24, 0.04);
  --shadow-hw: 0 24px 56px -16px rgba(13, 16, 23, 0.34), 0 4px 12px rgba(13, 16, 23, 0.14);

  --nav-bg: rgba(246, 245, 240, 0.88);
}

[data-theme="dark"] {
  --bg: #0a0d13;
  --bg-subtle: #101520;
  --surface: #121722;
  --surface-elevated: #171d2b;
  --surface-muted: #161c28;
  --border: #232b3b;
  --border-strong: #323d52;

  --ink: #f1f4f9;
  --ink-secondary: #bcc5d6;
  --ink-muted: #8b96ab;

  --blue: #5c98ff;
  --blue-hover: #7eb0ff;
  --blue-soft: rgba(92, 152, 255, 0.13);
  --blue-border: rgba(92, 152, 255, 0.28);

  --violet: #b197fc;
  --violet-soft: rgba(177, 151, 252, 0.12);

  --amber: #fbbf24;
  --amber-bright: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --amber-border: rgba(251, 191, 36, 0.28);

  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.12);
  --emerald-border: rgba(52, 211, 153, 0.28);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.48);
  --shadow-hw: 0 24px 56px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(10, 13, 19, 0.88);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(17, 19, 24, 0.045) 1px, transparent 0);
  background-size: 28px 28px;
  min-height: 100vh;
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue-hover);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12em 0.42em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: 24px;
}

@media (max-width: 600px) {
  .container {
    padding-inline: 16px;
  }
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  flex: 1 1 auto;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(17, 19, 24, 0.1);
  padding: 2px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 0.89rem;
  font-weight: 550;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.nav-links a.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-sm);
  font-weight: 600;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.menu-btn {
  display: none;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 16px 16px;
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
}

.mobile-drawer a.active,
.mobile-drawer a:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

/* Collapse navbar only below 680px so 768px tablets keep full desktop nav */
@media (max-width: 680px) {
  .nav-links {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 440px) {
  .brand-title {
    font-size: 0.92rem;
  }
  .brand-sub {
    display: none;
  }
}

/* ==========================================================================
   Buttons & Eyebrows
   ========================================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 18px;
  max-width: 100%;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
  flex-shrink: 0;
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.86); }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  color: var(--bg);
  background: var(--blue);
}

[data-theme="dark"] .btn-primary {
  background: var(--blue);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--blue-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--ink-muted);
}

@media (max-width: 480px) {
  .btn-row .btn {
    flex: 1 1 auto;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Hero Split Section (Index)
   ========================================================================== */
.hero-section {
  padding: 48px 0 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 44px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 3.6vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.032em;
  margin: 0 0 18px;
  color: var(--ink);
}

.hero-lead {
  font-size: 1.03rem;
  line-height: 1.66;
  color: var(--ink-secondary);
  margin: 0 0 26px;
  max-width: 52ch;
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.spec-item {
  min-width: 0;
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.spec-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--ink);
}

@media (max-width: 980px) {
  .hero-section {
    padding: 34px 0 48px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
  .hero-lead {
    max-width: 64ch;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 26px 0 40px;
  }
  .spec-strip {
    gap: 10px;
    padding-top: 18px;
    margin-top: 22px;
  }
  .spec-label {
    font-size: 0.62rem;
  }
  .spec-val {
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   Anodized Studio Hardware Demo Console
   ========================================================================== */
.studio-console {
  background: var(--hw-chassis);
  color: var(--hw-ink);
  border-radius: var(--radius-xl);
  border: 1px solid var(--hw-border-strong);
  box-shadow: var(--shadow-hw);
  padding: 18px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.studio-console::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--hw-border);
  margin-bottom: 13px;
}

.console-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.rec-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hw-emerald);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.75);
  flex-shrink: 0;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-console.is-paused .rec-led {
  background: var(--hw-amber);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.console-file {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hw-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--hw-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.timecode {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--hw-amber);
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.22);
  padding: 4px 8px;
  border-radius: 7px;
  white-space: nowrap;
}

.play-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--hw-border-strong);
  background: var(--hw-panel);
  color: var(--hw-ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.play-toggle:hover {
  background: #202838;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Console Controls Row */
.console-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}

.seg-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--hw-well);
  border: 1px solid var(--hw-border);
  padding: 3px;
  border-radius: 10px;
  max-width: 100%;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hw-muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.seg-btn:hover:not(:disabled) {
  color: var(--hw-ink);
}

.seg-btn.active {
  color: var(--hw-ink);
  background: #1f2737;
  border-color: rgba(255, 255, 255, 0.15);
}

.seg-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.soon-tag {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--hw-amber);
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.2;
}

/* OLED Visualization Well */
.oled-well {
  background: var(--hw-well);
  border: 1px solid var(--hw-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.oled-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--hw-muted);
}

.oled-engine-readout {
  color: var(--hw-blue);
  font-weight: 600;
  text-align: right;
}

.canvas-frame {
  position: relative;
  width: 100%;
  height: 188px;
  border-radius: 8px;
  overflow: hidden;
  background: #070a0f;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.canvas-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Interactive Clickable Stem Mute Pads */
.stem-meters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(152, 162, 179, 0.72);
}

.stem-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stem-ch {
  appearance: none;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: opacity 0.18s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.stem-ch:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}

.stem-ch.is-muted {
  opacity: 0.42;
  background: rgba(255, 255, 255, 0.015);
}

.stem-ch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: var(--hw-ink);
  margin-bottom: 5px;
}

.stem-ch-state {
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hw-emerald);
}

.stem-ch.is-muted .stem-ch-state {
  color: var(--hw-muted);
}

.meter-track {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  transition: width 0.08s linear;
}

.meter-drums { background: var(--hw-amber); }
.meter-bass { background: var(--hw-emerald); }
.meter-chords { background: var(--hw-blue); }
.meter-vocals { background: var(--hw-violet); }

/* Synced Karaoke Lyric Strip */
.lyric-strip {
  background: var(--hw-panel);
  border: 1px solid var(--hw-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  overflow: hidden;
}

.lyric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--hw-muted);
  margin-bottom: 6px;
}

.lyric-ts {
  color: var(--hw-emerald);
  white-space: nowrap;
}

.lyric-line-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  vertical-align: top;
}

.lyric-active {
  font-family: var(--font-display);
  font-size: clamp(0.84rem, 1.45vw, 1.02rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(243, 245, 249, 0.36);
}

.lyric-active-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 55%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(76, 141, 255, 0.45);
  pointer-events: none;
}

.lyric-next {
  font-size: 0.8rem;
  color: var(--hw-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Export Formats Footer inside Console */
.export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--hw-border);
}

.format-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fmt-pill {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--hw-muted);
  background: var(--hw-well);
  border: 1px solid var(--hw-border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.fmt-pill:hover,
.fmt-pill.active {
  color: var(--hw-ink);
  border-color: var(--hw-blue);
  background: rgba(76, 141, 255, 0.14);
}

.fmt-caption {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--hw-muted);
}

@media (max-width: 560px) {
  .studio-console {
    padding: 14px;
    border-radius: 18px;
  }
  .console-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .oled-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .oled-engine-readout {
    text-align: left;
  }
  .stem-meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .canvas-frame {
    height: 162px;
  }
  .seg-group {
    width: 100%;
    justify-content: space-between;
  }
  .seg-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 6px 6px;
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   Editorial Sections (Workflow, Privacy Boundary, Trust Cards)
   ========================================================================== */
.section-block {
  padding: 54px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  max-width: 660px;
  margin-bottom: 30px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 8px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2.08rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
  margin: 0 0 10px;
}

.section-header p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.99rem;
}

/* 3-Step Pipeline */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.step-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}

.step-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin: 4px 0 0;
  letter-spacing: -0.015em;
}

.step-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

@media (max-width: 860px) {
  .pipeline-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Privacy Boundary Visual Diagram */
.boundary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) auto minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.zone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.zone-local {
  border-color: var(--emerald-border);
  background: linear-gradient(180deg, var(--emerald-soft) 0%, var(--surface) 92px);
}

.zone-optional {
  border-style: dashed;
  border-color: var(--amber-border);
  background: linear-gradient(180deg, var(--amber-soft) 0%, var(--surface) 92px);
}

.zone-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.zone-title {
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 700;
  margin: 0;
}

.zone-badge {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-local {
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
}

.badge-opt {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
}

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

.zone-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.93rem;
  color: var(--ink-secondary);
}

.zone-check {
  flex-shrink: 0;
  margin-top: 3px;
}

.zone-local .zone-check { color: var(--emerald); }
.zone-optional .zone-check { color: var(--amber); }

.boundary-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 6px;
}

.bridge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: 999px;
  padding: 3px 9px;
}

.bridge-line {
  width: 58px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--amber) 0 6px,
    transparent 6px 12px
  );
  position: relative;
  overflow: hidden;
}

.bridge-pulse {
  position: absolute;
  top: -2px;
  left: -12px;
  width: 14px;
  height: 6px;
  border-radius: 99px;
  background: var(--amber-bright);
  animation: bridgeFlow 2.6s linear infinite;
}

@keyframes bridgeFlow {
  0% { transform: translateX(0); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(72px); opacity: 0; }
}

.bridge-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  text-align: center;
}

@media (max-width: 920px) {
  .boundary-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .boundary-bridge {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 0;
  }
}

/* Legal Hub Cards on Index */
.legal-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.legal-link-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.legal-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.legal-link-card h3 {
  font-family: var(--font-display);
  font-size: 1.24rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.legal-link-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.94rem;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--blue);
}

@media (max-width: 720px) {
  .legal-hub-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .section-block {
    padding: 40px 0;
  }
}

/* ==========================================================================
   Legal Document Pages (privacy.html & terms.html)
   ========================================================================== */
.doc-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}

.doc-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.doc-subtitle {
  font-size: 1.02rem;
  color: var(--ink-secondary);
  max-width: 64ch;
  margin: 0 0 20px;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.meta-chips span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.meta-chips strong {
  color: var(--ink);
  font-weight: 600;
}

/* At a Glance Summary Strip */
.glance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 0;
}

.glance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.glance-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink);
}

.glance-label svg {
  color: var(--emerald);
  flex-shrink: 0;
}

.glance-card.is-info .glance-label svg {
  color: var(--blue);
}

.glance-card.is-amber .glance-label svg {
  color: var(--amber);
}

.glance-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

@media (max-width: 960px) {
  .glance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .glance-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 2-Column Sticky TOC + Legal Prose (Architectural balanced width) */
.doc-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 36px;
  padding: 36px 0 64px;
  align-items: start;
}

.doc-layout > div {
  min-width: 0;
}

.toc-sidebar {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 12px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.toc-list a:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.toc-list a.active {
  background: var(--blue-soft);
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
}

/* Mobile Compact Jump Bar */
.mobile-toc {
  display: none;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.mobile-toc summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--ink);
}

.mobile-toc .toc-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

@media (max-width: 920px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 24px 0 56px;
  }
  .toc-sidebar {
    display: none;
  }
  .mobile-toc {
    display: block;
  }
}

/* Legal Prose Card — Full-width architectural dividers + ideal prose measure */
.prose-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 42px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  min-width: 0;
}

.prose-section {
  width: 100%;
  scroll-margin-top: 92px;
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
}

.prose-section:first-of-type {
  padding-top: 0;
  margin-top: 20px;
  border-top: none;
}

.prose-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.26rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
}

.sec-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.prose-article p {
  margin: 0 0 14px;
  color: var(--ink-secondary);
  line-height: 1.72;
  max-width: 72ch;
}

.prose-article p:last-child {
  margin-bottom: 0;
}

.prose-article ul {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink-secondary);
  max-width: 72ch;
}

.prose-article li {
  margin-bottom: 8px;
  line-height: 1.68;
}

.prose-article strong {
  color: var(--ink);
}

/* Callout Box */
.callout {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0 0;
  font-size: 0.93rem;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.callout.is-emerald {
  border-left-color: var(--emerald);
  background: var(--emerald-soft);
  border-color: var(--emerald-border);
}

/* Responsive Permissions Table — Desktop table + Mobile stacked cards */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
  text-align: left;
}

.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--surface-muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.spec-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-secondary);
  vertical-align: top;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.pill-yes {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-opt {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .prose-article {
    padding: 24px 18px;
    border-radius: 16px;
  }
  .table-wrap {
    border: none;
    overflow: visible;
  }
  .spec-table thead {
    display: none;
  }
  .spec-table,
  .spec-table tbody,
  .spec-table tr,
  .spec-table td {
    display: block;
    width: 100%;
  }
  .spec-table tr {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
  }
  .spec-table tr:last-child {
    margin-bottom: 0;
  }
  .spec-table td {
    border: none;
    padding: 4px 0;
    font-size: 0.87rem;
  }
  .spec-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 2px;
  }
  .spec-table td:first-child::before {
    display: none;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 30px 0 38px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  font-size: 0.87rem;
  color: var(--ink-muted);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.footer-links a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 550;
}

.footer-links a:hover {
  color: var(--blue);
}

/* ==========================================================================
   Subtle Entrance Motion (Never leaves content permanently hidden)
   ========================================================================== */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.will-animate:not(.is-visible) {
  opacity: 0;
  transform: translateY(12px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .eyebrow-dot,
  .bridge-pulse {
    animation: none;
  }
  .reveal.will-animate:not(.is-visible) {
    opacity: 1;
    transform: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
