:root {
  /* The Navigators palette — matches the proposal microsite */
  --bg: #f5f3ef;          /* warm light gray app shell */
  --bg-2: #ffffff;        /* cards / panels */
  --bg-3: #ecebe4;        /* hover / subtle fills */
  --line: rgba(48,48,48,0.10);
  --line-2: rgba(48,48,48,0.16);
  --txt: #1f1f1f;         /* near-black headings */
  --txt-dim: #555555;     /* secondary copy */
  --txt-faint: #6b7280;   /* captions, small labels */

  --accent: #008c95;            /* Navigator Teal — primary */
  --accent-dark: #006f78;       /* hover + accessible accent text */
  --accent-soft: rgba(0,140,149,0.12);
  --pale-teal: #e6f3f4;

  --gold: #d2a526;              /* Navigator Gold — accents / icon only */
  --gold-deep: #a87f16;
  --gold-soft: rgba(210,165,38,0.14);
  --gold-pale: #f7e8bb;

  --verified: #3f9e5a;
  --qualified: #bd9526;
  --unverified: #c0564f;
  --unspecified: #8b8472;

  --shadow: 0 16px 44px -18px rgba(0,0,0,0.30);
  --radius: 10px;

  --font-display: "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-body: "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

/* Never scroll horizontally. Single-column pages plus the off-canvas .drawer
   (parked at translateX(100%), 440px past the right edge) would otherwise leave
   dead space to the right of the header. `clip` (not `hidden`) avoids creating a
   scroll container, so the sticky header keeps working and fixed overlays
   (gate, open drawer) are not clipped. */
html, body { overflow-x: clip; max-width: 100%; }

/* ---------- password gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 50% 18%, var(--pale-teal), #ffffff 78%);
}
html.unlocked .gate { display: none; }
.gate-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%; max-width: 360px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 16px; padding: 38px 32px 32px;
  box-shadow: 0 24px 60px -28px rgba(0,0,0,0.28);
}
.gate-mark { width: 46px; height: 46px; margin-bottom: 18px; }
.gate-card h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 26px; letter-spacing: -.01em; margin: 0 0 8px; color: var(--txt);
}
.gate-sub { margin: 0 0 22px; font-size: 13px; line-height: 1.5; color: var(--txt-dim); }
.gate-input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px;
  font-family: var(--font-body); font-size: 15px; color: var(--txt); text-align: center;
}
.gate-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-btn {
  width: 100%; padding: 12px 14px; border: none; border-radius: 9px;
  background: var(--accent); color: #ffffff; font-family: var(--font-body);
  font-size: 14px; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; transition: background .15s;
  box-shadow: 0 8px 24px -12px rgba(0,111,120,.65);
}
.gate-btn:hover { background: var(--accent-dark); }
.gate-error { margin: 14px 0 0; font-size: 12.5px; color: var(--unverified); font-weight: 600; }
.gate-card.shake { animation: gate-shake .4s; }
@keyframes gate-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-7px); }
  40%,80% { transform: translateX(7px); }
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 22px;
  background: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.brand .mark { width: 32px; height: 32px; flex: none; }
.brand h1 {
  font-family: var(--font-display); font-size: 17px; margin: 0;
  letter-spacing: -.01em; font-weight: 600; color: var(--accent-dark);
}
.brand .sub { margin: 2px 0 0; font-size: 11.5px; color: var(--txt-faint); }

.stats { display: flex; gap: 10px; margin-left: auto; }
.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px;
  text-align: center;
  min-width: 74px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.stat .num {
  display: block; font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--accent-dark); letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.stat .lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--txt-faint); margin-top: 2px; }

.controls { display: flex; align-items: center; gap: 12px; }
.refresh { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-dim); cursor: pointer; user-select: none; }
.refresh input { accent-color: var(--accent); }
#refresh-btn {
  background: var(--bg-2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; width: 34px; height: 34px; font-size: 16px; cursor: pointer;
  transition: background .15s, transform .3s;
}
#refresh-btn:hover { background: var(--bg-3); }
#refresh-btn.spin { transform: rotate(360deg); }

/* ---------- tabs ---------- */
.tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 0 22px; background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none; border: none; color: var(--txt-dim);
  padding: 12px 16px; font-family: var(--font-body); font-size: 13px; cursor: pointer;
  border-bottom: 2px solid transparent; font-weight: 600;
}
.tab:hover { color: var(--txt); }
.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

