/* Hallmark · macrostructure: Long Document · tone: calm, tactile, unhurried · anchor hue: moss 140
 * nav: N3 side-rail (fixed vertical wordmark, section dots, Index sheet; becomes a slim top bar under 60rem)
 * footer: Ft7 adapted as a corrections-first close (no newsletter; a link to write to the editors) · enrichment: Tier B hand-built SVG line-work
 * pre-emit critique: P4 H4 E4 S4 R5 V4
 */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.7; font-kerning: normal; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; font-style: normal; color: var(--color-ink); overflow-wrap: anywhere; min-width: 0; font-optical-sizing: auto; }
a { color: var(--color-accent-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--color-accent-soft); transition: text-decoration-color var(--dur-fast) var(--ease-out); }
a:hover { text-decoration-color: var(--color-accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: var(--space-sm); top: -4rem; z-index: 60; padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); }
.skip:focus { top: var(--space-sm); }

/* ---------- N3 side-rail ---------- */
.rail { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); height: var(--bar-h); padding-inline: var(--gutter); background: var(--color-paper-2); border-bottom: var(--rule-hair) solid var(--color-rule); }
.rail__brand { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; text-decoration: none; color: var(--color-ink); }
.rail__brand svg { flex: none; width: 1.75rem; height: 1.75rem; }
.rail__name { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 560; letter-spacing: 0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail__dots { display: none; }
.rail__index { flex: none; white-space: nowrap; min-height: 2.75rem; padding: 0 var(--space-md); font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; transition: background-color var(--dur-fast) var(--ease-out); }
.rail__index:hover { background: var(--color-accent-wash); }
.rail__index[aria-expanded="true"] { background: var(--color-ink); color: var(--color-paper); border-color: var(--color-ink); }
.m-a { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linecap: round; }
.m-b { fill: none; stroke: var(--color-ink); stroke-width: 2; stroke-linecap: round; }
.m-c { fill: none; stroke: var(--color-plum); stroke-width: 1.2; stroke-linecap: round; }

.sheet { position: fixed; z-index: 45; top: var(--bar-h); bottom: 0; left: 0; width: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--color-paper); border-right: var(--rule-hair) solid var(--color-rule); padding: var(--space-lg) var(--gutter) var(--space-2xl); }
.sheet[hidden], .scrim[hidden] { display: none; }
.sheet:not([hidden]) { animation: sheet-in var(--dur-base) var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateX(-0.75rem); } to { opacity: 1; transform: none; } }
.scrim { position: fixed; z-index: 44; inset: var(--bar-h) 0 0 0; background: var(--color-scrim); }
.sheet__group { margin: 0 0 var(--space-lg); }
.sheet__group h2 { margin: 0 0 var(--space-xs); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--color-ink-mute); }
.sheet__group ul { list-style: none; margin: 0; padding: 0; }
.sheet__group a { display: block; padding: 0.4rem 0; font-family: var(--font-display); font-size: 1.125rem; line-height: 1.3; color: var(--color-ink); text-decoration: none; border-bottom: var(--rule-hair) solid var(--color-rule); }
.sheet__group a:hover { color: var(--color-accent-strong); }
.sheet__group a[aria-current="page"] { color: var(--color-accent); font-weight: 600; }

