/* ==========================================================================
   JOCKY website — shared stylesheet
   Palette: navy (brand) + rust (accent). Light is default; dark via
   prefers-color-scheme or [data-theme="dark"] on <html>.
   ========================================================================== */

:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --ink: #15212c;
  --ink-soft: #33434f;
  --muted: #5d6c79;
  --line: #d9e0e6;
  --brand: #13293d;
  --brand-2: #1c3a55;
  --brand-ink: #f1f5f8;
  --brand-muted: #9fb3c4;
  --accent: #c94d1a;
  --accent-hover: #ad3f12;
  --accent-ink: #ffffff;
  --accent-soft: #fbeae1;
  --link: #1b5f8f;
  --ok: #2f7d4f;
  --ok-soft: #e3f2e8;
  --warn: #9a6b00;
  --warn-soft: #fbf1d8;
  --bad: #a8323a;
  --bad-soft: #f8e3e4;
  --code-bg: #0f1b26;
  --code-line: #1f2f3e;
  --code-ink: #d6e1ea;
  --code-muted: #6f8699;
  --code-kw: #ff9a66;
  --code-str: #a8d68a;
  --code-num: #f0c674;
  --code-type: #7cc4f2;
  --code-fn: #e6d5ff;
  --shadow: 0 1px 2px rgba(19, 41, 61, .06), 0 4px 16px rgba(19, 41, 61, .06);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 6px;
  --wrap: 1200px;
  --gutter: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b131a;
    --surface: #111c26;
    --surface-2: #172532;
    --ink: #e3e9ee;
    --ink-soft: #c2ced8;
    --muted: #8fa1b0;
    --line: #223342;
    --brand: #08121b;
    --brand-2: #102131;
    --brand-ink: #e3e9ee;
    --brand-muted: #8093a4;
    --accent: #ee7a45;
    --accent-hover: #f58f60;
    --accent-ink: #1a0d06;
    --accent-soft: #2b1b13;
    --link: #7fb9e4;
    --ok: #6cc28f;
    --ok-soft: #13291d;
    --warn: #e2b44c;
    --warn-soft: #2a2211;
    --bad: #ec7c84;
    --bad-soft: #2d1619;
    --code-bg: #070f16;
    --code-line: #182735;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b131a;
  --surface: #111c26;
  --surface-2: #172532;
  --ink: #e3e9ee;
  --ink-soft: #c2ced8;
  --muted: #8fa1b0;
  --line: #223342;
  --brand: #08121b;
  --brand-2: #102131;
  --brand-ink: #e3e9ee;
  --brand-muted: #8093a4;
  --accent: #ee7a45;
  --accent-hover: #f58f60;
  --accent-ink: #1a0d06;
  --accent-soft: #2b1b13;
  --link: #7fb9e4;
  --ok: #6cc28f;
  --ok-soft: #13291d;
  --warn: #e2b44c;
  --warn-soft: #2a2211;
  --bad: #ec7c84;
  --bad-soft: #2d1619;
  --code-bg: #070f16;
  --code-line: #182735;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------- 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; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li + li { margin-top: .25em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); padding: .08em .35em; border-radius: 4px; font-size: .85em; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; background: var(--surface); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
