/* =========================================================
   Family Archive — shared stylesheet
   Used by: index.html, ramon.html, maximo.html
   ========================================================= */

:root {
  --bg-dark: #0d1018;
  --bg-dark-2: #131722;
  --bg-cream: #f4eee2;
  --bg-cream-warm: #ede6d6;
  --ink: #1b2030;
  --ink-soft: #4a4f5e;
  --cream-ink: #e6dccb;
  --cream-ink-soft: #a89e8b;
  --gold: #b08a48;
  --gold-deep: #8e6d33;
  --gold-soft: #d4b478;
  --rule-dark: rgba(230, 220, 203, 0.14);
  --rule-light: rgba(28, 34, 48, 0.14);
  --serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Lato', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ---------- Reading progress bar (per-page) ---------- */
.progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: var(--gold);
  z-index: 100;
  transition: width 0.08s linear;
}

/* ---------- Top nav ---------- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 90;
  padding: 18px 48px;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(8px);
  background: rgba(13, 16, 24, 0);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.topnav.is-light {
  background: rgba(244, 238, 226, 0.86);
  border-bottom-color: var(--rule-light);
}
.topnav-brand {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0;
  color: var(--cream-ink);
  text-decoration: none;
  font-style: normal;
  transition: color 0.4s ease;
}
.topnav.is-light .topnav-brand { color: var(--ink); }
.topnav-back {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-ink-soft);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.topnav.is-light .topnav-back { color: var(--ink-soft); }
.topnav-back:hover { color: var(--gold); }
.topnav.is-light .topnav-back:hover { color: var(--gold-deep); }
.topnav-back::before { content: "←"; font-size: 14px; }
.topnav-back-short { display: none; }
@media (max-width: 600px) {
  .topnav-back-full { display: none; }
  .topnav-back-short { display: inline; }
}

/* ---------- Hero (dark) — used variously ---------- */
.hero {
  background: var(--bg-dark);
  color: var(--cream-ink);
  padding: 140px 48px 100px;
  position: relative;
  overflow: hidden;
}
.hero.full {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(176,138,72,0.06) 0%, transparent 55%);
  pointer-events: none;
}
.hero-inner {
  max-width: 760px;
  position: relative;
  text-align: left;
  width: 100%;
}
.hero-kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 28px;
  display: flex; align-items: center; gap: 14px;
}
.hero-kicker::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--gold), transparent);
  max-width: 80px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.05;
  margin: 0 0 36px;
  color: var(--cream-ink);
  letter-spacing: -0.01em;
}
.hero h1 em { color: var(--gold-soft); font-style: italic; font-weight: 400; }
.hero-lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.55;
  color: var(--cream-ink);
  max-width: 640px;
  margin: 0 0 48px;
  font-weight: 400;
}
.hero-mission {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.6;
  color: var(--gold-soft);
  max-width: 540px;
  margin: 0;
  border-top: 1px solid var(--rule-dark);
  padding-top: 28px;
}

/* ---------- Biography page hero (dark, compact, with portrait) ---------- */
.bio-hero {
  background: var(--bg-dark);
  color: var(--cream-ink);
  padding: 140px 48px 100px;
  position: relative;
  overflow: hidden;
}
.bio-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 35% 50%, rgba(176,138,72,0.08) 0%, transparent 55%);
  pointer-events: none;
}
.bio-hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: 72px; align-items: center;
  position: relative;
}
.bio-hero-portrait {
  aspect-ratio: 4 / 5;
  background: #2a2f3a;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.45);
}
.bio-hero-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bio-hero-sign {
  display: block;
  width: min(320px, 100%);
  height: auto;
  margin: 0 0 22px;
  filter: drop-shadow(0 1px 5px rgba(0,0,0,0.45));
}
.bio-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  margin: 12px 0 24px;
  letter-spacing: -0.005em;
  color: var(--cream-ink);
}
.bio-hero-life {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--cream-ink);
  opacity: 0.78;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.bio-hero-role {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--gold);
  margin: 0 0 32px;
}
.bio-hero-epigraph {
  font-family: var(--serif);
  font-style: normal;
  font-size: 20px;
  line-height: 1.55;
  color: var(--cream-ink);
  opacity: 0.82;
  border-top: 1px solid var(--rule-dark);
  padding-top: 22px;
  margin: 0;
  max-width: 440px;
}

