/* ============================================================================
   runnerize — site styles
   Vanilla CSS. No build step. Light + dark via prefers-color-scheme.
   ========================================================================== */

/* ----------  Design tokens  ---------- */
:root {
  color-scheme: light dark;

  /* surfaces & ink (light) */
  --bg: #fbfbfd;
  --bg-2: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e7e9f0;
  --border-2: #d9dce6;
  --ink: #191b22;
  --ink-2: #545a68;
  --ink-3: #646c7d;

  /* brand */
  --brand: #5b52e5;
  --brand-text: #4b43cf;      /* AA on white */
  --brand-soft: #efeefc;
  --grad-a: #6c63ff;
  --grad-b: #12b3a6;
  --mark-bg: #0c0d12;

  /* code */
  --code-bg: #0f1119;
  --code-ink: #d6d9e6;
  --code-head: #171a24;
  --code-border: #23263300;

  /* accents */
  --ok-bg: rgba(15, 157, 122, 0.12);
  --ok-ink: #0a7a5f;
  --stub-bg: rgba(176, 122, 12, 0.12);
  --stub-ink: #8a6100;
  --preview-bg: rgba(91, 82, 229, 0.12);
  --preview-ink: #4b43cf;

  /* diagram */
  --dg-arrow: #8b90a0;
  --dg-arrow-faint: #b8bdca;
  --dg-zone-fill: rgba(108, 99, 255, 0.035);
  --dg-zone-stroke: #cbc6ee;
  --dg-zone-label: #8f8ad0;
  --dg-badge-fill: rgba(15, 18, 28, 0.06);
  --dg-badge-text: #4a5162;
  --dg-title: #1c1f27;
  --dg-sub: #5b6274;
  --dg-note: #6b7284;
  --dg-elabel: #626a7c;
  --dg-elabel-faint: #9aa0ad;
  --dg-src-fill: #f1f3f8;   --dg-src-stroke: #d3d8e4;  --dg-src-ic: #39404f;
  --dg-disp-fill: #efeefc;  --dg-disp-stroke: #cbc6f5; --dg-disp-ic: #5b52e5;
  --dg-mint-fill: #f5effc;  --dg-mint-stroke: #ddccf3; --dg-mint-ic: #8b5cf6;
  --dg-run-fill: #e6f7f3;   --dg-run-stroke: #12a89a;  --dg-run-ic: #0c8478;
  --dg-kill-fill: #fdeef0;  --dg-kill-stroke: #f1c4cc; --dg-kill-ic: #cf4560;

  /* metrics */
  --wrap: 1120px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 34, 0.04), 0 2px 8px rgba(20, 22, 34, 0.05);
  --shadow-md: 0 4px 12px rgba(20, 22, 34, 0.06), 0 14px 40px rgba(20, 22, 34, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090a0f;
    --bg-2: #0d0f16;
    --surface: #13151d;
    --surface-2: #181b24;
    --border: #242834;
    --border-2: #313847;
    --ink: #e9ebf2;
    --ink-2: #a6acbd;
    --ink-3: #8b93a4;

    --brand: #8f88ff;
    --brand-text: #a8a2ff;
    --brand-soft: #1a1930;
    --grad-a: #8b83ff;
    --grad-b: #2dd4bf;
    --mark-bg: #0c0d12;

    --code-bg: #0c0e15;
    --code-ink: #d0d4e2;
    --code-head: #12141c;

    --ok-bg: rgba(45, 212, 191, 0.15);
    --ok-ink: #52e0cf;
    --stub-bg: rgba(230, 185, 105, 0.14);
    --stub-ink: #e2bd72;
    --preview-bg: rgba(143, 136, 255, 0.15);
    --preview-ink: #a8a2ff;

    --dg-arrow: #667089;
    --dg-arrow-faint: #414a5c;
    --dg-zone-fill: rgba(140, 131, 255, 0.055);
    --dg-zone-stroke: #3a3768;
    --dg-zone-label: #9a94e0;
    --dg-badge-fill: rgba(255, 255, 255, 0.08);
    --dg-badge-text: #b8bece;
    --dg-title: #e9ebf2;
    --dg-sub: #9aa1b3;
    --dg-note: #808799;
    --dg-elabel: #8891a3;
    --dg-elabel-faint: #5c6373;
    --dg-src-fill: #191c26;   --dg-src-stroke: #2f3646;  --dg-src-ic: #c2c8d6;
    --dg-disp-fill: #191830;  --dg-disp-stroke: #3a3568; --dg-disp-ic: #a29bff;
    --dg-mint-fill: #201a33;  --dg-mint-stroke: #443564; --dg-mint-ic: #b794f6;
    --dg-run-fill: #0d2827;   --dg-run-stroke: #22c3b2;  --dg-run-ic: #5fe6d5;
    --dg-kill-fill: #291620;  --dg-kill-stroke: #5e2f3c; --dg-kill-ic: #f2879b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.4), 0 18px 50px rgba(0, 0, 0, 0.45);
  }
}

