/* Layout: one reading column, a hand-lettered wordmark, evidence labels set in mono like lab tags. */
:root {
  --paper: #fafbf9;
  --paper-2: #f1f4f1;
  --ink: #1d211f;
  --muted: #5b645f;
  --line: #dce2de;
  --accent: #2e6a4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2eee7;
  --ev-research: #2e6a4f;
  --ev-guidance: #34589a;
  --ev-inference: #8f620e;
  --ev-unknown: #8a4848;
  --ev-stance: #5b645f;
  --font-hand: "Gaegu", "Comic Neue", cursive;
  --font-head: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --measure: 66ch;
  --logo-filter: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121513; --paper-2: #181c1a; --ink: #e7ebe8; --muted: #9ba49f; --line: #2a302c;
    --accent: #7cc4a0; --accent-ink: #0f1a14; --accent-soft: #1c2a23;
    --ev-research: #7cc4a0; --ev-guidance: #8fb0ea; --ev-inference: #e0b45c; --ev-unknown: #e39a9a; --ev-stance: #9ba49f;
    --logo-filter: invert(0.92);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121513; --paper-2: #181c1a; --ink: #e7ebe8; --muted: #9ba49f; --line: #2a302c;
  --accent: #7cc4a0; --accent-ink: #0f1a14; --accent-soft: #1c2a23;
  --ev-research: #7cc4a0; --ev-guidance: #8fb0ea; --ev-inference: #e0b45c; --ev-unknown: #e39a9a; --ev-stance: #9ba49f;
  --logo-filter: invert(0.92);
  color-scheme: dark;
}

* { 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: 1.0625rem; line-height: 1.65;
}
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
[hidden] { display: none !important; }

.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: calc(var(--measure) + 32px); }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 56ch; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 14px; }
.wordmark { font-family: var(--font-hand); font-size: 2rem; line-height: 1; color: var(--ink); text-decoration: none; letter-spacing: 0.12em; }
.wordmark { display: inline-flex; align-items: flex-end; gap: 10px; }
.wordmark img { height: 34px; width: auto; filter: var(--logo-filter); }
.wordmark small { font-size: 1.15rem; letter-spacing: 0.06em; color: var(--muted); line-height: 1; padding-bottom: 2px; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--font-head); font-size: 0.98rem; }
.nav a { color: var(--ink); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Sections */
main { display: block; }
.section { padding-block: clamp(40px, 7vw, 80px); }
.section + .section { border-top: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }

.hero .wrap { display: flex; flex-direction: column; gap: 22px; padding-block: clamp(48px, 9vw, 104px) clamp(36px, 6vw, 64px); }
.hero h1 { max-width: 18ch; }
.rule-line { align-self: flex-start; font-family: var(--font-mono); font-size: 0.95rem; color: var(--ink); background: var(--accent-soft); display: inline-block; padding: 6px 10px; border-radius: 4px; }

.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { font-family: var(--font-head); font-size: 1rem; border-radius: 999px; padding: 11px 20px; text-decoration: none; border: 1.5px solid var(--accent); cursor: pointer; background: transparent; color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* Evidence labels */
.ev { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid currentColor; border-radius: 3px; padding: 2px 7px; white-space: nowrap; }
.ev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ev-research { color: var(--ev-research); }
.ev-guidance { color: var(--ev-guidance); }
.ev-inference { color: var(--ev-inference); }
.ev-unknown { color: var(--ev-unknown); }
.ev-stance { color: var(--ev-stance); }
.ev-row { display: flex; gap: 8px; flex-wrap: wrap; }

.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px 28px; }
.legend > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.legend p { font-size: 0.95rem; color: var(--muted); }

.filter { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Article list */
.posts { display: flex; flex-direction: column; }
.post-item { display: grid; grid-template-columns: 9.5rem 1fr; gap: 20px; padding-block: 22px; border-top: 1px solid var(--line); }
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); padding-top: 4px; }
.post-item .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.post-item h3 a { color: var(--ink); text-decoration: none; }
.post-item h3 a:hover { color: var(--accent); }
.post-item p { color: var(--muted); }
@media (max-width: 600px) { .post-item { grid-template-columns: 1fr; gap: 6px; } }

