/* ============================================
   गौतम बुद्ध story + hidden birthday surprise
   Mobile-first · Static · No frameworks
   ============================================ */

:root {
  --cream: #f3ead8;
  --beige: #e8dcc4;
  --sand: #d9c7a5;
  --gold: #b8954a;
  --gold-soft: #c9a96a;
  --brown: #3d2e1e;
  --brown-soft: #5c4632;
  --ink: #2a1f14;
  --green: #5a6b4a;
  --green-soft: #7a8f68;
  --muted: #7a6a55;
  --paper: #faf6ee;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font-ne: "Noto Sans Devanagari", "Noto Sans", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-bday: "Playfair Display", Georgia, serif;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ne);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100dvh;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Reading progress ---------- */
.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1000;
  background: transparent;
  padding-top: var(--safe-top);
  pointer-events: none;
}

.progress-fill {
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--green-soft));
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

body.is-birthday .progress-track {
  display: none;
}

/* ---------- Buddha page ---------- */
.buddha-page {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(184, 149, 74, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(90, 107, 74, 0.08), transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, var(--paper) 40%, var(--beige) 100%);
  min-height: 100dvh;
  padding-bottom: calc(2.5rem + var(--safe-bottom));
  transition: opacity 0.8s var(--ease), filter 0.8s var(--ease);
}

.buddha-page.is-fading {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

.buddha-hero {
  padding: calc(3.5rem + var(--safe-top)) 1.35rem 2.5rem;
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
}

.hero-ornament {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.lotus-css {
  position: relative;
  width: 72px;
  height: 72px;
}

.lotus-css span {
  position: absolute;
  inset: 18px;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  border-radius: 50% 50% 50% 0;
  opacity: 0.75;
  transform-origin: center;
}

.lotus-css span:nth-child(1) { transform: rotate(0deg) translateY(-14px); }
.lotus-css span:nth-child(2) { transform: rotate(60deg) translateY(-14px); }
.lotus-css span:nth-child(3) { transform: rotate(120deg) translateY(-14px); }
.lotus-css span:nth-child(4) { transform: rotate(180deg) translateY(-14px); }
.lotus-css span:nth-child(5) { transform: rotate(240deg) translateY(-14px); }
.lotus-css span:nth-child(6) { transform: rotate(300deg) translateY(-14px); }

.lotus-css::after {
  content: "";
  position: absolute;
  inset: 28px;
  background: var(--cream);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--font-ne);
  font-size: clamp(2.4rem, 10vw, 3.4rem);
  font-weight: 700;
  color: var(--brown);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--brown-soft);
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.hero-divider {
  width: 64px;
  height: 1px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.8;
}

.story-article {
  max-width: 38rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.story-section {
  margin-bottom: 2.5rem;
}

.story-section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(184, 149, 74, 0.28);
  line-height: 1.4;
}

.story-section p {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 1.1rem;
  text-align: justify;
  hyphens: auto;
}

.story-section p:last-child {
  margin-bottom: 0;
}

.story-closing {
  margin-top: 1.25rem;
  padding: 1.25rem 0 0.5rem;
  text-align: center;
}

.closing-ornament {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  position: relative;
}

.closing-ornament::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--green-soft);
  border-radius: 50%;
}

.closing-quote {
  font-size: 1rem;
  color: var(--brown);
  font-weight: 500;
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.closing-reflect {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 24rem;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.read-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.45rem;
  min-height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brown) 0%, #4a3724 100%);
  color: var(--cream);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(61, 46, 30, 0.22);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.read-more-btn:hover,
.read-more-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(61, 46, 30, 0.3);
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.read-more-btn:active {
  transform: translateY(0);
}

.rm-arrow {
  transition: transform 0.25s var(--ease);
}

.read-more-btn:hover .rm-arrow {
  transform: translateX(4px);
}

.read-more-hint {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.buddha-footer {
  text-align: center;
  padding: 1rem 1rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- Transition overlay ---------- */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #05030a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.glow-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 20px 8px rgba(255, 182, 210, 0.6);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.4s ease, transform 1.2s var(--ease);
}

.glow-dot.show {
  opacity: 1;
  transform: scale(1);
}

.glow-dot.expand {
  transform: scale(120);
  opacity: 0.15;
  transition: transform 1.4s var(--ease), opacity 1.4s ease;
}

.transition-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-bday);
  font-size: clamp(2rem, 12vw, 3.5rem);
  color: #fff;
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
  text-shadow: 0 0 40px rgba(255, 150, 180, 0.4);
}

