/* ThinRouter — marketing site. Same brand system as the app:
   Archivo + JetBrains Mono, one accent for routing/emphasis, a 5-step
   semantic ramp, flat (no gradients/glow). Light by default (dark available),
   airier than the app. */

:root {
  --font-heading: 'Archivo', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --maxw: 1120px;
}

html[data-theme="dark"] {
  --bg: #0c0c0e;
  --surface: #141417;
  --surface-2: #1c1c21;
  --surface-3: #232329;
  --text: #ececee;
  --text-dim: #96969c;
  --text-faint: #63636a;
  --divider: color-mix(in srgb, #ececee 12%, transparent);
  --divider-strong: color-mix(in srgb, #ececee 22%, transparent);
  --accent: #ec3013;
  --accent-soft: color-mix(in srgb, #ec3013 16%, transparent);
  --warn: #e6a90a;
  --danger: #ff4436;
  --sem-1: #2c6b68; --sem-2: #1f9184; --sem-3: #16b39a; --sem-4: #3ad6b2; --sem-5: #7bf0d6;
  --window-shadow: 0 24px 60px -30px rgba(0,0,0,.6);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --surface-2: #f0f0f2;
  --surface-3: #e7e7ea;
  --text: #1b1b1e;
  --text-dim: #63636a;
  --text-faint: #9a9aa1;
  --divider: color-mix(in srgb, #1b1b1e 12%, transparent);
  --divider-strong: color-mix(in srgb, #1b1b1e 26%, transparent);
  --accent: #ec3013;
  --accent-soft: color-mix(in srgb, #ec3013 12%, transparent);
  --warn: #a37200;
  --danger: #c62717;
  --sem-1: #255d5a; --sem-2: #12756a; --sem-3: #0a9079; --sem-4: #1ab293; --sem-5: #3fd0af;
  --window-shadow: 0 18px 44px -28px rgba(20,20,25,.28);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── kickers / headings ─────────────────────────────── */
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
.lead { color: var(--text-dim); font-size: clamp(16px, 1.6vw, 19px); }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ── wordmark ───────────────────────────────────────── */
.wordmark { display: inline-flex; align-items: baseline; font-family: var(--font-heading); letter-spacing: -0.02em; }
.wm-thin { font-weight: 300; }
.wm-slash { color: var(--accent); font-weight: 400; padding: 0 1px; }
.wm-router { font-weight: 800; }

/* ── nav ────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--divider);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.brand svg { display: block; color: var(--text); }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { font-size: 14px; color: var(--text-dim); }
.nav-links a:hover { color: var(--text); }
.nav-links .ghost { font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--divider-strong); padding: 6px 12px; color: var(--text); }
.nav-links .ghost:hover { border-color: var(--accent); }
.theme-btn { cursor: pointer; background: transparent; border: 1px solid var(--divider-strong); color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; padding: 6px 10px; }
.theme-btn:hover { color: var(--text); }

/* ── buttons ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--font-heading); font-weight: 800; font-size: 15px; padding: 12px 20px; border: 0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--divider-strong); }
.btn-ghost:hover { border-color: var(--accent); }

/* ── sections ───────────────────────────────────────── */
section { padding: 88px 0; border-top: 1px solid var(--divider); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head .kicker { display: block; margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 17px; margin: 14px 0 0; }

/* ── hero ───────────────────────────────────────────── */
.hero { border-top: 0; padding: 72px 0 64px; text-align: left; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 900; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { max-width: 60ch; margin: 22px 0 0; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 32px 0 18px; }
.hero-chip { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); background: var(--surface); border: 1px solid var(--divider); padding: 8px 12px; }
.hero-chip b { color: var(--text); font-weight: 500; }
.tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sem-3); margin-bottom: 18px; }

/* window frame around screenshots */
.window { margin-top: 44px; border: 1px solid var(--divider-strong); background: var(--surface); box-shadow: var(--window-shadow); }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--divider); background: var(--surface-2); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--divider-strong); display: block; }
.window-bar .url { margin-left: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.window img { display: block; width: 100%; }

/* ── stats row ──────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--divider); border: 1px solid var(--divider); }
.stat { background: var(--bg); padding: 26px 24px; }
.stat .n { font-family: var(--font-heading); font-weight: 900; font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.03em; }
.stat .n.accent { color: var(--accent); }
.stat .l { color: var(--text-dim); font-size: 14px; margin-top: 6px; }

/* ── feature cards ──────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--divider); border-top: 2px solid var(--divider-strong); padding: 26px 24px; }
.card .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.card h3 { margin: 10px 0 8px; }
.card p { color: var(--text-dim); font-size: 15px; margin: 0; }
.card .ramp { display: flex; gap: 4px; margin-top: 16px; }
.card .ramp span { height: 6px; flex: 1; }

/* ── pipeline ───────────────────────────────────────── */
.pipeline { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 8px; }
.stage { background: var(--surface); border: 1px solid var(--divider); padding: 22px 20px; position: relative; }
.stage .s-num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.stage h3 { font-size: 17px; margin: 8px 0; }
.stage p { color: var(--text-dim); font-size: 14px; margin: 0; }
.stage.local { border-left: 2px solid var(--sem-1); }
.stage.cloud { border-left: 2px solid var(--accent); }

/* ── split layout ───────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.split .prose h2 { margin-bottom: 16px; }
.split .prose p { color: var(--text-dim); }
.split ul { list-style: none; padding: 0; margin: 18px 0 0; }
.split li { display: flex; gap: 10px; padding: 7px 0; font-size: 15px; color: var(--text); }
.split li::before { content: "→"; color: var(--accent); font-family: var(--font-mono); }

/* ── code block ─────────────────────────────────────── */
.code { position: relative; background: var(--surface); border: 1px solid var(--divider); }
.code pre { margin: 0; padding: 18px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: var(--text); }
.code .c { color: var(--text-faint); }
.code .k { color: var(--sem-3); }
.code .copy { position: absolute; top: 10px; right: 10px; cursor: pointer; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--divider); padding: 4px 8px; }
.code .copy:hover { color: var(--text); }

/* ── terminal quick-start (self-contained dark graphic) ─ */
.term {
  --t-bg: #16171c;
  --t-bar: #1e1f26;
  --t-border: #2b2d36;
  --t-grid: rgba(255,255,255,.028);
  --t-text: #e7e8eb;
  --t-dim: #7c7f89;
  --t-prompt: var(--accent);
  --t-ok: #35c76a;
  --t-url: #cfd0d4;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--t-bg);
  box-shadow: var(--window-shadow);
  font-family: var(--font-mono);
}
.term-bar {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: var(--t-bar);
  border-bottom: 1px solid var(--t-border);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-title {
  position: absolute; left: 0; right: 0;
  text-align: center; font-size: 12px; color: var(--t-dim);
  pointer-events: none;
}
.term-body {
  padding: 20px 22px 24px;
  font-size: 13.5px; line-height: 1.95; color: var(--t-text);
  overflow-x: auto;
  background:
    linear-gradient(var(--t-grid) 1px, transparent 1px) 0 0 / 100% 27px,
    linear-gradient(90deg, var(--t-grid) 1px, transparent 1px) 0 0 / 27px 100%;
}
.t-line { white-space: pre; }
.t-gap { height: 0.7em; }
.t-p { color: var(--t-prompt); font-weight: 700; margin-right: 9px; }
.t-a { color: var(--t-prompt); margin-right: 8px; }
.t-ok { color: var(--t-ok); font-weight: 700; }
.t-d { color: var(--t-dim); }
.t-u { color: var(--t-url); }

/* ── complexity buckets (the routing axis) ───────────── */
.buckets .kicker { display: block; margin-bottom: 14px; }
.bucket-bar {
  display: flex; overflow: hidden;
  border: 1px solid var(--divider);
  font-family: var(--font-mono);
}
.bkt {
  padding: 16px 12px; text-align: center;
  font-size: 13px; white-space: nowrap; font-weight: 500;
}
.bkt.b1 { background: var(--sem-1); color: #eafcf8; }
.bkt.b2 { background: var(--sem-2); color: #eafcf8; }
.bkt.b3 { background: var(--sem-3); color: #052420; }
.bkt.b4 { background: var(--sem-4); color: #052420; }
.bucket-marks {
  position: relative; height: 20px; margin-top: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}
.bucket-marks .mark { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bucket-marks .mark b { color: var(--accent); font-weight: 400; }
.buckets .cap { color: var(--text-dim); font-size: 15px; margin: 24px 0 0; max-width: 72ch; }
.buckets .cap b { color: var(--text); font-weight: 600; }

/* ── local runtime card ──────────────────────────────── */
.runtime {
  margin-top: 26px; max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-top: 2px solid var(--sem-2);
  padding: 20px 20px 18px;
  font-family: var(--font-mono);
}
.rt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rt-title { font-family: var(--font-heading); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.rt-title span { font-weight: 400; color: var(--text-dim); }
.rt-sub { font-size: 11px; letter-spacing: 0.1em; color: var(--text-faint); margin-top: 4px; }
.rt-status { font-size: 12px; color: var(--sem-2); white-space: nowrap; }
.rt-status::before, .rt-foot::before { content: "● "; }
.rt-models { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.rt-models span { font-size: 11.5px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--divider); padding: 3px 7px; }
.rt-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-pills span { font-size: 12px; color: var(--sem-2); border: 1px solid color-mix(in srgb, var(--sem-2) 45%, transparent); padding: 5px 10px; }
.rt-url { margin-top: 16px; }
.rt-label { font-size: 11px; color: var(--text-faint); letter-spacing: 0.08em; margin-bottom: 6px; }
.rt-url code { display: block; background: var(--surface-2); border: 1px solid var(--divider); padding: 9px 11px; font-size: 12.5px; color: var(--text); }
.rt-foot { margin-top: 14px; font-size: 12px; color: var(--sem-2); }

/* ── faq ─────────────────────────────────────────────── */
.faq { margin-top: 8px; }
.faq-item { padding: 22px 0; border-bottom: 1px solid var(--divider); }
.faq-item:first-child { border-top: 1px solid var(--divider); }
.faq-item h3 { font-size: 18px; margin-bottom: 10px; }
.faq-item p { color: var(--text-dim); font-size: 15.5px; margin: 0; max-width: 80ch; }
.faq-item p .mono { color: var(--text); }

/* ── gallery ────────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gallery figure { margin: 0; }
.gallery figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-top: 10px; }

/* ── compare table ──────────────────────────────────── */
.compare { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--divider); }
.compare thead th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.compare tbody th { font-weight: 500; color: var(--text); width: 40%; }
.compare .yes { color: var(--sem-3); }
.compare .yes::before { content: "✓"; margin-right: 9px; font-weight: 700; }
.compare .no { color: var(--text-faint); }
.compare .them { color: var(--text-dim); }
.compare-note { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); margin: 20px 0 0; }

/* ── CTA band ───────────────────────────────────────── */
.cta { text-align: center; }
.cta h2 { max-width: 20ch; margin: 0 auto 16px; }
.cta .lead { max-width: 56ch; margin: 0 auto 28px; }
.cta .hero-cta { justify-content: center; }

/* ── footer ─────────────────────────────────────────── */
footer { border-top: 1px solid var(--divider); padding: 48px 0 60px; }
.foot { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot .brand { font-size: 16px; }
.foot p { color: var(--text-faint); font-size: 13px; margin: 12px 0 0; max-width: 42ch; }
.foot-links { display: flex; gap: 40px; }
.foot-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px; font-weight: 400; }
.foot-col a { display: block; font-size: 14px; color: var(--text-dim); padding: 4px 0; }
.foot-col a:hover { color: var(--text); }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--divider); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* ── reveal on scroll ───────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-links a:not(.ghost) { display: none; }
  .cards, .pipeline, .split, .gallery, .stats { grid-template-columns: 1fr; }
  .stats { border: 1px solid var(--divider); }
  .split { gap: 28px; }
  section { padding: 64px 0; }
}
