/* ============================================================
   logic of logic — design.css
   built exclusively from css/tokens.css. zero raw hex in this file.
   layers: timing → base → theme remap → masthead/folio → board →
   components → article templates → motion → dark overrides →
   reduced motion → breakpoints
   ============================================================ */

/* ---------- timing tokens ---------- */
:root {
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-hover: cubic-bezier(.4,0,.2,1);
  --t-fast: 160ms;
  --t-med: 260ms;
  --t-slow: 480ms;
  --stagger: 60ms;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
::selection { background: var(--gold-2); color: var(--dark-bg); }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em;
  background: var(--ink); color: var(--cream); padding: 8px 14px;
  transition: top var(--t-fast) var(--ease-hover);
}
.skip:focus-visible { top: 12px; }

/* shared lowercase mono voice */
.kicker, .meta, .chip, .folio-bar, .nav a, .more, .w-time, .w-meta, .b-time,
.m-num, .m-meta, .path-meta, .stat-label, .stat-caption, .quote-attr,
.f-kicker, .f-base, .wire-date, .pick-meta, .src-num, .domain-chip,
.tag-row a, .pagination, .strip-label, .toc-num, .slot-label, .field label {
  font-family: var(--font-mono);
  text-transform: lowercase;
  letter-spacing: .06em;
}

/* ---------- theme: semantic remap ---------- */
[data-theme="dark"] {
  --cream: var(--dark-bg);
  --cream-2: var(--dark-surface);
  --cream-3: var(--dark-surface-2);
  --ink: var(--dark-text);
  --ink-2: var(--dark-text);
  --muted: var(--dark-text-muted);
  --muted-2: var(--dark-muted-2);
  --rule: var(--dark-rule);
  --rust: var(--dark-rust);
  --rust-2: var(--dark-rust-2);
  /* gold ramp unchanged */
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  transition: background 200ms var(--ease-hover), box-shadow 200ms var(--ease-hover);
}
.masthead-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  transition: height 200ms var(--ease-hover);
}
.masthead.condensed {
  background: color-mix(in oklab, var(--cream) 76%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--rule), 0 10px 30px rgba(27,23,20,.07);
  border-bottom-color: transparent;
}
.masthead.condensed .masthead-inner { height: 56px; }

.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-name {
  font-family: var(--font-display); font-size: 1.45rem; line-height: 1;
  transition: font-size 200ms var(--ease-hover);
}
.condensed .brand-name { font-size: 1.2rem; }

/* the ∴ mark — three dots, pulse sequentially once on hover */
.mark { position: relative; width: 17px; height: 14px; display: inline-block; flex: none; align-self: center; }
.mark i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--rust); }
.mark i:nth-child(1) { top: 0; left: 6px; }
.mark i:nth-child(2) { bottom: 0; left: 0; }
.mark i:nth-child(3) { bottom: 0; right: 0; }
.brand:hover .mark i, .brand:focus-visible .mark i { animation: dot-pulse 420ms var(--ease-out) 1 both; }
.brand:hover .mark i:nth-child(2), .brand:focus-visible .mark i:nth-child(2) { animation-delay: 90ms; }
.brand:hover .mark i:nth-child(3), .brand:focus-visible .mark i:nth-child(3) { animation-delay: 180ms; }
@keyframes dot-pulse { 50% { transform: scale(1.7); } }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  font-size: .78rem; padding-bottom: 3px;
  background-image: linear-gradient(var(--rust), var(--rust));
  background-repeat: no-repeat; background-size: 0% 2px; background-position: 0 100%;
  transition: background-size var(--t-fast) var(--ease-hover);
}
.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"] { background-size: 100% 2px; }