.transition-text.show {
  opacity: 1;
  transform: scale(1);
}

.transition-text.pulse {
  animation: textPulse 0.8s ease;
}

@keyframes textPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---------- Birthday page ---------- */
.birthday-page {
  position: relative;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(180, 60, 110, 0.35), transparent 55%),
    radial-gradient(ellipse 80% 50% at 10% 40%, rgba(90, 40, 140, 0.3), transparent 50%),
    radial-gradient(ellipse 70% 40% at 90% 70%, rgba(200, 120, 60, 0.15), transparent 45%),
    linear-gradient(180deg, #0a0614 0%, #160b22 35%, #1a0e28 70%, #0d0818 100%);
  color: #f8eef5;
  overflow-x: hidden;
  padding-bottom: calc(3rem + var(--safe-bottom));
}

.birthday-page[hidden] {
  display: none !important;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.light-rays {
  position: fixed;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background:
    conic-gradient(from 0deg at 50% 30%,
      transparent 0deg,
      rgba(255, 200, 220, 0.06) 20deg,
      transparent 40deg,
      rgba(255, 220, 160, 0.05) 70deg,
      transparent 100deg,
      rgba(200, 160, 255, 0.05) 140deg,
      transparent 180deg,
      rgba(255, 180, 200, 0.05) 220deg,
      transparent 260deg,
      rgba(255, 220, 160, 0.04) 300deg,
      transparent 360deg);
  animation: raysSpin 48s linear infinite;
  opacity: 0.7;
}

@keyframes raysSpin {
  to { transform: rotate(360deg); }
}

.balloons {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.balloon {
  position: absolute;
  bottom: -80px;
  width: 28px;
  height: 36px;
  border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
  opacity: 0.45;
  animation: balloonRise 14s linear infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.35);
  transform: translateX(-50%);
}

.b1 { left: 12%; background: #e85a8a; animation-duration: 16s; animation-delay: 0s; }
.b2 { left: 38%; background: #9b5de5; animation-duration: 18s; animation-delay: -4s; width: 22px; height: 30px; }
.b3 { left: 64%; background: #ffd166; animation-duration: 15s; animation-delay: -8s; }
.b4 { left: 84%; background: #ff8fab; animation-duration: 17s; animation-delay: -2s; width: 24px; height: 32px; }

@keyframes balloonRise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.45; }
  50% { transform: translateY(-55vh) translateX(12px); }
  100% { transform: translateY(-110vh) translateX(-8px); opacity: 0; }
}

.music-dock {
  position: fixed;
  top: calc(0.75rem + var(--safe-top));
  right: calc(0.75rem + var(--safe-right));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.music-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.music-btn:hover,
.music-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.play-song-cta {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #e85a8a, #c44d9a);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(200, 60, 120, 0.4);
  white-space: nowrap;
}

.bday-section {
  position: relative;
  z-index: 10;
  padding: 4rem 1.25rem;
  min-height: 70dvh;
  display: flex;
  align-items: center;
}

.section-inner {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f0a8c4;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
}

.section-title {
  font-family: var(--font-bday);
  font-size: clamp(1.75rem, 7vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.75rem;
  background: linear-gradient(120deg, #fff 0%, #f7c4d8 50%, #ffd89a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Reveal hero */
.reveal-hero {
  min-height: 100dvh;
  justify-content: center;
  text-align: center;
  padding-top: calc(2rem + var(--safe-top));
}

.reveal-title {
  font-family: var(--font-bday);
  font-size: clamp(2.6rem, 12vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 60px rgba(255, 120, 170, 0.45);
  min-height: 2.4em;
  white-space: pre-line;
}

.reveal-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  animation: charIn 0.45s var(--ease) forwards;
}

@keyframes charIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-name {
  margin-top: 1rem;
  font-family: var(--font-bday);
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  color: #ffb6d0;
  opacity: 1;
  transform: scale(0.92);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  text-shadow: 0 0 30px rgba(255, 100, 150, 0.5);
}

.reveal-name.show {
  opacity: 1;
  transform: scale(1);
}

.reveal-gif {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.15rem auto 0;
  margin-top: 60px;
  border-radius: 14px;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.reveal-gif.show {
  opacity: 1;
  transform: scale(1);
}

.reveal-gif[hidden] {
  display: none !important;
}

.scroll-cue {
  position: absolute;
  bottom: calc(1.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.scroll-cue.show {
  opacity: 1;
}

.scroll-cue span {
  display: block;
  width: 4px;
  height: 8px;
  margin: 8px auto 0;
  background: #ffb6d0;
  border-radius: 2px;
  animation: cueBounce 1.4s ease infinite;
}

@keyframes cueBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.4; }
}

/* Letter */
.letter-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 200, 220, 0.2);
  border-radius: var(--radius);
  padding: 1.75rem 1.4rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #f5e6ef;
  white-space: pre-line;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Memories */
.memory-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0.15rem 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.memory-rail::-webkit-scrollbar {
  display: none;
}

.memory-card {
  flex: 0 0 78%;
  scroll-snap-align: center;
  background: #fff;
  color: #2a1f14;
  border-radius: 6px 6px 10px 10px;
  padding: 0.65rem 0.65rem 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: rotate(-1.5deg);
  transition: transform 0.3s var(--ease);
  text-align: left;
}

.memory-card:nth-child(even) {
  transform: rotate(1.8deg);
}

.memory-card:active {
  transform: scale(0.98) rotate(0);
}

.memory-card img,
.memory-fallback {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  background: linear-gradient(145deg, #e8d5c4, #c9a896);
}

.memory-fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-bday);
  font-size: 0.95rem;
  color: #6a4a3a;
}

.memory-card h3 {
  margin-top: 0.75rem;
  font-family: var(--font-bday);
  font-size: 1.05rem;
}

.memory-card p {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
  font-family: var(--font-ne);
}

/* Timeline */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(180deg, #e85a8a, #9b5de5, #ffd89a);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
  padding-left: 1rem;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffb6d0;
  box-shadow: 0 0 12px rgba(255, 150, 180, 0.7);
}

.timeline-item h3 {
  font-family: var(--font-bday);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
  color: #fff;
}

.timeline-item p {
  font-size: 0.95rem;
  color: #d4b8c8;
  line-height: 1.65;
}

/* Open when */
.openwhen-grid {
  display: grid;
  gap: 0.85rem;
}

.openwhen-card {
  width: 100%;
  text-align: left;
  padding: 1.15rem 1.2rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 200, 220, 0.18);
  color: #f8eef5;
  font-size: 1rem;
  line-height: 1.45;
  min-height: 56px;
  transition: background 0.25s ease, transform 0.25s var(--ease);
}

.openwhen-card:hover,
.openwhen-card:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  outline: none;
}

.openwhen-card .ow-emoji {
  margin-right: 0.45rem;
}

/* Distance */
.distance-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

.distance-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.distance-point .flag {
  font-size: 2rem;
}

.distance-point .place {
  font-family: var(--font-bday);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: #ffd89a;
}

.distance-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
}

.line-beam {
  width: 2px;
  height: 72px;
  background: linear-gradient(180deg, #e85a8a, #9b5de5);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.line-beam::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30%;
  background: #fff;
  opacity: 0.7;
  animation: beamTravel 2s ease-in-out infinite;
}

@keyframes beamTravel {
  0% { top: -30%; }
  100% { top: 100%; }
}

.pulse-heart {
  font-size: 1rem;
  animation: heartPulse 1.6s ease infinite;
}

.pulse-heart:nth-child(3) {
  animation-delay: 0.8s;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.2); opacity: 1; }
}

.distance-caption {
  text-align: center;
  font-family: var(--font-bday);
  font-size: 1.4rem;
  font-style: italic;
  color: #f7c4d8;
  line-height: 1.5;
}

/* Gift */
.gift-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem;
  min-height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e85a8a, #9b5de5);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(180, 60, 140, 0.4);
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}

.gift-btn:hover,
.gift-btn:focus-visible {
  transform: translateY(-2px) scale(1.02);
  outline: none;
}

.gift-reveal {
  margin-top: 2rem;
  padding: 1.75rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 215, 150, 0.12), rgba(255, 120, 170, 0.08));
  border: 1px solid rgba(255, 210, 150, 0.3);
  text-align: center;
  animation: giftPop 0.7s var(--ease);
}

