/* Shared styles for every page. Colours are tokens; dark mode follows the system. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #17181b;
  --muted: #5f6168;
  --line: #e1ded6;
  --accent: #2456d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfb;
  --ok: #1d7f45;
  --ok-soft: #e3f3e8;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --code-bg: #15171c;
  --code-text: #e6e7ea;
  --radius: 14px;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111215;
    --surface: #1a1c20;
    --surface-2: #22252a;
    --text: #ececef;
    --muted: #a2a4ab;
    --line: #30333a;
    --accent: #7c9dff;
    --accent-ink: #0d1020;
    --accent-soft: #1f2740;
    --ok: #5cc98a;
    --ok-soft: #17301f;
    --warn: #f0b35a;
    --warn-soft: #33270f;
    --code-bg: #0b0c0f;
  }
}
:root[data-theme="dark"] {
  --bg: #111215; --surface: #1a1c20; --surface-2: #22252a; --text: #ececef; --muted: #a2a4ab;
  --line: #30333a; --accent: #7c9dff; --accent-ink: #0d1020; --accent-soft: #1f2740;
  --ok: #5cc98a; --ok-soft: #17301f; --warn: #f0b35a; --warn-soft: #33270f; --code-bg: #0b0c0f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--accent); }
img, svg { max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 14px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }
@media (max-width: 720px) {
  .nav { padding: 8px 0; }
  .nav-links { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav-links a { white-space: nowrap; }
}

/* Typography */
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 68ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Sections */
.hero { padding: 72px 0 48px; }
.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 28px; max-width: 72ch; }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }

/* Grids and cards */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card.feature { display: flex; flex-direction: column; }
.icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.icon svg { width: 20px; height: 20px; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.dev { background: var(--warn-soft); color: var(--warn); }
.badge.neutral { background: var(--surface-2); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.35rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }

ul.clean { list-style: none; padding: 0; margin: 0 0 1em; }
ul.clean li { padding: 6px 0 6px 24px; position: relative; }
ul.clean li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 18px 0; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }

/* Pricing */
.price { font-size: 2.2rem; font-weight: 750; letter-spacing: -.03em; margin: 6px 0 2px; }
.price small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tier { display: flex; flex-direction: column; }
.tier ul { flex: 1; }
.tier.featured { border: 2px solid var(--accent); }
.tier .btn { text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Code */
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--code-bg); color: var(--code-text); padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: .88rem; line-height: 1.55; margin: 0 0 1.2em; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.method { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 6px; margin-right: 8px; }
.method.get { background: var(--ok-soft); color: var(--ok); }
.method.post { background: var(--accent-soft); color: var(--accent); }
.method.put { background: var(--warn-soft); color: var(--warn); }
.method.del { background: #fde7e7; color: #b42318; }
.endpoint { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }

/* Docs layout */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding: 40px 16px 64px; }
.docs-nav { position: sticky; top: 84px; align-self: start; font-size: .92rem; }
.docs-nav a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0; }
.docs-nav a:hover { color: var(--accent); }
.docs-nav .group { font-weight: 700; color: var(--text); margin: 14px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.docs article section { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.docs article h2 { font-size: 1.5rem; }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .docs-nav .group { width: 100%; margin: 8px 0 0; }
}

/* Evidence: video and learning curve */
.evidence { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .evidence { grid-template-columns: minmax(0, 1fr); } }
.video-frame { margin: 0; }
.video-frame video { display: block; width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: var(--radius); }
.video-frame figcaption { margin-top: 8px; }
.curve td:first-child { white-space: nowrap; width: 1%; }
.curve .bar { display: block; height: 4px; width: var(--w); background: var(--accent); border-radius: 2px; margin-bottom: 4px; }

/* Roadmap */
.roadmap .card { border-left: 4px solid var(--warn); }
.status-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: .9rem; margin-top: 24px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-grid a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.footer-grid a:hover { color: var(--text); }