/* theme toggle: css-drawn sun / moon, cross-fade + 40° rotate */
.theme-toggle { position: relative; width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink); }
.tt-sun, .tt-moon {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  transition: opacity 200ms var(--ease-hover), transform 200ms var(--ease-hover);
}
.tt-sun {
  border: 1.5px solid currentColor;
  box-shadow:
    0 -8px 0 -4.4px currentColor, 0 8px 0 -4.4px currentColor,
    8px 0 0 -4.4px currentColor, -8px 0 0 -4.4px currentColor,
    6px -6px 0 -4.6px currentColor, -6px 6px 0 -4.6px currentColor,
    6px 6px 0 -4.6px currentColor, -6px -6px 0 -4.6px currentColor;
}
.tt-moon { box-shadow: inset -3.5px -2.5px 0 0 currentColor; opacity: 0; transform: rotate(-40deg); }
[data-theme="dark"] .tt-sun { opacity: 0; transform: rotate(40deg); }
[data-theme="dark"] .tt-moon { opacity: 1; transform: rotate(0deg); }

/* ---------- folio bar ---------- */
.folio-bar {
  border-bottom: 1px solid var(--rule);
  font-size: .78rem; color: var(--muted);
}
.folio-inner {
  max-width: 1240px; margin: 0 auto; padding: 9px 24px;
  display: flex; justify-content: space-between; gap: 16px;
}

/* ---------- the board ---------- */
.board {
  max-width: 1240px; margin: 0 auto;
  padding: 16px 24px 0;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px;
}
.cell {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--rule);
  padding: 22px;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 0 var(--rule);
  transition: transform var(--t-med) var(--ease-hover), box-shadow var(--t-med) var(--ease-hover), background var(--t-fast) var(--ease-hover);
}
/* top hairline draws rust on hover */
.cell::after {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px;
  background: var(--rust); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease-hover);
}
@media (hover: hover) {
  .cell:hover, .cell:focus-within { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(27,23,20,.10); }
  .cell:hover::after, .cell:focus-within::after { transform: scaleX(1); }
}
@media (hover: none) {
  .cell:active { background: var(--cream-2); transition-duration: 100ms; }
}

/* placement */
.cell-a { grid-column: 1 / 9;  grid-row: 1 / 3; background: var(--cream-2); padding: 36px; overflow: hidden; min-height: 480px; justify-content: flex-end; }
.cell-b { grid-column: 9 / 13; grid-row: 1; }
.cell-c { grid-column: 9 / 13; grid-row: 2; }
.cell-d { grid-column: 1 / 8;  grid-row: 3 / 5; }
.cell-e { grid-column: 8 / 13; grid-row: 3 / 5; }
.cell-f { grid-column: 1 / 5;  grid-row: 5; }
.cell-g { grid-column: 5 / 9;  grid-row: 5; }
.cell-h { grid-column: 9 / 13; grid-row: 5; }
.cell-i { grid-column: 1 / 6;  grid-row: 6; }
.cell-j { grid-column: 6 / 10; grid-row: 6; }
.cell-k { grid-column: 10 / 13; grid-row: 6; }
.cell-notable { grid-column: 1 / -1; grid-row: 7; }

/* surfaces */
.cell--ink {
  background: var(--ink); color: var(--cream); border-color: var(--ink-2);
  box-shadow: 0 1px 0 var(--ink-2), inset 0 0 70px color-mix(in oklab, var(--gold-1) 6%, transparent);
}
.cell--gold { background: var(--gold-1); border-color: var(--gold-2); color: var(--ink-2); }
.cell--rust { background: var(--rust); border-color: var(--rust-2); color: var(--cream); }
.cell--rust::after { background: var(--gold-2); }
.cell--ink::after { background: var(--gold-2); }

/* ---------- kickers, chips, meta ---------- */
.kicker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.kicker { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.kicker--gold { color: var(--gold-2); }
.kicker-rule {
  flex: 1; height: 1px; background: var(--rule);
  transform: scaleX(0); transform-origin: left;
}
.cell--ink .kicker-rule { background: color-mix(in oklab, currentColor 22%, transparent); }
.cell--rust .kicker, .cell--rust .kicker-rule { color: inherit; }
.cell--rust .kicker { opacity: .8; }
.cell--rust .kicker-rule { background: color-mix(in oklab, currentColor 30%, transparent); }
.cell--gold .kicker { color: var(--gold-3); }
.cell--gold .kicker-rule { background: var(--gold-2); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rust); flex: none; }
.in .live-dot { animation: live-pulse 900ms var(--ease-out) 2; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--rust) 45%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .72rem; padding: 3px 9px;
  border: 1px solid var(--rule); border-radius: 2px;
  color: var(--muted); background: transparent;
}
.chip--type { color: var(--rust); border-color: color-mix(in oklab, var(--rust) 45%, transparent); }
.chip--guide { background: var(--gold-1); border-color: var(--gold-2); color: var(--dark-bg); }
.meta { font-size: .78rem; color: var(--muted); }