.legend { display: flex; gap: 16px; margin-left: auto; font-size: 11.5px; color: var(--txt-dim); }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.verified { background: var(--verified); }
.dot.qualified { background: var(--qualified); }
.dot.unverified { background: var(--unverified); }
.dot.unspecified { background: var(--unspecified); }

/* legend tooltips — hover/focus a confidence level for its definition */
.legend-item { position: relative; cursor: help; outline: none; }
.legend-item::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 9px); right: 0;
  width: max-content; max-width: 250px;
  background: var(--txt); color: #ffffff;
  padding: 8px 11px; border-radius: 8px;
  font-size: 11.5px; line-height: 1.45; font-weight: 400; text-align: left;
  white-space: normal; box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  opacity: 0; transform: translateY(-3px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease; z-index: 60;
}
.legend-item::before {
  content: ""; position: absolute; top: calc(100% + 2px); right: 12px;
  border: 6px solid transparent; border-bottom-color: var(--txt);
  opacity: 0; transition: opacity .14s ease; z-index: 60;
}
.legend-item:hover::after, .legend-item:focus-visible::after,
.legend-item:hover::before, .legend-item:focus-visible::before {
  opacity: 1; transform: translateY(0);
}

/* person search overlay on the lineage graph */
.graph-search { position: absolute; top: 14px; left: 14px; z-index: 20; width: 280px; max-width: calc(100% - 28px); }
.graph-search-input {
  width: 100%; padding: 9px 13px; box-sizing: border-box;
  background: rgba(255,255,255,0.96); border: 1px solid var(--line-2);
  border-radius: 9px; color: var(--txt); font-family: var(--font-body); font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08); backdrop-filter: blur(3px);
}
.graph-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 2px 14px rgba(0,140,149,0.22); }
.graph-search-results {
  margin-top: 6px; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,0.16);
  max-height: 320px; overflow-y: auto; display: none;
}
.graph-search-results.open { display: block; }
.gs-item {
  padding: 8px 13px; cursor: pointer; border-bottom: 1px solid var(--line);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.gs-item:last-child { border-bottom: none; }
.gs-item:hover, .gs-item.active { background: var(--pale-teal); }
.gs-item .gs-name { font-weight: 600; }
.gs-item .gs-aka { color: var(--txt-faint); font-size: 11.5px; }
.gs-item .gs-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.gs-item .gs-dot.verified { background: var(--verified); }
.gs-item .gs-dot.qualified { background: var(--qualified); }
.gs-item .gs-dot.unverified { background: var(--unverified); }
.gs-item .gs-dot.unspecified { background: var(--unspecified); }
.gs-empty { padding: 10px 13px; color: var(--txt-faint); font-size: 12.5px; font-style: italic; }

/* ---------- panels ---------- */
main { flex: 1; position: relative; min-height: 0; display: flex; }
.panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
.panel.active { display: flex; }

#graph-stage { flex: 1; min-height: 0; position: relative; }
#graph { position: absolute; inset: 0; background:
  radial-gradient(circle at 50% 0%, var(--pale-teal), var(--bg) 70%); }
.graph-hint { margin: 0; padding: 8px 22px; font-size: 12px; color: var(--txt-faint); border-top: 1px solid var(--line); background: var(--bg-2); }

