/* The Long Walk to Valedictorian — Heirloom Almanac Stylesheet
   Aesthetic: warm parchment, editorial, scholarly with marginalia
   See index.html for HTML structure and assets/script.js for interactivity.
*/

/* ============================================================
   THE LONG WALK TO VALEDICTORIAN — Heirloom Almanac Stylesheet
   Aesthetic: warm parchment, editorial, scholarly with marginalia
   ============================================================ */

:root {
  /* Palette — warm parchment with deep ink, gold, brick, sage */
  --paper:       #F5EFE0;
  --paper-deep:  #EDE4D0;
  --paper-shade: #E3D6BC;
  --ink:         #1A2E40;
  --ink-soft:    #3A4D60;
  --ink-light:   #6B7785;
  --gold:        #B8893E;
  --gold-deep:   #8E6829;
  --brick:       #A24936;
  --sage:        #6F8064;
  --rule:        rgba(26, 46, 64, 0.18);
  --rule-soft:   rgba(26, 46, 64, 0.08);
  --marg:        #8E6829;

  /* Type */
  --display: "Fraunces", "Times New Roman", serif;
  --body:    "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --hand:    "Caveat", cursive;
  --mono:    "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-weight: 380;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(184, 137, 62, 0.07), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(111, 128, 100, 0.05), transparent 40%),
    var(--paper);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle paper grain via SVG noise */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4   0 0 0 0 0.3   0 0 0 0 0.15   0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* Make sure content sits above the noise */
.layer { position: relative; z-index: 2; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 460;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: var(--ink);
  font-variation-settings: "SOFT" 30, "WONK" 0;
}

h1 { font-size: clamp(2.6rem, 6.5vw, 5.2rem); font-weight: 380; font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.025em; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 420; }
h3 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); font-weight: 500; }
h4 { font-size: 1.15rem; font-weight: 600; font-family: var(--body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-deep); }

p { margin-bottom: 1.1em; max-width: 68ch; }
p.lead { font-size: 1.22rem; line-height: 1.55; color: var(--ink-soft); max-width: 60ch; }

a { color: var(--brick); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s; }
a:hover { color: var(--gold-deep); }

em { font-style: italic; font-family: var(--display); font-weight: 400; }
strong { font-weight: 620; color: var(--ink); }

sup.cite {
  font-family: var(--mono);
  font-size: 0.65em;
  font-weight: 600;
  color: var(--brick);
  vertical-align: super;
  margin-left: 1px;
  cursor: help;
}
sup.cite::before { content: "["; }
sup.cite::after  { content: "]"; }