/* arrow links */
.more { font-size: .78rem; color: var(--rust); display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.more .arr { transition: transform var(--t-fast) var(--ease-hover); display: inline-block; }
.more:hover .arr, .more:focus-visible .arr { transform: translateX(4px); }

/* ---------- cell a: lead ---------- */
.graph { position: absolute; right: -30px; top: -20px; width: 58%; height: auto; pointer-events: none; }
.g-line { stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 620; stroke-dashoffset: 620; transition: stroke var(--t-med) var(--ease-hover); }
.g-node { fill: var(--rust); opacity: 0; transform: scale(0); transform-origin: center; transform-box: fill-box; transition: fill var(--t-med) var(--ease-hover); }
.in .g-line { animation: graph-draw 1100ms var(--ease-out) 200ms forwards; }
.in .g-node { animation: node-pop 420ms var(--ease-out) forwards; animation-delay: var(--gd, 600ms); }
@keyframes graph-draw { to { stroke-dashoffset: 0; } }
@keyframes node-pop { to { opacity: 1; transform: scale(1); } }
@media (hover: hover) {
  .cell-a:hover .g-node, .cell-a:focus-within .g-node { fill: var(--rust-2); }
  .cell-a:hover .g-line, .cell-a:focus-within .g-line { stroke: var(--muted-2); }
}

.cell-a-body { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; max-width: 620px; }
.lead-hed {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.8rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -0.015em;
  text-wrap: balance;
}
.lead-hed a {
  background-image: linear-gradient(var(--rust), var(--rust));
  background-repeat: no-repeat; background-size: 0% 2px; background-position: 0 96%;
  transition: background-size var(--t-slow) var(--ease-out);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cell-a:hover .lead-hed a, .lead-hed a:focus-visible { background-size: 100% 2px; }
.lead-dek { font-size: 1.05rem; line-height: 1.55; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.cell-a:hover .more .arr { transform: translateX(4px); }

/* ---------- rows: today / wire / mini / path ---------- */
.row-list { display: flex; flex-direction: column; }
.wire-row {
  position: relative;
  display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: baseline;
  padding: 11px 10px 11px 14px;
  border-top: 1px solid var(--rule);
  transition: background var(--t-fast) var(--ease-hover);
}
.wire-row::before {
  content: ""; position: absolute; left: 0; top: 50%; margin-top: -1px;
  width: 8px; height: 2px; background: var(--rust);
  opacity: 0; transform: translateX(-10px);
  transition: transform var(--t-fast) var(--ease-hover), opacity var(--t-fast) var(--ease-hover);
}
.wire-row:hover, .wire-row:focus-visible { background: var(--cream-2); }
.wire-row:hover::before, .wire-row:focus-visible::before { opacity: 1; transform: translateX(0); }
.w-time { font-size: .72rem; color: var(--muted-2); transition: color var(--t-fast) var(--ease-hover); }
.wire-row:hover .w-time, .wire-row:focus-visible .w-time { color: var(--rust); }
.w-title {
  display: block; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.3;
  transition: transform var(--t-fast) var(--ease-hover);
}
.wire-row:hover .w-title, .wire-row:focus-visible .w-title { transform: translateX(6px); }
.w-meta { display: block; font-size: .72rem; color: var(--muted-2); margin-top: 2px; }
.wire-date { font-size: .72rem; color: var(--muted-2); margin: 16px 0 4px; }
.row-list > .wire-date:first-child, .wire-head + .wire-date { margin-top: 0; }
.cell .more { margin-top: auto; padding-top: 16px; }

/* compact mini rows (field guides, picks) */
.mini-row {
  display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: baseline;
  padding: 9px 4px; border-top: 1px solid var(--rule);
  transition: background var(--t-fast) var(--ease-hover);
}
.mini-row:hover, .mini-row:focus-visible { background: var(--cream-2); }
.m-num { font-size: .78rem; color: var(--rust); }
.m-title { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.3; display: block; transition: transform var(--t-fast) var(--ease-hover); }
.mini-row:hover .m-title, .mini-row:focus-visible .m-title { transform: translateX(6px); }
.m-meta { display: block; font-size: .72rem; color: var(--muted-2); margin-top: 1px; }

/* start-here path */
.path { position: relative; display: flex; flex-direction: column; }
.path::before { content: ""; position: absolute; left: 72px; top: 8px; bottom: 8px; width: 1px; background: var(--rule); }
.path-row {
  display: grid; grid-template-columns: 58px 1fr; gap: 28px; align-items: start;
  padding: 13px 4px; border-top: 1px solid var(--rule);
  transition: background var(--t-fast) var(--ease-hover);
}
.path-row:first-of-type { border-top: 0; }
.path-row:hover, .path-row:focus-visible { background: var(--cream-2); }
.gnum {
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
  color: var(--muted-2);
  transition: color 500ms var(--ease-out); transition-delay: var(--d, 0ms);
}
.in .gnum { color: var(--rust); }
.path-title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; display: block; transition: transform var(--t-fast) var(--ease-hover); }
.path-row:hover .path-title, .path-row:focus-visible .path-title { transform: translateX(6px); }
.path-meta { display: block; font-size: .72rem; color: var(--muted-2); margin-top: 3px; }

/* ---------- cell c: the pulse ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 14px; }
.stat-num {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(2.2rem, 3vw, 3rem); line-height: 1;
  color: var(--gold-2); font-variant-numeric: tabular-nums;
  display: block;
}
.stat-label { display: block; font-size: .7rem; color: color-mix(in oklab, currentColor 62%, transparent); margin-top: 8px; }
.stat-caption { font-size: .72rem; color: color-mix(in oklab, currentColor 62%, transparent); margin-top: auto; }

/* ---------- cell i: featured ---------- */
.thumb-wrap { margin: 14px 0; border: 1px solid var(--rule); }
.cell-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.15; text-wrap: balance; }
.cell-title a {
  background-image: linear-gradient(var(--rust), var(--rust));
  background-repeat: no-repeat; background-size: 0% 2px; background-position: 0 100%;
  transition: background-size var(--t-med) var(--ease-hover);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cell:hover .cell-title a, .cell-title a:focus-visible { background-size: 100% 2px; }
.cell-dek { font-size: .92rem; line-height: 1.55; color: var(--muted); margin-top: 8px; text-wrap: pretty; }

/* ---------- cell j: pull quote ---------- */
.quote {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem); line-height: 1.25;
  margin: auto 0; text-wrap: balance;
}
.quote-attr { font-size: .72rem; color: var(--gold-3); margin-top: 16px; }

/* ---------- cell k: picks (rust) ---------- */
.pick { display: block; padding: 10px 4px; border-top: 1px solid color-mix(in oklab, currentColor 28%, transparent); transition: background var(--t-fast) var(--ease-hover); }
.pick:hover, .pick:focus-visible { background: color-mix(in oklab, var(--dark-bg) 12%, transparent); }
.pick-title { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.3; display: block; transition: transform var(--t-fast) var(--ease-hover); }
.pick:hover .pick-title, .pick:focus-visible .pick-title { transform: translateX(6px); }
.pick-meta { display: block; font-size: .72rem; opacity: .75; margin-top: 2px; }

/* ---------- newsletter band ---------- */
.band-wrap { max-width: 1240px; margin: 16px auto 0; padding: 0 24px; }
.band {
  padding: 36px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center;
}
.band-proof { font-family: var(--font-display); font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.25; margin-top: 10px; text-wrap: balance; }
.band-sub { font-size: .78rem; color: color-mix(in oklab, currentColor 62%, transparent); margin-top: 10px; font-family: var(--font-mono); letter-spacing: .06em; }
.nl-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.field { position: relative; flex: 1 1 120px; }
.field label { display: block; font-size: .68rem; color: color-mix(in oklab, currentColor 62%, transparent); margin-bottom: 4px; }
.field input {
  width: 100%; background: transparent; border: 0; outline: none;
  border-bottom: 1px solid color-mix(in oklab, currentColor 35%, transparent);
  padding: 8px 2px; color: inherit;
}
.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--gold-2); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease-hover);
}
.field:focus-within::after { transform: scaleX(1); }
.subscribe {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; text-transform: lowercase;
  background: var(--rust); color: var(--cream); padding: 12px 22px; flex: none;
  transition: background var(--t-fast) var(--ease-hover), transform var(--t-fast) var(--ease-hover);
}
.subscribe:hover, .subscribe:focus-visible { background: var(--rust-2); transform: translateY(-1px); }
.subscribe:active { transform: scale(.985); }
[data-theme="dark"] .subscribe { color: var(--dark-bg); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--rule); margin-top: 16px; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 44px 24px 28px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 28px;
}
.f-kicker { display: block; font-size: .72rem; color: var(--muted-2); margin-bottom: 12px; }
.f-brand { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--font-display); font-size: 1.2rem; }
.f-line { font-size: .9rem; color: var(--muted); margin-top: 10px; max-width: 30ch; text-wrap: pretty; }
.f-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.f-col a {
  font-size: .9rem;
  background-image: linear-gradient(var(--rust), var(--rust));
  background-repeat: no-repeat; background-size: 0% 1.5px; background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size var(--t-fast) var(--ease-hover);
}
.f-col a:hover, .f-col a:focus-visible { background-size: 100% 1.5px; }
.f-base {
  max-width: 1240px; margin: 0 auto; padding: 0 24px 28px;
  font-size: .72rem; color: var(--muted-2);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------- article pages ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 40px 24px 0; }
