/* ==========================================================================
   SLOW VARIABLES — design system
   Dark editorial / cyberpunk. One accent. Hairlines. No radius. No shadows.
   ========================================================================== */

/* ---- Fonts (self-hosted, no third-party requests) ---------------------- */
@font-face { font-family: "Anton"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/anton-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/newsreader-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/newsreader-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/newsreader-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/newsreader-latin-600-normal.woff2") format("woff2"); }

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --bg: #0a0a0a;
  --bg-2: #111110;
  --ink: #f2f0eb;
  --ink-2: rgba(242, 240, 235, 0.72);
  --muted: rgba(242, 240, 235, 0.38);
  --hair: rgba(242, 240, 235, 0.12);
  --hair-2: rgba(242, 240, 235, 0.22);
  --accent: #c8f53c;          /* acid */
  --accent-ink: #0a0a0a;
  --warn: #ff3d8a;            /* used only for "retracted" / "wrong" states */

  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --pad: clamp(1.25rem, 5vw, 4rem);
  --measure: 66ch;
  --step--1: 0.8125rem;
  --step-0: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  --step-1: 1.5rem;
  --step-2: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --step-3: clamp(3rem, 1.5rem + 7vw, 7.5rem);
  --step-4: clamp(4rem, 1rem + 14vw, 13rem);
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--hair-2); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
hr { border: 0; height: 1px; background: var(--hair); margin: 3rem 0; }

/* ---- Atmosphere: scanlines + grain (decorative, non-interactive) ------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed; inset: -50%; z-index: 9998; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}
@media (prefers-reduced-motion: no-preference) {
  body::after { animation: grain 1.2s steps(6) infinite; }
}
@keyframes grain {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -4%); }
  60%  { transform: translate(-1%, 3%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0,0); }
}

/* ---- Utilities --------------------------------------------------------- */
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink);
  padding: .5rem 1rem; font-family: var(--mono); z-index: 10000; }
.skip:focus { left: 0; }
.wrap { padding-inline: var(--pad); max-width: 1440px; margin-inline: auto; }
.label {
  font-family: var(--mono); font-size: var(--step--1); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.label b { color: var(--accent); font-weight: 600; }
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 0.92; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Header / nav ------------------------------------------------------ */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.1rem; border-bottom: 1px solid var(--hair);
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
}
.site-head .brand { text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: .6rem; }
.site-head .brand::before { content: ""; width: .55rem; height: .55rem; background: var(--accent); }
.site-head nav { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); }
.site-head nav a { text-decoration: none; color: var(--ink-2); }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--accent); }

/* ---- Hero (home) ------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(3rem, 8vw, 7rem) clamp(2.5rem, 6vw, 5rem); border-bottom: 1px solid var(--hair); overflow: clip; }
.hero::before { /* diagonal slab, like a lit stage edge */
  content: ""; position: absolute; right: -10%; top: 0; bottom: 0; width: 42%;
  background: linear-gradient(160deg, transparent 0 40%, rgba(200,245,60,0.06) 40.2% 100%);
  clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.hero .kicker { margin: 0 0 1.25rem; }
.hero h1 { margin: 0; font-size: var(--step-4); }
.hero h1 .cursor { display: inline-block; width: .12em; height: .78em; background: var(--accent); margin-left: .08em; vertical-align: -0.06em; }
@media (prefers-reduced-motion: no-preference) { .hero h1 .cursor { animation: blink 1.1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }
.hero .tagline { max-width: 40ch; font-size: var(--step-1); line-height: 1.3; margin: 1.5rem 0 0; color: var(--ink-2); font-style: italic; }
.hero .latest { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: baseline; font-family: var(--mono); font-size: var(--step--1); }
.hero .latest a { text-decoration: none; border-bottom: 1px solid var(--hair-2); padding-bottom: .15rem; }
.hero .latest a:hover { border-color: var(--accent); }
.hero .scroll { margin-top: clamp(2rem, 6vw, 4rem); display: inline-flex; flex-direction: column; gap: .5rem; }
.hero .scroll::after { content: ""; width: 1px; height: 2.5rem; background: var(--hair-2); margin-left: .35rem; }

/* ---- Layout: main + rail ---------------------------------------------- */
.page { display: grid; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 6vw, 5rem); }
@media (min-width: 1100px) {
  .page { grid-template-columns: minmax(0, 1fr) 20rem; }
  .rail { position: sticky; top: 1.5rem; align-self: start; }
}
.rail h2 { margin: 0 0 1rem; }
.rail ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.rail li { border-bottom: 1px solid var(--hair); padding: .8rem 0; display: grid; grid-template-columns: 3.2rem 1fr; gap: .75rem; font-family: var(--mono); font-size: var(--step--1); }
.rail li .n { color: var(--accent); }
.rail li a { text-decoration: none; color: var(--ink-2); }
.rail li a:hover { color: var(--accent); }
.rail li time { display: block; color: var(--muted); margin-top: .2rem; font-size: .72rem; letter-spacing: .08em; }
.rail .more { margin-top: 1rem; display: inline-block; }

