/* ==========================================================
   Mother's Day Tribute — cinematic single-page styles
   ========================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #0a0705;
  --bg-deep: #060403;
  --ink: #f6ecd9;
  --ink-soft: rgba(246, 236, 217, 0.78);
  --ink-mute: rgba(246, 236, 217, 0.56);
  --gold: #e9c785;
  --gold-soft: #c9a560;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fade: 1500ms;
}

html, body { height: 100%; margin: 0; padding: 0; }

body {
  background: radial-gradient(ellipse at center, #15100c 0%, var(--bg) 55%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { position: relative; width: 100vw; height: 100vh; height: 100dvh; overflow-y: auto; }
#app::-webkit-scrollbar { width: 0; }

/* ==========================================================
   AI banner (top, always visible)
   ========================================================== */
.ai-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-top: clamp(0.6rem, 1.6vh, 1.1rem);
  padding: 0.45em 1.2em;
  font-family: var(--sans);
  font-size: clamp(0.65rem, 1.1vw, 0.78rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(10, 7, 5, 0.55);
  border: 1px solid rgba(233, 199, 133, 0.30);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.ai-banner-dot {
  color: var(--gold-soft);
  font-size: 0.85em;
  opacity: 0.8;
}

/* ==========================================================
   Site footer (hero only) — Made-by credit + email
   ========================================================== */
.site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(0.9rem, 2.5vh, 1.6rem);
  text-align: center;
  font-family: var(--sans);
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.site-footer p { margin: 0; }
.site-footer a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted rgba(233, 199, 133, 0.45);
  transition: color 200ms ease, border-color 200ms ease;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fbe9c5;
  border-bottom-color: rgba(251, 233, 197, 0.85);
  outline: none;
}

/* Made-by Bruce Svenson pill */
.made-by {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.3rem 1rem 0.3rem 0.3rem;
  background: rgba(15, 11, 8, 0.55);
  border: 1px solid rgba(233, 199, 133, 0.25);
  border-radius: 999px;
  text-decoration: none;
  border-bottom: 1px solid rgba(233, 199, 133, 0.25); /* override .site-footer a dotted */
  transition: background 220ms ease, border-color 220ms ease, transform 220ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.made-by:hover,
.made-by:focus-visible {
  background: rgba(233, 199, 133, 0.10);
  border-color: rgba(233, 199, 133, 0.6);
  transform: translateY(-1px);
}
.made-by-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #2b2017;
  flex: none;
  box-shadow: 0 0 0 1px rgba(233, 199, 133, 0.35), 0 4px 14px -2px rgba(0,0,0,0.5);
}
.made-by-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  text-align: left;
}
.made-by-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.made-by-name {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--gold);
  font-weight: 500;
}
.made-by-fb {
  width: 16px;
  height: 16px;
  fill: rgba(233, 199, 133, 0.7);
  flex: none;
  margin-left: 0.15rem;
}
.made-by:hover .made-by-fb,
.made-by:focus-visible .made-by-fb {
  fill: #fbe9c5;
}

.site-footer-email {
  font-size: 0.72rem;
}

