/* Layout idea: a technical field guide — narrow reading column, a ledger-like rail for metadata, code shown as instrument readouts. */
:root {
  --paper: #f3f5f4;
  --surface: #ffffff;
  --ink: #15201d;
  --muted: #55625e;
  --line: #d5ddda;
  --accent: #1f4fd1;
  --accent-ink: #ffffff;
  --signal: #b4570c;
  --signal-bg: #fbf0e4;
  --ok: #1d7a4a;
  --ok-bg: #e5f4ec;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --code-bg: #e9eeec;
  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: 2.2rem;
  --step-4: 2.9rem;
  --measure: 66ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1513;
    --surface: #161e1b;
    --ink: #e4ebe8;
    --muted: #9aa9a4;
    --line: #2a3632;
    --accent: #8aa6ff;
    --accent-ink: #0f1513;
    --signal: #f0a35c;
    --signal-bg: #2a1e12;
    --ok: #6fd3a0;
    --ok-bg: #12261c;
    --bad: #ff8a80;
    --bad-bg: #2c1514;
    --code-bg: #1c2522;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1513;
  --surface: #161e1b;
  --ink: #e4ebe8;
  --muted: #9aa9a4;
  --line: #2a3632;
  --accent: #8aa6ff;
  --accent-ink: #0f1513;
  --signal: #f0a35c;
  --signal-bg: #2a1e12;
  --ok: #6fd3a0;
  --ok-bg: #12261c;
  --bad: #ff8a80;
  --bad-bg: #2c1514;
  --code-bg: #1c2522;
  color-scheme: dark;
}

@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); margin: 0 0 0.5rem; }
h2 { font-size: var(--step-2); margin: 2.6rem 0 0.8rem; scroll-margin-top: 1rem; }
h3 { font-size: var(--step-1); margin: 1.8rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.55rem; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--accent); }

/* Home */
.intro { padding: 3rem 0 2rem; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; }
.intro p.lede { font-size: var(--step-1); color: var(--muted); max-width: 40ch; margin: 0; }
.facts { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 1rem 1.2rem; display: grid; gap: 0.55rem; font-size: var(--step--1); }
.facts div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: 0.45rem; }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.facts-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); padding-bottom: 3rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; }
.card.lead { border-top: 4px solid var(--accent); }
.card h2, .card h3 { margin: 0; font-size: var(--step-1); }
.card p { margin: 0; color: var(--muted); }
.card .kicker { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card .more { margin-top: auto; font-family: var(--font-display); font-weight: 600; }
.card.soon { border-style: dashed; }

/* Article */
.article-head { padding: 2.6rem 0 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.8rem; }
.article-head p.lede { font-size: var(--step-1); color: var(--muted); max-width: var(--measure); margin: 0.6rem 0 1rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.crumbs { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(12rem, 16rem); gap: 3rem; align-items: start; padding-bottom: 4rem; }
.prose { min-width: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.4rem; font-size: 0.95rem; }
.table-scroll { overflow-x: auto; margin-bottom: 1.4rem; }
.table-scroll table { margin: 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-display); font-weight: 600; background: var(--surface); }
.prose pre { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 2.6rem 1rem 1rem; overflow-x: auto; margin: 0 0 1.4rem; }
.prose pre code { background: none; padding: 0; font-size: 0.82rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-btn { position: absolute; top: 0.5rem; right: 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 0.82rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 5px; padding: 0.25rem 0.7rem; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.callout { border-left: 4px solid var(--signal); background: var(--signal-bg); padding: 0.9rem 1rem; border-radius: 0 6px 6px 0; margin: 0 0 1.4rem; }
.callout p:last-child { margin-bottom: 0; }
.disclosure { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 0.9rem 1rem; font-size: 0.95rem; margin-bottom: 1.6rem; }
.toc { position: sticky; top: 1rem; border-left: 2px solid var(--line); padding-left: 1rem; font-size: 0.9rem; }
.toc p { font-family: var(--font-display); font-weight: 600; margin-bottom: 0.5rem; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.4rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.prose .faq h3 { font-size: 1.1rem; }

/* Wallet check */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.4rem; margin-bottom: 2rem; }
.tool label { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 0.5rem; }
.tool .row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tool input { flex: 1 1 22rem; min-width: 0; font-family: var(--font-mono); font-size: 0.9rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); }
.btn { font-family: var(--font-display); font-weight: 600; font-size: 1rem; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 0.7rem 1.2rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.result { margin-top: 1rem; border-radius: 6px; padding: 1rem; display: none; }
.result.show { display: block; }
.result.ok { background: var(--ok-bg); border: 1px solid var(--ok); }
.result.bad { background: var(--bad-bg); border: 1px solid var(--bad); }
.result .status { font-family: var(--font-display); font-weight: 700; margin-bottom: 0.4rem; }
.result.ok .status { color: var(--ok); }
.result.bad .status { color: var(--bad); }
.result .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.result code { word-break: break-all; }

.placeholder { border: 2px dashed var(--bad); background: var(--bad-bg); padding: 1rem; border-radius: 6px; margin-bottom: 1.4rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2rem 0; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; order: -1; margin-bottom: 1.6rem; }
}
@media (max-width: 480px) {
  h1 { font-size: var(--step-3); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
@media (max-width: 900px) { .toc.toc-after { order: 0; margin-top: 1rem; } }