/* ---------- Layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 3.5rem); }
.narrow { max-width: 760px; }

section { padding: clamp(4rem, 9vw, 8rem) 0; }

/* ---------- Top Bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 239, 224, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand .amp { color: var(--brick); font-variation-settings: "SOFT" 100, "WONK" 1; }
.topnav { display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); font-size: 0.88rem; }
.topnav a { color: var(--ink-soft); text-decoration: none; letter-spacing: 0.02em; }
.topnav a:hover { color: var(--brick); }
@media (max-width: 780px) { .topnav { display: none; } }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(3rem, 7vw, 6rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-block;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold);
  margin-bottom: 1.6rem;
}

.hero h1 .accent { color: var(--brick); font-variation-settings: "SOFT" 100, "WONK" 1; }
.hero h1 .small { font-size: 0.55em; font-style: normal; font-variation-settings: "SOFT" 30; font-weight: 360; display: block; margin-top: 0.4em; color: var(--ink-soft); letter-spacing: -0.015em; }

.hero-meta {
  margin-top: 2.2rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  display: flex; flex-wrap: wrap; gap: 1.4rem;
}
.hero-meta span::before { content: "·  "; color: var(--gold); }
.hero-meta span:first-child::before { content: ""; }

.hero-side {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.5rem, 3vw, 3rem);
  position: relative;
}
@media (max-width: 920px) { .hero-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 2.5rem; margin-top: 1.5rem; } }

.pull {
  font-family: var(--display);
  font-style: italic;
  font-weight: 320;
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink);
  font-variation-settings: "SOFT" 80;
}
.pull::before { content: "“"; font-size: 3rem; line-height: 0; vertical-align: -0.3em; color: var(--gold); margin-right: 0.05em; }
.pull-attr {
  margin-top: 1.2rem;
  font-family: var(--body);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-light);
}
.pull-attr::before { content: "— "; }

/* Audience pills */
.aud-row {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-top: 2.4rem;
}
.aud-pill {
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: all 0.2s;
  text-decoration: none;
}
.aud-pill:hover { border-color: var(--gold); color: var(--ink); background: rgba(184, 137, 62, 0.06); }
.aud-pill.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Decorative rule */
.deco-rule {
  display: flex; align-items: center; gap: 1rem;
  margin: 4rem 0;
}
.deco-rule::before, .deco-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}
.deco-rule .glyph {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
  font-size: 1.4rem;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

/* ---------- Manifesto / Why this exists ---------- */
.manifesto {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
}
@media (max-width: 880px) { .manifesto { grid-template-columns: 1fr; } }

.manifesto h2 .small {
  display: block; font-size: 0.4em; font-style: normal;
  font-variation-settings: "SOFT" 20; font-weight: 400;
  color: var(--ink-light); margin-top: 0.6em;
  letter-spacing: 0.05em; text-transform: uppercase;
  font-family: var(--body);
}

.dropcap::first-letter {
  font-family: var(--display);
  font-style: italic;
  font-weight: 380;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 4.6em;
  float: left;
  line-height: 0.85;
  margin: 0.08em 0.1em 0 0;
  color: var(--brick);
}

.note-card {
  position: relative;
  background: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: 1.6rem 1.8rem;
  margin-top: 1.4rem;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03), 2px 3px 0 var(--paper-shade);
}
.note-card h4 { color: var(--gold-deep); margin-bottom: 0.6rem; }
.note-card p { margin-bottom: 0.4rem; font-size: 0.97rem; }
.note-card p:last-child { margin-bottom: 0; }

/* ---------- The Seven Pillars ---------- */
.pillars-intro { text-align: left; margin-bottom: 3.5rem; max-width: 720px; }
.pillars-intro .eyebrow { display: inline-block; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2.4rem) clamp(2rem, 4vw, 4rem);
}
@media (max-width: 820px) { .pillar-grid { grid-template-columns: 1fr; } }

.pillar {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 1.5rem;
  position: relative;
}
.pillar-num {
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 0.4rem;
}
.pillar h3 { margin-bottom: 0.8rem; }
.pillar h3 .accent { font-style: italic; color: var(--brick); font-variation-settings: "SOFT" 100, "WONK" 1; }
.pillar p { font-size: 0.97rem; max-width: none; }
.pillar .evidence {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(184, 137, 62, 0.06);
  border-left: 2px solid var(--gold);
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-radius: 0 3px 3px 0;
}
.pillar .evidence strong { color: var(--gold-deep); display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.25rem; font-weight: 600; }
.pillar .tags {
  margin-top: 1.1rem;
  display: flex; flex-wrap: wrap; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-light);
}
.pillar .tags span {
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

/* ---------- Day Builder Interactive ---------- */
.day-builder {
  background: linear-gradient(180deg, var(--paper-deep), var(--paper));
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  padding: clamp(2rem, 4vw, 3.5rem);
  box-shadow: 0 1px 0 rgba(0,0,0,0.03), 0 30px 60px -40px rgba(26,46,64,0.12);
}

.db-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
@media (max-width: 880px) { .db-grid { grid-template-columns: 1fr; } }

.db-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px dotted var(--rule);
}
.db-controls label:last-child { border-bottom: none; }

.db-name {
  font-family: var(--body); font-weight: 600; font-size: 0.96rem;
  color: var(--ink);
}
.db-name small {
  display: block; font-weight: 380; color: var(--ink-light); font-size: 0.78rem;
  letter-spacing: 0.01em; margin-top: 2px;
}
.db-value {
  font-family: var(--mono); font-size: 1.05rem; font-weight: 600;
  color: var(--brick);
  min-width: 4.2rem; text-align: right;
}
.db-controls input[type="range"] {
  grid-column: 1 / -1;
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--p, 50%), var(--paper-shade) var(--p, 50%));
  border-radius: 2px;
  outline: none;
  margin-top: 0.4rem;
}
.db-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--paper);
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.db-controls input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--paper);
  cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* The dial */
