/* ========================================================================
   Zero Operators — Website v2
   Tokens come from the locked brand system. Dark default, light via
   [data-theme="light"] swap. Motion is gentle and intentional.
   ======================================================================== */

:root,
[data-theme="dark"] {
  --canvas: #12110F;
  --canvas-2: #17150F;
  --canvas-3: #1C1A13;
  --rule: #2A241C;
  --rule-2: #35301F;

  --cream: #EBE3D2;
  --cream-2: #C8C0AE;
  --dim: #857D6B;
  --ghost: #4E4738;

  --coral: oklch(0.74 0.14 35);
  --coral-hover: oklch(0.78 0.14 35);
  --coral-soft: oklch(0.74 0.14 35 / 0.14);
  --coral-ring: oklch(0.74 0.14 35 / 0.32);

  --dusk: oklch(0.70 0.10 245);
  --dusk-soft: oklch(0.70 0.10 245 / 0.14);
  --dusk-ring: oklch(0.70 0.10 245 / 0.30);

  --moss: oklch(0.62 0.08 150);
  --moss-soft: oklch(0.62 0.08 150 / 0.14);
  --moss-ring: oklch(0.62 0.08 150 / 0.30);

  --btn-ink: #1A0F06;
  --shadow-card: 0 0 0 1px var(--rule), 0 20px 40px -24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

[data-theme="light"] {
  --canvas: #F4EFE6;
  --canvas-2: #EDE6D3;
  --canvas-3: #E4DCC6;
  --rule: #D6CDB6;
  --rule-2: #C5BB9F;

  --cream: #1A1712;         /* alias: primary text */
  --cream-2: #3A342A;       /* secondary text */
  --dim: #6B6254;
  --ghost: #8A8171;

  --coral: oklch(0.58 0.16 35);
  --coral-hover: oklch(0.54 0.17 35);
  --coral-soft: oklch(0.58 0.16 35 / 0.12);
  --coral-ring: oklch(0.58 0.16 35 / 0.30);

  --dusk: oklch(0.50 0.12 245);
  --dusk-soft: oklch(0.50 0.12 245 / 0.12);
  --dusk-ring: oklch(0.50 0.12 245 / 0.28);

  --moss: oklch(0.48 0.09 150);
  --moss-soft: oklch(0.48 0.09 150 / 0.12);
  --moss-ring: oklch(0.48 0.09 150 / 0.28);

  --btn-ink: #FFF7EC;
  --shadow-card: 0 0 0 1px var(--rule), 0 16px 32px -20px rgba(26, 23, 18, 0.12);
  color-scheme: light;
}

/* Type */
:root {
  --sans: 'Geist', -apple-system, system-ui, sans-serif;
  --italic: 'Cormorant Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.3, 1.3, 0.5, 1);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }

em, .it {
  font-family: var(--italic);
  font-style: italic;
  font-weight: 500;
  color: var(--coral);
  letter-spacing: -0.005em;
  font-size: 1.08em;
  line-height: 0.95;
  vertical-align: -0.01em;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 48px; }

/* ========================================================================
   NAV
   ======================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 16px 0;
  background: color-mix(in oklab, var(--canvas) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-scrolled {
  border-bottom-color: var(--rule);
  background: color-mix(in oklab, var(--canvas) 92%, transparent);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .mark { width: 22px; height: 22px; display: block; }
.wordmark { font-weight: 500; font-size: 15px; letter-spacing: -0.01em; color: var(--cream); }
.wordmark em { font-size: 15px; color: var(--coral); }

.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-link {
  font-size: 13px; font-weight: 400; color: var(--cream-2);
  transition: color 0.15s var(--ease);
}
.nav-link:hover { color: var(--coral); }

.theme-toggle {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--rule-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--cream-2);
  transition: all 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--coral); color: var(--coral); }
.theme-icon { display: inline-block; width: 16px; height: 16px; position: relative; }
/* Moon (shown in dark) */
[data-theme="dark"] .theme-icon::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 35%, transparent 55%, currentColor 56%);
}
/* Sun (shown in light) */
[data-theme="light"] .theme-icon::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 -7px 0 -2px currentColor, 0 7px 0 -2px currentColor,
    -7px 0 0 -2px currentColor, 7px 0 0 -2px currentColor,
    -5px -5px 0 -3px currentColor, 5px -5px 0 -3px currentColor,
    -5px 5px 0 -3px currentColor, 5px 5px 0 -3px currentColor;
}

/* ========================================================================
   BUTTONS
   ======================================================================== */
.btn {
  font-family: var(--sans); font-weight: 500; font-size: 14px;
  padding: 11px 20px; border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1;
  transition: all 0.15s var(--ease);
}
.btn-primary {
  background: var(--coral);
  color: var(--btn-ink);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px var(--coral-ring);
}
.btn-secondary {
  background: transparent;
  color: var(--cream);
  border-color: var(--rule-2);
}
.btn-secondary:hover {
  border-color: var(--cream);
  background: var(--canvas-3);
}
.btn-ghost-sm {
  font-family: var(--mono); font-size: 12px;
  padding: 7px 12px; border-radius: 5px;
  color: var(--cream-2);
  border: 1px solid var(--rule-2);
  letter-spacing: 0.02em;
}
.btn-ghost-sm:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* ========================================================================
   HERO
   ======================================================================== */
