/* ═══════════════════════════════════════════════════════════════════════════
   Spaghetti Docs — Design System
   Terminal-craft aesthetic: ink surfaces, cyan accent, precision type
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #050607;
  --bg-deep: #030405;
  --surface: #0c0e12;
  --surface-2: #12151c;
  --surface-3: #181c26;
  --surface-hover: #1c2130;
  --border: rgba(255, 255, 255, 0.055);
  --border-strong: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(45, 212, 191, 0.22);

  --text: #eef1f6;
  --text-secondary: #a8b0c0;
  --text-muted: #6b7388;
  --text-dim: #4a5163;

  --accent: #2dd4bf;
  --accent-bright: #5eead4;
  --accent-dim: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.1);
  --accent-softer: rgba(45, 212, 191, 0.05);
  --accent-glow: rgba(45, 212, 191, 0.35);

  --cyan: #67e8f9;
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --magenta: #e879f9;
  --magenta-soft: rgba(232, 121, 249, 0.12);
  --orange: #fb923c;
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.12);
  --red: #f87171;

  --font-sans: "Instrument Sans", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace;
  --font-display: "Instrument Sans", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 60px rgba(45, 212, 191, 0.12);

  --nav-h: 64px;
  --max: 1120px;
  --max-wide: 1280px;
  --sidebar-w: 240px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(45, 212, 191, 0.09), transparent 55%),
    radial-gradient(ellipse 40% 30% at 90% 10%, rgba(103, 232, 249, 0.04), transparent 50%),
    radial-gradient(ellipse 30% 25% at 10% 40%, rgba(232, 121, 249, 0.03), transparent 50%);
}

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

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

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

code,
kbd,
pre {
  font-family: var(--font-mono);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.wrap-wide {
  max-width: var(--max-wide);
}

/* ── Nav ────────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 6, 7, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--text);
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px var(--accent-glow);
  color: #042f2e;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
  color: var(--accent-bright);
}

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

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  place-items: center;
  font-size: 18px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: #042f2e;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 24px rgba(45, 212, 191, 0.25);
}

.btn-primary:hover {
  color: #042f2e;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 12px 32px rgba(45, 212, 191, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 10px 12px;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
  font-size: 13px;
  padding: 7px 14px;
}

.btn-icon {
  font-size: 15px;
  opacity: 0.9;
}

/* ── Typography ─────────────────────────────────────────────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 560px;
}

.muted {
  color: var(--text-muted);
}

.section {
  padding: 96px 0;
  position: relative;
  z-index: 1;
}

.section-sm {
  padding: 64px 0;
}

.section-header {
  margin-bottom: 48px;
  max-width: 640px;
}

.section-header.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-header .lead {
  margin-top: 14px;
}

.section-header.center .lead {
  margin-left: auto;
  margin-right: auto;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 72px 0 48px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 56px;
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: 18px;
}

.hero-copy h1 .grad {
  background: linear-gradient(120deg, var(--text) 0%, var(--accent-bright) 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy .lead {
  margin-bottom: 28px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

/* Terminal mockup */

.terminal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
  position: relative;
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.35), transparent 40%, transparent 60%, rgba(103, 232, 249, 0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}

.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 20px 22px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  min-height: 320px;
}

.terminal-body .t-accent { color: var(--accent-bright); }
.terminal-body .t-muted { color: var(--text-muted); }
.terminal-body .t-dim { color: var(--text-dim); }
.terminal-body .t-amber { color: var(--amber); }
.terminal-body .t-green { color: var(--green); }
.terminal-body .t-white { color: var(--text); }
.terminal-body .t-bold { font-weight: 600; color: var(--text); }
.terminal-body .t-magenta { color: var(--magenta); }

.wordmark {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 8px 0 14px;
  white-space: pre;
  font-size: 11px;
  opacity: 0.95;
}

.term-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 2px 0;
}

.term-stats {
  display: grid;
  gap: 2px;
  text-align: right;
  flex-shrink: 0;
}

.term-stats .stat-line {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.term-stats .stat-label {
  color: var(--text-muted);
}

.term-stats .stat-val {
  color: var(--text);
  font-weight: 500;
  min-width: 56px;
  text-align: right;
}

.term-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.term-prompt {
  margin-top: 16px;
}

.term-prompt .cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ── Stats strip ────────────────────────────────────────────────────────── */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 56px 0 0;
}

.stat-cell {
  background: var(--surface);
  padding: 28px 24px;
  text-align: center;
  transition: background 0.2s;
}

