/* ============================================
   Custody.WTF - Editorial Design System
   ============================================ */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
}

/* --- Accessibility: focus + skip link --- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.btn:focus-visible,
.year-nav__btn:focus-visible,
.nav-toggle:focus-visible {
  outline-offset: 3px;
}

.nav-links a:focus-visible,
.toc__list a:focus-visible {
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
  color: var(--paper);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Design Tokens --- */
:root {
  /* Palette */
  --ink: #1a1714;
  --ink-soft: #3a3530;
  --ink-muted: #6b6258;
  --paper: #faf7f2;
  --paper-warm: #f3ede2;
  --rule: #d8d0c2;
  --rule-soft: #ece5d6;
  --accent: #7a1f1a;
  --accent-soft: #b8413a;
  --highlight: #f7e9c9;
  --success: #2f5d3a;

  /* Type */
  --serif: "Source Serif Pro", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Scale */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.1875rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.75rem;
  --fs-3xl: 3.75rem;
  --fs-4xl: 5rem;

  /* Layout */
  --container: 1240px;
  --reading: 680px;
  --reading-wide: 760px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base --- */
body {
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--highlight);
  color: var(--ink);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, var(--fs-3xl)); }
h2 { font-size: clamp(1.625rem, 3.2vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

p { margin-bottom: 1.1em; }

a:hover {
  color: var(--accent);
}

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: inline-block;
  margin-bottom: 1.25rem;
}

.dropcap::first-letter {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  margin: 0.08em 0.08em 0 -0.04em;
  color: var(--accent);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.reading {
  max-width: var(--reading);
  margin-left: auto;
  margin-right: auto;
}

.reading-wide {
  max-width: var(--reading-wide);
  margin-left: auto;
  margin-right: auto;
}

/* --- Top Nav --- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.brand__mark {
  color: var(--accent);
}

.brand__dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.15rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 4px;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

/* --- Hero --- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 5rem);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-warm) 0%, var(--paper) 100%);
}

.hero__dateline {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero__dateline::before,
.hero__dateline::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 80px;
}

.hero__title {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: -0.025em;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero__deck {
  font-family: var(--serif);
  font-size: clamp(1.125rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
  font-style: italic;
}

.hero__meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  max-width: 600px;
  margin: 0 auto;
}

.hero__meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.hero__meta-item strong {
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 700;
  font-family: var(--serif);
}

/* --- Section Layout --- */
section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head h2 {
  margin-bottom: 0.75rem;
}

.section-head p {
  font-style: italic;
  color: var(--ink-muted);
  max-width: 560px;
  margin: 0 auto;
}

.section--inverse {
  background: var(--ink);
  color: var(--paper);
}

.section--inverse h1,
.section--inverse h2,
.section--inverse h3 {
  color: var(--paper);
}

.section--warm {
  background: var(--paper-warm);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* --- Article Layout (sticky TOC) --- */
.article {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.toc__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.toc__list {
  list-style: none;
}

.toc__list li {
  margin-bottom: 0.6rem;
}

.toc__list a {
  text-decoration: none;
  color: var(--ink-muted);
  display: block;
  padding-left: 0.75rem;
  border-left: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
  line-height: 1.4;
}

.toc__list a:hover {
  color: var(--ink);
}

.toc__list a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.article__body {
  max-width: var(--reading);
}

.article__body h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  scroll-margin-top: 100px;
}

.article__body h2:first-child {
  margin-top: 0;
}

.article__body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
}

.article__body p {
  font-size: var(--fs-md);
  line-height: 1.75;
}

.article__body ul,
.article__body ol {
  margin: 0 0 1.2em 1.25rem;
  font-size: var(--fs-md);
  line-height: 1.7;
}

.article__body li {
  margin-bottom: 0.45rem;
}

/* --- Pull Quote --- */
.pullquote {
  margin: 2.5rem 0;
  padding: 1.5rem 0 1.5rem 1.75rem;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  line-height: 1.4;
  color: var(--ink);
}

.pullquote__attr {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.pullquote--dialogue p {
  margin: 0 0 0.85rem 0;
}

.pullquote--dialogue p:last-of-type {
  margin-bottom: 0;
}

.pullquote__speaker {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 700;
  font-size: 0.7em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 0.5rem;
  vertical-align: 0.1em;
}

/* --- Verbatim recording treatment (high-emphasis pullquote) --- */
.pullquote--verbatim {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--accent);
  border-radius: 4px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  margin: 3.5rem 0;
  font-size: clamp(1.4rem, 2.6vw, 1.7rem);
  line-height: 1.45;
  box-shadow: 0 6px 22px rgba(26, 23, 20, 0.08);
}

.pullquote--verbatim::before {
  content: "From the audio recording";
  display: block;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.pullquote--verbatim p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.5rem 0;
  line-height: 1.45;
}

.pullquote--verbatim p:last-of-type {
  margin-bottom: 0;
}

.pullquote--verbatim .pullquote__speaker {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 700;
  font-size: 0.6em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem 0;
  vertical-align: baseline;
}

.pullquote--verbatim .pullquote__attr {
  display: block;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-style: normal;
}

/* --- Callout --- */
.callout {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  border-radius: 2px;
}

.callout__label {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

.callout p:last-child { margin-bottom: 0; }

/* --- Numbers Strip --- */
.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
}

.numbers__cell {
  padding: 1.75rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.numbers__cell:last-child { border-right: none; }

.numbers__value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
}

.numbers__label {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.3;
}

/* --- Cards --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.75rem;
  border-radius: 4px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--ink-muted);
  transform: translateY(-2px);
}

.card__tag {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.card__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card__meta {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 1rem;
}

.card a {
  text-decoration: none;
  color: inherit;
}

/* --- Timeline --- */
.year-nav {
  position: sticky;
  top: 64px;
  z-index: 20;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: 0.875rem 0;
}

.year-nav__inner {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.year-nav__btn {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.625rem 1.125rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.18s var(--ease);
  flex-shrink: 0;
}

.year-nav__btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.year-nav__btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.timeline {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 132px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}

.tl-year {
  position: relative;
  padding-left: 180px;
  margin-bottom: 3.5rem;
  scroll-margin-top: 130px;
}

.tl-year__mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 110px;
  text-align: right;
}

.tl-year__number {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.tl-year__dot {
  position: absolute;
  left: 126px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--accent);
  z-index: 2;
}

.tl-event {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s var(--ease);
}

.tl-event:hover {
  border-color: var(--ink-muted);
}

.tl-event__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "tag tag"
    "title toggle";
  column-gap: 1rem;
  row-gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
}

.tl-event__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--ink);
  grid-area: title;
}