.article { max-width: 720px; margin: 0 auto; padding: 48px 24px 0; }
.post-hed {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 4.4vw, 3.6rem); line-height: 1.05; letter-spacing: -0.012em;
  margin: 14px 0 16px; text-wrap: balance;
}
.post-dek { font-size: 1.12rem; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.post-meta-row {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 12px 0; margin: 24px 0 32px;
}
.prose { font-size: 1rem; line-height: 1.65; }
.prose p { margin-bottom: 1.25em; text-wrap: pretty; }
.prose h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.2; margin: 1.8em 0 .6em; }
.prose h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1.25; margin: 1.5em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.25em 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  border-left: 2px solid var(--rust); padding-left: 18px; margin: 0 0 1.25em;
  font-family: var(--font-display); font-style: italic; font-size: 1.15rem; line-height: 1.45;
}

/* outbound source links — markdown-authored prose anchors (absolute hrefs)
   get the same treatment via attribute selectors; the ↗ arrives as ::after
   because markdown cannot emit the .ext span */
.out, .prose a[href^="http"] {
  color: var(--rust);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-size: 0% 1.5px; background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size var(--t-fast) var(--ease-hover), color var(--t-fast);
}
.out:hover, .out:focus-visible,
.prose a[href^="http"]:hover, .prose a[href^="http"]:focus-visible { background-size: 100% 1.5px; }
.out .ext, .prose a[href^="http"]::after { display: inline-block; font-size: .8em; transition: transform var(--t-fast) var(--ease-hover); }
.prose a[href^="http"]::after { content: "\2009\2197"; }
.out:hover .ext, .out:focus-visible .ext,
.prose a[href^="http"]:hover::after, .prose a[href^="http"]:focus-visible::after { transform: translate(2px, -2px); }