/* Small credit line on the closing card */
.closing-credit {
  margin: 1.6rem 0 0 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.closing-credit a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted rgba(233, 199, 133, 0.45);
}
.closing-credit a:hover { color: #fbe9c5; }

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(4rem, 10vw, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(4rem, 10vw, 6rem);
  text-align: center;
  z-index: 30;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(233, 199, 133, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #100a06 0%, #07050300 100%);
}

.hero-inner { max-width: 42rem; position: relative; z-index: 3; }

/* ----- Twinkling stars layer ----- */
.stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.star {
  position: absolute;
  width: var(--size, 2px);
  height: var(--size, 2px);
  border-radius: 50%;
  background: #fff8e3;
  box-shadow: 0 0 6px rgba(255, 235, 190, 0.8), 0 0 14px rgba(255, 215, 140, 0.35);
  opacity: 0;
  animation: twinkle var(--dur, 3.5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: opacity, transform;
}
.star::after {
  /* tiny cross-glint on bigger stars */
  content: "";
  position: absolute;
  inset: 50% 50% 50% 50%;
  width: 0;
  height: 0;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  45%, 55% { opacity: 1;    transform: scale(1.25); }
}

/* ----- Soft warm lightning ----- */
.lightning-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: transparent;
  mix-blend-mode: screen;
  animation: lightning 17s linear infinite;
  will-change: opacity, background;
}
.lightning-layer::before,
.lightning-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.lightning-layer::before {
  /* main flash, top-right */
  background: radial-gradient(ellipse at 78% 12%, rgba(255, 240, 200, 0.85) 0%, rgba(255, 220, 150, 0.35) 25%, transparent 55%);
  animation: lightning-flash-a 17s linear infinite;
}
.lightning-layer::after {
  /* secondary, more distant from top-left */
  background: radial-gradient(ellipse at 18% 30%, rgba(255, 235, 200, 0.55) 0%, rgba(255, 215, 150, 0.2) 25%, transparent 50%);
  animation: lightning-flash-b 17s linear infinite;
  animation-delay: 8.4s;
}
@keyframes lightning-flash-a {
  0%, 14%, 100% { opacity: 0; }
  15%           { opacity: 0.85; }
  15.5%         { opacity: 0.05; }
  16%           { opacity: 0.55; }
  17%           { opacity: 0; }
  /* second strike halfway */
  44%           { opacity: 0; }
  45%           { opacity: 0.7; }
  45.5%         { opacity: 0.1; }
  46%           { opacity: 0.4; }
  47%           { opacity: 0; }
}
@keyframes lightning-flash-b {
  0%, 32%, 100% { opacity: 0; }
  33%           { opacity: 0.55; }
  33.6%         { opacity: 0.05; }
  34%           { opacity: 0.30; }
  35%           { opacity: 0; }
}
@keyframes lightning {
  /* a faint global wash that pulses with the strikes for cohesion */
  0%, 100% { background: transparent; }
  15%, 16% { background: rgba(255, 235, 190, 0.05); }
  45%, 46% { background: rgba(255, 235, 190, 0.04); }
}

.hero-eyebrow {
  font-family: var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  color: var(--gold);
  margin: 0 0 1.4rem 0;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 0 1.4rem 0;
  background: linear-gradient(180deg, #fbe9c5 0%, #d8b27c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 auto 2.4rem auto;
}

.begin-btn {
  appearance: none;
  border: 1px solid rgba(233, 199, 133, 0.55);
  background: linear-gradient(180deg, rgba(233, 199, 133, 0.18), rgba(233, 199, 133, 0.06));
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.95em 2.4em;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  box-shadow: 0 0 0 0 rgba(233, 199, 133, 0.25);
}
.begin-btn:hover,
.begin-btn:focus-visible {
  background: linear-gradient(180deg, rgba(233, 199, 133, 0.28), rgba(233, 199, 133, 0.12));
  border-color: rgba(233, 199, 133, 0.85);
  box-shadow: 0 0 0 8px rgba(233, 199, 133, 0.10);
  transform: translateY(-1px);
  outline: none;
}
.begin-btn:active { transform: translateY(0); }

.hero-meta {
  margin: 1.6rem 0 0 0;
  color: var(--ink-mute);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ==========================================================
   Engagement: like button + visitor count
   ========================================================== */
.engagement {
  margin: 1.6rem auto 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.engagement-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: rgba(15, 11, 8, 0.55);
  border: 1px solid rgba(233, 199, 133, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
}
.engagement-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: var(--gold-soft);
  transition: fill 200ms ease, transform 220ms ease;
}
.engagement-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
  transition: color 200ms ease;
}
.engagement-label {
  color: var(--ink-mute);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

/* Like button: clickable */
.engagement-pill--like {
  appearance: none;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, transform 220ms ease;
}
.engagement-pill--like:hover,
.engagement-pill--like:focus-visible {
  background: rgba(233, 199, 133, 0.10);
  border-color: rgba(233, 199, 133, 0.55);
  outline: none;
}
.engagement-pill--like:active { transform: scale(0.97); }

.engagement-pill--like.is-liked {
  background: rgba(220, 70, 90, 0.18);
  border-color: rgba(232, 110, 120, 0.6);
}
.engagement-pill--like.is-liked .engagement-icon {
  fill: #ec5e6a;
  filter: drop-shadow(0 0 6px rgba(236, 94, 106, 0.55));
}
.engagement-pill--like.is-liked .engagement-count {
  color: #fbe9c5;
}

/* Pulse / "+1" cue when a like is registered */
@keyframes like-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
.engagement-pill--like.just-liked .engagement-icon {
  animation: like-pulse 600ms ease-out;
}
.engagement-pill--like .floater {
  position: absolute;
  pointer-events: none;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: #ec5e6a;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(0);
  animation: floater-up 900ms ease-out forwards;
}
.engagement-pill--like { position: relative; overflow: visible; }
@keyframes floater-up {
  0%   { opacity: 0;   transform: translateY(0); }
  20%  { opacity: 1;   transform: translateY(-6px); }
  100% { opacity: 0;   transform: translateY(-28px); }
}

/* When the visitor count animates */
.engagement-count.bump {
  animation: count-bump 700ms ease-out;
  color: #fbe9c5;
}
@keyframes count-bump {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-2px) scale(1.12); }
  100% { transform: translateY(0) scale(1); }
}

/* ==========================================================
   "Read the story" link
   ========================================================== */
.story-link {
  appearance: none;
  background: transparent;
  border: none;
  margin: 1.4rem auto 0 auto;
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  color: var(--gold);
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0.4em 0.8em;
  border-radius: 999px;
  transition: color 200ms ease, background 200ms ease;
}
.story-link:hover,
.story-link:focus-visible {
  color: #fbe9c5;
  background: rgba(233, 199, 133, 0.08);
  outline: none;
}
.story-link--closing { margin-top: 1.6rem; color: var(--ink-soft); }
.story-link--closing:hover { color: var(--gold); }

/* ==========================================================
   Story modal
   ========================================================== */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2rem);
  opacity: 0;
  transition: opacity 320ms ease;
}
.story-modal:not([hidden]) { opacity: 1; }
.story-modal[hidden] { display: none; }

