/* Nightwatch site: Midnight + lamp. No external fonts or CDNs. */
:root {
  --ink: #0a0f1e;
  --ink-2: #0c1324;
  --well: #0e1528;
  --panel: #111a30;
  --panel-2: #18233f;
  --line: #222d4a;
  --line-soft: #1a2440;
  --line-strong: #2e3b5e;
  --text: #eef1f8;
  --text-2: #c9d2e6;
  --muted: #a3aec6;
  --dim: #8692ad;
  --log: #6f7b97;
  --lamp: #f5b547;
  --lamp-hover: #ffc965;
  --lamp-ink: #1a1204;
  --auto: #6ee7b7;
  --auto-ink: #052e22;
  --never: #fb7185;
  --never-ink: #3b0a14;
  --ask-ink: #2a1a00;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--lamp); text-decoration: none; }
a:hover { color: #ffd58a; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
code, pre, kbd { font-family: var(--font-mono); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--lamp); color: var(--lamp-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

/* ---------- Type ---------- */
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); }
.h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(44px, 7vw, 72px); line-height: 1.02; letter-spacing: -.03em; }
.h1 .lamp { color: var(--lamp); }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 4.4vw, 44px); line-height: 1.1; letter-spacing: -.02em; max-width: 820px; }
.lede { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; color: var(--dim); }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 10px; font: 600 15px var(--font-sans); border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--lamp); color: var(--lamp-ink); }
.btn-primary:hover { background: var(--lamp-hover); color: var(--lamp-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--lamp); color: var(--text); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.link-arrow { font-weight: 600; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; font: 500 11px var(--font-mono); letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-auto { background: var(--auto); color: var(--auto-ink); }
.pill-ask { background: var(--lamp); color: var(--ask-ink); }
.pill-never { background: var(--never); color: var(--never-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--auto); display: inline-block; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 12px var(--font-mono); color: var(--auto); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10, 15, 30, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand-tag { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 10px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 16px; }
.nav-cta .gh { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-cta .gh:hover { color: var(--text); }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; width: 44px; height: 44px; color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }
@media (max-width: 900px) {
  .nav { flex-wrap: wrap; min-height: 64px; padding: 10px 0; }
  .nav-toggle { display: inline-flex; }
  .nav-links, .nav-cta { display: none; width: 100%; }
  .nav.open .nav-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 0; }
  .nav.open .nav-links a { padding: 10px 0; font-size: 16px; }
  .nav.open .nav-cta { display: flex; padding-bottom: 12px; }
}

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-alt { background: var(--ink-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 96px 0; }
.section-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 48px; }
.split { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.split > * { flex: 1 1 460px; min-width: 0; }
.split-top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 28px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 640px) { .section { padding: 72px 0; } .section-alt { padding: 64px 0; } .split > * { flex-basis: 100%; } }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 28px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 14px; font-weight: 600; }
.card-meta { font: 12px var(--font-mono); color: var(--dim); }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.grid-feat { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px 40px; }
.feature { display: flex; flex-direction: column; gap: 6px; }
.feature strong { font-size: 16px; }
.feature span { font-size: 14px; color: var(--muted); }
.pain { display: flex; flex-direction: column; gap: 12px; }
.pain svg { width: 28px; height: 28px; color: var(--lamp); }
.pain h3 { font-size: 19px; font-weight: 600; }
.pain p { color: var(--muted); font-size: 15px; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.step-n { font: 13px var(--font-mono); color: var(--lamp); }
.step p { font-size: 15px; color: var(--text-2); }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; flex: 1 1 520px; }
.hero-visual { flex: 1 1 460px; }
.hero-card { overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.loglines { padding: 18px 20px; font: 12.5px/1.9 var(--font-mono); color: var(--log); overflow-x: auto; }
.loglines div { white-space: pre; }
.loglines .warn { color: var(--lamp); }
.loglines .err { color: var(--never); }
.loglines .root { background: rgba(245, 181, 71, .1); margin: 0 -20px; padding: 0 20px; }
.decision { padding: 18px 20px 22px; border-top: 1px dashed #2a3658; display: flex; flex-direction: column; gap: 14px; }
.decision-call { font: 16px var(--font-mono); color: var(--text); word-break: break-word; }
.decision-call .arg { color: var(--lamp); }

/* ---------- Proof strip ---------- */
.proof { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--ink-2); }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.proof-item { padding: 32px 24px 32px 0; display: flex; flex-direction: column; gap: 6px; }
.proof-num { font-family: var(--font-display); font-size: 40px; font-weight: 600; }
.proof-num.lamp { color: var(--lamp); }
.proof-item span:last-child { font-size: 14px; color: var(--muted); }

/* ---------- Demo ---------- */
.demo-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.demo-tab { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 10px; font: 600 14px var(--font-sans); cursor: pointer; background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); }
.demo-tab:hover { border-color: var(--muted); }
.demo-tab[aria-selected="true"] { background: var(--panel-2); color: var(--text); border-color: var(--lamp); }
.demo-tab .t { font: 12px var(--font-mono); color: var(--dim); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 20px; }
.demo-log { overflow: hidden; display: flex; flex-direction: column; }
.demo-lines { padding: 14px 0; font: 12.5px/1.85 var(--font-mono); overflow-x: auto; }
.demo-lines div { padding: 1px 20px; white-space: pre; color: var(--log); }
.demo-lines .warn { color: var(--lamp); }
.demo-lines .err { color: var(--never); }
.demo-lines .root { background: rgba(245, 181, 71, .12); }
.demo-foot { margin-top: auto; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.demo-side { display: flex; flex-direction: column; gap: 20px; }
.checks { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.checks svg { width: 16px; height: 16px; margin-top: 3px; flex: none; color: var(--auto); }
.outcome { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.outcome-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.sms { border-radius: 12px; background: var(--ink); border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.sms-meta { font: 11px var(--font-mono); color: var(--dim); }
.sms-text { font: 13px/1.6 var(--font-mono); color: var(--text); }
[hidden] { display: none !important; }

/* ---------- Code ---------- */
.code-card { overflow: hidden; }
.code { margin: 0; padding: 20px 22px; font: 13px/1.75 var(--font-mono); color: var(--text-2); white-space: pre; overflow-x: auto; }
.code .c { color: var(--log); }
.code .k { color: var(--lamp); }
.code .g { color: var(--auto); }
.code .r { color: var(--never); }
.code .p { color: var(--dim); }
.copy { font: 600 12px var(--font-sans); color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; min-height: 32px; padding: 0 10px; cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--muted); }
.dots { display: flex; gap: 8px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }

/* ---------- Lanes ---------- */
.lane { padding: 20px 22px; display: flex; gap: 16px; align-items: flex-start; }
.lane .pill { flex: none; }
.lane div { display: flex; flex-direction: column; gap: 4px; }
.lane strong { font-size: 16px; }
.lane span.d { font-size: 14px; color: var(--muted); }

/* ---------- Phone ---------- */
.phone-wrap { display: flex; justify-content: center; }
.phone { width: 340px; max-width: 100%; border-radius: 40px; border: 1px solid var(--line-strong); background: var(--well); padding: 22px 18px 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.phone-notch { align-self: center; width: 96px; height: 6px; border-radius: 3px; background: var(--line); }
.phone-time { font-size: 12px; color: var(--dim); text-align: center; }
.bubble { max-width: 88%; border-radius: 18px 18px 18px 6px; padding: 12px 14px; font-size: 14px; line-height: 1.5; background: #1a2440; align-self: flex-start; }
.bubble.me { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--lamp); color: var(--lamp-ink); font-weight: 600; }
.bubble .code-num { font-family: var(--font-mono); color: var(--lamp); font-weight: 600; }
.call { margin-top: 8px; border-radius: 18px; border: 1px solid var(--line-strong); padding: 16px; display: flex; align-items: center; gap: 14px; }
.call-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(251, 113, 133, .16); display: flex; align-items: center; justify-content: center; flex: none; color: var(--never); }
.call-icon svg { width: 20px; height: 20px; }
.call div { display: flex; flex-direction: column; gap: 2px; }
.call strong { font-size: 14px; }
.call span { font-size: 13px; color: var(--muted); }

/* ---------- Report ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-bottom: 1px solid var(--line); }
.kpi { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-family: var(--font-display); font-size: 32px; font-weight: 600; }
.kpi .auto { color: var(--auto); } .kpi .ask { color: var(--lamp); } .kpi .never { color: var(--never); }
.report-body { display: flex; flex-wrap: wrap; }
.report-chart { flex: 1 1 460px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.report-sql { flex: 1 1 400px; min-width: 0; padding: 24px; border-left: 1px solid var(--line); background: var(--ink); display: flex; flex-direction: column; gap: 12px; }
.report-sql .code { padding: 0; }
@media (max-width: 900px) { .report-sql { border-left: 0; border-top: 1px solid var(--line); } }
.bar { display: grid; grid-template-columns: 150px 1fr 36px; gap: 12px; align-items: center; }
.bar-name { font: 12.5px var(--font-mono); color: var(--text-2); }
.bar-track { height: 10px; border-radius: 5px; background: var(--panel-2); }
.bar-fill { height: 10px; border-radius: 5px; background: var(--auto); width: 0; transition: width .6s ease; }
.bar-fill.ask { background: var(--lamp); } .bar-fill.never { background: var(--never); }
.bar-n { font: 12.5px var(--font-mono); color: var(--muted); text-align: right; }
.verified { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: var(--auto); }
.verified svg { width: 16px; height: 16px; }

/* ---------- Models ---------- */
.model { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.model-top { display: flex; justify-content: space-between; align-items: baseline; }
.model-top strong { font-size: 17px; }
.model-score { font-family: var(--font-display); font-size: 36px; font-weight: 600; }
.model-meta { display: flex; justify-content: space-between; font: 13px var(--font-mono); color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.model.featured { border-color: var(--lamp); }
.model.featured .model-score, .model.featured .tag { color: var(--lamp); }

/* ---------- Bands & footer ---------- */
.band { border-radius: 24px; border: 1px solid #3a3220; background: #15140f; padding: 48px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.band .h2 { font-size: clamp(28px, 3.4vw, 36px); }
.band p { color: #c9c2ae; font-size: 16px; }
.band-copy { flex: 1 1 520px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 640px) { .band { padding: 28px; } }
.site-footer { border-top: 1px solid var(--line-soft); padding: 56px 0 40px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; }
.footer-brand { display: flex; flex-direction: column; gap: 14px; max-width: 320px; }
.footer-brand .brand img { width: 26px; height: 26px; }
.footer-brand .brand-name { font-size: 18px; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.footer-col a { color: var(--muted); font-size: 14px; }
.footer-col a:hover { color: var(--text); }
.footer-legal { margin-top: 40px; font-size: 13px; color: var(--dim); }

/* ---------- Docs ---------- */
.docs-wrap { max-width: 1360px; margin: 0 auto; padding: 0 28px; display: flex; flex-wrap: wrap; gap: 48px; }
.docs-search { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--well); color: var(--dim); }
.docs-search svg { width: 16px; height: 16px; flex: none; }
.docs-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: 14px var(--font-sans); }
.docs-search kbd { font-size: 12px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.docs-nav { flex: 1 1 240px; max-width: 260px; padding: 32px 0; display: flex; flex-direction: column; gap: 24px; }
.docs-nav-group { display: flex; flex-direction: column; gap: 2px; }
.docs-nav-group h4 { margin: 0; font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 0 12px 8px; }
.docs-nav a { display: block; color: var(--muted); font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.docs-nav a:hover { color: var(--text); background: var(--panel); }
.docs-nav a[aria-current="page"] { color: var(--text); background: var(--panel); font-weight: 600; }
.doc { flex: 999 1 560px; min-width: 0; max-width: 760px; padding: 40px 0 80px; display: flex; flex-direction: column; gap: 36px; }
.doc-head { display: flex; flex-direction: column; gap: 14px; }
.crumbs { font-size: 13px; color: var(--dim); }
.doc h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 44px); font-weight: 600; letter-spacing: -.02em; }
.doc h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.doc h3 { font-size: 17px; font-weight: 600; }
.doc p, .doc li { color: var(--text-2); font-size: 16px; line-height: 1.7; }
.doc ul, .doc ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc section { display: flex; flex-direction: column; gap: 14px; }
.doc .lede { font-size: 18px; }
.doc .code-card .code { padding: 16px 18px; }
.ic { font-family: var(--font-mono); font-size: .875em; color: var(--text); background: var(--panel-2); border-radius: 6px; padding: 2px 6px; }
.n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--lamp); color: var(--lamp); font: 500 13px var(--font-mono); flex: none; }
.callout { border-radius: 14px; padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; background: #15140f; border: 1px solid #3a3220; }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--lamp); }
.callout p { font-size: 15px; color: #e5dcc4; }
.callout.info { background: var(--panel); border-color: var(--line); }
.callout.info p { color: var(--text-2); }
.reqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; font-size: 14px; color: var(--text-2); }
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.next-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.next-card:hover { border-color: var(--lamp); color: var(--text); }
.next-card span { font-size: 14px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; flex-wrap: wrap; }
.pager a { display: flex; flex-direction: column; gap: 2px; }
.pager a.next { text-align: right; margin-left: auto; }
.pager small { font-size: 12px; color: var(--dim); }
.pager span { font-weight: 600; }
.toc { flex: 1 1 200px; max-width: 220px; padding: 48px 0; display: flex; flex-direction: column; gap: 10px; align-self: flex-start; position: sticky; top: 72px; }
.toc h4 { margin: 0; font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.toc a { color: var(--muted); font-size: 13px; }
.toc a:hover { color: var(--text); }
@media (max-width: 1100px) { .toc { display: none; } }
@media (max-width: 760px) { .docs-nav { max-width: none; flex-basis: 100%; padding: 20px 0 0; border-bottom: 1px solid var(--line); padding-bottom: 20px; } .docs-wrap { padding: 0 20px; gap: 0; } }
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--text); background: var(--panel); }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }

/* ---------- Policy builder ---------- */
.builder { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.builder-main { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.builder-yaml { flex: 1 1 320px; min-width: 0; background: var(--well); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tool-row { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tool-row:last-of-type { border-bottom: 0; }
.tool-info { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tool-info code { font-size: 14px; color: var(--text); }
.tool-info span { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { min-height: 36px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 7px; font: 600 12px var(--font-sans); letter-spacing: .04em; cursor: pointer; background: transparent; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"][data-lane="auto"] { background: var(--auto); color: var(--auto-ink); }
.seg button[aria-pressed="true"][data-lane="ask"] { background: var(--lamp); color: var(--ask-ink); }
.seg button[aria-pressed="true"][data-lane="never"] { background: var(--never); color: var(--never-ink); }
.seg.wide button { min-width: 0; padding: 0 14px; font-size: 13px; letter-spacing: 0; }
.seg.wide button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--lamp); }
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; border: 0; cursor: pointer; flex: none; background: var(--line-strong); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); transition: left .15s; }
.switch[aria-pressed="true"] { background: var(--lamp); }
.switch[aria-pressed="true"]::after { left: 23px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.setting div { display: flex; flex-direction: column; gap: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 13px var(--font-mono); color: #fde2e7; background: rgba(251, 113, 133, .14); border: 1px solid rgba(251, 113, 133, .35); border-radius: 8px; padding: 5px 10px; }

/* ---------- Utilities (no inline styles: CSP style-src 'self') ---------- */
.plain-list { list-style: none; margin: 0; padding: 0; }
.flush { margin: 0; }
.split-rev { flex-wrap: wrap-reverse; }
.grid-feat-sm { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.clip { overflow: hidden; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.note { margin-top: 24px; }
.flush-top { padding-top: 0; }
.spread { justify-content: space-between; }
.gap-8 { gap: 8px; }
.console-shot { margin: 0; }
.console-shot img { width: 100%; height: auto; display: block; }

/* ---------- Blog & Technical Articles ---------- */
.blog-hero { padding: 72px 0 36px; border-bottom: 1px solid var(--line-soft); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 28px; }
.blog-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); transition: border-color .15s, transform .15s; }
.blog-card:hover { border-color: var(--lamp); color: var(--text); transform: translateY(-2px); }
.blog-card h2, .blog-card h3 { font-family: var(--font-display); font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.blog-card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.blog-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font: 12px var(--font-mono); color: var(--dim); }
.blog-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.blog-tag { font: 11px var(--font-mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; }

.article-wrap { max-width: 860px; margin: 0 auto; padding: 48px 32px 96px; display: flex; flex-direction: column; gap: 36px; }
@media (max-width: 640px) { .article-wrap { padding: 32px 20px 72px; } }
.article-head { display: flex; flex-direction: column; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.article-head h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 46px); line-height: 1.08; letter-spacing: -.02em; }
.article-section { display: flex; flex-direction: column; gap: 14px; }
.article-section h2 { font-family: var(--font-display); font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.article-section h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-top: 6px; }
.article-section p, .article-section li { color: var(--text-2); font-size: 16px; line-height: 1.72; }
.article-section ul, .article-section ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-card strong { font-family: var(--font-display); font-size: 28px; color: var(--text); line-height: 1.1; }
.stat-card strong.lamp { color: var(--lamp); }
.stat-card strong.auto { color: var(--auto); }
.stat-card span { font-size: 13px; color: var(--muted); }

.arch-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.arch-node { background: var(--well); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.arch-node .step-n { font: 600 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lamp); }
.arch-node strong { font-size: 15px; color: var(--text); }
.arch-node span { font-size: 13px; color: var(--muted); line-height: 1.5; }

.compare-list { display: flex; flex-direction: column; gap: 14px; }
.compare-item { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--well); border: 1px solid var(--line-soft); }
.compare-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.compare-name { font: 600 14px var(--font-mono); color: var(--text); }
.compare-nums { font: 13px var(--font-mono); color: var(--muted); }
.score-meter { width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--panel-2); appearance: none; -webkit-appearance: none; overflow: hidden; }
.score-meter::-webkit-progress-bar { background: var(--panel-2); border-radius: 999px; }
.score-meter::-webkit-progress-value { background: var(--auto); border-radius: 999px; }
.score-meter::-moz-progress-bar { background: var(--auto); border-radius: 999px; }
.score-meter.base::-webkit-progress-value { background: var(--dim); }
.score-meter.base::-moz-progress-bar { background: var(--dim); }
.score-meter.ref::-webkit-progress-value { background: var(--lamp); }
.score-meter.ref::-moz-progress-bar { background: var(--lamp); }

tr.row-win td { background: rgba(110, 231, 183, .06); color: var(--text); font-weight: 500; }
.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.partner-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.partner-card h3 { margin: 0; font-family: var(--font-display); font-size: 19px; }
.partner-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ---------- Landing v2: visuals ---------- */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.note-link { display: inline-block; margin-top: 28px; }
.subhead { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 64px 0 20px; }
.ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(245, 181, 71, .12); color: var(--lamp); display: flex; align-items: center; justify-content: center; flex: none; }
.ico svg { width: 22px; height: 22px; }

/* Before / after night */
.vs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; }
.vs-card { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.vs-card.good { border-color: rgba(110, 231, 183, .45); box-shadow: 0 0 0 1px rgba(110, 231, 183, .12), 0 30px 80px rgba(0, 0, 0, .35); }
.vs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vs-head h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { position: relative; display: grid; grid-template-columns: 72px 12px 1fr; gap: 14px; align-items: start; padding-bottom: 18px; }
.tl li:last-child { padding-bottom: 0; }
.tl li:not(:last-child)::before { content: ""; position: absolute; left: 91px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl time { font: 12.5px var(--font-mono); color: var(--dim); padding-top: 2px; }
.tl .pt { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--line-strong); }
.tl .pt.bad { background: var(--never); }
.tl .pt.warn { background: var(--lamp); }
.tl .pt.ok { background: var(--auto); }
.tl p { font-size: 15px; color: var(--text-2); }
.vs-result { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-top: auto; }
.vs-result strong { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1; }
.vs-result.bad strong { color: var(--never); }
.vs-result.ok strong { color: var(--auto); }
.vs-result span { color: var(--muted); font-size: 15px; }

/* How it works flow */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.flow li { position: relative; padding: 24px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.flow strong { font-size: 17px; }
.flow p { font-size: 15px; color: var(--muted); }
@media (min-width: 1040px) {
  .flow li:not(:last-child)::after { content: ""; position: absolute; right: -15px; top: 44px; width: 10px; height: 10px; border-top: 2px solid var(--lamp); border-right: 2px solid var(--lamp); transform: rotate(45deg); z-index: 1; }
}
.lanes3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lane3 { padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--auto); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.lane3.ask { border-top-color: var(--lamp); }
.lane3.never { border-top-color: var(--never); }
.lane3 strong { font-size: 17px; }
.lane3 p { font-size: 15px; color: var(--muted); }

/* Why tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.tile { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.tile h3 { font-size: 18px; font-weight: 600; }
.tile p { font-size: 15px; color: var(--muted); }
.tile .fact { margin-top: auto; padding-top: 6px; font: 12.5px var(--font-mono); color: var(--lamp); }

/* Comparison */
.cmp th, .cmp td { padding: 15px 18px; }
.cmp td:first-child { color: var(--text); font-weight: 500; }
.cmp .us { background: rgba(245, 181, 71, .07); }
.cmp th.us { color: var(--lamp); }
.cmp .yes { color: var(--auto); font-weight: 600; }
.cmp .no { color: var(--never); }
.cmp .meh { color: var(--muted); }
.cmp tbody td.us { border-left: 1px solid rgba(245, 181, 71, .3); }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--muted); }
.checklist svg { width: 18px; height: 18px; color: var(--auto); flex: none; margin-top: 3px; }
.checklist strong { color: var(--text); }

/* Browser frame */
.browser { margin: 0; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.browser-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.browser-url { font: 12px var(--font-mono); color: var(--dim); background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.browser img { width: 100%; height: auto; }

/* Training chart + crew */
.train { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.train .bar { grid-template-columns: minmax(130px, 210px) 1fr 52px; }
.train .bar-name { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--text); }
.bar-name small { display: block; font: 400 11.5px var(--font-mono); color: var(--dim); margin-top: 2px; }
.bar-fill.base { background: var(--dim); }
.train .bar-track, .train .bar-fill { height: 14px; border-radius: 7px; }
.crew { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.crew-card { padding: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text); transition: border-color .15s, transform .15s; }
.crew-card:hover { color: var(--text); border-color: var(--lamp); transform: translateY(-2px); }
.crew-role { font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lamp); }
.crew-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.crew-card p { font-size: 14px; color: var(--muted); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--lamp); font-size: 22px; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 20px; color: var(--muted); font-size: 15px; line-height: 1.65; }

/* Collapsible technical detail in articles */
.tech { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.tech[open] { padding-bottom: 22px; }
.tech summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.tech summary::-webkit-details-marker { display: none; }
.tech summary::after { content: "+"; color: var(--lamp); font-size: 22px; line-height: 1; }
.tech[open] summary::after { content: "\2212"; }
.tech .table-box { margin-bottom: 16px; }
.tech-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.tech-list li { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.article-section em { color: var(--text); font-style: normal; font-weight: 600; }

/* Editable protected lists (policy builder) */
.chip-add { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-input { flex: 1 1 200px; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--well); color: var(--text); font: 13px var(--font-mono); }
.chip-input:focus { outline: none; border-color: var(--lamp); }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-custom { color: var(--text); background: rgba(245, 181, 71, .12); border-color: rgba(245, 181, 71, .45); }
.chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.chip-x:hover { color: var(--text); }
.chip-err { color: var(--never); }

/* How-it-works walkthrough (animated, CSS transitions toggled by site.js) */
.walk { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .walk { grid-template-columns: 1fr; } }
.walk-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.walk-steps button { width: 100%; display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font: inherit; transition: background .2s, border-color .2s, color .2s; }
.walk-steps button:hover { background: var(--panel); }
.walk-steps button[aria-pressed="true"] { background: var(--panel); border-color: var(--lamp); color: var(--text); }
.walk-n { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font: 500 13px var(--font-mono); }
.walk-steps button[aria-pressed="true"] .walk-n { border-color: var(--lamp); background: var(--lamp); color: var(--lamp-ink); }
.walk-t { display: flex; flex-direction: column; gap: 2px; }
.walk-t strong { font-size: 15px; color: inherit; }
.walk-t small { font-size: 13px; color: var(--dim); line-height: 1.45; }
.walk-steps button[aria-pressed="true"] small { color: var(--muted); }
.walk-stage { overflow: hidden; min-height: 420px; }
.walk-bar { width: 120px; height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.walk-bar span { display: block; height: 100%; width: 0; background: var(--lamp); }
.walk.playing .walk-bar span { animation: walk-progress 2.6s linear forwards; }
@keyframes walk-progress { from { width: 0; } to { width: 100%; } }
.walk-log { padding: 16px 0; font: 12.5px/1.9 var(--font-mono); color: var(--log); border-bottom: 1px dashed #2a3658; overflow-x: auto; }
.walk-log div { padding: 0 20px; white-space: pre; opacity: 0; transform: translateX(-6px); transition: opacity .35s, transform .35s, background .4s; }
.walk-log .warn { color: var(--lamp); }
.walk-log .err { color: var(--never); }
.walk.s0 .walk-log div { opacity: 1; transform: none; }
.walk.s0 .walk-log div:nth-child(2) { transition-delay: .12s; }
.walk.s0 .walk-log div:nth-child(3) { transition-delay: .24s; }
.walk.s0 .walk-log div:nth-child(4) { transition-delay: .36s; }
.walk.s0 .walk-log div:nth-child(5) { transition-delay: .48s; }
.walk.s1 .walk-log div { transition-delay: 0s; }
.walk.s1 .walk-log div:not(.walk-root) { opacity: .45; }
.walk.s1 .walk-log .walk-root { background: rgba(245, 181, 71, .14); }
.walk-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.walk-item { opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.walk-call { display: flex; flex-direction: column; gap: 6px; }
.walk-call code { font: 15px var(--font-mono); color: var(--text); word-break: break-word; }
.walk-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.walk-checks li { font-size: 14px; color: var(--text-2); padding-left: 24px; position: relative; opacity: 0; transition: opacity .3s; }
.walk-checks li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 9px; height: 5px; border-left: 2px solid var(--auto); border-bottom: 2px solid var(--auto); transform: rotate(-45deg); }
.walk-checks code, .walk-policy code { font: 12.5px var(--font-mono); color: var(--text); }
.walk-policy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.walk-record { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font: 13px var(--font-mono); color: var(--auto); border-top: 1px solid var(--line); padding-top: 14px; }
.walk.s1 .walk-call, .walk.s2 .walk-checks, .walk.s3 .walk-policy, .walk.s4 .walk-record { opacity: 1; transform: none; }
.walk.s2 .walk-checks li { opacity: 1; }
.walk.s2 .walk-checks li:nth-child(2) { transition-delay: .25s; }
.walk.s2 .walk-checks li:nth-child(3) { transition-delay: .5s; }
@media (prefers-reduced-motion: reduce) {
  .walk-log div, .walk-item, .walk-checks li { transition: none; }
  .walk.playing .walk-bar span { animation: none; width: 100%; }
}
@media (max-width: 900px) {
  .walk-stage { order: -1; min-height: 0; }
  .walk-steps { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .walk-steps li { flex: none; }
  .walk-steps button { padding: 8px 12px; gap: 8px; align-items: center; white-space: nowrap; }
  .walk-t small { display: none; }
  .walk-n { width: 22px; height: 22px; font-size: 12px; }
}