.search {
  margin: 16px 22px 8px; padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--txt); font-family: var(--font-body); font-size: 13px; max-width: 360px;
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.table-wrap { flex: 1; overflow: auto; padding: 0 22px 22px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; background: var(--bg-2);
  text-align: left; padding: 9px 12px; color: var(--txt-dim);
  font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line-2); cursor: pointer; white-space: nowrap;
}
thead th:hover { color: var(--accent-dark); }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--pale-teal); }
.muted { color: var(--txt-faint); }
.clamp { max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  border: 1px solid transparent;
}
.badge.verified { color: #2f7e45; background: rgba(63,158,90,0.14); border-color: rgba(63,158,90,0.35); }
.badge.qualified { color: var(--gold-deep); background: var(--gold-soft); border-color: rgba(168,127,22,0.38); }
.badge.unverified { color: #b13d36; background: rgba(192,86,79,0.14); border-color: rgba(192,86,79,0.35); }
.badge.unspecified { color: #6f6857; background: rgba(139,132,114,0.14); border-color: rgba(139,132,114,0.34); }

.gen-pill {
  display: inline-block; min-width: 22px; text-align: center;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 1px 7px; font-variant-numeric: tabular-nums; color: var(--txt-dim);
}

/* research-coverage pill */
.cov { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.cov.done { color: #2f7e45; background: rgba(63,158,90,0.14); border-color: rgba(63,158,90,0.35); }
.cov.in_progress { color: var(--gold-deep); background: var(--gold-soft); border-color: rgba(168,127,22,0.38); }
.cov.pending { color: var(--txt-faint); background: rgba(139,132,114,0.10); border-color: var(--line-2); }

/* ---------- sources ---------- */
.src-chip {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; max-width: 230px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 6px;
  font-size: 11px; color: var(--txt-dim); text-decoration: none; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.src-chip { color: var(--accent-dark); border-color: rgba(0,140,149,0.4); }
a.src-chip:hover { background: var(--accent-soft); }
.src-cell { max-width: 340px; }
.src-row { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.src-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--txt-faint); margin-right: 8px; }
.src-none { color: var(--txt-faint); font-style: italic; font-size: 11.5px; }
.src-type { text-transform: capitalize; color: var(--txt-dim); }
#sources-table a { color: var(--accent-dark); text-decoration: none; }
#sources-table a:hover { text-decoration: underline; }

/* ---------- drawer ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(31,31,31,0.34);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 35;
}
/* Desktop: the panel is modeless — it sits beside the map and the map stays
   fully interactive (pan / zoom / click another person). No dark backdrop. */
.scrim.open { opacity: 0; pointer-events: none; }
/* Reserve room on the right so the panel doesn't cover the map / tables.
   <main> is a stretched item in a column flex container, so a cross-axis margin
   is ignored — padding-right is what actually shrinks its content box. */
main { transition: padding-right .22s ease, padding-bottom .22s ease; }
body.drawer-open main { padding-right: 440px; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 440px; max-width: 92vw;
  background: var(--bg-2); border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow); transform: translateX(100%);
  transition: transform .22s ease; z-index: 36; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-close {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: var(--txt-dim); font-size: 26px; line-height: 1; cursor: pointer;
}
.drawer-close:hover { color: var(--txt); }
/* grab handle — only shown when the drawer is a mobile bottom sheet */
.drawer-grip { display: none; }
#drawer-body { padding: 26px 26px 40px; }
#drawer-body h2 { font-family: var(--font-display); margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; color: var(--ink, var(--txt)); }
#drawer-body .meta-row { color: var(--txt-dim); font-size: 12.5px; margin-bottom: 16px; }
.section-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--txt-faint); margin: 22px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.kv { margin: 6px 0; font-size: 13px; line-height: 1.5; }
.kv b { color: var(--txt-dim); font-weight: 600; }
.rel-item { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin: 7px 0; font-size: 12.5px; }
.rel-item .who { font-weight: 600; }
.rel-item .ev { color: var(--txt-dim); margin-top: 4px; line-height: 1.45; }
.rel-item a { color: var(--accent-dark); text-decoration: none; }
.rel-item a:hover { text-decoration: underline; }
.empty { color: var(--txt-faint); font-style: italic; font-size: 12.5px; }

/* ---------- lineage path (back to Dawson Trotman) ---------- */
.lineage {
  background: linear-gradient(180deg, var(--pale-teal), var(--bg-2));
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin: 4px 0 18px;
}
.lineage .ln-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--accent-dark); font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.lineage .ln-title::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft);
}
.lineage.none, .lineage.is-root { font-size: 13px; color: var(--txt-dim); line-height: 1.5; }
.lineage.is-root b { color: var(--txt); }

.ln-node {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600;
  color: var(--txt); cursor: pointer; transition: border-color .12s, background .12s;
}
.ln-node:hover { border-color: var(--accent); background: var(--accent-soft); }
.ln-node.root { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ln-node.root::before {
  content: "★"; color: var(--gold-deep); font-size: 12px;
}
.ln-node.target { background: var(--accent); color: #fff; border-color: var(--accent); cursor: default; }
.ln-node.target:hover { background: var(--accent); }

.ln-link {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 4px 16px; padding-left: 14px;
  border-left: 2px solid var(--line-2);
  min-height: 26px;
}
.ln-link .ln-arrow { color: var(--accent); font-weight: 700; margin-left: -22px; }
.ln-link .ln-type { font-size: 11.5px; color: var(--txt-dim); font-style: italic; }
.ln-link .badge { font-size: 10px; padding: 1px 7px; }
.ln-alt { margin-top: 10px; font-size: 11.5px; color: var(--txt-faint); }

/* ---------- shareable lineage card ---------- */
.share-cta {
  display: inline-flex; align-items: center; gap: 7px; margin: 2px 0 4px;
  padding: 8px 14px; font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  color: var(--accent-dark); background: var(--accent-soft);
  border: 1px solid rgba(0,140,149,0.4); border-radius: 8px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.share-cta:hover { background: rgba(0,140,149,0.18); border-color: var(--accent); }
.share-cta:active { transform: translateY(1px); }

.share-overlay {
  position: fixed; inset: 0; z-index: 40; display: none;
  align-items: flex-start; justify-content: center; overflow: auto;
  padding: 46px 20px 90px;
  background: rgba(0,52,56,0.62);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
}
.share-overlay.open { display: flex; animation: share-fade .22s ease; }
@keyframes share-fade { from { opacity: 0; } to { opacity: 1; } }

.share-toolbar { position: fixed; top: 18px; right: 22px; display: flex; gap: 10px; z-index: 41; }
.share-btn {
  font: 700 12.5px/1 var(--font-body); letter-spacing: .3px;
  padding: 10px 15px; border-radius: 9px; cursor: pointer; color: #ffffff;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.30);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background .15s, transform .12s;
}
.share-btn:hover { background: rgba(255,255,255,0.24); }
.share-btn:active { transform: translateY(1px); }
.share-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.share-btn.primary:hover { background: var(--accent-dark); }

.share-card {
  position: relative; width: 720px; max-width: 100%;
  font-family: var(--font-body); color: var(--txt);
  background:
    radial-gradient(135% 90% at 50% -12%, #ffffff 0%, #f7fbfb 52%, var(--pale-teal) 100%);
  border-radius: 6px;
  box-shadow: 0 34px 90px rgba(0,40,44,0.42), 0 1px 0 rgba(255,255,255,0.7) inset;
  animation: share-rise .3s cubic-bezier(.2,.7,.3,1);
}
@keyframes share-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
/* engraved double rule, like a certificate — in Navigator teal */
.share-card::before {
  content: ""; position: absolute; inset: 15px; pointer-events: none; border-radius: 4px;
  border: 1px solid rgba(0,140,149,0.40);
  box-shadow: 0 0 0 4px rgba(0,140,149,0.06), inset 0 0 0 4px rgba(255,255,255,0.45);
}
.sc-body { position: relative; z-index: 1; padding: 50px 56px 30px; text-align: center; }

.sc-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  font-weight: 700; color: var(--accent-dark);
}
.sc-eyebrow::before, .sc-eyebrow::after {
  content: ""; height: 1px; width: 64px;
  background: linear-gradient(90deg, transparent, rgba(0,140,149,0.55));
}
.sc-eyebrow::after { background: linear-gradient(90deg, rgba(0,140,149,0.55), transparent); }

.sc-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 50px; line-height: 1.04; letter-spacing: -0.02em;
  margin: 20px 0 0; color: var(--txt);
}
.sc-aka { font-style: italic; font-size: 17px; color: var(--txt-faint); margin-top: 8px; }
.sc-sub {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; font-size: 15px; color: var(--txt-dim);
}
.sc-sub .dates { font-variant-numeric: oldstyle-nums; }
.sc-conf {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
  border: 1px solid transparent;
}
.sc-conf.verified { color: #2f7e45; background: rgba(63,158,90,0.14); border-color: rgba(63,158,90,0.4); }
.sc-conf.qualified { color: var(--gold-deep); background: var(--gold-soft); border-color: rgba(168,127,22,0.42); }
.sc-conf.unverified { color: #b13d36; background: rgba(192,86,79,0.14); border-color: rgba(192,86,79,0.4); }
.sc-conf.unspecified { color: #6f6857; background: rgba(139,132,114,0.14); border-color: rgba(139,132,114,0.38); }

/* hero stat */
.sc-gen { margin: 30px 0 6px; }
.sc-gen .num {
  font-family: var(--font-display); font-weight: 700; font-size: 88px; line-height: .86;
  letter-spacing: -.03em; color: var(--accent-dark);
}
.sc-gen .medallion {
  font-size: 46px; line-height: 1; color: var(--gold-deep);
  text-shadow: 0 2px 6px rgba(210,165,38,0.3);
}
.sc-gen .num sup { font-size: .36em; font-weight: 700; vertical-align: top; margin-left: 3px; color: var(--accent); }
.sc-gen .cap {
  margin-top: 10px; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700;
}
.sc-gen .subcap { margin-top: 8px; font-style: italic; font-size: 13px; color: var(--txt-faint); }

.sc-desc {
  font-size: 17px; line-height: 1.62; color: var(--charcoal, var(--txt-dim));
  max-width: 52ch; margin: 20px auto 0;
}
.sc-note { font-style: italic; font-size: 14px; line-height: 1.55; color: var(--txt-faint); max-width: 52ch; margin: 12px auto 0; }

.sc-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 30px 0 22px; }
.sc-divider::before, .sc-divider::after { content: ""; height: 1px; width: 90px; background: rgba(0,140,149,0.4); }
.sc-divider span { width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.sc-section-h { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700; margin-bottom: 16px; }

/* lineage spine — inline-block (not flex) so the PNG export can't collapse
   pills to min-content width and wrap names like "Dawson / Trotman" */
.sc-lineage { text-align: center; }
.sc-node {
  display: inline-block; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  padding: 9px 22px; border-radius: 30px; background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,140,149,0.4); color: var(--txt); max-width: 92%;
}
.sc-node .star { color: var(--gold-deep); margin-right: 5px; }
.sc-node.root { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.sc-node.target {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 24px rgba(0,140,149,0.38);
}
.sc-link { display: flex; flex-direction: column; align-items: center; padding: 5px 0; }
.sc-link .bar { width: 1.5px; height: 13px; background: rgba(0,140,149,0.5); }
.sc-link .desc { font-style: italic; font-size: 12.5px; color: var(--txt-faint); padding: 3px 0; max-width: 40ch; }
.sc-untraced, .sc-rootcap { font-style: italic; color: var(--txt-faint); font-size: 14.5px; line-height: 1.5; max-width: 46ch; margin: 4px auto 0; }
.sc-rootcap { margin-top: 14px; }

/* other disciplers (not on the path to Dawson) — surfaced subtly */
.sc-also {
  margin: 20px auto 0; max-width: 48ch;
  font-style: italic; font-size: 13.5px;
  color: var(--txt-faint); line-height: 1.6;
}
.sc-also .lbl {
  display: block; margin-bottom: 6px;
  font-style: normal;
  font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700;
}

/* stats strip */
.sc-stats-note {
  margin-top: 28px; text-align: center;
  font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700;
}
.sc-stats { display: flex; margin-top: 10px; border-top: 1px solid rgba(0,140,149,0.3); }
.sc-stat { flex: 1; padding: 18px 10px 6px; }
.sc-stat + .sc-stat { border-left: 1px solid rgba(0,140,149,0.2); }
.sc-stat .n { font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--accent-dark); line-height: 1; }
.sc-stat .l { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700; margin-top: 6px; }
.sc-stat .names { font-style: italic; font-size: 12px; color: var(--txt-dim); margin-top: 8px; line-height: 1.45; }

.sc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(0,140,149,0.3);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); font-weight: 600;
}
.sc-foot .sc-mark {
  display: inline-flex; align-items: center; gap: 8px;
}
.sc-foot .sc-mark::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); box-shadow: inset 0 0 0 3px #ffffff, 0 0 0 1.5px var(--gold);
}

@media (max-width: 760px) {
  .sc-body { padding: 38px 26px 24px; }
  .sc-name { font-size: 38px; }
  .sc-gen .num { font-size: 66px; }
  .sc-stats { flex-direction: column; }
  .sc-stat + .sc-stat { border-left: none; border-top: 1px solid rgba(0,140,149,0.2); }
}

/* ---------- footer ---------- */
.foot { padding: 7px 22px; font-size: 11.5px; color: var(--txt-faint); border-top: 1px solid var(--line); background: var(--bg-2); }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 14px; }
  .stats { margin-left: 0; order: 3; width: 100%; }
  .legend { display: none; }

  /* On phones the person panel becomes a bottom sheet instead of a full-screen
     sidebar, so the map — with the selected person's lineage highlighted — stays
     visible and interactive above it. */
  .drawer {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    height: 46vh; height: 46dvh;
    border-left: none; border-top: 1px solid var(--line-2);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -16px 44px -18px rgba(0,0,0,0.30);
    transform: translateY(100%);
  }
  .drawer.open { transform: translateY(0); }
  /* drag the grip (or tap it) to expand the sheet for the full details */
  .drawer.expanded { height: 88vh; height: 88dvh; }
  .drawer-grip {
    display: flex; align-items: center; justify-content: center;
    position: sticky; top: 0; z-index: 2;
    width: 100%; padding: 10px 0 6px; margin: 0;
    background: var(--bg-2); border: none; cursor: grab;
  }
  .drawer-grip span {
    width: 44px; height: 5px; border-radius: 999px; background: var(--line-2);
  }
  .drawer-close { top: 8px; }
  #drawer-body { padding: 6px 20px 40px; }

  /* keep the map interactive — no dark modal backdrop */
  .scrim.open { opacity: 0; pointer-events: none; }
  /* shrink the map into the space above the sheet so the lineage stays in view */
  body.drawer-open main { padding-right: 0; padding-bottom: 46vh; padding-bottom: 46dvh; }
}