/* ---------- Biography body ---------- */
article.bio {
  background: var(--bg-cream);
  padding: 100px 48px 120px;
}
.bio-body {
  max-width: 660px;
  margin: 0 0 0 max(48px, calc((100vw - 1200px) / 2));
  font-family: Georgia, var(--serif);
  /* Reader-adjustable via the text-size pill (effects.js). Only the narrative
     body scales — chapter names, subheads, pull-quotes and captions are fixed
     px and stay put. Falls back to 18px with no JS / no stored choice. */
  font-size: var(--reading-size, 18px);
  line-height: 1.75;
  color: var(--ink);
}
@media (max-width: 1000px) {
  .bio-body { margin: 0 auto; }
}
/* Above 1000px the fixed contents rail (right:48px, width:220px) is shown; in
   the narrow band just above that breakpoint a full 660px body would butt right
   up against the rail (they meet at ~1024px). Cap the body width here to keep a
   48px gutter to the rail; min() restores the full 660px once the viewport is
   wide enough (>=1076px), so wide screens are unchanged. */
@media (min-width: 1001px) {
  .bio-body { max-width: min(660px, calc(100vw - 412px)); }
}
.bio-body > p { margin: 0 0 1.4em; text-wrap: pretty; }
/* Indented verbatim exchange (e.g. an interrogation transcript) — set
   apart from the surrounding narrative by a left indent + tighter rhythm */
.bio-exchange {
  margin: 2em 0;
  padding-left: 38px;
}
.bio-exchange p { margin: 0 0 0.7em; }
.bio-exchange p:last-child { margin-bottom: 0; }
@media (max-width: 880px) {
  .bio-exchange { padding-left: 22px; }
}
.bio-subhead {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 24px;
  color: var(--ink);
  margin: 2.4em 0 0.6em;
  line-height: 1.25;
}
.bio-subhead::before {
  content: "§";
  color: var(--gold);
  font-style: normal;
  margin-right: 12px;
  font-size: 0.85em;
  vertical-align: 0.05em;
}

/* Pull quote — editorial accent, breaks up the column.
   Markup: <aside class="bio-pullquote"><p class="quote">...</p><cite>...</cite></aside> */
.bio-pullquote {
  margin: 3em -60px;
  padding: 0;
  text-align: center;
  position: relative;
  border: 0;
}
.bio-pullquote::before {
  content: "\2767"; /* floral heart bullet */
  display: block;
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.4em;
  margin: 0 0 22px;
  opacity: 0.85;
}
.bio-pullquote .quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.32;
  color: var(--ink);
  margin: 0 auto;
  max-width: 580px;
  text-wrap: balance;
}
.bio-pullquote .quote em {
  color: var(--gold-deep);
  font-style: italic;
}
.bio-pullquote cite {
  display: block;
  margin-top: 20px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* =========================================================
   Figures — two modes
   1. Single image:  <figure class="bio-figure portrait|landscape|square">
   2. Dual portrait: <figure class="bio-figure duo">  (two .figure-cell children)
   Caption style: bold "ABOVE" label + soft-gray description, inline.
   All figures align to the left edge of the reading column.
   ========================================================= */
.bio-figure {
  margin: 2.6em 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.bio-figure .frame {
  background: #d6cdba;
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
}
.bio-figure .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Empty image slot awaiting a real asset: drop the file into images/ and
   swap this div for an <img>. Warm beige, never gray. */
.img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(28, 34, 48, 0.45);
}

/* Single-image orientations */
.bio-figure.landscape .frame { aspect-ratio: 3 / 2; }
.bio-figure.square    .frame { aspect-ratio: 1 / 1; }
.bio-figure.portrait  .frame { aspect-ratio: 4 / 5; max-width: 460px; }

/* Dual portrait: two cells side by side, each captioned */
.bio-figure.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.bio-figure.duo .figure-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bio-figure.duo .frame { aspect-ratio: 4 / 5; }

/* Fit-to-image frames (2026-07-04): portraits and squares fit a set height
   and let their width follow the photo; landscapes fit the column width and
   let their height follow. Carousels keep one cropped aspect per set (the
   sliding track needs a stable frame). Every figure img now carries
   intrinsic width/height, so space is reserved before decode (keeps the
   smooth-scroll citation jumps accurate). */
.bio-figure:not(.carousel) .frame { aspect-ratio: auto; }
.bio-figure:not(.carousel) .frame img {
  position: static;
  width: 100%;
  height: auto;
  object-fit: unset;
}
.bio-figure.portrait:not(.carousel) .frame,
.bio-figure.square:not(.carousel) .frame {
  max-width: none;
  width: fit-content;
}
.bio-figure.portrait:not(.carousel) .frame img,
.bio-figure.square:not(.carousel) .frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(580px, 78vh);
}
.bio-figure.duo .frame {
  aspect-ratio: auto;
  width: fit-content;
}
.bio-figure.duo .frame img {
  position: static;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(480px, 60vh);
  object-fit: unset;
}

