/* ==========================================================================
   The Ballí Family Archive — sample family site (Skeleton Files)
   Warm archival theme: ivory paper, ink, oxblood, aged gold.
   ========================================================================== */

:root {
  --paper: #f5efe3;
  --paper-2: #eee5d2;
  --paper-3: #e6d9bf;
  --card: #fbf7ee;
  --card-2: #fffcf6;
  --ink: #1f1a14;
  --ink-2: #463c31;
  --muted: #675a4c;
  --accent: #7b2d26;
  --accent-2: #5d201a;
  --gold: #b08d57;
  --gold-dark: #8c6a3a;
  --gold-soft: rgba(176, 141, 87, 0.42);
  --line: rgba(120, 94, 60, 0.24);
  --dotted: rgba(120, 94, 60, 0.36);

  --v: #2f5d3a;  --v-bg: rgba(47, 93, 58, 0.08);
  --p: #2e4a6b;  --p-bg: rgba(46, 74, 107, 0.08);
  --r: #855600;  --r-bg: rgba(160, 110, 10, 0.1);
  --u: #655c52;

  --serif-d: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --serif: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;

  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 10px 26px -14px rgba(60, 40, 20, 0.32);
  --shadow-lg: 0 2px 6px rgba(60, 40, 20, 0.08), 0 30px 60px -30px rgba(60, 40, 20, 0.45);
  --radius: 3px;
  --head-h: 76px;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 18px);
  background: var(--paper);
}
body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image:
    var(--grain),
    radial-gradient(ellipse 90% 60% at 15% 0%, rgba(255, 251, 241, 0.9), rgba(255, 251, 241, 0) 70%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(214, 194, 155, 0.3), rgba(214, 194, 155, 0) 70%);
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(123, 45, 38, 0.18); }
q { quotes: "“" "”" "‘" "’"; }
q[lang="es"], i[lang="es"] { font-style: italic; }
html.modal-open { overflow: hidden; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 400; background: var(--ink); color: var(--paper); padding: 8px 14px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* ---------- sample ribbon ---------- */
.ribbon { background: #1c1712; color: #e9dfcc; font-size: 14.5px; line-height: 1.45; position: relative; z-index: 60; }
.ribbon-inner { display: flex; align-items: center; gap: 14px; padding-top: 9px; padding-bottom: 9px; }
.ribbon-tag {
  flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: #1c1712; background: #d9bf86; padding: 5px 8px 4px 10px; border-radius: 2px; line-height: 1;
}
.ribbon p { margin: 0; flex: 1; min-width: 0; }
.ribbon-back { color: #f2e2bd; white-space: nowrap; text-decoration-color: rgba(217, 191, 134, 0.55); }
.ribbon-back:hover { color: #fff3d6; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 239, 227, 0.93);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s ease;
}
.site-head.scrolled { box-shadow: 0 10px 30px -22px rgba(60, 40, 20, 0.6); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--head-h); }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-crest { width: 46px; height: 46px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-name { font-family: var(--serif-d); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: 0.005em; }
.lock-pill {
  display: inline-flex; align-items: center; gap: 6px; width: max-content;
  font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; line-height: 1;
  color: var(--accent); border: 1px solid rgba(123, 45, 38, 0.32); background: rgba(123, 45, 38, 0.05);
  border-radius: 99px; padding: 4px 10px 3px 8px;
}
.lock-pill svg { width: 10px; height: 10px; flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.site-nav a {
  position: relative; display: block; padding: 8px 11px; white-space: nowrap;
  font-size: 16px; color: var(--ink-2); text-decoration: none; border-radius: 2px;
}
.site-nav a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.28s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); }
.site-nav a[aria-current] { color: var(--accent); }

/* ---------- shared bits ---------- */
.kicker {
  margin: 0 0 10px; font-size: 13px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.kicker .num { font-family: var(--serif-d); font-style: italic; font-weight: 600; font-size: 18px; letter-spacing: 0.04em; margin-right: 10px; color: var(--gold-dark); text-transform: none; }
.kicker.center { text-align: center; }
.mini-head {
  margin: 0 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--gold-soft);
  font-family: var(--serif); font-size: 12.5px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent);
}
.credit { display: block; font-style: normal; font-size: 12.5px; letter-spacing: 0.03em; color: var(--muted); margin-top: 3px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; white-space: nowrap;
  font-family: var(--serif); font-size: 10.5px; font-weight: 600; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; font-style: normal;
  padding: 4px 7px 3px 6px; border-radius: 2px; border: 1px solid currentColor;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; transform: translateY(-0.5px); }
.badge.v { color: var(--v); background: var(--v-bg); }
.badge.p { color: var(--p); background: var(--p-bg); }
.badge.r { color: var(--r); background: var(--r-bg); }
.badge.u { color: var(--u); border-style: dashed; background: transparent; }
.badge.u::before { background: transparent; box-shadow: inset 0 0 0 1.3px currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0 !important; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.3;
  font-size: 13px; letter-spacing: 0.02em; padding: 4px 10px 3px 9px; border-radius: 99px; border: 1px solid currentColor;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.v { color: var(--v); background: var(--v-bg); }
.chip.p { color: var(--p); background: var(--p-bg); }
.chip.r { color: var(--r); background: var(--r-bg); }
.chip.u { color: var(--u); border-style: dashed; }
.chip.u::before { background: transparent; box-shadow: inset 0 0 0 1.2px currentColor; }

.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif-d); font-style: italic; font-weight: 600; font-size: 22px; letter-spacing: 0.02em; color: var(--accent);
  background: radial-gradient(circle at 35% 30%, #fffaf0, #eee1c5);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 3px var(--card-2), 0 0 0 4px rgba(176, 141, 87, 0.5);
}
.crest-avatar { background: none; box-shadow: none; }
.crest-avatar svg { width: 62px; height: 62px; display: block; filter: drop-shadow(0 3px 6px rgba(93, 32, 26, 0.25)); }

/* ---------- sections ---------- */
.section { padding: 96px 0; position: relative; }
.sec-head { text-align: center; max-width: 780px; margin: 0 auto 46px; }
.sec-head h2 {
  margin: 0 0 14px; font-family: var(--serif-d); font-weight: 600;
  font-size: clamp(34px, 4.6vw, 54px); line-height: 1.06; letter-spacing: -0.005em; color: var(--ink);
}
.sec-head h2::after {
  content: ""; display: block; width: 150px; height: 12px; margin: 18px auto 0;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 12'%3E%3Cpath d='M0 6h62M88 6h62' stroke='%23b08d57' stroke-width='1'/%3E%3Cpath d='M75 1l5 5-5 5-5-5z' fill='none' stroke='%23b08d57'/%3E%3Ccircle cx='75' cy='6' r='1.6' fill='%237b2d26'/%3E%3Ccircle cx='65' cy='6' r='1.2' fill='%23b08d57'/%3E%3Ccircle cx='85' cy='6' r='1.2' fill='%23b08d57'/%3E%3C/svg%3E");
}
.lede { margin: 0; font-size: 20px; font-style: italic; color: var(--ink-2); line-height: 1.5; }
.band {
  background: linear-gradient(180deg, rgba(230, 217, 191, 0.55), rgba(230, 217, 191, 0.28));
  border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft);
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 56px 0 30px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40px 0 0; pointer-events: none;
  background: url(img/cameron-map-1884.jpg) 50% 38% / cover no-repeat;
  opacity: 0.085; filter: sepia(1) contrast(1.15);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 45%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 45%, #000 20%, transparent 78%);
}
.hero-frame {
  position: relative; max-width: 960px; margin: 0 auto; text-align: center;
  padding: 50px 56px 40px;
  background: rgba(252, 248, 240, 0.62);
  border: 1px solid var(--gold-soft);
  outline: 1px solid var(--gold-soft); outline-offset: 7px;
}
.hero-frame::before, .hero-frame::after {
  content: ""; position: absolute; width: 11px; height: 11px; top: -6px;
  background: var(--paper); border: 1px solid var(--gold); transform: rotate(45deg);
}
.hero-frame::before { left: calc(50% - 6px); }
.hero-frame::after { top: auto; bottom: -6px; left: calc(50% - 6px); }
.hero-crest { width: 84px; height: 84px; display: block; margin: 0 auto 16px; filter: drop-shadow(0 6px 14px rgba(93, 32, 26, 0.28)); }
.hero-kicker { margin: 0; font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent); }
.hero h1 {
  margin: 8px 0 12px; font-family: var(--serif-d); font-weight: 600;
  font-size: clamp(58px, 10vw, 124px); line-height: 0.95; letter-spacing: -0.01em; color: var(--ink);
}
.h1-the { display: block; font-size: 0.3em; font-style: italic; font-weight: 500; letter-spacing: 0.04em; color: var(--accent); margin-bottom: 4px; }
.h1-fam { font-style: italic; font-weight: 500; color: var(--accent-2); }
.hero-places { margin: 0 0 6px; font-size: 15.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-2); }
.hero-places span[aria-hidden] { color: var(--gold); font-size: 9px; vertical-align: 3px; margin: 0 10px; letter-spacing: 0; }
.hero-era { margin: 0 0 22px; font-style: italic; color: var(--muted); font-size: 17.5px; }
.hero-intro { max-width: 650px; margin: 0 auto 30px; font-size: 19.5px; color: var(--ink-2); }

