@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Warm "espresso" ground — leather-bound books, candlelight, sepia photographs.
     Token names kept from the original navy scheme; values are now warm. */
  --navy:        oklch(0.19 0.024 52);
  --navy-mid:    oklch(0.26 0.028 52);
  --navy-rim:    oklch(0.38 0.030 55);
  --gold:        oklch(0.74 0.115 72);
  --gold-dim:    oklch(0.52 0.095 62);
  --gold-pale:   oklch(0.90 0.060 78);
  --gold-glow:   oklch(0.74 0.115 72 / 0.20);

  --bg:          oklch(0.985 0.006 76);
  --surface:     oklch(0.965 0.009 72);
  --border:      oklch(0.885 0.012 68);
  --ink:         oklch(0.23 0.018 52);
  --muted:       oklch(0.46 0.020 56);

  --hero-text:   oklch(0.97 0.008 76);
  --hero-muted:  oklch(0.86 0.014 74);
  --hero-gold:   oklch(0.85 0.100 78);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-ui:      system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --content-w: 1080px;
  --reading-w: 62ch;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Scroll-reveal ───────────────────────────────────────────────────────── */
.js-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.22,1,0.36,1),
              transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.js-ready .reveal.visible { opacity: 1; transform: none; }

/* Escape hatch: drops all reveal gating instantly, without waiting on a
   transition. Applied by the failsafe so content is never left invisible. */
.reveals-off .reveal,
.reveals-off .carousel-slide {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.visible { opacity: 1 !important; transform: none !important; transition: none !important; }
  .carousel-track { transition: none !important; }
  .site-nav { transition: none !important; }
  .hero-content > * { animation: none !important; opacity: 1 !important; transform: none !important; }
  .hero-bg { animation: none !important; }
  .candle-flame, .candle-glow, .hero-scroll-cue { animation: none !important; }
  .glow-ring, .ember, .section-flash { display: none !important; }
  #candle-count.pop, #candle-btn.confirming, .candle.just-lit { animation: none !important; }
  .js-ready .carousel-slide { opacity: 1 !important; transform: none !important; transition: none !important; }
  .lightbox-figure img.swap, .lightbox::backdrop { animation: none !important; }
  .carousel-photo-wrap:hover img { transform: none !important; }
  .nav-link::after { transition: none !important; }
}

/* ── Focus ───────────────────────────────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-dim);
  outline-offset: 3px;
  border-radius: 4px;
}
.site-nav:not(.scrolled) a:focus-visible,
footer a:focus-visible {
  outline-color: var(--gold);
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  transition: background 0.3s, box-shadow 0.3s;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav.scrolled {
  background: white;
  box-shadow: 0 2px 20px oklch(0 0 0 / 0.08);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo svg { flex-shrink: 0; transition: opacity 0.3s; }
.site-nav.scrolled .nav-logo svg path { fill: var(--gold-dim); }

.nav-logo-text {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-muted);
  transition: color 0.3s;
}
.site-nav.scrolled .nav-logo-text { color: var(--muted); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--hero-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--hero-text); }
.site-nav.scrolled .nav-link { color: var(--muted); }
.site-nav.scrolled .nav-link:hover { color: var(--ink); }

/* Where the reader currently is */
.nav-link::after {
  content: '';
  display: block;
  height: 1px;
  margin-top: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
}
.nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--hero-text); }
.site-nav.scrolled .nav-link.active { color: var(--ink); }

/* Reading progress along the bottom edge of the nav */
.read-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(to right, var(--gold-dim), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.nav-cta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--gold);
  border: 1px solid oklch(0.72 0.13 75 / 0.5);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
}
.nav-cta:hover { background: var(--gold-glow); color: var(--gold); }
.site-nav.scrolled .nav-cta { color: var(--gold-dim); border-color: oklch(0.58 0.10 75 / 0.4); }

/* ── Hero (full-bleed portrait) ────────────────────────────────────────── */
.memorial-header {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  overflow: hidden;
  background: var(--navy);
}

