/* ==========================================================================
   THEBWT.BLOG — "PAPER RECORD" DOSSIER FIELD-NOTES THEME
   Hand-written, no build step. Chrome = dark green terminal hardware.
   Reading surface = warm archival paper. No external fonts.
   ========================================================================== */

/* ---- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote { margin: 0; }
a { color: inherit; }
button { font: inherit; }

/* ---- tokens --------------------------------------------------------------
   Chrome = the dossier hardware (dark, green, monospace).
   Paper  = the reading surface (warm, near-black ink, serif).
--------------------------------------------------------------------------- */
:root {
  /* paper (reading surface) */
  --paper: #f3ecdb;
  --paper-deep: #e8ddc2;
  --paper-edge: #cebd93;
  --ink: #221e14;
  --ink-soft: #55503f;
  --ink-faint: #5f563a; /* darkened from #8d8264 — original failed AA (3.24:1 on paper, 2.88:1 on stamp-bg); this clears 4.5:1 on both */
  --stamp-bg: #eadfc4;

  /* chrome (dossier hardware) */
  --chrome-bg: #010902;
  --chrome-panel: #041405;
  --chrome-panel-2: #06210a;
  --green-dim: #00b300;
  --green-body: #00cc3a;
  --green-bright: #4dff88;
  --green-white: #cfe6d6;
  --rule-dark: #0a5c1f;
  --rule-bright: #1f9e44;
  --green-ink: #146b30; /* AA-safe green ink for paper/stamp-bg text (rule-bright is chrome-only: 2.63:1 on stamp-bg, fails) */

  /* shared accent */
  --amber: #ffb300; /* bright — chrome/dark-panel surfaces only */
  --amber-ink: #714a0b; /* darkened from #8a5c0e — that value passed on paper (4.93:1) but failed on stamp-bg (4.38:1); this clears 4.5:1 on both */

  /* type */
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", "Liberation Mono", "Courier New", monospace;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Noto Serif", "Times New Roman", serif;

  --measure: 66ch;
  --radius: 2px;
}

/* ---- base ----------------------------------------------------------------*/
body {
  background: var(--chrome-bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { text-decoration: none; }

/* =========================================================================
   CHROME — status readout, header, nav
   ========================================================================= */

.status-bar {
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--green-dim);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}
.status-bar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.4rem 1rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.status-bar__dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 4px var(--green-bright);
  margin-right: 0.5em;
  flex: none;
}
.status-bar__spacer { flex: 1; }
.status-bar__amber { color: var(--amber); }

.site-header {
  background: linear-gradient(180deg, var(--chrome-panel-2), var(--chrome-panel));
  border-bottom: 1px solid var(--rule-dark);
  position: relative;
}
.site-header::after {
  /* faint scanline texture, echoes CRT readout */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 204, 58, 0.035) 0px,
    rgba(0, 204, 58, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
}
.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.1rem 1rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  position: relative;
}
.site-header__id {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--green-dim);
  margin-bottom: 0.35rem;
}
.site-header__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: 0.06em;
  color: var(--green-white);
  text-shadow: 0 0 14px rgba(77, 255, 136, 0.25);
}
.site-header__title a { color: inherit; }
.site-header__title span { color: var(--amber); }

.site-header__socials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.3rem;
}
.site-header__socials a {
  display: inline-flex;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius);
  padding: 0.3rem;
  background: rgba(0, 179, 0, 0.06);
}
.site-header__socials img { height: 1.05rem; width: 1.05rem; filter: grayscale(1) brightness(1.6); }
.site-header__socials a:hover { border-color: var(--green-bright); }

.site-nav {
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--rule-dark);
}
.site-nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  overflow-x: auto;
}
.site-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.site-nav li { flex: none; }
.site-nav a {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-body);
  padding: 0.68rem 1.1rem;
  border-right: 1px solid var(--rule-dark);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--green-bright);
  background: rgba(0, 179, 0, 0.08);
}
.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: var(--amber);
  border-bottom-color: var(--amber);
  background: rgba(255, 179, 0, 0.07);
}
.site-nav a.ancestor { color: var(--green-bright); }

