/* ciscomani.org - "a grand archive of memories": white page, archive-ink bands, oxblood (sealing wax) accent,
   aged brass for rules and numerals, Cormorant Garamond headings, Source Serif 4 reading text, Inter for controls.
   Sonoran terracotta stays for migration lines. No cream or paper backgrounds. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #e9ebef;
  --line: #dcdfe4;
  --line-strong: #aab1ba;
  --line-ctl: #7d8591; /* borders of inputs and buttons: 3:1 against white */
  --text: #161a22;
  --muted: #535b67;
  --accent: #7b1e2b;
  --accent-strong: #5c1520;
  --accent-ink: #ffffff;
  --accent-soft: #f7ecee;
  --accent-2: #b4532a;
  --brass: #a67c2e;
  --brass-strong: #80601f;
  --ink: #141922;
  --ink-2: #1f2633;
  --on-ink: #eef0f3;
  --on-ink-muted: #aab2bf;
  --focus: #0b57d0;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --c-verified: #1b6b43;
  --c-probable: #1f5fa8;
  --c-unverified: #b4532a;
  --on-conf: #ffffff;
  --shadow: 0 1px 0 rgba(20, 25, 34, .04), 0 14px 30px -20px rgba(20, 25, 34, .45);
  --radius: 6px;
  --header-h: 68px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --font-body: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #161b23;
    --surface-2: #1b212b;
    --surface-3: #232a35;
    --line: #2a313c;
    --line-strong: #46505e;
    --line-ctl: #6f7a89;
    --text: #ecebe8;
    --muted: #a7aeb9;
    --accent: #e0909b;
    --accent-strong: #f0b2ba;
    --accent-ink: #1c0b0f;
    --accent-soft: #2b1a1f;
    --accent-2: #e8946a;
    --brass: #c9a45c;
    --brass-strong: #dcbd7f;
    --ink: #0a0d12;
    --ink-2: #151b24;
    --on-ink: #eceff3;
    --on-ink-muted: #9aa3b0;
    --focus: #8ab4ff;
    --danger: #ff8a80;
    --danger-soft: #3a1f1d;
    --c-verified: #5cc08a;
    --c-probable: #7fb1ec;
    --c-unverified: #e8946a;
    --on-conf: #0e1411;
    --shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 16px 32px -18px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.125rem/1.7 var(--font-body);
  font-optical-sizing: auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0 0 .45em; letter-spacing: 0; color: var(--text); }
