:root {
    --crest-img: url("/crest.webp");
    --parchment: #f3ead6;
    --parchment-deep: #ead8b3;
    --paper-shadow: rgba(94, 70, 30, 0.12);
    --ink: #1d1810;
    --ink-soft: #3a2f1e;
    --ink-muted: #6e5f47;
    --oxblood: #6a1d1d;
    --oxblood-deep: #4a1414;
    --gold: #a47148;
    --gold-light: #c89968;
    --rule: #c9b78a;
  }

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

  html { scroll-behavior: smooth; }

  body {
    background: var(--parchment);
    background-image:
      radial-gradient(at 15% 10%, rgba(164, 113, 72, 0.07) 0%, transparent 45%),
      radial-gradient(at 85% 80%, rgba(106, 29, 29, 0.05) 0%, transparent 50%),
      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.3 0 0 0 0 0.2 0 0 0 0 0.1 0 0 0 0.06 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    color: var(--ink);
    font-family: 'Spectral', 'Iowan Old Style', Georgia, serif;
    font-size: 20px;
    line-height: 1.7;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  .container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* ========== HEADER ========== */
  header.masthead {
    text-align: center;
    padding: 64px 32px 72px;
    border-bottom: 1px solid var(--rule);
    position: relative;
  }

  .eyebrow {
    font-family: 'Cormorant SC', serif;
    font-size: 14px;
    letter-spacing: 0.42em;
    color: var(--ink-muted);
    margin-bottom: 28px;
  }

  h1.masthead-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(48px, 7vw, 84px);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 18px;
  }

  h1.masthead-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--oxblood);
  }

  .masthead-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(18px, 2.2vw, 22px);
    color: var(--ink-soft);
    max-width: 520px;
    margin: 0 auto;
  }

  .crest {
    width: 88px;
    height: 88px;
    margin: 0 auto 36px;
    display: block;
    background-image: var(--crest-img);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  /* Hero crest: only on the home masthead (not the smaller chapter mastheads) */
  header.masthead:not(.masthead-small) .crest {
    width: clamp(220px, 28vw, 320px);
    height: clamp(220px, 28vw, 320px);
    margin: 0 auto 32px;
    filter: drop-shadow(0 6px 24px rgba(94, 70, 30, 0.18));
  }

  /* ========== ARTICLE ========== */
  article {
    padding: 24px 0 80px;
  }

  article p {
    margin-bottom: 1.3em;
    text-align: left;
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  article p:first-of-type::first-letter {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 3.2em;
    line-height: 0.95;
    float: left;
    padding: 4px 10px 0 0;
    color: var(--oxblood);
  }

  article h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(28px, 3.8vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.005em;
    margin: 64px 0 8px;
    color: var(--ink);
  }

  article h2 .ornament {
    display: inline-block;
    color: var(--gold);
    font-size: 13px;
    line-height: 1;
    margin-right: 14px;
    letter-spacing: 0.36em;
    vertical-align: middle;
    padding: 4px 8px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: rgba(234, 216, 179, 0.35);
  }

  article a {
    color: var(--oxblood);
    text-decoration: underline;
    text-decoration-color: var(--gold-light);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
  }

  article a:hover {
    text-decoration-color: var(--oxblood);
  }

  article strong {
    font-weight: 600;
    color: var(--ink);
  }

  article em {
    font-style: italic;
  }

  /* Aside: coat of arms callout */
  aside.callout {
    margin: 48px 0;
    padding: 36px 40px;
    background: var(--parchment-deep);
    border-left: 3px solid var(--oxblood);
    box-shadow: 4px 4px 0 var(--paper-shadow);
    position: relative;
  }

  /* Full coat of arms figure */
  figure.arms {
    margin: 64px auto;
    max-width: 560px;
    text-align: center;
    padding: 36px 24px 28px;
  }

  figure.arms .arms-svg {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    display: block;
    margin: 0 auto;
    background-image: var(--crest-img);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  figure.arms figcaption {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 17.5px;
    color: var(--ink-muted);
    margin-top: 22px;
    line-height: 1.5;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
  }

  figure.arms figcaption .source {
    display: block;
    font-style: normal;
    font-family: 'Cormorant SC', serif;
    letter-spacing: 0.22em;
    font-size: 13px;
    color: var(--gold);
    margin-top: 10px;
  }

  aside.callout .label {
    font-family: 'Cormorant SC', serif;
    font-size: 14px;
    letter-spacing: 0.32em;
    color: var(--oxblood);
    margin-bottom: 14px;
  }

  aside.callout p {
    text-align: left;
    margin-bottom: 0.8em;
    font-size: 18.5px;
    color: var(--ink-soft);
  }

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

  /* Notable bearers list */
  .bearers {
    list-style: none;
    margin: 24px 0 32px;
    padding: 0;
    border-top: 1px solid var(--rule);
  }

  .bearers li {
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bearers li strong {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
  }

  .bearers li .dates {
    font-style: italic;
    color: var(--ink-muted);
    font-size: 17.5px;
  }

  .bearers li p {
    margin: 4px 0 0;
    font-size: 18px;
    color: var(--ink-soft);
    text-align: left;
    hyphens: none;
  }

  /* Research list */
  .research {
    list-style: none;
    padding: 0;
    margin: 16px 0 32px;
  }

  .research li {
    padding: 12px 0 12px 28px;
    position: relative;
    color: var(--ink-soft);
    border-bottom: 1px dotted var(--rule);
  }

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

  .research li::before {
    content: "❦";
    position: absolute;
    left: 0;
    top: 12px;
    color: var(--gold);
    font-size: 18px;
  }

  /* Section divider */
  .divider {
    border: none;
    height: 1px;
    background: var(--rule);
    margin: 56px auto;
    max-width: 120px;
    opacity: 0.7;
  }
  .divider::before { content: ""; }

  /* ========== FOOTER ========== */
  footer {
    border-top: 1px solid var(--rule);
    padding: 56px 32px 80px;
    text-align: center;
    background: rgba(234, 216, 179, 0.35);
  }

  footer .footer-inner {
    max-width: 560px;
    margin: 0 auto;
  }

  footer p {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 22px;
    color: var(--ink-soft);
    line-height: 1.6;
  }

  footer .domain {
    display: block;
    margin-top: 24px;
    font-family: 'Cormorant SC', serif;
    font-style: normal;
    letter-spacing: 0.3em;
    font-size: 16px;
    color: var(--oxblood);
  }

  footer .credit {
    display: block;
    margin-top: 14px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 18px;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
  }

  footer .credit a {
    color: var(--ink-soft);
    text-decoration: underline;
    text-decoration-color: var(--gold-light);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
  }

  footer .credit a:hover {
    color: var(--oxblood);
    text-decoration-color: var(--oxblood);
  }

  /* ========== RESPONSIVE ========== */
  @media (max-width: 600px) {
    body { font-size: 19px; }
    .container { padding: 0 24px; }
    header.masthead { padding: 56px 24px 56px; }
    header.masthead:not(.masthead-small) .crest { width: 220px; height: 220px; margin-bottom: 28px; }
    .crest { width: 132px; height: 132px; margin-bottom: 28px; }
    article p { text-align: left; }
    article p:first-of-type::first-letter {
      font-size: 2.8em;
      padding: 4px 8px 0 0;
    }
    aside.callout { padding: 28px 24px; }
  }

  /* Selection */
  ::selection {
    background: var(--oxblood);
    color: var(--parchment);
  }

  /* ========== SKIP LINK ========== */
  .skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--oxblood);
    color: var(--parchment);
    padding: 10px 16px;
    font-family: 'Cormorant SC', serif;
    letter-spacing: 0.2em;
    font-size: 13px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 2px;
  }
  .skip-link:focus { top: 16px; outline: 2px solid var(--gold); }

  /* ========== READING META (time + updated chip) ========== */
  .reading-meta {
    margin-top: 22px;
    font-family: 'Cormorant SC', serif;
    font-size: 13px;
    letter-spacing: 0.26em;
    color: var(--ink-muted);
    display: inline-flex;
    gap: 18px;
    align-items: center;
  }
  .reading-meta span + span::before {
    content: "·";
    margin-right: 18px;
    color: var(--gold);
  }

  /* ========== TABLE OF CONTENTS ========== */
  nav.toc {
    max-width: 760px;
    margin: 48px auto 0;
    padding: 28px 32px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    background: rgba(234, 216, 179, 0.25);
  }
  nav.toc .toc-label {
    font-family: 'Cormorant SC', serif;
    font-size: 14px;
    letter-spacing: 0.32em;
    color: var(--oxblood);
    margin-bottom: 14px;
    text-align: center;
  }
  nav.toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc;
    column-count: 2;
    column-gap: 40px;
  }
  nav.toc ol li {
    counter-increment: toc;
    padding: 5px 0;
    break-inside: avoid;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18.5px;
  }
  nav.toc ol li::before {
    content: counter(toc, upper-roman) ". ";
    color: var(--gold);
    font-family: 'Cormorant SC', serif;
    font-size: 13px;
    letter-spacing: 0.2em;
    margin-right: 6px;
  }
  nav.toc a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px dotted var(--rule);
    transition: color 0.2s, border-color 0.2s;
  }
  nav.toc a:hover { color: var(--oxblood); border-bottom-color: var(--oxblood); }

  /* ========== SECTION ANCHOR LINKS ========== */
  article h2 {
    scroll-margin-top: 24px;
    position: relative;
  }
  article h2 .anchor-link {
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Cormorant SC', serif;
    color: var(--gold);
    text-decoration: none;
    opacity: 0;
    font-size: 0.55em;
    transition: opacity 0.2s;
  }
  article h2:hover .anchor-link,
  article h2 .anchor-link:focus { opacity: 1; }

  /* ========== BACK TO TOP ========== */
  .back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--oxblood);
    color: var(--parchment);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    box-shadow: 2px 2px 0 var(--paper-shadow);
    z-index: 50;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
  }
  .back-to-top:hover { opacity: 1; transform: translateY(-2px); }
  @media (max-width: 600px) {
    .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
  }

  /* ========== GLOSSARY ========== */
  dl.glossary {
    margin: 24px 0 32px;
    padding: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 14px 24px;
    border-top: 1px solid var(--rule);
    padding-top: 22px;
  }
  dl.glossary dt {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--ink);
    font-style: italic;
  }
  dl.glossary dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.55;
  }
  @media (max-width: 600px) {
    dl.glossary { grid-template-columns: 1fr; gap: 4px 0; }
    dl.glossary dd { margin-bottom: 14px; }
  }

  /* ========== REFERENCES ========== */
  ol.references {
    list-style: decimal;
    padding-left: 22px;
    margin: 16px 0 32px;
    font-size: 17px;
    color: var(--ink-soft);
  }
  ol.references li {
    padding: 6px 0;
    line-height: 1.55;
    text-align: left;
    hyphens: none;
  }
  ol.references li::marker { color: var(--gold); }
  ol.references cite { font-style: italic; }

  /* ========== TIMELINE / MAP figures ========== */
  figure.timeline,
  figure.map {
    margin: 56px auto;
    max-width: 720px;
    text-align: center;
  }
  figure.timeline svg,
  figure.map svg {
    width: 100%;
    height: auto;
    display: block;
  }
  figure.timeline figcaption,
  figure.map figcaption {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 17px;
    color: var(--ink-muted);
    margin-top: 16px;
    line-height: 1.5;
  }

  /* ========== FOOTER EXTRAS ========== */
  footer .meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
    font-family: 'Cormorant SC', serif;
    font-size: 14px;
    letter-spacing: 0.22em;
    color: var(--ink-muted);
  }
  footer .meta-row a {
    color: var(--ink-muted);
    text-decoration: underline;
    text-decoration-color: var(--gold-light);
    text-underline-offset: 3px;
    transition: color 0.2s;
  }
  footer .meta-row a:hover { color: var(--oxblood); }

  /* ========== DARK MODE ========== */
    /* ========== DESCENDANT CHART ========== */
  figure.descent {
    margin: 48px auto;
    max-width: 560px;
    text-align: center;
  }
  figure.descent .chain {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 2px solid var(--rule);
    padding-left: 24px;
    text-align: left;
  }
  figure.descent .chain li {
    position: relative;
    padding: 11px 0 11px 4px;
  }
  figure.descent .chain li::before {
    content: "";
    position: absolute;
    left: -31px;
    top: 21px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--parchment);
    border: 2px solid var(--oxblood);
    box-shadow: 0 0 0 3px var(--parchment);
  }
  figure.descent .chain li.you::before {
    background: var(--oxblood);
  }
  figure.descent .chain li .gen {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 19px;
    line-height: 1.25;
  }
  figure.descent .chain li .gen em {
    font-style: italic;
    color: var(--oxblood);
  }
  figure.descent .chain li .gen-meta {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 16px;
    color: var(--ink-soft);
    margin-top: 1px;
  }
  figure.descent figcaption {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 15px;
    color: var(--ink-soft);
    margin-top: 18px;
    line-height: 1.5;
  }

  /* ========== FAQ ========== */
  .faq {
    margin: 8px 0 24px;
    padding: 0;
  }
  .faq details {
    border-bottom: 1px solid var(--rule);
    padding: 18px 0;
  }
  .faq details[open] { padding-bottom: 22px; }
  .faq summary {
    list-style: none;
    cursor: pointer;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 21px;
    line-height: 1.3;
    color: var(--ink);
    position: relative;
    padding-right: 30px;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 0;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1;
    transition: transform 0.2s;
  }
  .faq details[open] summary::after { content: "−"; }
  .faq summary:hover { color: var(--oxblood); }
  .faq details p {
    margin: 12px 0 0;
    font-size: 17.5px;
    line-height: 1.6;
    color: var(--ink-soft);
    text-align: left;
    hyphens: auto;
  }
  .faq details p + p { margin-top: 10px; }

  @media (prefers-color-scheme: dark) {

  :root:not(.theme-light) {
      --parchment: #1a1410;
      --parchment-deep: #241b14;
      --paper-shadow: rgba(0, 0, 0, 0.4);
      --ink: #efe4cc;
      --ink-soft: #d8c9aa;
      --ink-muted: #bfae8d;
      --oxblood: #c98080;
      --oxblood-deep: #a45a5a;
      --gold: #c89968;
      --gold-light: #d8b079;
      --rule: #4a3d28;
    }

  :root:not(.theme-light) body {
      background-image:
        radial-gradient(at 15% 10%, rgba(200, 153, 104, 0.05) 0%, transparent 45%),
        radial-gradient(at 85% 80%, rgba(201, 128, 128, 0.04) 0%, transparent 50%);
    }

  :root:not(.theme-light) footer { background: rgba(36, 27, 20, 0.5); }

  :root:not(.theme-light) nav.toc { background: rgba(36, 27, 20, 0.35); }

  :root:not(.theme-light) .crest, :root:not(.theme-light) figure.arms .arms-svg { filter: brightness(1.05) contrast(0.95); }

  :root:not(.theme-light) /* SVG overrides for dark mode */
    figure.map .m-bg { stroke: var(--rule); }

  :root:not(.theme-light) figure.map .m-grid { stroke: var(--gold); }

  :root:not(.theme-light) figure.map .m-grid-label, :root:not(.theme-light) figure.map .m-subtitle, :root:not(.theme-light) figure.map .m-region, :root:not(.theme-light) figure.map .m-stage, :root:not(.theme-light) figure.map .m-sub, :root:not(.theme-light) figure.map .m-compass-t { fill: var(--gold); }

  :root:not(.theme-light) figure.map .m-title { fill: var(--oxblood); }

  :root:not(.theme-light) figure.map .m-route, :root:not(.theme-light) figure.map .m-pin-ring { stroke: var(--oxblood); }

  :root:not(.theme-light) figure.map .m-pin, :root:not(.theme-light) figure.map .m-arrow { fill: var(--oxblood); }

  :root:not(.theme-light) figure.map .m-label, :root:not(.theme-light) figure.map .m-label-major { fill: var(--ink); }

  :root:not(.theme-light) figure.timeline .tl-axis { stroke: currentColor; }

  :root:not(.theme-light) figure.timeline .tl-dot, :root:not(.theme-light) figure.timeline .tl-event, :root:not(.theme-light) figure.timeline .tl-year { fill: currentColor; }

  :root:not(.theme-light) figure.timeline .tl-dot { fill: var(--oxblood); }

  :root:not(.theme-light) figure.timeline .tl-dot-ring { stroke: var(--oxblood); }

  :root:not(.theme-light) figure.timeline .tl-place { fill: var(--gold); }

  :root:not(.theme-light) figure.timeline .tl-event, :root:not(.theme-light) figure.timeline .tl-year { fill: var(--ink); }

  
}

  /* ========== REDUCED MOTION ========== */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* ========== PRINT ========== */
  @media print {
    body {
      background: white;
      color: black;
      font-size: 11pt;
      line-height: 1.5;
    }
    header.masthead { padding: 0 0 24pt; border-bottom: 1pt solid #999; }
    .crest { width: 64px; height: 64px; margin-bottom: 18pt; }
    h1.masthead-title { font-size: 32pt; }
    h1.masthead-title em { color: #6a1d1d; }
    .masthead-subtitle { font-size: 12pt; }
    article { padding: 24pt 0; }
    article h2 { page-break-after: avoid; font-size: 18pt; margin-top: 24pt; }
    article p { orphans: 3; widows: 3; }
    aside.callout, figure.arms, nav.toc, .reading-meta,
    .back-to-top, .skip-link, figure.timeline, figure.map { break-inside: avoid; }
    nav.toc, .back-to-top, .skip-link { display: none; }
    a { color: black; text-decoration: underline; }
    a[href^="http"]::after {
      content: " (" attr(href) ")";
      font-size: 9pt;
      color: #555;
    }
    footer { border-top: 1pt solid #999; }
  }

/* ========== MULTI-PAGE NAVIGATION ========== */
header.masthead.masthead-small {
  padding: 44px 32px 32px;
}
header.masthead.masthead-small .crest {
  width: 130px;
  height: 130px;
  margin-bottom: 22px;
  filter: drop-shadow(0 4px 18px rgba(94, 70, 30, 0.14));
}
header.masthead.masthead-small h1.masthead-title {
  font-size: clamp(34px, 5vw, 52px);
  margin-bottom: 4px;
}
header.masthead.masthead-small .masthead-subtitle {
  font-size: clamp(15px, 1.6vw, 18px);
  margin-top: 0;
}
@media (max-width: 600px) {
  header.masthead.masthead-small { padding: 36px 24px 24px; }
  header.masthead.masthead-small .crest { width: 156px; height: 156px; margin-bottom: 18px; }
}

.crest-link {
  display: block;
  text-decoration: none;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.crest-link:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 6px;
  border-radius: 50%;
}

nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 22px;
  border-bottom: 1px solid var(--rule);
  background: rgba(243, 234, 214, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  box-shadow: 0 1px 0 rgba(94, 70, 30, 0.06), 0 6px 16px -10px rgba(94, 70, 30, 0.18);
  font-family: 'Cormorant SC', serif;
  font-size: 13px;
  letter-spacing: 0.22em;
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) nav.site-nav { background: rgba(26, 20, 16, 0.88); }


}
nav.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 4px 6px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
nav.site-nav a:hover { color: var(--oxblood); }
nav.site-nav a.current {
  color: var(--oxblood);
  border-bottom-color: var(--oxblood);
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) nav.site-nav { background: rgba(36, 27, 20, 0.35); }


}

nav.page-nav {
  max-width: 760px;
  margin: 24px auto 48px;
  padding: 24px 32px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  border-top: 1px solid var(--rule);
}
nav.page-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  max-width: 45%;
}
nav.page-nav a:hover { color: var(--oxblood); }
nav.page-nav a .nav-label {
  display: block;
  font-family: 'Cormorant SC', serif;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 4px;
}
nav.page-nav a.next { text-align: right; margin-left: auto; }
@media (max-width: 600px) {
  nav.page-nav { padding: 20px 24px 0; font-size: 16px; }
}