/* ---- perforation seam between chrome and paper -------------------------- */
.perforation {
  background: var(--chrome-bg);
  height: 18px;
  position: relative;
  overflow: hidden;
}
.perforation::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 4px;
  height: 10px;
  background-image: radial-gradient(circle, var(--paper) 3.2px, transparent 3.4px);
  background-size: 22px 10px;
  background-position: 11px 0;
  opacity: 0.92;
}
.perforation::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 9px;
  border-top: 1px dashed rgba(207, 230, 214, 0.28);
}

/* =========================================================================
   PAPER — the reading surface
   ========================================================================= */

.paper {
  background: var(--paper);
  flex: 1;
  position: relative;
  box-shadow: inset 0 10px 22px -18px rgba(0,0,0,0.55);
}
.paper::before {
  /* subtle sheet texture */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 1px, transparent 1px, transparent 3px);
}
.paper__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.2rem 1.25rem 3rem;
  position: relative;
}

/* generic constrained column for readable prose */
.column {
  max-width: var(--measure);
}

/* ---- section bars (§ numbered, sits ON the paper) ------------------------
   Default/neutral = chrome-panel outline (generic listings: /posts/, /tags/,
   404). §01/§02 get a SOLID fill (green / amber) — the strongest 20-second
   IA signal in the design review — carried through to their term pages too,
   so the color-code stays legible off the homepage. ------------------------ */
.section-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  background: var(--chrome-panel);
  color: var(--green-white);
  border: 1px solid var(--rule-dark);
  border-left: 4px solid var(--amber);
  padding: 0.55rem 0.9rem;
  margin: 2.4rem 0 1.1rem;
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}
.section-bar:first-child { margin-top: 0; }
.section-bar__heading {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
}
.section-bar__num {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.section-bar__title {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-bright);
}
.section-bar__meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--green-dim);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.section-bar a.section-bar__link {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  border-bottom: 1px dotted var(--amber);
  white-space: nowrap;
}
.section-bar a.section-bar__link:hover { color: var(--green-bright); border-color: var(--green-bright); }

/* solid-fill variants — dark chrome ink on the fill for max contrast */
.section-bar--green,
.section-bar--amber {
  border-left-width: 4px;
  color: var(--chrome-bg);
}
.section-bar--green { background: var(--green-dim); border-color: var(--chrome-bg); }
.section-bar--amber { background: var(--amber); border-color: var(--chrome-bg); }
.section-bar--green .section-bar__num,
.section-bar--green .section-bar__title,
.section-bar--green .section-bar__meta,
.section-bar--amber .section-bar__num,
.section-bar--amber .section-bar__title,
.section-bar--amber .section-bar__meta {
  color: inherit;
}
.section-bar--green a.section-bar__link,
.section-bar--amber a.section-bar__link {
  color: inherit;
  border-bottom-color: currentColor;
}
.section-bar--green a.section-bar__link:hover,
.section-bar--amber a.section-bar__link:hover { color: var(--chrome-panel); }

/* ---- briefing / welcome box ---------------------------------------------- */
.briefing {
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--rule-bright);
  background: var(--stamp-bg);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.5rem;
}
.briefing__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--amber-ink);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.briefing__body {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: var(--measure);
}
.briefing__body h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.briefing__body p { margin: 0.5rem 0; }

/* ---- numbered record list (index / section / term pages) ---------------- */
.record-list { list-style: none; padding: 0; margin: 0; }
.record {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 0.2rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--paper-edge);
}
.record:first-child { padding-top: 0.2rem; }
.record__num {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-ink);
  letter-spacing: 0.03em;
  padding-top: 0.2rem;
}
.record__title {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.3;
}
.record__title a { color: var(--ink); border-bottom: 1px solid transparent; }
.record__title a:hover { color: var(--amber-ink); border-color: var(--amber-ink); }
.record__meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin: 0.3rem 0 0.4rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.record__meta .tag-chip { font-size: 0.68rem; }
.record-flag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.05em 0.4em;
  border: 1px solid currentColor;
  color: var(--ink-soft); /* fallback for any category beyond infra/table */
}
.record-flag--infra { color: var(--green-ink); }
.record-flag--table { color: var(--amber-ink); }
.record__summary {
  font-family: var(--serif);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 62ch;
}
.record--draft .record__title a { color: var(--ink-faint); }
.badge-draft {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--amber-ink);
  border: 1px solid var(--amber-ink);
  padding: 0 0.35em;
  border-radius: var(--radius);
}

