/* site.css — the Clearsigned site design system (2026-09-25 redesign, palette v2).
 * One stylesheet for the landing, launch post, sweep, scanner pages and the
 * Learn pages. Legacy token names (--color-*, --space-*) are kept as aliases so
 * pages generated against the older tokens.css/app.css render on this system.
 *
 * Identity: petrol ink on warm paper. The accent is the color of signature ink;
 * the dark band (header, footer) is the ledger cover. Verdict colors are
 * semantic only: green supports, copper refutes, ochre abstains. */

:root {
  color-scheme: light;
  --bg: #f8f7f2;          /* warm paper */
  --bg-2: #eeece4;        /* sand: code blocks, quiet surfaces */
  --surface: #ffffff;     /* cards, the receipt, tiles */
  --ink: #17201f;
  --muted: #5a6462;
  --rule: #dddbd2;
  --rule-strong: #c3c1b6;

  --accent: #0b5e7a;        /* petrol ink */
  --accent-strong: #08475c;
  --accent-soft: #e3ecf0;   /* tinted bands */
  --on-accent: #f8f7f2;
  --mark: #6ec1d6;          /* the brand mark, same in both themes */

  --band: #0e2f3b;          /* header + footer */
  --on-band: #e8eef0;
  --band-muted: #9db3bc;

  --ok: #1f7a3e;    --ok-bg: #e4f1e7;
  --bad: #b4532a;   --bad-bg: #f7e6de;
  --warn: #9a6a00;  --warn-bg: #f6edd3;

  --paper-shadow: 0 1px 0 rgba(23,32,31,.06), 0 18px 40px -24px rgba(14,47,59,.45);

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 44rem;
  --wide: 66rem;

  /* legacy names used by generated Learn pages */
  --color-bg: var(--bg);
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --color-border: var(--rule);
  --color-accent: var(--accent);
  --color-error: var(--bad);
  --color-warning: var(--warn);
  --text-base: 16px;
  --leading-body: 1.6;
  --content-measure: var(--measure);
  --space-xs: .5rem; --space-sm: 1rem; --space-md: 1.75rem; --space-lg: 3rem; --space-xl: 4.5rem;
  --radius: 4px;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1514; --bg-2: #172020; --surface: #1b2625; --ink: #e7ecea; --muted: #9da9a6;
    --rule: #263230; --rule-strong: #3a4844;
    --accent: #6ec1d6; --accent-strong: #9ad6e6; --accent-soft: #14242a; --on-accent: #0f1514;
    --band: #0a1c23; --on-band: #dce6e9; --band-muted: #8fa5ad;
    --ok: #6bcf92; --ok-bg: #14291c; --bad: #f0a07c; --bad-bg: #2f1b12; --warn: #e5b85a; --warn-bg: #2c2410;
    --paper-shadow: 0 1px 0 rgba(0,0,0,.5), 0 18px 40px -24px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1514; --bg-2: #172020; --surface: #1b2625; --ink: #e7ecea; --muted: #9da9a6;
  --rule: #263230; --rule-strong: #3a4844;
  --accent: #6ec1d6; --accent-strong: #9ad6e6; --accent-soft: #14242a; --on-accent: #0f1514;
  --band: #0a1c23; --on-band: #dce6e9; --band-muted: #8fa5ad;
  --ok: #6bcf92; --ok-bg: #14291c; --bad: #f0a07c; --bad-bg: #2f1b12; --warn: #e5b85a; --warn-bg: #2c2410;
  --paper-shadow: 0 1px 0 rgba(0,0,0,.5), 0 18px 40px -24px rgba(0,0,0,.9);
}

/* ── base ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-sans);
}
a { color: var(--accent); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.75rem); font-weight: 600; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p, ul, ol, table, pre, dl { margin: 0; }
.stack > * + * { margin-top: 1rem; }
code, pre, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--bg-2); padding: .1em .35em; border-radius: 3px; }
pre {
  background: var(--bg-2); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 4px; padding: .9rem 1.1rem; overflow-x: auto; line-height: 1.5; font-size: .86rem;
}
pre code { background: none; padding: 0; font-size: inherit; }
.wrap { max-width: var(--measure); margin: 0 auto; padding-inline: 1.25rem; }
.wrap--wide { max-width: var(--wide); }
.eyebrow {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── the band: header and footer ─────────────────────────────────────────── */
.topbar, header.site { background: var(--band); color: var(--on-band); }
.topbar .wrap, .topbar .wrap--wide, header.site .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: .85rem; flex-wrap: wrap;
}
.brand { font-weight: 600; text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .55rem; color: var(--on-band); }
.brand:hover { color: var(--on-band); text-decoration: none; }
.brand__mark { width: 14px; height: 14px; border: 2px solid var(--mark); border-radius: 2px; position: relative; }
.brand__mark::after { content: ""; position: absolute; inset: 3px; background: var(--mark); }
.topbar nav, header.site nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .95rem; }
.topbar nav a, header.site nav a { text-decoration: none; color: var(--band-muted); margin: 0; }
.topbar nav a:hover, header.site nav a:hover { color: var(--on-band); }
.topbar nav a[aria-current="page"], header.site nav a[aria-current="page"] { color: var(--on-band); font-weight: 600; box-shadow: inset 0 -2px 0 var(--mark); }