/* Extra vertical headroom so parallax travel never exposes an edge */
.hero-media {
  position: absolute;
  inset: -14% 0;
  z-index: 0;
  will-change: transform;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
  /* warm, gently faded "printed photograph" grade */
  filter: saturate(0.82) sepia(0.16) brightness(0.94) contrast(1.02);
  animation: heroKen 20s ease-out both;
}
@keyframes heroKen {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}

.hero-bg-empty {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: clamp(4rem, 14vw, 9rem);
  color: var(--navy-rim);
  background: radial-gradient(ellipse at 50% 35%, var(--navy-mid), var(--navy));
  filter: none;
  animation: none;
}

/* Scrim: warm darkening so the name stays legible over any photo */
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom,
      oklch(0.15 0.02 50 / 0.34) 0%,
      oklch(0.15 0.02 50 / 0.10) 30%,
      oklch(0.15 0.02 50 / 0.55) 72%,
      oklch(0.11 0.02 50 / 0.88) 100%),
    radial-gradient(ellipse 120% 82% at 50% 122%, oklch(0.55 0.09 60 / 0.24), transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 2rem 1.5rem clamp(3rem, 8vh, 5.5rem);
  margin: 0 auto;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  font-weight: 400;
  color: var(--hero-text);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 0.9rem;
  text-shadow: 0 2px 30px oklch(0.12 0.02 50 / 0.55);
}

.dates {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--hero-gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.9rem;
  text-shadow: 0 1px 14px oklch(0.12 0.02 50 / 0.7);
}

.dates-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; margin-bottom: 1.15rem;
}
.dates-divider::before,
.dates-divider::after {
  content: ''; flex: 0 1 90px; height: 1px;
}
.dates-divider::before { background: linear-gradient(to left, transparent, oklch(0.85 0.10 78 / 0.7)); }
.dates-divider::after  { background: linear-gradient(to right, transparent, oklch(0.85 0.10 78 / 0.7)); }
.dates-divider-heart { color: var(--gold); font-size: 0.95rem; }

.epitaph {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--hero-text);
  line-height: 1.6;
  text-wrap: pretty;
  max-width: 42ch;
  margin: 0 auto;
  text-shadow: 0 1px 18px oklch(0.12 0.02 50 / 0.72);
}

/* Scroll cue */
.hero-scroll-cue {
  position: absolute; left: 50%; bottom: 1.4rem; z-index: 2;
  width: 1px; height: 40px; transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, oklch(0.85 0.10 78 / 0.8));
  animation: cuePulse 2.6s ease-in-out infinite;
}
@keyframes cuePulse {
  0%, 100% { opacity: 0.15; transform: translateX(-50%) scaleY(0.6); transform-origin: top; }
  50%      { opacity: 0.85; transform: translateX(-50%) scaleY(1); transform-origin: top; }
}

/* Hero arrival: a quiet, staggered rise */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content h1             { animation: heroRise 0.9s cubic-bezier(0.22,1,0.36,1) both 0.22s; }
.hero-content .dates         { animation: heroRise 0.9s cubic-bezier(0.22,1,0.36,1) both 0.34s; }
.hero-content .dates-divider { animation: heroRise 0.9s cubic-bezier(0.22,1,0.36,1) both 0.42s; }
.hero-content .epitaph       { animation: heroRise 0.9s cubic-bezier(0.22,1,0.36,1) both 0.50s; }

/* ── Page body ───────────────────────────────────────────────────────────── */
.page-container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding-inline: 2rem;
  width: 100%;
}

/* ── Bio (intimate single column) ──────────────────────────────────────── */
.bio-section { padding: clamp(3.5rem, 8vh, 6rem) 0; }
.bio-inner { max-width: 680px; text-align: center; }

.bio-heading {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
  text-wrap: balance;
  line-height: 1.2;
}

.bio-heading-rule {
  width: 54px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 2rem;
  border: none;
}

.bio-text {
  text-align: left;
  max-width: var(--reading-w);
  margin: 0 auto;
  font-size: 1.08rem;
}
.bio-text p { margin-bottom: 1.2rem; }
.bio-text p:last-child { margin-bottom: 0; }
.bio-text p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.1rem;
  float: left;
  line-height: 0.82;
  padding: 0.2rem 0.6rem 0 0;
  color: var(--gold-dim);
}