.empty-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  padding: 1rem 0;
  letter-spacing: 0.04em;
}

/* ---- §02 teaser grid (compact cards, deliberately lighter than §01) ----- */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-top: 0.2rem;
}
.teaser-card {
  border: 1px solid var(--paper-edge);
  border-top: 3px solid var(--amber-ink);
  background: var(--paper-deep);
  padding: 0.85rem 1rem;
}
.teaser-card__id {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--amber-ink);
  margin-bottom: 0.3rem;
}
.teaser-card__title {
  font-family: var(--serif);
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}
.teaser-card__title a { color: var(--ink); border-bottom: 1px solid transparent; }
.teaser-card__title a:hover { color: var(--amber-ink); border-color: var(--amber-ink); }
.teaser-card__note {
  font-family: var(--serif);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.teaser-card--draft .teaser-card__title a { color: var(--ink-faint); }

/* ---- plain-English sectioning note under a teaser --------------------- */
.section-note {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
  color: var(--ink-soft);
  border: 1px dashed var(--paper-edge);
  padding: 0.65rem 0.9rem;
  margin-top: 0.9rem;
}
.section-note a { color: var(--amber-ink); border-bottom: 1px dotted var(--amber-ink); }
.section-note a:hover { color: var(--ink); }

/* ---- taxonomy index rows (/tags/, /categories/): REC-numbered, dotted
   leader, count right-aligned — replaces a chip cloud ------------------- */
.term-index { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 1px solid var(--paper-edge); }
.term-row { border-bottom: 1px solid var(--paper-edge); }
.term-row__link {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.7rem 0.15rem;
  color: var(--ink);
}
.term-row__id {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-ink);
  flex: none;
  min-width: 5.5ch;
}
.term-row__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  flex: none;
}
.term-row__leader {
  flex: 1 1 auto;
  min-width: 1rem;
  border-bottom: 1px dotted var(--paper-edge);
  height: 0.7em;
  align-self: center;
}
.term-row__count {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  flex: none;
  white-space: nowrap;
}
.term-row__link:hover .term-row__title { color: var(--amber-ink); }
.term-row__link:hover .term-row__leader { border-color: var(--amber-ink); }

/* =========================================================================
   SINGLE POST
   ========================================================================= */

.post-return {
  display: flex;
  align-items: center;
  gap: 0.4em;
  width: fit-content;
  max-width: var(--measure);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 auto 1.1rem;
}
.post-return:hover { color: var(--amber-ink); }

.post-head { max-width: var(--measure); margin: 0 auto 1.6rem; }
.post-head__kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--amber-ink);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.post-head__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.18;
  color: var(--ink);
}

/* the stamped record block: dossier grammar, dotted-leader fields */
.stamp {
  margin: 1.4rem auto 0;
  max-width: var(--measure);
  border: 1px solid var(--ink-faint);
  outline: 1px solid var(--paper);
  outline-offset: -4px;
  background: var(--stamp-bg);
  padding: 0.9rem 1.1rem;
  position: relative;
}
.stamp__tag {
  position: absolute;
  top: -0.65rem;
  right: 0.9rem;
  background: var(--paper);
  border: 1px solid var(--amber-ink);
  color: var(--amber-ink);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 0.1rem 0.5rem;
  transform: rotate(-2deg);
}
.stamp__row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--ink-soft);
}
.stamp__row .k {
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  white-space: nowrap;
}
.stamp__row .leader {
  flex: 1;
  border-bottom: 1px dotted var(--ink-faint);
  height: 0.7em;
  min-width: 1rem;
}
.stamp__row .v {
  color: var(--ink);
  white-space: nowrap;
  font-weight: 600;
}
.stamp__row .v a { color: var(--ink); border-bottom: 1px dotted var(--ink-faint); }
.stamp__row .v a:hover { color: var(--amber-ink); border-color: var(--amber-ink); }
/* selector targets the <a>, not .v — the two classes never land on the same
   element in the markup (classification--X is on the link, .v is its
   parent). Also fixes: was --rule-bright, 2.63:1 on stamp-bg, fails AA. */