/* ========== CHAPTER CARDS (home page) ========== */
.chapters {
  max-width: 760px;
  margin: 48px auto;
  padding: 0 32px;
  display: grid;
  gap: 16px;
}
.chapters .chapter {
  display: block;
  padding: 22px 26px;
  border: 1px solid var(--rule);
  background: rgba(234, 216, 179, 0.22);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.chapters .chapter:hover {
  background: rgba(234, 216, 179, 0.45);
  border-color: var(--oxblood);
  transform: translateY(-1px);
}
.chapters .chapter .ch-num {
  display: block;
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--gold);
  margin-bottom: 6px;
}
.chapters .chapter .ch-title {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px;
}
.chapters .chapter .ch-summary {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.5;
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) .chapters .chapter { background: rgba(36, 27, 20, 0.35); }

  :root:not(.theme-light) .chapters .chapter:hover { background: rgba(36, 27, 20, 0.55); }


}


/* ========== BREADCRUMBS ========== */
nav.crumbs {
  max-width: 760px;
  margin: 22px auto 0;
  padding: 0 32px;
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-muted);
}
nav.crumbs a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
nav.crumbs a:hover {
  color: var(--oxblood);
  border-bottom-color: var(--oxblood);
}
nav.crumbs span.sep {
  margin: 0 10px;
  color: var(--gold);
}