/* ===================================================================
   Consumer shell — shared site nav used across home / map / contribute
   =================================================================== */
.sitenav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 13px 28px;
  background: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sitenav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  letter-spacing: -.01em; color: var(--accent-dark); text-decoration: none;
}
.sitenav-brand .mark { width: 28px; height: 28px; flex: none; }
.sitenav-links { display: flex; align-items: center; gap: 4px; }
.sitenav-links a {
  color: var(--txt-faint); text-decoration: none; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; padding: 8px 13px; border-radius: 9px;
  transition: color .2s, background .2s;
}
.sitenav-links a:hover { color: var(--txt); background: var(--bg-3); }
.sitenav-links a.active { color: var(--accent-dark); background: var(--pale-teal); }
.sitenav-links a.cta {
  color: #fff; background: var(--accent);
  box-shadow: 0 8px 24px -12px rgba(0,111,120,.65);
}
.sitenav-links a.cta:hover { color: #fff; background: var(--accent-dark); }

/* disabled "Add Your Story" — under construction, not yet clickable */
.sitenav-links .soon {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--txt-faint); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 8px 13px; border-radius: 9px; cursor: not-allowed; background: var(--bg-3);
}
.soon-tag {
  font-size: 9px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase;
  color: var(--gold-deep); background: var(--gold-pale); border-radius: 999px; padding: 2px 7px;
}
.btn-lg.disabled {
  background: var(--bg-3); color: var(--txt-faint); border-color: var(--line-2);
  cursor: not-allowed; box-shadow: none; pointer-events: none;
}