.stamp__row a.classification--infra { color: var(--green-ink); }
.stamp__row a.classification--table { color: var(--amber-ink); }

/* ---- prose --------------------------------------------------------------- */
.prose {
  max-width: var(--measure);
  margin: 1.9rem auto 0;
  font-family: var(--serif);
  font-size: 1.09rem;
  line-height: 1.72;
  color: var(--ink);
}
.prose > * + * { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.28;
  margin-top: 1.8em;
  padding-top: 0.4em;
  border-top: 1px solid var(--paper-edge);
}
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.prose h1 { font-size: 1.55rem; }
.prose h2 { font-size: 1.32rem; }
.prose h3 { font-size: 1.14rem; }
.prose h4 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--mono); }
.prose p { text-wrap: pretty; }
.prose a {
  color: var(--ink);
  border-bottom: 1px solid var(--amber-ink);
}
.prose a:hover { color: var(--amber-ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose ul { list-style: none; }
.prose ul li { position: relative; }
.prose ul li::before {
  content: "\2013";
  position: absolute;
  left: -1.15em;
  color: var(--amber-ink);
}
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--amber-ink); font-family: var(--mono); }
.prose blockquote {
  border-left: 3px solid var(--rule-bright);
  background: var(--stamp-bg);
  padding: 0.7em 1em;
  font-style: italic;
  color: var(--ink-soft);
}
/* inline code = a paper-surface chip (tan/dark-ink), NOT the dark terminal
   panel used by fenced blocks below — a dark blob mid-sentence read as a
   design defect in review. */
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--stamp-bg);
  color: var(--ink);
  padding: 0.1em 0.4em;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
}
.prose pre {
  font-family: var(--mono);
  font-size: 0.86rem;
  background: var(--chrome-bg);
  color: var(--green-body);
  padding: 1em 1.1em;
  overflow-x: auto;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius);
}
/* fenced blocks stay dark terminal panels. font-size:1em here is the fix for
   the measured 11.83px double-multiplier: without it, <code> inside <pre>
   ALSO matches the inline-chip rule above (0.86em), compounding against the
   pre's own 0.86rem — 0.86em * 0.86rem(13.76px) = 11.83px. This pins fenced
   code to exactly the pre's 0.86rem (~13.8px), and drops the inline chip's
   surface/border so it reads as one panel, not a chip-in-a-chip. */
.prose pre code {
  font-size: 1em;
  background: none;
  color: inherit;
  border: none;
  padding: 0;
}
.prose img { border: 1px solid var(--paper-edge); }
.prose hr {
  border: none;
  border-top: 1px dashed var(--paper-edge);
  margin: 2em 0;
}
/* display:block + overflow-x:auto self-contains a wide table (long cell
   content, e.g. code spans) exactly like .prose pre does — without it a
   table's min-content width can exceed the reading column and push the
   whole page wider than the viewport (confirmed via the fixture post at
   360/390px: the table alone pushed the page to 412px, wider than either
   viewport). */
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--paper-edge); padding: 0.4em 0.6em; text-align: left; }
.prose th { font-family: var(--mono); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; background: var(--stamp-bg); }

/* ---- tags footer on posts -------------------------------------------------*/
.post-tags {
  max-width: var(--measure);
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-edge);
}
.post-tags__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.tag-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--paper-edge);
  background: var(--stamp-bg);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius);
}
a.tag-chip:hover { color: var(--amber-ink); border-color: var(--amber-ink); }

/* ---- end-of-record stamp + prev/next section pager ---------------------- */
.post-endstamp {
  max-width: var(--measure);
  margin: 2.2rem auto 0;
  padding-top: 1rem;
  border-top: 1px dotted var(--paper-edge);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-faint);
}