/* ========== ON THIS PAGE (chapter mini-TOC) ========== */
aside.on-this-page {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 18px 24px 20px;
  border: 1px solid var(--rule);
  background: rgba(234, 216, 179, 0.18);
  border-radius: 4px;
}
aside.on-this-page .otp-label {
  display: block;
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 10px;
}
aside.on-this-page ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
aside.on-this-page li {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
}
aside.on-this-page a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
aside.on-this-page a:hover {
  color: var(--oxblood);
  border-bottom-color: var(--oxblood);
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) aside.on-this-page { background: rgba(36, 27, 20, 0.35); }


}

/* ========== LANDING HERO INTRO + CHAPTER CARD GRID ========== */
.intro-lead {
  max-width: 680px;
  margin: 36px auto 0;
  padding: 0 32px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 2.1vw, 24px);
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: center;
}

.chapters {
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 56px auto 16px;
}
.chapters .chapter {
  padding: 26px 26px 24px;
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.chapters .chapter::after {
  content: "→";
  position: absolute;
  right: 22px;
  bottom: 18px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: var(--gold);
  transition: transform 0.2s, color 0.2s;
}
.chapters .chapter:hover::after {
  transform: translateX(4px);
  color: var(--oxblood);
}
@media (max-width: 640px) {
  .chapters { grid-template-columns: 1fr; gap: 12px; }
}

.cta-row {
  max-width: 680px;
  margin: 8px auto 56px;
  padding: 0 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  font-family: 'Cormorant SC', serif;
  font-size: 12px;
  letter-spacing: 0.28em;
}
.cta-row a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-light);
  padding-bottom: 2px;
}
.cta-row a:hover { color: var(--oxblood); border-bottom-color: var(--oxblood); }