/* Story end mark: a small gold square set into the final line. */
.end-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--gold);
  margin-left: 10px;
}

/* Caption */
.bio-figure figcaption,
.bio-figure .figure-cell figcaption {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 14px;
  text-wrap: pretty;
}
/* Provenance note for digitally restored / colorized / AI-upscaled scans */
.bio-figure figcaption .figure-note {
  display: block;
  margin-top: 5px;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.8;
}
/* Bold row labels in long group-photo "who's who" captions */
.bio-figure figcaption strong {
  font-weight: 700;
  color: var(--ink);
}
/* Optional inline lead-in (e.g. a date or "Left"/"Right") if ever needed */
.bio-figure figcaption .figlabel {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--ink);
  margin-right: 0.5em;
}

@media (max-width: 600px) {
  .bio-figure.duo { grid-template-columns: 1fr; gap: 1.8em; }
}

/* =========================================================
   Carousel figure — single-image mode that holds 1→N images.
   <figure class="bio-figure carousel landscape|portrait|square">
     <div class="carousel-viewport">
       <div class="carousel-track">
         <div class="carousel-slide">
           <div class="frame"><img src="images/…" alt="…"></div>
           <figcaption>…</figcaption>
         </div>
         … more slides …
       </div>
     </div>
     <div class="carousel-nav">…</div>   (injected by figure-carousel.js)
   </figure>
   With a single slide the nav hides and it reads as a static figure.
   ========================================================= */
.bio-figure.carousel { display: block; }
.carousel-viewport { overflow: hidden; width: 100%; }
.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
/* In carousel, the orientation cap on .portrait must not shrink slides */
.bio-figure.carousel.portrait .frame { max-width: none; }
.bio-figure.carousel.portrait .carousel-viewport { max-width: 460px; }

/* Caption sits below the viewport; it animates between slides */
.bio-figure.carousel .carousel-slide figcaption { margin-top: 14px; min-height: 1.5em; }

/* Nav row: counter · dots · arrows */
.carousel-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.bio-figure.carousel.portrait .carousel-nav { max-width: 460px; }
.carousel-count {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.carousel-count b { color: var(--gold-deep); font-weight: 700; }
.carousel-dots {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}
.carousel-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--rule-light);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.carousel-dot:hover { background: var(--gold-soft); }
.carousel-dot.is-active { background: var(--gold-deep); transform: scale(1.3); }
.carousel-arrows { display: flex; gap: 8px; }
.carousel-arrow {
  width: 38px; height: 38px;
  border: 1px solid var(--rule-light);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.carousel-arrow:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.carousel-arrow:disabled { opacity: 0.28; cursor: default; }
.carousel-arrow:disabled:hover { border-color: var(--rule-light); color: var(--ink); }

/* Single-slide carousels: hide the whole nav row */
.bio-figure.carousel[data-count="1"] .carousel-nav { display: none; }

/* Uncropped figures — show the whole image at its natural aspect, no edge
   crop. Add `uncropped` to a figure's class list for wide newspaper
   clippings, documents, and panoramas where the edges carry content. */
.bio-figure.uncropped .frame {
  aspect-ratio: auto;
  background: transparent;
}
.bio-figure.uncropped .frame img {
  position: static;
  width: 100%;
  height: auto;
  object-fit: fill;
}

/* ---------- Lightbox: shared viewer (viewer.css / album-viewer.js) ---------- */
.bio-figure img, .bio-hero-portrait img { cursor: zoom-in; }

/* ---------- Chapter nav (right-side vertical rail) ---------- */
.chapter-nav {
  position: fixed;
  right: 48px;
  top: 110px;
  z-index: 80;
  width: 220px;
  padding-left: 18px;
  border-left: 1px solid var(--rule-light);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}
.chapter-nav.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.chapter-nav-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 18px;
  display: block;
}
.chapter-nav-toggle { display: none; }
.chapter-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chapter-nav a {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.35;
  transition: color 0.2s ease;
}
.chapter-nav a:hover { color: var(--ink); }
.chapter-nav .numeral {
  font-style: italic;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.chapter-nav .name {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.35;
  color: inherit;
  text-wrap: balance;
}
.chapter-nav li.is-active a { color: var(--ink); }
.chapter-nav li.is-active .numeral { color: var(--gold-deep); }
.chapter-nav li.is-active .name {
  font-style: italic;
  color: var(--gold-deep);
}

/* Narrow viewports: the rail becomes an in-flow collapsible contents card
   between the hero and the narrative. The Show/Hide toggle (hidden on
   desktop) drives it via .is-open. */
@media (max-width: 1000px) {
  .chapter-nav {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
    border-left: 0;
    border-bottom: 1px solid var(--rule-light);
    background: var(--bg-cream-warm);
    padding: 20px 26px;
  }
  .chapter-nav-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0;
  }
  .chapter-nav-toggle {
    display: inline-block;
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold-deep);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .chapter-nav ol { display: none; margin-top: 20px; }
  .chapter-nav.is-open ol { display: flex; }
}

