:root {
  --ink: #0f1b2d;
  --ink-2: #1c2c44;
  --paper: #f6f2ea;
  --paper-2: #ece5d8;
  --text: #1f2633;
  --muted: #5d6675;
  --gold: #b08a4a;
  --gold-soft: #d8c39a;
  --gold-ink: #7a5c27;
  --line: rgba(15, 27, 45, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 48px);
  color: var(--paper);
  transition: background .35s, padding .35s, color .35s, box-shadow .35s;
}
.nav.scrolled {
  background: rgba(246, 242, 234, .92);
  backdrop-filter: blur(10px);
  color: var(--ink);
  padding-top: 12px; padding-bottom: 12px;
  box-shadow: 0 1px 0 var(--line);
}
.brand {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  letter-spacing: .02em; text-decoration: none;
}
.brand span { color: var(--gold); }
.nav ul { display: flex; gap: clamp(16px, 3vw, 36px); list-style: none; }
.nav a.link {
  text-decoration: none; font-size: .85rem; letter-spacing: .14em;
  text-transform: uppercase; opacity: .85; position: relative;
}
.nav a.link::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
  background: var(--gold); transition: width .3s;
}
.nav a.link:hover::after, .nav a.link.active::after { width: 100%; }

/* ---------- Hero with parallax layers ---------- */
.hero {
  position: relative; height: 100vh; min-height: 620px;
  overflow: hidden; color: var(--paper);
  background: linear-gradient(180deg, #0b1524 0%, #15253d 55%, #2a3a52 100%);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.hero.short { height: 78vh; min-height: 520px; }
.layer { position: absolute; left: 0; right: 0; will-change: transform; pointer-events: none; }
.layer svg { width: 100%; height: 100%; display: block; }
.layer.stars { inset: 0; }
.layer.far { bottom: 0; height: 60%; }
.layer.mid { bottom: 0; height: 45%; }
.layer.near { bottom: -2px; height: 30%; }

.hero-content { position: relative; z-index: 5; padding: 0 16px; will-change: transform, opacity; }
.eyebrow {
  font-size: .78rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-soft); margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(3rem, 10vw, 7.5rem); line-height: 1; letter-spacing: .01em;
}
.hero .hebrew {
  font-family: "Frank Ruhl Libre", var(--serif);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem); color: var(--gold-soft);
  margin-top: 14px; direction: rtl;
}
.hero .lede {
  max-width: 620px; margin: 26px auto 0; font-size: 1.08rem;
  color: rgba(246, 242, 234, .78); font-weight: 300;
}
.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 6; width: 24px; height: 40px; border: 1px solid rgba(246,242,234,.5);
  border-radius: 12px;
}
.scroll-cue::after {
  content: ""; position: absolute; top: 8px; left: 50%; width: 3px; height: 8px;
  margin-left: -1.5px; background: var(--gold-soft); border-radius: 2px;
  animation: cue 1.8s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
section { position: relative; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.block { padding: clamp(80px, 12vw, 140px) 0; }
.block.alt { background: var(--paper-2); }
.block.dark { background: var(--ink); color: var(--paper); }

.kicker {
  font-size: .75rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 14px;
}
.kicker::before { content: ""; width: 36px; height: 1px; background: var(--gold); }
h2 {
  font-family: var(--serif); font-weight: 500; line-height: 1.1;
  font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 26px; color: var(--ink);
}
.dark h2 { color: var(--paper); }
h3 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; color: var(--ink); margin-bottom: 8px; }
.dark h3 { color: var(--paper); }
p + p { margin-top: 1em; }
.muted { color: var(--muted); }
.dark .muted { color: rgba(246,242,234,.65); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.split.top { align-items: start; }

/* Etymology breakdown */
.etym {
  display: flex; align-items: stretch; justify-content: center;
  border: 1px solid var(--line); background: var(--paper);
  font-family: var(--serif);
}
.etym > div { flex: 1; padding: 34px 18px; text-align: center; }
.etym > div + div { border-left: 1px solid var(--line); }
.etym .part { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--ink); }
.etym .part em { color: var(--gold-ink); font-style: normal; }
.etym .gloss { font-family: var(--sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.spellings { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.spellings span {
  border: 1px solid var(--line); padding: 6px 14px; font-size: .9rem;
  background: var(--paper); border-radius: 999px;
}

/* Parallax band */
.band {
  position: relative; overflow: hidden; height: 60vh; min-height: 380px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--paper); background: var(--ink-2);
}
.band .bg { position: absolute; inset: -25% 0; will-change: transform; }
.band .bg svg { width: 100%; height: 100%; }
.band blockquote {
  position: relative; z-index: 2; max-width: 820px; padding: 0 16px;
  font-family: var(--serif); font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.3; font-style: italic;
}
.band cite { display: block; margin-top: 18px; font-family: var(--sans); font-style: normal; font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold-soft); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; }
.card {
  background: var(--paper); border: 1px solid var(--line); padding: 34px 30px;
  transition: transform .35s, box-shadow .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 40px -24px rgba(15,27,45,.35); }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.awards { grid-template-columns: repeat(4, 1fr); }
.cards.awards .card { padding: 28px 24px; }
.cards.awards h3 { font-size: 1.35rem; }
.cards.awards .card { text-align: center; }
.award-img { height: 150px; width: auto; margin: 0 auto 20px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(15,27,45,.25)); }

a.card.memorial { text-decoration: none; display: block; }
.portrait.photo { background: var(--ink); }
.portrait.photo img { object-position: center 20%; filter: sepia(.12) contrast(1.02); }
.memorial-photo {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: center 25%;
  border: 2px solid var(--gold-soft); margin-bottom: 18px; filter: sepia(.12);
}
a.card.memorial .more { display: inline-block; margin-top: 14px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.t-body a { color: var(--gold-soft); }
#story a { color: var(--gold); }
.hero .dates { margin-top: 10px; font-family: var(--serif); font-size: 1.3rem; letter-spacing: .12em; color: rgba(246,242,234,.75); }
.card-dates { font-family: var(--serif); color: var(--gold); margin: -4px 0 10px; letter-spacing: .06em; }

/* Fact list */
.facts { display: grid; grid-template-columns: 120px 1fr; border-top: 1px solid var(--line); }
.facts dt, .facts dd { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding-top: 17px; }
.facts dd { color: var(--text); }
.card .num { font-family: var(--serif); font-size: 2.6rem; color: var(--gold); line-height: 1; margin-bottom: 14px; }
.dark .card { background: var(--ink-2); border-color: rgba(246,242,234,.08); }

/* Timeline */
.timeline { position: relative; margin-top: 50px; }
.timeline::before { content: ""; position: absolute; left: 140px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.dark .timeline::before { background: rgba(246,242,234,.15); }
.t-item { display: grid; grid-template-columns: 140px 1fr; gap: 0 48px; padding-bottom: 46px; position: relative; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: ""; position: absolute; left: 135px; top: 8px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--gold);
}
.dark .t-item::before { background: var(--ink); }
.t-date { font-family: var(--serif); font-size: 1.25rem; color: var(--gold); padding-right: 24px; text-align: right; }
.t-body { padding-left: 4px; }
.t-body .org { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.dark .t-body .org { color: rgba(246,242,234,.6); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tags span { padding: 8px 16px; border: 1px solid var(--line); font-size: .9rem; background: var(--paper); }

/* Embedded family tree */
.tree-embed { border: 1px solid var(--line); background: var(--paper); padding: 8px; }
.tree-embed iframe { display: block; width: 100%; height: clamp(420px, 70vh, 640px); border: 0; }

/* Profile portrait */
.portrait {
  aspect-ratio: 4 / 5; background: linear-gradient(160deg, var(--ink-2), var(--ink));
  display: flex; align-items: center; justify-content: center; position: relative;
  font-family: var(--serif); font-size: 6rem; color: var(--gold-soft);
}
.portrait::after { content: ""; position: absolute; inset: 16px; border: 1px solid rgba(216,195,154,.35); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px;
  padding: 14px 28px; border: 1px solid var(--gold); color: var(--ink);
  text-decoration: none; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase;
  transition: background .3s, color .3s;
}
.btn:hover { background: var(--gold); color: var(--paper); }
.dark .btn, .hero .btn { color: var(--paper); }

/* Placeholder marker for content still to be filled in */
.todo { background: rgba(176,138,74,.14); outline: 1px dashed var(--gold); padding: 0 4px; }

/* Footer */
footer { background: var(--ink); color: rgba(246,242,234,.6); padding: 50px 0; font-size: .85rem; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
footer .brand { color: var(--paper); }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .cards, .cards.two, .cards.awards { grid-template-columns: 1fr; }
  .timeline::before { left: 6px; }
  .t-item { grid-template-columns: 1fr; padding-left: 32px; }
  .t-item::before { left: 1px; }
  .t-date { text-align: left; padding: 0 0 4px; }
  .nav ul { gap: 14px; }
  .nav a.link { font-size: .72rem; letter-spacing: .1em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue::after { animation: none; }
}

/* Present-day colour photos stay untoned */
.portrait.photo.color img { filter: none; object-position: center 30%; }

/* Family cards: colour photos and an initials placeholder */
.memorial-photo.color { filter: none; }
.memorial-photo.initials {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--ink-2), var(--ink));
  font-family: var(--serif); font-size: 1.8rem; color: var(--gold-soft);
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 10px 18px;
  font-size: .9rem; text-decoration: none; border: 2px solid var(--gold);
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.dark :focus-visible, .hero :focus-visible, footer :focus-visible { outline-color: var(--gold-soft); }

/* Small gold text on light backgrounds uses the darker ink for contrast */
.kicker, a.card.memorial .more, .card-dates, .facts dt, #story a { color: var(--gold-ink); }
.kicker::before { background: var(--gold-ink); }
.block:not(.dark) .t-date { color: var(--gold-ink); }
.dark .kicker { color: var(--gold-soft); }
.dark .kicker::before { background: var(--gold-soft); }
.btn { color: var(--ink); border-color: var(--gold-ink); }
.dark .btn, .hero .btn { color: var(--paper); border-color: var(--gold); }
.btn:hover { background: var(--gold-ink); color: var(--paper); }

/* "Back to the family" link at the top of person pages */
.back-link { grid-column: 1 / -1; margin: -40px 0 8px; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; }
.back-link a { color: var(--gold-ink); text-decoration: none; }
.back-link a:hover { text-decoration: underline; }
