/* curtlang.com — fresh brand. Precise, editorial-technical; ink/paper
   monochrome with a single lime signal. Distinct from the playground's
   terminal-orange tool UI. Dark-first, light supported. Structure follows
   docs/UX-BLUEPRINT.md (spatial annotated specimen).

   Spacing is a 4px scale (--s-*) — no off-scale one-offs. Surfaces are flat
   by default (hairline borders, no drop shadow); the single hero specimen is
   the one deliberately elevated element. */
:root {
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1140px;
  --r: 10px;
  --r-sm: 6px;

  /* spacing scale — 4px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 64px; --s-10: 80px;
}
:root, [data-theme="dark"] {
  --bg: #0b0d10;
  --bg-2: #0f1216;
  --panel: #14181d;
  --panel-2: #191e24;
  --line: #232a31;
  --line-2: #2e373f;
  --ink: #eef1f4;
  --ink-2: #c4ccd4;
  --dim: #8a939d;
  --accent: #b6f24a;
  --accent-strong: #c8f96e;
  --accent-ink: #0b0d10;
  --good: #b6f24a;
  --warn: #f2a93f;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 40px rgba(0,0,0,.35);
  --grid: rgba(255,255,255,.035);
}
[data-theme="light"] {
  --bg: #fbfbf8;
  --bg-2: #f3f3ee;
  --panel: #ffffff;
  --panel-2: #f7f7f2;
  --line: #e4e4da;
  --line-2: #d4d4c8;
  --ink: #14171a;
  --ink-2: #353b41;
  --dim: #5d646c;
  --accent: #88c70a;
  --accent-strong: #4f7d06;
  --accent-ink: #0b0d10;
  --good: #4f7d06;
  --warn: #9a5b00;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 36px rgba(0,0,0,.06);
  --grid: rgba(0,0,0,.03);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.6; font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}
a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 750; margin: 0 0 var(--s-3); }
code, pre, .mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.tiny { font-size: 12.5px; }
/* horizontal gutters only — must NOT clobber the vertical padding that
   `section` sets (the shorthand `padding: 0 …` did, zeroing section rhythm). */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--s-6); }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  max-width: var(--maxw); margin: 0 auto; padding: var(--s-3) var(--s-6);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; font-family: var(--mono); font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.04em; }
.brand.small { font-size: 16px; }
.brand-mark { width: 14px; height: 18px; background: var(--accent); border-radius: 2px; display: inline-block; animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .brand-mark { animation: none; } }
.nav-links { display: flex; align-items: center; gap: var(--s-5); }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 14.5px; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { content: ""; display: block; height: 2px; background: var(--accent); margin-top: var(--s-1); }
.nav-links a.ext { color: var(--dim); }
.nav-sep { width: 1px; height: 18px; background: var(--line-2); }
.theme-toggle { display: inline-flex; align-items: center; gap: var(--s-2); background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); font: inherit; font-size: 13px; cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--ink); font-size: 18px; width: 38px; height: 36px; cursor: pointer; }

main { display: block; }
section { padding: var(--s-9) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: var(--s-3); }

/* ---- hero ---- */
.hero { padding-top: var(--s-8); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -0.04em; max-width: 16ch; }
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.4rem); color: var(--ink-2); max-width: 52ch; margin: var(--s-4) 0 var(--s-6); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.specimen-caption { max-width: 72ch; margin: var(--s-6) 0 0; font-size: 14.5px; line-height: 1.65; }
.prose { max-width: 62ch; }
.prose p { color: var(--ink-2); margin: 0 0 var(--s-4); font-size: 1.02rem; }
.prose .links-row { margin-top: var(--s-5); }
em { font-style: italic; color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-radius: var(--r-sm); font-weight: 650; font-size: 15px; text-decoration: none; border: 1px solid var(--line-2); color: var(--ink); background: var(--panel); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }

/* ---- specimen (annotated code) — the one elevated element ---- */
.specimen { margin-top: var(--s-8); }
.specimen-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.specimen-title { font-family: var(--mono); font-size: 13.5px; color: var(--dim); }
.specimen-title b { color: var(--ink); font-weight: 650; }
.specimen-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--s-4); align-items: stretch; }
.spec-main { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-4); }
.code {
  margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-5) var(--s-6); font-size: 14.5px; line-height: 1.7; overflow-x: auto;
  box-shadow: var(--shadow); white-space: pre; tab-size: 2;
}
.code .an { border-radius: 3px; padding: 1px 3px; margin: -1px -1px; cursor: default; transition: background .12s, color .12s; border-bottom: 2px solid transparent; }
.code .an[data-an]:hover, .code .an.lit { background: color-mix(in srgb, var(--accent) 22%, transparent); border-bottom-color: var(--accent); }
.code .cm { color: var(--dim); }
.code .kw { color: var(--accent-strong); }
.code .st { color: var(--ink-2); }