.stat-cell:hover {
  background: var(--surface-2);
}

.stat-cell .value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-cell .value.accent { color: var(--accent-bright); }
.stat-cell .value.amber { color: var(--amber); }
.stat-cell .value.green { color: var(--green); }

.stat-cell .label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Feature cards ──────────────────────────────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.feature-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 40px rgba(45, 212, 191, 0.06);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-size: 18px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid rgba(45, 212, 191, 0.15);
}

.feature-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.15);
}

.feature-icon.green {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.15);
}

.feature-icon.magenta {
  background: var(--magenta-soft);
  color: var(--magenta);
  border-color: rgba(232, 121, 249, 0.15);
}

.feature-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(96, 165, 250, 0.15);
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Architecture ───────────────────────────────────────────────────────── */

.arch-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.arch-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(45, 212, 191, 0.06), transparent 70%);
  pointer-events: none;
}

.arch-svg {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.arch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.arch-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.arch-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Engine comparison ──────────────────────────────────────────────────── */

.engine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.engine-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.engine-card.featured {
  border-color: rgba(45, 212, 191, 0.3);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.08), var(--shadow-glow);
}

.engine-card.featured::before {
  content: "Default";
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.2);
  padding: 4px 8px;
  border-radius: 999px;
}

.engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-bright);
  margin-bottom: 12px;
}

.engine-card h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.engine-card > p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.engine-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.engine-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.engine-list li::before {
  content: "→";
  color: var(--accent);
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Code blocks ────────────────────────────────────────────────────────── */

.code-block {
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.code-block pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  tab-size: 2;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: inherit;
}

/* Syntax colors */
.c-kw { color: var(--magenta); }
.c-fn { color: var(--cyan); }
.c-str { color: var(--green); }
.c-cm { color: var(--text-dim); font-style: italic; }
.c-num { color: var(--amber); }
.c-type { color: var(--blue); }
.c-prop { color: var(--accent-bright); }
.c-op { color: var(--text-muted); }

.copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.copy-btn.copied {
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.3);
}

/* ── Two-col layouts ────────────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split-start {
  align-items: start;
}

/* ── Command table ──────────────────────────────────────────────────────── */

.cmd-grid {
  display: grid;
  gap: 8px;
}

.cmd-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}

.cmd-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.cmd-row code {
  font-size: 13px;
  color: var(--accent-bright);
  background: var(--accent-softer);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(45, 212, 191, 0.12);
}

.cmd-row span {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Index matrix ───────────────────────────────────────────────────────── */

.index-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.index-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  transition: border-color 0.15s;
}

.index-item:hover {
  border-color: var(--border-strong);
}

.index-item .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.index-item .tag.rs-only { color: var(--amber); }
.index-item .tag.ts-only { color: var(--blue); }

.index-item h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.index-item p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Pipeline steps ─────────────────────────────────────────────────────── */

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}

.pipeline-step {
  text-align: center;
  padding: 0 12px;
  position: relative;
}

.pipeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: calc(50% + 28px);
  right: calc(-50% + 28px);
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim), rgba(45, 212, 191, 0.15));
}

.pipeline-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.12);
  position: relative;
  z-index: 1;
}

.pipeline-step h4 {
  font-size: 13.5px;
  margin-bottom: 6px;
}

.pipeline-step p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── CTA band ───────────────────────────────────────────────────────────── */

.cta-band {
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(45, 212, 191, 0.1), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-band h2 {
  margin-bottom: 12px;
}

.cta-band .lead {
  margin: 0 auto 28px;
}

.cta-band .hero-ctas {
  justify-content: center;
  margin-bottom: 0;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 40px;
  position: relative;
  z-index: 1;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 12px;
  max-width: 260px;
  line-height: 1.55;
}

.footer h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer a {
  color: var(--text-secondary);
  font-size: 13.5px;
}

.footer a:hover {
  color: var(--accent-bright);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── API page layout ────────────────────────────────────────────────────── */

.api-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  max-width: var(--max-wide);
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
  position: relative;
  z-index: 1;
}

.api-sidebar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 28px 16px 40px 24px;
  border-right: 1px solid var(--border);
  background: rgba(5, 6, 7, 0.4);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.api-sidebar h4 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 20px 0 8px;
  padding: 0 10px;
}

.api-sidebar h4:first-child {
  margin-top: 0;
}

.api-sidebar a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
  line-height: 1.35;
}