/* under-construction banner (contribute page) */
.uc-banner {
  max-width: 580px; margin: 0 auto 16px; display: flex; align-items: center; gap: 11px;
  background: linear-gradient(180deg, var(--gold-pale), #fff); border: 1px solid rgba(168,127,22,0.35);
  border-radius: 14px; padding: 12px 15px; color: var(--gold-deep); font-size: 13.5px; line-height: 1.45;
}
.uc-banner .uc-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; }
.uc-banner .uc-ic svg { width: 17px; height: 17px; }
.uc-banner b { color: var(--ink, var(--txt)); }
/* dim the prototype form behind the banner so it reads as inactive */
.contribute-page .card.inactive { opacity: .55; pointer-events: none; filter: grayscale(0.25); }

/* secondary bar on the map page — title + stats + legend */
.mapbar {
  display: flex; align-items: center; gap: 24px;
  padding: 11px 22px; background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.mapbar .mapbar-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--txt); letter-spacing: -.01em; }
.mapbar .mapbar-title .sub { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: var(--txt-faint); letter-spacing: 0; }
.mapbar .stats { margin-left: auto; }

@media (max-width: 760px) {
  .sitenav { padding: 11px 16px; flex-wrap: wrap; gap: 10px; }
  .sitenav-links a { padding: 7px 9px; font-size: 11.5px; }
  .mapbar { flex-wrap: wrap; gap: 10px; padding: 9px 14px; }
  /* compact the stat cards so the map itself gets the vertical space */
  .mapbar .stats { display: flex; gap: 6px; }
  .mapbar .stat { flex: 1; min-width: 0; padding: 5px 6px; }
  .mapbar .stat .num { font-size: 15px; }
  .mapbar .stat .lbl { font-size: 9.5px; letter-spacing: 0.5px; }
  /* while the person sheet is open, hide the search box so it doesn't cover the lineage */
  body.drawer-open .graph-search { display: none; }
}

