/* ReadLab home page styles */

:root {
  /* Brand palette */
  --ink: #0a1628;
  --ink-2: #15243f;
  --ink-3: #2a3a5c;
  --muted: #5c6c87;
  --muted-2: #8392ad;
  --rule: #e3e8f0;
  --rule-2: #d4dbe6;

  --bg: #fafbfc;
  --bg-2: #f4f6fb;
  --bg-3: #eef2f8;
  --surface: #ffffff;

  /* Gradient layers */
  --rl-1a: #081840;
  --rl-1b: #1230a0;
  --rl-2a: #1a4fd4;
  --rl-2b: #0580c4;
  --rl-3a: #0c9fe0;
  --rl-3b: #3ac4f0;
  --rl-4a: #48ccf0;
  --rl-4b: #82e6fc;

  --accent: #1a4fd4;
  --accent-soft: #e8eefb;

  /* Label colors */
  --c-correct: #10b981;
  --c-omission: #ef4444;
  --c-insertion: #94a3b8;
  --c-repetition: #0c9fe0;
  --c-selfcorr: #14b8a6;
  --c-mispron: #f59e0b;
  --c-ai: #8b5cf6;

  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.04), 0 1px 3px rgba(10, 22, 40, 0.06);
  --shadow-md: 0 4px 14px rgba(10, 22, 40, 0.06), 0 12px 40px rgba(10, 22, 40, 0.05);
  --shadow-lg: 0 20px 60px rgba(10, 22, 40, 0.10), 0 6px 16px rgba(10, 22, 40, 0.06);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  --font-display: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-fa: 'Vazirmatn', 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: #cfdcfc; color: var(--ink); }

a { color: inherit; text-decoration: none; }

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

/* Layout */
.shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 720px) {
  .shell { padding: 0 20px; }
}

.hairline {
  height: 1px;
  background: var(--rule);
  width: 100%;
}

/* Top nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 26px;
  height: 30px;
  flex-shrink: 0;
}
.logo-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.logo-text span { font-weight: 700; }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-links a:hover { color: var(--ink); background: rgba(10, 22, 40, 0.04); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-cta:hover { background: var(--ink-2); }
.nav-cta svg { width: 12px; height: 12px; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* Section headers */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.sec-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.sec-title {
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 600;
  letter-spacing: -1.6px;
  line-height: 1.04;
  text-wrap: balance;
  color: var(--ink);
}
.sec-title em {
  font-style: normal;
  background: linear-gradient(95deg, var(--rl-1b), var(--rl-2b) 50%, var(--rl-3a));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sec-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 60ch;
  margin-top: 18px;
}