/* ---- Edition ----------------------------------------------------------- */
.edition { min-width: 0; }
.edition > header { padding-bottom: 2rem; border-bottom: 1px solid var(--hair); margin-bottom: 2.5rem; }
.edition .eyebrow { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1.25rem; }
.edition h1.title { font-size: var(--step-3); margin: 0; max-width: 14ch; text-wrap: balance; }
.edition .dek { font-size: var(--step-1); line-height: 1.3; margin: 1.25rem 0 0; color: var(--ink-2); max-width: 34ch; font-style: italic; }
.meta { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.meta dl { display: flex; gap: .5rem; margin: 0; font-family: var(--mono); font-size: var(--step--1); }
.meta dt { color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.meta dt::after { content: " //"; }
.meta dd { margin: 0; }
.status-speculative dd, .status-exploratory dd { color: var(--accent); }
.status-confident dd { color: var(--ink); }
.status-revised dd { color: var(--warn); }

/* Section blocks (the recurring edition structure) */
.block { padding-block: 2.25rem; border-top: 1px solid var(--hair); }
.block:first-of-type { border-top: 0; padding-top: 0; }
.block > .label { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.block > .label::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.block h2.head { font-family: var(--display); text-transform: uppercase; font-size: var(--step-2); line-height: .95; letter-spacing: -0.01em; margin: 0 0 1rem; }

/* Table of contents — Pluralistic-style summary of the edition */
.toc { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--hair); }
.toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); color: var(--accent); font-size: var(--step--1); padding-top: .25rem; }
.toc a { text-decoration: none; font-family: var(--display); text-transform: uppercase; font-size: 1.35rem; letter-spacing: .01em; line-height: 1.05; }
.toc a:hover { color: var(--accent); }
.toc .why { display: block; color: var(--ink-2); font-size: 1rem; margin-top: .15rem; font-style: italic; }

/* Prose */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.25em; }
.prose p:first-of-type::first-letter { font-family: var(--display); font-size: 3.4em; line-height: .8; float: left; margin: .12em .12em 0 0; color: var(--accent); }
.prose h2, .prose h3 { font-family: var(--display); text-transform: uppercase; line-height: 1; letter-spacing: 0; margin-top: 2.25em; }
.prose h2 { font-size: var(--step-2); }
.prose h3 { font-size: var(--step-1); color: var(--ink-2); }
.prose .anchor { text-decoration: none; color: var(--hair-2); margin-right: .3em; font-family: var(--mono); font-size: .6em; vertical-align: .3em; }
.prose h2:hover .anchor, .prose h3:hover .anchor { color: var(--accent); }
.prose blockquote { margin: 1.75em 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--accent); font-style: italic; color: var(--ink-2); }
.prose blockquote p + p { margin-top: .75em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose strong { font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--bg-2); border: 1px solid var(--hair); padding: .08em .35em; }
.prose pre { font-family: var(--mono); font-size: .86rem; line-height: 1.5; background: var(--bg-2); border: 1px solid var(--hair); padding: 1rem 1.25rem; overflow-x: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-family: var(--mono); font-size: var(--step--1); color: var(--muted); margin-top: .6rem; letter-spacing: .04em; }
.prose img { border: 1px solid var(--hair); filter: grayscale(.2) contrast(1.05); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .9rem; }
.prose th, .prose td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: var(--step--1); }
.prose .pull { font-family: var(--display); text-transform: uppercase; font-size: var(--step-2); line-height: .95; color: var(--accent); margin: 1.5em 0; max-width: 20ch; }
.prose .aside { font-family: var(--mono); font-size: .9rem; color: var(--ink-2); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 1rem 0; }
.footnotes { font-size: .92rem; color: var(--ink-2); }
.footnotes-sep { margin: 3rem 0 1.5rem; }
.footnotes ol { padding-left: 1.4em; }
.footnote-ref a { font-family: var(--mono); text-decoration: none; color: var(--accent); }
.footnote-backref { text-decoration: none; font-family: var(--mono); }