.story-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 10, 4, 0.78) 0%, rgba(6, 4, 3, 0.94) 80%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.story-card {
  position: relative;
  z-index: 1;
  width: min(100%, 44rem);
  max-height: calc(100dvh - clamp(1.5rem, 6vw, 4rem));
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(233, 199, 133, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #15100c 0%, #0d0907 100%);
  color: var(--ink);
  border: 1px solid rgba(233, 199, 133, 0.22);
  border-radius: 14px;
  padding: clamp(1.4rem, 4vw, 2.6rem) clamp(1.2rem, 4vw, 2.6rem);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0,0,0,0.4) inset;
  scroll-behavior: smooth;
  transform: translateY(8px);
  transition: transform 360ms ease;
}
.story-modal:not([hidden]) .story-card { transform: translateY(0); }

/* Custom scrollbar inside the card */
.story-card::-webkit-scrollbar { width: 8px; }
.story-card::-webkit-scrollbar-thumb { background: rgba(233, 199, 133, 0.25); border-radius: 4px; }
.story-card::-webkit-scrollbar-track { background: transparent; }

.story-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(246, 236, 217, 0.20);
  background: rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 200ms ease, border-color 200ms ease;
}
.story-close:hover,
.story-close:focus-visible {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(233, 199, 133, 0.7);
  outline: none;
}

.story-header {
  text-align: center;
  margin: 0.5rem 0 1.6rem 0;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(233, 199, 133, 0.18);
}
.story-eyebrow {
  font-family: var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0 0 0.6rem 0;
}
.story-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  margin: 0;
  background: linear-gradient(180deg, #fbe9c5 0%, #d8b27c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.story-body {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.62;
  color: var(--ink);
}
.story-body p {
  margin: 0 0 1.05em 0;
}
.story-body strong {
  font-weight: 600;
  color: #fbe9c5;
}
.story-body em {
  color: var(--gold);
  font-style: italic;
}

/* Rhythmic short lines — tighter spacing, slightly muted */
.story-beat {
  margin: 0 0 0.35em 0 !important;
  color: var(--ink-soft);
}
.story-beat + p:not(.story-beat) { margin-top: 1.2em; }

.story-coda {
  margin-top: 1.6em !important;
  font-style: italic;
  color: var(--gold);
  font-size: 1.05em;
}

.story-final {
  margin-top: 2em !important;
  text-align: center;
  font-style: italic;
  font-size: 1.15em;
  color: #fbe9c5;
  padding-top: 1.2em;
  border-top: 1px solid rgba(233, 199, 133, 0.18);
}