/* ── Elevated quote (her words, over her portrait) ─────────────────────── */
.quote-section {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  padding: clamp(4rem, 12vh, 7rem) 1.5rem;
  display: flex;
  justify-content: center;
}
.quote-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 28%;
  filter: saturate(0.7) sepia(0.2) brightness(0.5);
  z-index: 0;
}
.quote-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom, oklch(0.15 0.02 50 / 0.82), oklch(0.15 0.02 50 / 0.72)),
    radial-gradient(ellipse 90% 70% at 50% 50%, transparent, oklch(0.12 0.02 50 / 0.6));
}
.quote-content {
  position: relative; z-index: 2;
  max-width: 760px; text-align: center;
}
.quote-mark {
  font-family: var(--font-display);
  font-size: 4rem; line-height: 0.5;
  color: var(--gold); opacity: 0.85;
  display: block; margin-bottom: 0.75rem;
}
.quote-content blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.35rem);
  line-height: 1.34;
  color: var(--hero-text);
  text-wrap: balance;
  margin-bottom: 1.5rem;
}
.quote-content cite {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hero-gold);
}
.quote-content cite::before { content: '— '; }

/* ── Candle (an act of remembrance) ────────────────────────────────────── */
.candle-section {
  background: var(--navy);
  text-align: center;
  padding: clamp(3.5rem, 9vh, 6rem) 0;
  position: relative;
  overflow: hidden;
}
.candle-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 45% 55% at 50% 22%, var(--gold-glow), transparent 70%);
  pointer-events: none;
}
.candle-section .page-container { position: relative; z-index: 1; }

.candle {
  position: relative;
  width: 44px; height: 96px;
  margin: 0 auto 1.75rem;
}
.candle-stem {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 64px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(to bottom, oklch(0.94 0.03 85), oklch(0.82 0.04 80));
  box-shadow: inset 0 6px 8px oklch(1 0 0 / 0.3), inset 0 -6px 10px oklch(0.5 0.05 60 / 0.3);
}
.candle-flame {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 30px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 70%, oklch(0.98 0.08 90) 0%, oklch(0.82 0.16 70) 45%, oklch(0.62 0.19 45 / 0.6) 100%);
  transform-origin: 50% 90%;
  animation: flicker 2.8s ease-in-out infinite;
}
.candle-glow {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.85 0.14 75 / 0.55), transparent 62%);
  animation: glowPulse 2.8s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-1deg); opacity: 0.95; }
  25%      { transform: translateX(-50%) scale(1.04, 0.97) rotate(1deg); opacity: 1; }
  50%      { transform: translateX(-50%) scale(0.97, 1.05) rotate(-1deg); opacity: 0.9; }
  75%      { transform: translateX(-50%) scale(1.02, 0.99) rotate(1deg); opacity: 1; }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(0.95); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.06); }
}

/* ── Ignition moment: the whole room catches light, not just the icon ──── */

/* The dark section itself flashes warm — visible no matter where the eye is */
.section-flash {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 65% at 50% 38%, oklch(0.78 0.13 72 / 0.65), transparent 68%);
  animation: sectionFlash 1.6s ease-out both;
}
@keyframes sectionFlash {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  100% { opacity: 0; }
}

/* The whole candle object gives a visible "catch" */
.candle.just-lit { animation: candlePunch 0.7s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes candlePunch {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.16); }
  60%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.candle-flame.igniting {
  animation: flameIgnite 1.3s cubic-bezier(0.22,1,0.36,1) both,
             flicker 2.8s ease-in-out 1.3s infinite;
}
@keyframes flameIgnite {
  0%   { transform: translateX(-50%) scale(0.2, 0.15); opacity: 0.25; filter: brightness(1); }
  28%  { transform: translateX(-50%) scale(2.1, 2.4);  opacity: 1;    filter: brightness(2.1); }
  50%  { transform: translateX(-50%) scale(0.8, 1.15); opacity: 1;    filter: brightness(1.4); }
  70%  { transform: translateX(-50%) scale(1.15, 0.92); opacity: 1;   filter: brightness(1.1); }
  100% { transform: translateX(-50%) scale(1, 1);       opacity: 1;   filter: brightness(1); }
}