/* Chapter heading — used in body AND mirrored in sources */
.bio-chapter { margin: 0 0 4.5em; scroll-margin-top: 90px; }
.bio-chapter:first-child { margin-top: 0; }
.bio-chapter-head {
  margin: 0 0 2em;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule-light);
}
.bio-chapter-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 10px;
  display: block;
}
.bio-chapter-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}
.bio-chapter-name em { font-style: italic; color: var(--gold-deep); }
.bio-chapter-body > p { margin: 0 0 1.4em; text-wrap: pretty; }
/* Drop cap. `initial-letter` sizes the cap to 3 lines AND aligns its
   cap-height flush with the first text line (handles the font's ascent
   gap for us) — WebKit + Chrome/Edge 110+. */
.bio-body > p.dropcap::first-letter,
.bio-chapter-body > p:first-child.dropcap::first-letter {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--gold);
  margin-right: 12px;
  -webkit-initial-letter: 3;
  initial-letter: 3;
}
/* Firefox (no initial-letter): float fallback, top padding removed and a
   slight negative lift so the cap top sits closer to the first line. */
@supports not (initial-letter: 3) {
  @supports not (-webkit-initial-letter: 3) {
    .bio-body > p.dropcap::first-letter,
    .bio-chapter-body > p:first-child.dropcap::first-letter {
      float: left;
      font-size: 5.4em;
      line-height: 0.82;
      margin: -0.04em 12px 0 0;
    }
  }
}

/* Placeholder banner — visible only while content is in draft */
.placeholder-note {
  max-width: 660px;
  margin: 0 0 56px max(48px, calc((100vw - 1200px) / 2));
  padding: 16px 20px;
  background: rgba(176,138,72,0.08);
  border-left: 2px solid var(--gold);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gold-deep);
  letter-spacing: 0.02em;
}
@media (max-width: 1000px) {
  .placeholder-note { margin-left: auto; margin-right: auto; }
}
.placeholder-note strong {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  display: block;
  margin-bottom: 4px;
}

/* ---------- Sources ---------- */
.sources {
  background: var(--bg-cream-warm);
  padding: 120px 48px;
  scroll-margin-top: 90px; /* the contents rail links here (#sources) */
}
.sources-inner { max-width: 880px; margin: 0 auto; }
.sources-kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 18px;
  display: flex; align-items: center; gap: 14px;
}
.sources-kicker::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--gold), transparent);
  max-width: 60px;
}
.sources h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--ink);
}
.sources h2 em { font-style: italic; color: var(--gold-deep); }
.sources-intro {
  font-family: Georgia, var(--serif);
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 600px;
  line-height: 1.55;
  margin: 0 0 56px;
}
/* Sources, grouped by chapter */
.sources-chapter { margin: 0 0 56px; }
.sources-chapter:last-child { margin-bottom: 0; }
.sources-chapter-head {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule-light);
}
.sources-chapter-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
}
.sources-chapter-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}
.sources-chapter-name em { font-style: italic; color: var(--gold-deep); }
/* ---------- Inline citation superscripts (gold, unobtrusive) ---------- */
.cite {
  font-size: 0.66em;
  line-height: 0;
  vertical-align: super;
  white-space: nowrap;
}
.cite a {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gold-deep);
  text-decoration: none;
  border: 0;
  padding: 0 0.5px;
  scroll-margin-top: 90px;
  transition: color 0.2s ease;
}
.cite a:hover { color: var(--ink); }
.cite + .cite { margin-left: 1.5px; }