.api-sidebar a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.api-sidebar a.active {
  color: var(--accent-bright);
  background: var(--accent-soft);
}

.api-main {
  padding: 40px 48px 96px;
  min-width: 0;
  max-width: 820px;
}

.api-main > .lead {
  margin-bottom: 40px;
}

.api-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.api-section > h2 {
  font-size: 1.55rem;
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.api-section > .section-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin: 14px 0 24px;
  line-height: 1.6;
}

/* Method cards */

.method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.method:hover {
  border-color: var(--border-strong);
}

.method-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}

.method-sig {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  word-break: break-word;
}

.method-sig .name {
  color: var(--accent-bright);
  font-weight: 600;
}

.method-sig .params {
  color: var(--text-muted);
}

.method-sig .ret {
  color: var(--blue);
}

.method-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.method-badge.sync {
  color: var(--amber);
  background: var(--amber-soft);
}

.method-badge.async {
  color: var(--magenta);
  background: var(--magenta-soft);
}

.method-badge.live {
  color: var(--green);
  background: var(--green-soft);
}

.method-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.method.open .method-body {
  display: block;
  padding-top: 16px;
}

.method-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.55;
}

.method-body .param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.method-body .param-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.method-body .param-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.method-body .param-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-bright);
  white-space: nowrap;
}

.method-body .param-table td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
}

.method-body .code-block {
  margin-top: 4px;
}

.method-chevron {
  color: var(--text-dim);
  font-size: 12px;
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
  margin-top: 4px;
}

.method.open .method-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

/* Type cards */

.type-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.type-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.type-card-header h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
}

.type-card-header .kind {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.type-card .code-block {
  border: none;
  border-radius: 0;
  background: var(--bg-deep);
}

.type-card .code-block pre {
  margin: 0;
}

.type-card > p {
  padding: 12px 18px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Options table */

.options-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.options-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.options-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}

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

.options-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-bright);
  white-space: nowrap;
}

.options-table td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  white-space: nowrap;
}

.options-table td code {
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Inline code */

:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent-bright);
  background: var(--accent-softer);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(45, 212, 191, 0.1);
}

/* Callout */

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--accent-softer);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.callout strong {
  color: var(--accent-bright);
  font-weight: 600;
}

.callout.warn {
  background: var(--amber-soft);
  border-color: rgba(251, 191, 36, 0.15);
}

.callout.warn strong {
  color: var(--amber);
}

/* Group headers in API */

.method-group {
  margin-bottom: 28px;
}