.post-pager {
  max-width: var(--measure);
  margin: 1.6rem auto 0;
  display: flex;
  gap: 1rem;
  border-top: 1px solid var(--paper-edge);
  padding-top: 1rem;
}
.post-pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 46%;
}
.post-pager__link--next { margin-left: auto; text-align: right; }
.post-pager__dir {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-ink);
}
.post-pager__title {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}
.post-pager__link:hover .post-pager__title { color: var(--amber-ink); border-color: var(--amber-ink); }

/* =========================================================================
   FOOTER — closing chrome bar
   ========================================================================= */
.site-footer {
  background: var(--chrome-bg);
  border-top: 1px solid var(--rule-dark);
  color: var(--green-dim);
}
.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
}
.site-footer__close {
  color: var(--green-bright);
  letter-spacing: 0.14em;
  margin-bottom: 0.4rem;
}
.site-footer__close .blip {
  display: inline-block;
  width: 0.45em; height: 0.45em;
  background: var(--amber);
  margin-right: 0.5em;
  box-shadow: 0 0 4px var(--amber);
}
.site-footer p { margin: 0.15rem 0; color: var(--green-dim); }
.site-footer a { color: var(--green-body); border-bottom: 1px dotted var(--rule-dark); }
.site-footer a:hover { color: var(--green-bright); }

/* =========================================================================
   404
   ========================================================================= */
.not-found {
  max-width: var(--measure);
  margin: 3rem auto;
  text-align: left;
}
.not-found__code {
  font-family: var(--mono);
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--amber-ink);
  line-height: 1;
}
.not-found__desc {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-top: 0.8rem;
  color: var(--ink-soft);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 640px) {
  .status-bar__inner { gap: 0.85rem; padding: 0.4rem 0.75rem; }
  .status-bar__hide-sm { display: none; }
  .site-nav__inner { overflow-x: visible; }
  .site-nav ul { flex-wrap: wrap; }
  .site-nav a { padding: 0.55rem 0.8rem; font-size: 0.72rem; letter-spacing: 0.1em; }
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .site-header__socials { padding-bottom: 0; }
  .paper__inner { padding: 1.5rem 1rem 2.4rem; }
  .record { grid-template-columns: 1fr; }
  .record__num { padding-top: 0; }
  .section-bar { flex-wrap: wrap; }
  .section-bar__meta, .section-bar a.section-bar__link { margin-left: 0; width: 100%; }
  .stamp__row { flex-wrap: wrap; }
  .stamp__row .leader { display: none; }
  .teaser-grid { grid-template-columns: 1fr; }
  .term-row__leader { display: none; }
  .term-row__link { flex-wrap: wrap; }
  .post-pager { flex-direction: column; gap: 0.9rem; }
  .post-pager__link, .post-pager__link--next { max-width: 100%; text-align: left; margin-left: 0; }
}

/* =========================================================================
   MOTION SAFETY
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* =========================================================================
   PRINT — flatten to clean black-on-white document
   ========================================================================= */
@media print {
  body { background: #fff; color: #000; }
  .status-bar, .site-nav, .perforation, .site-footer, .site-header__socials, .stamp__tag,
  .post-return, .post-pager {
    display: none !important;
  }
  .site-header {
    background: #fff !important;
    border-bottom: 2px solid #000;
    box-shadow: none;
  }
  .site-header::after { display: none; }
  .site-header__title, .site-header__id { color: #000 !important; text-shadow: none !important; }
  .paper { background: #fff !important; box-shadow: none; }
  .paper::before { display: none; }
  .briefing, .stamp, .tag-chip, .record, .teaser-card { background: #fff !important; border-color: #000 !important; }
  .prose, .prose *, .post-head__title, .record__title, .stamp__row .v, .stamp__row .k,
  .post-endstamp, .record-flag {
    color: #000 !important;
  }
  .prose code, .prose pre { background: #fff !important; color: #000 !important; border-color: #000 !important; }
  a { color: #000 !important; text-decoration: underline; }
  .section-bar,
  .section-bar--green,
  .section-bar--amber {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }
  .section-bar__title, .section-bar__num, .section-bar__meta, .section-bar a.section-bar__link {
    color: #000 !important;
  }
  /* print URLs after post-body links so a paper copy is still useful */
  article a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }
}