@media (min-width: 60rem) {
  .rail { position: fixed; inset: 0 auto 0 0; width: var(--rail-w); height: 100dvh; flex-direction: column; justify-content: flex-start; align-items: center; gap: var(--space-md); padding: var(--space-md) 0; border-bottom: 0; border-right: var(--rule-hair) solid var(--color-rule); }
  .rail__brand { flex-direction: column; gap: var(--space-sm); flex: 0 1 auto; min-height: 0; }
  .rail__name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 1rem; max-height: 15rem; }
  .rail__dots { display: flex; flex-direction: column; flex: 1 1 auto; justify-content: center; list-style: none; margin: 0; padding: 0; min-height: 0; overflow: visible; }
  .rail__dots a { position: relative; display: grid; place-items: center; width: 2.75rem; height: 1.7rem; text-decoration: none; }
  .rail__dots a::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; border: var(--rule-mid) solid var(--color-rule-strong); background: transparent; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
  .rail__dots a:hover::before, .rail__dots a.is-here::before { background: var(--color-accent); border-color: var(--color-accent); }
  .rail__dots a::after { content: attr(data-label); position: absolute; left: calc(100% + 0.25rem); top: 50%; transform: translateY(-50%); z-index: 3; width: max-content; max-width: 16rem; padding: 0.3rem 0.6rem; background: var(--color-ink); color: var(--color-paper); font-size: var(--text-xs); line-height: 1.35; border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease-out); }
  .rail__dots a:focus-visible::after { opacity: 1; }
  .rail__index { width: 3.5rem; justify-content: center; padding: 0; flex: none; }
  .sheet { top: 0; left: var(--rail-w); width: min(30rem, calc(100% - var(--rail-w))); padding-top: var(--space-xl); }
  .scrim { inset: 0 0 0 var(--rail-w); }
  .page { margin-left: var(--rail-w); }
  html { scroll-padding-top: 2rem; }
}
@media (min-width: 60rem) and (hover: hover) { .rail__dots a:hover::after { opacity: 1; } }
@media (min-width: 60rem) and (max-height: 40rem) { .rail__dots { display: none; } }

/* ---------- the document ---------- */
.doc { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding: var(--space-xl) var(--gutter) var(--space-3xl); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 var(--space-xs); list-style: none; margin: 0 0 var(--space-lg); padding: 0; font-size: var(--text-sm); color: var(--color-ink-mute); }
.crumbs li + li::before { content: "/"; margin-right: var(--space-xs); color: var(--color-rule-strong); }
.crumbs a { color: var(--color-ink-dim); white-space: nowrap; }
.head h1 { margin: 0 0 var(--space-md); font-size: var(--text-2xl); line-height: 1.1; letter-spacing: -0.012em; font-weight: 500; }
.head__dek { margin: 0 0 var(--space-md); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 380; line-height: 1.45; color: var(--color-ink-dim); }
.head__meta { display: flex; flex-wrap: wrap; margin: 0 0 var(--space-lg); font-size: var(--text-sm); color: var(--color-ink-mute); }
.head__meta span + span::before { content: "\00b7"; margin: 0 0.6em; }
.fig { margin: var(--space-lg) 0 var(--space-xl); padding: 0; }
.motif { display: block; width: 100%; height: auto; max-height: 8rem; }
.fig figcaption { margin-top: var(--space-xs); font-size: var(--text-xs); color: var(--color-ink-mute); line-height: 1.5; }
.ln-a { fill: none; stroke: var(--color-accent); stroke-width: 1.7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ln-b { fill: none; stroke: var(--color-ink); stroke-width: 1.2; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.75; }
.ln-c { fill: none; stroke: var(--color-plum); stroke-width: 1.1; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ln-x { fill: none; stroke: var(--color-rule-strong); stroke-width: 1; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dot-a { fill: var(--color-accent); }
.dot-b { fill: var(--color-ink-mute); }
.fill-a { fill: var(--color-accent-wash); stroke: none; }
.fill-b { fill: var(--color-paper-3); stroke: none; }
.orn { display: block; width: 7.5rem; height: auto; margin: var(--space-2xl) 0 var(--space-md); }
.o-a { fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-linecap: round; }
.o-b { fill: none; stroke: var(--color-plum); stroke-width: 1.2; stroke-linecap: round; }

.care { margin: 0 0 var(--space-lg); padding: var(--space-sm) var(--space-md); background: var(--color-accent-wash); border-left: 3px solid var(--color-accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--text-sm); line-height: 1.6; color: var(--color-ink-dim); }
.care strong { color: var(--color-ink); font-weight: 700; }
.toc { margin: 0 0 var(--space-xl); border-block: var(--rule-hair) solid var(--color-rule); }
.toc summary { cursor: pointer; padding: var(--space-sm) 0; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); list-style-position: inside; }
.toc ol { margin: 0 0 var(--space-md); padding-left: 1.4rem; font-size: var(--text-sm); line-height: 1.5; }
.toc li { padding: 0.18rem 0; }

.prose { max-width: var(--measure); }
.prose > p:first-child { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.55; font-weight: 400; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin: 2.6em 0 0.6em; font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem); line-height: 1.22; font-weight: 560; }
.prose h2::before { content: ""; display: block; width: 2.25rem; height: var(--rule-mid); margin-bottom: var(--space-sm); background: var(--color-accent); }
.prose h3 { margin: 1.8em 0 0.4em; font-size: 1.1875rem; line-height: 1.3; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4em; padding-left: 0.2rem; }
.prose li::marker { color: var(--color-accent); }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose blockquote { margin: 1.6em 0; padding: 0 0 0 var(--space-md); border-left: 2px solid var(--color-accent-soft); font-family: var(--font-display); font-size: 1.1875rem; line-height: 1.5; color: var(--color-ink-dim); }
.prose blockquote p { margin: 0; }
.prose abbr { text-decoration: underline dotted; text-underline-offset: 0.2em; cursor: help; }
.prose table.data { width: 100%; margin: 1.6em 0; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.prose table.data caption { padding-bottom: var(--space-xs); text-align: left; font-family: var(--font-display); font-weight: 560; font-size: 1rem; color: var(--color-ink); }
.prose table.data th, .prose table.data td { padding: var(--space-xs) var(--space-sm); text-align: left; vertical-align: top; border-bottom: var(--rule-hair) solid var(--color-rule); }
.prose table.data thead th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-mute); border-bottom: var(--rule-mid) solid var(--color-rule-strong); }
.prose table.data tbody th { font-weight: 600; }
@media (max-width: 39.99rem) {
  .prose table.data, .prose table.data tbody, .prose table.data tr, .prose table.data td, .prose table.data th { display: block; width: 100%; }
  .prose table.data thead { position: absolute; left: -9999px; }
  .prose table.data tr { padding: var(--space-xs) 0; border-bottom: var(--rule-mid) solid var(--color-rule-strong); }
  .prose table.data td, .prose table.data th { border: 0; padding: 0.15rem 0; }
  .prose table.data td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-mute); }
}