.story-footer {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(233, 199, 133, 0.18);
  text-align: center;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-mute);
  line-height: 1.5;
}
.story-footer p { margin: 0.2rem 0; }
.story-footer a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted rgba(233, 199, 133, 0.45);
}
.story-footer a:hover { color: #fbe9c5; }

@media (max-width: 540px) {
  .story-title { font-size: 1.5rem; }
  .story-body { font-size: 1rem; }
}

/* ==========================================================
   Tribute modal (cinematic experience in a popup)
   ========================================================== */
.tribute-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  opacity: 0;
  transition: opacity 600ms ease;
}
.tribute-modal:not([hidden]) { opacity: 1; }
.tribute-modal[hidden] { display: none; }

.tribute-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(10,7,5,0.85) 0%, rgba(0,0,0,0.96) 80%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.tribute-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 1122 / 1402; /* matches the photo ratio so images fit edge-to-edge */
  width: min(94vw, calc(90dvh * 1122 / 1402));
  max-width: 94vw;
  max-height: 90dvh;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.85);
  outline: 1px solid rgba(233, 199, 133, 0.18);
  container-type: inline-size;
}

.tribute-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(246, 236, 217, 0.30);
  background: rgba(0, 0, 0, 0.55);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 200ms ease, border-color 200ms ease;
}
.tribute-close:hover, .tribute-close:focus-visible {
  background: rgba(0, 0, 0, 0.78);
  border-color: rgba(233, 199, 133, 0.85);
  outline: none;
}

/* ==========================================================
   Stage + scenes (inside the tribute frame)
   ========================================================== */
.stage {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: #000;
}

.scene {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity var(--fade) ease;
  pointer-events: none;
  will-change: opacity;
}
.scene.active { opacity: 1; }

/* Scene motion is split across two nested elements so the transforms
   compose naturally (single-element transforms with custom properties
   in calc() don't always recompute reliably across browsers).
   - .scene-motion handles scale (baseline breathe + audio-reactive pulse)
   - .scene-rock   handles rotation (clockwise then anti-clockwise rocking)
   --audio-pulse is JS-driven from AnalyserNode loudness so the zoom
   syncs to the song's dynamic build-ups. */
@property --breathe {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}
:root { --audio-pulse: 0; }

.scene-motion {
  position: absolute;
  inset: 0;
  transform-origin: center;
  will-change: transform;
  /* Baseline breathe gives the picture life when audio is paused.
     Audio-pulse drives the song-synced zoom while playing. The transition
     and the JS-side smoothing together iron out frame-to-frame jitter. */
  transform: scale(calc(1 + var(--breathe) * 0.07 + var(--audio-pulse) * 0.13));
  transition: transform 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
}
.scene.active .scene-motion {
  animation: breathe-cycle 13s ease-in-out infinite;
}
@keyframes breathe-cycle {
  0%, 100% { --breathe: 0; }
  50%      { --breathe: 1; }
}

.scene-rock {
  position: absolute;
  inset: 0;
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
}
.scene.active .scene-rock {
  animation: rock-cycle 18s ease-in-out infinite;
}
@keyframes rock-cycle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(1deg); }   /* clockwise tilt */
  50%      { transform: rotate(0deg); }
  75%      { transform: rotate(-1deg); }  /* anti-clockwise tilt */
}

.scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center;
  will-change: transform, filter;
}

/* Cinematic vignette + warmth pass over every scene */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(20,10,4,0.10) 0%, rgba(20,10,4,0.30) 100%);
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