section.section {
  padding: 110px 0 90px;
  position: relative;
}
section.section.alt { background: var(--bg-2); }
section.section.dark {
  background: var(--ink);
  color: #e2e8f0;
}
section.section.dark .sec-title { color: #fff; }
section.section.dark .sec-lede { color: #94a3b8; }
section.section.dark .eyebrow,
section.section.dark .sec-num { color: #5d7596; }

@media (max-width: 720px) {
  section.section { padding: 70px 0 60px; }
}

.sec-head {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 64px;
  margin-bottom: 56px;
}
.sec-head .left { padding-top: 6px; }
@media (max-width: 900px) {
  .sec-head { grid-template-columns: 1fr; gap: 18px; margin-bottom: 36px; }
}

/* Small labels */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-correct);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn-ghost:hover { background: rgba(10, 22, 40, 0.04); border-color: var(--ink); }

.btn .arr {
  width: 14px; height: 14px;
  transition: transform 0.2s;
}
.btn:hover .arr { transform: translateX(3px); }

/* Hero */
.hero {
  padding: 80px 0 120px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: center;
}
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
}

.hero-eyebrow {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(44px, 6.5vw, 84px);
  font-weight: 600;
  letter-spacing: -2.6px;
  line-height: 0.98;
  text-wrap: balance;
}
.hero h1 .grad {
  background: linear-gradient(110deg, var(--rl-1b) 0%, var(--rl-2a) 35%, var(--rl-3a) 70%, var(--rl-3b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 28px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 52ch;
}
.hero-cta {
  margin-top: 40px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-meta {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 36px;
  width: fit-content;
}
.hero-meta .stat .v {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.8px;
  color: var(--ink);
}
.hero-meta .stat .l {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-top: 4px;
}

/* Hero visual */
.hero-visual {
  position: relative;
  aspect-ratio: 1.05 / 1;
  width: 100%;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card.elev { box-shadow: var(--shadow-md); }

/* Reading demo */
.reading-card {
  position: absolute;
  inset: 6% 12% 28% 0;
  padding: 36px 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.reading-card .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.reading-card .meta-row .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-omission);
}
.reading-card .meta-row .live::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-omission);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.reading-text {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.45;
  text-align: left;
  direction: ltr;
  color: var(--ink);
  text-wrap: pretty;
  font-weight: 600;
  letter-spacing: -0.035em;
  min-height: 168px;
  margin-top: 78px;
  padding-right: 6px;
}
.reading-text .w {
  display: inline-block;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(4px);
  transition: opacity 0.45s ease, filter 0.45s ease, transform 0.45s ease;
  margin-inline: 2px;
}
.reading-text .w.shown {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}
.reading-text .w.current { color: var(--rl-2a); }

.reading-progress {
  margin-top: auto;
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.reading-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rl-2a), var(--rl-3a));
  transition: width 0.4s linear;
}

/* Hero waveform */
.wave-card {
  position: absolute;
  inset: auto 0 0 18%;
  height: 32%;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wave-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.wave-card .top strong { color: var(--ink); font-weight: 600; }
.wave-card canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 1000px) {
  .hero-visual { aspect-ratio: auto; height: 460px; }
}

@media (max-width: 640px) {
  .hero {
    padding: 54px 0 76px;
  }

  .hero-grid {
    gap: 36px;
  }

  .hero-visual {
    aspect-ratio: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
  }

  .reading-card,
  .wave-card {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
  }

  .reading-card {
    min-height: 340px;
    padding: 26px 24px 24px;
  }

  .reading-card .meta-row {
    align-items: flex-start;
    gap: 10px;
    font-size: 10px;
    line-height: 1.55;
    letter-spacing: 0.09em;
  }

  .reading-card .meta-row > span:first-child {
    min-width: 0;
    max-width: 22ch;
  }

  .reading-card .meta-row .live {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .reading-text {
    font-size: clamp(23px, 6.1vw, 28px);
    line-height: 1.38;
    letter-spacing: -0.02em;
    min-height: 132px;
    margin-top: 72px;
    padding-right: 0;
  }

  .reading-text .w {
    margin-inline: 1px;
  }

  .wave-card {
    height: 162px;
    padding: 18px 20px;
  }

  .wave-card .top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
    font-size: 10px;
    line-height: 1.55;
  }

  .wave-card .top span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .wave-card canvas {
    min-height: 84px;
  }
}

@media (max-width: 380px) {
  .reading-card {
    min-height: 326px;
    padding: 24px 20px 22px;
  }

  .reading-card .meta-row {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }

  .reading-text {
    font-size: 22px;
    min-height: 124px;
    margin-top: 64px;
  }

  .wave-card {
    height: 152px;
    padding: 16px 18px;
  }
}

/* Hero grid */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(10,22,40,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,22,40,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
  z-index: 0;
}
.hero .shell { position: relative; z-index: 1; }

/* Participant flow */
.flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  position: relative;
}
@media (max-width: 1000px) { .flow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .flow { grid-template-columns: 1fr; } }

.flow-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}
.flow-card .step {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
}
.flow-card h4 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 4px 0 10px;
}
.flow-card p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
}
.flow-card .visual {
  margin-top: 16px;
  height: 100px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

/* Flow card visuals */
.flow-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.flow-mic span {
  display: block;
  width: 4px;
  background: var(--rl-2a);
  border-radius: 2px;
  animation: micbar 1.2s infinite ease-in-out;
}
.flow-mic span:nth-child(1) { height: 30%; animation-delay: 0s; }
.flow-mic span:nth-child(2) { height: 65%; animation-delay: 0.1s; }
.flow-mic span:nth-child(3) { height: 95%; animation-delay: 0.2s; }
.flow-mic span:nth-child(4) { height: 70%; animation-delay: 0.15s; }
.flow-mic span:nth-child(5) { height: 40%; animation-delay: 0.05s; }
.flow-mic span:nth-child(6) { height: 80%; animation-delay: 0.25s; }
.flow-mic span:nth-child(7) { height: 55%; animation-delay: 0.18s; }
@keyframes micbar {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
.flow-code {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.flow-code .cursor {
  display: inline-block;
  width: 10px;
  height: 22px;
  margin-left: 4px;
  background: var(--rl-2a);
  animation: blink 1s infinite step-end;
  vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

.flow-text {
  font-family: var(--font-fa);
  direction: rtl;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--ink);
}
.flow-text .w2 { opacity: 0.25; }
.flow-text .w2.on { opacity: 1; color: var(--rl-2a); }

.flow-rec {
  display: flex; align-items: center; justify-content: center;
}
.flow-rec .blob {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  display: grid; place-items: center;
  position: relative;
}
.flow-rec .blob::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.3);
  animation: ring 1.6s infinite;
}
.flow-rec .blob i {
  width: 16px; height: 16px; border-radius: 50%;
  background: #ef4444;
}
@keyframes ring {
  0% { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.flow-key {
  display: flex; align-items: center; justify-content: center;
}
.flow-key .key {
  width: 70%;
  border: 1.5px solid var(--ink-3);
  border-radius: 6px;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  color: var(--ink-2);
  letter-spacing: 0.1em;
  box-shadow: 0 3px 0 var(--ink-3);
  animation: press 2s infinite;
}
@keyframes press {
  0%, 90%, 100% { transform: translateY(0); box-shadow: 0 3px 0 var(--ink-3); }
  92%, 95% { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink-3); }
}

/* Flow arrows */
.flow-card:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 32px;
  color: var(--muted-2);
  font-size: 18px;
  font-family: var(--font-mono);
  z-index: 2;
}
@media (max-width: 1000px) { .flow-card::after { display: none; } }

/* Pipeline */
.pipeline-wrap {
  position: relative;
  margin-top: 24px;
}
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pipeline { grid-template-columns: 1fr; } }