.faq { margin-top: var(--space-2xl); }
.faq h2 { margin-top: 0; }
.faq-item { padding: var(--space-md) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.faq-item:last-child { border-bottom: var(--rule-hair) solid var(--color-rule); }
.faq-item h3 { margin: 0 0 var(--space-xs); font-size: 1.125rem; }
.faq-item p { margin: 0; }
.prose #takeaway { margin-top: 0; }
.prose #takeaway + p { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.55; }

.next { margin: var(--space-2xl) 0 0; padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.next h2 { margin: 0 0 var(--space-sm); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--color-ink-mute); }
.next h2::before { display: none; }
.next ul { list-style: none; margin: 0; padding: 0; }
.next li { margin: 0; padding: 0; }
.next a { display: block; padding: var(--space-sm) 0; text-decoration: none; color: var(--color-ink); border-bottom: var(--rule-hair) solid var(--color-rule); }
.next a b { display: block; font-family: var(--font-display); font-size: 1.1875rem; font-weight: 560; line-height: 1.3; color: var(--color-accent-strong); }
.next a span { display: block; font-size: var(--text-sm); color: var(--color-ink-dim); line-height: 1.5; }
.next a:hover b { text-decoration: underline; text-underline-offset: 0.18em; }

.sources { margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: var(--rule-mid) solid var(--color-rule-strong); font-size: var(--text-sm); line-height: 1.55; color: var(--color-ink-dim); }
.prose .sources h2 { margin: 0 0 var(--space-sm); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--color-ink-mute); }
.prose .sources h2::before { display: none; }
.sources ul { list-style: none; margin: 0; padding: 0; counter-reset: note; }
.sources li { position: relative; margin: 0 0 var(--space-sm); padding-left: 2rem; counter-increment: note; overflow-wrap: anywhere; }
.sources li::before { content: counter(note); position: absolute; left: 0; top: 0; width: 1.4rem; text-align: right; font-family: var(--font-display); font-weight: 600; color: var(--color-accent); }