/* ----------  Reset & base  ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 80px;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; }
code, pre { font-family: var(--mono); }
::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  z-index: 100; transition: top .16s ease;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.muted { color: var(--ink-3); }
.inline-code {
  font-size: 0.86em; padding: 2px 7px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-text);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent);
}
/* prose inline code only — never the <code> inside a <pre> code block */
:not(pre) > code:not(.inline-code):not([class^="tok"]) {
  font-size: 0.88em; padding: 1.5px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink);
}

/* ----------  Header  ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header { border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 8px; flex: none; }
.brand-word { font-size: 1.12rem; letter-spacing: -0.02em; }
.brand-word-accent {
  background: linear-gradient(115deg, var(--grad-a), var(--grad-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a { color: var(--ink-2); font-size: 0.95rem; font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.nav-ext {
  color: var(--ink) !important; font-weight: 550 !important;
  padding: 7px 15px; border: 1px solid var(--border-2); border-radius: 9px;
  transition: border-color .16s ease, background .16s ease;
}
.nav-ext:hover { background: var(--surface-2); border-color: var(--ink-3); }

/* ----------  Hero  ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 76px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 78% -8%, color-mix(in srgb, var(--grad-b) 16%, transparent), transparent 62%),
    radial-gradient(58% 60% at 8% 4%, color-mix(in srgb, var(--grad-a) 15%, transparent), transparent 60%);
  pointer-events: none;
}
.hero-inner { max-width: 880px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.82rem; font-weight: 550; letter-spacing: 0.01em;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; box-shadow: var(--shadow-sm);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--dg-run-stroke);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dg-run-stroke) 22%, transparent);
}
.hero-title {
  margin: 26px 0 0; font-size: clamp(2.4rem, 6vw, 4.05rem);
  font-weight: 680; letter-spacing: -0.035em; line-height: 1.04;
}
.grad-text {
  display: inline-block;
  background: linear-gradient(108deg, var(--grad-a) 8%, var(--grad-b) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede {
  margin: 24px 0 0; max-width: 660px;
  font-size: clamp(1.06rem, 2vw, 1.22rem); line-height: 1.62; color: var(--ink-2);
}
.hero-lede strong { color: var(--ink); font-weight: 620; }

.install { margin-top: 34px; max-width: 560px; }
.install-alt { margin-top: 14px; font-size: 0.92rem; color: var(--ink-3); }
.install-alt .sep { margin: 0 8px; opacity: 0.6; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust-row {
  display: flex; flex-wrap: wrap; gap: 12px 34px; margin: 40px 0 0; padding: 0; list-style: none;
}
.trust-row li { font-size: 0.94rem; color: var(--ink-2); }
.trust-row strong {
  color: var(--ink); font-weight: 680; font-variant-numeric: tabular-nums;
  margin-right: 4px; font-size: 1.02rem;
}

/* ----------  Buttons  ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.96rem; font-weight: 560; padding: 12px 22px;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  color: #fff; background: linear-gradient(120deg, var(--grad-a), color-mix(in srgb, var(--grad-b) 82%, var(--grad-a)));
  box-shadow: 0 2px 6px color-mix(in srgb, var(--grad-a) 35%, transparent), var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--grad-a) 40%, transparent); }
.btn-ghost {
  color: var(--ink); background: var(--surface); border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--ink-3); }

/* ----------  Code blocks  ---------- */
.code-block {
  border-radius: var(--radius); overflow: hidden;
  background: var(--code-bg); border: 1px solid color-mix(in srgb, #000 22%, var(--border));
  box-shadow: var(--shadow-md);
}
.code-head {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: var(--code-head);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.code-dot--r { background: #ff5f57; } .code-dot--y { background: #febc2e; } .code-dot--g { background: #28c840; }
.code-label {
  margin-left: 8px; font-size: 0.78rem; font-family: var(--mono);
  color: #8b90a4; letter-spacing: 0.01em;
}
.copy-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-family: var(--font); font-weight: 540;
  color: #b8bdcf; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.copy-btn.is-copied { color: #52e0cf; border-color: color-mix(in srgb, #52e0cf 40%, transparent); }
.code-body {
  margin: 0; padding: 18px 18px 20px; overflow-x: auto;
  font-size: 0.9rem; line-height: 1.72; color: var(--code-ink);
}
.code-body code { font-family: var(--mono); }
.tok-c { color: #6b7387; font-style: italic; }
.tok-p { color: #7fd0c4; }
.tok-a { color: #c3a6f5; }
.tok-k { color: #f2a2b4; }

/* ----------  Sections  ---------- */
.section { padding: clamp(64px, 9vw, 108px) 0; }
.section--tint { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 60px); }
.kicker {
  font-size: 0.8rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-text); margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); letter-spacing: -0.03em; }
.section-sub { margin-top: 18px; font-size: 1.06rem; color: var(--ink-2); line-height: 1.62; }

/* ----------  Pillars  ---------- */
.pillars-section { padding: clamp(30px, 5vw, 44px) 0; }
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin: 0; padding: 0; list-style: none;
}
.pillar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease;
}
.pillar:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
.pillar-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px;
  color: var(--brand); background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  margin-bottom: 16px;
}
.pillar h3 { font-size: 1.12rem; margin-bottom: 8px; }
.pillar p { font-size: 0.96rem; color: var(--ink-2); line-height: 1.58; }

/* ----------  Diagram  ---------- */
.diagram-figure {
  margin: 0; padding: clamp(18px, 3vw, 34px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.flow { width: 100%; height: auto; }
.dg-title { font: 650 15px/1 var(--font); fill: var(--dg-title); letter-spacing: -0.01em; }
.dg-sub { font: 500 12px/1 var(--font); fill: var(--dg-sub); }
.dg-note { font: 500 11.5px/1 var(--font); fill: var(--dg-note); }
.dg-badge-text { font: 600 11px/1 var(--font); fill: var(--dg-badge-text); }
.dg-zone-label { font: 650 11.5px/1 var(--font); fill: var(--dg-zone-label); letter-spacing: 0.06em; text-transform: uppercase; }
.dg-elabel text { font: 550 12px/1 var(--font); fill: var(--dg-elabel); }
.dg-elabel--faint text { font-size: 11.5px; fill: var(--dg-elabel-faint); font-style: italic; }
.dg-node { transition: opacity .2s ease; }
.diagram-cap { margin-top: 18px; font-size: 0.9rem; color: var(--ink-3); text-align: center; }

/* animated flow dashes (respect reduced motion) */
.dg-edge { stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .dg-edge--faint { animation: dash 1.1s linear infinite; }
}
@keyframes dash { to { stroke-dashoffset: -20; } }

/* ----------  Quickstart  ---------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.quick-h { font-size: 1.06rem; margin-bottom: 14px; color: var(--ink); }
.quick-h--sp { margin-top: 30px; }
.quick-note { margin-top: 14px; font-size: 0.92rem; color: var(--ink-2); line-height: 1.55; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.opt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--surface); }
.opt-table td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
.opt-table tr:last-child td { border-bottom: none; }
.opt-table td:first-child { white-space: nowrap; width: 1%; }
.opt-table td:first-child code { color: var(--brand-text); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 15%, transparent); }
.opt-table .muted { display: block; margin-top: 2px; font-size: 0.85rem; }

/* ----------  Security  ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm);
}
.sec-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 15px;
  color: var(--dg-run-ic); background: var(--dg-run-fill);
  border: 1px solid color-mix(in srgb, var(--dg-run-stroke) 30%, transparent);
}
.sec-card h3 { font-size: 1.08rem; margin-bottom: 9px; }
.sec-card p { font-size: 0.95rem; color: var(--ink-2); line-height: 1.6; }

/* ----------  Backends matrix  ---------- */
.matrix { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--surface); min-width: 640px; }
.matrix th {
  text-align: left; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 18px; border-bottom: 1px solid var(--border-2); background: var(--surface-2);
}
.matrix td { padding: 16px 18px; border-bottom: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
.matrix tr:last-child td { border-bottom: none; }
.matrix td:first-child code { font-size: 0.92em; color: var(--brand-text); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 15%, transparent); }
.status {
  display: inline-flex; align-items: center; font-size: 0.82rem; font-weight: 560;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.status--ok { color: var(--ok-ink); background: var(--ok-bg); }
.status--ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 7px; }
.status--stub { color: var(--stub-ink); background: var(--stub-bg); }
.status--preview { color: var(--preview-ink); background: var(--preview-bg); }
.status--preview::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 7px; }

/* ----------  Limitations + roadmap  ---------- */
.lr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.lr-h { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-bottom: 22px; }
.lr-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.lr-list li {
  position: relative; padding-left: 30px; font-size: 0.98rem; color: var(--ink-2); line-height: 1.55;
}
.lr-list li::before {
  position: absolute; left: 0; top: 1px; width: 20px; height: 20px; text-align: center;
  font-size: 0.9rem; line-height: 20px; border-radius: 6px;
}
.lr-list--limit li::before { content: "!"; font-weight: 700; color: var(--stub-ink); background: var(--stub-bg); }
.lr-list--road li::before { content: "→"; color: var(--brand-text); background: var(--brand-soft); }

/* ----------  CTA  ---------- */
.cta { padding: clamp(60px, 9vw, 104px) 0; position: relative; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 120% at 50% 0%, color-mix(in srgb, var(--grad-a) 13%, transparent), transparent 60%);
}
.cta-inner { max-width: 620px; margin-inline: auto; text-align: center; }
.cta-inner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; }
.cta-inner p { margin-top: 14px; font-size: 1.08rem; color: var(--ink-2); }
.cta-code { margin: 32px auto 0; max-width: 480px; text-align: left; }

/* ----------  Footer  ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 56px 0 30px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.footer-brand { max-width: 320px; }
.footer-tag { margin-top: 14px; font-size: 0.92rem; color: var(--ink-3); line-height: 1.55; }
.footer-links { display: flex; gap: 60px; }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col h4 { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; margin-bottom: 3px; }
.footer-col a { font-size: 0.94rem; color: var(--ink-2); font-weight: 500; }
.footer-col a:hover { color: var(--ink); text-decoration: none; }
.footer-base {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border);
  font-size: 0.86rem; color: var(--ink-3);
}
.footer-sep { opacity: 0.5; }

/* ----------  Responsive  ---------- */
@media (max-width: 860px) {
  .pillars, .sec-grid { grid-template-columns: 1fr; }
  .quick-grid, .lr-grid { grid-template-columns: 1fr; gap: 32px; }
  .site-nav { gap: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav a:not(.nav-ext) { display: none; }
  .footer-inner { flex-direction: column; gap: 32px; }
  .footer-links { gap: 44px; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 420px) {
  .footer-links { flex-direction: column; gap: 28px; }
}