h1 { font-size: clamp(2.6rem, 6vw, 4.1rem); line-height: 1.02; }
h2 { font-size: clamp(1.95rem, 3.6vw, 2.6rem); margin-top: 1.5em; }
h3 { font-size: 1.6rem; margin-top: 1.1em; line-height: 1.15; }
h4 { font-family: var(--font-body); font-weight: 600; line-height: 1.3; margin: 0 0 .5em; font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
code { background: var(--surface-3); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.bare { border: 0; }
.muted { color: var(--muted); }
.small { font-size: .9375rem; }
.block { display: block; }
.grow { flex: 1 1 260px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.req { color: var(--danger); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 3000; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.page { padding-top: 32px; padding-bottom: 56px; }
.prose { max-width: 760px; }
.lead { font-size: clamp(1.125rem, 2.2vw, 1.375rem); line-height: 1.55; max-width: 46rem; }
.eyebrow { text-transform: uppercase; margin: 0 0 .75rem; }
.crumbs { font-size: .9375rem; color: var(--muted); margin-bottom: 12px; }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 2000; }
.header-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; min-height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--line-ctl); background: var(--surface); color: var(--text); cursor: pointer; }
.nav-menu { display: none; width: 100%; padding-bottom: 12px; }
.nav-menu.is-open { display: block; max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.nav-cta { background: var(--accent); color: var(--accent-ink); }
.nav-cta:hover { background: var(--accent-strong); color: var(--accent-ink); }
.nav-cta[aria-current="page"] { background: var(--accent-strong); color: var(--accent-ink); }
.lang-toggle { display: inline-flex; border: 1px solid var(--line-ctl); overflow: hidden; margin-top: 8px; }
.lang-btn { min-width: 52px; min-height: 44px; border: 0; background: var(--surface); color: var(--text); font: 600 1rem var(--font); cursor: pointer; }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media (min-width: 1120px) {
  .nav-toggle { display: none; }
  .nav-menu, .nav-menu.is-open { display: flex; align-items: center; gap: 16px; width: auto; padding: 0; max-height: none; overflow: visible; }
  .nav-list { flex-direction: row; gap: 4px; }
  .lang-toggle { margin: 0; }
}

/* ---------- buttons, inputs, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1.5px solid var(--line-ctl); background: var(--surface); color: var(--text); font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; text-align: center; }
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 1.0625rem; }
.btn-icon { min-width: 46px; padding: 0; font-size: 1.5rem; line-height: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.25rem 0; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.btn-stack .btn { width: 100%; }
.linklike { background: none; border: 0; padding: 10px 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; min-height: 44px; }

.input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-ctl); background: var(--surface); color: var(--text); font: 400 1rem/1.4 var(--font); }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
textarea.input { min-height: 120px; resize: vertical; }
.select { appearance: auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: 1rem; }
.help { color: var(--muted); font-size: .9375rem; margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; }
.check input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.grid-2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .9375rem; font-weight: 600; border: 1.5px solid currentColor; white-space: nowrap; }
.badge-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--badge-c); color: var(--on-conf); font-size: 12px; font-weight: 800; }
.badge.conf-verified, .badge.rel-primary { --badge-c: var(--c-verified); color: var(--c-verified); }
.badge.conf-probable, .badge.rel-secondary { --badge-c: var(--c-probable); color: var(--c-probable); }
.badge.conf-unverified, .badge.rel-user-tree { --badge-c: var(--c-unverified); color: var(--c-unverified); }
.badge.rel-family { --badge-c: var(--accent-2); color: var(--accent-2); }
.chip { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px; background: var(--surface-3); font-size: .9375rem; }

.notice { padding: 14px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); margin: 16px 0; }
.notice p:last-child { margin-bottom: 0; }
.notice-error { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.notice-privacy { background: var(--accent-soft); border-color: var(--accent); }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 20px 0; box-shadow: var(--shadow); }
.card-box h2:first-child { margin-top: 0; }
.loading { display: flex; align-items: center; gap: 12px; padding: 48px 16px; justify-content: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.plain-list { list-style: none; margin: 0 0 1em; padding: 0; }
.plain-list li { padding: 6px 0; }
.plain-list.bullet { list-style: disc; padding-left: 1.25rem; }

/* ---------- picker (combobox) ---------- */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 300; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow: auto; }
.picker-item, .picker-empty { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; }
.picker-item.is-active, .picker-item:hover { background: var(--accent-soft); }
.picker-name { font-weight: 600; }
.picker-meta, .picker-empty { color: var(--muted); font-size: .9375rem; }
.picker-empty { cursor: default; }

/* ---------- home ---------- */
.hero { padding: 48px 0 40px; position: relative; }
.hero-inner { position: relative; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.hero-photo { margin: 0; order: -1; } /* photo first on phones */
.hero-photo img { display: block; width: 100%; height: auto; }
.hero-photo figcaption { margin-top: 10px; font-size: 1rem; color: var(--muted); }
.hero-photo .cap-main, .hero-photo .cap-credit { display: block; }
.hero-photo .cap-credit { margin-top: 2px; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; }
  .hero-photo { order: 0; }
}
.hero h1 { max-width: 18ch; }
.hero-search { max-width: 560px; margin: 24px 0 8px; }
.hero-search .input { min-height: 56px; font-size: 1.125rem; padding-left: 18px; }
.stats { list-style: none; padding: 0; margin: -24px 0 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); }
.stat-n { display: block; }
.stat-l { color: var(--muted); }
.section { padding-top: 24px; padding-bottom: 8px; }
.founder-card { display: grid; gap: 24px; border: 1px solid var(--line); margin-top: 32px; }
.founder-card h2 { margin-top: 0; }
.founder-art svg { width: 100%; max-height: 220px; }
.art-arc { stroke: var(--accent-2); animation: dash 1.4s linear infinite; }
.art-dot { fill: var(--accent); } .art-dot.b { fill: var(--accent-2); }
.art-ring { fill: none; stroke: var(--line-strong); stroke-width: 2; }
@keyframes dash { to { stroke-dashoffset: -32; } }
.route-line { font-weight: 600; }
.arrow { color: var(--accent-2); }
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 16px; }
.step { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step h3 { margin: 0 0 4px; } .step p { margin: 0; color: var(--muted); }
.step-n { flex: none; width: 36px; height: 36px; display: grid; place-items: center; }
/* instructions read top to bottom, not in columns */
.share-tree .steps { grid-template-columns: 1fr; }
.share-tree .step p { color: var(--text); }
@media (min-width: 780px) {
  .founder-card { grid-template-columns: 1.4fr 1fr; align-items: center; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 72px 0 64px; }
}

/* ---------- tool views (tree + map) ---------- */
.tool-view { max-width: 1400px; margin: 0 auto; padding: 14px 16px 28px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin-bottom: 8px; }
.toolbar .field { margin-bottom: 4px; }
.field-btn { justify-content: flex-end; }
.tree-view .toolbar .select { width: auto; min-width: 88px; }
@media (max-width: 720px) {
  .toolbar { gap: 4px 12px; } .legend { gap: 4px 14px; } .tool-view { padding-top: 8px; }
  /* the person picker takes a full row; the three-way switch fills it with equal segments */
  .toolbar .field.grow { flex: 1 1 100%; }
  .toolbar .seg-group { flex: 1 1 100%; }
  .toolbar .seg-row { display: flex; width: 100%; }
  .toolbar .seg { flex: 1; }
  .toolbar .seg span { justify-content: center; text-align: center; padding: 0 6px; }
}
.seg-group { flex: none; }
.seg-row { display: inline-flex; border: 1.5px solid var(--line-ctl); overflow: hidden; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; min-height: 46px; padding: 0 16px; background: var(--surface); font-weight: 600; border-right: 1px solid var(--line); cursor: pointer; }
.seg:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.seg-btn { min-width: 48px; min-height: 40px; border: 0; background: var(--surface); color: var(--text); font: 600 1rem var(--font); cursor: pointer; border-right: 1px solid var(--line); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.small-seg { margin-bottom: 8px; }
.zoom-btns { display: flex; gap: 8px; margin-bottom: 4px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 4px 0 10px; font-size: .9375rem; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--on-conf); }
.legend-dot.conf-verified { background: var(--c-verified); }
.legend-dot.conf-probable { background: var(--c-probable); }
.legend-dot.conf-unverified { background: var(--c-unverified); }
.legend-dot.living { background: var(--muted); border: 2px dashed var(--bg); }

.canvas-wrap { position: relative; isolation: isolate; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; height: clamp(460px, 74vh, 940px); height: clamp(460px, 74dvh, 940px); background: var(--surface-2); }
.tree-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px); background-size: 24px 24px; }
.tree-svg:active { cursor: grabbing; }
.canvas-hint { position: absolute; left: 12px; bottom: 8px; margin: 0; padding: 4px 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 8px; font-size: .9375rem; color: var(--muted); pointer-events: none; }
.link { fill: none; stroke: var(--line-strong); stroke-width: 2.25; }
.marriage { stroke: var(--accent-2); stroke-width: 3; stroke-linecap: round; }
.card { cursor: pointer; outline: none; }
.card .box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2.5; transition: stroke-width .1s; }
.card:hover .box { stroke-width: 4; }
.card.conf-verified .box { stroke: var(--c-verified); }
.card.conf-probable .box { stroke: var(--c-probable); }
.card.conf-unverified .box { stroke: var(--c-unverified); }
.card.conf-verified .mark-bg { fill: var(--c-verified); }
.card.conf-probable .mark-bg { fill: var(--c-probable); }
.card.conf-unverified .mark-bg { fill: var(--c-unverified); }
.card .mark { fill: var(--on-conf); font-weight: 800; font-size: 16px; }
.card .nm { fill: var(--text); font-weight: 600; font-size: 16px; }
.card .sn { fill: var(--text); font-size: 15px; }
.card .dt { fill: var(--muted); font-size: 13px; }
.card.is-living .box { stroke: var(--line-strong); stroke-dasharray: 6 5; fill: var(--surface-2); }
.card.is-living .mark-bg { fill: var(--muted); }
.card.is-living .nm { fill: var(--muted); font-style: italic; }
.card.is-root .box { stroke-width: 4; }
.card.is-selected .box { stroke: var(--accent); stroke-width: 5; }
.card:focus-visible .box { stroke: var(--focus); stroke-width: 5; }
.more rect { fill: var(--surface-3); stroke: var(--line-strong); }
.more text { fill: var(--muted); font-size: 14px; font-weight: 700; }
.tree-svg text { font-family: var(--font); user-select: none; }