.hero {
  position: relative;
  padding: 160px 0 120px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, var(--coral-soft), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, var(--dusk-soft), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 80px;
  align-items: center;
}

.eyebrow {
  font-family: var(--mono); font-size: 11px;
  color: var(--coral);
  letter-spacing: 0.2em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.tick { width: 18px; height: 1px; background: var(--coral); }

.author-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.18s var(--ease);
}
.author-link:hover { opacity: 0.7; }
.author-link em { font-style: normal; }

.display {
  font-weight: 500;
  font-size: clamp(44px, 5.8vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--cream);
  margin-bottom: 36px;
  padding-bottom: 4px;
}
.display em { letter-spacing: -0.01em; line-height: 1; display: inline-block; padding-bottom: 0.08em; }

.lede {
  font-size: 18px;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.55;
  max-width: 480px;
  margin-bottom: 40px;
}

.ctas {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 64px;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  max-width: 480px;
}
.hero-meta > div { display: flex; flex-direction: column; gap: 4px; }
.hero-meta dt {
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.hero-meta dd {
  font-weight: 500; font-size: 20px;
  color: var(--cream);
  letter-spacing: -0.01em;
}

/* Hero art */
.hero-art {
  display: flex; flex-direction: column; gap: 16px;
}
.hero-art-frame {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--canvas-2);
  box-shadow: var(--shadow-card);
}
.hero-art-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.03) saturate(0.98);
  transition: filter 0.4s var(--ease);
}
[data-theme="light"] .hero-art-frame img {
  filter: contrast(1.02) saturate(0.96) brightness(1.02);
}
.art-corner {
  position: absolute; width: 20px; height: 20px;
  border: 1.5px solid var(--coral);
  opacity: 0.75;
}
.art-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.art-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.art-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.art-corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.hero-art figcaption {
  display: flex; justify-content: flex-start; align-items: baseline; gap: 16px;
  padding-top: 12px;
}
.fc-title-lg {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--cream);
  line-height: 1.3;
}
.fc-title-lg em { color: var(--coral); font-size: 1em; }

