:root {
  --aegean: #1f4e79;
  --aegean-deep: #143552;
  --terracotta: #b8613d;
  --olive: #6b7a3a;
  --cream: #faf6ef;
  --sand: #f1e9dc;
  --ink: #23262b;
  --muted: #6a6f76;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--aegean); }

/* ---------- Hero ---------- */
.hero {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(20,53,82,.55), rgba(20,53,82,.85)),
    var(--hero-img, linear-gradient(135deg, #2a6496, #143552));
  background-size: cover;
  background-position: center;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(16px, 5vw, 56px);
}
.brand {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: .02em;
}
.nav-links { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav-links a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.hero-inner {
  margin: auto;
  text-align: center;
  padding: 40px 16px 80px;
  max-width: 760px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 600;
  opacity: .85;
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 1.02;
  margin: 0 0 18px;
}
.lede { font-size: clamp(1.05rem, 2.4vw, 1.25rem); opacity: .92; margin: 0; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 104px) clamp(16px, 5vw, 56px); }
.section-alt { background: var(--sand); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--aegean-deep);
  margin: 0 0 6px;
}
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Places ---------- */
.places {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
}
.place {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(20,53,82,.07);
  border-top: 4px solid var(--terracotta);
}
.place-icon { font-size: 2rem; margin-bottom: 8px; }
.place h3 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0 0 4px;
}
.place p { color: var(--muted); margin: 0 0 20px; }
.place h3 { margin-bottom: 16px; }
.place-links { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--aegean);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  border: 2px solid var(--aegean);
  transition: background .15s;
}
.btn:hover { background: var(--aegean-deep); border-color: var(--aegean-deep); }
.btn-ghost { background: transparent; color: var(--aegean); }
.btn-ghost:hover { background: var(--aegean); color: #fff; }

/* ---------- Gallery ---------- */
.gallery {
  columns: 3 260px;
  column-gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}
.gallery figure {
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd;
  cursor: zoom-in;
  position: relative;
}
.gallery img { width: 100%; height: auto; transition: transform .3s; }
.gallery figure:hover img { transform: scale(1.03); }
.gallery figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 12px 10px;
  font-size: .85rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  opacity: 0;
  transition: opacity .2s;
}
.gallery figure:hover figcaption { opacity: 1; }
.empty { text-align: center; color: var(--muted); font-style: italic; }

/* ---------- Story ---------- */
.story { max-width: 680px; margin: 0 auto; font-size: 1.08rem; }
.muted { color: var(--muted); }

.links { text-align: center; font-weight: 500; }
.links a { text-underline-offset: 3px; }

/* ---------- Facts ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 28px 0;
  padding: 0;
}
.facts div { background: #fff; border-radius: 10px; padding: 14px 16px; border-top: 3px solid var(--olive); }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--aegean-deep); }

/* ---------- Video ---------- */
.video { max-width: 900px; margin: 40px auto 0; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(20,53,82,.12);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* ---------- Family tree ---------- */
.tree-scroll { overflow-x: auto; padding-bottom: 12px; }
.tree { width: max-content; min-width: 100%; text-align: center; }
.tree ul {
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  position: relative;
  display: flex;
  justify-content: center;
}
.tree > ul { padding-top: 0; }
.tree li {
  position: relative;
  padding: 24px 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tree > ul > li { padding-top: 0; }
/* vertical line up from each child */
.tree li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 24px;
  background: var(--olive);
}
/* horizontal line across the children */
.tree li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--olive);
}
.tree li:only-child::after { display: none; }
.tree li:first-child::after { left: 50%; }
.tree li:last-child::after { right: 50%; }
.tree > ul > li::before, .tree > ul > li::after { display: none; }
/* line down from a parent to its children */
.tree li > ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 24px;
  background: var(--olive);
}
.person {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 118px;
  max-width: 190px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(20,53,82,.08);
  border-top: 3px solid var(--olive);
  position: relative;
  z-index: 1;
}
.person-name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.person-spouse { font-size: .85rem; color: var(--ink); margin-top: 2px; }
.person-dates, .person-note { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.person-lives { font-size: .74rem; color: var(--aegean); margin-top: 4px; }
.person-lives::before { content: "📍 "; }

/* ---------- Contact ---------- */
.contact-text { text-align: center; }
.btn-big { font-size: 1.05rem; padding: 14px 26px; }
.footer a { color: rgba(255,255,255,.85); }

/* ---------- Footer ---------- */
.footer {
  background: var(--aegean-deep);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 32px 16px;
  font-size: .9rem;
}
.footer p { margin: 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,14,20,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; text-align: center; }
.lightbox img { max-height: 84vh; max-width: 92vw; margin: 0 auto; border-radius: 6px; }
.lightbox figcaption { color: #eee; margin-top: 12px; font-size: .95rem; }
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 12px;
  opacity: .8;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

@media (max-width: 520px) {
  .nav-links a:not(:last-child) { display: none; }
  .nav-links { gap: 0; }
}