.node {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(130, 230, 252, 0.15);
  border-radius: 10px;
  padding: 20px 18px;
  position: relative;
  aspect-ratio: 1 / 1;
  transition: all 0.3s ease;
}
.node .n {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(130, 230, 252, 0.6);
  letter-spacing: 0.1em;
}
.node h5 {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #e2e8f0;
}
.node p {
  font-size: 12.5px;
  color: #94a3b8;
  margin-top: 10px;
  line-height: 1.55;
}
.node.active {
  background: linear-gradient(180deg, rgba(58,196,240,0.18), rgba(26,79,212,0.14));
  border-color: rgba(130, 230, 252, 0.6);
  box-shadow: 0 0 0 1px rgba(130, 230, 252, 0.3), 0 12px 30px rgba(58, 196, 240, 0.2);
}
.node.active .n { color: var(--rl-3b); }

@media (max-width: 900px) {
  .node {
    aspect-ratio: auto;
    min-height: 190px;
  }
}

.pipeline-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  flex-wrap: wrap;
  gap: 16px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 13px;
}
.legend-item .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(130,230,252,0.25);
}
.legend-item .lbl.green { color: var(--c-correct); border-color: rgba(16,185,129,0.4); }
.legend-item .lbl.amber { color: var(--c-mispron); border-color: rgba(245,158,11,0.4); }
.legend-item .lbl.red { color: var(--c-omission); border-color: rgba(239,68,68,0.4); }

/* STT and VAD */
.parallel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .parallel { grid-template-columns: 1fr; } }

.track {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 28px 28px 26px;
}
.track .track-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.track h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.track h3 .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 400;
  letter-spacing: 0.05em;
  display: block;
  margin-top: 4px;
}
.track .desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.wave {
  width: 100%;
  height: 110px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.wave canvas { width: 100%; height: 100%; display: block; }

.tokens-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--font-fa);
  direction: rtl;
}
.tok {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 10px 5px;
  font-size: 14px;
  line-height: 1;
}
.tok .ms {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.keyterm-list {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-family: var(--font-fa);
  direction: rtl;
  margin-top: 14px;
}
.keyterm-list .kt {
  font-size: 13px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--rl-1b);
  border-radius: 4px;
  font-weight: 500;
}
.keyterm-list .kt.strike {
  text-decoration: line-through;
  background: var(--bg-3);
  color: var(--muted-2);
  font-weight: 400;
}

.vad-stat-row {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.vad-stat-row .s { color: var(--muted); }
.vad-stat-row .s strong { color: var(--ink); font-weight: 600; }

/* Normalization and alignment */
.norm-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
}
@media (max-width: 900px) { .norm-grid { grid-template-columns: 1fr; } }

.morph {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 32px 28px;
}
.morph h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}
.morph .row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule);
}
.morph .row:last-child { border-bottom: none; }
.morph .cell {
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px;
  direction: ltr;
  letter-spacing: -0.2px;
}
.morph .cell.fa {
  direction: rtl;
  font-family: var(--font-fa);
}
.morph .cell.phon {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--rl-2a);
  letter-spacing: 0.05em;
}
.morph .arr {
  text-align: center;
  color: var(--muted-2);
  font-family: var(--font-mono);
}
.morph .col-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  text-align: center;
  padding-bottom: 6px;
}