.eyebrow { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: .5rem; display: block; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--muted); }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .7rem 1.15rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { font-size: 1.05rem; padding: .9rem 1.4rem; }
.btn small { font-weight: 400; opacity: .85; font-size: .8em; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Top section bar (like python.org's meta tabs) ---------- */
.meta-bar { background: var(--brand); color: var(--brand-muted); font-size: .8rem; }
.meta-bar .wrap { display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; }
.meta-tabs { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.meta-tabs li { margin: 0; }
.meta-tabs a { display: block; padding: .5rem .9rem; color: var(--brand-muted); text-decoration: none; border-right: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
.meta-tabs li:first-child a { border-left: 1px solid rgba(255,255,255,.06); }
.meta-tabs a:hover, .meta-tabs a[aria-current="true"] { color: var(--brand-ink); background: var(--brand-2); }
.meta-tools { display: flex; align-items: center; gap: .25rem; }
.icon-btn { background: none; border: 0; color: var(--brand-muted); padding: .35rem .5rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font: inherit; border-radius: 4px; }
.icon-btn:hover { color: var(--brand-ink); background: var(--brand-2); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Header ---------- */
.site-header { background: var(--brand-2); color: var(--brand-ink); border-bottom: 3px solid var(--accent); }
.header-row { display: flex; align-items: center; gap: 1.5rem; padding-block: 1.1rem; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: .7rem; color: var(--brand-ink); text-decoration: none; margin-right: auto; }
.logo:hover { color: var(--brand-ink); }
.logo svg { width: 42px; height: 42px; flex: none; }
.logo-word { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1; }
.logo-sub { display: block; font-family: var(--font-mono); font-size: .68rem; font-weight: 400; letter-spacing: .06em; color: var(--brand-muted); margin-top: .3rem; text-transform: uppercase; }
.search { display: flex; align-items: stretch; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); overflow: hidden; min-width: 0; flex: 0 1 340px; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--brand-ink); padding: .55rem .8rem; font: inherit; font-size: .9rem; }
.search input::placeholder { color: var(--brand-muted); }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--accent); }
.search button { background: var(--accent); color: var(--accent-ink); border: 0; padding: 0 1rem; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.2); color: var(--brand-ink); border-radius: var(--radius); padding: .45rem .7rem; font: inherit; cursor: pointer; }