/* Fast variables — short link items */
.fast { list-style: none; margin: 0; padding: 0; }
.fast li { display: grid; grid-template-columns: 1fr; gap: .25rem; padding: 1rem 0; border-bottom: 1px solid var(--hair); }
.fast .t { font-family: var(--display); text-transform: uppercase; font-size: 1.25rem; letter-spacing: .01em; line-height: 1.05; }
.fast .t a { text-decoration: none; }
.fast .src { font-family: var(--mono); font-size: var(--step--1); color: var(--muted); letter-spacing: .06em; }
.fast .note { color: var(--ink-2); max-width: var(--measure); }
.fast .note p { margin: 0; }
@media (min-width: 720px) { .fast li { grid-template-columns: 11rem 1fr; gap: .35rem 1.5rem; } .fast .note, .fast .t { grid-column: 2; } .fast .src { grid-column: 1; grid-row: 1 / span 3; padding-top: .3rem; } }

/* Long memory — precedent timeline */
.memory { list-style: none; margin: 0; padding: 0; }
.memory li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.25rem; padding: .85rem 0; border-bottom: 1px solid var(--hair); }
.memory .y { font-family: var(--display); font-size: 1.6rem; line-height: 1; color: var(--accent); }
.memory .what { max-width: var(--measure); color: var(--ink-2); }
.memory .what p { margin: 0; }

/* Ledger — predictions table */
.ledger { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .9rem; }
.ledger th, .ledger td { text-align: left; padding: .75rem .5rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.ledger th { color: var(--muted); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-size: var(--step--1); }
.ledger td.claim { font-family: var(--serif); font-size: 1.05rem; }
.ledger .conf, .ledger td:nth-child(3), .ledger td:nth-child(4) { white-space: nowrap; } .ledger .conf { color: var(--accent); }
.ledger .st { text-transform: uppercase; letter-spacing: .1em; font-size: var(--step--1); white-space: nowrap; }
.ledger .st-open { color: var(--muted); }
.ledger .st-right { color: var(--accent); }
.ledger .st-wrong { color: var(--warn); }
.ledger .st-partial { color: var(--ink-2); }
@media (max-width: 719px) { .ledger thead { display: none; } .ledger tr { display: grid; gap: .25rem; padding: .9rem 0; border-bottom: 1px solid var(--hair); } .ledger td { border: 0; padding: 0; } }

/* Revisions */
.revisions { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: .9rem; }
.revisions li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--hair); }
.revisions time { color: var(--accent); }

/* Colophon block inside an edition */
.colophon-block { font-family: var(--mono); font-size: .9rem; color: var(--ink-2); max-width: var(--measure); }
.colophon-block p { margin: 0 0 .75em; }

/* Tags & edition nav */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.tags a { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .06em; text-decoration: none; border: 1px solid var(--hair-2); padding: .3rem .6rem; color: var(--ink-2); }
.tags a:hover { border-color: var(--accent); color: var(--accent); }
.ed-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hair); border: 1px solid var(--hair); margin-top: 3rem; }
.ed-nav a { background: var(--bg); padding: 1.25rem; text-decoration: none; display: grid; gap: .4rem; min-height: 6rem; }
.ed-nav a:hover { background: var(--bg-2); }
.ed-nav a.next { text-align: right; }
.ed-nav .t { font-family: var(--display); text-transform: uppercase; font-size: 1.2rem; line-height: 1.05; }
.ed-nav .empty { background: var(--bg); }

/* ---- Archive list ------------------------------------------------------ */
.archive { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.archive li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--hair); }
.archive .n { font-family: var(--display); font-size: var(--step-2); line-height: .9; color: var(--accent); }
.archive .t { font-family: var(--display); text-transform: uppercase; font-size: var(--step-1); line-height: 1; text-decoration: none; }
.archive .t:hover { color: var(--accent); }
.archive .d { color: var(--ink-2); font-style: italic; margin-top: .4rem; max-width: var(--measure); }
.archive .m { margin-top: .6rem; }
@media (min-width: 720px) { .archive li { grid-template-columns: 6rem 1fr 12rem; } .archive .m { grid-column: 3; grid-row: 1; margin: .3rem 0 0; text-align: right; } }

