/* ============================================================
   MISSION CANVAS — Landing Page
   Design: dark-mode first · Cabinet Grotesk + Satoshi
   Inspired by: Obsidian (#0F0F0F), Harvey (warm-dark, trust),
   Jan.ai (social proof, open source energy)
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Core palette — dark mode (default) */
  --color-bg:             #0d0d0b;
  --color-surface:        #141412;
  --color-surface-offset: #1c1c19;
  --color-border:         rgba(255,255,255,0.08);
  --color-border-strong:  rgba(255,255,255,0.15);

  /* Text */
  --color-text:           #eeede8;
  --color-text-muted:     #a8a79f;
  --color-text-faint:     #666560;

  /* Accent — teal, trust, governance */
  --color-primary:        #4f9fa8;
  --color-primary-dim:    rgba(79,159,168,0.12);
  --color-primary-glow:   rgba(79,159,168,0.25);

  /* Semantic chip colors */
  --color-local:          #22c55e;
  --color-local-bg:       rgba(34,197,94,0.1);
  --color-external:       #f59e0b;
  --color-external-bg:    rgba(245,158,11,0.1);
  --color-node:           #818cf8;
  --color-node-bg:        rgba(129,140,248,0.1);

  /* Type */
  --font-display: 'Cabinet Grotesk', system-ui, sans-serif;
  --font-body:    'Satoshi', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Scale */
  --text-xs:   clamp(11px, 1.1vw, 12px);
  --text-sm:   clamp(13px, 1.3vw, 14px);
  --text-base: clamp(15px, 1.5vw, 17px);
  --text-lg:   clamp(18px, 2vw, 22px);
  --text-xl:   clamp(22px, 2.5vw, 28px);
  --text-2xl:  clamp(30px, 4vw, 42px);
  --text-3xl:  clamp(42px, 6vw, 72px);
  --text-hero: clamp(52px, 8vw, 96px);

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --space-16: 64px; --space-20: 80px; --space-24: 96px; --space-32: 128px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.7), 0 4px 16px rgba(0,0,0,0.4);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --t-reveal: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1140px;
  --container-pad: clamp(var(--space-6), 5vw, var(--space-16));
  --section-pad:   clamp(var(--space-16), 8vw, var(--space-32));
}

/* Light mode override */
[data-theme="light"] {
  --color-bg:             #fafaf8;
  --color-surface:        #f2f1ee;
  --color-surface-offset: #e8e6e0;
  --color-border:         rgba(0,0,0,0.08);
  --color-border-strong:  rgba(0,0,0,0.15);
  --color-text:           #17170f;
  --color-text-muted:     #5a5950;
  --color-text-faint:     #a0a090;
  --color-primary:        #3a8a94;
  --color-primary-dim:    rgba(58,138,148,0.08);
  --color-primary-glow:   rgba(58,138,148,0.15);
  --color-local:          #16a34a;
  --color-local-bg:       rgba(22,163,74,0.08);
  --color-external:       #d97706;
  --color-external-bg:    rgba(217,119,6,0.08);
  --color-node:           #6366f1;
  --color-node-bg:        rgba(99,102,241,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  transition: background var(--t-reveal), color var(--t-reveal);
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; }
ul, ol { list-style: none; }

/* ---------- Layout Utilities ---------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ---------- Typography ---------- */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.section-headline {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.section-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 56ch;
  line-height: 1.7;
  margin-bottom: var(--space-12);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--t-interactive),
    color var(--t-interactive),
    box-shadow var(--t-interactive),
    transform var(--t-interactive),
    border-color var(--t-interactive);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
}
.btn-primary:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--color-primary-dim), var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
  background: transparent;
}
.btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  transform: translateY(-1px);
}

.btn-sm { padding: 8px 14px; font-size: var(--text-xs); }

.download-buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.btn-download {
  padding: 14px 28px;
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-md);
}
.mobile-download-note {
  display: none;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.chip-local {
  color: var(--color-local);
  background: var(--color-local-bg);
  border: 1px solid rgba(34,197,94,0.2);
}
.chip-external {
  color: var(--color-external);
  background: var(--color-external-bg);
  border: 1px solid rgba(245,158,11,0.2);
}
.chip-open {
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}
.chip-node {
  color: var(--color-node);
  background: var(--color-node-bg);
  border: 1px solid rgba(129,140,248,0.2);
}
.chip-lens {
  color: var(--color-primary);
  background: var(--color-primary-dim);
  border: 1px solid rgba(79,159,168,0.2);
}
.chip-sources {
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}
.chip-always {
  color: var(--color-primary);
  background: var(--color-primary-dim);
  border: 1px solid rgba(79,159,168,0.2);
  padding: 6px 14px;
  font-size: 12px;
}
.chip-sm { font-size: 10px; padding: 2px 8px; }

/* ---------- Scroll Reveal (CSS-driven, no CLS) ---------- */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Hero items use JS-driven entrance instead */
.hero .fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.hero .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    background var(--t-reveal);
}
.nav--hidden { transform: translateY(-100%); }
.nav--scrolled { box-shadow: var(--shadow-sm); }

