/* rabideau.org — shared styles
   Palette carried over from the previous site (navy / slate / cream). */

:root {
  --paper: #f6f1e4;
  --paper-2: #ede6d3;
  --card: #fbf8f0;
  --ink: #1d2d44;
  --ink-soft: #3e5c76;
  --muted: #6b7686;
  --rule: #d6cdb6;
  --accent: #8a5a2b;        /* sepia, for links and small marks */
  --accent-soft: #e9dcc4;
  --navy: #1d2d44;
  --on-navy: #f0ebd8;
  --focus: #b07a3a;
  --shadow: 0 1px 2px rgba(29, 45, 68, .06), 0 4px 16px rgba(29, 45, 68, .06);

  --display: "IM Fell French Canon", "Iowan Old Style", Georgia, serif;
  --body: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 40rem;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16202f;
    --paper-2: #1d2a3d;
    --card: #1f2d42;
    --ink: #f0ebd8;
    --ink-soft: #b9c6d6;
    --muted: #93a0b2;
    --rule: #33445c;
    --accent: #d9b07a;
    --accent-soft: #3a3528;
    --navy: #0f1724;
    --on-navy: #f0ebd8;
    --focus: #d9b07a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16202f;
  --paper-2: #1d2a3d;
  --card: #1f2d42;
  --ink: #f0ebd8;
  --ink-soft: #b9c6d6;
  --muted: #93a0b2;
  --rule: #33445c;
  --accent: #d9b07a;
  --accent-soft: #3a3528;
  --navy: #0f1724;
  --on-navy: #f0ebd8;
  --focus: #d9b07a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.1875rem/1.6 var(--body);
  font-feature-settings: "onum", "kern";
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--card); padding: 6px 10px; z-index: 10; }