@keyframes giftPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gift-reveal h3 {
  font-family: var(--font-bday);
  font-size: 1.5rem;
  margin-bottom: 0.85rem;
  color: #ffd89a;
}

.gift-reveal p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #f0dce6;
  white-space: pre-line;
}

.gift-gif {
  display: block;
  width: min(240px, 70vw);
  height: auto;
  margin: 1.25rem auto 0;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.gift-gif[hidden] {
  display: none !important;
}

.gift-link {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
  color: #fff;
  font-size: 0.95rem;
}

.gift-reveal[hidden],
.gift-link[hidden] {
  display: none !important;
}

/* Finale */
.finale-section {
  min-height: 100dvh;
  text-align: center;
  overflow: hidden;
}

.finale-glow {
  position: absolute;
  inset: 20% 10%;
  background: radial-gradient(circle, rgba(232, 90, 138, 0.35), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  animation: finaleGlow 4s ease-in-out infinite alternate;
}

@keyframes finaleGlow {
  from { opacity: 0.6; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.08); }
}

.finale-inner {
  position: relative;
  z-index: 2;
}

.finale-title {
  font-family: var(--font-bday);
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  margin-bottom: 1.5rem;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 120, 170, 0.5);
}

.finale-message {
  font-size: 1.08rem;
  line-height: 1.85;
  color: #f0dce6;
  white-space: pre-line;
  margin-bottom: 2rem;
}