/* ---- Page (generic) ---------------------------------------------------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 5rem) 2rem; border-bottom: 1px solid var(--hair); margin-bottom: 2.5rem; }
.page-head h1 { font-size: var(--step-3); margin: .75rem 0 0; }
.page-head p { font-size: var(--step-1); font-style: italic; color: var(--ink-2); max-width: 40ch; margin: 1rem 0 0; line-height: 1.3; }

/* ---- Footer ------------------------------------------------------------ */
.site-foot { border-top: 1px solid var(--hair); padding-block: 2.5rem 3.5rem; margin-top: 4rem; font-family: var(--mono); font-size: var(--step--1); color: var(--muted); display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .site-foot { grid-template-columns: 1fr auto; align-items: end; } }
.site-foot .stmt { max-width: 60ch; line-height: 1.6; letter-spacing: .02em; }
.site-foot .stmt b { color: var(--ink-2); font-weight: 500; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { text-decoration: none; color: var(--ink-2); }
.site-foot a:hover { color: var(--accent); }
.site-foot .sig { font-family: var(--display); text-transform: uppercase; font-size: 1.1rem; color: var(--ink-2); letter-spacing: .02em; }

}

/* ---- Small screens ----------------------------------------------------- */
.site-head .brand { white-space: nowrap; }
.site-head nav a, .site-foot nav a { padding-block: .5rem; display: inline-block; }
@media (max-width: 700px) {
  .site-head { flex-wrap: wrap; font-size: .72rem; padding-block: .6rem .2rem; row-gap: .1rem; }
  .site-head .brand { order: 1; }
  .reader-controls { order: 2; }
  .head-right { display: contents !important; }
  .site-head nav { order: 3; width: 100%; gap: 0 1.1rem; flex-wrap: wrap; justify-content: flex-start; }
  .hero h1 .cursor { display: none; }
  .toc li { grid-template-columns: 2.4rem 1fr; }
  .memory li { grid-template-columns: 4rem 1fr; }
  .archive li { grid-template-columns: 3.5rem 1fr; }
  .revisions li { grid-template-columns: 6.5rem 1fr; }
}

/* ---- Replies ----------------------------------------------------------- */
.replies-list { max-width: var(--measure); }
.replies-empty { color: var(--muted); font-style: italic; margin: 0 0 1.5rem; }
.reply { border-top: 1px solid var(--hair); padding: 1.1rem 0; }
.reply header { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline; font-family: var(--mono); font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.reply header b { color: var(--accent); font-weight: 600; }
.reply p { margin: 0 0 .6em; color: var(--ink-2); }
.replies-flash { font-family: var(--mono); font-size: .9rem; padding: .75rem 1rem; border: 1px solid var(--hair-2); max-width: var(--measure); margin: 1rem 0; }
.replies-flash.ok { border-color: var(--accent); color: var(--accent); }
.replies-flash.err { border-color: var(--warn); color: var(--warn); }
.replies-form { max-width: var(--measure); margin-top: 2rem; border-top: 1px solid var(--hair); padding-top: 1.5rem; }
.replies-grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .replies-grid { grid-template-columns: 1fr 1fr; } .replies-grid .full { grid-column: 1 / -1; } }
.replies-form label { display: grid; gap: .4rem; }
.replies-form label span { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.replies-form input, .replies-form textarea { font: inherit; font-family: var(--serif); font-size: 1rem; color: var(--ink); background: var(--bg-2); border: 1px solid var(--hair-2); padding: .7rem .8rem; width: 100%; border-radius: 0; }
.replies-form input:focus, .replies-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.replies-form textarea { resize: vertical; min-height: 8rem; }
.replies-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.replies-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.1rem; }
.replies-form button { font-family: var(--mono); font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: .8rem 1.4rem; cursor: pointer; }
.replies-form button:hover { background: transparent; color: var(--accent); }
.replies-form button:disabled { opacity: .5; cursor: wait; }