.dial-wrap { position: relative; display: flex; justify-content: center; align-items: center; }
.dial-wrap svg { width: 100%; max-width: 360px; height: auto; display: block; }
.dial-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}
.dial-hrs {
  font-family: var(--display); font-style: italic;
  font-variation-settings: "SOFT" 80;
  font-size: 2.6rem; line-height: 1; color: var(--ink);
  font-weight: 400;
}
.dial-cap {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-light); margin-top: 0.4rem;
}

.dial-legend {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 1.2rem;
  margin-top: 1.4rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.dial-legend .sw {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 0.6rem; vertical-align: middle;
}

.db-verdict {
  margin-top: 1.6rem; padding: 1rem 1.2rem;
  background: var(--paper); border-left: 3px solid var(--brick);
  border-radius: 0 3px 3px 0;
  font-size: 0.93rem; color: var(--ink-soft);
  min-height: 3.2rem;
}
.db-verdict strong { color: var(--ink); }

/* ---------- Evidence Table ---------- */
.evidence-tbl {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
  table-layout: fixed;
}
.evidence-tbl col.c-intv     { width: 18%; }
.evidence-tbl col.c-outcome  { width: 14%; }
.evidence-tbl col.c-es       { width: 11%; }
.evidence-tbl col.c-base     { width: 28%; }
.evidence-tbl col.c-quality  { width: 10%; }
.evidence-tbl col.c-cite     { width: 19%; }
.evidence-tbl th, .evidence-tbl td {
  text-align: left;
  padding: 0.85rem 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.evidence-tbl th {
  font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  border-bottom: 1px solid var(--gold);
  white-space: normal;
}
.evidence-tbl tr:hover td { background: rgba(184, 137, 62, 0.04); }
.evidence-tbl td:first-child { font-weight: 600; color: var(--ink); }
.evidence-tbl .es {
  font-family: var(--mono); font-weight: 600; color: var(--brick); font-size: 0.86rem;
  word-break: break-word;
}
.evidence-tbl .es.nowrap { white-space: nowrap; }
.evidence-tbl .quality { font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }
.evidence-tbl .q-strong { color: var(--sage); }
.evidence-tbl .q-mod    { color: var(--gold-deep); }
.evidence-tbl .q-weak   { color: var(--brick); }

.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Antithesis ---------- */
.anti-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2.4rem);
  margin-top: 2.5rem;
}
@media (max-width: 880px) { .anti-grid { grid-template-columns: 1fr; } }

.anti-card {
  background: rgba(162, 73, 54, 0.05);
  border: 1px solid rgba(162, 73, 54, 0.18);
  border-radius: 4px;
  padding: 1.6rem 1.6rem 1.4rem;
}
.anti-card h4 { color: var(--brick); margin-bottom: 0.7rem; }
.anti-card p { font-size: 0.93rem; margin-bottom: 0.6rem; }
.anti-card p:last-child { margin-bottom: 0; }

/* ---------- Audience Tabs ---------- */
.aud-tabs {
  display: flex; gap: 0.4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.aud-tab {
  font-family: var(--body); font-size: 0.95rem; font-weight: 500;
  background: transparent; border: none; cursor: pointer;
  padding: 0.85rem 1.2rem;
  color: var(--ink-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}
.aud-tab:hover { color: var(--ink); }
.aud-tab.is-on { color: var(--ink); border-bottom-color: var(--brick); }

.aud-panel { display: none; }
.aud-panel.is-on { display: block; animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.aud-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
}
@media (max-width: 880px) { .aud-grid { grid-template-columns: 1fr; } }

.aud-list { list-style: none; padding: 0; }
.aud-list li {
  padding: 1rem 0 1rem 2.2rem;
  border-bottom: 1px dotted var(--rule);
  position: relative;
  font-size: 0.97rem;
}
.aud-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0.95rem;
  font-family: var(--hand); font-size: 1.4rem; color: var(--sage);
  font-weight: 600;
}
.aud-list li strong { color: var(--ink); display: block; margin-bottom: 0.2rem; }
.aud-list li:last-child { border-bottom: none; }

.handwritten {
  font-family: var(--hand); font-size: 1.6rem; line-height: 1.4;
  color: var(--marg); font-weight: 500;
  padding: 1.5rem 0;
  display: block;
}
.handwritten::before { content: "✎ "; color: var(--gold); }

/* ---------- Self-Assessment / Checklist ---------- */
.check-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 2.5rem;
  margin-top: 2rem;
}
@media (max-width: 720px) { .check-grid { grid-template-columns: 1fr; } }

