/* ==========================================================================
   CollegeAthleteInsider.com — styles.css
   Identity: "collegiate quad meets data journalism"
   Varsity tradition (pennants, letterman patches, engraved-program type,
   diploma paper) sharpened with clean modern data graphics.
   Single stylesheet. All tokens are CSS variables. Dark via [data-theme="dark"].
   ========================================================================== */

/* ---------- 1. Design tokens ---------------------------------------------- */
:root {
  /* Palette — light ("diploma paper") */
  --bg:          #f6f1e4;   /* ivory diploma paper            */
  --bg-2:        #efe8d6;   /* recessed panels                */
  --surface:     #fbf8f0;   /* cards / raised paper           */
  --ink:         #14213d;   /* varsity navy — primary text    */
  --ink-2:       #2a3556;   /* secondary navy                 */
  --muted:       #4a567a;   /* muted captions / meta          */
  --accent:      #b0892f;   /* old-gold — decorative          */
  --accent-ink:  #87670f;   /* gold, text-safe (AA on ivory)  */
  --accent-2:    #9b3a2c;   /* brick — secondary heritage     */
  --rule:        #d8ceb6;   /* hairline rule                  */
  --rule-strong: #c3b692;
  --shadow:      0 1px 0 rgba(20,33,61,.04), 0 14px 30px -22px rgba(20,33,61,.45);
  --paper-tint:  rgba(20,33,61,.025);

  /* Category pennant tints (badge bg / ink) */
  --cat-stat:     #2f5d50;  /* explainers — slate green      */
  --cat-fb:       #7a2e26;  /* football — brick              */
  --cat-bb:       #b0892f;  /* basketball — gold             */
  --cat-nil:      #2a3556;  /* business — navy               */
  --cat-tut:      #3c4a8a;  /* tutorials — ink blue          */
  --cat-hist:     #6a4a2a;  /* history — sepia               */

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Source Serif 4", Georgia, serif;
  --font-mono:    "IBM Plex Mono", "Courier New", monospace;
  --measure:      42rem;            /* ~720px article column   */

  /* Spacing / shape */
  --gap:    1.5rem;
  --radius: 3px;            /* engraved program = nearly square */
  --pagepad: clamp(1.1rem, 4vw, 2.5rem);
  --maxw: 75rem;

  --tnum: "tnum" 1, "lnum" 1; /* tabular, lining numerals */
  color-scheme: light;
}

[data-theme="dark"] {
  /* Palette — dark ("trophy case at night") */
  --bg:          #0e1726;
  --bg-2:        #0b1320;
  --surface:     #15233b;
  --ink:         #ece3cf;   /* warm ivory text                */
  --ink-2:       #cdbf9f;
  --muted:       #9fb0cf;
  --accent:      #d4af59;   /* brighter gold (glows)          */
  --accent-ink:  #e3c879;   /* gold, text-safe on dark        */
  --accent-2:    #d2705f;   /* warmed brick                   */
  --rule:        #2a3a55;
  --rule-strong: #3a4d6e;
  --shadow:      0 1px 0 rgba(0,0,0,.3), 0 18px 40px -24px rgba(0,0,0,.8);
  --paper-tint:  rgba(255,255,255,.02);

  --cat-stat: #4f9c86; --cat-fb: #d2705f; --cat-bb: #d4af59;
  --cat-nil: #8fa6cf;  --cat-tut: #93a3e0; --cat-hist: #c69b6a;
  color-scheme: dark;
}

/* ---------- 2. Reset & base ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  /* subtle diploma-paper grain */
  background-image:
    radial-gradient(var(--paper-tint) 1px, transparent 1px),
    radial-gradient(var(--paper-tint) 1px, transparent 1px);
  background-position: 0 0, 11px 11px;
  background-size: 22px 22px;
  font-feature-settings: var(--tnum);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg, figure { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; color: var(--ink); }
[data-theme="dark"] a:hover { color: var(--accent); }

/* ---------- 3. Typography ------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--ink);
  font-variation-settings: "opsz" 40, "SOFT" 0, "WONK" 0;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.4rem); font-weight: 640; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); margin-top: 2.4em; }
h3 { font-size: 1.3rem; margin-top: 1.8em; }
p, ul, ol, blockquote, figure, table, pre { margin-bottom: 1.15rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.3rem; }
strong { font-weight: 640; }

/* engraved small-caps "kicker" / eyebrow */
.kicker {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: var(--accent-ink);
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.1rem;
  font-style: italic;
  color: var(--ink-2);
}

