/* Charter site — plum ground, signal-red accent */
:root {
  color-scheme: dark;
  --bg: #0F0A16;
  --surface: #191223;
  --line: #2A2038;
  --line-strong: #3F3154;
  --accent: #E5483B;
  --accent-text: #E5483B;
  --glow: rgba(229, 72, 59, 0.12);
  --selection: rgba(229, 72, 59, 0.32);

  --text: #FAFAFA;
  --text-muted: #A1A1AA;
  --text-soft: #D4D4D8;
  --text-faint: #82828C;
  --ok: #4ADE80;
  --ink: #09090B;
  --btn-primary-hover: #FFFFFF;
  --nav-hover: rgba(255, 255, 255, 0.03);
  --nav-active: rgba(255, 255, 255, 0.06);

  /* Terminal stays a dark terminal in both themes */
  --terminal-bg: #191223;
  --terminal-line: #2A2038;
  --terminal-fg: #E4E4E7;
  --terminal-bright: #FAFAFA;
  --terminal-muted: #A1A1AA;
  --terminal-dim: #82828C;
  --terminal-ok: #4ADE80;

  --font-sans: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F6F2F9;
    --surface: #FFFFFF;
    --line: #E5DDED;
    --line-strong: #C9BED8;
    --accent: #E5483B;
    --accent-text: #C93A2E;
    --glow: rgba(229, 72, 59, 0.10);
    --selection: rgba(229, 72, 59, 0.22);

    --text: #18121F;
    --text-muted: #57516A;
    --text-soft: #3D3648;
    --text-faint: #6F6880;
    --ok: #15803D;
    --ink: #FAFAFA;
    --btn-primary-hover: #09090B;
    --nav-hover: rgba(15, 10, 22, 0.04);
    --nav-active: rgba(15, 10, 22, 0.08);
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 560px at 12% -6%, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  overflow-x: clip;
}

::selection { background: var(--selection); color: var(--text); }