.main-nav { background: var(--brand-2); border-top: 1px solid rgba(255,255,255,.07); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.main-nav li { margin: 0; flex: 1; }
.main-nav a { display: block; text-align: center; padding: .8rem .75rem; color: var(--brand-ink); text-decoration: none; font-weight: 500; font-size: .95rem; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.main-nav a:hover { background: rgba(255,255,255,.05); color: var(--brand-ink); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--accent); background: rgba(255,255,255,.06); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .search { flex-basis: 100%; order: 3; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { text-align: left; border-bottom: 0; border-left: 3px solid transparent; margin: 0; }
  .main-nav a[aria-current="page"] { border-left-color: var(--accent); }
  .main-nav:not(.open) { display: none; }
}

/* ---------- Page header band (interior pages) ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 2.75rem 2.25rem; }
.page-head .lede { margin-bottom: 0; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumbs a { color: var(--muted); }
.section { padding-block: 3rem; }
.section-tight { padding-block: 2rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

/* ---------- Home hero ---------- */
.hero { background: linear-gradient(180deg, var(--brand-2) 0%, var(--brand) 100%); color: var(--brand-ink); padding-block: 3rem 3.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero h1 { color: var(--brand-ink); font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: #c7d4df; font-size: 1.1rem; max-width: 52ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero .btn-ghost { color: var(--brand-ink); border-color: rgba(255,255,255,.25); }
.hero .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-meta { margin-top: 1.25rem; font-family: var(--font-mono); font-size: .78rem; color: var(--brand-muted); display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hero-meta b { color: var(--brand-ink); font-weight: 500; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Code widget (tabbed "shell" like python.org) ---------- */
.code-widget { background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 10px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.code-widget-bar { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-bottom: 1px solid var(--code-line); }
.dots { display: flex; gap: 6px; margin-right: .5rem; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--code-line); display: block; }
.code-tabs { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.code-tabs button { background: none; border: 0; color: var(--code-muted); font-family: var(--font-mono); font-size: .75rem; padding: .35rem .6rem; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.code-tabs button:hover { color: var(--code-ink); }
.code-tabs button[aria-selected="true"] { background: var(--code-line); color: var(--code-ink); }
.code-widget pre { margin: 0; padding: 1.1rem 1.2rem; color: var(--code-ink); font-size: .85rem; line-height: 1.65; overflow-x: auto; min-height: 17.5rem; }
.code-widget .caption { border-top: 1px solid var(--code-line); padding: .8rem 1.2rem; font-size: .88rem; color: #aebfcd; }
.code-widget .caption a { color: var(--code-num); }

/* ---------- Code blocks ---------- */
.code { position: relative; background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--radius); margin: 0 0 1.25rem; }
.code pre { margin: 0; padding: 1rem 1.1rem; color: var(--code-ink); overflow-x: auto; font-size: .85rem; line-height: 1.6; }
.code .code-label { display: block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--code-muted); padding: .5rem 1.1rem 0; }
.copy-btn { position: absolute; top: .45rem; right: .45rem; background: var(--code-line); color: var(--code-ink); border: 0; border-radius: 4px; font: 500 .72rem var(--font-mono); padding: .3rem .55rem; cursor: pointer; opacity: .75; }
.copy-btn:hover, .copy-btn:focus-visible { opacity: 1; }
.tok-kw { color: var(--code-kw); }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-com { color: var(--code-muted); font-style: italic; }
.tok-type { color: var(--code-type); }
.tok-fn { color: var(--code-fn); }
.tok-prompt { color: var(--code-muted); user-select: none; }
.tok-out { color: #9fb0bf; }

/* ---------- Grids and cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .95rem; }
.card > :last-child { margin-bottom: 0; }
.card .more { margin-top: auto; font-weight: 600; font-size: .9rem; text-decoration: none; }
.card .more::after { content: " →"; }
a.card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); color: inherit; }
a.card:hover h3 { color: var(--accent); }

.widget { display: flex; flex-direction: column; gap: .6rem; }
.widget-title { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin: 0; }
.widget-title svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.widget p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.widget .more { font-weight: 600; font-size: .9rem; text-decoration: none; }
.widget .more::after { content: " →"; }

/* ---------- Lists: news / events ---------- */
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding-block: .8rem; border-bottom: 1px solid var(--line); margin: 0; }
.feed li:last-child { border-bottom: 0; }
.feed time { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.feed a { color: var(--ink); text-decoration: none; font-weight: 500; }
.feed a:hover { color: var(--accent); }
.feed .where { display: block; font-size: .85rem; color: var(--muted); }
.feed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: .25rem; }
.feed-head h2 { font-size: 1.25rem; margin: 0; }
.feed-head a { font-size: .85rem; font-weight: 600; text-decoration: none; }

/* ---------- Stats / proof strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 1.25rem 1.4rem; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .88rem; color: var(--muted); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Quote / success stories ---------- */
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.quote blockquote { margin: 0; font-size: 1.02rem; color: var(--ink-soft); }
.quote footer { display: flex; align-items: center; gap: .75rem; margin-top: auto; font-size: .88rem; }
.quote .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); flex: none; }
.quote footer b { display: block; }
.quote footer span { color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-body); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td code { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .85em; }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Callouts ---------- */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1.5rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--link); }

/* ---------- Downloads ---------- */
.dl-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
.dl-hero .btn-lg { flex-direction: column; align-items: flex-start; gap: .1rem; padding: 1rem 1.6rem; }
.dl-alt { font-size: .9rem; color: var(--muted); margin-top: .75rem; }
@media (max-width: 760px) { .dl-hero { grid-template-columns: 1fr; } }
.os-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.os-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: .75rem 1.1rem; font: 600 .95rem var(--font-body); color: var(--muted); cursor: pointer; white-space: nowrap; }
.os-tabs button:hover { color: var(--ink); }
.os-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.sums { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); word-break: break-all; }

/* ---------- Docs layout ---------- */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 3rem; }
.docs-side { position: sticky; top: 1rem; align-self: start; font-size: .92rem; }
.docs-side h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .5rem; }
.docs-side h4:first-child { margin-top: 0; }
.docs-side ul { list-style: none; padding: 0; margin: 0; }
.docs-side li { margin: 0; }
.docs-side a { display: block; padding: .3rem .6rem; color: var(--ink-soft); text-decoration: none; border-left: 2px solid var(--line); }
.docs-side a:hover { color: var(--accent); border-left-color: var(--accent); }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } .docs-side { position: static; } }
.version-select { display: flex; gap: .5rem; align-items: center; font-size: .9rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.version-select select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
.docs-filter { width: 100%; font: inherit; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); margin-bottom: 1.5rem; }
.docs-filter:focus { outline: none; border-color: var(--accent); }

