/* Duerinck Family Genealogy
   Palette after the Flemish heraldic colours: gold and black, on archive paper. */
:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #eceee9;
  --ink: #161c26;
  --ink-2: #4a5361;
  --ink-3: #7a8290;
  --line: #d8dcd6;
  --line-strong: #b9bfb7;
  --band: #141b26;            /* header band */
  --band-ink: #e9e4d6;
  --band-muted: #9aa3b0;
  --gold: #b8860b;            /* heraldic gold: marks, borders, highlights */
  --gold-soft: #f6eed8;
  --link: #1d4a7a;            /* readable link blue */
  --focus: #b8860b;
  --edge: #a9b0ab;
  --edge-hi: #b8860b;
  --serif: "EB Garamond", "Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131a;
    --surface: #151c26;
    --surface-2: #1c2531;
    --ink: #e7e9ec;
    --ink-2: #aeb6c2;
    --ink-3: #7d8695;
    --line: #263040;
    --line-strong: #364256;
    --band: #0a0e14;
    --band-ink: #e9e4d6;
    --band-muted: #8b95a3;
    --gold: #d9ab3f;
    --gold-soft: #2a2516;
    --link: #8fb7e3;
    --focus: #d9ab3f;
    --edge: #3b475a;
    --edge-hi: #d9ab3f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Header band ---------- */