.nav-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  height: 60px;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
  text-decoration: none;
  transition: color var(--t-interactive);
}
.nav-logo:hover { color: var(--color-primary); }
.nav-logo-mark {
  width: 96px;
  height: 34px;
  display: block;
  overflow: hidden;
  border-radius: 5px;
  background: #050807;
  box-shadow: 0 0 16px rgba(79,159,168,0.16);
}
.nav-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-left: auto;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--t-interactive);
}
.nav-links a:hover { color: var(--color-text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: var(--space-6);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: transparent;
  transition: color var(--t-interactive), background var(--t-interactive);
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  padding-block: var(--space-8) var(--space-20);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 520px;
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero-headline {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--color-text);
}
.hero-headline em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 50ch;
  margin-bottom: 0;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}

/* Install block — Obsidian-style terminal command */
.install-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.install-cmd {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--t-interactive), box-shadow var(--t-interactive);
  width: 100%;
  max-width: 520px;
  min-width: 0;
}
.install-cmd:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-dim);
}
.install-cmd code {
  flex: 1;
  font-family: inherit;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install-prefix {
  color: var(--color-primary);
  font-weight: 700;
  user-select: none;
}
.copy-btn {
  color: var(--color-text-faint);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--t-interactive), background var(--t-interactive);
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.copy-btn.copied { color: var(--color-local); }

.install-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  padding-left: 4px;
}

.hero-trust {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-faint);
  letter-spacing: 0.03em;
  padding-top: var(--space-2);
}

/* ── Hero banner — graffiti logo centered at top of page ── */
.hero-banner {
  text-align: center;
  padding-top: calc(56px + var(--space-8));  /* clear the fixed nav */
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.hero-banner.visible {
  opacity: 1;
  transform: translateY(0);
}
.hero-banner-img {
  max-width: min(90vw, 560px);
  height: auto;
  margin-inline: auto;
}

/* ── Install command blocks (curl / irm / docker) ── */
.install-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  width: 100%;
  max-width: 520px;
}

/* ============================================================
   PIPELINE DEMO WINDOW
   ============================================================ */
.pipeline-demo {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pipeline-demo::before {
  content: "";
  position: absolute;
  inset: 6% -6% -8% 8%;
  background:
    radial-gradient(circle at 45% 35%, var(--color-primary-glow), transparent 46%),
    radial-gradient(circle at 76% 68%, rgba(129,140,248,0.12), transparent 36%);
  filter: blur(28px);
  opacity: 0.9;
  pointer-events: none;
}

.mc-demo-brand {
  position: relative;
  z-index: 1;
  left: 50%;
  width: min(132%, 940px);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
}

.mc-demo-brand img {
  width: 100%;
  max-width: none;
  height: clamp(200px, 24vw, 310px);
  object-fit: cover;
  object-position: center 43%;
  transform: scale(1.18) translateY(-6%);
  transform-origin: center 43%;
}

.mc-demo-window {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 40px var(--color-primary-glow);
  overflow: hidden;
}

.mc-demo-titlebar {
  position: relative;
  min-height: 40px;
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mc-demo-dots {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 7px;
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }
.mc-demo-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.mc-demo-app {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 520px;
  background: color-mix(in srgb, var(--color-surface) 92%, #0d1117);
}

.mc-demo-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  padding-top: 22px;
  background: color-mix(in srgb, var(--color-surface-offset) 44%, #0d0d0b);
  border-right: 1px solid rgba(255,255,255,0.12);
}

.mc-side-icon {
  position: relative;
  width: 18px;
  height: 18px;
  opacity: 0.62;
}

.mc-side-icon::before,
.mc-side-icon::after {
  content: "";
  position: absolute;
  border: 1.5px solid var(--color-text-muted);
}

.mc-side-mail::before { inset: 3px 1px; border-radius: 3px; }
.mc-side-mail::after {
  left: 3px; right: 3px; top: 7px; height: 7px;
  border-top: 0; border-left: 0; transform: rotate(45deg);
}
.mc-side-calendar::before { inset: 2px; border-radius: 3px; }
.mc-side-calendar::after {
  left: 4px; right: 4px; top: 7px; border-width: 1px 0 0;
}
.mc-side-check::before { inset: 2px; border-radius: 4px; }
.mc-side-check::after {
  width: 8px; height: 4px; left: 5px; top: 7px;
  border-top: 0; border-right: 0; transform: rotate(-45deg);
}
.mc-side-chat::before { inset: 3px 2px 5px; border-radius: 6px; }
.mc-side-chat::after {
  width: 5px; height: 5px; left: 5px; bottom: 3px;
  border-top: 0; border-right: 0; transform: rotate(-18deg);
}

.mc-demo-content {
  min-width: 0;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  opacity: 1;
  transition: opacity 220ms ease;
}

.mc-demo-workspace {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mc-demo-chips {
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  align-content: flex-start;
}

.mc-gov-chip {
  opacity: 0;
  transform: translateY(4px);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  transition: opacity 300ms ease, transform 300ms ease;
}

.mc-gov-chip.visible {
  opacity: 1;
  transform: translateY(0);
}

.mc-chip-amber {
  color: #f59e0b;
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.35);
}
.mc-chip-green {
  color: #4ade80;
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.35);
}
.mc-chip-red {
  color: #ef4444;
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.35);
}

.mc-demo-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.mc-demo-response {
  min-width: 0;
}

.mc-demo-response p {
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: 1.6;
  min-height: 72px;
}

.mc-stream-caret,
.mc-input-caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 2px;
  background: currentColor;
  transform: translateY(2px);
  opacity: 0;
}