/* ---- Sidenotes ------------------------------------------------------------
   Wide: notes hang in the right margin beside their reference.
   Narrow: tap the number to reveal the note inline.                        */
.prose { position: relative; }
.sn-ref { font-family: var(--mono); font-size: .7em; color: var(--accent); cursor: pointer; vertical-align: super; line-height: 0; padding: 0 .15em; user-select: none; }
.sn-ref span::before { content: "["; } .sn-ref span::after { content: "]"; }
.sn-ref:hover, .sn-ref:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.sn-num { font-family: var(--mono); color: var(--accent); font-size: .85em; margin-right: .25em; }
.sidenote { display: none; font-family: var(--serif); font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.sidenote a { color: var(--ink-2); }
.print-only { display: none; }
/* Narrow: inline reveal */
.sn-toggle:checked + .sidenote { display: block; margin: .75em 0 1em; padding: .6em 0 .6em .9em; border-left: 2px solid var(--accent); }
/* Wide: margin */
@media (min-width: 1280px) {
  .sidenote, .sn-toggle:checked + .sidenote { display: block; float: right; clear: right; width: 12rem; margin: .1em -14rem 1.2em 1.5em; padding: 0; border: 0; font-size: .82rem; }
  .sn-ref { cursor: default; }
  .sn-ref:hover { text-decoration: none; }
}
@media (min-width: 1100px) and (max-width: 1279px) { .edition .prose { max-width: 58ch; } }

/* ---- Diff view --------------------------------------------------------- */
.diff p { color: var(--ink-2); }
.diff p:first-of-type::first-letter { all: unset; }
.diff del { color: var(--warn); text-decoration: line-through; text-decoration-thickness: 1px; opacity: .85; }
.diff ins { color: var(--accent); text-decoration: none; background: rgba(200,245,60,.08); box-shadow: inset 0 -1px 0 var(--accent); }
.page-head del { color: var(--warn); } .page-head ins { color: var(--accent); text-decoration: none; box-shadow: inset 0 -1px 0 var(--accent); }

/* ---- Calibration chart ------------------------------------------------- */
.calib-fig { margin: 0; max-width: 40rem; }
.calib { width: 100%; height: auto; display: block; font-family: var(--mono); }
.calib .grid { stroke: var(--hair); stroke-width: 1; }
.calib .tick { fill: var(--muted); font-size: 14px; letter-spacing: .04em; }
.calib .axis { fill: var(--ink-2); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.calib .diag { stroke: var(--hair-2); stroke-width: 1.5; stroke-dasharray: 4 5; }
.calib .pt circle { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.calib .pt .n { fill: var(--accent-ink); font-size: 14px; font-weight: 600; }
.calib .open circle { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.calib .empty { fill: var(--ink-2); font-family: var(--display); font-size: 34px; text-transform: uppercase; letter-spacing: .02em; }
.calib-fig figcaption { font-family: var(--mono); font-size: var(--step--1); color: var(--muted); margin-top: .75rem; line-height: 1.55; letter-spacing: .02em; }
.calib-table { margin-top: 1rem; max-width: 40rem; } .calib-table summary { cursor: pointer; list-style: none; } .calib-table summary::before { content: "+ "; color: var(--accent); } .calib-table[open] summary::before { content: "− "; }

/* ---- Variables index --------------------------------------------------- */
.vars { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.vars > li { padding: 2rem 0; border-bottom: 1px solid var(--hair); display: grid; gap: .75rem 3rem; }
@media (min-width: 900px) { .vars > li { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .vars-note { grid-column: 1; } .vars-eds, .vars-none { grid-column: 2; grid-row: 1 / span 2; align-self: start; } }
.vars-head h2 { font-size: var(--step-2); margin: 0 0 .5rem; line-height: .95; }
.vars-note { margin: 0; color: var(--ink-2); max-width: 50ch; }
.vars-eds { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.vars-eds li { display: grid; grid-template-columns: 3rem 1fr auto; gap: .75rem 1rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--hair); font-family: var(--mono); font-size: var(--step--1); }
.vars-eds .n { color: var(--accent); } .vars-eds a { text-decoration: none; } .vars-eds time { color: var(--muted); letter-spacing: .06em; }
.vars-none { margin: 0; align-self: start; }

/* ---- Reader controls + light theme ------------------------------------- */
.head-right { display: flex; align-items: center; gap: clamp(.9rem, 2.5vw, 2rem); }
.reader-controls { display: flex; gap: .35rem; }
.reader-controls button { font-family: var(--mono); font-size: .8rem; line-height: 1; background: none; color: var(--ink-2); border: 1px solid var(--hair-2); min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; cursor: pointer; letter-spacing: 0; text-transform: none; }
.reader-controls button:hover { color: var(--accent); border-color: var(--accent); }
.reader-controls button[data-size="s"] span[aria-hidden] { font-size: .7rem; } .reader-controls button[data-size="l"] span[aria-hidden] { font-size: .95rem; }
:root[data-size="s"] { --step-0: 1rem; --measure: 70ch; }
:root[data-size="l"] { --step-0: clamp(1.2rem, 1.1rem + .5vw, 1.4rem); --measure: 60ch; }
:root { color-scheme: dark; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0eb; --bg-2: #e9e6df; --ink: #0f0f0e; --ink-2: rgba(15,15,14,.78); --muted: rgba(15,15,14,.5);
  --hair: rgba(15,15,14,.14); --hair-2: rgba(15,15,14,.28); --accent: #4d7a00; --accent-ink: #f2f0eb; --warn: #c2185b;
}
:root[data-theme="light"] body::before { display: none; }
:root[data-theme="light"] body::after { opacity: .045; mix-blend-mode: multiply; }
:root[data-theme="light"] .hero::before { background: linear-gradient(160deg, transparent 0 40%, rgba(77,122,0,.07) 40.2% 100%); }
:root[data-theme="light"] .diff ins { background: rgba(77,122,0,.1); }
:root[data-theme="light"] .prose img { filter: none; }

/* ---- Print ------------------------------------------------------------- */
@media print {
  @page { margin: 18mm 16mm; }
  :root { --bg: #fff; --bg-2: #f4f4f2; --ink: #000; --ink-2: #222; --muted: #555; --hair: #bbb; --hair-2: #888; --accent: #000; --accent-ink: #fff; --warn: #000; }
  body { background: #fff !important; color: #000; font-size: 11pt; line-height: 1.5; }
  body::before, body::after, .site-head, .rail, .hero .scroll, .hero .cursor, .hero::before, .replies, .ed-nav, .reader-controls, .skip, .tags, .toc, .site-foot nav { display: none !important; }
  .page { display: block; padding-block: 0; }
  .wrap { padding-inline: 0; max-width: none; }
  .hero { padding-block: 0 1.5rem; border: 0; }
  .hero h1 { font-size: 40pt; }
  .edition h1.title { font-size: 28pt; max-width: none; }
  .prose { max-width: none; }
  .prose p:first-of-type::first-letter { all: unset; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-family: var(--mono); font-size: .8em; color: #444; word-break: break-all; }
  .prose .pull { color: #000; font-size: 20pt; }
  .block { break-inside: avoid-page; page-break-inside: avoid; }
  .block > .label::after { background: #bbb; }
  h2, h3 { break-after: avoid-page; page-break-after: avoid; }
  /* footnotes: hide sidenote copies, show the numbered list */
  .sidenote, .sn-toggle { display: none !important; }
  .sn-ref { color: #000; }
  .print-only { display: block !important; }
  .footnotes-sep { display: none; }
  .footnotes::before { content: "Notes"; display: block; font-family: var(--mono); font-size: 8pt; letter-spacing: .12em; text-transform: uppercase; color: #555; border-top: 1px solid #bbb; padding-top: 1rem; margin-top: 2rem; }
  .footnote-backref { display: none; }
  .ledger, .ledger thead { display: table; width: 100%; } .ledger thead { display: table-header-group; } .ledger tr { display: table-row; } .ledger td, .ledger th { display: table-cell; border-bottom: 1px solid #bbb; padding: .4rem .3rem; }
  .calib .pt circle { fill: #000; } .calib .pt .n { fill: #fff; } .calib .open circle { stroke: #000; fill: #fff; } .calib .diag { stroke: #888; }
  .site-foot { border-top: 1px solid #bbb; margin-top: 2rem; color: #555; }
  .site-foot .stmt::after { content: " Printed from slowvariables.net."; }
  .colophon-block a[href$=".txt"], .colophon-block a[href$=".gmi"] { display: none; }
}