/* ---------- Reference list (continuous, book-style numbering) ---------- */
.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ref;
  font-family: Georgia, var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
.ref-list li {
  counter-increment: ref;
  position: relative;
  padding: 13px 0 13px 48px;
  border-top: 1px solid var(--rule-light);
  scroll-margin-top: 90px;
  transition: background-color 0.6s ease;
}
.ref-list li:last-child { border-bottom: 1px solid var(--rule-light); }
.ref-list li::before {
  content: counter(ref);
  position: absolute;
  left: 0;
  top: 14px;
  width: 34px;
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-deep);
  font-size: 14px;
}
.ref-list li:target { background-color: rgba(176, 138, 72, 0.12); }
.ref-list .source-type {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.ref-list a.ref-src {
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(142, 109, 51, 0.35);
  transition: border-color 0.2s, color 0.2s;
}
.ref-list a.ref-src:hover { color: var(--ink); border-bottom-color: var(--ink); }
/* ---------- Citation popover ----------
   The card effects.js shows when a superscript is hovered (desktop),
   tapped (touch), or focused (keyboard). Content is cloned from the
   matching .ref-list entry, so it inherits nothing from .ref-list-scoped
   rules — the entry pieces (.source-type, .ref-src) are restyled here. */
.cite-pop {
  position: absolute;
  z-index: 95;
  background: #fbf6ea;
  border: 1px solid var(--rule-light);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(28, 34, 48, 0.16);
  padding: 13px 16px 14px;
  font-family: Georgia, var(--serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  animation: citePopIn 0.18s ease;
}
@keyframes citePopIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cite-pop-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}
.cite-pop-num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-deep);
  font-size: 14px;
}
.cite-pop .source-type {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cite-pop a.ref-src {
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(142, 109, 51, 0.35);
  transition: border-color 0.2s, color 0.2s;
}
.cite-pop a.ref-src:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Typed citations: numbered entries with a hairline rule between them and a
   small-caps type label (Family record / Parish record / Correspondence /
   Oral history / Photograph) above each title, so the reader can weigh
   each claim. Entry title is a link where a URL exists, plain text
   where it doesn't.
   <li><span class="source-type">Parish record</span><a href="…">Title</a></li> */
.sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: src;
  font-family: Georgia, var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}
.sources-list li {
  counter-increment: src;
  position: relative;
  padding: 14px 0 14px 44px;
  border-top: 1px solid var(--rule-light);
}
.sources-list li:last-child {
  border-bottom: 1px solid var(--rule-light);
}
.sources-list li::before {
  content: counter(src, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 17px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 12px;
}
.sources-list .source-type {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.sources-list a {
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(142, 109, 51, 0.35);
  transition: border-color 0.2s, color 0.2s;
}
.sources-list a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

@media (max-width: 720px) {
  .sources-chapter-head { grid-template-columns: 1fr; }
}

/* ---------- Continue band (link to the OTHER person) ---------- */
.continue {
  background: var(--bg-dark);
  color: var(--cream-ink);
  padding: 100px 48px;
  text-align: center;
  position: relative;
}
.continue-inner { max-width: 680px; margin: 0 auto; position: relative; }
.continue .kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 24px;
}
.continue a.next {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15;
  color: var(--cream-ink);
  text-decoration: none;
  display: inline-block;
  position: relative;
  padding-bottom: 8px;
  transition: color 0.3s;
}
.continue a.next em { color: var(--gold-soft); font-style: italic; }
.continue a.next::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 0.45s ease;
}
.continue a.next:hover::after { transform: scaleX(1); }
.continue a.next .arrow { color: var(--gold); margin-left: 14px; font-style: normal; }
.continue .meta {
  margin-top: 18px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--cream-ink-soft);
  letter-spacing: 0.04em;
}
.continue .back {
  margin-top: 56px;
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream-ink-soft);
  text-decoration: none;
  border-top: 1px solid var(--rule-dark);
  padding-top: 28px;
}
.continue .back:hover { color: var(--gold-soft); }