.mc-demo-response.streaming .mc-stream-caret,
.mc-demo-input.typing .mc-input-caret {
  opacity: 0.78;
  animation: blink 850ms steps(1) infinite;
}
@keyframes blink {
  0%, 48% { opacity: 0.78; }
  49%, 100% { opacity: 0; }
}

.mc-demo-proof {
  opacity: 0;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: opacity 500ms ease;
}

.mc-demo-proof.visible {
  opacity: 1;
}

.mc-demo-sources {
  opacity: 0;
  width: min(100%, 330px);
  margin-left: auto;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.45;
  transform: translateX(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.mc-demo-sources.visible {
  opacity: 1;
  transform: translateX(0);
}

.mc-sources-title {
  margin-bottom: 8px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 700;
}

.mc-source-line {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.mc-source-line span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mc-source-icon {
  position: relative;
  width: 13px;
  height: 15px;
  border: 1px solid var(--color-text-muted);
  border-radius: 2px;
}

.mc-source-icon::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 5px;
  height: 5px;
  border-left: 1px solid var(--color-text-muted);
  border-bottom: 1px solid var(--color-text-muted);
  background: var(--color-surface-offset);
}

.mc-source-mail {
  height: 12px;
  border-radius: 3px;
}

.mc-source-mail::after {
  left: 2px;
  right: 2px;
  top: 3px;
  width: auto;
  height: 5px;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  background: transparent;
}

.mc-demo-input {
  min-height: 56px;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg) 65%, var(--color-surface));
  padding: 11px 15px 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.45;
}

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

.mc-demo-query {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
}

.mc-demo-resetting {
  opacity: 0;
}

.demo-trace-item {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-faint);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 1px 6px;
  opacity: 0;
  animation: chip-in 0.2s var(--ease-out) forwards;
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================================
   TRUST BAR
   ============================================================ */
.trust-bar {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-4);
  background: transparent;
}
.trust-items {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-6);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.trust-item svg { color: var(--color-primary); flex-shrink: 0; }
.trust-divider {
  width: 1px; height: 24px;
  background: var(--color-border-strong);
}

/* ============================================================
   HOW IT WORKS — PIPELINE
   ============================================================ */
.how-it-works {
  padding-block: var(--section-pad);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr) repeat(4, auto);
  align-items: stretch;
  gap: 0;
  margin-block: var(--space-10);
  overflow-x: auto;
  padding-bottom: var(--space-4);
}

/* Restructure to a linear left-to-right flow */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: var(--space-4);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.pipeline-step {
  flex: 1;
  min-width: 150px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--t-interactive), box-shadow var(--t-interactive);
}
.pipeline-step:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}
.step-highlight {
  border-color: rgba(79,159,168,0.3);
  background: var(--color-primary-dim);
}
.step-highlight:hover {
  border-color: rgba(79,159,168,0.5);
  box-shadow: 0 0 20px var(--color-primary-glow);
}
.step-terminal {
  border-color: rgba(129,140,248,0.25);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  text-transform: uppercase;
}
.step-highlight .step-num { color: var(--color-primary); }

.step-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.step-body p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding-inline: var(--space-2);
  color: var(--color-text-faint);
  font-size: 16px;
  flex-shrink: 0;
}

.pipeline-footer {
  margin-top: var(--space-6);
}

/* ============================================================
   USE CASES
   ============================================================ */
.use-cases {
  padding-block: var(--section-pad);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.case-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--t-interactive), box-shadow var(--t-interactive), transform var(--t-interactive);
}
.case-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.case-icon {
  width: 48px; height: 48px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.case-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}
.case-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
}
.case-proof {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.proof-label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-faint);
}
.proof-label em {
  font-style: italic;
  color: var(--color-text-muted);
}