/* Hero scroll indicator */
.hero-scroll {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.2em; text-transform: uppercase;
  z-index: 1;
}
.scroll-line {
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--coral), transparent);
  animation: scroll-drift 2.4s var(--ease) infinite;
}
@keyframes scroll-drift {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ========================================================================
   SECTION SCAFFOLD
   ======================================================================== */
.section {
  padding: 120px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}

.section-head { margin-bottom: 64px; max-width: 820px; }
.section-num {
  font-family: var(--mono); font-size: 11px;
  color: var(--coral);
  letter-spacing: 0.22em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.section-kind { color: var(--dim); margin-left: 4px; }
.section-kind::before { content: "·"; margin-right: 14px; color: var(--ghost); }
.section-title {
  font-weight: 500;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--cream);
  margin-bottom: 20px;
  text-wrap: balance;
}
.section-lede {
  font-size: 17px; font-weight: 300;
  color: var(--cream-2);
  line-height: 1.55;
  max-width: 620px;
}

.mono-inline {
  font-family: var(--mono); font-size: 0.9em;
  color: var(--dusk);
  padding: 1px 6px;
  background: var(--dusk-soft);
  border-radius: 3px;
}

/* ========================================================================
   IDEA — narrative + flow diagram
   ======================================================================== */
.idea-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.idea-copy p {
  font-size: 18px;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 520px;
}
.idea-copy p:first-child {
  font-size: 22px;
  color: var(--cream);
  font-weight: 400;
}
.idea-copy p:last-child { margin-bottom: 0; }

.idea-diagram {
  background: var(--canvas-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px;
  aspect-ratio: 5/4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow { width: 100%; height: auto; }
.flow-label, .flow-tick {
  font-family: var(--mono); font-size: 10px;
  fill: var(--dim); letter-spacing: 0.12em;
}
.flow-tick { fill: var(--moss); font-size: 14px; letter-spacing: 0; }
.flow-sub {
  font-family: var(--mono); font-size: 9px;
  fill: var(--dim); letter-spacing: 0.18em; text-transform: uppercase;
}
.flow-caption {
  font-family: var(--italic); font-style: italic;
  font-size: 14px; fill: var(--cream-2);
}
.flow-it { fill: var(--coral); }

.flow-arrow {
  stroke: var(--rule-2);
  stroke-width: 1;
  fill: none;
  marker-end: none;
  position: relative;
}
.flow-node { transition: opacity 0.6s var(--ease); }

/* Idea diagram animation: staged reveal + animated flow line */
.idea-diagram.is-in .flow-node[data-step="1"] { animation: flow-in 0.5s var(--ease) 0.0s both; }
.idea-diagram.is-in .flow-node[data-step="2"] { animation: flow-in 0.5s var(--ease) 0.6s both; }
.idea-diagram.is-in .flow-node[data-step="3"] { animation: flow-in 0.5s var(--ease) 1.4s both; }
.idea-diagram.is-in .flow-node[data-step="4"] { animation: flow-in 0.5s var(--ease) 2.0s both; }
.idea-diagram .flow-node { opacity: 0; }
@keyframes flow-in {
  to { opacity: 1; }
}

.idea-diagram .flow-arrow {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
/* Fanout (6 decompose arrows) animate in staggered */
.idea-diagram.is-in .flow-arrow.flow-fan:nth-of-type(1) { animation: dash-in 0.5s var(--ease) 0.3s forwards; }
.idea-diagram.is-in .flow-arrow.flow-fan:nth-of-type(2) { animation: dash-in 0.5s var(--ease) 0.38s forwards; }
.idea-diagram.is-in .flow-arrow.flow-fan:nth-of-type(3) { animation: dash-in 0.5s var(--ease) 0.46s forwards; }
.idea-diagram.is-in .flow-arrow.flow-fan:nth-of-type(4) { animation: dash-in 0.5s var(--ease) 0.54s forwards; }
.idea-diagram.is-in .flow-arrow.flow-fan:nth-of-type(5) { animation: dash-in 0.5s var(--ease) 0.62s forwards; }
.idea-diagram.is-in .flow-arrow.flow-fan:nth-of-type(6) { animation: dash-in 0.5s var(--ease) 0.70s forwards; }
/* Remaining arrows (verify fan-in + oracle→delivery) */
.idea-diagram.is-in .flow-arrow:not(.flow-fan) { animation: dash-in 0.5s var(--ease) 1.2s forwards; }
@keyframes dash-in { to { stroke-dashoffset: 0; } }

/* Phase chips */
.phase-chip rect { transition: fill 0.3s var(--ease); }
.idea-diagram .phase-chip.is-active rect {
  filter: drop-shadow(0 0 6px var(--coral-ring));
}

.pulse-dot { transform-origin: center; transform-box: fill-box; animation: pulse-dot 2.4s var(--ease) infinite; }
@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ========================================================================
   PIPELINE
   ======================================================================== */
.section-pipeline { background: var(--canvas-2); border-top: 1px solid var(--rule); }

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 48px;
}

.phase {
  background: var(--canvas);
  padding: 28px 22px 24px;
  min-height: 260px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: background 0.3s var(--ease);
}
.phase:hover { background: var(--canvas-3); }

.phase-head {
  display: flex; justify-content: space-between; align-items: center;
}
.phase-num {
  font-family: var(--mono); font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.2em;
}
.phase-kind {
  font-family: var(--mono); font-size: 9px;
  padding: 3px 8px; border-radius: 3px;
  letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.phase-auto {
  color: var(--cream-2);
  border-color: var(--rule-2);
}
.phase-human {
  color: var(--dusk);
  background: var(--dusk-soft);
  border-color: var(--dusk-ring);
}
.loop {
  font-family: var(--italic); font-style: italic;
  font-size: 11px; color: var(--coral);
  letter-spacing: 0;
  text-transform: none;
  margin-left: 2px;
}

.phase-name {
  font-weight: 500; font-size: 24px;
  color: var(--cream);
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.phase-body {
  font-size: 13px; font-weight: 300;
  color: var(--cream-2);
  line-height: 1.5;
  flex: 1;
}
.phase-tag {
  font-family: var(--mono); font-size: 9px;
  color: var(--ghost);
  letter-spacing: 0.12em;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
}

/* Active phase (phase 04) */
.phase-active {
  background: var(--canvas-3);
}
.phase-active::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--coral);
}
.phase-glow {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 40%;
  background: radial-gradient(ellipse at 50% 100%, var(--coral-soft), transparent 70%);
  pointer-events: none;
  animation: glow-breathe 3.2s var(--ease) infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.pipeline-note {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 20px 24px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 8px;
  max-width: 720px;
}
.note-glyph {
  font-family: var(--mono); font-size: 20px;
  color: var(--coral);
  line-height: 1;
  animation: rotate 4s linear infinite;
  display: inline-block;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.pipeline-note span:last-child {
  font-size: 14px; font-weight: 300;
  color: var(--cream-2);
  line-height: 1.55;
}

/* ========================================================================
   ORACLE & MEMORY (split)
   ======================================================================== */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.split-card {
  background: var(--canvas-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 32px 36px;
  display: flex; flex-direction: column;
  min-height: 440px;
}

.split-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.split-kind {
  font-family: var(--mono); font-size: 11px;
  color: var(--coral);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.split-title {
  font-weight: 500; font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 28px;
}
.split-foot {
  font-size: 14px; font-weight: 300;
  color: var(--cream-2);
  line-height: 1.55;
  padding-top: 20px;
  margin-top: auto;
  border-top: 1px solid var(--rule);
}

/* Badges */
.badge {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em;
  padding: 5px 10px; border-radius: 3px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
}
.b-coral { background: var(--coral-soft); color: var(--coral); border-color: var(--coral-ring); }
.b-dusk { background: var(--dusk-soft); color: var(--dusk); border-color: var(--dusk-ring); }
.b-moss { background: var(--moss-soft); color: var(--moss); border-color: var(--moss-ring); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Oracle card */
.metric-line {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 32px;
}
.metric-num {
  font-family: var(--sans); font-weight: 500;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.metric-caption {
  font-family: var(--mono); font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.16em; text-transform: uppercase;
}

.oracle-intro {
  font-size: 14px; font-weight: 300;
  color: var(--cream-2);
  line-height: 1.55;
  margin-bottom: 24px;
}
.oracle-intro em { font-size: 14px; }

.oracle-checks { display: flex; flex-direction: column; gap: 10px; }
.oracle-checks li {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 6px;
  transition: all 0.3s var(--ease);
}
.check-tier {
  font-family: var(--mono); font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.18em; text-transform: uppercase;
}
.check-name { font-size: 14px; color: var(--cream); }
.check-state {
  font-family: var(--mono); font-size: 10px;
  padding: 3px 9px;
  border-radius: 3px;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: all 0.4s var(--ease);
  background: var(--canvas-3);
  color: var(--dim);
}
.check-state[data-state="pending"] { color: var(--dim); }
.check-state[data-state="pass"] {
  background: var(--moss-soft);
  color: var(--moss);
  border: 1px solid var(--moss-ring);
  padding: 2px 8px;
}

/* Memory card */
.memory-stream {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 32px;
  min-height: 232px;
  counter-reset: mem;
}
.mem-line {
  display: grid;
  grid-template-columns: 52px 88px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--rule-2);
  border-radius: 4px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), border-left-color 0.3s var(--ease);
}
.mem-line.is-in { opacity: 1; transform: translateX(0); }
.mem-stamp {
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.08em;
}
.mem-kind {
  font-family: var(--mono); font-size: 9px;
  padding: 3px 7px; border-radius: 3px;
  letter-spacing: 0.16em; text-transform: uppercase;
  text-align: center;
  border: 1px solid transparent;
}
.mem-decision { background: var(--dusk-soft); color: var(--dusk); border-color: var(--dusk-ring); }
.mem-gate { background: var(--moss-soft); color: var(--moss); border-color: var(--moss-ring); }
.mem-error { background: oklch(0.65 0.18 25 / 0.14); color: oklch(0.70 0.18 25); border-color: oklch(0.65 0.18 25 / 0.3); }
.mem-prior { background: var(--coral-soft); color: var(--coral); border-color: var(--coral-ring); }
.mem-shield { background: var(--moss-soft); color: var(--moss); border-color: var(--moss-ring); }
.mem-resume { background: var(--coral-soft); color: var(--coral); border-color: var(--coral-ring); }
.mem-text { font-size: 13px; color: var(--cream-2); }
.mem-text em { font-size: 13px; }

.mem-line[data-t="2"] { border-left-color: oklch(0.65 0.18 25 / 0.6); }
.mem-line[data-t="3"] { border-left-color: var(--coral); }
.mem-line[data-t="4"] { border-left-color: var(--coral); }

/* ========================================================================
   TMUX STAGE · authentic tmux capture look
   Real ANSI palette · tight monospace · dense text · green status bar
   ======================================================================== */
.section-team { background: var(--canvas-2); }

.tmux-stage {
  background: #181818;
  border: 1px solid #2A2A2A;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
  font-family: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #C5C8C6;
}
[data-theme="light"] .tmux-stage {
  box-shadow: 0 30px 60px -30px rgba(26, 23, 18, 0.3);
}

/* Window bar at the top — looks like the tmux window list */
.tmux-winbar {
  display: flex; align-items: center; gap: 0;
  background: #0F0F0F;
  border-bottom: 1px solid #2A2A2A;
  padding: 0 8px;
  font-size: 11px;
  color: #7A7A7A;
  overflow: hidden;
  white-space: nowrap;
  min-height: 26px;
}
.wb-session {
  color: #98C379; /* tmux green */
  padding: 5px 10px 5px 4px;
  font-weight: 500;
}
.wb-tab {
  padding: 5px 10px;
  color: #7A7A7A;
  flex-shrink: 0;
}
.wb-tab-active {
  color: #E0E0E0;
  background: #262626;
}
.wb-sep { color: #5A5A5A; margin-left: 2px; }
.wb-host {
  margin-left: auto;
  padding: 5px 10px;
  color: #5A5A5A;
  font-size: 10.5px;
  flex-shrink: 0;
}

/* Two-pane split — left lead, right stacked agents */
.tmux-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 620px;
  max-height: 680px;
}
.tmux-pane { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.tmux-pane + .tmux-pane { border-left: 1px solid #2A2A2A; }

/* Pane header — small bar above each pane / agent box */
.pane-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: #141414;
  border-bottom: 1px solid #2A2A2A;
  font-size: 10.5px;
  flex-shrink: 0;
}
.ph-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #E5C07B;
  box-shadow: 0 0 6px rgba(229, 192, 123, 0.5);
  animation: term-blink 1.6s steps(2) infinite;
}
.ph-dot-blue { background: #61AFEF; box-shadow: 0 0 6px rgba(97, 175, 239, 0.5); }
.ph-dot-green { background: #98C379; box-shadow: 0 0 6px rgba(152, 195, 121, 0.5); animation: none; }
.ph-dot-dim { background: #3A3A3A; box-shadow: none; animation: none; }
.ph-name {
  color: #E0E0E0;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.ph-meta {
  margin-left: auto;
  color: #5A5A5A;
  font-size: 10px;
}

/* Lead pane body (scrolling stream) */
.tmux-lead { display: flex; flex-direction: column; }
.pane-body {
  padding: 10px 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.pane-body::-webkit-scrollbar { width: 6px; }
.pane-body::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* Chat input docked at the bottom of the lead pane */
.pane-chat {
  border-top: 1px solid #2A2A2A;
  background: #141414;
  padding: 10px 14px 12px;
  flex-shrink: 0;
}
.chat-prompt {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 10px;
  background: #0F0F0F;
  border: 1px solid #2A2A2A;
  border-radius: 4px;
  font-size: 11.5px;
}
.chat-placeholder { color: #4A4A4A; flex: 1; }
.chat-hints {
  display: flex; gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: #5A5A5A;
  flex-wrap: wrap;
}

/* Right pane — stacked agent boxes */
.tmux-right {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.agent-box {
  display: flex; flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  border-bottom: 1px solid #2A2A2A;
  overflow: hidden;
}
.agent-box:last-child { border-bottom: none; }
.agent-box.agent-active { flex: 1.3 1 0; }
.agent-box.agent-idle { flex: 0.55 1 0; opacity: 0.65; }
.agent-body {
  padding: 8px 14px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.agent-body::-webkit-scrollbar { width: 6px; }
.agent-body::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.agent-idle .agent-body { padding: 10px 14px; }

/* Individual lines: very tight, no animations, reads like captured text */
.tmx-line {
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.tmx-line.t-header {
  color: #E0E0E0;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #2A2A2A;
}
.tmx-line.t-out { color: #C5C8C6; }

/* ANSI-style accent colors */
.t-g, .tmx-line.t-g { color: #98C379; }       /* green */
.t-y, .tmx-line.t-y { color: #E5C07B; }       /* yellow */
.t-b, .tmx-line.t-b { color: #61AFEF; }       /* blue */
.t-r, .tmx-line.t-r { color: #E06C75; }       /* red */
.t-m, .tmx-line.t-m { color: #C678DD; }       /* magenta */
.t-p, .tmx-line.t-p { color: #D19A66; }       /* orange/purple-ish */
.t-dim { color: #5A5A5A; }

/* Highlighted label blocks like "> research-scout" and "●●● ok-engineer" */
.t-b-block {
  background: #61AFEF;
  color: #181818;
  padding: 1px 8px;
  border-radius: 2px;
  font-weight: 500;
}
.t-g-block {
  background: #98C379;
  color: #181818;
  padding: 1px 8px;
  border-radius: 2px;
  font-weight: 500;
}

/* Cursor line with caret */
.t-cursor { display: flex; align-items: baseline; gap: 8px; padding-top: 6px; }
.t-caret {
  display: inline-block;
  width: 7px; height: 13px;
  background: #C5C8C6;
  margin-left: 4px;
  animation: term-blink 1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }

/* Footer rows inside the lead pane (the hint lines) */
.t-footer, .t-footer2, .t-footer3 {
  margin-top: 4px;
  font-size: 10.5px;
  color: #5A5A5A;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.t-footer3 { color: #5A5A5A; }

/* Green tmux status bar at the bottom */
.tmux-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 10px;
  background: #98C379;
  color: #0F0F0F;
  font-size: 10.5px;
  font-family: inherit;
  letter-spacing: 0;
  border-top: 1px solid #2A2A2A;
}
.ts-left { display: flex; gap: 8px; }
.ts-right { display: flex; gap: 10px; align-items: center; }
.ts-dim { color: #3B5A26; }
.ts-clock { font-weight: 500; }

.tmux-caption {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.6;
  max-width: 820px;
}
.tmux-caption em { font-size: 15px; }

@media (max-width: 900px) {
  .tmux-split { grid-template-columns: 1fr; max-height: none; min-height: 0; }
  .tmux-pane + .tmux-pane { border-left: none; border-top: 1px solid #2A2A2A; }
  .tmux-winbar { font-size: 10px; }
  .tmux-winbar .wb-tab:nth-child(n+5) { display: none; }
}

/* ========================================================================
   HANDOFF — what you give / what you get
   ======================================================================== */
.section-handoff { background: var(--canvas-2); }

.handoff-grid {
  display: grid;
  grid-template-columns: 1fr 200px 1fr;
  gap: 0;
  align-items: stretch;
  margin-top: 8px;
}

.handoff-col {
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 28px 28px 32px;
  min-height: 380px;
}
.handoff-out { border-color: var(--coral-ring); }

.hc-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.hc-kind {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
}
.hc-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.handoff-out .hc-kind { color: var(--coral); }

.hc-list { display: flex; flex-direction: column; gap: 18px; }
.hc-list li {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--rule);
}
.hc-list li:last-child { border-bottom: none; padding-bottom: 0; }
.hc-name {
  font-size: 17px;
  font-weight: 500;
  color: var(--cream);
}
.hc-note {
  font-size: 14px;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.45;
}
.hc-note em { font-size: 1em; }

.handoff-engine {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  padding: 0 12px;
  position: relative;
}
.he-pulse {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft), 0 0 24px 4px var(--coral-ring);
  animation: he-pulse 2.4s var(--ease) infinite;
}
@keyframes he-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}
.he-label {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--cream);
}
.he-label em { font-size: 1em; }
.he-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  max-width: 180px;
}
.he-flow { width: 100%; height: 12px; opacity: 0.6; }

@media (max-width: 900px) {
  .handoff-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .handoff-engine { padding: 24px 0; min-height: 100px; }
  .he-flow { display: none; }
}

/* ========================================================================
   TEAM DIAGRAM — peer-to-peer multi-agent topology
   ======================================================================== */
.team-diagram {
  margin: 36px 0 18px;
  padding: 28px 24px;
  background: var(--canvas-3);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow-x: auto;
}
.team-svg { width: 100%; height: auto; min-width: 720px; }

.td-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  fill: var(--cream);
  letter-spacing: -0.01em;
}
.td-label-lg { font-size: 15px; }
.td-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--dim);
}
.td-edge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--dim);
}
.td-edge-it {
  font-family: var(--italic);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  fill: var(--coral);
}

.td-arrow {
  stroke: var(--rule-2);
  stroke-width: 1;
  fill: none;
}
.td-claim {
  stroke: var(--dusk);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}

.td-peer path {
  stroke: var(--coral);
  stroke-width: 1.4;
  fill: none;
  marker-end: none;
}

.team-diagram-note {
  margin: 18px auto 0;
  font-size: 15px;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.6;
  max-width: 720px;
  text-align: center;
}
.team-diagram-note em { font-size: 1em; }

.section-subhead {
  margin: 56px 0 24px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.section-subtitle {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 8px;
}
.section-subtitle em { font-size: 1em; }
.section-sublede {
  font-size: 15px;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.55;
  max-width: 620px;
}

/* ========================================================================
   COMPARISON
   ======================================================================== */
.compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.col {
  background: var(--canvas-2);
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 20px;
  transition: background 0.3s var(--ease);
}
.col-feat {
  background: var(--canvas-3);
  position: relative;
}
.col-feat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--coral);
}
.col-kind {
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.col-feat .col-kind { color: var(--coral); }
.col-name {
  font-weight: 500; font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--cream);
  line-height: 1.15;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.col-name em { font-size: 22px; }
.col-list { display: flex; flex-direction: column; gap: 18px; }
.col-list li {
  display: flex; flex-direction: column; gap: 4px;
}
.col-list li span {
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.col-list li em {
  font-family: var(--italic); font-style: italic; font-weight: 400;
  font-size: 16px;
  color: var(--cream-2);
  letter-spacing: -0.005em;
}
.col-feat .col-list li em { color: var(--cream); }
.col-feat .col-list li em em,
.col-feat .col-list li em .nobreak { color: var(--coral); }
.nobreak { white-space: nowrap; }

/* ========================================================================
   QUICK START · TERMINAL
   ======================================================================== */
.section-start { border-top: 1px solid var(--rule); }

.terminal {
  background: #0A0907;
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
  max-width: 860px;
}
[data-theme="light"] .terminal {
  box-shadow: 0 30px 60px -30px rgba(26, 23, 18, 0.3);
}

.term-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #111;
  border-bottom: 1px solid #2A241C;
}
.dot-r, .dot-y, .dot-g {
  width: 11px; height: 11px; border-radius: 50%;
}
.dot-r { background: #FF5F57; }
.dot-y { background: #FEBC2E; }
.dot-g { background: #28C840; }
.term-title {
  font-family: var(--mono); font-size: 11px;
  color: #857D6B;
  margin-left: auto;
  margin-right: auto;
}
.copy-btn {
  font-family: var(--mono); font-size: 10px;
  padding: 5px 10px;
  color: #857D6B;
  border: 1px solid #2A241C;
  border-radius: 4px;
  letter-spacing: 0.14em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s var(--ease);
}
.copy-btn:hover { color: oklch(0.74 0.14 35); border-color: oklch(0.74 0.14 35); }
.copy-btn.copied { color: oklch(0.62 0.08 150); border-color: oklch(0.62 0.08 150); }

.term-body {
  font-family: var(--mono); font-size: 13px;
  padding: 24px 28px;
  color: #C8C0AE;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}
.term-cmt { color: #4E4738; }
.term-prompt { color: oklch(0.74 0.14 35); margin-right: 4px; }
.term-cmd { color: #EBE3D2; }
.term-arg { color: oklch(0.70 0.10 245); }
.term-out-dim { color: #6B6254; display: block; }
.term-pass { color: oklch(0.62 0.08 150); }
.term-wait { color: oklch(0.78 0.13 70); }
.caret {
  display: inline-block;
  color: oklch(0.74 0.14 35);
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ========================================================================
   FOOTER
   ======================================================================== */
.footer {
  border-top: 1px solid var(--rule);
  padding: 80px 0 40px;
  background: var(--canvas-2);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--rule);
}
.footer-brand {
  display: flex; gap: 16px; align-items: flex-start;
}
.mark-lg { width: 40px; height: 40px; display: block; flex-shrink: 0; }
.footer-wordmark {
  font-weight: 500; font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--cream);
  margin-bottom: 4px;
}
.footer-wordmark em { font-size: 20px; }
.footer-tag {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.5;
  max-width: 280px;
}
.footer-tag em { font-size: 14px; color: var(--coral); }

.footer-meta { display: flex; flex-direction: column; gap: 10px; }
.fm-row {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
}
.fm-row span {
  color: var(--dim);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.fm-row strong, .fm-row a {
  font-weight: 500; color: var(--cream);
  letter-spacing: 0;
}
.fm-row a:hover { color: var(--coral); }

.footer-links {
  display: flex; flex-direction: column; gap: 8px;
  align-self: start;
}
.footer-links a {
  font-size: 13px;
  color: var(--cream-2);
  padding: 4px 0;
  transition: color 0.15s var(--ease);
}
.footer-links a:hover { color: var(--coral); }

.footer-bottom {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.16em; text-transform: uppercase;
  padding-top: 32px;
}

/* ========================================================================
   REVEAL · scroll-triggered motion
   ======================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal[data-delay] { transition-delay: calc(var(--delay, 0) * 1ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ========================================================================
   MOBILE NAV — hamburger + slide-in drawer
   ======================================================================== */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 6px;
  border: 1px solid var(--rule-2);
  align-items: center; justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: var(--cream-2);
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.nav-burger:hover { border-color: var(--coral); color: var(--coral); }
.burger-line {
  width: 16px; height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
  transform-origin: center;
}
.nav-burger.is-open .burger-line:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.nav-burger.is-open .burger-line:nth-child(2) { opacity: 0; }
.nav-burger.is-open .burger-line:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.mobile-drawer {
  position: fixed; inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.32s;
}
.mobile-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}
.md-scrim {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--canvas) 70%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.mobile-drawer.is-open .md-scrim { opacity: 1; }

.md-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  background: var(--canvas);
  border-left: 1px solid var(--rule);
  display: flex; flex-direction: column;
  padding: 20px 22px 24px;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  box-shadow: -20px 0 50px -20px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
}
.mobile-drawer.is-open .md-panel { transform: translateX(0); }

.md-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}
.md-kind {
  font-family: var(--mono); font-size: 11px;
  color: var(--coral);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.md-close {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1px solid var(--rule-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--cream-2);
  transition: all 0.2s var(--ease);
}
.md-close:hover { color: var(--coral); border-color: var(--coral); }

.md-links { display: flex; flex-direction: column; flex: 1; }
.md-link {
  display: flex; align-items: baseline; gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px dashed var(--rule);
  color: var(--cream);
  transition: color 0.15s var(--ease), padding-left 0.2s var(--ease);
}
.md-link:hover, .md-link:focus-visible {
  color: var(--coral);
  padding-left: 8px;
}
.md-num {
  font-family: var(--mono); font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.18em;
  min-width: 24px;
}
.md-link:hover .md-num, .md-link:focus-visible .md-num { color: var(--coral); }
.md-label {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.md-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--rule);
  gap: 12px;
}
.md-version {
  font-family: var(--mono); font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.16em; text-transform: uppercase;
}

/* ========================================================================
   RESPONSIVE — tablet and mobile
   ======================================================================== */

/* Tablet — ≤1024px (small laptops, large tablets) */
@media (max-width: 1024px) {
  .container { padding: 0 32px; }
  .nav-inner { padding: 0 32px; }
  .nav-right { gap: 18px; }
  .hero-inner { gap: 56px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline .phase:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
}

/* Tablet portrait — ≤900px (collapse columns, show hamburger) */
@media (max-width: 900px) {
  .container { padding: 0 24px; }
  .nav-inner { padding: 0 24px; }

  /* Nav: hide desktop links, show burger */
  .nav-link { display: none; }
  .nav-github { display: none; }
  .nav-docs { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-right { gap: 10px; }

  /* Hero */
  .hero { padding: 116px 0 72px; }
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-scroll { display: none; }
  .display { font-size: clamp(38px, 9vw, 56px); margin-bottom: 28px; }
  .lede { font-size: 17px; margin-bottom: 32px; max-width: 100%; }
  .ctas { margin-bottom: 48px; }
  .hero-art-frame { aspect-ratio: 4/3; }

  /* Sections */
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 40px; }
  .section-title { font-size: clamp(30px, 5.4vw, 44px); }
  .section-lede { font-size: 16px; }

  /* Idea */
  .idea-grid { grid-template-columns: 1fr; gap: 36px; }
  .idea-copy p { max-width: 100%; }
  .idea-copy p:first-child { font-size: 20px; }
  .idea-diagram { aspect-ratio: auto; padding: 20px 16px; }

  /* Pipeline */
  .pipeline { grid-template-columns: 1fr 1fr; }
  .phase { min-height: 220px; padding: 24px 20px; }
  .phase:nth-child(-n+4) { border-bottom: 1px solid var(--rule); }

  /* Oracle / memory */
  .split-grid { grid-template-columns: 1fr; gap: 16px; }
  .split-card { padding: 26px 24px; min-height: auto; }
  .split-title { font-size: 24px; margin-bottom: 22px; }

  /* Compare */
  .compare { grid-template-columns: 1fr; }
  .col { padding: 26px 24px; }

  /* Footer */
  .footer { padding: 64px 0 32px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; padding-bottom: 36px; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 16px 20px; }
  .footer-bottom { padding-top: 24px; }
}

/* Mobile — ≤640px (phones) */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }
  .nav { padding: 12px 0; }
  .wordmark, .wordmark em { font-size: 14px; }
  .brand .mark { width: 20px; height: 20px; }

  /* Hero */
  .hero { padding: 96px 0 56px; }
  .hero-inner { gap: 36px; }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
    line-height: 1.5;
  }
  .display { font-size: clamp(34px, 10vw, 46px); margin-bottom: 22px; line-height: 1.05; }
  .lede { font-size: 16px; line-height: 1.55; margin-bottom: 28px; }

  /* CTAs — stack full-width */
  .ctas {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 40px;
  }
  .btn { padding: 13px 18px; font-size: 14px; justify-content: center; }
  .btn-primary, .btn-secondary { width: 100%; }

  .hero-meta {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 16px;
    padding-top: 20px;
    max-width: 100%;
  }
  .hero-meta dd { font-size: 18px; }
  .fc-title-lg { font-size: 18px; }

  /* Sections */
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 32px; }
  .section-num {
    font-size: 10px;
    letter-spacing: 0.18em;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
  }
  .section-kind::before { margin-right: 8px; }
  .section-title { font-size: clamp(28px, 6.8vw, 36px); margin-bottom: 16px; }
  .section-lede { font-size: 15px; }

  /* Idea diagram — make SVG render fully (it has its own viewBox) */
  .idea-copy p { font-size: 16px; }
  .idea-copy p:first-child { font-size: 18px; }
  .idea-diagram { padding: 18px 12px; }

  /* Handoff — center the engine on mobile */
  .handoff-grid { gap: 14px; }
  .handoff-col { padding: 22px 20px 26px; min-height: auto; }
  .hc-name { font-size: 16px; }
  .hc-note { font-size: 13px; }
  .handoff-engine { padding: 18px 0; min-height: 80px; }

  /* Pipeline — single column on phones */
  .pipeline { grid-template-columns: 1fr; }
  .phase { min-height: auto; padding: 22px 20px; }
  .phase:not(:last-child) { border-bottom: 1px solid var(--rule); }
  .phase-name { font-size: 22px; }

  .pipeline-note {
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
  }

  /* Oracle / memory */
  .split-card { padding: 22px 20px; }
  .split-title { font-size: 22px; margin-bottom: 18px; }
  .oracle-checks li {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 10px 12px;
  }
  .check-tier {
    grid-column: 1 / -1;
    font-size: 8.5px;
    margin-bottom: 2px;
  }
  .check-name { font-size: 13px; grid-column: 1; }
  .check-state { grid-column: 2; grid-row: 2; }

  .memory-stream { gap: 8px; min-height: 0; }
  .mem-line {
    grid-template-columns: 50px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 10px 12px;
  }
  .mem-stamp { grid-column: 1; grid-row: 1; font-size: 9.5px; }
  .mem-kind {
    grid-column: 2; grid-row: 1;
    justify-self: start;
    font-size: 8.5px;
    padding: 2px 6px;
  }
  .mem-text {
    grid-column: 1 / -1; grid-row: 2;
    font-size: 12.5px;
    line-height: 1.45;
  }
  .mem-text em { font-size: 12.5px; }

  /* Team diagram — let it scroll horizontally with hint */
  .team-diagram {
    margin: 28px -20px 14px;
    padding: 20px 16px;
    border-left: none;
    border-right: none;
    border-radius: 0;
    -webkit-overflow-scrolling: touch;
  }
  .team-svg { min-width: 640px; }
  .section-subhead { margin: 40px 0 20px; padding-top: 24px; }
  .section-subtitle { font-size: 22px; }
  .section-sublede { font-size: 14px; }

  /* Tmux stage — drop min-height, single col, smaller text */
  .tmux-stage { font-size: 10.5px; line-height: 1.5; }
  .tmux-split {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: none;
  }
  .tmux-pane + .tmux-pane { border-left: none; border-top: 1px solid #2A2A2A; }
  .tmux-lead .pane-body { max-height: 320px; }
  .agent-box { min-height: 110px; }
  .agent-box.agent-active { flex: none; min-height: 160px; }
  .agent-box.agent-idle { flex: none; min-height: 70px; }
  .pane-body, .agent-body { padding: 8px 12px; }
  .pane-chat { padding: 8px 12px 10px; }
  .ph-meta { display: none; }
  .pane-head { padding: 5px 10px; font-size: 10px; }
  /* Window bar — keep only first few tabs */
  .tmux-winbar { font-size: 9.5px; padding: 0 6px; min-height: 24px; }
  .tmux-winbar .wb-tab:nth-child(n+4) { display: none; }
  .tmux-winbar .wb-host { font-size: 9.5px; padding: 4px 6px; }
  .tmux-status { font-size: 9.5px; padding: 3px 8px; }
  .tmux-status .ts-dim { display: none; }
  .tmux-caption { font-size: 14px; margin-top: 18px; }
  .tmux-caption em { font-size: 14px; }

  /* Compare */
  .col { padding: 24px 22px; gap: 16px; }
  .col-name, .col-name em { font-size: 20px; }
  .col-list li em { font-size: 15px; }

  /* Quick start terminal */
  .terminal { border-radius: 8px; }
  .term-body {
    font-size: 11.5px;
    padding: 18px 16px;
    line-height: 1.7;
  }
  .term-title { font-size: 10px; }
  .copy-btn { font-size: 9px; padding: 4px 8px; }

  /* Footer */
  .footer-inner { gap: 28px; padding-bottom: 28px; }
  .footer-brand { gap: 14px; }
  .mark-lg { width: 36px; height: 36px; }
  .footer-wordmark, .footer-wordmark em { font-size: 18px; }
  .footer-tag, .footer-tag em { font-size: 13px; }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    font-size: 9.5px;
    letter-spacing: 0.12em;
  }
}

/* Small mobile — ≤400px (tight phones) */
@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 16px; }
  .display { font-size: 30px; letter-spacing: -0.02em; }
  .lede { font-size: 15px; }
  .section-title { font-size: 26px; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 14px; }
  .hero-meta dd { font-size: 17px; }
  .col-name, .col-name em { font-size: 18px; }
  .term-body { font-size: 10.5px; padding: 14px 12px; }
  .team-diagram { margin-left: -16px; margin-right: -16px; padding: 16px 14px; }
}

/* Touch hints — make scrollable areas more obvious on touch */
@media (hover: none) and (pointer: coarse) {
  .team-diagram::after,
  .term-body::after { display: none; } /* placeholder, no-op */
  /* Make tap targets in nav comfy */
  .md-link { padding: 18px 4px; }
  .btn { min-height: 44px; }
  .theme-toggle, .nav-burger, .md-close { min-width: 40px; min-height: 40px; }
}
