/* zcli — shared site styles. Tech/utility direction, terminal-native dark theme. */
:root {
  --bg:       #0c0d10;
  --surface:  #14161b;
  --surface2: #1a1d24;
  --fg:       #e7e9ee;
  --fg-soft:  #c9cdd6;   /* long-form body copy — brighter than --muted so articles don't read washed out */
  --muted:    #9298a4;
  --faint:    #838b98;   /* lifted from #646a76 to clear 4.5:1 on --bg for small labels */
  --border:   rgba(255, 255, 255, 0.08);
  --border2:  rgba(255, 255, 255, 0.14);
  --accent:   #f7a41d;            /* Zig amber */
  --accent-d: #d4860a;
  --green:    #57c97a;
  --red:      #f06969;
  --cyan:     #5ec8d8;
  --font:  -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", ui-monospace, "IBM Plex Mono", Menlo, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0;
  /* subtle grid texture */
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 56px 56px;
}
a { color: inherit; text-decoration: none; }
/* prose links (paragraphs + the changelog policy box) read as accent by default */
p a, .chglog-policy a { color: var(--accent); }
::selection { background: var(--accent); color: #1a1205; }

/* Visible keyboard focus on every interactive element (WCAG 2.4.7 / 2.4.13). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
[tabindex="-1"]:focus { outline: none; }   /* skip-link lands here; don't ring the whole region */

/* Honour reduced-motion: drop smooth scroll + neutralize transitions/animations. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip link — first tab stop on every page. */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--accent); color: #1a1205;
  font: 600 13px/1 var(--mono); padding: 10px 14px; border-radius: 8px;
  transition: top .15s;
}
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 13, 16, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand .glyph {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent); color: #1a1205; font-size: 14px; font-weight: 800;
}
.brand .ver { font-size: 11px; color: var(--faint); font-weight: 500; letter-spacing: 0.04em; padding-top: 2px; }
.nav nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav nav a { font-size: 14px; color: var(--muted); transition: color .15s; }
.nav nav a:hover, .nav nav a.active { color: var(--fg); }
.nav .gh {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border2); border-radius: 7px; padding: 7px 12px;
  font-size: 13px; color: var(--fg); transition: border-color .15s, background .15s;
}
.nav .gh:hover { border-color: var(--accent); background: rgba(247,164,29,0.06); }
.nav .gh svg { width: 15px; height: 15px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  padding: 12px 20px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
  transition: transform .08s ease, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #1a1205; }
.btn.primary:hover { background: #ffb02e; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border2); }
.btn.ghost:hover { border-color: var(--accent); }

/* ---------- eyebrow / headings ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.08; }
.lead { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* ---------- terminal window ---------- */
.term {
  background: #0a0b0e; border: 1px solid var(--border2); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #111318; border-bottom: 1px solid var(--border); }
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.term-bar .dot.r { background: #ff5f57; } .term-bar .dot.y { background: #febc2e; } .term-bar .dot.g { background: #28c840; }
.term-bar .ttl { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.term pre, .term code { font-family: var(--mono); font-size: 13.5px; line-height: 1.7; }
.term-body { padding: 20px 22px; overflow-x: auto; }
.term-body pre { color: #cfd3da; white-space: pre; }
.c-prompt { color: var(--accent); } .c-cmd { color: #fff; } .c-flag { color: var(--cyan); }
.c-ok { color: var(--green); } .c-err { color: var(--red); } .c-mut { color: var(--faint); }
.cursor { display: inline-block; width: 8px; height: 16px; background: var(--accent); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- code block ---------- */
.code {
  background: #0a0b0e; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: #111318; border-bottom: 1px solid var(--border); }
.code-head .fname { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.code-head .lang { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.code pre { margin: 0; padding: 18px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: #cfd3da; }
.code .kw { color: #d98cff; } .code .str { color: #9ece6a; } .code .fn { color: var(--cyan); } .code .cm { color: var(--faint); font-style: italic; } .code .at { color: var(--accent); } .code .num { color: #ff9e64; }

/* Zine (tree-sitter) syntax highlighting — SuperMD fenced code blocks in blog posts
   and the markdown guide pages (docs/testing, docs/errors).
   NB: Zine's Zig grammar tags plain identifiers with `constant`/`type`/`variable` too,
   so only the unambiguous classes get colors; identifiers stay the default. */
.post pre code .keyword, .post pre code .keyword_modifier, .post pre code .keyword_type,
.post pre code .keyword_function, .post pre code .keyword_exception,
.guide pre code .keyword, .guide pre code .keyword_modifier, .guide pre code .keyword_type,
.guide pre code .keyword_function, .guide pre code .keyword_exception { color: #d98cff; }
.post pre code .string, .post pre code .string_escape,
.guide pre code .string, .guide pre code .string_escape { color: #9ece6a; }
.post pre code .type_builtin, .guide pre code .type_builtin { color: var(--cyan); }
.post pre code .function, .post pre code .function_call, .post pre code .function_builtin,
.guide pre code .function, .guide pre code .function_call, .guide pre code .function_builtin { color: var(--cyan); }
.post pre code .number, .post pre code .boolean,
.guide pre code .number, .guide pre code .boolean { color: #ff9e64; }
.post pre code .comment, .guide pre code .comment { color: var(--faint); font-style: italic; }
.post pre code .operator, .post pre code .punctuation_delimiter, .post pre code .punctuation_bracket,
.guide pre code .operator, .guide pre code .punctuation_delimiter, .guide pre code .punctuation_bracket { color: #8b92a5; }

/* ---------- sections ---------- */
section { padding: 92px 0; border-top: 1px solid var(--border); }
.sec-head { max-width: 62ch; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.sec-head p { color: var(--muted); font-size: 17px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 48px 0 64px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
footer .cols { display: flex; gap: 64px; flex-wrap: wrap; }
footer .col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
footer .col a { display: block; color: var(--muted); font-size: 14px; padding: 6px 0; transition: color .15s; }
footer .col a:hover { color: var(--accent); }
footer .meta { color: var(--faint); font-size: 13px; font-family: var(--mono); }

@media (max-width: 720px) {
  /* Keep every nav link reachable — let the nav scroll horizontally
     instead of hiding links (a phone user still needs Docs/Plugins/Install). */
  .nav .wrap { gap: 14px; }
  .nav nav { gap: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav nav a { white-space: nowrap; flex: none; }
  .nav .gh { padding: 7px 10px; }
  section { padding: 64px 0; }
}

/* =====================================================================
   Shared cross-page components (redesign additions).
   Reuses the existing tokens only — no new colors/fonts introduced.
   ===================================================================== */

/* measured-claim affordance — small mono tag linking to /why/#numbers */
.measured {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--green); border: 1px solid rgba(87,201,122,0.28);
  background: rgba(87,201,122,0.08); border-radius: 999px;
  padding: 2px 9px 2px 7px; white-space: nowrap; transition: border-color .15s, background .15s;
}
.measured:hover { border-color: var(--green); background: rgba(87,201,122,0.14); }

/* ---------- folder → CLI interactive mapping (home, signature component) ---------- */
.foldermap { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--border2); border-radius: 12px; overflow: hidden; background: #0a0b0e; }
.foldermap .fm-tree { padding: 22px 4px; border-right: 1px solid var(--border); }
.foldermap .fm-tree .fm-head { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 0 20px 14px; }
.fm-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13.5px; color: var(--muted); padding: 7px 20px; cursor: pointer; border-left: 2px solid transparent; transition: all .12s; }
.fm-row .fm-indent { display: inline-block; }
.fm-row:hover, .fm-row.on { color: var(--fg); background: rgba(247,164,29,0.07); border-left-color: var(--accent); }
.fm-row .fm-dir { color: var(--cyan); }
.foldermap .fm-term { padding: 22px 24px; }
.foldermap .fm-term .fm-head { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.foldermap .fm-term pre { font-family: var(--mono); font-size: 13.5px; line-height: 1.85; color: #cfd3da; min-height: 190px; white-space: pre-wrap; }
.foldermap .fm-term .c-prompt { color: var(--accent); } .foldermap .fm-term .c-cmd { color: #fff; } .foldermap .fm-term .c-mut { color: var(--faint); }
.foldermap-caption { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.foldermap-caption svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
@media (max-width: 780px) { .foldermap { grid-template-columns: 1fr; } .foldermap .fm-tree { border-right: none; border-bottom: 1px solid var(--border); } }

/* ---------- type-safety comptime-error demo ---------- */
.errdemo { background: #0a0b0e; border: 1px solid rgba(240,105,105,0.3); border-radius: 10px; overflow: hidden; }
.errdemo .code-head { background: #150f10; border-bottom: 1px solid rgba(240,105,105,0.22); }
.errdemo pre { margin: 0; padding: 18px; font-family: var(--mono); font-size: 13px; line-height: 1.75; color: #cfd3da; overflow-x: auto; }
.errdemo .e-file { color: var(--red); } .errdemo .e-line { color: var(--faint); } .errdemo .e-msg { color: var(--red); } .errdemo .e-cmd { color: var(--accent); } .errdemo .e-hint { color: var(--faint); font-style: italic; }

/* ---------- numbers strip (home) ---------- */
.numstrip { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.numstrip .ns-item { flex: 1 1 190px; padding: 20px 22px; border-right: 1px solid var(--border); }
.numstrip .ns-item:last-child { border-right: none; }
.numstrip .ns-val { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.numstrip .ns-label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.numstrip .ns-item .measured { margin-top: 10px; }

/* ---------- meta-CLI / AI teaser (home) ---------- */
.metateaser { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.metateaser > * { min-width: 0; }
@media (max-width: 900px) { .metateaser { grid-template-columns: 1fr; } }

/* ---------- comparison teaser mini-cards (home) ---------- */
.cmp-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cmp-mini .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; }
.cmp-mini .card h4 { font-family: var(--mono); font-size: 14px; color: var(--fg); margin-bottom: 8px; }
.cmp-mini .card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
@media (max-width: 780px) { .cmp-mini { grid-template-columns: 1fr; } }

/* ---------- built-with-zcli (home) ---------- */
.builtwith { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.builtwith .bw { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.builtwith .bw h4 { font-size: 15.5px; margin-bottom: 6px; }
.builtwith .bw p { color: var(--muted); font-size: 13.5px; }
.builtwith .bw.add { display: flex; align-items: center; justify-content: center; text-align: center; border-style: dashed; border-color: var(--border2); color: var(--faint); font-family: var(--mono); font-size: 13px; }
@media (max-width: 780px) { .builtwith { grid-template-columns: 1fr; } }

/* ---------- /why/ page ---------- */
.why-hero { padding: 72px 0 8px; max-width: 68ch; }
.why-hero h1 { font-size: clamp(32px, 4.6vw, 48px); }
.why-hero .lead { margin-top: 18px; font-size: 18px; }
.why-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0 0; }
.why-nav a { font-family: var(--mono); font-size: 12.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; transition: all .15s; }
.why-nav a:hover { color: var(--accent); border-color: var(--accent); }

.cmp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cmp-table th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0 16px 14px; border-bottom: 1px solid var(--border); font-weight: 500; }
.cmp-table td { padding: 15px 16px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--muted); }
.cmp-table td.hl { color: var(--fg); }
.cmp-table th.zcli-col, .cmp-table td.zcli-col { background: rgba(247,164,29,0.05); }

.contrast { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.contrast > * { min-width: 0; }
@media (max-width: 780px) { .contrast { grid-template-columns: 1fr; } }

.num-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 8px; }
.num-table td { padding: 13px 4px; border-bottom: 1px solid var(--border); }
.num-table td.metric { color: var(--muted); }
.num-table td.value { font-family: var(--mono); color: var(--fg); text-align: right; white-space: nowrap; }
details.repro { margin-top: 4px; }
details.repro summary { cursor: pointer; font-family: var(--mono); font-size: 11.5px; color: var(--faint); list-style: none; }
details.repro summary::-webkit-details-marker { display: none; }
details.repro summary::before { content: "▸ "; color: var(--accent); }
details.repro[open] summary::before { content: "▾ "; }
details.repro pre { margin-top: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: #0a0b0e; border: 1px solid var(--border); border-radius: 7px; padding: 10px 14px; overflow-x: auto; }

.zig-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 8px; }
.zig-table th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0 14px 12px; border-bottom: 1px solid var(--border); font-weight: 500; }
.zig-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.zig-table td.zcli-v { font-family: var(--mono); color: var(--accent); }

/* ---------- /changelog/ page ---------- */
.chglog-policy { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 18px 22px; margin-bottom: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.chglog-policy b { color: var(--fg); }
/* The release list is markdown generated from CHANGELOG.md (see
   website/sync-site-data.sh), so these rules style plain elements. */
.chglog h2 { font-family: var(--mono); font-size: 22px; color: var(--fg); margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--border); scroll-margin-top: 84px; }
.chglog h2:first-child { border-top: none; margin-top: 8px; padding-top: 0; }
.chglog h2 + p { color: var(--muted); font-size: 15px; margin: 8px 0 18px; max-width: 68ch; }
.chglog p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.chglog h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin: 20px 0 8px; }
.chglog ul { color: var(--muted); font-size: 14.5px; margin-left: 20px; }
.chglog li { padding: 5px 0; line-height: 1.6; }
.chglog li b, .chglog li strong { color: var(--fg); }
.chglog a { color: var(--accent); }
.chglog code { font-family: var(--mono); font-size: 0.88em; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--accent); }

/* ---------- docs hub additions ---------- */
.prompt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prompt-grid .pcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.prompt-grid .pcard h4 { font-family: var(--mono); font-size: 13.5px; color: var(--accent); margin-bottom: 6px; }
.prompt-grid .pcard p { color: var(--muted); font-size: 13px; margin: 0; }
@media (max-width: 700px) { .prompt-grid { grid-template-columns: 1fr; } }

.tier-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 18px; }
.tier-table th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0 14px 10px; border-bottom: 1px solid var(--border); font-weight: 500; }
.tier-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
.tier-table td.tier { font-family: var(--mono); color: var(--accent); white-space: nowrap; }

.transcript { background: #0a0b0e; border: 1px solid var(--border2); border-radius: 10px; padding: 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.85; color: var(--muted); white-space: pre-wrap; overflow-x: auto; }
.transcript .t-agent { color: var(--cyan); } .transcript .t-cmd { color: var(--accent); } .transcript .t-ok { color: var(--green); } .transcript .t-you { color: var(--fg); }