/* ---------- 4. Accessibility helpers ------------------------------------- */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem;
  background: var(--ink); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: var(--radius);
  z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 0.5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 5. Layout primitives ----------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pagepad); }
.measure { max-width: var(--measure); }
main { display: block; }
section { margin-block: clamp(2.5rem, 6vw, 4.5rem); }

/* hairline double-rule divider */
.rule-double { border: 0; height: 4px; background: var(--bg); position: relative; margin: 2.5rem 0; }
.rule-double::before, .rule-double::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--rule-strong);
}
.rule-double::before { top: 0; } .rule-double::after { bottom: 0; }

/* ---------- 6. Header & navigation --------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  display: flex; align-items: center; gap: 1rem;
  padding-block: 0.7rem; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pagepad);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand .mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  /* letterman patch: chamfered shield */
  clip-path: polygon(12% 0, 88% 0, 100% 22%, 100% 78%, 50% 100%, 0 78%, 0 22%);
}
.brand .wordmark { font-family: var(--font-display); font-weight: 640; font-size: 1.18rem; letter-spacing: -0.01em; }
.brand .wordmark b { color: var(--accent-ink); font-weight: 640; }

.nav-links { display: flex; align-items: center; gap: 0.3rem; list-style: none; padding: 0; margin: 0; }
.nav-links a {
  display: inline-block; padding: 0.4rem 0.7rem; text-decoration: none; color: var(--ink-2);
  font-family: var(--font-display); font-size: 0.97rem; font-weight: 560; border-radius: var(--radius);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }
.nav-tools { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink); cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { border-color: var(--accent); background: var(--bg-2); }
.theme-toggle .moon { display: none; } .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: block; } [data-theme="dark"] .theme-toggle .sun { display: none; }

.nav-toggle { display: none; }

/* search popover */
.search-shell { position: relative; }
.search-panel {
  position: absolute; right: 0; top: calc(100% + 0.6rem); width: min(92vw, 30rem);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 0.9rem; display: none;
}
.search-panel[data-open="true"] { display: block; }
.search-panel input[type="search"] {
  width: 100%; padding: 0.65rem 0.8rem; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.search-results { list-style: none; padding: 0; margin: 0.6rem 0 0; max-height: 50vh; overflow: auto; }
.search-results li { margin: 0; }
.search-results a { display: block; padding: 0.5rem 0.55rem; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--bg-2); }
.search-results .sr-cat { font-size: 0.72rem; color: var(--muted); display: block; }
.search-empty { color: var(--muted); padding: 0.5rem; font-size: 0.92rem; }

/* ---------- 7. Buttons & pennant badges ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  padding: 0.6rem 1.1rem; border-radius: var(--radius); text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
}
.btn:hover { background: var(--ink-2); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); border-color: var(--accent); }

/* pennant-shaped category badge (swallowtail ribbon) */
.pennant {
  display: inline-block; padding: 0.22rem 0.95rem 0.22rem 0.7rem;
  font-family: var(--font-display); font-weight: 600; font-size: 0.74rem;
  font-variant-caps: all-small-caps; letter-spacing: 0.1em; line-height: 1.4;
  color: #fff; background: var(--accent-2); text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 90% 50%, 100% 100%, 0 100%);
}
.pennant:hover { color: #fff; filter: brightness(1.08); }
.pennant[data-cat="stat-explainers"]    { background: var(--cat-stat); }
.pennant[data-cat="college-football"]   { background: var(--cat-fb); }
.pennant[data-cat="college-basketball"] { background: var(--cat-bb); color: #1c1606; }
.pennant[data-cat="nil-and-the-business"]{ background: var(--cat-nil); }
.pennant[data-cat="tutorials"]          { background: var(--cat-tut); }
.pennant[data-cat="history"]            { background: var(--cat-hist); }

/* ---------- 8. Cards & grids --------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem;
  box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.18rem; line-height: 1.18; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card h3 a:hover { color: var(--accent-ink); }
.card .desc { color: var(--ink-2); font-size: 0.98rem; }
.card .meta { margin-top: auto; color: var(--muted); font-size: 0.82rem; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.card .meta time { font-variant-numeric: tabular-nums; }

/* category nav card (homepage) */
.cat-card {
  display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.cat-card:hover { transform: translateY(-3px); color: var(--ink); }
.cat-card[data-cat="stat-explainers"]     { border-left-color: var(--cat-stat); }
.cat-card[data-cat="college-football"]    { border-left-color: var(--cat-fb); }
.cat-card[data-cat="college-basketball"]  { border-left-color: var(--cat-bb); }
.cat-card[data-cat="nil-and-the-business"]{ border-left-color: var(--cat-nil); }
.cat-card[data-cat="tutorials"]           { border-left-color: var(--cat-tut); }
.cat-card[data-cat="history"]             { border-left-color: var(--cat-hist); }
.cat-card .cat-name { font-family: var(--font-display); font-weight: 640; font-size: 1.25rem; }
.cat-card .cat-count { color: var(--muted); font-size: 0.82rem; font-variant-caps: all-small-caps; letter-spacing: 0.08em; }

/* ---------- 9. Hero ------------------------------------------------------ */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 3rem); }
.hero .kicker { display: block; margin-bottom: 0.8rem; }
.hero h1 { max-width: 18ch; }
.hero p.lede { max-width: 52ch; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); color: var(--ink-2); margin-top: 1rem; }
.hero .cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* featured article — grid-breaking moment */
.featured {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1rem, 4vw, 2.5rem);
  align-items: center; background: var(--surface); border: 1px solid var(--rule);
  border-top: 4px solid var(--accent); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}