footer.site { background: var(--band); color: var(--band-muted); padding-block: 2rem 3rem; font-size: .88rem; margin-top: 3rem; }
footer.site .wrap, footer.site .wrap--wide { display: grid; gap: .6rem; }
footer.site a { color: var(--on-band); }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── page head: every sub page opens on the tinted band ──────────────────── */
.page-head { background: var(--accent-soft); border-bottom: 1px solid var(--rule); padding-block: 2.75rem 2.25rem; }
.page-head .wrap, .page-head .wrap--wide { display: grid; gap: .75rem; }
.page-head .lede { max-width: 40rem; }
.byline { font-size: .88rem; color: var(--muted); font-family: var(--font-mono); }
main { display: block; }
.section { padding-block: 3.5rem; }
.section + .section { border-top: 1px solid var(--rule); }
.section__head { display: grid; gap: .6rem; margin-bottom: 1.75rem; max-width: 40rem; }
.article { display: grid; gap: 1.1rem; padding-block: 2.5rem 1rem; }
.article h2 { margin-top: 1.4rem; }
.article h3 { margin-top: .6rem; }
.article ul, .article ol { padding-left: 1.2rem; display: grid; gap: .5rem; }
.article blockquote, .pull-quote { margin: 0; padding: .25rem 0 .25rem 1rem; border-left: 3px solid var(--accent); color: var(--ink); font-size: 1.1rem; }

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero { background: var(--accent-soft); border-bottom: 1px solid var(--rule); padding-block: 3.5rem 3.25rem; }
.hero__grid { display: grid; gap: 2.5rem; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3.5rem; } }
.hero__copy { display: grid; gap: 1.25rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  font-weight: 500; font-size: .95rem; padding: .65rem 1.05rem; border-radius: 4px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }

/* ── the receipt ─────────────────────────────────────────────────────────── */
.receipt {
  position: relative; background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule-strong); border-bottom: 0; border-radius: 3px 3px 0 0;
  box-shadow: var(--paper-shadow);
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.5;
  padding: 1.1rem 1.2rem 1.4rem;
}
.receipt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); border-radius: 3px 3px 0 0; }
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background:
    linear-gradient(-45deg, transparent 5.66px, var(--surface) 0),
    linear-gradient(45deg, transparent 5.66px, var(--surface) 0);
  background-size: 16px 16px; background-repeat: repeat-x;
}
.receipt__head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding-bottom: .6rem; border-bottom: 1px dashed var(--rule-strong); margin-bottom: .6rem; }
.receipt__title { font-weight: 600; letter-spacing: .06em; color: var(--accent); }
.receipt__tag { color: var(--muted); font-size: .72rem; }
.receipt__rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1rem; }
.receipt__rows dt { color: var(--muted); }
.receipt__rows dd { margin: 0; overflow-wrap: anywhere; }
.receipt__sig { margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed var(--rule-strong); color: var(--muted); }
.receipt__sig b { color: var(--accent); font-weight: 600; }
.receipt__caption { font-family: var(--font-sans); font-size: .82rem; color: var(--muted); margin-top: 1.3rem; }
.verdict {
  display: inline-block; font-family: var(--font-mono); font-weight: 600; font-size: .78rem; letter-spacing: .04em;
  padding: .1em .5em; border-radius: 3px; border: 1px solid currentColor;
}
.verdict--supported { color: var(--ok); background: var(--ok-bg); }
.verdict--refuted { color: var(--bad); background: var(--bad-bg); }
.verdict--unverifiable { color: var(--warn); background: var(--warn-bg); }
.stance { display: inline-block; min-width: 5.2em; }
.stance--supports { color: var(--ok); }
.stance--refutes { color: var(--bad); }
.stance--neutral { color: var(--muted); }

/* ── live tiles ──────────────────────────────────────────────────────────── */
.tiles { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); padding: 1rem 1.1rem; display: grid; gap: .25rem; align-content: start; }
.tile__label { font-size: .78rem; color: var(--muted); }
.tile__value { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); }
.tile__value small { font-size: .8rem; font-weight: 400; color: var(--muted); margin-left: .35rem; }
.tile__note { font-size: .78rem; color: var(--muted); }
.tiles__caption { font-size: .82rem; color: var(--muted); margin-top: .6rem; }

/* ── tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  font: 500 .9rem/1 var(--font-sans); background: none; border: 0; color: var(--muted);
  padding: .65rem .9rem; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.panel[hidden] { display: none !important; }
.panel { display: grid; gap: .75rem; }

/* ── steps / lists / rule cards ──────────────────────────────────────────── */
.steps { list-style: none; padding: 0; display: grid; gap: 1.25rem; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .75rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  font-family: var(--font-mono); font-size: .8rem; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 50%; width: 1.8rem; height: 1.8rem;
  display: inline-grid; place-items: center; margin-top: .1rem;
}
.steps h3 { margin-bottom: .25rem; }
.bullets { padding-left: 1.2rem; display: grid; gap: .6rem; }
.bullets li::marker { color: var(--accent); }
.rules { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rule-card { border-top: 3px solid var(--accent); padding-top: .75rem; display: grid; gap: .35rem; }
.rule-card h3 { font-size: 1rem; }
.rule-card p { font-size: .92rem; color: var(--muted); }

/* ── tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-size: .78rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-mono); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
tr.is-live td { font-weight: 600; background: var(--accent-soft); }
.grade {
  display: inline-grid; place-items: center; font-family: var(--font-mono); font-weight: 600;
  width: 1.8em; height: 1.8em; border-radius: 3px; border: 1px solid currentColor; font-size: .85rem;
}
.grade--A, .grade--B { color: var(--ok); background: var(--ok-bg); }
.grade--C { color: var(--warn); background: var(--warn-bg); }
.grade--D, .grade--F { color: var(--bad); background: var(--bad-bg); }

/* ── notes / callouts ────────────────────────────────────────────────────── */
.note, .cta { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: .9rem 1.1rem; display: grid; gap: .4rem; font-size: .95rem; border-radius: 0 4px 4px 0; }
.note__label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* ── scanner ─────────────────────────────────────────────────────────────── */
.scan-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.scan-form input {
  flex: 1 1 16rem; font: 1rem var(--font-mono); padding: .65rem .8rem; border: 1px solid var(--rule-strong);
  border-radius: 4px; background: var(--surface); color: var(--ink); min-width: 0;
}
.scan-form input:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.scan-form button { font: 500 .95rem var(--font-sans); padding: .65rem 1.05rem; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.scan-form button:hover { background: var(--accent-strong); }
.score { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.score__grade { font-family: var(--font-mono); font-weight: 600; font-size: 3.2rem; line-height: 1; width: 1.4em; height: 1.4em; display: inline-grid; place-items: center; border-radius: 6px; border: 2px solid currentColor; }
.score__points { font-family: var(--font-mono); font-size: 1.1rem; color: var(--muted); }
.pillar { display: grid; gap: .5rem; }
.pillar h3 { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-top: .75rem; }
.check { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) max-content; gap: .6rem; padding: .7rem .8rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
.check__mark { font-family: var(--font-mono); font-weight: 600; }
.check--pass .check__mark { color: var(--ok); }
.check--fail .check__mark { color: var(--bad); }
.check--fail { border-left: 3px solid var(--bad); }
.check--pass { border-left: 3px solid var(--ok); }
.check__name { font-family: var(--font-mono); font-size: .9rem; font-weight: 600; }
.check__found { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.check__fix { font-size: .9rem; margin-top: .3rem; }
.check__fix b { font-weight: 600; color: var(--bad); }
.check__pts { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ── generated Learn pages (legacy class names) ──────────────────────────── */
header.site + main .wrap > h1:first-child, main > .wrap > h1:first-child { margin-top: 2.5rem; }
main > .wrap > .lede { margin-top: .75rem; }
.region { margin: var(--space-lg) 0; }
.region-title { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-family: var(--font-mono); margin-bottom: 1rem; font-weight: 600; }
.state { display: none; } .state[data-active] { display: block; }
.state.loading, .state.empty, .state.error, .state.stale { padding: var(--space-md); color: var(--muted); }
.state.error { color: var(--bad); } .state.stale { color: var(--warn); }
[data-slot] { display: grid; gap: 1rem; }
[data-slot] h2 { margin-top: 1.25rem; } [data-slot] h3 { margin-top: .75rem; }
[data-slot] > ul, [data-slot] ul { padding-left: 1.2rem; display: grid; gap: .8rem; }
[data-slot] li > p { color: var(--muted); font-size: .95rem; margin-top: .15rem; }
.detail { display: block; margin-top: var(--space-xs); font-size: .875rem; color: var(--muted); }
.todo { color: var(--muted); font-size: .875rem; }
.coming { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); border: 1px solid var(--rule-strong); border-radius: 3px; padding: .05em .4em; margin-left: .35em; }
.proof { font-family: var(--font-mono); font-size: .85rem; color: var(--accent); }
button[data-action] { padding: var(--space-sm) var(--space-md); background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--radius); cursor: pointer; font-size: 1rem; }
button[data-action]:hover { background: var(--accent-strong); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