.align-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 28px 26px;
}
.align-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.align-card .hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.align-rail {
  position: relative;
  padding: 16px 0 14px;
  font-family: var(--font-display);
  direction: ltr;
}
.align-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.align-row.ref { padding-bottom: 36px; }
.align-row.stt { padding-top: 36px; border-top: 1px dashed var(--rule); }
.align-row .at {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  font-family: var(--font-display);
  direction: ltr;
  padding: 6px 12px 5px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.align-row .at:hover { border-color: var(--rl-2a); }
.align-row .at.active {
  background: var(--accent-soft);
  border-color: var(--rl-2a);
  color: var(--rl-1b);
}
.align-row .at.miss { opacity: 0.45; }
.align-row .at.ins { background: #f1f5f9; color: var(--muted); border-style: dashed; }

.cost-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.cost-list .ci {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: 6px;
  border: 1px solid var(--rule);
}
.cost-list .ci .pair { font-family: var(--font-display); font-size: 14px; }
.cost-list .ci .v { font-weight: 600; }
.cost-list .ci.green .v { color: var(--c-correct); }
.cost-list .ci.blue .v { color: var(--rl-2a); }
.cost-list .ci.red .v { color: var(--c-omission); }

/* Labels */
.labels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .labels-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .labels-grid { grid-template-columns: 1fr; } }

.label-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 22px 22px 24px;
  position: relative;
  overflow: hidden;
}
.label-card .stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: currentColor;
}
.label-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.label-card .glyph {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: currentColor;
  position: relative;
}
.label-card .glyph::before {
  content: attr(data-g);
  color: #fff;
}
.label-card h4 {
  font-size: 18px;
  margin-top: 14px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.label-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 6px;
}
.label-card .ex {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  direction: ltr;
  text-align: left;
}
.label-card .ex em {
  font-style: normal;
  color: currentColor;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}
.label-card .orf {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.label-card .orf strong { color: var(--ink); font-weight: 600; }

.label-card.correct  { color: var(--c-correct); }
.label-card.omission { color: var(--c-omission); }
.label-card.insertion { color: var(--c-insertion); }
.label-card.repetition { color: var(--c-repetition); }
.label-card.selfcorr { color: var(--c-selfcorr); }
.label-card.mispron  { color: var(--c-mispron); }

.philosophy {
  margin-top: 36px;
  padding: 32px 36px;
  background: var(--ink);
  color: #e2e8f0;
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}
.philosophy .ico {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rl-2a), var(--rl-3a));
  display: grid; place-items: center;
  font-family: var(--font-mono);
  color: white;
  font-weight: 700;
}
.philosophy q {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.4;
}
.philosophy q::before, .philosophy q::after { content: ""; }
.philosophy .src {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #5d7596;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
@media (max-width: 720px) {
  .philosophy { grid-template-columns: 1fr; gap: 18px; padding: 26px; }
  .philosophy q { font-size: 18px; }
}

/* Duration and WCPM */
.duration-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: stretch;
}
@media (max-width: 900px) { .duration-grid { grid-template-columns: 1fr; } }

.timeline-card, .formula-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 32px 32px 30px;
}
.timeline-card h4, .formula-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.tl-track {
  position: relative;
  height: 236px;
  margin: 12px 0 8px;
}
.tl-axis {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  background: var(--rule-2);
}
.tl-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 72px;
  text-align: center;
}
.tl-mark::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid white;
  outline: 1px solid var(--ink);
  margin: 0;
}
.tl-mark.vad::before { background: var(--c-correct); outline-color: var(--c-correct); }
.tl-mark.edge {
  transform: translate(-100%, -50%);
  align-items: flex-end;
  text-align: right;
}
.tl-mark.up .lbl { order: -2; margin-bottom: 8px; }
.tl-mark.up .ms { order: -1; margin-bottom: 6px; }
.tl-mark.down .lbl { margin-top: 8px; }
.tl-mark .lbl { white-space: nowrap; }
.tl-mark .ms {
  margin-top: 2px;
  color: var(--muted-2);
  letter-spacing: 0;
}

.tl-bar {
  position: absolute;
  left: 0; right: 0;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}
.tl-bar.a {
  top: 12%;
  background: rgba(10, 22, 40, 0.08);
  color: var(--ink-2);
}
.tl-bar.b {
  top: 76%;
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  left: 18%;
  right: 12%;
}
.tl-bar .pill {
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
}