/* ========== DISCLOSURE-BASED NAV (works on desktop and mobile) ========== */
details.nav-disclosure {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(243, 234, 214, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(94, 70, 30, 0.06), 0 6px 16px -10px rgba(94, 70, 30, 0.18);
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) details.nav-disclosure { background: rgba(26, 20, 16, 0.9); }


}

/* Inner nav strip already has its own background; clear it so disclosure styling shows through */
details.nav-disclosure > nav.site-nav {
  position: static;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-bottom: none;
}

/* Desktop: show the nav inline, hide the summary */
@media (min-width: 641px) {
  details.nav-disclosure > summary.nav-summary { display: none; }
  details.nav-disclosure > nav.site-nav { display: flex !important; }
  details.nav-disclosure > nav.site-nav a { padding: 4px 6px; border-bottom: 1px solid transparent; }
}

/* Mobile: collapsible disclosure with a clean toggle bar */
@media (max-width: 640px) {
  summary.nav-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    font-family: 'Cormorant SC', serif;
    font-size: 13px;
    letter-spacing: 0.22em;
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
  }
  summary.nav-summary::-webkit-details-marker { display: none; }
  summary.nav-summary::marker { content: ""; }
  summary.nav-summary .nav-summary-current {
    color: var(--ink-soft);
    letter-spacing: 0.22em;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  details.nav-disclosure > nav.site-nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 12px;
    border-top: 1px solid var(--rule);
  }
  details.nav-disclosure > nav.site-nav a {
    padding: 14px 22px;
    font-family: 'Cormorant Garamond', serif;
    font-style: normal;
    font-size: 19px;
    letter-spacing: 0.02em;
    color: var(--ink);
    border-bottom: none;
    border-left: 3px solid transparent;
    text-align: left;
  }
  details.nav-disclosure > nav.site-nav a:hover {
    background: rgba(234, 216, 179, 0.45);
    color: var(--oxblood);
  }
  details.nav-disclosure > nav.site-nav a.current {
    background: rgba(234, 216, 179, 0.55);
    color: var(--oxblood);
    border-left-color: var(--oxblood);
  }
  @media (prefers-color-scheme: dark) {

  :root:not(.theme-light) details.nav-disclosure > nav.site-nav a:hover { background: rgba(106, 29, 29, 0.15); }

  :root:not(.theme-light) details.nav-disclosure > nav.site-nav a.current { background: rgba(106, 29, 29, 0.22); }

  
}
}