/* ----- Scene 1 — Mother praying: slow push-in + warm glow pulse ----- */
.scene[data-scene="1"].active img {
  animation: scene1-pushin 70s ease-out forwards;
}
.scene[data-scene="1"] .overlay-glow {
  background: radial-gradient(ellipse at 60% 40%, rgba(255, 200, 120, 0.35) 0%, rgba(255, 180, 90, 0.15) 35%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
}
.scene[data-scene="1"].active .overlay-glow {
  animation: glow-pulse 9s ease-in-out infinite;
}
@keyframes scene1-pushin {
  from { transform: scale(1.00); }
  to   { transform: scale(1.10); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.65; }
}

/* ----- Scene 2 — Holding hand: forward push + sunrise flare growth ----- */
.scene[data-scene="2"].active img {
  animation: scene2-forward 70s ease-out forwards;
}
.scene[data-scene="2"] .overlay-flare {
  background: radial-gradient(circle at 18% 28%, rgba(255, 220, 150, 0.0) 0%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 1;
}
.scene[data-scene="2"].active .overlay-flare {
  animation: scene2-flare 70s ease-out forwards;
}
@keyframes scene2-forward {
  from { transform: scale(1.00) translateY(0); }
  to   { transform: scale(1.10) translateY(-2%); }
}
@keyframes scene2-flare {
  0%   { background: radial-gradient(circle at 18% 28%, rgba(255, 220, 150, 0.10) 0%, transparent 30%); }
  100% { background: radial-gradient(circle at 18% 28%, rgba(255, 220, 150, 0.55) 0%, rgba(255, 220, 150, 0.20) 25%, transparent 60%); }
}

/* ----- Scene 3 — Three generations: camera rise + parallax shimmer ----- */
.scene[data-scene="3"].active img {
  animation: scene3-rise 70s ease-out forwards;
}
.scene[data-scene="3"] .overlay-shimmer {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 235, 195, 0.18) 50%, transparent 70%);
  mix-blend-mode: screen;
  background-size: 220% 220%;
  opacity: 0;
}
.scene[data-scene="3"].active .overlay-shimmer {
  animation: scene3-shimmer 12s ease-in-out infinite, shimmer-fadein 2s ease forwards;
}
@keyframes scene3-rise {
  from { transform: translateY(2%) scale(1.04); }
  to   { transform: translateY(0)  scale(1.00); }
}
@keyframes scene3-shimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
@keyframes shimmer-fadein {
  to { opacity: 0.9; }
}

/* ----- Scene 4 — Heart of home: slow pan + candle flicker ----- */
.scene[data-scene="4"].active img {
  animation: scene4-pan 70s ease-in-out forwards, scene4-flicker 6s steps(1, end) infinite;
}
.scene[data-scene="4"] .overlay-flicker {
  background: radial-gradient(ellipse at 70% 55%, rgba(255, 170, 90, 0.30) 0%, transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.7;
}
.scene[data-scene="4"].active .overlay-flicker {
  animation: candle-flicker 1.4s steps(1, end) infinite;
}
@keyframes scene4-pan {
  from { transform: translateX(-2.2%) scale(1.04); }
  to   { transform: translateX( 2.2%) scale(1.04); }
}
@keyframes scene4-flicker {
  0%, 100% { filter: brightness(1.00); }
  10%      { filter: brightness(1.06); }
  17%      { filter: brightness(0.96); }
  22%      { filter: brightness(1.04); }
  60%      { filter: brightness(1.00); }
  72%      { filter: brightness(0.97); }
  82%      { filter: brightness(1.05); }
}
@keyframes candle-flicker {
  0%   { opacity: 0.62; }
  20%  { opacity: 0.78; }
  35%  { opacity: 0.55; }
  55%  { opacity: 0.72; }
  70%  { opacity: 0.60; }
  100% { opacity: 0.70; }
}

/* ----- Scene 5 — Faith-filled: slow zoom + sweeping light rays ----- */
.scene[data-scene="5"].active img {
  animation: scene5-zoom 80s ease-out forwards;
}
.scene[data-scene="5"] .overlay-rays {
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 230, 180, 0.10) 50%, transparent 62%),
    linear-gradient(115deg, transparent 42%, rgba(255, 230, 180, 0.06) 55%, transparent 68%);
  mix-blend-mode: screen;
  background-size: 200% 200%, 240% 240%;
  opacity: 0;
}
.scene[data-scene="5"].active .overlay-rays {
  animation: rays-sweep 16s linear infinite, rays-fadein 2s ease forwards;
}
@keyframes scene5-zoom {
  from { transform: scale(1.00); }
  to   { transform: scale(1.12); }
}
@keyframes rays-sweep {
  0%   { background-position: 0% 0%, 100% 100%; }
  100% { background-position: 100% 100%, 0% 0%; }
}
@keyframes rays-fadein {
  to { opacity: 1; }
}

/* ==========================================================
   Captions
   ========================================================== */
.captions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(0.8rem, 3cqw, 1.6rem);
  padding: 0 clamp(0.8rem, 4cqw, 2rem);
  text-align: center;
  z-index: 20;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 1px 4px rgba(0, 0, 0, 0.95);
}