.site-header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(20px, env(safe-area-inset-left));
  background: var(--band); color: var(--band-ink);
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--band-ink); }
.brand svg { flex: none; }
.brand-mark { font-family: var(--serif); font-size: 21px; letter-spacing: .14em; text-transform: uppercase; }
.brand-sub { color: var(--band-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding-left: 10px; border-left: 1px solid #3a4352; }
.site-header nav { margin-left: auto; display: flex; gap: 22px; font-size: 13px; letter-spacing: .04em; }
.site-header nav a { color: var(--band-muted); text-decoration: none; }
.site-header nav a:hover { color: var(--band-ink); }

/* ---------- Home ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.hero-band { background: var(--band); color: var(--band-ink); }
.hero { padding-block: 64px 56px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px 64px; align-items: end; }
.hero .eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 14px; }
.hero h1 { font-size: clamp(36px, 5.6vw, 60px); }
.hero p.lede { color: var(--band-muted); max-width: 56ch; font-size: 16px; margin: 18px 0 0; }
.variants { color: var(--band-ink); }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; border-top: 1px solid #333c4a; }
.stat { padding: 14px 28px 0 0; }
.stat + .stat { padding-left: 28px; border-left: 1px solid #333c4a; }
.stat b { display: block; font-family: var(--serif); font-size: 34px; font-weight: 500; color: var(--gold); font-variant-numeric: lining-nums; }
.stat span { color: var(--band-muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

.search-row { margin-top: -26px; position: relative; z-index: 5; }
.search-box { position: relative; max-width: 640px; }
.search-row .search-box input {
  padding: 16px 16px 16px 46px; font-size: 16px;
  box-shadow: 0 10px 30px rgba(10, 14, 20, .18);
}
.search-box input {
  width: 100%; padding: 10px 12px 10px 38px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.search-box input:focus { border-color: var(--gold); outline: none; }
.search-box svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-3); }
.search-row .search-box svg { left: 17px; }
.results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px;
  box-shadow: 0 12px 28px rgba(10, 14, 20, .16); max-height: 380px; overflow: auto; padding: 4px 0;
}
.search-box .results svg { display: none; }
.results a, .results .empty {
  display: flex; gap: 10px; align-items: baseline; padding: 8px 14px;
  text-decoration: none; color: var(--ink); border-left: 3px solid transparent;
}
.results a:hover, .results a.active { background: var(--surface-2); border-left-color: var(--gold); }
.results .yrs { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.results .where { margin-left: auto; color: var(--ink-3); font-size: 12px; text-align: right; }
.results .empty { color: var(--ink-3); }

.group { padding-block: 44px 8px; }
.group-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px; }
.group h2 { font-size: 30px; }
.group-head .count { color: var(--ink-3); font-size: 13px; margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 36px; }
.card {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px;
  padding: 14px 2px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.card h3 { font-size: 19px; grid-column: 1; }
.card .meta { grid-column: 1; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.card .people { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-family: var(--serif); font-size: 24px; color: var(--ink-3); font-variant-numeric: lining-nums; }
a.card:hover h3 { color: var(--link); }
a.card:hover .people { color: var(--gold); }
.card.pending h3 { color: var(--ink-3); }
.tag {
  grid-column: 1; justify-self: start; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 6px; border: 1px solid var(--gold); color: var(--gold); border-radius: 2px; margin-top: 5px;
}
.section-note { color: var(--ink-3); margin: 10px 0 0; }
footer.site-footer { margin-top: 64px; padding-block: 28px 56px; color: var(--ink-3); font-size: 13px; border-top: 3px solid var(--gold); }
footer.site-footer p { max-width: 75ch; }

/* ---------- Tree page ---------- */
body.tree-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.toolbar h1 { font-size: 23px; margin-right: 8px; }
.toolbar .search-box { margin: 0; flex: 1 1 220px; max-width: 340px; }
.toolbar .search-box input { padding: 7px 10px 7px 34px; font-size: 14px; }
.toolbar .search-box svg { left: 11px; }
.btns { display: flex; margin-left: auto; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 0;
  padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; margin-left: -1px;
}
.btns .btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.btns .btn:last-child { border-radius: 0 4px 4px 0; }
.btn:hover { background: var(--surface-2); position: relative; }
.btn.icon { width: 34px; padding: 6px 0; text-align: center; }

.workspace { flex: 1; display: flex; min-height: 0; }
.canvas { flex: 1; position: relative; overflow: hidden; touch-action: none; cursor: grab; background: var(--bg); }
.canvas.dragging { cursor: grabbing; }
.canvas svg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
.hint { position: absolute; left: 16px; bottom: 12px; font-size: 12px; color: var(--ink-3); pointer-events: none;
  background: var(--surface); padding: 3px 8px; border: 1px solid var(--line); }

.node { cursor: pointer; }
.node rect.box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.node rect.bar { fill: var(--line-strong); }
.node:hover rect.box { stroke: var(--ink-2); }
.node.on-path rect.box { stroke: var(--gold); }
.node.on-path rect.bar { fill: var(--gold); }
.node.selected rect.box { stroke: var(--gold); stroke-width: 2; fill: var(--gold-soft); }
.node.selected rect.bar { fill: var(--gold); }
.node text { fill: var(--ink); font-family: var(--sans); }
.node .nm { font-size: 13px; font-weight: 600; }
.node .sub { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.node .sp { font-size: 11.5px; fill: var(--ink-2); }
.node .badge rect { fill: var(--surface); stroke: var(--line-strong); }
.node .badge text { font-size: 11px; fill: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.node.collapsed .badge rect { fill: var(--ink); stroke: var(--ink); }
.node.collapsed .badge text { fill: var(--bg); }
.node.virtual rect.box { fill: var(--band); stroke: none; }
.node.virtual rect.bar { fill: var(--gold); }
.node.virtual text { fill: var(--band-ink); }
.node.virtual .nm { font-family: var(--serif); font-size: 15px; font-weight: 500; }
.node.virtual .sub { fill: var(--band-muted); }
.edge { fill: none; stroke: var(--edge); stroke-width: 1.25; }
.edge.on-path { stroke: var(--edge-hi); stroke-width: 2; }

/* Detail panel */
.panel {
  width: 390px; flex: none; border-left: 1px solid var(--line); background: var(--surface);
  overflow: auto; padding: 22px 24px 40px;
}
.panel h2 { font-size: 31px; }
.panel .lifespan { color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.panel h3 {
  font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3);
  margin: 24px 0 8px; font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 18px 0 0; padding: 14px 0 0; border-top: 2px solid var(--gold); }
.facts dt { color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; padding-top: 3px; }
.facts dd { margin: 0; }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { padding: 3px 0; }
.plist button { all: unset; cursor: pointer; color: var(--link); }
.plist button:hover { text-decoration: underline; }
.plist .yrs { color: var(--ink-3); font-size: 13px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.crumbs { font-size: 12.5px; color: var(--ink-3); line-height: 1.8; margin-bottom: 6px; }
.crumbs button { all: unset; cursor: pointer; color: var(--ink-2); }
.crumbs button:hover { color: var(--link); text-decoration: underline; }
.crumbs .sep { margin: 0 5px; color: var(--gold); }
.note { margin: 0 0 10px; white-space: pre-wrap; }
.raw {
  font-size: 13px; color: var(--ink-2); background: var(--surface-2);
  border-left: 3px solid var(--line-strong); padding: 10px 12px; white-space: pre-wrap; margin: 0;
}
.muted { color: var(--ink-3); font-size: 13px; }
.intro p { margin: 0 0 10px; color: var(--ink-2); }
.panel-close { display: none; }

@media (max-width: 820px) {
  .workspace { flex-direction: column; }
  .panel {
    width: auto; border-left: 0; border-top: 3px solid var(--gold);
    max-height: 46dvh; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .panel.hidden-mobile { display: none; }
  .panel-close { display: block; float: right; border-radius: 4px; }
  .btns .label-long { display: none; }
  .hint { display: none; }
}

/* ---------- Narrow screens ---------- */
.facts dd, .crumbs, .panel h2, .note, .raw { overflow-wrap: anywhere; min-width: 0; }
.search-box { min-width: 0; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-block: 40px 52px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; gap: 6px 16px; }
  .brand-sub { display: none; }
  .site-header nav { gap: 14px; }
  .toolbar h1 { flex: 1 1 100%; font-size: 21px; }
  .toolbar .search-box { flex: 1 1 100%; max-width: none; }
  .btns { margin-left: 0; }
  .stat { padding-right: 16px; }
  .stat + .stat { padding-left: 16px; }
  .stat b { font-size: 26px; }
}

/* ---------- Rebuilt original pages (site/pages/) ---------- */
.doc { max-width: 860px; padding-block: 28px 0; }
.crumbs-top { font-size: 13px; color: var(--ink-3); margin: 0 0 18px; }
.crumbs-top a { color: var(--ink-2); text-decoration: none; }
.crumbs-top a:hover { color: var(--link); text-decoration: underline; }
.crumbs-top span { color: var(--gold); margin: 0 4px; }
.doc > h1 { font-size: clamp(30px, 4.5vw, 44px); padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.page-note { margin: 16px 0 0; padding: 10px 14px; background: var(--gold-soft); border-left: 3px solid var(--gold); color: var(--ink); }
.doc-body { margin-top: 24px; font-size: 16px; line-height: 1.65; overflow-wrap: break-word; }
.doc-body h2, .doc-body h3, .doc-body h4, .doc-body h5, .doc-body h6 { margin: 1.6em 0 .5em; }
.doc-body h2 { font-size: 28px; } .doc-body h3 { font-size: 23px; } .doc-body h4 { font-size: 19px; }
.doc-body h5, .doc-body h6 { font-size: 17px; font-family: var(--sans); font-weight: 600; }
.doc-body p { margin: 0 0 1em; }
.doc-body ul, .doc-body ol { padding-left: 1.4em; margin: 0 0 1em; }
.doc-body ul ul, .doc-body ol ol, .doc-body ul ol, .doc-body ol ul { margin: .25em 0 .25em; border-left: 1px solid var(--line); padding-left: 1.2em; }
.doc-body li { margin: .15em 0; }
.doc-body img { max-width: 100%; height: auto; margin: 8px 0; vertical-align: middle; }
.doc-body table { border-collapse: collapse; margin: 1em 0; display: block; overflow-x: auto; max-width: 100%; font-size: 14px; }
.doc-body td, .doc-body th { border: 1px solid var(--line); padding: 5px 8px; vertical-align: top; text-align: left; }
.doc-body th { background: var(--surface-2); }
.doc-body pre { white-space: pre-wrap; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; }
.doc-body blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.doc-body div { max-width: 100%; }