.featured .fig { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.5rem; }
.featured h2 { margin-top: 0.3rem; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); }
.featured h2 a { text-decoration: none; color: var(--ink); }
.featured h2 a:hover { color: var(--accent-ink); }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; text-decoration: none; }

/* ---------- 10. Stat plaque (record-board callout) ----------------------- */
.plaque {
  background: var(--ink); color: var(--bg); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; display: inline-grid; gap: 0.2rem; min-width: 9rem;
  border: 1px solid var(--ink); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
.plaque .num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.plaque .lbl { font-variant-caps: all-small-caps; letter-spacing: 0.1em; font-size: 0.82rem; color: var(--bg); opacity: 0.92; }
.plaque-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.6rem 0; }

/* oversized pull stat (grid-breaking) */
.pullstat {
  margin: 2rem 0; padding: 1.4rem 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 1rem + 2vw, 2.1rem);
  line-height: 1.25; color: var(--ink);
}
.pullstat b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* ---------- 11. Article page --------------------------------------------- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); padding-block: 1rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.breadcrumb a { text-decoration: none; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; color: var(--rule-strong); }

.article-head { max-width: var(--measure); }
.article-head h1 { margin-top: 0.4rem; }
.byline { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.byline .by-name { color: var(--ink-2); font-weight: 600; }
.byline time, .byline .readtime { font-variant-numeric: tabular-nums; }
.asof { display: inline-block; font-size: 0.78rem; font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--accent-ink); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0.1rem 0.6rem; }

.article-layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
@media (max-width: 1024px) { .article-layout { grid-template-columns: 1fr; } }