/* ---------- Steps (getting started) ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: flex; flex-direction: column; gap: 2rem; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 1.25rem; margin: 0; }
.steps > li::before { content: counter(step); width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--brand-2); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; }
.steps h3 { margin-top: .35rem; }

/* ---------- Timeline (about) ---------- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.5rem; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline time { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); font-weight: 600; }
.timeline h4 { margin: .15rem 0 .25rem; }
.timeline p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Principles ---------- */
.principles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }
.principles li { padding: .8rem 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 1.02rem; }
.principles li b { font-family: var(--font-display); }
@media (max-width: 700px) { .principles { grid-template-columns: 1fr; } }

/* ---------- News list ---------- */
.post { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.75rem; border-bottom: 1px solid var(--line); }
.post:first-child { padding-top: 0; }
.post time { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post h2 { font-size: 1.35rem; margin-bottom: .35rem; }
.post h2 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover { color: var(--accent); }
.post p { color: var(--ink-soft); margin-bottom: .5rem; }
.post .tags { display: flex; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 640px) { .post { grid-template-columns: 1fr; gap: .4rem; } }

/* ---------- Newsletter ---------- */
.subscribe { display: flex; gap: .5rem; flex-wrap: wrap; }
.subscribe input { flex: 1 1 220px; font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 0; }
.subscribe input:focus { outline: none; border-color: var(--accent); }
.form-msg { font-size: .9rem; color: var(--ok); margin-top: .5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand); color: var(--brand-muted); margin-top: 4rem; padding-block: 3rem 1.5rem; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2rem; }
.footer-grid h4 { color: var(--brand-ink); font-size: .95rem; margin-bottom: .75rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 0 0 .4rem; }
.footer-grid a { color: var(--brand-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--brand-ink); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 2.5rem; padding-top: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; }
.footer-bottom a { color: var(--brand-muted); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 404 ---------- */
.not-found { text-align: left; padding-block: 5rem; }
.not-found .code-big { font-family: var(--font-mono); color: var(--accent); font-size: .95rem; margin-bottom: 1rem; display: block; }

/* ---------- Content + sidebar ---------- */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 3rem; align-items: start; }
@media (max-width: 860px) { .with-aside { grid-template-columns: 1fr; } }

/* ---------- GitHub button (header) ---------- */
.gh-btn { display: inline-flex; align-items: center; gap: .5rem; color: var(--brand-ink); text-decoration: none; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); padding: .5rem .85rem; font-weight: 600; font-size: .9rem; }
.gh-btn:hover { border-color: var(--accent); color: var(--brand-ink); background: rgba(255,255,255,.05); }
.gh-btn svg { width: 18px; height: 18px; }
@media (max-width: 480px) { .gh-btn span { display: none; } }