/* ---------- header / nav ---------- */
.site-header {
  background: var(--navy);
  color: var(--on-navy);
}
.site-header .inner {
  max-width: 72rem; margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand {
  font-family: var(--display); font-size: 1.5rem; color: var(--on-navy); text-decoration: none;
  letter-spacing: .01em; margin-right: auto; white-space: nowrap;
}
.brand small { font-family: var(--ui); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-left: 8px; }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-family: var(--ui); font-size: .875rem; }
.site-nav a { color: var(--on-navy); text-decoration: none; opacity: .82; padding: 4px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { opacity: 1; }
.site-nav a[aria-current="page"] { opacity: 1; border-bottom-color: currentColor; }
.theme-toggle {
  font: inherit; font-family: var(--ui); font-size: .8rem; color: var(--on-navy); background: transparent;
  border: 1px solid rgba(240, 235, 216, .35); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}

/* ---------- layout ---------- */
main { display: block; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); margin: 0 auto; }
.eyebrow { font-family: var(--ui); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.lede { font-size: 1.35rem; line-height: 1.5; color: var(--ink-soft); }

.site-footer { margin-top: 80px; border-top: 1px solid var(--rule); color: var(--muted); font-family: var(--ui); font-size: .8rem; }
.site-footer .inner { max-width: 72rem; margin: 0 auto; padding: 24px var(--gutter) 40px; display: flex; gap: 8px 24px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- home ---------- */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(32px, 6vw, 64px); text-align: center; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0 0 .25em; }
.hero .lede { max-width: 36rem; margin: 0 auto; }
.ornament { display: block; margin: 28px auto 0; color: var(--accent); width: 120px; height: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 8px 0 64px; }
.card {
  display: block; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 22px 22px 20px;
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h2 { font-size: 1.6rem; margin: 0 0 .35rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 1.05rem; }
.card .domain { display: block; font-family: var(--ui); font-size: .85rem; color: var(--muted); }
.people-cards { margin-top: 8px; }
.card p.eyebrow { font-size: .72rem; color: var(--muted); margin-bottom: .4rem; }
.card .go { display: inline-block; margin-top: 12px; font-family: var(--ui); font-size: .8rem; color: var(--accent); }

.section-title { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 .3em; }

/* journey strip */
.journey { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 8px; }
.journey li { position: relative; padding: 30px 14px 0 0; }
.journey li::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: var(--rule); }
.journey li::after { content: ""; position: absolute; top: 3px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.journey li:last-child::before { right: auto; width: 0; }
.journey .yr { font-family: var(--ui); font-size: .75rem; letter-spacing: .06em; color: var(--accent); font-variant-numeric: tabular-nums; }
.journey .pl { display: block; font-family: var(--display); font-size: 1.15rem; line-height: 1.2; margin: 2px 0 4px; }
.journey .what { display: block; font-size: .95rem; color: var(--ink-soft); line-height: 1.35; }

/* direct line */
.line { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; counter-reset: gen; }
.line li { counter-increment: gen; }
.line a {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 0 8px; align-items: baseline;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); text-decoration: none; color: var(--ink);
}
.line a:hover { border-color: var(--accent); }
.line a::before { content: counter(gen); grid-row: span 2; font-family: var(--display); font-size: 1.6rem; color: var(--accent); line-height: 1; }
.line .n { font-size: 1.05rem; line-height: 1.25; }
.line .d { grid-column: 2; font-family: var(--ui); font-size: .75rem; color: var(--muted); }
.line .d + .d { margin-top: 4px; color: var(--accent); }
.line a::before { grid-row: span 3; }

/* ---------- origins (long read) ---------- */
.article-head { padding: clamp(40px, 7vw, 88px) 0 24px; }
.article-head h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); margin: 0 0 .3em; }
.chapter { margin-top: 56px; }
.chapter h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); margin: 0 0 .5em; }
.chapter h2 .num { display: block; font-family: var(--ui); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.prose p { margin: 0 0 1.05em; }
.prose sup a { font-family: var(--ui); font-size: .7em; text-decoration: none; padding: 0 1px; }
.dropcap::first-letter { font-family: var(--display); float: left; font-size: 3.6em; line-height: .82; padding: .06em .08em 0 0; color: var(--accent); }

.aside {
  margin: 28px 0; padding: 18px 20px; border-left: 3px solid var(--accent); background: var(--paper-2); border-radius: 0 8px 8px 0;
  font-size: 1.05rem;
}
.aside h3 { font-size: 1.2rem; margin: 0 0 .4em; }
.aside p:last-child, .aside ul:last-child { margin-bottom: 0; }
.aside ul { padding-left: 1.1em; margin: .4em 0 0; }
.aside li { margin-bottom: .35em; }

.gens { list-style: none; padding: 0; margin: 20px 0; border-top: 1px solid var(--rule); }
.gens li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.gens .when { font-family: var(--ui); font-size: .8rem; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.gens .who { line-height: 1.35; }
.gens .who small { display: block; color: var(--ink-soft); font-size: .95rem; }

.notes { font-size: 1rem; color: var(--ink-soft); }
.notes ol { padding-left: 1.3em; }
.notes li { margin-bottom: .5em; }
.notes li:target { background: var(--accent-soft); }

/* ---------- tree explorer ---------- */
.tree-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; padding-top: 32px; align-items: start; }
@media (max-width: 860px) { .tree-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

.finder { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
@media (max-width: 860px) { .finder { position: static; } }
.finder label { display: block; font-family: var(--ui); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.finder input[type="search"] {
  width: 100%; font: 400 1rem var(--ui); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px;
}
.finder input[type="search"]:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.finder .count { font-family: var(--ui); font-size: .75rem; color: var(--muted); margin: 8px 2px 0; }
.results { list-style: none; margin: 10px 0 0; padding: 0; max-height: 56vh; overflow-y: auto; }
@media (max-width: 860px) { .results { max-height: 260px; } }
.results button {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 7px 8px; border-radius: 6px; line-height: 1.25;
}
.results button:hover, .results button:focus-visible { background: var(--paper-2); }
.results button[aria-current="true"] { background: var(--accent-soft); }
.results .r-name { display: block; font-size: 1rem; }
.results .r-meta { display: block; font-family: var(--ui); font-size: .72rem; color: var(--muted); }
.surnames { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font: 500 .75rem var(--ui); color: var(--ink-soft); background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 9px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.person-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.person-head .years { font-family: var(--ui); font-size: .95rem; color: var(--muted); margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.person-head .aka { font-size: 1rem; color: var(--ink-soft); font-style: italic; margin: 6px 0 0; }
.badge { display: inline-block; font: 600 .68rem var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0 0; }
.vital { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.vital dt { font-family: var(--ui); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.vital dd { margin: 2px 0 0; line-height: 1.35; }
.vital dd small { display: block; color: var(--ink-soft); font-size: .95rem; }

.panel { margin-top: 36px; }
.panel h2 { font-size: 1.5rem; margin: 0 0 12px; }

/* pedigree chart: 4 generations, grid with 8 rows */
.pedigree-scroll { overflow-x: auto; padding-bottom: 6px; container-type: inline-size; }
.pedigree { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); grid-template-rows: repeat(8, minmax(46px, auto)); gap: 6px 22px; min-width: 660px; }
.pslot { display: flex; align-items: center; position: relative; }
.pslot.g1, .pslot.g2, .pslot.g3 { }
.pslot:not(.g0)::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 1px solid var(--rule); }
.pbox {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer; background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: 7px 10px; line-height: 1.2; transition: border-color .12s ease;
}
.pbox:hover, .pbox:focus-visible { border-color: var(--accent); }
.pbox .pn { display: block; font-size: .98rem; }
.pbox .pd { display: block; font-family: var(--ui); font-size: .7rem; color: var(--muted); margin-top: 2px; }
.pbox.self { background: var(--ink); color: var(--paper); border-color: var(--ink); cursor: default; }
.pbox.self .pd { color: var(--paper-2); opacity: .8; }
.pbox.empty { cursor: default; border-style: dashed; color: var(--muted); background: transparent; }
.pbox.empty .pn { font-size: .85rem; font-family: var(--ui); }
/* narrow column: drop the 4th generation and fit without scrolling */
@container (max-width: 640px) {
  .pedigree { grid-template-columns: repeat(3, minmax(96px, 1fr)); grid-template-rows: repeat(8, minmax(38px, auto)); min-width: 0; gap: 4px 14px; }
  .pbox { padding: 6px 8px; }
  .pbox .pn { font-size: .9rem; }
  .pslot:not(.g0)::before { left: -14px; width: 14px; }
  .pslot.g3 { display: none; }
}

.fam { border: 1px solid var(--rule); border-radius: 10px; background: var(--card); padding: 14px 16px; margin-bottom: 12px; }
.fam-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fam-head .label { font-family: var(--ui); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fam-head .when { font-family: var(--ui); font-size: .8rem; color: var(--muted); }
.plink { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.plink:hover { text-decoration-thickness: 2px; }
.plink:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kids { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; }
.kids li { padding: 3px 0; }
.kids .y { font-family: var(--ui); font-size: .72rem; color: var(--muted); margin-left: 4px; }
.none { color: var(--muted); font-style: italic; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline .t { font-family: var(--ui); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.timeline .dt { font-family: var(--ui); font-size: .8rem; color: var(--muted); margin-left: 6px; }
.timeline .pl { display: block; line-height: 1.35; }
.timeline .oc { display: block; font-size: .95rem; color: var(--ink-soft); font-style: italic; }

.srcs { columns: 2 260px; column-gap: 28px; padding-left: 1.1em; margin: 0; font-size: 1rem; color: var(--ink-soft); }
.srcs li { break-inside: avoid; margin-bottom: 4px; }

.privacy-note { font-family: var(--ui); font-size: .8rem; color: var(--muted); margin-top: 14px; line-height: 1.5; }

.loading { padding: 40px 0; color: var(--muted); font-family: var(--ui); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