/* internal text links — markdown-authored internal anchors (relative hrefs) match too */
.ilink, .prose a:not([href^="http"]) {
  background-image: linear-gradient(var(--rust), var(--rust));
  background-repeat: no-repeat; background-size: 0% 1.5px; background-position: 0 100%;
  padding-bottom: 1px; transition: background-size var(--t-fast) var(--ease-hover);
}
.ilink:hover, .ilink:focus-visible,
.prose a:not([href^="http"]):hover, .prose a:not([href^="http"]):focus-visible { background-size: 100% 1.5px; }

/* video slot */
.video-slot {
  aspect-ratio: 16 / 9; margin: 0 0 32px;
  border: 1px solid var(--rule);
  background: repeating-linear-gradient(45deg, var(--cream-2) 0 10px, var(--cream) 10px 20px);
  display: grid; place-items: center;
}
.slot-label { font-size: .72rem; color: var(--muted); background: var(--cream); border: 1px solid var(--rule); padding: 4px 10px; }

/* sources panel — a designed object */
.sources { background: var(--cream-2); border: 1px solid var(--rule); padding: 26px; margin: 44px 0; }
.src-row {
  display: grid; grid-template-columns: 22px auto 1fr auto; gap: 14px; align-items: center;
  padding: 12px 8px; border-top: 1px solid var(--rule);
  transition: background var(--t-fast) var(--ease-hover);
}
.src-row:hover, .src-row:focus-visible { background: var(--cream-3); }
.src-num { font-size: .72rem; color: var(--muted-2); }
.domain-chip {
  font-size: .72rem; border: 1px solid var(--rule); background: var(--cream);
  padding: 3px 9px; border-radius: 2px; color: var(--muted); white-space: nowrap;
  transition: background var(--t-fast) var(--ease-hover), color var(--t-fast) var(--ease-hover), border-color var(--t-fast) var(--ease-hover);
}
.src-row:hover .domain-chip, .src-row:focus-visible .domain-chip { background: var(--rust); color: var(--cream); border-color: var(--rust); }
.src-title { font-size: .95rem; line-height: 1.4; }
.src-row .ext { color: var(--rust); transition: transform var(--t-fast) var(--ease-hover); }
.src-row:hover .ext, .src-row:focus-visible .ext { transform: translate(2px, -2px); }