a { color: var(--text-muted); text-decoration: none; }
a:hover { color: var(--text); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Header */
.site-header .wrap {
  padding-top: 20px; padding-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-header.bordered { border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .brand-mark,
.brand-mark { display: block; }
.brand .brand-mark { width: 44px; height: 44px; }
.wordmark { font-size: 23px; font-weight: 600; letter-spacing: -0.4px; }
.nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 16px; }
.nav a[aria-current="page"] { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block; padding: 14px 22px; border-radius: 10px;
  font-size: 16px; font-weight: 500;
}
.btn-sm { padding: 10px 16px; border-radius: 8px; }
.btn-primary { background: var(--text); color: var(--ink); }
.btn-primary:hover { color: var(--ink); background: var(--btn-primary-hover); }
.btn-ghost { color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); background: var(--nav-hover); }

/* Hero */
.hero { padding-top: 104px; padding-bottom: 64px; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.hero h1 { margin: 0; font-size: clamp(40px, 6vw, 68px); line-height: 1.04; font-weight: 600; letter-spacing: -0.03em; max-width: 860px; text-wrap: balance; }
.hero .lead { margin: 0; font-size: 24px; line-height: 1.4; color: var(--text-muted); max-width: 560px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 8px; }

/* Terminal */
.terminal-section { padding-bottom: 72px; }
.terminal { background: var(--terminal-bg); border: 1px solid var(--terminal-line); border-radius: 14px; overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--terminal-line); }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.terminal-path { font-family: var(--font-mono); font-size: 12px; color: var(--terminal-muted); }
.terminal pre {
  margin: 0; padding: 28px 28px 32px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.85; color: var(--terminal-fg);
}
.t-prompt { color: var(--accent); }
.terminal ::selection { color: var(--terminal-bright); }
.t-ok { color: var(--terminal-ok); }
.t-dim { color: var(--terminal-dim); }
.t-muted { color: var(--terminal-muted); }
.t-bright { color: var(--terminal-bright); font-weight: 500; }

/* Pillars: the three claims, each with its evidence */
.pillars { padding-bottom: 104px; }
.pillar {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start;
  padding: 56px 0; border-top: 1px solid var(--line);
}
.pillar-copy { padding-top: 8px; position: sticky; top: 32px; }
.pillar-copy h2 { margin: 0 0 16px; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.pillar-copy p { margin: 0; max-width: 44ch; font-size: 18px; line-height: 1.55; color: var(--text-muted); }
.pillar-copy code { font-family: var(--font-mono); font-size: 0.88em; color: var(--text); }
.proof { min-width: 0; background: var(--terminal-bg); border: 1px solid var(--terminal-line); border-radius: 14px; overflow: hidden; }
.proof-bar { padding: 12px 18px; border-bottom: 1px solid var(--terminal-line); font-family: var(--font-mono); font-size: 12px; color: var(--terminal-muted); }
.proof pre {
  margin: 0; padding: 22px 24px 26px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--terminal-fg);
  scrollbar-width: thin; scrollbar-color: var(--terminal-line) transparent;
}
.envs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.env { padding: 20px 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.env h3 { margin: 0 0 16px; font-size: 16px; font-weight: 500; }
.env dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-family: var(--font-mono); font-size: 14px; }
.env dt { color: var(--text-faint); }
.env dd { margin: 0; color: var(--text); }
.env dd.differs { color: var(--accent-text); }

/* Key features rail */
.features { padding-bottom: 120px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -0.8px; }
.section-head .count { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.rail {
  display: flex; scroll-padding-left: 0; gap: 16px; overflow-x: auto; padding: 0 0 16px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  list-style: none; margin: 0;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.rail:focus-visible { outline-offset: 6px; border-radius: 14px; }
.card {
  flex: 0 0 min(320px, 82%); scroll-snap-align: start; min-height: 210px;
  padding: 28px 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.card .num { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); }
.card h3 { margin: 6px 0 0; font-size: 18px; line-height: 1.3; font-weight: 500; }
.card p { margin: 0; font-size: 18px; line-height: 1.3; color: var(--text-muted); }

/* Closing CTA */
.cta { padding-top: 96px; padding-bottom: 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.cta h2 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -1.2px; }
.cta p { margin: 0; font-size: 18px; line-height: 1.3; color: var(--text-muted); }
.cta .brand-mark { display: block; width: 56px; height: 56px; }
.cta .then { font-family: var(--font-mono); font-size: 14px; color: var(--text-faint); }
.cta .then code { font-family: inherit; color: var(--text); }

/* Footer */
.site-footer { font-size: 16px; }
.site-footer .wrap {
  padding-top: 32px; padding-bottom: 48px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--text-faint);
}
.site-footer .copy { display: flex; align-items: center; gap: 10px; }
.site-footer .copy .brand-mark { display: block; width: 20px; height: 20px; opacity: 0.55; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Docs */
.docs-layout { padding-top: 48px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.docs-nav { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 28px; font-size: 15px; }
.docs-nav .group { display: flex; flex-direction: column; gap: 10px; }
.docs-nav .group-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); }
.docs-nav a {
  display: block; padding: 6px 10px; margin: 0 -10px; border-radius: 8px;
  color: var(--text-muted);
}
.docs-nav a:hover { color: var(--text); background: var(--nav-hover); }
.docs-nav a[aria-current="page"] {
  color: var(--text); font-weight: 500; background: var(--nav-active);
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.article { flex: 999 1 560px; min-width: 0; max-width: 720px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); }
.article h1 { margin: 12px 0 20px; font-size: clamp(36px, 5vw, 52px); line-height: 1.05; font-weight: 600; letter-spacing: -1.6px; }
.article .lead { margin: 0 0 48px; font-size: 22px; line-height: 1.4; color: var(--text-soft); }
.article section { padding-top: 32px; border-top: 1px solid var(--line); margin-bottom: 40px; }
.article section:last-of-type { margin-bottom: 56px; }
.article h2 { margin: 0 0 16px; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.6px; }
.article p { margin: 0 0 16px; font-size: 18px; line-height: 1.55; color: var(--text-muted); }
.article p:last-child { margin-bottom: 0; }
.article ul { margin: 0 0 16px; padding-left: 1.25em; color: var(--text-muted); font-size: 18px; line-height: 1.55; }
.article li { margin-bottom: 8px; }
.draft-note {
  margin: 0 0 32px; padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 16px; line-height: 1.45; color: var(--text-soft);
}
.standards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 20px; }
.standard { padding: 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.standard .label { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); }
.article .standard p { margin: 0; font-size: 16px; line-height: 1.45; }
.next {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 24px; border-radius: 12px; border: 1px solid var(--line-strong); color: var(--text);
}
.next:hover { color: var(--text); border-color: var(--text-faint); }
.next .kicker { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.next .title { font-size: 18px; font-weight: 500; }
.next .arrow { font-size: 20px; color: var(--accent-text); }

/* Changelog / release history (Intent-style entries inside docs article shell) */
.release-history { border-top: none; padding-top: 0; margin-bottom: 0; }
.release-empty {
  margin: 0; padding: 20px 22px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 18px; line-height: 1.5; color: var(--text-muted);
}
.release-meta {
  margin: 34px 0 12px; font-size: 18px; font-weight: 500;
  line-height: 1.3; color: var(--text);
}
.release-history > .release-meta:first-child { margin-top: 0; }
.release-history > .release-meta + p { margin-bottom: 0; }

/* Download page */
.download-page {
  padding-top: 96px; padding-bottom: 120px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  max-width: 640px;
}
.download-page h1 { margin: 0; font-size: clamp(36px, 5vw, 52px); line-height: 1.05; font-weight: 600; letter-spacing: -1.6px; }
.download-page p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--text-muted); }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Desktop: features become a grid; the rail is for touch widths */
@media (min-width: 900px) {
  .rail {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    overflow: visible; scroll-snap-type: none; padding: 0;
    -webkit-mask-image: none; mask-image: none;
  }
  .card { min-height: 0; }
  .count-arrow { display: none; }
}

@media (max-width: 860px) {
  .pillar { grid-template-columns: 1fr; gap: 28px; padding: 44px 0; }
  .pillar-copy { padding-top: 0; position: static; }
}

/* Mobile */
@media (max-width: 640px) {
  .pillar-copy h2 { font-size: 28px; }
  .pillars { padding-bottom: 72px; }
  .proof { margin: 0 -8px; }
  .proof pre { padding: 18px 18px 22px; font-size: 12px; }
  .envs { grid-template-columns: 1fr; }
  .hero { padding-top: 56px; padding-bottom: 48px; }
  .hero .lead { font-size: 20px; }
  .terminal-section { padding-bottom: 48px; }
  .features { padding-bottom: 88px; }
  .cta { padding-top: 64px; padding-bottom: 88px; }
  .terminal { margin: 0 -8px; }
  .terminal pre { padding: 20px 18px 24px; font-size: clamp(11px, 3.1vw, 14px); }
}

@media (max-width: 480px) {
  .wordmark { display: none; }
}