.side-panel { position: absolute; z-index: 1100; top: 0; right: 0; bottom: 0; width: min(390px, 100%); overflow: auto; background: var(--surface); border-left: 1px solid var(--line-strong); padding: 20px 20px 24px; box-shadow: var(--shadow); }
.side-panel[hidden] { display: none; }
.side-panel h2 { margin: 0 44px 8px 0; font-size: 1.5rem; }
.side-panel h2:focus { outline: none; }
.panel-close { position: absolute; top: 10px; right: 10px; }
.lifespan { font-weight: 600; margin-bottom: 8px; }
.panel-bio { margin-top: 12px; }
@media (max-width: 720px) {
  .side-panel { top: auto; width: 100%; max-height: 62%; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0; }
  .canvas-hint { display: none; }
}

/* ---------- map ---------- */
.map-canvas { position: absolute; inset: 0; z-index: 0; background: var(--surface-2); font-family: var(--font); }
.map-canvas .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; font-size: 22px; }
.leaflet-container a { color: var(--accent); }
/* Neutralise OSM's warm land colour to match the gray palette */
.map-canvas .leaflet-tile-pane { filter: grayscale(.9) contrast(1.03) brightness(1.02); }
@media (prefers-color-scheme: dark) {
  .map-canvas .leaflet-tile-pane { filter: grayscale(.9) invert(1) hue-rotate(180deg) brightness(.92) contrast(.88); }
}
.leaflet-tooltip { font: 600 .9375rem var(--font); }
.mig-line { stroke-dasharray: 9 11; animation: flow 1.1s linear infinite; stroke-linecap: round; cursor: pointer; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.place-marker { cursor: pointer; }
.map-controls { margin: 12px 0 4px; }
.timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.slider { flex: 1 1 240px; min-width: 160px; height: 36px; accent-color: var(--accent); cursor: pointer; }
.year-label { min-width: 4ch; font-weight: 800; font-size: 1.5rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.tl-end { color: var(--muted); font-size: .9375rem; }
.map-summary { margin: 8px 0 0; color: var(--muted); }
.places-details { margin-top: 12px; } .places-details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.places-list { list-style: none; padding: 0; columns: 2 260px; }
.map-empty { position: absolute; left: 16px; top: 16px; z-index: 1000; margin: 0; }

/* ---------- person ---------- */
.person-head { display: grid; gap: 16px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.person-head h1 { margin-bottom: .2em; }
@media (min-width: 800px) { .person-head { grid-template-columns: 1fr 320px; } .head-actions { margin-top: 0; } }
.bio-text { font-size: 1.1875rem; max-width: 46rem; }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px 20px; margin: 0 0 1em; }
.facts dt { font-weight: 700; margin-top: 10px; }
.facts dd { margin: 0; }
@media (min-width: 640px) { .facts { grid-template-columns: 170px 1fr; } .facts dt { margin-top: 0; padding: 8px 0; } .facts dd { padding: 8px 0; border-bottom: 1px solid var(--line); } .facts dt { border-bottom: 1px solid var(--line); } }
.rel-grid { display: grid; gap: 4px 28px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.rel-grid h3 { margin-top: .6em; font-size: 1.0625rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.person-link { font-weight: 600; }
.person-link.is-redacted { color: var(--muted); font-style: italic; }
.place-trail { padding-left: 1.25rem; } .place-trail li { padding: 4px 0; }
.sources { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.source, .finding, .story-card, .notice { overflow-wrap: anywhere; }
.source { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.source p { margin: 4px 0 0; }
.source-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; font-weight: 600; }
.notes summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.gallery-head h2 { margin: 1em 0 .4em; }
.empty-gallery { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 24px; text-align: center; }
.photo-grid { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--surface-3); }
.photo-btn img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.video-list { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.video-item { margin: 0; } .video-item video { width: 100%; border-radius: 10px; background: #000; }
.story-card { background: var(--surface); border: 1px solid var(--line); max-width: 52rem; }
.story-card h3, .story-card h4 { margin: 0 0 .4em; }

/* ---------- context pictures (Wikimedia Commons) ---------- */
.picture { margin: 0; display: grid; gap: 6px; }
.picture img { display: block; width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--line); }
.picture figcaption { display: grid; gap: 2px; font-size: .9375rem; line-height: 1.45; }
.picture-caption { color: var(--text); }
.picture-credit { color: var(--muted); font-size: .9375rem; font-family: var(--font); }
.picture-credit a { color: inherit; }
.story-card.has-picture .picture { margin-bottom: 14px; }
.story-card .picture img { width: auto; max-width: 100%; max-height: 26rem; }
.picture-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.world-section { margin-top: 32px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px 24px; }
.lb-img { max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; border-radius: 6px; }
.lb-cap { text-align: center; max-width: 52rem; margin-top: 12px; } .lb-cap .muted { color: #c6ccd2; }
.lb-close, .lb-prev, .lb-next { position: fixed; background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .5); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .3); color: #fff; border-color: #fff; }
.lb-close { top: 10px; right: 10px; } .lb-prev { left: 8px; top: 50%; } .lb-next { right: 8px; top: 50%; }
@media (max-width: 600px) { .lightbox figure { padding: 56px 8px 80px; } .lb-prev, .lb-next { top: auto; bottom: 12px; } .lb-prev { left: 12px; } .lb-next { right: 12px; } }

.lead-sm { font-size: 1.1875rem; max-width: 46rem; }
.findings { list-style: none; padding: 0; display: grid; gap: 12px; max-width: 52rem; }
.finding { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--surface); }
.finding p { margin: 0 0 8px; }
.source-line a { overflow-wrap: anywhere; }

/* ---------- contribute ---------- */
.contribute { max-width: 860px; }
.trust-list { padding-left: 1.2rem; color: var(--muted); }
.invite-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.invite-form .field { margin-bottom: 0; }
.type-set legend { float: left; width: 100%; font-weight: 700; font-size: 1.25rem; padding: 0; margin-bottom: 12px; }
.type-set legend + * { clear: both; }
.type-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.type-card { position: relative; display: block; padding: 14px 14px 14px 48px; border: 1.5px solid var(--line-ctl); border-radius: 12px; cursor: pointer; background: var(--surface); min-height: 76px; }
.type-card input { position: absolute; left: 14px; top: 16px; width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.type-card:hover { border-color: var(--text); }
.type-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.type-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.type-title { display: block; font-weight: 700; }
.type-desc { display: block; color: var(--muted); font-size: .9375rem; line-height: 1.4; }
.file-input { padding: 10px; border: 1.5px dashed var(--line-ctl); border-radius: 10px; width: 100%; background: var(--surface-2); font: inherit; min-height: 56px; }
.preview { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.preview img, .preview video { max-height: 320px; border-radius: 8px; display: block; margin-bottom: 8px; }
.progress-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.progress { flex: 1; height: 16px; accent-color: var(--accent); }
.progress-text { font-weight: 700; min-width: 4ch; }
.success h2 { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); padding: 28px 0 40px; margin-top: 24px; }
.footer-inner p { margin: 0 0 8px; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0; margin: 0 0 8px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

body.immersive .site-footer { margin-top: 0; }

/* ---------- contributor profile: levels and badges ---------- */
.medal { display: block; flex: none; }
.medal-disc { fill: var(--medal-c, var(--accent)); }
.medal-ring { fill: none; stroke: #fff; stroke-opacity: .45; stroke-width: 1.5; }
.medal-glyph path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medal.is-locked .medal-disc { fill: var(--surface-3); }
.medal.is-locked .medal-ring { stroke: var(--line-strong); stroke-opacity: 1; stroke-dasharray: 3 3; }
.medal.is-locked .medal-glyph path { stroke: var(--line-strong); }
.medal-seed { --medal-c: #8a6a3a; }
.medal-sprout { --medal-c: #4f9d5d; }
.medal-branch { --medal-c: #1b6b43; }
.medal-trunk { --medal-c: #7a4e2d; }
.medal-roots { --medal-c: #b4532a; }
.medal-great_tree { --medal-c: #b8901c; }
.medal-genealogist { --medal-c: #1b6b43; }
.medal-connector { --medal-c: #1f5fa8; }
.medal-album { --medal-c: #b4532a; }
.medal-storyteller { --medal-c: #6b4fa0; }
.medal-detective { --medal-c: #a06a00; }
.medal-archivist { --medal-c: #4a5a6a; }

.profile h2 { margin: 2rem 0 .75rem; }
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.profile-head h1 { margin: 0 0 .25rem; }
.profile-head .eyebrow { margin-bottom: .35rem; }
.profile-medal { flex: none; position: relative; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.profile-avatar { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 2.25rem; font-weight: 800; }
.profile-sub { font-size: 1.125rem; margin: 0; line-height: 1.8; }
.profile-chip { display: inline-block; line-height: 1.5; margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .9375rem; font-weight: 600; }

.level-card { display: grid; grid-template-columns: auto 1fr; gap: 8px 28px; align-items: center; }
.level-total { display: grid; justify-items: start; }
.level-num { font-size: 3.25rem; line-height: 1; color: var(--accent); }
.level-label { color: var(--muted); font-weight: 600; }
.level-progress p { margin: 10px 0 0; font-weight: 500; }
.level-pending { grid-column: 1 / -1; margin: 0; }
.meter { height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-sm { height: 8px; margin-top: 6px; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); min-width: 0; transition: width .4s ease-out; }

.pstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pstat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; }
.pstat-num { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.pstat-label { color: var(--muted); font-weight: 500; }
.pstat.is-zero .pstat-num { color: var(--muted); }

.level-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; position: relative; }
.level-path li { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 14px 6px; border-radius: 12px; }
.level-path li strong { font-size: 1rem; }
.level-path li:not(.is-earned) strong { color: var(--muted); }
.level-path li.is-next { background: var(--surface-2); outline: 2px dashed var(--line-strong); outline-offset: -2px; }

.h-count { font-size: 1rem; font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.badge-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.badge-card.is-earned { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.badge-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.badge-text strong { font-size: 1.0625rem; }
.badge-count { color: var(--muted); font-weight: 600; margin-top: 4px; }
.badge-card.is-earned .badge-count { color: var(--accent); }

.recent-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.recent-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.recent-list li:first-child { border-top: 0; }
.recent-main { flex: 1; min-width: 200px; overflow-wrap: anywhere; }
.recent-status { font-size: .875rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.recent-status.s-approved { background: var(--accent-soft); color: var(--accent); }
.recent-status.s-pending { background: var(--surface-3); color: var(--muted); }
.recent-date { white-space: nowrap; }

.profile-empty { text-align: center; max-width: 640px; margin: 40px auto; padding: 36px 24px; }
.profile-empty-medal { display: flex; justify-content: center; margin-bottom: 12px; }
.profile-empty .lead { margin: 0 auto; }
.profile-empty .btn-row { justify-content: center; }

@media (max-width: 760px) {
  .level-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .profile-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .level-card { grid-template-columns: 1fr; }
  .level-num { font-size: 2.75rem; }
}

/* ---------- top contributors panel ---------- */
.home-layout, .contribute-layout { display: grid; gap: 8px 32px; align-items: start; }
.home-main { min-width: 0; }
.contribute-layout .contribute { min-width: 0; }
@media (min-width: 1000px) {
  .home-layout, .contribute-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .board { position: sticky; top: calc(var(--header-h) + 16px); }
}
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 32px; }
.home-layout .board { margin-top: 56px; } /* level with the founder card */
.contribute-layout .board { margin-top: 12px; }
.board-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.board-head h2 { margin: 0 0 2px; }
.board-head p { margin: 0; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board-row { display: grid; grid-template-columns: 26px 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; }
.board-rank { text-align: center; color: var(--muted); }
.rank-1 .board-rank { color: #8f6d12; } /* 4.4:1 on the light row, 3.4:1 on the dark one */
.rank-2 .board-rank { color: #7d868f; }
.rank-3 .board-rank { color: #a0643a; }
.board-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9375rem; }
.board-who { display: grid; min-width: 0; line-height: 1.35; }
.board-who strong { overflow-wrap: anywhere; }
.board-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.board-badge { display: inline-flex; }
.board-foot { display: grid; gap: 10px; margin-top: 14px; }
.board-foot p { margin: 0; }
.board-mine { font-weight: 600; text-align: center; }

.board-pref p { margin: 0 0 12px; }
.switch-line { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line-ctl); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch:disabled { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .mig-line, .art-arc, .spinner { animation: none; }
  .btn, .card .box { transition: none; }
}

/* ---------- profile: name and photo ---------- */
.identity-grid { display: grid; gap: 20px 32px; margin-top: 8px; }
@media (min-width: 760px) { .identity-grid { grid-template-columns: 1fr 1fr; } }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.identity-row { display: flex; flex-wrap: wrap; gap: 10px; }
.identity-row input { flex: 1 1 14rem; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line-ctl); border-radius: 10px; background: var(--surface); color: var(--text); }
.identity-photo-box { display: flex; gap: 16px; align-items: flex-start; }
.identity-photo { flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; }
.identity-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.identity-photo .profile-avatar { width: 96px; height: 96px; font-size: 1.75rem; }
.identity .btn-row { margin: 8px 0 4px; }
.identity .btn-row:focus-within label.btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-error { color: var(--danger); font-weight: 600; }
.profile-photo { display: block; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); }
.profile-photo-medal { position: absolute; right: -8px; bottom: -8px; line-height: 0; }
.board-face { position: relative; display: inline-block; width: 40px; height: 40px; }
.board-photo { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.board-face-medal { position: absolute; right: -6px; bottom: -6px; line-height: 0; }


/* =====================================================================
   Grand archive layer
   ===================================================================== */

/* controls stay in Inter so forms and buttons read clearly */
button, input, select, textarea, .btn, .nav-link, .lang-btn, .seg span, .seg-btn, .chip, .badge, .board-rank,
.pstat-label, .level-label, .stat-l, .eyebrow, .crumbs, .legend, .toolbar, label, .field-label { font-family: var(--font); }

::selection { background: color-mix(in srgb, var(--brass) 35%, transparent); }
a { text-decoration-thickness: 1px; }
::placeholder { color: var(--muted); opacity: 1; }

/* catalogue label: a brass rule, then letter-spaced capitals */
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--brass-strong); font-weight: 600; letter-spacing: .18em; font-size: .9375rem; }
.eyebrow::before { content: ''; flex: none; width: 34px; height: 1px; background: var(--brass); }
.lead { font-family: var(--font-body); font-style: italic; color: var(--muted); }

/* ---------- header: archive ink band with a brass hairline ---------- */
.site-header { background: var(--ink); backdrop-filter: none; border-bottom: 0; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brass) 70%, transparent), 0 1px 0 rgba(0, 0, 0, .25); color: var(--on-ink); }
.brand { color: var(--brass); }
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: .2em; text-transform: uppercase; color: var(--on-ink); }
.site-header .nav-toggle { background: transparent; color: var(--on-ink); border-color: var(--line-ctl); border-radius: 4px; }
.site-header .nav-link { color: var(--on-ink); font-weight: 500; border-radius: 4px; }
.site-header .nav-link:hover { background: var(--ink-2); color: #fff; }
.site-header .nav-link[aria-current="page"] { background: transparent; color: #fff; box-shadow: inset 0 -2px 0 var(--brass); border-radius: 0; }
.site-header .nav-cta { background: var(--brass); color: var(--ink); font-weight: 600; border-radius: 4px; }
.site-header .nav-cta:hover, .site-header .nav-cta[aria-current="page"] { background: color-mix(in srgb, var(--brass) 80%, #fff); color: var(--ink); box-shadow: none; border-radius: 4px; }
.site-header .lang-toggle { border-color: var(--line-ctl); border-radius: 4px; }
.site-header .lang-btn { background: transparent; color: var(--on-ink-muted); }
.site-header .lang-btn[aria-pressed="true"] { background: var(--on-ink); color: var(--ink); }
.site-header .nav-link:focus-visible, .site-header .lang-btn:focus-visible, .site-header .brand:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .site-header .nav-cta { color: var(--ink); } }

/* ---------- buttons and fields: quieter corners ---------- */
.btn { border-radius: 4px; letter-spacing: .01em; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-outline { border-color: var(--text); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--text); color: var(--text); }
input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="url"], select, textarea, .input, .select { border-radius: 4px; }
.seg-row, .lang-toggle, .nav-toggle { border-radius: 4px; }

/* ---------- hero: a matted portrait ---------- */
.hero { background: var(--bg); border-bottom: 1px solid var(--line); }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--line); }
.hero-photo img { border-radius: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 24px 40px -26px rgba(20, 25, 34, .6); }
.hero-photo figcaption { font-style: italic; }
.hero-photo .cap-credit { font-style: normal; font-family: var(--font); font-size: .9375rem; }

/* ---------- cards: index cards with a double brass rule ---------- */
.card-box, .stat, .step, .board { border-radius: var(--radius); }
.card-box h2, .board-head h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
.stat { border-top: 3px double var(--brass); padding: 20px 12px 16px; }
.stat-n { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.25rem, 6vw, 3.4rem); color: var(--accent); line-height: 1; }
.stat-l { text-transform: uppercase; letter-spacing: .14em; font-size: .875rem; font-weight: 600; }
.founder-card { background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 7px var(--surface), inset 0 0 0 8px var(--line), var(--shadow); padding: 34px; }
.step-n { border-radius: 2px; background: var(--ink); color: var(--on-ink); font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.step { border-top: 3px double var(--brass); }

/* the story: archive cards */
.story-card { border-left: 0; border-top: 3px double var(--brass); border-radius: var(--radius); padding: 22px 26px 18px; box-shadow: var(--shadow); }
.story-card.hypothesis { border-top: 3px dashed var(--accent-2); } /* conjecture, not fact: dashed terracotta rule instead of the brass double rule */
.story-card h3 { font-size: clamp(1.55rem, 2.6vw, 1.9rem); margin-top: 0; }
.story-card h3 + .muted.small { font-family: var(--font); text-transform: uppercase; letter-spacing: .16em; font-size: .875rem; color: var(--brass-strong); margin-top: -4px; }
.story-card .picture img { border-radius: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); }
.source-line { font-family: var(--font); }
.story-list { display: grid; gap: 22px; }

/* person page */
.lifespan { font-family: var(--font-display); font-size: 1.5rem; color: var(--brass-strong); }
.facts dt { font-family: var(--font); text-transform: uppercase; letter-spacing: .12em; font-size: .875rem; color: var(--muted); }
.picture img { border-radius: 2px; }

/* top contributors */
.board { border-top: 3px double var(--brass); }
.board-row.rank-1, .board-row.rank-2, .board-row.rank-3 { background: var(--surface-2); border-radius: 4px; }
.board-rank { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }

/* profile */
.profile h2, .profile .card-box h2 { font-size: 1.5rem; } /* card headings match the other section headings */
.profile-head h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); }
.level-num { font-family: var(--font-display); font-weight: 600; }

/* ---------- footer: the archive's colophon ---------- */
.site-footer { background: var(--ink); color: var(--on-ink-muted); border-top: 0; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--brass) 70%, transparent); padding: 36px 0 44px; }
.site-footer .brand-text { color: var(--on-ink); font-size: 1.15rem; }
.site-footer a { color: var(--on-ink); }
.site-footer a:hover { color: var(--brass); }
.site-footer .muted { color: var(--on-ink-muted); }
.stat-n, .step-n, .level-num, .board-rank, .year-label { font-variant-numeric: lining-nums tabular-nums; }
.step h3 { font-size: 1.55rem; margin-bottom: 6px; }
.step p { font-size: 1.0625rem; }

/* ---------- editor: direct edit ---------- */
.btn-edit { font-size: 1.125rem; min-height: 56px; letter-spacing: .02em; }
.edit-panel { border-top: 3px double var(--brass); margin-top: 8px; }
.edit-grid { display: grid; gap: 0 20px; }
@media (min-width: 760px) { .edit-grid { grid-template-columns: 1fr 1fr; } .edit-event-row { grid-template-columns: 1fr 1.4fr; } }
.edit-event { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; margin: 4px 0 18px; }
.edit-event legend { font-family: var(--font); font-weight: 700; padding: 0 6px; }
.edit-event-row { display: grid; gap: 0 16px; }
.edit-event .field { margin-bottom: 8px; }
.check-line { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--accent); }
.field-help { margin: 0; }
.edit-form textarea.input { font-family: var(--font-body); font-size: 1.0625rem; }
.panel-edit { width: 100%; margin: 4px 0 12px; }

/* ---------- small screens, notches, missing media ---------- */
code, h1, .picker-name, .person-link { overflow-wrap: anywhere; }
.picker-name { min-width: 0; }
.header-inner, .container, .tool-view { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.media-missing { display: grid; place-items: center; min-height: 96px; padding: 12px; background: var(--surface-3); color: var(--muted); font-size: .9375rem; text-align: center; }
.media-missing[hidden] { display: none; }
.photo-btn .media-missing { aspect-ratio: 4 / 3; }
.lb-missing { margin: 0; padding: 32px 24px; border-radius: 6px; background: rgba(255, 255, 255, .12); color: #e3e7ea; }
@media (max-width: 479px) {
  .founder-card { padding: 22px 18px; }
  .identity-photo-box { flex-direction: column; }
  .stats { gap: 8px; }
  .stat-l { letter-spacing: .06em; }
}

.edit-slot { scroll-margin-top: calc(var(--header-h) + 12px); }

/* desktop header: brand, six links (Spanish, with "Mis insignias") and the language toggle fit in one row of 1088px */
@media (min-width: 1120px) {
  .site-header .nav-link { padding: 0 10px; white-space: nowrap; }
  .nav-list { gap: 2px; }
  .nav-menu, .nav-menu.is-open { gap: 12px; }
}

/* signed-in line on the contribute page */
.signed-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.signed-in .signed-in-who { margin: 0; font-size: 1.125rem; }
.signed-in .btn-row { margin: 0; }
.signed-as { font-size: 1.0625rem; }

/* search results: who the person is the child or spouse of */
.picker-main { display: flex; flex-direction: column; min-width: 0; }
.picker-kin { color: var(--muted); font-size: .9375rem; }

/* close-family chart under a person picker (contribute form) */
.kin { margin: 14px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin: 0 0 14px; font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; }
.kin-head a { font-family: var(--font); font-size: 1rem; font-weight: 500; }
.kin-tier { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 8px; }
.kin-sibs { margin-bottom: 8px; }
.kin-stem { width: 2px; height: 18px; margin: 6px auto; background: var(--line-strong); }
/* equal widths: two to a row on a phone, three or more on a computer */
.kin-node { flex: 1 1 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; max-width: 220px; margin: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; }
button.kin-node { cursor: pointer; }
button.kin-node:hover { border-color: var(--accent); background: var(--accent-soft); }
.kin-node.is-self { border: 2px solid var(--accent); background: var(--accent-soft); }
.kin-node.is-ghost { border: 2px dashed var(--brass-strong); background: transparent; }
.kin-node.is-match { border: 2px solid var(--c-unverified); }
.kin-sibs .kin-node { border-color: var(--line); }
.kin-role, .kin-years { color: var(--muted); font-size: .9375rem; }
.kin-name { font-weight: 600; overflow-wrap: anywhere; }
.kin-more { flex: 0 0 auto; align-self: center; color: var(--muted); }
.kin-note { margin: 12px 0 0; }
.kin-warn { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--c-unverified); background: var(--danger-soft); color: var(--text); }
.kin-pair { display: grid; gap: 12px; margin: 0 0 16px; }
.kin-slot { margin: 0 0 16px; }
.kin-slot .kin, .kin-pair .kin { margin: 0; }
@media (max-width: 480px) { .kin { padding: 12px; } }

/* editors: whether a kind of contribution goes live in their branch or goes to the admin */
.type-flow { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--text); font-size: .9375rem; font-weight: 600; }
.type-flow.is-live { background: var(--accent-soft); color: var(--accent); }
.flow-hint.is-live { background: var(--accent-soft); border-color: var(--accent); }

/* static pages from data/build-pages.mjs: language links instead of buttons, breadcrumb, founder photo */
a.lang-btn, span.lang-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.lang-btn[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.site-header .lang-btn[aria-current="page"] { background: var(--on-ink); color: var(--ink); }
.breadcrumb { margin: 0 0 16px; }
.static-photo { max-width: 760px; margin: 24px 0 8px; }