.check-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px dotted var(--rule);
  cursor: pointer;
}
.check-item input { display: none; }
.check-item .box {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-soft);
  border-radius: 3px;
  margin-top: 3px;
  position: relative;
  transition: all 0.2s;
}
.check-item input:checked ~ .box {
  background: var(--ink); border-color: var(--ink);
}
.check-item input:checked ~ .box::after {
  content: "✓";
  font-family: var(--hand); font-size: 1.2rem; font-weight: 600;
  color: var(--paper);
  position: absolute; top: -7px; left: 2px;
}
.check-item .label-txt { font-size: 0.94rem; color: var(--ink-soft); transition: color 0.2s; }
.check-item input:checked ~ .label-txt { color: var(--ink-light); text-decoration: line-through; text-decoration-thickness: 1px; }

.check-progress {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-light);
  margin-top: 2rem; padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.check-progress .bar {
  flex: 1; min-width: 200px;
  height: 4px; background: var(--paper-shade); border-radius: 2px; overflow: hidden;
}
.check-progress .bar > span {
  display: block; height: 100%; background: var(--gold);
  transition: width 0.4s ease;
  width: 0%;
}

/* ---------- References ---------- */
.refs ol {
  list-style: none; padding: 0;
  counter-reset: refnum;
  font-size: 0.84rem; line-height: 1.55;
  color: var(--ink-soft);
}
.refs li {
  counter-increment: refnum;
  position: relative;
  padding: 0.7rem 0 0.7rem 3rem;
  border-bottom: 1px dotted var(--rule-soft);
}
.refs li::before {
  content: counter(refnum);
  position: absolute; left: 0; top: 0.7rem;
  font-family: var(--mono); font-weight: 600;
  font-size: 0.78rem;
  color: var(--gold-deep);
  width: 2.2rem; text-align: right;
}
.refs a { color: var(--ink-soft); text-decoration-color: var(--rule); word-break: break-word; }
.refs a:hover { color: var(--brick); text-decoration-color: var(--brick); }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--paper-deep);
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  margin-top: 4rem;
}
.footer h3 { color: var(--paper); margin-bottom: 0.6rem; font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; }
.footer p { color: rgba(245, 239, 224, 0.7); font-size: 0.92rem; max-width: 60ch; }
.footer .small {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(245, 239, 224, 0.45);
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(245, 239, 224, 0.12);
}

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1; transform: none;
}

/* ---------- Tooltips for citations ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-family: var(--body); font-weight: 400; font-size: 0.78rem;
  letter-spacing: 0; text-transform: none;
  padding: 0.5rem 0.75rem; border-radius: 3px;
  white-space: normal; width: max-content; max-width: 280px;
  z-index: 100; line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Section headings with eyebrow */
.sec-head {
  margin-bottom: 2.5rem;
}
.sec-head .eyebrow { display: inline-block; }
.sec-head h2 { margin-bottom: 0.5rem; }
.sec-head h2 .accent { font-style: italic; color: var(--brick); font-variation-settings: "SOFT" 100, "WONK" 1; }
.sec-head p { color: var(--ink-soft); max-width: 60ch; font-size: 1.05rem; }

/* Decorative numerals for big sections */
.sec-numeral {
  position: absolute;
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 300;
  font-size: clamp(8rem, 18vw, 16rem);
  color: rgba(184, 137, 62, 0.08);
  line-height: 0.8;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* Print friendly tweaks (in case) */
@media print {
  body { background: white; }
  body::before { display: none; }
  .topbar, .day-builder, .aud-tabs { display: none; }
}