.method-group > h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-group > h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .index-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .pipeline-step:not(:last-child)::after {
    display: none;
  }

  .pipeline-step {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 16px;
    text-align: left;
    align-items: start;
  }

  .pipeline-num {
    margin: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .api-layout {
    grid-template-columns: 1fr;
  }

  .api-sidebar {
    display: none;
  }

  .api-main {
    padding: 32px 24px 80px;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(8, 10, 14, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 2px;
    backdrop-filter: blur(16px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    width: 100%;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-actions .btn-secondary {
    display: none;
  }

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

  .features-grid,
  .engine-grid,
  .split,
  .index-grid {
    grid-template-columns: 1fr;
  }

  .cmd-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .cta-band {
    padding: 40px 24px;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .terminal-body {
    font-size: 10.5px;
    padding: 14px 14px 16px;
  }

  .terminal-body:not(.terminal-body-mock) {
    min-height: 280px;
  }

  .terminal-body-mock {
    min-height: 0;
    font-size: 10.5px;
  }

  .wordmark {
    font-size: 9px;
  }
}

/* ── Utilities ──────────────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mt-0 { margin-top: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

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

/* Selection */

::selection {
  background: rgba(45, 212, 191, 0.3);
  color: var(--text);
}

/* Scrollbar (webkit) */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Screenshot gallery ─────────────────────────────────────────────────── */

.shot-gallery {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.shot-gallery .shot-main {
  grid-row: span 2;
}

.shot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.shot-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow), 0 0 40px rgba(45, 212, 191, 0.06);
  transform: translateY(-2px);
}

.shot-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #0c0e12;
}

.shot-caption {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.shot-caption strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.shot-caption span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.shot-note {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-align: center;
}

@media (max-width: 900px) {
  .shot-gallery {
    grid-template-columns: 1fr;
  }
  .shot-gallery .shot-main {
    grid-row: auto;
  }
}

/* ── Theme toggle ───────────────────────────────────────────────────────── */

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

/* ── Light theme ────────────────────────────────────────────────────────── */

html[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-deep: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --surface-hover: #f0f2f5;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --border-glow: rgba(13, 148, 136, 0.28);

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent: #0d9488;
  --accent-bright: #0f766e;
  --accent-dim: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-softer: rgba(13, 148, 136, 0.06);
  --accent-glow: rgba(13, 148, 136, 0.2);

  --cyan: #0891b2;
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.1);
  --green: #15803d;
  --green-soft: rgba(21, 128, 61, 0.1);
  --magenta: #a21caf;
  --magenta-soft: rgba(162, 28, 175, 0.1);
  --orange: #c2410c;
  --blue: #1d4ed8;
  --blue-soft: rgba(29, 78, 216, 0.1);
  --red: #dc2626;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.08);
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(13, 148, 136, 0.08), transparent 55%),
    radial-gradient(ellipse 40% 30% at 90% 10%, rgba(8, 145, 178, 0.05), transparent 50%);
}

html[data-theme="light"] .nav {
  background: rgba(244, 246, 248, 0.82);
}

html[data-theme="light"] .nav-logo {
  color: #f0fdfa;
  box-shadow: 0 0 16px rgba(13, 148, 136, 0.25);
}

html[data-theme="light"] .hero-copy h1 .grad {
  background: linear-gradient(120deg, #0f172a 0%, #0d9488 55%, #0891b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  color: #f0fdfa;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px rgba(13, 148, 136, 0.25);
}

html[data-theme="light"] .btn-primary:hover {
  color: #f0fdfa;
}

html[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text);
}

html[data-theme="light"] .terminal,
html[data-theme="light"] .code-block,
html[data-theme="light"] .type-card .code-block {
  background: #0c0e12;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .terminal-bar,
html[data-theme="light"] .code-header {
  background: #12151c;
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .terminal-body,
html[data-theme="light"] .code-block pre {
  color: #a8b0c0;
}

html[data-theme="light"] .code-block .c-kw { color: #e879f9; }
html[data-theme="light"] .code-block .c-fn { color: #67e8f9; }
html[data-theme="light"] .code-block .c-str { color: #4ade80; }
html[data-theme="light"] .code-block .c-cm { color: #5c6478; }
html[data-theme="light"] .code-block .c-num { color: #fbbf24; }
html[data-theme="light"] .code-block .c-type { color: #60a5fa; }
html[data-theme="light"] .code-block .c-prop { color: #5eead4; }

html[data-theme="light"] .copy-btn {
  color: #8b93a7;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .copy-btn:hover {
  color: #eef1f6;
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .code-header {
  color: #6b7388;
}

html[data-theme="light"] .shot-card img {
  background: #0c0e12;
}

html[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

html[data-theme="light"] .stats-strip {
  background: var(--border);
}

html[data-theme="light"] .cta-band {
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(13, 148, 136, 0.08), transparent 60%),
    var(--surface);
}

html[data-theme="light"] .api-sidebar {
  background: rgba(244, 246, 248, 0.6);
}

html[data-theme="light"] .method-sig .name,
html[data-theme="light"] .options-table td:first-child,
html[data-theme="light"] .method-body .param-table td:first-child,
html[data-theme="light"] :not(pre) > code {
  color: var(--accent-bright);
}

html[data-theme="light"] .arch-panel {
  background: var(--surface);
}

html[data-theme="light"] .feature-card:hover {
  box-shadow: var(--shadow);
}

/* Keep architecture SVG readable in light mode via panel background only;
   SVG internal colors stay dark-themed which still works on white cards. */

/* Command detail cards on commands page */
.cmd-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}

.cmd-detail:hover {
  border-color: var(--border-strong);
}

.cmd-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.cmd-detail-header h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-bright);
}

.cmd-detail-header .alias {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.cmd-detail > p {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.55;
}

.cmd-flags {
  list-style: none;
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.cmd-flags li {
  font-size: 13px;
  color: var(--text-secondary);
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 12px;
}

.cmd-flags code {
  font-size: 12px;
}

.cmd-examples {
  display: grid;
  gap: 6px;
}

.cmd-examples code {
  display: block;
  font-size: 12.5px;
  padding: 8px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent-bright);
  overflow-x: auto;
}

html[data-theme="light"] .cmd-examples code {
  background: #0c0e12;
  border-color: rgba(15, 23, 42, 0.12);
  color: #5eead4;
}

.resolve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.resolve-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.resolve-item code {
  display: inline-block;
  margin-bottom: 8px;
}

.resolve-item p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

@media (max-width: 720px) {
  .resolve-grid {
    grid-template-columns: 1fr;
  }
  .cmd-flags li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ── Terminal mocks (screenshot-faithful, dense CLI rhythm) ─────────────── */

.terminal-hero {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  min-width: 0; /* allow shrink inside hero grid without forced overflow wrap chaos */
}

.terminal-hero .terminal-body {
  min-height: 0;
  padding: 12px 12px 14px;
  line-height: 1.3;
}

.terminal-body-mock {
  /* normal on container: HTML indentation between tags must not become blank lines */
  white-space: normal;
  font-size: 12px;
  line-height: 1.3;
  min-height: 0;
}

/* Only the half-block wordmark needs multi-line pre */
.terminal-body-mock .wordmark {
  white-space: pre;
  line-height: 1.12;
  margin: 0 0 8px;
  font-size: clamp(9px, 1.35vw, 11px);
  overflow: hidden;
}

/* Gallery/table rows keep internal spaces for column alignment */
.terminal-body-mock > div:not(.dash-frame) {
  white-space: pre;
  line-height: 1.3;
}

.terminal-body-compact {
  padding: 14px 16px 14px;
  min-height: 0;
}

.terminal-body-mock .t-blank {
  height: 0.4em;
}

.terminal-body-mock .t-bar {
  color: var(--accent);
  letter-spacing: -0.04em;
}

.terminal-body-mock .t-hl {
  color: var(--accent-bright);
  background: rgba(45, 212, 191, 0.14);
  border-radius: 2px;
  padding: 0 2px;
}

/* Hero dashboard: CSS frame (no unicode box-drawing that wraps) */
.dash-mock {
  overflow: hidden;
}

.dash-frame {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px 14px;
  min-width: 0;
}

.dash-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.dash-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px 0 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
  border-left: 1px solid rgba(148, 163, 184, 0.45);
  flex-shrink: 0;
  margin-top: -2px;
}

.dash-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), transparent);
  min-width: 12px;
}

.dash-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 20px;
  align-items: start;
  margin-bottom: 12px;
}

.dash-brand {
  min-width: 0;
}

.dash-tagline {
  margin-bottom: 4px;
  font-size: 11.5px;
  white-space: normal;
}

.dash-meta {
  font-size: 11px;
  white-space: normal;
}

.terminal-hero .term-stats {
  display: grid;
  gap: 2px;
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
}

.terminal-hero .term-stats .stat-line {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  line-height: 1.35;
  white-space: nowrap;
  font-size: 11.5px;
}

.terminal-hero .term-stats .stat-label {
  color: var(--text-muted);
}

.terminal-hero .term-stats .stat-val {
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dash-cmds {
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  white-space: normal;
  line-height: 1.4;
}

.terminal-hero .term-prompt {
  margin-top: 10px;
  white-space: nowrap;
  font-size: 12px;
}

.terminal-hero .term-result {
  margin-top: 8px;
}

.terminal-hero .term-result > div {
  white-space: normal;
  line-height: 1.4;
  font-size: 11.5px;
}

.terminal-hero .term-result > div + div {
  margin-top: 3px;
}

/* Base terminal-body is loose for non-mock use; mocks stay dense */
.terminal-body:not(.terminal-body-mock) {
  line-height: 1.55;
}

@media (max-width: 520px) {
  .dash-top {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .terminal-hero .term-stats {
    text-align: left;
  }

  .terminal-hero .term-stats .stat-line {
    justify-content: flex-start;
  }
}

/* Caption strip under mock terminals in the gallery */
.terminal > .shot-caption {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.shot-gallery .terminal {
  display: flex;
  flex-direction: column;
  height: auto;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.shot-gallery .terminal:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow), 0 0 40px rgba(45, 212, 191, 0.06);
  transform: translateY(-2px);
}

/* Don't stretch body to fill tallest card — keeps content dense */
.shot-gallery .terminal .terminal-body {
  flex: 0 1 auto;
}

/* Match real CLI traffic-light dots more closely */
.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

html[data-theme="light"] .terminal-body-mock .t-hl {
  background: rgba(94, 234, 212, 0.18);
}

html[data-theme="light"] .terminal > .shot-caption {
  background: #12151c;
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .terminal > .shot-caption strong {
  color: #eef1f6;
}

html[data-theme="light"] .terminal > .shot-caption span {
  color: #6b7388;
}