.finale-line {
  font-family: var(--font-bday);
  font-style: italic;
  font-size: 1.15rem;
  color: #ffb6d0;
  line-height: 1.6;
}

/* Scroll reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(5, 3, 10, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(1.5rem + var(--safe-top)) 1rem calc(1.5rem + var(--safe-bottom));
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-height: 65dvh;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-close,
.letter-modal-close {
  position: absolute;
  top: calc(0.75rem + var(--safe-top));
  right: calc(0.75rem + var(--safe-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.lightbox-meta {
  margin-top: 1rem;
  text-align: center;
  max-width: 24rem;
  color: #f5e6ef;
}

.lightbox-meta h3 {
  font-family: var(--font-bday);
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.lightbox-meta p {
  font-size: 0.95rem;
  color: #d4b8c8;
}

/* Letter modal */
.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(5, 3, 10, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-top: calc(1.25rem + var(--safe-top));
  padding-bottom: calc(1.25rem + var(--safe-bottom));
}

.letter-modal[hidden] {
  display: none !important;
}

.letter-modal-card {
  position: relative;
  width: 100%;
  max-width: 24rem;
  max-height: 80dvh;
  overflow-y: auto;
  background: linear-gradient(165deg, #2a1528, #1a0e22);
  border: 1px solid rgba(255, 180, 200, 0.25);
  border-radius: 18px;
  padding: 2.25rem 1.5rem 1.75rem;
  animation: giftPop 0.45s var(--ease);
}

.letter-modal-card h3 {
  font-family: var(--font-bday);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #ffb6d0;
  padding-right: 2rem;
}

.letter-modal-card p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #f0dce6;
  white-space: pre-line;
}

body.no-scroll {
  overflow: hidden;
  height: 100dvh;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-on-scroll,
  .timeline-item {
    opacity: 1;
    transform: none;
  }

  .line-beam::after {
    animation: none;
  }

  .light-rays,
  .balloons {
    display: none;
  }
}

/* Wider phones */
@media (min-width: 430px) {
  .story-article {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .memory-card {
    flex-basis: 70%;
  }
}

@media (min-width: 768px) {
  .bday-section {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .memory-card {
    flex-basis: 42%;
  }

  .openwhen-grid {
    grid-template-columns: 1fr 1fr;
  }
}