.notice { margin: 0 0 var(--space-lg); padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule-strong); border-left: 3px solid var(--color-plum); background: var(--color-paper-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--text-sm); }
.notice p { margin: 0; }
.form { display: grid; gap: var(--space-md); margin: var(--space-lg) 0; }
.form label { display: grid; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 600; }
.form input, .form textarea { width: 100%; min-height: 2.75rem; padding: 0.55rem var(--space-sm); font: inherit; font-weight: 400; color: var(--color-ink); background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-sm); }
.form textarea { min-height: 9rem; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.btn { justify-self: start; min-height: 2.75rem; padding: 0 var(--space-lg); font: inherit; font-weight: 600; white-space: nowrap; color: var(--color-paper); background: var(--color-accent-strong); border: 0; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.btn:hover { background: var(--color-ink); }
.btn:active { transform: translateY(1px); }

/* ---------- home ---------- */
.cover h1 { margin: var(--space-md) 0 var(--space-md); font-size: var(--text-3xl); line-height: 1.04; letter-spacing: -0.015em; font-weight: 480; }
.cover .lede { margin: 0 0 var(--space-md); font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.5; font-weight: 380; color: var(--color-ink-dim); }
.home-fig { display: block; width: 100%; height: auto; max-height: 15rem; }
.part { margin-top: var(--space-2xl); }
.part h2 { margin: 0 0 var(--space-md); font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem); font-weight: 560; line-height: 1.22; }
.part h2::before { content: ""; display: block; width: 2.25rem; height: var(--rule-mid); margin-bottom: var(--space-sm); background: var(--color-accent); }
.part p { margin: 0 0 1.1em; }
.run { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; }
.guides { list-style: none; margin: 0; padding: 0; }
.guides li { padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.guides li:first-child { border-top: var(--rule-hair) solid var(--color-rule); }
.guides a { font-family: var(--font-display); font-size: 1.1875rem; font-weight: 560; line-height: 1.3; }
.guides span { display: block; margin-top: 0.15rem; font-size: var(--text-sm); color: var(--color-ink-dim); line-height: 1.5; }

/* ---------- footer: corrections-first close ---------- */
.foot { margin-top: var(--space-3xl); background: var(--color-foot); color: var(--color-foot-ink); }
.foot__in { width: 100%; max-width: calc(var(--measure) + 14rem + 2 * var(--gutter)); margin-inline: auto; padding: var(--space-2xl) var(--gutter) var(--space-xl); display: grid; gap: var(--space-xl); grid-template-columns: minmax(0, 1fr); }
.foot__lead { margin: 0 0 var(--space-md); font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); line-height: 1.2; font-weight: 450; color: var(--color-foot-ink); max-width: 22ch; }
.foot__ask { margin: 0 0 var(--space-md); font-size: var(--text-sm); color: var(--color-foot-dim); max-width: 34ch; }
.foot .btn { background: var(--color-foot-ink); color: var(--color-foot); }
.foot .btn:hover { background: var(--color-accent-soft); }
.foot :focus-visible { outline-color: var(--color-foot-ink); }
.foot__name { margin: 0 0 var(--space-sm); font-family: var(--font-display); font-size: 1.125rem; font-weight: 560; }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); list-style: none; margin: 0; padding: 0; }
.foot__links a { display: inline-block; padding: 0.35rem 0; color: var(--color-foot-ink); white-space: nowrap; text-decoration-color: var(--color-foot-dim); }
.foot__links a:hover { text-decoration-color: var(--color-foot-ink); }
.foot__fine { grid-column: 1 / -1; margin: 0; padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-foot-dim); font-size: var(--text-xs); line-height: 1.6; color: var(--color-foot-dim); max-width: 62ch; }
@media (min-width: 48rem) { .foot__in { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .rail, .sheet, .scrim, .foot, .next { display: none; }
  .page { margin: 0; }
}

.nf { max-width: 18ch; font-size: var(--text-2xl); line-height: 1.1; margin: var(--space-xl) 0 var(--space-md); }