/* ---------- Compiler pipeline panel ---------- */
.pipeline { background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 10px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35); font-family: var(--font-mono); }
.pipeline-bar { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid var(--code-line); color: var(--code-muted); font-size: .75rem; }
.pipeline ol { list-style: none; margin: 0; padding: .6rem 1.2rem; }
.pipeline li { display: grid; grid-template-columns: .65rem minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .55rem 0; margin: 0; color: var(--code-ink); font-size: .86rem; border-bottom: 1px dashed var(--code-line); }
.pipeline li:last-child { border-bottom: 0; }
.pipeline .dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--code-line); transition: background .2s, box-shadow .2s; }
.pipeline .io { color: var(--code-muted); font-size: .74rem; text-align: right; }
.pipeline li.done .dot { background: var(--code-str); }
.pipeline li.active .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(238, 122, 69, .25); }
.pipeline li.active { color: #fff; }
.pipeline-foot { border-top: 1px solid var(--code-line); padding: .8rem 1.2rem; font-size: .8rem; color: #aebfcd; font-family: var(--font-body); }
.pipeline-foot b { color: var(--code-num); font-weight: 600; }
@media (max-width: 480px) { .pipeline .io { display: none; } .pipeline li { grid-template-columns: .65rem minmax(0, 1fr); } }

/* ---------- Pipeline (light, in-page version for docs) ---------- */
.flow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.flow li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; font-family: var(--font-mono); font-size: .82rem; }
.flow li + li::before { content: "→"; color: var(--accent); margin-right: .5rem; margin-left: -.1rem; }
.flow li:last-child { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Acronym (about) ---------- */
.acronym { font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 500; line-height: 1.35; margin: 0 0 1rem; color: var(--ink-soft); }
.acronym b { color: var(--accent); font-weight: 800; }

/* ---------- Misc ---------- */
.state { color: var(--muted); padding: 1rem 1.25rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); margin: 0 0 1.5rem; }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.post .tags { align-items: center; }
.post .tags a { font-size: .88rem; font-weight: 600; text-decoration: none; }
.footer-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 960px) { .footer-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .footer-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Docs index (generated from docs/) ---------- */
.doc-group { display: flex; align-items: baseline; gap: .5rem; margin: 1.75rem 0 .6rem; font-size: 1.05rem; }
.doc-group .muted { font-family: var(--font-mono); font-size: .75rem; font-weight: 400; }
.doc-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.doc-list li { margin: 0; border-bottom: 1px solid var(--line); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list a { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: .65rem 1rem; color: var(--ink); text-decoration: none; }
.doc-list a:hover { background: var(--surface-2); color: var(--accent); }
.doc-label { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.doc-list a:not(:has(.doc-label)) .doc-title { grid-column: 1 / -1; }
.doc-meta { font-size: .85rem; margin-top: 1rem; }
@media (max-width: 480px) { .doc-list a { grid-template-columns: 1fr; gap: .1rem; } }

/* ==========================================================================
   Documentation pages (generated into docs/ from the repo's Markdown)
   ========================================================================== */
.doc-page { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 2.75rem; padding-block: 2rem 2rem; align-items: start; }
@media (max-width: 1140px) { .doc-page { grid-template-columns: 240px minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 860px) { .doc-page { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 1.25rem; } }

/* Left: search + chapter menu */
.doc-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
.doc-nav { min-height: 0; display: flex; flex-direction: column; }
.doc-nav summary { cursor: pointer; font-weight: 600; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); list-style: none; }
.doc-nav summary::-webkit-details-marker { display: none; }
.doc-nav summary::after { content: " ▾"; color: var(--muted); }
.doc-nav[open] summary::after { content: " ▴"; }
/* The chapter list scrolls inside the sidebar: viewport minus sticky offset, search box and gaps. */
.doc-nav nav { overflow-y: auto; font-size: .9rem; padding-right: .25rem; overscroll-behavior: contain; max-height: calc(100vh - 6.5rem); max-height: calc(100dvh - 6.5rem); }
.doc-nav h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .4rem; }
.doc-nav h4:first-child { margin-top: .25rem; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; }
.doc-nav li { margin: 0; }
.doc-nav a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .25rem; padding: .3rem .6rem; color: var(--ink-soft); text-decoration: none; border-left: 2px solid var(--line); line-height: 1.4; }
.doc-nav a:not(:has(.doc-nav-label))::before { content: ""; }
.doc-nav a:hover { color: var(--accent); border-left-color: var(--accent); }
.doc-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--accent); background: var(--accent-soft); }
.doc-nav-label { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); padding-top: .1rem; font-variant-numeric: tabular-nums; }
@media (min-width: 861px) { .doc-nav summary { display: none; } }
@media (max-width: 860px) { .doc-side { position: static; max-height: none; } .doc-nav nav { max-height: 60vh; padding: .5rem 0; } }