/* takeaway */
.takeaway { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 24px 0; margin: 44px 0; }
.takeaway-line { font-family: var(--font-display); font-style: italic; font-size: 1.45rem; line-height: 1.3; margin-top: 10px; text-wrap: balance; }

/* next block */
.next-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 14px; }
.next-card {
  border: 1px solid var(--rule); background: var(--cream-2); padding: 22px;
  display: flex; flex-direction: column; gap: 8px; position: relative;
  transition: transform var(--t-med) var(--ease-hover), box-shadow var(--t-med) var(--ease-hover);
}
@media (hover: hover) {
  .next-card:hover, .next-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(27,23,20,.10); }
}
.prevnext { display: flex; flex-direction: column; gap: 16px; }
.pn {
  border: 1px solid var(--rule); padding: 16px 18px; flex: 1;
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  transition: background var(--t-fast) var(--ease-hover);
}
.pn:hover, .pn:focus-visible { background: var(--cream-2); }
.pn .w-title { font-size: 1rem; }
.next-wrap { margin: 44px 0 0; padding-bottom: 0; }
/* related-by-topic strip (news post): reuses .pn cards; chips need breathing room */
.pn-chips { margin-top: 8px; }

/* table of contents */
.toc { border: 1px solid var(--rule); background: var(--cream-2); padding: 22px 24px; margin: 0 0 36px; }
.toc ol { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.toc-num { color: var(--rust); font-size: .72rem; margin-right: 10px; }

/* guide numeral plate */
.plate-row { display: flex; align-items: center; gap: 24px; margin-bottom: 10px; }
.plate {
  width: 104px; height: 104px; flex: none;
  display: grid; place-items: center;
  background: var(--cream-2); border: 1px solid var(--rule);
  font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--rust);
}

/* ---------- index pages ---------- */
.index-hed {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.8rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -0.015em;
}
.index-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.index-intro { color: var(--muted); max-width: 56ch; margin-top: 12px; text-wrap: pretty; }