.tl-event__tag {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  grid-area: tag;
  justify-self: start;
  max-width: 100%;
}

.tag--allegation { background: #f5e0de; color: var(--accent); }
.tag--legal     { background: #e6e3dc; color: var(--ink-soft); }
.tag--court     { background: #ddd5c2; color: var(--ink); }
.tag--cleared   { background: #d8e6dc; color: var(--success); }
.tag--abuse     { background: #f3d3cf; color: var(--accent); }
.tag--milestone { background: var(--ink); color: var(--paper); }

.tl-event__toggle {
  font-family: var(--sans);
  font-size: 1.25rem;
  color: var(--ink-muted);
  transition: transform 0.2s var(--ease);
  line-height: 1;
  padding: 0.1rem 0.25rem;
  grid-area: toggle;
  justify-self: end;
}

.tl-event[open] .tl-event__toggle {
  transform: rotate(45deg);
}

.tl-event__body {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink-soft);
}

.tl-event__body p { margin-bottom: 0.85em; }
.tl-event__body p:last-child { margin-bottom: 0; }

.tl-event__body ul {
  margin: 0.5rem 0 0.85rem 1.25rem;
}

.tl-event__body li {
  margin-bottom: 0.35rem;
}

/* --- Evidence Cards --- */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.ev-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.ev-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}

.ev-card__icon {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}

.ev-card__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.ev-card__count {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  display: block;
}

.ev-card__desc {
  font-size: var(--fs-base);
  color: var(--ink-soft);
  line-height: 1.55;
}

.ev-card__list {
  list-style: none;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: var(--fs-sm);
}

.ev-card__list li {
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.ev-card__list li::before {
  content: "›";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Footer --- */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(250, 247, 242, 0.15);
  margin-bottom: 1.5rem;
}

.footer__brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--paper);
  margin-bottom: 0.75rem;
}

.footer__tag {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: rgba(250, 247, 242, 0.82);
  max-width: 460px;
  line-height: 1.55;
}

.footer__nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.footer__nav a {
  text-decoration: none;
  color: rgba(250, 247, 242, 0.9);
  transition: color 0.18s var(--ease);
}

.footer__nav a:hover {
  color: var(--paper);
}

.footer__legal {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: rgba(250, 247, 242, 0.72);
  line-height: 1.6;
}

/* --- CTA --- */
.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2.5rem;
}

.btn {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.875rem 1.5rem;
  border-radius: 3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.18s var(--ease);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn--secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn__arrow {
  transition: transform 0.18s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .article {
    grid-template-columns: 1fr;
  }

  .toc {
    position: relative;
    top: 0;
    max-height: none;
    padding: 1rem 1.25rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper-warm);
    margin-bottom: 2rem;
  }

  .toc__list a {
    padding: 0.5rem 0.75rem;
    min-height: 32px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 72px; }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    transform: translateY(-110%);
    transition: transform 0.25s var(--ease);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  }

  .nav-links.is-open {
    transform: translateY(0);
  }

  .nav-links li {
    border-bottom: 1px solid var(--rule-soft);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    padding: 0.85rem var(--gutter);
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .timeline::before { left: 18px; }

  .tl-year {
    padding-left: 0;
    padding-top: 3rem;
  }

  .tl-year__mark {
    position: relative;
    top: 0;
    left: 0;
    width: auto;
    text-align: left;
    padding-left: 48px;
    margin-bottom: 1rem;
  }

  .tl-year__dot {
    left: 12px;
    top: 18px;
  }

  .numbers__cell {
    border-right: none;
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }
}

/* --- Narrow phones (iPhone SE class, 320 to 480) --- */
@media (max-width: 480px) {
  :root {
    --gutter: 1rem;
  }

  .hero {
    padding: 2.25rem 0 2rem;
  }

  .hero__dateline {
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.6875rem;
  }

  .hero__dateline::before,
  .hero__dateline::after {
    max-width: 30px;
  }

  .hero__title {
    font-size: clamp(1.875rem, 9vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .hero__deck {
    font-size: 1.0625rem;
    margin-bottom: 1.75rem;
  }

  .hero__meta {
    gap: 0.75rem 1.25rem;
    padding-top: 1.25rem;
  }

  .hero__meta-item strong {
    font-size: 1.125rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1.75rem;
  }

  .btn {
    justify-content: center;
    padding: 0.875rem 1rem;
    width: 100%;
  }

  .article__body p,
  .article__body ul,
  .article__body ol {
    font-size: 1.0625rem;
    line-height: 1.7;
  }

  .article__body h2 {
    margin-top: 2.25rem;
    font-size: 1.5rem;
  }

  .article__body h3 {
    font-size: 1.25rem;
  }

  .dropcap::first-letter {
    font-size: 3.5em;
    margin: 0.08em 0.08em 0 0;
  }

  .pullquote {
    margin: 1.75rem 0;
    padding: 1rem 0 1rem 1.125rem;
    font-size: 1.1875rem;
    line-height: 1.45;
  }

  .pullquote__attr {
    font-size: 0.75rem;
    margin-top: 0.75rem;
  }

  .callout {
    padding: 1.125rem 1.25rem;
    margin: 1.5rem 0;
  }

  .numbers {
    grid-template-columns: 1fr 1fr;
  }

  .numbers__cell {
    padding: 1.25rem 0.875rem;
  }

  .numbers__cell:nth-child(odd) {
    border-right: 1px solid var(--rule);
  }

  .numbers__cell:nth-child(even) {
    border-right: none;
  }

  .numbers__value {
    font-size: 1.875rem;
  }

  .numbers__label {
    font-size: 0.8125rem;
  }

  .section-head {
    margin-bottom: 1.75rem;
  }

  .evidence-grid,
  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ev-card,
  .card {
    padding: 1.25rem;
  }

  .ev-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .ev-card__title,
  .card__title {
    font-size: 1.125rem;
  }

  .year-nav {
    position: static;
    padding: 1rem 0 0.75rem;
    background: var(--paper);
  }

  .year-nav__inner {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 0.5rem;
    padding-bottom: 0;
    justify-content: flex-start;
  }

  .year-nav__btn {
    padding: 0.5rem 0.875rem;
    min-height: 40px;
    font-size: 0.8125rem;
    flex: 0 1 auto;
  }

  .tl-year {
    margin-bottom: 2.5rem;
  }

  .tl-year__number {
    font-size: 2rem;
  }

  .tl-event {
    padding: 1rem 1.125rem;
  }

  .tl-event__title {
    font-size: 1rem;
    line-height: 1.4;
  }

  .tl-event__tag {
    font-size: 0.625rem;
    padding: 0.2rem 0.5rem;
  }

  .tl-event__body {
    font-size: 0.9375rem;
  }

  .topnav__inner {
    height: 56px;
  }

  .nav-links {
    top: 56px;
  }

  .footer {
    padding: 2.5rem 0 1.5rem;
    margin-top: 2.5rem;
  }

  .footer__inner {
    padding-bottom: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