.stats { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 780px; border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); }
.stats li + li { border-left: 1px solid var(--gold-soft); }
.stats a { display: flex; flex-direction: column; align-items: center; padding: 16px 10px 14px; text-decoration: none; color: var(--ink); height: 100%; transition: background 0.25s; }
.stats a:hover { background: rgba(123, 45, 38, 0.045); }
.stats b { font-family: var(--serif-d); font-weight: 600; font-size: 46px; line-height: 1; color: var(--accent); }
.stats span { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); margin-top: 6px; }
.stats small { font-size: 13.5px; font-style: italic; color: var(--muted); margin-top: 3px; line-height: 1.25; }

/* ---------- family tree ---------- */
.legend { list-style: none; margin: -14px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; font-size: 15px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }

.tree { position: relative; margin-top: 46px; }
.tree-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.tree-lines .ln { fill: none; stroke: #a7834d; stroke-width: 1.4; }
.tree-lines .dash { stroke: #8f7f6a; stroke-dasharray: 5 5; }
.tree-lines .q { fill: #f5efe3; stroke: #8f7f6a; stroke-width: 1.2; stroke-dasharray: 3 3; }
.tree-lines .qt { font-family: var(--serif-d); font-weight: 600; font-style: italic; font-size: 16px; fill: #675a4c; }
.tree-lines .qlabel { font-family: var(--serif); font-style: italic; font-size: 14px; fill: #675a4c; }

.gen {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 92px repeat(12, minmax(0, 1fr)); column-gap: 16px; align-items: stretch;
}
.gen > * { grid-row: 1; }
.gen + .gen { margin-top: 66px; }
.gen-label { grid-column: 1; align-self: center; margin: 0; line-height: 1.2; }
.gen-num { display: block; font-family: var(--serif-d); font-style: italic; font-weight: 600; font-size: 32px; line-height: 1; color: var(--gold-dark); }
.gen-word { display: block; margin-top: 4px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.pos-a { grid-column: 3 / 7; }
.pos-b { grid-column: 9 / 13; }
.pos-1 { grid-column: 2 / 6; }
.pos-2 { grid-column: 6 / 10; }
.pos-3 { grid-column: 10 / 14; }
.pos-n { grid-column: 8 / 12; }
.pos-k { grid-column: 2 / 6; }
.knot { grid-column: 7 / 9; justify-self: center; align-self: center; position: relative; z-index: 2; padding: 2px 4px; background: var(--paper); color: var(--gold-dark); line-height: 0; border-radius: 8px; }
.knot svg { width: 28px; height: 16px; display: block; }

.person {
  position: relative; display: flex; align-items: center; gap: 15px; min-width: 0; min-height: 120px;
  padding: 16px 18px 16px 16px;
  color: var(--ink); text-decoration: none;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}
.person::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(176, 141, 87, 0.2); border-radius: 1px; pointer-events: none; }
.person:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 2px 4px rgba(60, 40, 20, 0.08), 0 20px 36px -18px rgba(60, 40, 20, 0.42); }
.person:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.p-body { display: flex; flex-direction: column; min-width: 0; }
.p-role { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); line-height: 1.35; }
.p-name { margin: 3px 0 1px; font-family: var(--serif-d); font-weight: 600; font-size: 22px; line-height: 1.1; }
.p-dates { font-style: italic; font-size: 16px; color: var(--ink-2); line-height: 1.3; }
.dots { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.dot { display: block; width: 8px; height: 8px; border-radius: 50%; }
.dot.v { background: var(--v); }
.dot.p { background: var(--p); }
.dot.r { background: var(--r); }
.dot.u { box-shadow: inset 0 0 0 1.4px var(--u); }
.p-open {
  position: absolute; right: 13px; bottom: 10px; font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent);
  opacity: 0; transform: translateX(-4px); transition: opacity 0.25s, transform 0.25s;
}
.p-open::after { content: " →"; }
.person:hover .p-open, .person:focus-visible .p-open { opacity: 1; transform: none; }

.person.featured {
  background: linear-gradient(180deg, #fffdf8, #f7ecdb);
  border-color: rgba(123, 45, 38, 0.5);
  box-shadow: 0 0 0 3px rgba(123, 45, 38, 0.07), var(--shadow);
}
.person.featured::before { border-color: rgba(123, 45, 38, 0.18); }
.person.featured::after {
  content: "Featured file"; position: absolute; top: -10px; left: 16px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; line-height: 1;
  color: #fbf2e2; background: var(--accent); padding: 4px 8px 3px; border-radius: 2px;
}
.person.featured .p-name { color: var(--accent-2); }
.person.placeholder { background: rgba(251, 247, 238, 0.4); border: 1.5px dashed rgba(103, 90, 76, 0.55); box-shadow: none; }
.person.placeholder::before { display: none; }
.person.placeholder .avatar { background: transparent; box-shadow: none; border: 1.5px dashed rgba(103, 90, 76, 0.6); color: var(--muted); font-style: normal; }
.person.placeholder .p-name { font-style: italic; font-weight: 500; color: var(--ink-2); }
.person.placeholder:hover { background: rgba(251, 247, 238, 0.8); }

.tree-key { align-self: center; padding: 6px 0 6px 18px; border-left: 2px solid var(--gold-soft); font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.tree-key p { margin: 0 0 5px; }
.tree-key-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.key-line { display: inline-block; width: 30px; border-top: 1.5px solid #a7834d; vertical-align: middle; margin-right: 9px; }
.key-line.dashed { border-top: 1.5px dashed #8f7f6a; }
.tree-key .tree-key-note { margin-top: 8px; font-style: italic; color: var(--muted); font-size: 14.5px; }

/* ---------- person files (no-JS section; inside drawer with JS) ---------- */
.js .profiles { display: none; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.profile { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.pf-head { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--gold-soft); }
.pf-head .avatar { width: 70px; height: 70px; font-size: 27px; }
.pf-head .crest-avatar svg { width: 76px; height: 76px; }
.placeholder-profile .pf-head .avatar { background: transparent; box-shadow: none; border: 1.5px dashed rgba(103, 90, 76, 0.6); color: var(--muted); font-style: normal; }
.pf-role { margin: 0; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.profile h3 { margin: 4px 0 3px; font-family: var(--serif-d); font-weight: 600; font-size: 31px; line-height: 1.05; }
.pf-dates { margin: 0; font-style: italic; color: var(--ink-2); font-size: 17.5px; }
.facts { list-style: none; margin: 0; padding: 0; }
.fact { padding: 16px 0 15px; border-bottom: 1px dotted var(--dotted); }
.fact > .badge { margin-bottom: 9px; }
.fact p { margin: 0; font-size: 17.5px; line-height: 1.55; }
.fact .cite { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--gold-soft); font-size: 14.5px; color: var(--muted); line-height: 1.45; }
.fact .fact-note { margin-top: 8px; font-size: 15.5px; font-style: italic; color: var(--ink-2); }
.fact-note .badge { margin-right: 7px; }
.pf-more { margin: 18px 0 0; font-size: 17px; }
.pf-empty { margin: 18px 0 0; padding: 14px 16px; font-style: italic; color: var(--muted); border: 1px dashed var(--dotted); font-size: 16px; }
.pf-records h4 { margin: 24px 0 12px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.pf-rec-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.rec-thumb { display: block; text-decoration: none; color: var(--ink-2); font-size: 14px; line-height: 1.3; }
.rec-thumb img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; margin-bottom: 7px; background: #2b241d; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform 0.25s, box-shadow 0.25s; }
.rec-thumb:hover img { transform: translateY(-2px); box-shadow: 0 16px 28px -16px rgba(60, 40, 20, 0.55); }
.rec-chip {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 100%; min-height: 120px;
  padding: 12px; text-decoration: none; color: var(--ink);
  font-family: var(--serif-d); font-weight: 600; font-size: 17px; line-height: 1.15;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(238, 229, 210, 0.9));
  border: 1px dashed var(--gold-soft);
  transition: border-color 0.25s;
}
.rec-chip::before { content: "Text record"; font-family: var(--serif); font-weight: 500; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: auto; }
.rec-chip span { font-family: var(--serif); font-weight: 400; font-size: 12.5px; color: var(--muted); }
.rec-chip:hover { border-color: var(--accent); }

/* ---------- drawer ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 100; }
.drawer-wrap[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(31, 26, 20, 0.46); opacity: 0; transition: opacity 0.32s ease; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(540px, 100%);
  display: flex; flex-direction: column;
  background-color: var(--paper); background-image: var(--grain);
  border-left: 1px solid var(--gold-soft);
  box-shadow: -24px 0 60px -24px rgba(31, 26, 20, 0.55);
  transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
}
.drawer-wrap.open .scrim { opacity: 1; }
.drawer-wrap.open .drawer { transform: none; }
.drawer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 28px; border-bottom: 1px solid var(--gold-soft); }
.drawer-kicker { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.drawer-kicker svg { width: 11px; height: 11px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink); cursor: pointer;
  font-size: 26px; line-height: 1; font-family: var(--serif); transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover { border-color: var(--accent); background: #fff; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px 30px; }
.drawer .profile { background: none; border: 0; box-shadow: none; padding: 0; }
.drawer-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--gold-soft); background: rgba(238, 229, 210, 0.5); }
.step-btn {
  max-width: 49%; padding: 8px 12px; border: 0; border-radius: 2px; background: none; cursor: pointer;
  font-family: var(--serif); font-size: 15.5px; color: var(--accent); text-align: left; line-height: 1.3;
}
.step-btn[data-step="1"] { text-align: right; }
.step-btn:hover { background: rgba(123, 45, 38, 0.07); }

/* ---------- featured: Padre ---------- */
.featured-sec { background: linear-gradient(180deg, rgba(230, 217, 191, 0.55), rgba(230, 217, 191, 0.25)); border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); }
.padre-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 52px; align-items: start; }
.portrait { margin: 0; position: sticky; top: calc(var(--head-h) + 28px); }
.portrait-frame {
  position: relative; text-align: center; padding: 34px 30px 28px;
  background: linear-gradient(180deg, #fffdf8, #f8f0e1);
  border: 1px solid var(--gold-soft); outline: 1px solid var(--gold-soft); outline-offset: -11px;
  box-shadow: var(--shadow-lg);
}
.portrait-crest { width: 58px; height: 58px; display: block; margin: 0 auto 14px; }
.portrait-sig {
  display: grid; place-items: center; width: 100%; max-width: 380px; margin: 0 auto 18px; aspect-ratio: 5 / 4;
  border-radius: 50%; overflow: hidden;
  background: radial-gradient(ellipse at 50% 46%, #fbf6e6 0%, #f4ead2 58%, #e6d6b4 100%);
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 7px #f8f1e2, inset 0 0 0 8px rgba(176, 141, 87, 0.55), inset 0 0 50px rgba(120, 90, 50, 0.22), 0 14px 30px -18px rgba(60, 40, 20, 0.5);
}
.portrait-sig img { width: 84%; height: auto; mix-blend-mode: multiply; transform: translate(2%, 3%); }
.portrait-name { margin: 0; font-family: var(--serif-d); font-weight: 600; font-size: 30px; line-height: 1.1; }
.portrait-dates { margin: 4px 0 0; font-family: var(--serif-d); font-style: italic; font-size: 21px; color: var(--accent); letter-spacing: 0.04em; }
.portrait figcaption { margin-top: 16px; font-size: 15.5px; font-style: italic; color: var(--ink-2); line-height: 1.5; text-align: center; }

.vitals-wrap { min-width: 0; }
.vitals { margin: 0; }
.vrow { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 18px; padding: 15px 0 14px; border-bottom: 1px dotted var(--dotted); }
.vrow dt { padding-top: 6px; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); line-height: 1.35; }
.vrow dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.vval { font-family: var(--serif-d); font-weight: 600; font-size: 22px; line-height: 1.22; color: var(--ink); }
.vcite { flex-basis: 100%; font-size: 15px; color: var(--muted); line-height: 1.45; }
.vsub { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-style: italic; color: var(--ink-2); }
.gap-row { background: repeating-linear-gradient(-45deg, rgba(103, 90, 76, 0) 0 9px, rgba(103, 90, 76, 0.06) 9px 10px); }
.gap-row dt { padding-left: 10px; }
.gap-row .vval { font-style: italic; font-weight: 500; color: var(--ink-2); }

.own-words { position: relative; margin: 76px 0 0; padding: 52px 52px 34px; background: var(--card-2); border: 1px solid var(--gold-soft); box-shadow: var(--shadow); }
.own-words::before {
  content: "“"; position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--serif-d); font-size: 84px; line-height: 1; padding-top: 30px; color: var(--accent);
  background: var(--card-2); border: 1px solid var(--gold-soft);
}
.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; margin: 18px 0 26px; }
.quote { margin: 0; padding-left: 22px; border-left: 2px solid var(--accent); }
.q-es { margin: 0 0 12px; font-family: var(--serif-d); font-style: italic; font-weight: 500; font-size: 27px; line-height: 1.32; color: var(--ink); }
.q-en { margin: 0; font-size: 17.5px; color: var(--ink-2); }
.q-cite { margin: 0; padding-top: 18px; border-top: 1px solid var(--gold-soft); text-align: center; font-size: 14.5px; color: var(--muted); }
.q-cite .badge { margin-left: 8px; }

.padre-bottom { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; margin-top: 52px; align-items: start; }
.inventory { position: relative; padding: 30px 30px 24px; background: var(--card-2); border: 1px solid var(--gold-soft); box-shadow: var(--shadow); }
.inventory::before { content: ""; position: absolute; top: 0; bottom: 0; left: 64px; border-left: 1px solid rgba(123, 45, 38, 0.22); }
.inv-head { position: relative; padding-left: 50px; }
.inventory h3, .how h3 { margin: 0; font-family: var(--serif-d); font-weight: 600; font-size: 28px; line-height: 1.1; }
.inv-list { list-style: none; counter-reset: inv; margin: 18px 0 16px; padding: 0; }
.inv-list li {
  counter-increment: inv; position: relative; display: flex; align-items: baseline; gap: 12px;
  padding: 8px 0 8px 50px; border-bottom: 1px solid rgba(46, 74, 107, 0.13); font-size: 17px; line-height: 1.4;
}
.inv-list li::before { content: counter(inv, lower-roman) "."; position: absolute; left: 0; width: 38px; text-align: right; font-family: var(--serif-d); font-style: italic; font-weight: 600; color: var(--accent); }
.inv-item { flex: 1; min-width: 0; }
.inv-es { display: block; margin-top: 3px; font-size: 14.5px; font-style: italic; color: var(--muted); line-height: 1.4; }
.inv-mat { flex: none; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dark); }
.inv-cite { position: relative; margin: 0; padding-left: 50px; font-size: 14px; color: var(--muted); }
.inv-cite .badge { margin-left: 6px; }

.how { min-width: 0; }
.chains { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.chain {
  display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr); align-items: stretch;
  padding: 12px; background: rgba(255, 252, 246, 0.75); border: 1px solid var(--line); border-radius: var(--radius);
}
.node { display: flex; align-items: center; min-width: 0; padding: 9px 11px; font-size: 15px; line-height: 1.35; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 2px; }
.node.rec { color: var(--v); border-color: rgba(47, 93, 58, 0.38); background: rgba(47, 93, 58, 0.05); font-weight: 500; }
.node.out { color: #fcf4e6; background: var(--accent); border-color: var(--accent); font-weight: 500; }
.arrow { position: relative; align-self: center; height: 1px; margin: 0 4px; background: var(--gold-dark); }
.arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 7px solid var(--gold-dark); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 20px; left: 182px; width: 1px; background: linear-gradient(180deg, var(--gold) 0%, var(--gold) 94%, rgba(176, 141, 87, 0)); }
.tl { position: relative; display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 56px; padding-bottom: 34px; }
.tl::before {
  content: ""; position: absolute; left: 176px; top: 9px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--paper);
}
.tl-date { margin: 0; padding-top: 1px; text-align: right; font-family: var(--serif-d); font-weight: 600; font-size: 23px; line-height: 1.2; color: var(--accent); }
.tl-body h3 { margin: 0 0 6px; font-family: var(--serif-d); font-weight: 600; font-size: 25px; line-height: 1.2; }
.tl-body p { margin: 0 0 8px; color: var(--ink-2); font-size: 18px; }
.tl.gap::before { border-style: dashed; border-color: var(--u); }
.tl.gap .tl-date { color: var(--muted); font-style: italic; }
.tl.gap .tl-body { padding: 14px 18px 12px; border: 1px dashed rgba(103, 90, 76, 0.5); border-radius: var(--radius); background: rgba(251, 247, 238, 0.55); }
.tl.now::before { background: var(--accent); }
.tl-flag { margin: 0 0 4px !important; font-size: 11px !important; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted) !important; }
.tl-thumb { display: block; max-width: 340px; margin: 12px 0 4px; background: #efe4cc; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform 0.25s; }
.tl-thumb:hover { transform: translateY(-2px); }
.tl-thumb img { display: block; width: 100%; height: auto; }
.tl-thumb.wide { max-width: 520px; background: #2b241d; }

/* ---------- records ---------- */
.records-sec { background: linear-gradient(180deg, rgba(230, 217, 191, 0.5), rgba(230, 217, 191, 0.22)); border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.record { display: flex; flex-direction: column; min-width: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: calc(var(--head-h) + 24px); }
.record.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(123, 45, 38, 0.55), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.rec-mat {
  position: relative; display: block; aspect-ratio: 5 / 4; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #40362b 0%, #2a231c 70%, #221c16 100%);
}
.rec-mat::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255, 240, 210, 0.08), inset 0 -40px 60px -40px rgba(0, 0, 0, 0.5); pointer-events: none; }
.rec-mat img {
  position: absolute; top: 18px; left: 18px; width: calc(100% - 36px); height: calc(100% - 36px);
  object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5));
  transition: transform 0.45s ease;
}
a.rec-mat:hover img { transform: scale(1.035); }
.mat-hint {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; line-height: 1;
  color: #f6ecd8; background: rgba(28, 23, 18, 0.78); border: 1px solid rgba(217, 191, 134, 0.45); padding: 6px 9px 5px; border-radius: 2px;
  opacity: 0.85; transition: opacity 0.25s;
}
a.rec-mat:hover .mat-hint, a.rec-mat:focus-visible .mat-hint { opacity: 1; }
.rec-mat.paper { background: linear-gradient(180deg, #e9dfca, #dccdb0); display: grid; place-items: center; }
.paper-sheet { position: relative; display: block; width: 48%; height: 80%; background: linear-gradient(180deg, #fdf9ef, #f4ead6); box-shadow: 0 10px 22px -6px rgba(60, 40, 20, 0.35), 0 0 0 1px rgba(120, 94, 60, 0.18); transform: rotate(-2deg); }
.paper-lines { position: absolute; top: 16%; left: 13%; right: 13%; bottom: 32%; background: repeating-linear-gradient(180deg, rgba(120, 94, 60, 0.22) 0 1px, transparent 1px 12px); }
.paper-seal { position: absolute; width: 40px; height: 40px; right: 11%; bottom: 8%; transform: rotate(6deg); filter: drop-shadow(0 2px 3px rgba(60, 20, 10, 0.3)); }
.rec-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 20px; }
.rec-kicker { margin: 0 0 4px; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.record h3 { margin: 0 0 8px; font-family: var(--serif-d); font-weight: 600; font-size: 25px; line-height: 1.15; }
.rec-body > p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.details { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.details a { display: block; width: 86px; text-align: center; text-decoration: none; color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.25; }
.details img { display: block; width: 86px; height: 58px; object-fit: cover; object-position: 0% 50%; margin-bottom: 5px; background: #2b241d; border: 1px solid var(--line); box-shadow: 0 6px 12px -8px rgba(60, 40, 20, 0.6); transition: transform 0.25s, border-color 0.25s; }
.details a:hover img { transform: translateY(-2px); border-color: var(--gold); }
.details a:hover { color: var(--accent); }
.rec-body > .rec-cite { margin: auto 0 0; padding-top: 12px; border-top: 1px dotted var(--dotted); font-size: 14px; line-height: 1.5; color: var(--muted); }
.rec-cite .badge { margin-right: 6px; }

.sources { max-width: 980px; margin: 60px auto 0; }
.sources .mini-head { text-align: center; }
.source-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.source-list li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; padding: 15px 0; border-bottom: 1px dotted var(--dotted); }
.src-type { padding-top: 4px; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.source-list p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.source-list b { font-weight: 600; color: var(--ink); }

/* ---------- places ---------- */
.place-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.place { display: flex; flex-direction: column; min-width: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.place-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #2b241d; }
.place-img img { display: block; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.42) saturate(0.95) contrast(1.04); transition: transform 0.7s ease; }
.place-img img.top { object-position: 50% 6%; }
.place-img img.mid { object-position: 50% 50%; }
.place-img::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 6px rgba(255, 252, 246, 0.9), inset 0 0 0 7px var(--gold-soft), inset 0 0 70px rgba(40, 25, 10, 0.35); }
.place:hover .place-img img { transform: scale(1.04); }
.place-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 20px; }
.place-role { margin: 0 0 3px; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.place h3 { margin: 0 0 12px; font-family: var(--serif-d); font-weight: 600; font-size: 28px; line-height: 1.1; }
.arrow-txt { color: var(--gold-dark); font-style: italic; font-weight: 500; }
.place-facts { list-style: none; margin: 0 0 14px; padding: 0; }
.place-facts li { padding: 8px 0; border-bottom: 1px dotted var(--dotted); font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.place-facts .badge { margin-right: 6px; transform: translateY(-1px); }
.place-cap { margin: auto 0 0; font-size: 14.5px; font-style: italic; color: var(--muted); line-height: 1.45; }

.map-panel {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center;
  margin-top: 56px; padding: 34px; background: var(--card-2); border: 1px solid var(--gold-soft); box-shadow: var(--shadow-lg);
  outline: 1px solid var(--gold-soft); outline-offset: -12px;
}
.map-frame { display: block; padding: 12px; background: #efe4cc; border: 1px solid var(--gold); box-shadow: inset 0 0 0 4px #f8f0e0, 0 16px 30px -18px rgba(60, 40, 20, 0.6); }
.map-frame img { display: block; width: 100%; height: auto; max-height: 720px; object-fit: contain; filter: sepia(0.15) contrast(1.03); transition: filter 0.3s; }
.map-frame:hover img { filter: sepia(0) contrast(1.06); }
.map-text h3 { margin: 0 0 14px; font-family: var(--serif-d); font-weight: 600; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.08; }
.map-text p { margin: 0 0 14px; color: var(--ink-2); }
.map-text .kicker { color: var(--accent); margin-bottom: 8px; }
.map-text .map-note { padding: 12px 16px; border-left: 2px solid var(--accent); background: rgba(123, 45, 38, 0.05); font-style: italic; font-size: 17px; }
.map-text .credit { margin-top: 18px; }

/* ---------- open questions ---------- */
.questions-sec { background: linear-gradient(180deg, rgba(123, 45, 38, 0.07), rgba(123, 45, 38, 0.02)); border-top: 1px solid var(--gold-soft); }
.q-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.qcard { position: relative; min-width: 0; padding: 30px 30px 26px 96px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.qcard::before { content: ""; position: absolute; left: 76px; top: 26px; bottom: 26px; border-left: 1px solid var(--gold-soft); }
.q-num { position: absolute; left: 22px; top: 20px; width: 40px; text-align: center; font-family: var(--serif-d); font-style: italic; font-weight: 600; font-size: 62px; line-height: 1; color: var(--accent); }
.qcard h3 { margin: 0 0 12px; font-family: var(--serif-d); font-weight: 600; font-size: 27px; line-height: 1.15; }
.q-status { margin: 0 0 8px; font-size: 17px; color: var(--ink-2); }
.status { display: inline-block; margin-right: 8px; padding: 4px 9px 3px; border-radius: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.2; vertical-align: 2px; }
.status.narrowed { color: var(--v); background: var(--v-bg); border: 1px solid rgba(47, 93, 58, 0.38); }
.status.traced { color: var(--r); background: var(--r-bg); border: 1px solid rgba(133, 86, 0, 0.38); }
.status.missing { color: var(--accent); background: rgba(123, 45, 38, 0.06); border: 1px dashed rgba(123, 45, 38, 0.55); }
.q-next { margin: 0; font-size: 15.5px; font-style: italic; color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { position: relative; padding: 64px 0 30px; color: #e3d8c4; background-color: #1f1914; background-image: var(--grain); }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-top: 1px solid #b08d57; border-bottom: 1px solid rgba(176, 141, 87, 0.45); }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 30px; border-bottom: 1px solid rgba(201, 169, 110, 0.25); }
.foot-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.foot-crest { width: 58px; height: 58px; flex: none; }
.foot-name { margin: 0; font-family: var(--serif-d); font-weight: 600; font-size: 29px; line-height: 1.1; color: #f6efe2; }
.foot-line { margin: 4px 0 0; font-size: 15.5px; color: #cbbea6; }
.foot-cta { padding: 11px 18px 10px; border: 1px solid rgba(232, 207, 154, 0.5); border-radius: 2px; color: #ecd39e; text-decoration: none; font-size: 15.5px; transition: background 0.25s, color 0.25s; }
.foot-cta:hover { background: #ecd39e; color: #1f1914; }
.foot-credits h2 { margin: 28px 0 12px; font-family: var(--serif); font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: #c9a96e; }
.foot-credits ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 44px; font-size: 14.5px; line-height: 1.5; color: #bdb09a; }
.foot-credits li { break-inside: avoid; margin-bottom: 7px; }
.foot-bottom { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(201, 169, 110, 0.18); font-size: 14px; color: #a99c86; }
.foot-bottom p { margin: 0; }
.foot-bottom a { color: #ecd39e; }

/* ---------- gate (built by family.js) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: rgba(240, 232, 216, 0.72);
  -webkit-backdrop-filter: blur(10px) saturate(0.9); backdrop-filter: blur(10px) saturate(0.9);
  opacity: 0; transition: opacity 0.38s ease;
}
.gate.open { opacity: 1; }
.gate-card {
  position: relative; width: 100%; max-width: 470px; text-align: center; padding: 46px 38px 32px;
  background-color: var(--card-2); background-image: var(--grain);
  border: 1px solid var(--gold-soft); outline: 1px solid var(--gold-soft); outline-offset: -11px;
  box-shadow: 0 40px 90px -36px rgba(31, 26, 20, 0.65);
  transform: translateY(10px) scale(0.985); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gate.open .gate-card { transform: none; }
.gate-crest { width: 80px; height: 80px; display: block; margin: 0 auto 16px; filter: drop-shadow(0 8px 16px rgba(93, 32, 26, 0.3)); }
.gate-kicker { margin: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.gate-kicker svg { width: 11px; height: 11px; }
.gate h2 { margin: 8px 0 12px; font-family: var(--serif-d); font-weight: 600; font-size: 38px; line-height: 1.05; }
.gate-desc { margin: 0 auto 24px; max-width: 330px; font-size: 18.5px; color: var(--ink-2); line-height: 1.5; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px 13px; border: 0; border-radius: 2px; cursor: pointer;
  font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: 0.05em; line-height: 1;
  color: #fcf4e6; background: var(--accent); box-shadow: 0 10px 22px -10px rgba(123, 45, 38, 0.8);
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.gate-note { margin: 18px 0 0; font-size: 14px; font-style: italic; color: var(--muted); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  color: #efe5d2; background: rgba(18, 14, 11, 0.97);
  opacity: 0; transition: opacity 0.25s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-stage { min-height: 0; display: grid; place-items: center; padding: 64px 84px 10px; }
.lb-img { display: block; max-width: min(100%, calc(100vw - 168px)); max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); width: auto; height: auto; object-fit: contain; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65); background: #2a241d; opacity: 0; transition: opacity 0.25s; }
.lb-img.ready { opacity: 1; }
.lb-meta { width: 100%; max-width: 860px; margin: 0 auto; padding: 12px 84px 24px; text-align: center; }
.lb-count { margin: 0 0 4px; font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; color: #c9a96e; }
.lb-title { margin: 0 0 5px; font-family: var(--serif-d); font-weight: 600; font-size: 26px; line-height: 1.15; color: #f8f0e2; }
.lb-caption { margin: 0 0 4px; font-size: 16.5px; line-height: 1.5; color: #e2d7c4; }
.lb-credit { margin: 0; font-size: 13.5px; font-style: italic; color: #b6a98f; }
.lb-btn {
  position: absolute; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  font-family: var(--serif-d); font-size: 34px; line-height: 1; color: #f5efe3;
  background: rgba(36, 30, 24, 0.7); border: 1px solid rgba(239, 229, 210, 0.28); transition: background 0.2s, border-color 0.2s;
}
.lb-btn:hover { background: rgba(123, 45, 38, 0.85); border-color: rgba(239, 229, 210, 0.5); }
.lb-btn:focus-visible { outline: 2px solid #d9bf86; outline-offset: 3px; }
.lb-prev { left: 18px; top: calc(50% - 60px); }
.lb-next { right: 18px; top: calc(50% - 60px); }
.lb-close { right: 18px; top: 14px; font-size: 30px; }

/* ---------- reveal motion ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.75s ease, transform 0.75s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  :root { --head-h: 118px; }
  .head-inner { flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .site-nav { width: 100%; margin-top: 4px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { padding: 0 20px 6px 0; }
  .site-nav li:first-child a { padding-left: 0; }
  .site-nav li:first-child a::after { left: 0; }
  .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .padre-bottom { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .padre-top { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .portrait { position: static; max-width: 480px; margin: 0 auto; }
  .place-grid { grid-template-columns: minmax(0, 1fr); max-width: 620px; margin: 0 auto; }
  .map-panel { grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 620px; margin-left: auto; margin-right: auto; }
  .map-frame img { max-height: 560px; }
  .quotes { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* Tree: stacked layout below 900px */
@media (max-width: 900px) {
  .tree-lines { display: none; }
  .gen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gen > * { grid-row: auto; grid-column: auto; }
  .gen + .gen { margin-top: 26px; padding-top: 30px; }
  .gen + .gen::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid var(--gold); }
  .gen-label { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: center; gap: 10px; text-align: center; }
  .gen-num { display: inline; font-size: 24px; }
  .gen-word { display: inline; margin: 0; }
  .knot { display: none; }
  .person.featured { grid-column: 1 / -1; margin-top: 8px; }
  .gen-4 .person { grid-column: 1 / -1; }
  .tree-key { grid-column: 1 / -1; order: 3; margin-top: 10px; }
  .q-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 18px; }
  .wrap { padding: 0 20px; }
  .section { padding: 68px 0; }
  .sec-head { margin-bottom: 34px; }
  .lede { font-size: 18px; }
  .ribbon { font-size: 13.5px; }
  .ribbon-inner { flex-wrap: wrap; gap: 6px 10px; }
  .ribbon p { flex-basis: calc(100% - 80px); }
  .ribbon-back { margin-left: 0; }
  .brand-crest { width: 40px; height: 40px; }
  .brand-name { font-size: 21px; }
  .hero { padding: 32px 0 10px; }
  .hero-frame { padding: 38px 22px 30px; }
  .hero-crest { width: 70px; height: 70px; }
  .hero-places { font-size: 13px; letter-spacing: 0.18em; }
  .hero-places span[aria-hidden] { margin: 0 6px; }
  .hero-intro { font-size: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n + 3) { border-top: 1px solid var(--gold-soft); }
  .stats b { font-size: 40px; }
  .legend { justify-content: flex-start; gap: 8px 18px; margin-top: -6px; }
  .rec-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
  .source-list { grid-template-columns: minmax(0, 1fr); }
  .timeline::before { left: 7px; }
  .tl { grid-template-columns: minmax(0, 1fr); padding-left: 36px; padding-bottom: 28px; }
  .tl::before { left: 1px; top: 7px; }
  .tl-date { text-align: left; font-size: 20px; margin-bottom: 4px; }
  .tl-body h3 { font-size: 23px; }
  .vrow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .vrow dt { padding-top: 0; }
  .gap-row dt { padding-left: 0; }
  .gap-row { padding-left: 10px; padding-right: 10px; }
  .own-words { padding: 50px 22px 26px; margin-top: 64px; }
  .q-es { font-size: 23px; }
  .chain { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 20px auto 20px auto; }
  .arrow { width: 1px; height: 100%; margin: 0 auto; justify-self: center; }
  .arrow::after { right: auto; top: auto; left: -4px; bottom: -1px; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 7px solid var(--gold-dark); border-bottom: 0; }
  .map-panel { padding: 20px; outline-offset: -8px; }
  .qcard { padding: 26px 22px 22px 78px; }
  .qcard::before { left: 62px; }
  .q-num { left: 12px; font-size: 52px; }
  .foot-credits ul { columns: 1; }
  .lb-stage { padding: 64px 10px 8px; }
  .lb-img { max-width: calc(100vw - 20px); max-height: calc(100vh - 300px); max-height: calc(100dvh - 300px); }
  .lb-meta { padding: 10px 20px 84px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; }
  .lb-prev { left: calc(50% - 62px); }
  .lb-next { right: calc(50% - 62px); }
  .lb-title { font-size: 22px; }
  .drawer { top: auto; height: 92vh; height: 92dvh; width: 100%; border-left: 0; border-top: 1px solid var(--gold-soft); border-radius: 14px 14px 0 0; transform: translateY(100%); box-shadow: 0 -24px 60px -24px rgba(31, 26, 20, 0.55); }
  .drawer-bar { padding-left: 20px; }
  .drawer-body { padding: 20px 20px 26px; }
}

@media (max-width: 640px) {
  .person { flex-direction: column; text-align: center; gap: 10px; padding: 18px 12px 16px; min-height: 0; }
  .p-body { align-items: center; }
  .dots { justify-content: center; }
  .p-open { display: none; }
  .person.featured, .gen-4 .person { flex-direction: row; text-align: left; padding: 18px 16px; }
  .person.featured .p-body, .gen-4 .person .p-body { align-items: flex-start; }
  .person.featured .dots, .gen-4 .person .dots { justify-content: flex-start; }
  .p-name { font-size: 20px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .head-inner { padding-top: 8px; }
  .lock-pill { font-size: 10px; letter-spacing: 0.1em; }
  .hero h1 { font-size: 54px; }
  .hero-frame { padding: 34px 16px 26px; outline-offset: 5px; }
  .hero-places span[aria-hidden] { display: block; height: 0; overflow: hidden; margin: 0; }
  .hero-places { line-height: 1.8; }
  .stats a { padding: 14px 6px 12px; }
  .stats span { letter-spacing: 0.12em; }
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-head .avatar { width: 58px; height: 58px; font-size: 23px; }
  .profile h3 { font-size: 27px; }
  .rec-body, .place-body { padding: 18px 16px; }
  .details a, .details img { width: 76px; }
  .inventory { padding: 24px 16px 20px; }
  .inventory::before { left: 46px; }
  .inv-head, .inv-cite { padding-left: 36px; }
  .inv-list li { padding-left: 38px; flex-wrap: wrap; }
  .inv-list li::before { width: 28px; }
  .source-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gate-card { padding: 38px 22px 26px; }
  .gate h2 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .ribbon, .site-head, .drawer-wrap, .lightbox, .gate { display: none !important; }
  .js .profiles { display: block; }
  body { background: #fff; }
}
