/* Serif — public pages. The Bound Periodical, extended to the site. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url(/fonts/bricolage-grotesque-latin.woff2) format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url(/fonts/source-serif-4-latin.woff2) format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url(/fonts/source-serif-4-italic-latin.woff2) format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #fffdf9;
  --ink: #181614;
  --mute: #6f685f;
  --line: #e6e1d8;
  --sunk: #f6f2ea;
  --inbox: #c8412a;
  --reader: #2e6fe4;
  --reader-deep: #2258c9;
  --ledger: #2f7a4f;
  --gold: #8f6410;
  --grot: 'Bricolage Grotesque', system-ui, sans-serif;
  --text: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --ink: #eae5db;
    --mute: #8d857a;
    --line: #2b2823;
    --sunk: #1c1a16;
    --inbox: #f0705a;
    --reader: #6fa0ff;
    --reader-deep: #6fa0ff;
    --ledger: #5fbd85;
    --gold: #e0b055;
  }
}

* { box-sizing: border-box; }
html { height: 100%; scrollbar-color: var(--line) var(--paper); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
  border: 3px solid var(--paper);
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: color-mix(in oklab, var(--reader) 24%, var(--paper)); }
:focus-visible { outline: 2px solid var(--inbox); outline-offset: 3px; border-radius: 2px; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in oklab, var(--reader) 62%, var(--paper));
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.12s linear, text-decoration-color 0.12s linear;
}
a:hover { color: var(--reader); text-decoration-color: var(--reader); }

/* ── Folio: the running head both pages share ─────────────────────────── */
.folio {
  max-width: 85ch;
  margin-inline: auto;
  padding: 26px clamp(20px, 6vw, 48px) 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--text);
  font-size: 1.4375rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.folio-note {
  font-family: var(--grot);
  font-size: 0.8125rem;
  color: var(--mute);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── The letter ───────────────────────────────────────────────────────── */
main {
  max-width: 85ch;
  margin-inline: auto;
  padding: 0 clamp(20px, 6vw, 48px);
}
.letter { padding-top: clamp(40px, 8vh, 84px); }
h1 {
  font-family: var(--grot);
  font-size: clamp(2.1rem, 5.4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0 0 0.9em;
  max-width: 18ch;
}
p { max-width: 75ch; margin: 0 0 1.35em; }
.inbox-word, .reader-word, .ledger-word {
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}
.inbox-word { text-decoration-color: var(--inbox); }
.reader-word { text-decoration-color: var(--reader); }
.ledger-word { text-decoration-color: var(--ledger); }

.signoff { margin-top: 2.6em; }
.signature {
  font-family: var(--text);
  font-style: italic;
  font-size: 1.25rem;
  margin-bottom: 0.15em;
}
.signature-role {
  font-family: var(--grot);
  font-size: 0.8125rem;
  color: var(--mute);
  letter-spacing: 0.02em;
}

/* ── The plate: figs. 1–3 ─────────────────────────────────────────────── */
.plate {
  margin: 3.2em 0;
  display: grid;
  gap: 14px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--sunk);
}
.dept {
  font-family: var(--grot);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.dept.d-inbox { color: var(--inbox); }
.dept.d-reader { color: var(--reader); }
.dept.d-ledger { color: var(--ledger); }
.panel-meta { font-family: var(--grot); font-size: 0.75rem; color: var(--mute); }

.row {
  display: grid;
  grid-template-columns: 30px minmax(7em, 11em) 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
  font-family: var(--grot);
  font-size: 0.875rem;
  line-height: 1.35;
  border-top: 1px solid var(--line);
  position: relative;
}
.row:first-of-type { border-top: 0; }
.row.sel { box-shadow: inset 3px 0 0 var(--inbox); }
.av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--sunk);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--mute);
  letter-spacing: 0.02em;
}
.sender { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.subj b { font-weight: 650; }
.subj span { color: var(--mute); font-weight: 400; }
.when {
  color: var(--mute);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.filed-note {
  color: var(--reader-deep);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
}
.filed-note kbd {
  font-family: var(--grot);
  font-size: 0.6875rem;
  border: 1px solid color-mix(in oklab, var(--reader) 40%, var(--line));
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* The one authored moment: the newsletter row files itself to the Reader. */
.row.file-me { transition: background 0.4s linear; }
.row.file-me .filed-note { transition: opacity 0.5s linear 0.7s; }
.plate.go .row.file-me {
  background: color-mix(in oklab, var(--reader) 13%, var(--paper));
  box-shadow: inset 3px 0 0 var(--reader);
}
.plate.go .row.file-me .when { display: none; }
.plate.go .row.file-me .filed-note { opacity: 1; }
.plate.go .fig-reader { border-color: color-mix(in oklab, var(--reader) 38%, var(--line)); }
@media (prefers-reduced-motion: reduce) {
  .row.file-me, .row.file-me .filed-note { transition: none; }
}

.article { padding: 18px 20px 4px; max-width: 58ch; }
.art-folio {
  font-family: var(--grot);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--reader);
  margin-bottom: 10px;
}
.art-title {
  font-family: var(--text);
  font-size: 1.375rem;
  font-weight: 650;
  line-height: 1.2;
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.art-byline { font-family: var(--grot); font-size: 0.78125rem; color: var(--mute); margin-bottom: 12px; }
.art-body { font-size: 0.9375rem; line-height: 1.6; margin: 0; }
.art-fade {
  height: 40px;
  background: linear-gradient(color-mix(in srgb, var(--paper) 0%, transparent), var(--paper));
  margin-top: -40px;
  position: relative;
}

.day-label {
  font-family: var(--grot);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 10px 16px 4px;
}
/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  max-width: 85ch;
  margin: clamp(48px, 10vh, 96px) auto 0;
  padding: 20px clamp(20px, 6vw, 48px) 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: baseline;
  font-family: var(--grot);
  font-size: 0.8125rem;
  color: var(--mute);
}
footer a { text-decoration-color: color-mix(in oklab, var(--mute) 50%, var(--paper)); }
footer .spacer { flex: 1; }

code {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

/* ── Policy page ──────────────────────────────────────────────────────── */
.policy { padding-top: clamp(36px, 7vh, 72px); font-size: 1.0625rem; }
.policy h1 { margin-bottom: 0.35em; }
.dateline {
  font-family: var(--grot);
  font-size: 0.875rem;
  color: var(--mute);
  margin-bottom: 2.4em;
}
.policy h2 {
  font-family: var(--grot);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 2.2em 0 0.55em;
  max-width: 75ch;
}
.policy ul { max-width: 75ch; padding-left: 1.2em; margin: 0 0 1.35em; }
.policy li { margin-bottom: 0.45em; }
.policy li::marker { color: var(--mute); }

@media (max-width: 560px) {
  body { font-size: 1.0938rem; }
  .row { grid-template-columns: 30px 1fr auto; }
  .row .subj { grid-column: 2 / 4; grid-row: 2; }
  .row .sender { min-width: 0; }
  /* The filing note takes its own line so it never crowds the sender's name. */
  .row .filed-note { display: none; grid-column: 2 / 4; grid-row: 3; justify-self: start; }
  .plate.go .row.file-me .filed-note { display: block; opacity: 1; }
}