.caption-en,
.caption-tl {
  margin: 0 auto;
  max-width: 90%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 800ms ease, transform 800ms ease;
}

.caption-en {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(0.95rem, 4.4cqw, 1.55rem);
  line-height: 1.32;
  color: var(--ink);
  letter-spacing: 0.005em;
}

.caption-tl {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.85rem, 3.4cqw, 1.2rem);
  line-height: 1.32;
  color: var(--gold);
  margin-top: 0.5rem;
}

.caption-en.show,
.caption-tl.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   Closing card
   ========================================================== */
.closing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5cqw, 2.5rem);
  text-align: center;
  z-index: 25;
  background: radial-gradient(ellipse at center, rgba(20, 10, 4, 0.55) 0%, rgba(6, 4, 3, 0.94) 75%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 1500ms ease, visibility 0s linear 1500ms;
  overflow-y: auto;
}
.closing.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 1500ms ease, visibility 0s linear 0s;
}

.closing-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 7cqw, 3rem);
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(180deg, #fbe9c5 0%, #d8b27c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.closing-line--small {
  font-size: clamp(1.05rem, 4.5cqw, 1.8rem);
  margin-top: 0.5rem;
  font-style: italic;
}
.closing-tl {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: clamp(0.9rem, 3cqw, 1.15rem);
  margin: 1.1rem 0 0 0;
  letter-spacing: 0.01em;
}

.replay-btn {
  margin-top: 2.2rem;
  appearance: none;
  border: 1px solid rgba(233, 199, 133, 0.55);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.85em 2em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 220ms ease, border-color 220ms ease;
}
.replay-btn:hover,
.replay-btn:focus-visible {
  background: rgba(233, 199, 133, 0.14);
  border-color: rgba(233, 199, 133, 0.85);
  outline: none;
}

/* ==========================================================
   Thunder mute toggle (bottom-right of hero)
   ========================================================== */
.thunder-mute {
  position: fixed;
  right: clamp(0.8rem, 2.2vw, 1.4rem);
  bottom: clamp(0.8rem, 2.2vw, 1.4rem);
  z-index: 45;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(246, 236, 217, 0.22);
  background: rgba(0, 0, 0, 0.45);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 200ms ease, border-color 200ms ease, opacity 200ms ease;
  appearance: none;
  padding: 0;
  overflow: hidden;
}
.thunder-mute:hover,
.thunder-mute:focus-visible {
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(233, 199, 133, 0.65);
  outline: none;
}
.thunder-mute-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  filter: drop-shadow(0 0 4px rgba(233, 199, 133, 0.35));
  transition: opacity 200ms ease;
}
.thunder-mute-slash {
  position: absolute;
  inset: 50% 50% auto auto;
  transform: translate(50%, -50%) rotate(-32deg);
  width: 24px;
  height: 1.6px;
  background: var(--gold);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 220ms ease;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.thunder-mute.is-muted .thunder-mute-icon { opacity: 0.4; }
.thunder-mute.is-muted .thunder-mute-slash { opacity: 1; }

/* ==========================================================
   Mute button
   ========================================================== */
.mute-btn {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  z-index: 45;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(246, 236, 217, 0.25);
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 300ms ease, background 220ms ease, border-color 220ms ease;
}
.mute-btn:hover,
.mute-btn:focus-visible {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(246, 236, 217, 0.55);
  outline: none;
}
.mute-btn[aria-pressed="true"] .mute-icon::after {
  content: " ✕";
  font-size: 12px;
  color: var(--gold);
}
.mute-btn[hidden] { display: none !important; }

/* ==========================================================
   Responsive tweaks
   ========================================================== */
@media (max-width: 540px) {
  .ai-banner { font-size: 0.62rem; letter-spacing: 0.22em; padding: 0.4em 0.95em; }
  .hero { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .hero-sub br { display: none; }
  .caption-en { line-height: 1.28; }
}

@media (prefers-reduced-motion: reduce) {
  .scene img,
  .scene .overlay,
  .scene-motion,
  .scene-rock,
  .star,
  .lightning-layer,
  .lightning-layer::before,
  .lightning-layer::after {
    animation: none !important;
    transform: none !important;
  }
  .caption-en,
  .caption-tl {
    transition: opacity 200ms ease;
    transform: none;
  }
}