/* ========== HAMBURGER ICON ========== */
.hamburger {
  display: inline-block;
  position: relative;
  width: 26px;
  height: 18px;
  flex: 0 0 auto;
}
.hamburger > span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--oxblood);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.18s ease, top 0.22s ease;
}
.hamburger > span:nth-child(1) { top: 2px; }
.hamburger > span:nth-child(2) { top: 8px; }
.hamburger > span:nth-child(3) { top: 14px; }

/* When the disclosure is open, morph the hamburger into an X */
details.nav-disclosure[open] summary.nav-summary .hamburger > span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}
details.nav-disclosure[open] summary.nav-summary .hamburger > span:nth-child(2) {
  opacity: 0;
}
details.nav-disclosure[open] summary.nav-summary .hamburger > span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  .hamburger > span { transition: none; }
}


/* Tighten the top of every article so it sits close to the panel above it */
article > h2:first-child,
article > p.intro-lead:first-child {
  margin-top: 0;
}
article > h2:first-child .ornament {
  margin-top: 0;
}
/* Pull on-this-page panel closer to what follows */
aside.on-this-page { margin-bottom: 0; }


/* ========== MOBILE READABILITY BUMPS ========== */
@media (max-width: 640px) {
  nav.crumbs {
    font-size: 12.5px;
    letter-spacing: 0.22em;
  }
  .cta-row { font-size: 14px; letter-spacing: 0.22em; }
  aside.on-this-page { padding: 16px 20px 18px; }
  aside.on-this-page .otp-label { font-size: 12.5px; letter-spacing: 0.26em; }
  aside.on-this-page li { font-size: 18px; }
  .reading-meta { font-size: 12.5px; letter-spacing: 0.24em; }
  footer .meta-row { font-size: 13px; letter-spacing: 0.18em; }
  ol.references { font-size: 18px; line-height: 1.55; }
  dl.glossary dt { font-size: 21px; }
  dl.glossary dd { font-size: 18.5px; }
  .bearers li .dates { font-size: 17px; }
  .bearers li p { font-size: 18px; }
}