.formula {
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
}
.formula .eq {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
}
.formula .eq.primary {
  background: linear-gradient(180deg, #eaf2ff 0%, #d9e6fb 100%);
  border-color: var(--rl-2a);
}
.formula .eq .name {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}
.formula .eq .name strong { color: var(--ink); font-weight: 600; }
.formula .eq .name .pri {
  background: var(--rl-1b); color: white;
  padding: 2px 7px; border-radius: 3px;
  font-size: 9.5px;
}
.formula .eq .frac {
  display: grid;
  grid-template-columns: 1fr;
  font-size: 14px;
}
.formula .eq .num, .formula .eq .den {
  padding: 6px 0;
  text-align: center;
  color: var(--ink);
}
.formula .eq .num { border-bottom: 1.5px solid var(--ink); }

.params-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.params-mini .pm {
  display: flex; flex-direction: column;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--rule);
}
.params-mini .pm code { color: var(--rl-1b); font-weight: 500; }
.params-mini .pm small { color: var(--muted); margin-top: 4px; font-family: var(--font-display); font-size: 11px; }

/* Dashboard preview */
.dash-frame {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dash-bar {
  background: var(--ink);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dash-bar .left { display: flex; align-items: center; gap: 16px; color: #94a3b8; font-size: 13px; }
.dash-bar .left .dlogo { display: flex; align-items: center; gap: 8px; color: #e2e8f0; font-weight: 600; font-size: 14px; }
.dash-bar .left .dlogo span { font-weight: 700; }
.dash-bar .left .dnav { display: flex; gap: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,0.08); }
.dash-bar .left .dnav span { font-size: 12px; }
.dash-bar .left .dnav .on { color: #e2e8f0; }
.dash-bar .right {
  display: flex; align-items: center; gap: 12px; color: #94a3b8;
}
.dash-bar .right .badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.dash-body {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-2);
}
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.kpi {
  padding: 22px 26px;
  border-right: 1px solid var(--rule);
}
.kpi:last-child { border-right: none; }
.kpi .l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.kpi .v {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--ink);
  margin-top: 6px;
}
.kpi .v small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-2);
  font-family: var(--font-mono);
  letter-spacing: 0;
  margin-left: 4px;
}
.kpi .delta {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-correct);
}
.kpi .delta.warn { color: var(--c-mispron); }
@media (max-width: 700px) { .kpi-strip { grid-template-columns: 1fr 1fr; } .kpi:nth-child(2) { border-right: none; } .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid var(--rule); } }

.dash-panels {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1px;
  background: var(--rule);
}
@media (max-width: 900px) { .dash-panels { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  padding: 22px 24px 24px;
}
.panel h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-bottom: 14px;
}
.panel-wave {
  height: 130px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.panel-wave canvas { width: 100%; height: 100%; }

.flag-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px;
}
.flag {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
}
.flag .ico {
  width: 16px; height: 16px;
  border-radius: 3px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
  margin-top: 1px;
}
.flag.warn .ico { background: var(--c-mispron); }
.flag.info .ico { background: var(--rl-3a); }
.flag h6 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.flag p {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.review-state-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
}