/* ============================================================
   TRIANGULATION
   ============================================================ */
.triangulation {
  padding-block: var(--section-pad);
}
.tri-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.tri-text h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}
.tri-text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 50ch;
}
.tri-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.tri-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.tri-icon {
  font-size: 20px;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-style: normal;
  color: var(--color-primary);
}
.tri-list li > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tri-list strong {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.tri-list span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
}
.tri-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   GOVERNANCE CHIPS DEMO
   ============================================================ */
.governance-chips-demo {
  padding-block: var(--section-pad);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.chip-demo-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 760px;
}

.chip-demo-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chip-demo-query {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  line-height: 1.5;
}
.chip-demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-demo-why {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chip-demo-why-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-primary);
  font-weight: 600;
}
.chip-demo-why-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ============================================================
   OPEN SOURCE
   ============================================================ */
.open-source {
  padding-block: var(--section-pad);
}
.open-source-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  overflow: hidden;
}
.os-text h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}
.os-text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 46ch;
}
.os-ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.os-stat {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: 0 !important;
  line-height: 1.6;
}

/* Code block — styled terminal */
.os-code-block {
  background: #0a0a08;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}
[data-theme="light"] .os-code-block {
  background: #111111;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.code-file {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.code-badge {
  font-size: 9px;
  color: var(--color-primary);
  background: var(--color-primary-dim);
  border: 1px solid rgba(79,159,168,0.3);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.code-pre {
  padding: var(--space-6);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.8;
}
.code-pre code { font-family: inherit; }
.code-comment { color: #4d4d4a; }
.code-kw      { color: #a78bfa; }
.code-fn      { color: #4f9fa8; }

/* ============================================================
   JOURNEY
   ============================================================ */
.journey {
  padding-block: var(--section-pad);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.journey-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-10);
  counter-reset: journey;
}
.journey-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
  transition: border-color var(--t-interactive), transform var(--t-interactive);
}
.journey-step:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.journey-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-faint);
  letter-spacing: 0.08em;
}
.journey-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.journey-content p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.journey-time {
  margin-top: auto;
  padding-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-primary);
  letter-spacing: 0.06em;
}

/* ============================================================
   FINAL CTA
   ============================================================ */
.final-cta {
  padding-block: var(--section-pad);
  text-align: center;
}
.final-cta-inner {
  max-width: 600px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}
.final-cta-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  max-width: 18ch;
}
.final-cta-inner p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 50ch;
}
.final-cta-install { width: 100%; max-width: 480px; }
.final-byline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.08em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-8);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.footer-tagline {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}
.footer-links {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  transition: color var(--t-interactive);
}
.footer-links a:hover { color: var(--color-text-muted); }
.footer-dev code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: unset;
    padding-block: var(--space-16) var(--space-12);
  }
  .hero-inner { max-width: 100%; }
  .pipeline-demo {
    width: min(100%, 720px);
    margin-inline: auto;
  }
  .cases-grid { grid-template-columns: 1fr; }
  .tri-layout { grid-template-columns: 1fr; }
  .open-source-inner { grid-template-columns: 1fr; }
  .journey-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .hero-headline { font-size: clamp(36px, 11vw, 56px); }
  .nav-logo {
    gap: 6px;
  }
  .nav-logo-mark {
    width: 68px;
    height: 36px;
  }
  .download-buttons {
    flex-direction: column;
    width: 100%;
  }
  .btn-download {
    width: 100%;
    text-align: center;
  }
  .mobile-download-note { display: block; }
  .journey-steps { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .trust-items { gap: var(--space-4); }
  .trust-divider { display: none; }
  .pipeline-demo {
    max-width: 100%;
    overflow: hidden;
  }
  .mc-demo-brand img {
    height: 130px;
  }
  .mc-demo-app {
    min-height: 430px;
  }
  .mc-demo-content {
    padding: var(--space-4);
  }
  .mc-demo-chips {
    min-height: 86px;
  }
  .mc-gov-chip {
    font-size: 10px;
    white-space: normal;
  }
  .mc-demo-response p {
    min-height: 110px;
    font-size: 13px;
    line-height: 1.55;
  }
  .mc-demo-sources {
    width: 100%;
    margin-left: 0;
    padding: var(--space-3);
  }
  .mc-demo-proof {
    font-size: 10px;
  }
  /* Prevent text overflow */
  .hero-sub, .section-sub, .tri-text p, .os-text p, .final-cta-inner p {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  body { overflow-x: hidden; }
  .hero-inner { width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .hero .fade-in { opacity: 1; transform: none; }
}

/* ============================================================
   GLOW / AMBIENT — subtle depth, not AI-slop
   ============================================================ */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 75% 40%, var(--color-primary-glow) 0%, transparent 60%);
  z-index: -1;
}
.hero { position: relative; }