.empty { color: var(--muted); font-style: italic; padding-block: 16px; }

/* Gaps table */
.table-wrap { overflow-x: auto; }
table.gaps { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.97rem; }
table.gaps th, table.gaps td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); }
table.gaps th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
table.gaps td:first-child { font-family: var(--font-head); font-weight: 600; width: 40%; }

.yesno { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 40px; }
.yesno > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-top: 14px; border-top: 3px solid var(--ev-research); }
.yesno > div + div { border-top-color: var(--ev-unknown); }
.yesno ul { margin: 0; padding-left: 1.2em; font-size: 1.1rem; }
.yesno li + li { margin-top: 6px; }
.why { max-width: var(--measure); font-size: 1.05rem; }

.supporters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 36px; }
.supporters article { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.supporters .who { color: var(--muted); font-size: 0.97rem; }
.supporters a { margin-top: auto; font-family: var(--font-head); font-size: 0.95rem; }

.post-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--paper-2); max-width: 100%; }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-img { margin: 8px 0 0; max-width: var(--measure); aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--paper-2); }
.article-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.heart p { font-size: 1.25rem; line-height: 1.6; max-width: 40ch; }
.heart h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }

.heart .sign { font-family: var(--font-head); font-weight: 650; color: var(--accent); }

.terms { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 36px; }
.terms > div { min-width: 0; }
.terms dt { font-family: var(--font-head); font-weight: 650; }
.terms dd { margin: 4px 0 0; color: var(--muted); }

.plain { font-family: var(--font-head); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 650; line-height: 1.25; max-width: 30ch; }

.definition { font-size: 1.2rem; line-height: 1.65; max-width: 62ch; }
.yesno-line { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 1.05rem; padding-block: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: var(--measure); }

.why-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; max-width: var(--measure); }
.why-list li { padding-left: 18px; border-left: 3px solid var(--accent); }
.why-list a { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; margin-left: 4px; }

.why-list li.key { border-left-width: 6px; font-size: 1.1rem; }

.heart .punch { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.2; }

/* Band */
.band { background: var(--paper-2); }

/* Article page */
.article-head { display: flex; flex-direction: column; gap: 14px; padding-block: clamp(36px, 6vw, 64px) 8px; }
.meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.sources { max-width: var(--measure); border-top: 1px solid var(--line); padding-top: 18px; }
.sources ol { padding-left: 1.3em; font-size: 0.95rem; }
.sources li + li { margin-top: 6px; }
.sources a { word-break: break-word; }

/* Forms */
form.card { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-head); font-size: 0.95rem; }
input[type="text"], input[type="email"], input[type="url"], textarea, select {
  font: inherit; font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks label { flex-direction: row; align-items: center; gap: 8px; font-family: var(--font-body); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { font-size: 0.92rem; color: var(--muted); }
.status { font-family: var(--font-mono); font-size: 0.85rem; }
.status.ok { color: var(--ev-research); }
.status.err { color: var(--ev-unknown); }

.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px 32px; }
.ways > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ways p { color: var(--muted); }

.preview-banner { background: var(--accent-soft); font-family: var(--font-mono); font-size: 0.8rem; }
.preview-banner .wrap { padding-block: 8px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 24px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px; font-size: 0.92rem; color: var(--muted); }
.site-foot strong { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }

/* Admin */
.admin-grid { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
.admin-grid > * { min-width: 0; }
@media (max-width: 820px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-list button { text-align: left; background: var(--paper); border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.admin-list button:last-child { border-bottom: 0; }
.admin-list button[aria-current="true"] { background: var(--accent-soft); }
.pill { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pill.pub { color: var(--ev-research); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { font-family: var(--font-head); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.preview-box { border: 1px dashed var(--line); border-radius: 8px; padding: 16px; }

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