.token-grid {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-family: var(--font-display);
  direction: ltr;
  text-align: left;
  justify-content: flex-start;
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: 6px;
  border: 1px solid var(--rule);
}
.tg {
  padding: 5px 9px;
  border-radius: 4px;
  font-family: var(--font-display);
  direction: ltr;
  font-size: 14.5px;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
}
.tg:hover { border-color: var(--ink); }
.tg.correct  { background: rgba(16,185,129,0.12); color: #047857; }
.tg.omission { background: rgba(239,68,68,0.12); color: #b91c1c; text-decoration: line-through; }
.tg.mispron  { background: rgba(245,158,11,0.16); color: #b45309; }
.tg.repetition { background: rgba(12,159,224,0.14); color: #0369a1; }
.tg.selfcorr { background: rgba(20,184,166,0.14); color: #0f766e; }
.tg.insertion { background: rgba(148,163,184,0.16); color: var(--muted); font-style: italic; }

/* Imagery */
.placeholder {
  background:
    repeating-linear-gradient(135deg, var(--bg-3) 0 12px, var(--bg-2) 12px 24px);
  border: 1px dashed var(--rule-2);
  border-radius: var(--r-md);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.placeholder .meta {
  background: rgba(255,255,255,0.92);
  padding: 12px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  max-width: 80%;
}
.placeholder .meta .ttl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 6px;
}
.placeholder .meta .prompt {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

/* Footer */
.closing {
  padding: 110px 0 90px;
  background: var(--ink);
  color: #e2e8f0;
  text-align: center;
}
.closing h2 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 600;
  letter-spacing: -1.6px;
  line-height: 1.05;
  text-wrap: balance;
  max-width: 24ch;
  margin: 0 auto;
}
.closing h2 em {
  font-style: normal;
  background: linear-gradient(95deg, var(--rl-2a), var(--rl-3b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.closing .pillars {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 760px;
  margin-left: auto; margin-right: auto;
}
.closing .pillars .p {
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
}
.closing .pillars .p .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #5d7596;
  letter-spacing: 0.1em;
}
.closing .pillars .p .t {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
  color: #e2e8f0;
  letter-spacing: -0.2px;
}
.closing .cta {
  margin-top: 48px;
  display: inline-flex;
  gap: 14px;
}
.closing .cta .btn-primary {
  background: white;
  color: var(--ink);
}
.closing .cta .btn-primary:hover { background: #f4f6fb; }
.closing .cta .btn-ghost {
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.2);
}
.closing .cta .btn-ghost:hover { background: rgba(255,255,255,0.05); }
@media (max-width: 700px) { .closing .pillars { grid-template-columns: 1fr; } }

footer.foot {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 0;
  color: #5d7596;
  font-size: 12.5px;
}
footer.foot .row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Helpers */
.mono { font-family: var(--font-mono); }
.fa { font-family: var(--font-fa); direction: rtl; }
.fa-inline {
  font-family: var(--font-fa);
  direction: rtl;
  unicode-bidi: isolate;
}


/* Presentation modes */
.modes {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .modes { grid-template-columns: 1fr; } }

.mode-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 30px 30px 24px;
  display: flex;
  flex-direction: column;
}
.mode-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.mode-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}
.mode-card h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.mode-desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
  margin-bottom: 22px;
  text-wrap: pretty;
}
.mode-demo {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px 22px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.reveal-demo .md-row {
  font-family: var(--font-display);
  direction: ltr;
  font-size: 22px;
  line-height: 2;
  color: var(--ink);
  flex: 1;
  letter-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.reveal-demo .md-w {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 220ms ease, transform 220ms ease;
  display: inline-block;
}
.reveal-demo .md-w.on { opacity: 1; transform: translateY(0); }
.reveal-demo .md-w.cur { color: var(--rl-1b); font-weight: 600; }

.static-demo { padding: 0; overflow: hidden; }
.static-demo .sd-page {
  display: none;
  padding: 22px 22px 0;
  flex: 1;
  flex-direction: column;
}
.static-demo .sd-page.sd-active { display: flex; }
.static-demo .sd-marker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.static-demo .sd-text {
  font-family: var(--font-display);
  direction: ltr;
  font-size: 19px;
  line-height: 2;
  color: var(--ink);
  flex: 1;
}
.md-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 0;
  border-top: 1px dashed var(--rule);
  margin-top: 14px;
}
.md-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: uppercase;
}
.md-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
}
.reveal-demo .md-foot { padding-left: 0; padding-right: 0; }

/* Pipeline legend */
.pipeline-wrap { position: relative; }
.pipeline-legend {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
}
@media (max-width: 700px) { .pipeline-legend { grid-template-columns: 1fr; } }
.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
}
.legend-item > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.legend-item strong { color: #e2e8f0; font-weight: 600; font-family: var(--font-display); font-size: 13px; letter-spacing: -0.1px; }
.legend-item em {
  font-style: normal;
  font-family: var(--font-mono);
  color: #5d7596;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.legend-item .lbl {
  font-weight: 700;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  font-size: 9.5px;
  padding: 3px 7px;
  border-radius: 3px;
  color: white;
}
.legend-item .lbl.green { background: #047857; }
.legend-item .lbl.amber { background: #b45309; }
.legend-item .lbl.red { background: #b91c1c; }

/* Keyterm chips */
.keyterm-list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.keyterm-list .kt {
  font-family: var(--font-mono);
  direction: ltr;
  font-size: 13px;
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 14px;
  color: var(--ink);
}
.keyterm-list .kt.strike {
  color: var(--muted-2);
  text-decoration: line-through;
  background: transparent;
}

.vad-stat-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.vad-stat-row .s strong { color: var(--ink); }

/* Cost ladder */
.cost-ladder {
  margin-top: 56px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 40px 40px 36px;
}
.cl-head { margin-bottom: 28px; max-width: 720px; }
.cl-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cl-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.7px;
  color: var(--ink);
  margin-bottom: 14px;
}
.cl-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  text-wrap: pretty;
}

.ladder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.rung {
  display: grid;
  grid-template-columns: 80px 180px 1fr 1.2fr 120px;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  position: relative;
}
.rung.break {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.3);
  border-style: dashed;
}
.rung.over {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.25);
}
.rung .r-cost {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.rung .r-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.rung .r-name-2 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #b45309;
}
.rung .r-ex { font-size: 13px; color: var(--ink); font-family: var(--font-mono); }
.rung .r-ex .fa-tag {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 7px;
  font-family: var(--font-fa);
  font-size: 11.5px;
  color: #94a3b8;
  background: rgba(148,163,184,0.06);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 3px;
  direction: rtl;
  vertical-align: 1px;
}
.rung .r-rule {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #6b7a90;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.rung .r-bar {
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.rung .r-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, var(--rl-2a), var(--rl-3b));
  border-radius: 3px;
}
.rung.break .r-bar i { background: #f59e0b; }
.rung.over .r-bar i { background: #ef4444; }

.cl-note {
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--bg-2);
  border-left: 3px solid var(--rl-2a);
  border-radius: 4px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 800px) {
  .rung { grid-template-columns: 60px 1fr; gap: 10px; }
  .rung .r-rule, .rung .r-ex, .rung .r-bar { grid-column: 1 / -1; }
}

/* Label cascade */
.cascade {
  margin-top: 56px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 40px;
}
.cas-head { margin-bottom: 28px; }
.cas-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cas-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.6px;
  color: var(--ink);
}
.cas-steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.cas-step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.cas-step .cs-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  padding-top: 4px;
}
.cas-step .cs-body h5 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.cas-step .cs-body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  text-wrap: pretty;
}