/* ---------- Motion layer (wired by effects.js) ---------- */
/* Hover tilt — Apple-TV-poster feel, restrained. effects.js drives the
   custom properties (mouse pointers only). The element needs
   position: relative and overflow: hidden for the sheen to clip. */
.fx-tilt {
  transform: perspective(700px) rotateX(var(--tilt-rx, 0deg)) rotateY(var(--tilt-ry, 0deg)) scale(var(--tilt-s, 1));
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.fx-tilt.is-tilting {
  --tilt-s: 1.02;
  transition: transform 0.12s ease-out;
}
.fx-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--sheen-x, 50%) var(--sheen-y, 50%),
              rgba(244, 238, 226, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fx-tilt.is-tilting::after { opacity: 1; }

/* Scroll reveal — class is added by effects.js, so without JS (or under
   reduced motion) nothing is ever hidden */
.fx-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.fx-reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* Bio hero entrance — portrait first, then the titling cascade.
   `backwards` fill only (hidden during delay, no lingering transform
   that would fight hover transitions). */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); }
}
.bio-hero-portrait { animation: heroRise 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.10s backwards; }
.bio-hero-sign     { animation: heroRise 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.28s backwards; }
.bio-hero h1       { animation: heroRise 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.38s backwards; }
.bio-hero-life     { animation: heroRise 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.48s backwards; }
.bio-hero-epigraph { animation: heroRise 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.58s backwards; }

@media (prefers-reduced-motion: reduce) {
  .fx-tilt { transform: none; }
  .fx-tilt::after { display: none; }
  .fx-reveal { opacity: 1; transform: none; transition: none; }
  .cite-pop { animation: none; }
  .bio-hero-portrait, .bio-hero-sign, .bio-hero h1,
  .bio-hero-life, .bio-hero-epigraph { animation: none; }
}

