  :root {
    --bg: #f6f6f3; --surface: #ffffff; --ink: #1a1a1b; --muted: #5f5f5c; --line: #dcdcd6;
    --accent: #b8480a; --accent-ink: #ffffff; --teal: #0f766e; --note: #f0efe9;
    --banner: #0b1622;
    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #0e0e0f; --surface: #161618; --ink: #ebebe8; --muted: #9a9a96; --line: #2a2a2d;
      --accent: #ff8a3d; --accent-ink: #1c0d03; --teal: #2dd4bf; --note: #1b1b1d;
    }
  }
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 24px; }
  body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
  a { color: inherit; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  .skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); }
  .skip:focus { top: 12px; }

  /* ---------- Banner ---------- */
  .top { background: var(--banner); }
  #intro { display: none; position: fixed; inset: 0; z-index: 9999; background: var(--banner); opacity: 1; transition: opacity .25s ease; cursor: pointer; }
  html.intro-pending #intro, #intro.live { display: block; }
  #intro.done { opacity: 0; pointer-events: none; }
  #intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  body.intro-playing { overflow: hidden; }
  /* The page waits below the frame, then is pulled up over the dots */
  #rest { background: var(--bg); }
  html.intro-pending #rest, #rest.away { transform: translateY(100vh); }
  #rest.lift { position: relative; z-index: 10000; box-shadow: 0 -24px 48px rgba(0,0,0,.35); }  .banner-wrap { position: relative; width: 100%; height: clamp(190px, 25vw, 310px); background: var(--banner); overflow: hidden; }
  #banner { display: block; width: 100%; height: 100%; }
  .marker, .marker-label, .replay { transition: opacity .6s ease; }
  body.intro-playing .marker, body.intro-playing .marker-label, body.intro-playing .replay { opacity: 0; }
  .marker { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 2px rgba(255,255,255,.55); pointer-events: none; }
  .marker::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); animation: ping 3.2s ease-out infinite; }
  .marker-label { position: absolute; transform: translate(-100%, -50%); padding-right: 14px; font: 500 12px var(--sans); color: rgba(255,255,255,.72); white-space: nowrap; pointer-events: none; }
  @keyframes ping { 0% { transform: scale(.6); opacity: .9; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
  .replay { position: absolute; right: 14px; bottom: 10px; background: none; border: 0; color: rgba(255,255,255,.4); font: 500 12px var(--sans); cursor: pointer; padding: 6px 8px; }
  .replay:hover { color: rgba(255,255,255,.85); }

  .masthead { text-align: center; padding: 44px 24px 6px; }
  .masthead h1 { font: 700 clamp(44px, 8vw, 76px)/1.05 var(--serif); letter-spacing: -.025em; margin: 0 0 10px; }
  body.title-in-banner .masthead h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.title-in-banner .masthead { padding-top: 36px; }
  .tagline { font: 400 clamp(20px, 3vw, 26px)/1.3 var(--serif); margin: 0 0 6px; }
  .kicker { color: var(--muted); font-size: 14px; margin: 0; }

  /* Reveal after the intro */

  /* ---------- Layout ---------- */
  .layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; max-width: 1100px; margin: 0 auto; padding: 48px 24px 80px; }
  .side { position: sticky; top: 24px; align-self: start; }
  .eyebrow { font: italic 400 15px var(--serif); color: var(--muted); margin: 0 0 6px; }
  .btn-primary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; line-height: 1.25; transition: transform .15s ease, filter .15s ease; }
  .btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
  .btn-arrow { flex: none; margin-left: auto; }
  .btn-logo { flex: none; border-radius: 7px; }
  .btn-primary .btn-label { font-size: 1.15rem; letter-spacing: .01em; }
  .fine { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 10px 0 0; }
  .anchors { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
  .anchors a { display: block; padding: 10px 0 10px 14px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); }
  .anchors a:hover { color: var(--ink); }
  .anchors a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }

  .content { min-width: 0; }
  .section { margin: 0 0 64px; }
  .section h2 { font: 700 clamp(28px, 4vw, 36px)/1.15 var(--serif); letter-spacing: -.015em; margin: 0 0 14px; }
  .lead { font-size: 17px; max-width: 62ch; }
  .card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: clamp(22px, 4vw, 36px); }

  /* ---------- Tree ---------- */
  .legend { margin: 22px 0 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .legend summary { cursor: pointer; padding: 12px 16px; font-weight: 500; }
  .legend dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 24px; margin: 0; padding: 4px 16px 16px; }
  .legend div { display: flex; gap: 10px; align-items: baseline; }
  .legend dt { font-weight: 600; min-width: 4.2em; }
  .legend dd { margin: 0; color: var(--muted); font-size: 14px; }

  .tree-static { list-style: none; margin: 0; padding: 0; position: relative; }
  .tree-static::before { content: ""; position: absolute; left: 22px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--line), var(--line)); }
  .tree-static li { position: relative; padding: 0 0 26px 68px; }
  .tree-static li:last-child { padding-bottom: 0; }
  .roman { position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 2px solid var(--accent); color: var(--accent); font: 700 13px var(--serif); letter-spacing: .02em; }
  .t-name { font: 600 19px/1.3 var(--serif); }
  .tree-static em { color: var(--muted); font-size: 13px; }
  .tree-static p { margin: 2px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
  .tree-static p:first-of-type { color: var(--ink); margin-top: 6px; }
  .tree-static p:last-child:not(:first-of-type) { font-size: 13.5px; font-style: italic; border-left: 2px solid var(--line); padding-left: 10px; margin-top: 8px; }
  .note { color: var(--muted); font-size: 14px; margin-top: 28px; }

  /* ---------- Name & crest ---------- */
  .name-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 44px); align-items: center; }
  .crest { margin: 0; text-align: center; }
  .crest img { width: 100%; max-width: 260px; border-radius: 6px; height: auto; display: block; margin: 0 auto 10px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.28)); }
  .crest figcaption { color: var(--muted); font-size: 13px; }
  .name-card p { max-width: 60ch; }
  .name-card .eyebrow + h2 + p { margin-top: 0; }

  /* ---------- Story ---------- */
  .facts { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 16px; }
  .facts li { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); }
  .facts .num { font: 700 clamp(26px, 4vw, 34px)/1.1 var(--serif); color: var(--teal); }

  .foot { border-top: 1px solid var(--line); padding: 36px 24px 56px; text-align: center; color: var(--muted); font-size: 14px; }
  .foot p { margin: 0 0 4px; }
  .foot strong { color: var(--ink); }

  @media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; gap: 36px; padding-top: 32px; }
    .side { position: static; }
    .anchors { display: flex; gap: 6px 18px; flex-wrap: wrap; border-top: 0; margin-top: 18px; }
    .anchors a { border-left: 0; padding: 6px 0; border-bottom: 2px solid transparent; margin: 0; }
    .anchors a[aria-current="true"] { border-bottom-color: var(--accent); }
  }
  @media (max-width: 640px) {
    .name-card { grid-template-columns: 1fr; }
    .facts li { grid-template-columns: 1fr; gap: 4px; }
    .marker-label { display: none; }
    .tree-static::before { left: 18px; }
    .tree-static li { padding-left: 58px; }
    .roman { width: 38px; height: 38px; font-size: 11px; }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .marker::after { animation: none; display: none; }
    .replay, #intro { display: none !important; }
    html.intro-pending #rest { transform: none; }
  }