.conf-track {
  margin-top: 18px;
  position: relative;
  height: 78px;
  background: var(--bg-2);
  border-radius: 6px;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.conf-axis {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  height: 2px;
  background: var(--rule-2);
}
.conf-band {
  position: absolute;
  top: 8px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 0 6px;
  text-align: center;
  text-transform: uppercase;
  color: white;
}
.conf-band.correct { background: rgba(16, 185, 129, 0.7); }
.conf-band.misp { background: rgba(245, 158, 11, 0.85); }
.conf-band.correct2 { background: rgba(16, 185, 129, 0.45); color: #064e3b; }
.conf-tick {
  position: absolute;
  top: 4px;
  bottom: 0;
  width: 1px;
  background: var(--ink);
  transform: translateX(-0.5px);
}
.conf-tick span {
  position: absolute;
  bottom: 0;
  left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
}

/* Metrics */
.metrics-tier { margin-top: 8px; }
.mt-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.mt-sub {
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 70ch;
  text-wrap: pretty;
}
.mt-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 1000px) { .mt-grid { grid-template-columns: 1fr; } }

.formula-card.slim, .timeline-card {
  padding: 28px 28px 24px;
}

.formula-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  text-wrap: pretty;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
}

/* Profile cards */
.profile-cards {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) { .profile-cards { grid-template-columns: 1fr; } }
.pf {
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.pf.b {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}
.pf-h {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.04em;
}
.pf-d {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Flag rows */
.flag-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.flagrow { border-bottom: 1px solid var(--rule); }
.flagrow:last-child { border-bottom: none; }
.flagrow > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 18px;
  gap: 18px;
  align-items: center;
  transition: background 0.15s;
}
.flagrow > summary::-webkit-details-marker { display: none; }
.flagrow > summary:hover { background: var(--bg-2); }
.flagrow[open] > summary { background: var(--bg-2); border-bottom: 1px solid var(--rule); }
.flagrow .fr-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.flagrow .fr-param {
  font-size: 12px;
  color: var(--rl-1b);
}
.flagrow .fr-thr {
  font-size: 12px;
  color: var(--c-mispron);
  font-weight: 600;
  text-align: right;
}
.flagrow .fr-arr {
  font-size: 18px;
  color: var(--muted-2);
  text-align: center;
  transition: transform 0.2s;
  font-family: var(--font-mono);
}
.flagrow[open] .fr-arr { transform: rotate(90deg); }
.flagrow .fr-body {
  padding: 18px 22px 22px 22px;
  display: grid;
  gap: 10px;
  background: var(--bg-2);
}
.flagrow .fr-q {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
  text-wrap: pretty;
}
.flagrow .fr-q strong { color: var(--ink); font-weight: 600; }

@media (max-width: 700px) {
  .flagrow > summary { grid-template-columns: 1fr 18px; gap: 6px; }
  .flagrow .fr-param, .flagrow .fr-thr { grid-column: 1 / 2; text-align: left; }
}

/* Dashboard photo */
.dash-photo {
  margin-top: 22px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}
.dash-photo img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.02);
}
.dash-photo-cap {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  text-wrap: pretty;
}