.candle.just-lit .candle-glow { animation: glowBurst 1.6s ease-out; }
@keyframes glowBurst {
  0%   { opacity: 1;   transform: translateX(-50%) scale(3.4); }
  100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
}

.glow-ring {
  position: absolute; top: -14px; left: 50%;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.9 0.13 75 / 0.6), transparent 65%);
  pointer-events: none;
  animation: glowRing 1.5s ease-out both;
}
@keyframes glowRing {
  0%   { opacity: 1; transform: translateX(-50%) scale(0.5); }
  100% { opacity: 0; transform: translateX(-50%) scale(4.5); }
}

.ember {
  position: absolute; top: 8px; left: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.97 0.08 85), oklch(0.76 0.17 55));
  box-shadow: 0 0 10px 2px oklch(0.82 0.16 65 / 0.9);
  pointer-events: none;
  animation: emberRise 1.9s ease-out both;
}
@keyframes emberRise {
  0%   { transform: translate(-50%, 0) scale(1);   opacity: 1; }
  70%  { opacity: 0.9; }
  100% { transform: translate(calc(-50% + var(--drift, 0px)), -150px) scale(0.2); opacity: 0; }
}

@keyframes countPop {
  0%   { transform: scale(1);   color: var(--hero-gold); }
  40%  { transform: scale(1.7); color: oklch(0.92 0.1 85); }
  100% { transform: scale(1);   color: var(--hero-gold); }
}
#candle-count.pop { display: inline-block; animation: countPop 0.7s cubic-bezier(0.34,1.56,0.64,1); }

@keyframes btnConfirm {
  0%   { transform: scale(1);    box-shadow: 0 4px 18px oklch(0.55 0.1 60 / 0.35); }
  30%  { transform: scale(1.12); box-shadow: 0 0 0 14px oklch(0.74 0.115 72 / 0.28), 0 4px 24px oklch(0.55 0.1 60 / 0.5); }
  100% { transform: scale(1);    box-shadow: 0 4px 18px oklch(0.55 0.1 60 / 0.35); }
}
#candle-btn.confirming { animation: btnConfirm 0.75s ease-out; }

.candle-section h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  color: var(--hero-text);
  margin-bottom: 0.5rem;
  text-wrap: balance;
}
.candle-sub {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--hero-muted);
  margin-bottom: 1.75rem;
}
.candle-sub #candle-count { color: var(--hero-gold); font-style: normal; }

#candle-btn {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--gold);
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 18px oklch(0.55 0.1 60 / 0.35);
}
#candle-btn:hover:not(:disabled) { background: var(--gold-pale); transform: translateY(-1px); box-shadow: 0 8px 26px oklch(0.55 0.1 60 / 0.45); }
#candle-btn:disabled { cursor: default; background: transparent; color: var(--hero-gold); border: 1px solid oklch(0.85 0.10 78 / 0.4); box-shadow: none; }

/* ── Section shared ──────────────────────────────────────────────────────── */
.section-wrap {
  padding: 3.5rem 0;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
  margin-bottom: 0.6rem;
}

.section-rule {
  width: 40px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 0 auto 2.5rem;
}

/* ── Timeline: a vertical spine that draws as you travel her life ───────── */
.timeline-section {
  background: var(--surface);
  padding: clamp(3.5rem, 8vh, 5.5rem) 0;
}

.timeline-wrap {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: 0.5rem 0;
}
.timeline { list-style: none; }

/* The unlit track, and the gold fill that follows the reader down it */
.timeline-spine {
  position: absolute;
  left: 23px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}
.timeline-spine-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--gold-dim), var(--gold));
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: top;
  will-change: transform;
}

.timeline-node {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.25rem;
  align-items: start;
  /* generous spacing so each year lands as its own beat while scrolling */
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
}
.timeline-node:last-child { padding-bottom: 0; }

.timeline-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: oklch(0.72 0.02 60);
  position: relative;
  z-index: 1;
  transition: color 0.5s ease, border-color 0.5s ease,
              box-shadow 0.5s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1);
}

/* Each year lights up as the spine reaches it */
.timeline-node.lit .timeline-icon-wrap {
  color: var(--gold-dim);
  border-color: oklch(0.78 0.09 72);
  box-shadow: 0 0 0 5px var(--gold-glow), 0 4px 14px oklch(0.5 0.06 60 / 0.18);
  transform: scale(1.06);
}