/* ========== EXPLICIT DARK THEME (data-theme="dark") ========== */
:root.theme-dark { --parchment: #1a1410;
      --parchment-deep: #241b14;
      --paper-shadow: rgba(0, 0, 0, 0.4);
      --ink: #efe4cc;
      --ink-soft: #d8c9aa;
      --ink-muted: #bfae8d;
      --oxblood: #c98080;
      --oxblood-deep: #a45a5a;
      --gold: #c89968;
      --gold-light: #d8b079;
      --rule: #4a3d28; }
:root.theme-dark body { background-image:
        radial-gradient(at 15% 10%, rgba(200, 153, 104, 0.05) 0%, transparent 45%),
        radial-gradient(at 85% 80%, rgba(201, 128, 128, 0.04) 0%, transparent 50%); }
:root.theme-dark footer { background: rgba(36, 27, 20, 0.5); }
:root.theme-dark nav.toc { background: rgba(36, 27, 20, 0.35); }
:root.theme-dark .crest, :root.theme-dark figure.arms .arms-svg { filter: brightness(1.05) contrast(0.95); }
:root.theme-dark /* SVG overrides for dark mode */
    figure.map .m-bg { stroke: var(--rule); }
:root.theme-dark figure.map .m-grid { stroke: var(--gold); }
:root.theme-dark figure.map .m-grid-label, :root.theme-dark figure.map .m-subtitle, :root.theme-dark figure.map .m-region, :root.theme-dark figure.map .m-stage, :root.theme-dark figure.map .m-sub, :root.theme-dark figure.map .m-compass-t { fill: var(--gold); }
:root.theme-dark figure.map .m-title { fill: var(--oxblood); }
:root.theme-dark figure.map .m-route, :root.theme-dark figure.map .m-pin-ring { stroke: var(--oxblood); }
:root.theme-dark figure.map .m-pin, :root.theme-dark figure.map .m-arrow { fill: var(--oxblood); }
:root.theme-dark figure.map .m-label, :root.theme-dark figure.map .m-label-major { fill: var(--ink); }
:root.theme-dark figure.timeline .tl-axis { stroke: currentColor; }
:root.theme-dark figure.timeline .tl-dot, :root.theme-dark figure.timeline .tl-event, :root.theme-dark figure.timeline .tl-year { fill: currentColor; }
:root.theme-dark figure.timeline .tl-dot { fill: var(--oxblood); }
:root.theme-dark figure.timeline .tl-dot-ring { stroke: var(--oxblood); }
:root.theme-dark figure.timeline .tl-place { fill: var(--gold); }
:root.theme-dark figure.timeline .tl-event, :root.theme-dark figure.timeline .tl-year { fill: var(--ink); }
:root.theme-dark nav.site-nav { background: rgba(26, 20, 16, 0.88); }
:root.theme-dark nav.site-nav { background: rgba(36, 27, 20, 0.35); }
:root.theme-dark .chapters .chapter { background: rgba(36, 27, 20, 0.35); }
:root.theme-dark .chapters .chapter:hover { background: rgba(36, 27, 20, 0.55); }
:root.theme-dark aside.on-this-page { background: rgba(36, 27, 20, 0.35); }
:root.theme-dark details.nav-disclosure { background: rgba(26, 20, 16, 0.9); }
:root.theme-dark details.nav-disclosure > nav.site-nav a:hover { background: rgba(106, 29, 29, 0.15); }
:root.theme-dark details.nav-disclosure > nav.site-nav a.current { background: rgba(106, 29, 29, 0.22); }


/* ========== EXPLICIT LIGHT THEME (data-theme="light") — overrides OS dark ========== */
:root.theme-light {
  --parchment: #f3ead6;
  --parchment-deep: #ead8b3;
  --paper-shadow: rgba(94, 70, 30, 0.12);
  --ink: #1d1810;
  --ink-soft: #3a2f1e;
  --ink-muted: #6e5f47;
  --oxblood: #6a1d1d;
  --oxblood-deep: #4a1414;
  --gold: #a47148;
  --gold-light: #c89968;
  --rule: #c9b78a;
}

/* ========== MAP COUNTRY FILLS (document-level so dark mode can adapt) ========== */
figure.map .m-country-fill {
  fill: rgba(164, 113, 72, 0.10);
  stroke: rgba(94, 70, 30, 0.55);
  stroke-width: 0.9;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
figure.map .m-country-fill.cur {
  fill: rgba(106, 29, 29, 0.13);
  stroke: rgba(106, 29, 29, 0.55);
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) figure.map .m-country-fill {
    fill: rgba(200, 153, 104, 0.08);
    stroke: rgba(200, 153, 104, 0.45);
  }

  :root:not(.theme-light) figure.map .m-country-fill.cur {
    fill: rgba(201, 128, 128, 0.16);
    stroke: rgba(201, 128, 128, 0.6);
  }


}
:root.theme-dark figure.map .m-country-fill {
  fill: rgba(200, 153, 104, 0.08);
  stroke: rgba(200, 153, 104, 0.45);
}
:root.theme-dark figure.map .m-country-fill.cur {
  fill: rgba(201, 128, 128, 0.16);
  stroke: rgba(201, 128, 128, 0.6);
}

/* ========== THEME TOGGLE BUTTON ========== */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 200;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--parchment);
  color: var(--oxblood);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px -3px rgba(94, 70, 30, 0.25);
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.theme-toggle:hover {
  background: var(--parchment-deep);
  transform: scale(1.06);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 19px;
  height: 19px;
  display: block;
}
.theme-toggle .icon-moon { display: none; }
:root.theme-dark .theme-toggle .icon-sun,
:root:not(.theme-light) .theme-toggle .icon-sun {
  /* placeholder, overridden below */
}
@media (prefers-color-scheme: dark) {

  :root:not(.theme-light) .theme-toggle .icon-sun { display: none; }

  :root:not(.theme-light) .theme-toggle .icon-moon { display: block; }


}
:root.theme-dark .theme-toggle .icon-sun { display: none; }
:root.theme-dark .theme-toggle .icon-moon { display: block; }
:root.theme-light .theme-toggle .icon-sun { display: block; }
:root.theme-light .theme-toggle .icon-moon { display: none; }
@media (max-width: 640px) {
  .theme-toggle { top: 10px; right: 12px; width: 36px; height: 36px; }
  .theme-toggle svg { width: 17px; height: 17px; }
}