/* Hero stats */
.hero-meta { display: flex; gap: 32px; margin-top: 36px; }
.hero-meta .stat .v {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.hero-meta .stat .l {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

@media (max-width: 720px) {
  .sec-title {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.06;
    letter-spacing: -1px;
  }

  .sec-lede,
  .hero-sub {
    font-size: 15.5px;
    line-height: 1.62;
  }

  .hero h1 {
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.03;
    letter-spacing: -1.4px;
  }

  .hero-meta {
    width: 100%;
    gap: 0;
    justify-content: space-between;
  }

  .hero-meta .stat {
    min-width: 0;
  }

  .hero-meta .stat .v {
    font-size: 20px;
  }

  .hero-meta .stat .l {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }

  .track,
  .morph,
  .align-card,
  .cascade,
  .formula-card.slim,
  .timeline-card,
  .panel {
    padding: 22px 18px;
  }

  .track .track-head {
    align-items: flex-start;
    gap: 12px;
  }

  .vad-stat-row {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .morph .row {
    grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 14px minmax(0, 1fr);
    gap: 4px;
    padding: 12px 0;
  }

  .morph .cell {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .morph .cell.phon {
    font-size: 13.5px;
  }

  .morph .col-lbl {
    font-size: 8.5px;
    letter-spacing: 0.06em;
  }

  .cost-list .ci {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .cost-list .ci .v {
    line-height: 1.5;
  }

  .cascade {
    margin-top: 36px;
  }

  .cas-title {
    font-size: 22px;
  }

  .cas-step {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }

  .cas-step .cs-num {
    padding-top: 0;
  }

  .cas-step .cs-body h5 {
    font-size: 16px;
  }

  .cas-step .cs-body p {
    font-size: 13.5px;
    line-height: 1.62;
  }

  .conf-track {
    height: auto;
    display: grid;
    grid-template-columns: 30fr 50fr 20fr;
    gap: 3px;
    overflow: visible;
    background: transparent;
    border: 0;
  }

  .conf-axis,
  .conf-tick {
    display: none;
  }

  .conf-band {
    position: relative;
    inset: auto !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto;
    min-height: 44px;
    padding: 8px 6px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }

  .tl-track {
    height: auto;
    display: grid;
    gap: 8px;
    margin: 18px 0 4px;
  }

  .tl-axis {
    display: none;
  }

  .tl-bar {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 34px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 4px 8px;
    line-height: 1.35;
  }

  .tl-bar.b {
    left: auto;
    right: auto;
  }

  .tl-mark,
  .tl-mark.edge {
    position: relative;
    top: auto;
    left: auto !important;
    transform: none;
    min-width: 0;
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    justify-items: start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--bg-2);
    text-align: left;
  }

  .tl-mark::before {
    width: 9px;
    height: 9px;
    grid-column: 1;
    grid-row: 1;
  }

  .tl-mark .lbl,
  .tl-mark.up .lbl,
  .tl-mark.down .lbl {
    order: initial;
    margin: 0;
    white-space: normal;
    grid-column: 2;
    grid-row: 1;
  }

  .tl-mark .ms,
  .tl-mark.up .ms,
  .tl-mark.down .ms {
    order: initial;
    margin: 0;
    grid-column: 3;
    grid-row: 1;
    white-space: nowrap;
  }

  .profile-cards {
    gap: 10px;
  }

  .pf-h {
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
  }

  .dash-bar {
    height: auto;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
  }

  .dash-bar .left {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .dash-bar .left .dnav {
    display: none;
  }

  .dash-bar .right {
    width: 100%;
  }

  .dash-bar .right .badge {
    width: 100%;
    text-align: center;
  }

  .kpi {
    padding: 18px 16px;
  }

  .kpi .v {
    font-size: 28px;
  }

  .panel h5 {
    line-height: 1.5;
  }

  .panel-wave {
    height: 112px;
  }

  .review-state-flow {
    align-items: flex-start;
  }

  .token-grid {
    gap: 5px;
    padding: 10px;
  }

  .tg {
    font-size: 13px;
    padding: 5px 8px;
  }
}

@media (max-width: 420px) {
  .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-cta {
    gap: 10px;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .kpi {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .kpi:last-child {
    border-bottom: none;
  }
}