/* ---------- Back to top (long-article pages) ---------- */
.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 85;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(230, 220, 203, 0.22);
  background: var(--bg-dark);
  color: var(--gold-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 14px 30px rgba(13, 16, 24, 0.30);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease,
              border-color 0.2s ease, color 0.2s ease;
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.to-top svg { width: 18px; height: 18px; display: block; }
@media (max-width: 880px) {
  .to-top { right: 18px; bottom: 18px; width: 44px; height: 44px; }
}

/* ---------- Reading text-size pill (story pages) ----------
   Bottom-left so it clears the right-side chapter-nav rail and the
   bottom-right "back to top" button. Scales only .bio-body (via
   --reading-size); chapter names and other headings are unaffected.
   Hidden over the hero/cover and revealed in sync with the contents rail
   (JS toggles .is-visible on the same in-body scroll condition). */
.text-size {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(244, 238, 226, 0.92);
  border: 1px solid var(--rule-light);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(28, 34, 48, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}
.text-size.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.text-size button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 999px;
  font-family: var(--serif);
  transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.text-size button:hover:not(:disabled) {
  background: var(--bg-cream-warm);
  color: var(--gold-deep);
}
.text-size button:disabled { opacity: 0.3; cursor: default; }
.text-size .ts-dec   { font-size: 12px; }
.text-size .ts-reset { font-size: 14px; letter-spacing: 0.02em; }
.text-size .ts-inc   { font-size: 18px; }
@media (max-width: 880px) {
  .text-size { left: 16px; bottom: 16px; }
}

/* ---------- Footer ---------- */
footer.archive-footer {
  background: var(--bg-dark);
  color: var(--cream-ink-soft);
  padding: 64px 48px 48px;
  text-align: center;
  border-top: 1px solid var(--rule-dark);
}
footer.archive-footer .mark {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0;
  margin-bottom: 14px;
}
footer.archive-footer .note {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--cream-ink-soft);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}
footer.archive-footer .meta {
  margin-top: 28px;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(230,220,203,0.35);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  body { font-size: 17px; }
  .topnav { padding: 14px 22px; }
  .hero { padding: 110px 26px 80px; }
  .hero.full { min-height: 88vh; }
  .bio-hero { padding: 110px 26px 80px; }
  .bio-hero-inner { grid-template-columns: 1fr; gap: 36px; }
  /* Keep the portrait from filling the first phone screen — the reader
     should see the name without scrolling */
  .bio-hero-portrait { max-width: min(300px, 64vw); }
  article.bio { padding: 64px 26px 80px; }
  .bio-figure,
  .bio-figure.landscape,
  .bio-figure.portrait,
  .bio-figure.square { margin-left: 0; margin-right: 0; }
  .bio-pullquote { margin-left: 0; margin-right: 0; }
  .sources, .continue, footer.archive-footer { padding-left: 24px; padding-right: 24px; }
  .sources { padding-top: 80px; padding-bottom: 80px; }
  .continue { padding-top: 80px; padding-bottom: 80px; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.55; }
  .progress, .topnav, .to-top, .text-size, .cite-pop { display: none !important; }
  .bio-body { font-size: 11pt !important; }
  .hero, .bio-hero, .continue, footer.archive-footer {
    background: #fff !important; color: #000 !important;
    page-break-inside: avoid;
    padding: 24px 0 !important;
    min-height: auto !important;
  }
  .hero h1, .hero-lede, .hero-mission,
  .bio-hero h1, .bio-hero-life, .bio-hero-role, .bio-hero-epigraph,
  .continue a.next, .continue a.next em, .continue .kicker, .continue .meta, .continue .back,
  footer.archive-footer .note, footer.archive-footer .mark, footer.archive-footer .meta {
    color: #000 !important;
  }
  .hero h1 em, .continue a.next em { color: #6b5119 !important; }
  .hero.full { display: block; padding-top: 0 !important; }
  .bio-hero-inner { grid-template-columns: 220px 1fr !important; gap: 24px !important; align-items: start !important; }
  article.bio { padding: 0 !important; }
  .bio-body { max-width: 100% !important; }
  .bio-figure,
  .bio-figure.landscape,
  .bio-figure.portrait,
  .bio-figure.square { margin: 1em 0 !important; }
  .bio-figure .frame { aspect-ratio: 16 / 9; }
  .sources { padding: 24px 0 !important; page-break-before: always; background: #fff !important; }
  a { color: #000 !important; text-decoration: underline; }
  .bio-portrait, .bio-figure .frame, .bio-hero-portrait { background: #f0ece2 !important; }
  .placeholder-note { display: none !important; }
  #ak-gate { display: none !important; }
}

/* =========================================================
   Password gate — frosted overlay + modal
   ========================================================= */
html.ak-locked, html.ak-locked body { overflow: hidden; }
html.ak-unlocked #ak-gate { display: none !important; }

.ak-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 18, 0.62);
  backdrop-filter: blur(20px) saturate(0.85);
  -webkit-backdrop-filter: blur(20px) saturate(0.85);
  animation: ak-fade-in 0.5s ease both;
}
.ak-gate.ak-leaving { animation: ak-fade-out 0.55s ease forwards; }

@keyframes ak-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ak-fade-out { from { opacity: 1; } to { opacity: 0; } }

.ak-gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-cream);
  border: 1px solid rgba(142, 109, 51, 0.28);
  border-radius: 14px;
  padding: 40px 34px 34px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: ak-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ak-gate.ak-shake .ak-gate-card { animation: ak-shake 0.42s ease; }

@keyframes ak-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes ak-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.ak-gate-mark {
  width: 46px; height: 46px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
}
.ak-gate-kicker {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.ak-gate-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.2;
  color: var(--ink);
}
.ak-gate-sub {
  margin: 0 0 24px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.ak-gate-form { display: flex; flex-direction: column; gap: 10px; }
.ak-gate-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 2px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.ak-gate-remember input {
  width: 15px; height: 15px;
  margin: 0;
  accent-color: var(--gold-deep);
  cursor: pointer;
}
.ak-gate-input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(28, 34, 48, 0.2);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ak-gate-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 72, 0.18);
}
.ak-gate-btn {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg-cream);
  background: var(--gold-deep);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.ak-gate-btn:hover { background: var(--gold); }
.ak-gate-btn:active { transform: translateY(1px); }
.ak-gate-error {
  margin: 14px 0 0;
  font-size: 13px;
  color: #9a3a2e;
}
.ak-gate-error[hidden] { display: none; }

@media (max-width: 480px) {
  .ak-gate-card { padding: 34px 24px 28px; }
  .ak-gate-title { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .ak-gate, .ak-gate-card, .ak-gate.ak-shake .ak-gate-card { animation: none; }
}