/* ===================================================================
   Home page
   =================================================================== */
.home {
  position: relative; flex: 1;
  background:
    radial-gradient(120vw 70vh at 80% -10%, rgba(0,140,149,0.06), transparent 60%),
    radial-gradient(90vw 60vh at 5% 25%, rgba(210,165,38,0.05), transparent 55%),
    var(--bg);
}
.home-wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

.home-hero { padding: 70px 0 30px; text-align: center; }
.home-eyebrow {
  font-size: 12.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--accent-dark); font-weight: 700; margin-bottom: 20px;
}
.home-h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -.02em;
  color: var(--txt); margin: 0 auto; max-width: 16ch;
}
.home-h1 em { font-style: italic; color: var(--accent); }
.home-lead {
  font-size: clamp(17px, 2vw, 20px); color: var(--txt-dim); line-height: 1.6;
  max-width: 60ch; margin: 20px auto 0;
}
.home-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }
.btn-lg {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; letter-spacing: .01em;
  padding: 14px 24px; border-radius: 12px; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .2s, border-color .2s, transform .1s;
}
.btn-lg.primary { background: var(--accent); color: #fff; box-shadow: 0 10px 28px -12px rgba(0,111,120,.65); }
.btn-lg.primary:hover { background: var(--accent-dark); }
.btn-lg.secondary { background: var(--bg-2); color: var(--accent-dark); border-color: var(--line-2); }
.btn-lg.secondary:hover { border-color: var(--accent); background: var(--pale-teal); }
.btn-lg:active { transform: translateY(1px); }

/* graph teaser — clickable LIVE preview that opens the full map */
.teaser { display: block; position: relative; max-width: 880px; margin: 26px auto 0; text-decoration: none; cursor: pointer; }
.teaser-frame {
  position: relative; height: 380px; border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, var(--pale-teal), var(--bg-2) 72%);
  box-shadow: 0 30px 80px -44px rgba(0,0,0,.28);
}
.teaser-frame svg { display: block; width: 100%; height: auto; }
#home-graph { position: absolute; inset: 0; }
/* gentle "loading the live map" hint until the network stabilizes / if it can't load */
#home-graph::after {
  content: "Loading the live map…"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--txt-faint); font-size: 14px; pointer-events: none;
}
#home-graph.ready::after { content: none; }
#home-graph.fallback::after { content: "Open the full interactive map →"; color: var(--accent-dark); font-weight: 600; }
@media (max-width: 760px) { .teaser-frame { height: 300px; } }
.teaser-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 22px;
  background: linear-gradient(180deg, transparent 55%, rgba(255,255,255,0.85));
  transition: background .25s;
}
.teaser:hover .teaser-overlay { background: linear-gradient(180deg, rgba(0,140,149,0.04) 40%, rgba(255,255,255,0.9)); }
.teaser-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  padding: 11px 20px; border-radius: 999px; box-shadow: 0 12px 30px -12px rgba(0,111,120,.7);
  transition: transform .15s, background .2s;
}
.teaser:hover .teaser-pill { transform: translateY(-2px); background: var(--accent-dark); }
.teaser-caption { text-align: center; color: var(--txt-faint); font-size: 14px; margin: 14px auto 0; max-width: 60ch; line-height: 1.55; }
.teaser-caption em { font-style: italic; color: var(--accent-dark); }