.toc { position: sticky; top: 5rem; font-size: 0.9rem; border-left: 1px solid var(--rule); padding-left: 1rem; }
.toc .kicker { display: block; margin-bottom: 0.6rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover, .toc a[aria-current="true"] { color: var(--accent-ink); }
@media (max-width: 1024px) {
  .toc { position: static; border-left: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1rem 0; }
  .toc ol { grid-template-columns: 1fr 1fr; }
}

.article-body { max-width: var(--measure); font-size: 1.08rem; }
.article-body h2 { scroll-margin-top: 5rem; }
.article-body h2::before { content: ""; display: block; width: 2.5rem; height: 2px; background: var(--accent); margin-bottom: 0.7rem; }
.article-body figure { margin: 1.8rem 0; }
.article-body figure.fullbleed { margin-inline: calc(-1 * var(--pagepad)); }
@media (min-width: 1025px) { .article-body figure.fullbleed { margin-inline: -3rem; } }
.article-body figure img, .article-body figure svg {
  width: 100%; background: #fbf8f0; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.6rem;
}
figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; padding-left: 0.2rem; border-left: 2px solid var(--accent); padding-left: 0.6rem; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; font-variant-numeric: tabular-nums; background: var(--surface); }
caption { caption-side: bottom; text-align: left; font-size: 0.8rem; color: var(--muted); padding: 0.6rem 0.8rem; }
th, td { padding: 0.55rem 0.8rem; text-align: left; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--ink); border-bottom: 2px solid var(--rule-strong); background: var(--bg-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* code / tutorials */
pre, code, kbd { font-family: var(--font-mono); font-size: 0.88em; }
:not(pre) > code { background: var(--bg-2); padding: 0.1rem 0.35rem; border-radius: 3px; border: 1px solid var(--rule); }
pre {
  background: #11192a; color: #e7ecf6; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.55; margin: 1.4rem 0;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }
.codecaption { display: block; font-size: 0.78rem; color: var(--muted); margin: -0.9rem 0 1.4rem; font-variant-caps: all-small-caps; letter-spacing: 0.06em; }

/* author-todo marker (visible only as faint note; real content replaces it) */
.todo-note { border: 1px dashed var(--accent-2); background: color-mix(in srgb, var(--accent-2) 8%, transparent); color: var(--ink-2); padding: 0.8rem 1rem; border-radius: var(--radius); font-size: 0.9rem; margin: 1.4rem 0; }
.todo-note code { font-size: 0.85em; }

/* ad slots — empty but structurally ready */
.ad-slot { margin: 2rem 0; min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); font-size: 0.75rem; font-variant-caps: all-small-caps; letter-spacing: 0.1em; background: var(--bg-2); }

/* author bio */
.author-box { display: flex; gap: 1rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.2rem; margin: 2.2rem 0; }
.author-box .avatar { width: 64px; height: 64px; flex: none; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: var(--accent-ink); font-size: 1.4rem; }
.author-box h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.author-box p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }

/* sources block */
.sources { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 2rem 0; }
.sources h2 { margin-top: 0; font-size: 1.15rem; }
.sources ul { margin-bottom: 0; }

/* related + prev/next */
.related h2 { font-size: 1.3rem; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 2rem 0; }
.prevnext a { text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.9rem 1.1rem; background: var(--surface); display: block; }
.prevnext a:hover { border-color: var(--accent); }
.prevnext .dir { font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--muted); font-size: 0.78rem; }
.prevnext .nx { text-align: right; }
@media (max-width: 560px) { .prevnext { grid-template-columns: 1fr; } }

/* ---------- 12. Static page (about/legal) -------------------------------- */
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.5rem; }
.page-head { padding-block: clamp(1.5rem, 4vw, 3rem) 0; }
.page-head .kicker { display: block; margin-bottom: 0.6rem; }

/* contact + form-ish list */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- 13. Footer --------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--bg-2); margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-block: 2.5rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--font-display); font-size: 0.82rem; font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.site-footer a { text-decoration: none; color: var(--ink-2); font-size: 0.92rem; }
.site-footer a:hover { color: var(--accent-ink); }
.footer-brand .wordmark { font-family: var(--font-display); font-weight: 640; font-size: 1.1rem; }
.footer-brand p { font-size: 0.88rem; color: var(--muted); margin-top: 0.5rem; max-width: 34ch; }
.footer-legal { border-top: 1px solid var(--rule); padding-block: 1.2rem; font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- 14. Motion (CSS-only staggered fade-up) ---------------------- */
.fade-up { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.fade-up.in { opacity: 1; transform: none; }
.no-js .fade-up { opacity: 1; transform: none; } /* graceful if JS disabled */
.stagger > * { transition-delay: calc(var(--i, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---------- 15. Responsive nav (hamburger) ------------------------------- */
@media (max-width: 800px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: fixed; inset: 0 0 auto auto; top: 0; right: 0; height: 100dvh; width: min(80vw, 18rem);
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    background: var(--surface); border-left: 1px solid var(--rule); box-shadow: var(--shadow);
    padding: 4.5rem 1rem 1rem; transform: translateX(100%); transition: transform .25s ease; z-index: 90;
  }
  .nav-links[data-open="true"] { transform: none; }
  .nav-links a { padding: 0.8rem 0.9rem; font-size: 1.05rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(8,12,22,.4); z-index: 80; display: none; }
  .nav-backdrop[data-open="true"] { display: block; }
}
@media (prefers-reduced-motion: reduce) { .nav-links { transition: none; } }

/* print: lighten ink, drop chrome */
@media print {
  .site-header, .site-footer, .toc, .ad-slot, .prevnext, .nav-tools { display: none; }
  body { background: #fff; color: #000; }
}