.annotations { display: flex; flex-direction: column; gap: var(--s-2); }
.annot { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel-2); padding: var(--s-3); transition: border-color .12s, background .12s; }
.annot.lit { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); }
.annot .marker { font-family: var(--mono); color: var(--accent-strong); font-weight: 700; margin-right: var(--s-2); }
.annot .meaning { font-size: 14px; }
.annot .cost { font-family: var(--mono); font-size: 12px; color: var(--dim); display: block; margin-top: var(--s-1); }

.specimen-nav { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-4); }
.specimen-nav button { background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); cursor: pointer; font: inherit; font-size: 13px; }
.specimen-nav button:hover { border-color: var(--accent); }
.dots { display: inline-flex; gap: var(--s-2); }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.dots i.on { background: var(--accent); }

/* ---- compare rail ---- */
.compare { margin-top: 0; display: flex; align-items: stretch; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.compare .cell { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: var(--s-4) var(--s-5); border-right: 1px solid var(--line); }
.compare .cell:last-child { border-right: none; align-items: flex-end; text-align: right; }
.compare .lang { font-family: var(--mono); font-size: 12px; color: var(--dim); text-transform: lowercase; }
.compare .n { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.compare .cell.win .n { color: var(--accent-strong); }
.compare .repro { font-size: 13px; }
@media (max-width: 560px) { .compare { flex-wrap: wrap; } .compare .cell { flex-basis: 33%; } }

/* ---- proof band (flat, divider-separated — not stat cards) ---- */
.proof { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: var(--s-7); border-top: 1px solid var(--line); }
.proof .stat { padding: var(--s-5) var(--s-6) 0 var(--s-6); border-left: 1px solid var(--line); }
.proof .stat:first-child { border-left: none; padding-left: 0; }
.proof .stat .n { font-family: var(--mono); font-size: 26px; font-weight: 750; color: var(--accent-strong); display: block; }
.proof .stat .l { font-size: 13px; color: var(--ink-2); margin-top: var(--s-2); display: block; }
.proof .stat a { color: var(--dim); font-size: 12px; display: inline-block; margin-top: var(--s-2); }

/* ---- generic content ---- */
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.grid2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--s-7); align-items: start; margin-top: var(--s-6); }
.tour-block { margin-top: var(--s-7); }
.tour-block h3 { font-family: var(--mono); font-size: 15px; color: var(--accent-strong); letter-spacing: 0; }
.links-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); }

/* ---- feature list (definition style — distinct from code annotations) ---- */
.featurelist { display: flex; flex-direction: column; }
.featurelist .feat { padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.featurelist .feat:first-child { border-top: none; padding-top: 0; }
.featurelist .feat b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 650; color: var(--accent-strong); letter-spacing: 0; margin-bottom: var(--s-1); }
.featurelist .feat span { font-size: 14.5px; color: var(--ink-2); }

/* ---- claim ledger ---- */
.ledger { width: 100%; border-collapse: collapse; margin-top: var(--s-5); font-size: 15px; }
.ledger th, .ledger td { text-align: left; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.ledger .claim { font-weight: 600; }
.ledger .measured { font-family: var(--mono); color: var(--accent-strong); white-space: nowrap; }
.ledger .measured.warn { color: var(--warn); }
.ledger .repro a { font-family: var(--mono); font-size: 13px; color: var(--dim); white-space: nowrap; }
.ledger tr:hover td { background: var(--panel-2); }

/* ---- data tables ---- */
.tbl { width: 100%; border-collapse: collapse; margin-top: var(--s-4); font-size: 14px; }
.tbl th, .tbl td { padding: var(--s-3); border-bottom: 1px solid var(--line); text-align: right; font-family: var(--mono); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--dim); font-weight: 600; font-size: 12px; }
.tbl td.hi { color: var(--accent-strong); font-weight: 700; }
.tbl caption { text-align: left; color: var(--dim); font-size: 13px; margin-bottom: var(--s-2); font-family: var(--sans); }

.note { border-left: 3px solid var(--accent); background: var(--panel-2); padding: var(--s-4) var(--s-5); border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-top: var(--s-6); color: var(--ink-2); font-size: 14.5px; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--line); padding: var(--s-8) var(--s-6) var(--s-7); max-width: var(--maxw); margin: 0 auto; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--s-7); }
.footer h4 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: var(--s-3); }
.footer a { display: block; color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 3px 0; }
.footer a:hover { color: var(--accent-strong); }
.foot-base { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.foot-base .sep { color: var(--line-2); }

/* ---- responsive ---- */
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav-links { position: absolute; top: 100%; right: 12px; left: 12px; flex-direction: column; align-items: flex-start; gap: var(--s-4); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: var(--s-5); display: none; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-sep { display: none; }
  .specimen-grid, .grid2 { grid-template-columns: 1fr; }
  .proof { grid-template-columns: 1fr 1fr; }
  .proof .stat { border-left: none; padding-left: 0; }
  .foot-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .compare .cell:last-child { margin-left: 0; }
}
@media (max-width: 460px) { .proof { grid-template-columns: 1fr; } }