/* Search */
.doc-search { position: relative; }
.doc-search input { width: 100%; font: inherit; font-size: .92rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.doc-search input:focus { outline: none; border-color: var(--accent); }
.doc-search-results { position: absolute; z-index: 20; top: calc(100% + .35rem); left: 0; width: min(440px, calc(100vw - 2 * var(--gutter))); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-search-results ul { list-style: none; margin: 0; padding: .35rem; }
.doc-search-results li { margin: 0; }
.doc-search-results a { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border-radius: 4px; color: var(--ink); text-decoration: none; }
.doc-search-results a:hover, .doc-search-results a:focus { background: var(--surface-2); }
.doc-search-results b { font-weight: 600; font-size: .92rem; }
.doc-search-where { font-size: .75rem; color: var(--muted); font-family: var(--font-mono); }
.doc-search-snippet { font-size: .82rem; color: var(--ink-soft); }
.doc-search-snippet mark { background: var(--accent-soft); color: var(--accent); padding: 0 .1em; border-radius: 2px; }
.doc-search-empty { margin: 0; padding: .8rem 1rem; color: var(--muted); font-size: .9rem; }
.docs-search-hub { max-width: 560px; margin-top: 1.5rem; }

/* Middle: rendered Markdown */
.doc-content { min-width: 0; max-width: 78ch; }
.doc-content h1 { margin-bottom: 1rem; }
.doc-content h2 { margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.doc-content h3 { margin-top: 1.9rem; }
.doc-content h4 { margin-top: 1.5rem; }
.doc-content h2, .doc-content h3, .doc-content h4 { position: relative; scroll-margin-top: 1rem; }
.doc-content .anchor { position: absolute; left: -1.1em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.doc-content :is(h2, h3, h4):hover .anchor, .doc-content .anchor:focus { opacity: 1; }
.doc-content p, .doc-content li { color: var(--ink-soft); }
.doc-content li > p { margin-bottom: .4em; }
.doc-content ul, .doc-content ol { margin-bottom: 1.1em; }
.doc-content blockquote { margin: 0 0 1.25rem; padding: .75rem 1.1rem; border-left: 4px solid var(--link); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.doc-content blockquote p:last-child { margin-bottom: 0; }
.doc-content img { border-radius: var(--radius); border: 1px solid var(--line); }
.doc-content pre code { font-size: inherit; background: none; border: 0; padding: 0; }
.doc-content .table-wrap { margin: 0 0 1.5rem; }
.doc-content td { color: var(--ink-soft); }
.doc-content input[type="checkbox"] { margin-right: .4em; }

.doc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.doc-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.doc-pager a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.doc-pager a:hover { border-color: var(--accent); color: var(--accent); }
.doc-pager span { font-size: .8rem; color: var(--muted); }
.doc-pager .doc-pager-next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .doc-pager { grid-template-columns: 1fr; } .doc-pager .doc-pager-next { grid-column: auto; } }

/* Right: on this page */
.doc-toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1rem); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; font-size: .85rem; }
.doc-toc h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .25rem 0 .6rem; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.doc-toc li { margin: 0; }
.doc-toc a { display: block; padding: .25rem .8rem; color: var(--muted); text-decoration: none; line-height: 1.4; }
.doc-toc .lvl-3 a { padding-left: 1.6rem; font-size: .8rem; }
.doc-toc a:hover { color: var(--accent); }