/* Unlit years stay readable (WCAG AA); the "lit" cue lives in the icon and
   year colour, not in dimming the text out of legibility. */
.timeline-body {
  padding-top: 0.35rem;
  opacity: 0.85;
  transform: translateY(6px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.timeline-node.lit .timeline-body { opacity: 1; transform: none; }

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 0.2rem;
  transition: color 0.55s ease;
}
.timeline-node.lit .timeline-year { color: var(--gold-dim); }

.timeline-event {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-spine-fill { transform: scaleY(1) !important; }
  .timeline-body { opacity: 1 !important; transform: none !important; }
  .timeline-icon-wrap { color: var(--gold-dim) !important; }
}

/* ── Gallery / Carousel ──────────────────────────────────────────────────── */
.gallery-section { padding: 3.5rem 0; }

.carousel-outer {
  position: relative;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: 8px;
}

.carousel-track {
  display: flex;
  gap: 10px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-slide {
  flex: 0 0 calc(20% - 8px);
}

/* The photo tile is a button (opens the lightbox) — strip button chrome */
.carousel-photo-wrap {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.carousel-slide img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  /* unify mixed family photos into one warm, curated set */
  filter: saturate(0.86) sepia(0.13) contrast(1.02);
  transition: filter 0.5s, transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.carousel-photo-wrap:hover img,
.carousel-photo-wrap:focus-visible img { filter: saturate(1) sepia(0.03); transform: scale(1.05); }

/* Quiet "you can open this" affordance */
.photo-zoom-cue {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: oklch(0.15 0.02 50 / 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.photo-zoom-cue::before,
.photo-zoom-cue::after {
  content: '';
  position: absolute;
  background: var(--hero-text);
  left: 50%; top: 50%;
}
.photo-zoom-cue::before { width: 11px; height: 1.5px; transform: translate(-50%,-50%); }
.photo-zoom-cue::after  { width: 1.5px; height: 11px; transform: translate(-50%,-50%); }
.carousel-photo-wrap:hover .photo-zoom-cue,
.carousel-photo-wrap:focus-visible .photo-zoom-cue { opacity: 1; transform: scale(1); }

/* Photos arrive in sequence, not all at once */
.js-ready .carousel-slide {
  opacity: 0;
  transform: translateY(20px);
}
.js-ready .carousel-outer.visible .carousel-slide {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1) var(--stagger, 0ms),
              transform 0.7s cubic-bezier(0.22,1,0.36,1) var(--stagger, 0ms);
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */
.lightbox {
  border: none;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
  display: none;
  place-items: center;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop {
  background: oklch(0.11 0.015 50 / 0.94);
  backdrop-filter: blur(6px);
  animation: lbFade 0.35s ease both;
}
@keyframes lbFade { from { opacity: 0 } to { opacity: 1 } }

.lightbox-figure {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-height: 92vh;
  padding: 1rem 0;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 24px 80px oklch(0 0 0 / 0.6);
}
.lightbox-figure img.swap { animation: lbSwap 0.45s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes lbSwap {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-figure figcaption {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--hero-muted);
  text-align: center;
  font-size: 0.95rem;
  padding: 0 1rem;
}

.lightbox-nav,
.lightbox-close {
  background: oklch(1 0 0 / 0.08);
  border: 1px solid oklch(1 0 0 / 0.18);
  color: var(--hero-text);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.lightbox-nav { width: 48px; height: 48px; font-size: 1.6rem; margin: 0 0.75rem; }
.lightbox-nav.prev { grid-column: 1; }
.lightbox-nav.next { grid-column: 3; }
.lightbox-nav:hover, .lightbox-close:hover { background: oklch(1 0 0 / 0.18); transform: scale(1.06); }

.lightbox-close {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  width: 42px; height: 42px;
  font-size: 1.5rem;
  line-height: 1;
}

@media (max-width: 560px) {
  .lightbox-nav { width: 40px; height: 40px; margin: 0 0.25rem; }
  .lightbox-figure img { max-height: 66vh; }
}

.carousel-photo-fallback {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  color: var(--gold-dim);
  font-size: 1.6rem;
}

.carousel-caption {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}

.carousel-btn {
  position: absolute;
  top: calc(50% - 1.5rem);
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px oklch(0 0 0 / 0.10);
  transition: background 0.2s, box-shadow 0.2s;
  z-index: 5;
}
.carousel-btn:hover { background: var(--surface); box-shadow: 0 4px 16px oklch(0 0 0 / 0.14); }
.carousel-btn.prev { left: -20px; }
.carousel-btn.next { right: -20px; }
.carousel-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Service ─────────────────────────────────────────────────────────────── */
.service-section { padding: 3.5rem 0; }

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1.5rem 2rem;
  align-items: center;
}

.service-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.service-main-text h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.service-main-text p {
  font-size: 0.875rem;
  color: var(--muted);
}

.service-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.service-detail-icon {
  color: var(--gold-dim);
  font-size: 1rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}
.service-detail-text p {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.5;
}
.service-detail-text p + p { color: var(--muted); font-size: 0.8rem; }

.service-cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.service-cal-btn:hover { background: var(--border); }

/* ── Tributes ─────────────────────────────────────────────────────────────── */
.tributes-section { padding: 3.5rem 0; }

.tributes-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* Left panel — list */
.tributes-list-panel h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.tributes-subline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-style: italic;
}

#guestbook-messages { min-height: 80px; }

/* Individual tribute cards */
.tribute-card {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.tribute-card:last-child { border-bottom: 1px solid var(--border); }

.tribute-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tribute-body { flex: 1; min-width: 0; }

.tribute-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.tribute-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}
.tribute-relationship {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
}

.tribute-message {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.6;
}

.no-messages, .loading {
  font-style: italic;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
}

/* Right panel — form */
.tribute-form-panel {
  position: sticky;
  top: 80px;
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--border);
}

.tribute-form-panel h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

#guestbook-form input,
#guestbook-form select,
#guestbook-form textarea {
  display: block;
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.18s;
  appearance: none;
}

#guestbook-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

#guestbook-form textarea {
  resize: vertical;
  margin-bottom: 0.3rem;
}

#guestbook-form input::placeholder,
#guestbook-form textarea::placeholder { color: var(--muted); }

#guestbook-form input:focus,
#guestbook-form select:focus,
#guestbook-form textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.char-counter {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  margin-bottom: 0.75rem;
}

#guestbook-form button {
  width: 100%;
  background: var(--navy);
  color: var(--hero-text);
  border: none;
  padding: 0.82rem 1.5rem;
  border-radius: 7px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
#guestbook-form button:hover:not(:disabled) { background: var(--navy-mid); }
#guestbook-form button:disabled { opacity: 0.55; cursor: not-allowed; }

.form-note {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.65rem;
  text-align: center;
}

.success {
  font-style: italic;
  color: var(--gold-dim);
  text-align: center;
  padding: 1rem 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  background: var(--navy);
  color: var(--hero-muted);
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--hero-text);
  margin-bottom: 0.25rem;
}
.footer-dates {
  color: var(--hero-gold);
  font-style: italic;
  font-family: var(--font-body);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.footer-divider {
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  margin-bottom: 0.75rem;
}
footer a { color: var(--hero-muted); text-underline-offset: 3px; }
footer a:hover { color: var(--hero-text); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}

@media (max-width: 860px) {
  .service-card { grid-template-columns: auto 1fr; }
  .service-card > :nth-child(3),
  .service-card > :nth-child(4),
  .service-card > :nth-child(5) { grid-column: 2; }

  .tributes-layout { grid-template-columns: 1fr; }
  .tribute-form-panel { position: static; }

  .carousel-slide { flex: 0 0 calc(33.33% - 7px); }
  .carousel-btn.prev { left: -10px; }
  .carousel-btn.next { right: -10px; }
}

@media (max-width: 560px) {
  .site-nav { padding: 0 1rem; gap: 0.75rem; }
  .page-container { padding-inline: 1.25rem; }
  .memorial-header { min-height: 84vh; min-height: 84dvh; }
  .carousel-slide { flex: 0 0 calc(50% - 5px); }
  .service-card { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