/* "what this is" + benefits */
.home-section { padding: 46px 0 10px; border-top: 1px solid var(--line); margin-top: 56px; }
.home-kicker { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-dark); font-weight: 700; text-align: center; margin-bottom: 14px; }
.home-section h2 {
  font-family: var(--font-display); font-weight: 600; text-align: center;
  font-size: clamp(24px, 3.4vw, 36px); line-height: 1.12; letter-spacing: -.015em; color: var(--txt);
  max-width: 22ch; margin: 0 auto;
}
.home-section h2 em { font-style: italic; color: var(--accent); }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 40px 0 0; }
.benefit {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px;
  text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.benefit .b-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 13px;
  background: var(--pale-teal); color: var(--accent-dark);
}
.benefit .b-ic svg { width: 22px; height: 22px; }
.benefit .b-t { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--txt); margin-bottom: 6px; }
.benefit .b-c { font-size: 14px; color: var(--txt-dim); line-height: 1.5; }

.home-cta-row { text-align: center; padding: 44px 0 8px; }
.home-cta-row h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px,3.4vw,34px); letter-spacing: -.015em; color: var(--txt); margin-bottom: 8px; }
.home-cta-row h2 em { font-style: italic; color: var(--accent); }
.home-cta-row p { color: var(--txt-dim); font-size: 16px; margin: 0 auto 24px; max-width: 52ch; line-height: 1.55; }

.home-foot {
  margin-top: 56px; padding: 22px 28px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-size: 12px; color: var(--txt-faint);
}
.home-foot .home-foot-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent-dark); }
.home-foot .home-foot-brand .mark { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .benefits { grid-template-columns: 1fr; }
  .home-hero { padding: 44px 0 20px; }
  .home-foot { flex-direction: column; text-align: center; }
}