.stat-strip {
  display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: baseline;
  background: var(--ink); color: var(--cream); border: 1px solid var(--ink-2);
  padding: 16px 22px; margin: 24px 0;
  box-shadow: inset 0 0 50px color-mix(in oklab, var(--gold-1) 6%, transparent);
}
.strip-stat { display: flex; align-items: baseline; gap: 10px; }
.strip-num { font-family: var(--font-mono); font-weight: 500; font-size: 1.5rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.strip-label { font-size: .72rem; color: color-mix(in oklab, currentColor 62%, transparent); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.tag-row a {
  font-size: .72rem; padding: 4px 11px; border: 1px solid var(--rule); border-radius: 2px; color: var(--muted);
  transition: color var(--t-fast) var(--ease-hover), border-color var(--t-fast) var(--ease-hover), background var(--t-fast) var(--ease-hover);
}
.tag-row a:hover, .tag-row a:focus-visible { color: var(--rust); border-color: var(--rust); }
.tag-row a[aria-current="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.river { border-top: 1px solid var(--rule); }
.river .wire-row { grid-template-columns: 72px 1fr; padding: 16px 12px 16px 16px; }
.river .w-title { font-size: 1.35rem; line-height: 1.25; }
.river-date {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: lowercase; color: var(--muted-2);
  padding: 22px 0 8px; display: flex; align-items: baseline; gap: 12px;
}
.river-date .count { color: var(--rust); }
.pagination {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: .78rem; color: var(--muted); border-top: 1px solid var(--rule);
  padding: 20px 0; margin-top: 12px;
}

/* guides index */
.lib-section { margin-bottom: 44px; }
.lib-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 24px; align-items: start;
  padding: 18px 12px; border-top: 1px solid var(--rule);
  transition: background var(--t-fast) var(--ease-hover);
}
.lib-row:hover, .lib-row:focus-visible { background: var(--cream-2); }
.lib-num { font-family: var(--font-display); font-size: 3.2rem; line-height: .9; color: var(--muted-2); transition: color 500ms var(--ease-out); }
.in .lib-num { color: var(--rust); }
.lib-title { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; display: block; transition: transform var(--t-fast) var(--ease-hover); }
.lib-row:hover .lib-title, .lib-row:focus-visible .lib-title { transform: translateX(6px); }
.lib-dek { font-size: .92rem; color: var(--muted); margin-top: 4px; max-width: 60ch; text-wrap: pretty; }
.lib-meta { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: lowercase; color: var(--muted-2); white-space: nowrap; padding-top: 10px; }

/* ink panel page (newsletter/about) */
.panel { background: var(--ink); color: var(--cream); border: 1px solid var(--ink-2); padding: 44px; margin: 8px 0 0; box-shadow: inset 0 0 70px color-mix(in oklab, var(--gold-1) 6%, transparent); }
.panel .post-hed { margin-top: 8px; }
.panel .post-dek { color: color-mix(in oklab, currentColor 70%, transparent); }

/* ---------- reveals (animation-based so hover transitions stay free) ---------- */
[data-reveal] { opacity: 0; }
[data-reveal].in { opacity: 1; animation: cell-reveal var(--t-slow) var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
@keyframes cell-reveal { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.rise { opacity: 0; }
.in .rise { opacity: 1; animation: row-rise var(--t-med) var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
@keyframes row-rise { from { opacity: 0; transform: translateY(8px); } }
.in .kicker-rule { transform: scaleX(1); transition: transform 600ms var(--ease-out) 150ms; }

/* ---------- dark-mode surface overrides ---------- */
[data-theme="dark"] .cell--ink,
[data-theme="dark"] .stat-strip,
[data-theme="dark"] .panel {
  background: var(--cream-3); color: var(--ink); border-color: var(--rule);
  box-shadow: inset 0 0 70px color-mix(in oklab, var(--gold-1) 4%, transparent);
}
[data-theme="dark"] .cell--gold { color: var(--dark-bg); }
[data-theme="dark"] .cell--gold .kicker { color: var(--gold-3); }
[data-theme="dark"] .chip--guide { color: var(--dark-bg); }
[data-theme="dark"] .takeaway { border-top-color: var(--ink); }
[data-theme="dark"] .masthead.condensed { box-shadow: 0 1px 0 var(--rule), 0 10px 30px rgba(0,0,0,.35); }
[data-theme="dark"] .cell:hover, [data-theme="dark"] .next-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.35); }
[data-theme="dark"] .pick:hover, [data-theme="dark"] .pick:focus-visible { background: color-mix(in oklab, var(--dark-bg) 18%, transparent); }
/* guide thumbnails stay light — a printed card on a dark desk */
[data-theme="dark"] .thumb-wrap { border-color: var(--rule); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  [data-reveal], .rise { opacity: 1; }
  .g-line { stroke-dashoffset: 0; }
  .g-node { opacity: 1; transform: scale(1); }
  .live-dot, .in .live-dot { animation: none !important; }
  .gnum, .lib-num { color: var(--rust); }
  .kicker-rule { transform: scaleX(1); }
}

/* ---------- breakpoints ---------- */
@media (max-width: 920px) {
  .board { grid-template-columns: repeat(6, 1fr); }
  .cell-a { grid-column: 1 / -1; grid-row: auto; min-height: 420px; }
  .cell-b { grid-column: 1 / 4; grid-row: auto; }
  .cell-c { grid-column: 4 / 7; grid-row: auto; }
  .cell-d { grid-column: 1 / -1; grid-row: auto; }
  .cell-e { grid-column: 1 / -1; grid-row: auto; }
  .cell-f { grid-column: 1 / 4; grid-row: auto; }
  .cell-g { grid-column: 4 / 7; grid-row: auto; }
  .cell-h { grid-column: 1 / 4; grid-row: auto; }
  .cell-i { grid-column: 4 / 7; grid-row: auto; }
  .cell-j { grid-column: 1 / 4; grid-row: auto; }
  .cell-k { grid-column: 4 / 7; grid-row: auto; }
  .cell-notable { grid-column: 1 / -1; grid-row: auto; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .band { grid-template-columns: 1fr; gap: 24px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .next-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .cell-a { padding: 26px; }
  .panel { padding: 30px 24px; }
}
@media (max-width: 680px) {
  .board { grid-template-columns: 1fr; }
  .cell-a, .cell-b, .cell-c, .cell-d, .cell-e, .cell-f,
  .cell-g, .cell-h, .cell-i, .cell-j, .cell-k, .cell-notable { grid-column: 1 / -1; }
  .cell-a { min-height: 0; }
  .graph { width: 78%; opacity: .6; }
  .lib-row { grid-template-columns: 64px 1fr; }
  .lib-meta { grid-column: 2; padding-top: 4px; white-space: normal; }
  .lib-num { font-size: 2.4rem; }
  .river .wire-row { grid-template-columns: 56px 1fr; }
  .river .w-title { font-size: 1.15rem; }
}
@media (max-width: 600px) {
  .folio-inner span:last-child { display: none; }
  .nav { gap: 14px; }
  .masthead-inner { padding: 0 16px; }
  .folio-inner, .board, .band-wrap, .footer-inner, .f-base { padding-left: 16px; padding-right: 16px; }
  .article, .page { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 540px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nl-form { flex-direction: column; align-items: stretch; }
  .subscribe { width: 100%; }
  /* masthead may wrap; every tap target reaches 40px */
  .masthead-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .masthead.condensed .masthead-inner { height: auto; }
  .nav { flex-wrap: wrap; row-gap: 0; }
  .nav a { padding-top: 11px; padding-bottom: 11px; }
  .theme-toggle { width: 40px; height: 40px; }
  .brand { padding: 8px 0; }
}
@media (max-width: 390px) {
  .brand-name { font-size: 1.2rem; }
  .path-row { grid-template-columns: 44px 1fr; gap: 18px; }
  .path::before { left: 54px; }
  .gnum { font-size: 2rem; }
}
