/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Playfair Display', Georgia, serif;
  overflow-x: hidden;
  width: 100%;
  background: #1a0a0f;
  color: #fce7f3;
  transition: background 0.4s, color 0.4s;
}

/* ── LIGHT THEME ── */
[data-theme="light"] body {
  background: #fff0f3;
  color: #3d0a1e;
}
[data-theme="light"] .section { background: transparent; }
[data-theme="light"] .hero-section { background: transparent; }
[data-theme="light"] .card-section { background: rgba(255,240,243,0.6); }
[data-theme="light"] .gallery-section { background: transparent; }
[data-theme="light"] .wishes-section { background: rgba(255,240,243,0.5); }
[data-theme="light"] .message-section { background: transparent; }
[data-theme="light"] .celebration-section { background: linear-gradient(135deg,#fff0f3,#ffe4e6,#fff0f3); }
[data-theme="light"] .glass-card { background: rgba(255,255,255,0.55); border-color: rgba(244,63,94,0.2); }
[data-theme="light"] .wish-card { background: rgba(255,255,255,0.7); }
[data-theme="light"] .navbar { background: rgba(255,240,243,0.85); border-color: rgba(244,63,94,0.15); }
[data-theme="light"] .navbar a { color: #be123c; }
[data-theme="light"] .hero-sub,
[data-theme="light"] .hero-name { color: #be123c; }
[data-theme="light"] .section-sub,
[data-theme="light"] .scroll-hint { color: #be123c99; }
[data-theme="light"] .wish-message { color: #3d0a1e; }
[data-theme="light"] .message-text { color: #3d0a1e; }
/* theme-toggle light styles defined in button section below */

::selection { background: #f43f5e33; color: #f43f5e; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #1a0a0f; }
::-webkit-scrollbar-thumb { background: #f43f5e; border-radius: 3px; }

/* ══════════════════════════════════════════
   FIXED CANVASES
══════════════════════════════════════════ */
#confetti-canvas,
#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
#confetti-canvas { z-index: 50; }

/* ══════════════════════════════════════════
   LOADING SCREEN
══════════════════════════════════════════ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a0a0f 0%, #3d0a1e 50%, #1a0a0f 100%);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
#loading-screen.hidden {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.loading-hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  z-index: 1;
}

.loading-cake {
  font-size: clamp(4rem, 15vw, 6rem);
  animation: cakeWobble 1.5s ease-in-out infinite;
}
@keyframes cakeWobble {
  0%,100%{transform:rotate(-3deg) scale(1);}
  50%{transform:rotate(3deg) scale(1.08);}
}

.loading-label {
  font-family: 'Lato', sans-serif;
  color: #fda4af;
  font-size: clamp(0.85rem, 3vw, 1rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

.progress-bar-wrap {
  width: min(260px, 70vw);
  height: 4px;
  background: #3d0a1e;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #f43f5e, #ec4899, #fb923c);
  box-shadow: 0 0 10px rgba(244,63,94,0.8);
  transition: width 0.05s linear;
}
.progress-num {
  font-family: monospace;
  color: #fda4af;
  font-size: 0.85rem;
}

/* Welcome overlay */
.welcome-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(135deg, #1a0a0f 0%, #3d0a1e 50%, #1a0a0f 100%);
}
.welcome-overlay.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.welcome-emoji { font-size: clamp(3rem, 12vw, 5rem); }
.welcome-title {
  font-size: clamp(2rem, 9vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, #fda4af, #f43f5e, #fce7f3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-sub {
  font-family: 'Lato', sans-serif;
  color: #fda4af;
  font-size: clamp(1rem, 4vw, 1.2rem);
}
.welcome-emojis {
  display: flex;
  gap: 12px;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
}
.welcome-emojis span {
  animation: bounceUp 0.8s ease-in-out infinite alternate;
}
.welcome-emojis span:nth-child(1){animation-delay:0s;}
.welcome-emojis span:nth-child(2){animation-delay:.1s;}
.welcome-emojis span:nth-child(3){animation-delay:.2s;}
.welcome-emojis span:nth-child(4){animation-delay:.3s;}
.welcome-emojis span:nth-child(5){animation-delay:.4s;}
@keyframes bounceUp {
  from{transform:translateY(0);}
  to{transform:translateY(-10px);}
}

/* ══════════════════════════════════════════
   THEME TOGGLE BUTTON
══════════════════════════════════════════ */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(244,63,94,0.5);
  background: linear-gradient(135deg, rgba(61,10,30,0.85), rgba(26,10,15,0.9));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(244,63,94,0.35), 0 4px 12px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s, background 0.3s;
}
.theme-toggle:hover {
  transform: scale(1.12) rotate(15deg);
  box-shadow: 0 0 28px rgba(244,63,94,0.7), 0 4px 18px rgba(0,0,0,0.5);
  border-color: #f43f5e;
}
.theme-toggle:active { transform: scale(0.95); }

[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,240,243,0.9));
  border-color: rgba(244,63,94,0.4);
  box-shadow: 0 0 14px rgba(244,63,94,0.25), 0 4px 12px rgba(0,0,0,0.15);
}
[data-theme="light"] .theme-toggle:hover {
  box-shadow: 0 0 28px rgba(244,63,94,0.55), 0 4px 18px rgba(0,0,0,0.2);
  border-color: #f43f5e;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 0 0 20px 20px;
  background: rgba(26,10,15,0.75);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(244,63,94,0.12);
  border-top: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.navbar.visible { opacity: 1; pointer-events: auto; }
.navbar a {
  color: rgba(253,164,175,0.7);
  text-decoration: none;
  font-size: clamp(0.9rem, 3vw, 1rem);
  padding: 4px 8px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.navbar a:hover {
  background: rgba(244,63,94,0.15);
  color: #fce7f3;
}

/* ══════════════════════════════════════════
   SECTIONS — SHARED
══════════════════════════════════════════ */
.section {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(60px, 12vw, 100px) clamp(16px, 5vw, 48px);
  overflow: hidden;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(32px, 6vw, 60px);
}
.section-eyebrow {
  display: block;
  font-family: 'Lato', sans-serif;
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fb7185;
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(2rem, 8vw, 3.75rem);
  font-weight: 700;
  background: linear-gradient(135deg, #fda4af, #f43f5e, #fce7f3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.section-sub {
  font-family: 'Lato', sans-serif;
  color: rgba(253,164,175,0.65);
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  max-width: 420px;
  margin: 12px auto 0;
  font-weight: 300;
}

/* Section divider */
.section-divider {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 24px;
  z-index: 1;
}
.section-divider .div-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,63,94,0.3), transparent);
}
.section-divider .div-star {
  color: rgba(244,63,94,0.4);
  font-size: 0.85rem;
  animation: rotateStar 8s linear infinite;
}
@keyframes rotateStar { to{transform:rotate(360deg);} }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero-section {
  background: transparent;
  text-align: center;
}

.hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(244,63,94,0.15);
  pointer-events: none;
  animation: rotate 20s linear infinite;
}
.ring-1 {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  animation-duration: 20s;
}
.ring-1::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 10px; height: 10px;
  background: #f43f5e;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.ring-2 {
  width: min(380px, 90vw);
  height: min(380px, 90vw);
  border-color: rgba(236,72,153,0.08);
  animation-direction: reverse;
  animation-duration: 30s;
}
@keyframes rotate { to { transform: rotate(360deg); } }

.floating-emojis {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.floating-emojis span {
  position: absolute;
  font-size: clamp(1.2rem, 4vw, 2rem);
  animation: floatEmoji var(--spd, 3s) ease-in-out infinite;
}
.floating-emojis span:nth-child(1){left:5%;top:10%;--spd:3s;animation-delay:0s;}
.floating-emojis span:nth-child(2){left:30%;top:10%;--spd:4s;animation-delay:0.3s;}
.floating-emojis span:nth-child(3){left:55%;top:10%;--spd:3.5s;animation-delay:0.6s;}
.floating-emojis span:nth-child(4){left:80%;top:10%;--spd:5s;animation-delay:0.9s;}
.floating-emojis span:nth-child(5){left:5%;top:75%;--spd:4s;animation-delay:1.2s;}
.floating-emojis span:nth-child(6){left:30%;top:75%;--spd:3s;animation-delay:1.5s;}
.floating-emojis span:nth-child(7){left:55%;top:75%;--spd:4.5s;animation-delay:1.8s;}
.floating-emojis span:nth-child(8){left:80%;top:75%;--spd:3.5s;animation-delay:2.1s;}
@keyframes floatEmoji {
  0%,100%{transform:translateY(0) rotate(-5deg) scale(1);}
  50%{transform:translateY(-20px) rotate(5deg) scale(1.12);}
}

/* Hide floating emojis on small screens to avoid clutter */
@media(max-width:480px){
  .floating-emojis { display:none; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 3vw, 20px);
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.0;
}
.title-word {
  display: block;
  font-size: clamp(3.2rem, 16vw, 7.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fda4af 0%, #f43f5e 40%, #fce7f3 70%, #fb7185 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(244,63,94,0.5));
  animation: titleIn 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}
#word-happy  { animation-delay: 0.1s; }
#word-birthday { animation-delay: 0.3s; }
@keyframes titleIn {
  from{opacity:0;transform:translateY(30px) scale(0.9);}
  to{opacity:1;transform:translateY(0) scale(1);}
}

.hero-name {
  font-size: clamp(1.5rem, 7vw, 3rem);
  font-weight: 400;
  font-style: italic;
  color: #fda4af;
  letter-spacing: 0.1em;
  animation: fadeUp 0.8s 0.5s ease both;
}

.divider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(240px, 60vw);
  animation: fadeUp 0.6s 0.8s ease both;
}
.divider-line {
  flex: 1;
  height: 1px;
}
.divider-line:first-child { background: linear-gradient(90deg, transparent, #f43f5e); }
.divider-line:last-child  { background: linear-gradient(90deg, #f43f5e, transparent); }
.divider-rose {
  font-size: 1.4rem;
  animation: roseWobble 2s ease-in-out infinite;
}
@keyframes roseWobble {
  0%,100%{transform:rotate(0deg) scale(1);}
  50%{transform:rotate(10deg) scale(1.2);}
}

.hero-sub {
  font-family: 'Lato', sans-serif;
  color: rgba(253,164,175,0.8);
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-weight: 300;
  max-width: 360px;
  line-height: 1.6;
  animation: fadeUp 0.8s 1s ease both;
}

.cta-btn {
  position: relative;
  border: none;
  border-radius: 50px;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 4vw, 1.1rem);
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  box-shadow: 0 0 28px rgba(244,63,94,0.45), 0 4px 20px rgba(0,0,0,0.3);
  padding: clamp(12px, 3vw, 16px) clamp(28px, 7vw, 44px);
  animation: fadeUp 0.8s 1.3s ease both;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(244,63,94,0.75), 0 4px 28px rgba(0,0,0,0.4);
}
.cta-btn:active { transform: scale(0.97); }

.celebrate-btn {
  position: relative;
  border: none;
  border-radius: 50px;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 4.5vw, 1.3rem);
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(135deg, #f43f5e, #ec4899, #fb923c);
  box-shadow: 0 0 40px rgba(244,63,94,0.5), 0 8px 28px rgba(0,0,0,0.4);
  padding: clamp(14px, 3vw, 18px) clamp(36px, 8vw, 52px);
  transition: transform 0.2s, box-shadow 0.2s;
}
.celebrate-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 70px rgba(244,63,94,0.85);
}
.celebrate-btn:active { transform: scale(0.97); }

.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-20deg) translateX(-200%);
  animation: shimmer 3s 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0%{transform:skewX(-20deg) translateX(-200%);}
  100%{transform:skewX(-20deg) translateX(200%);}
}

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(251,113,133,0.55);
  font-family: 'Lato', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: fadeUp 0.6s 2s ease both;
}
.scroll-arrow { animation: arrowBounce 1.5s ease-in-out infinite; font-size: 1.1rem; }
@keyframes arrowBounce {
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(7px);}
}

@keyframes fadeUp {
  from{opacity:0;transform:translateY(20px);}
  to{opacity:1;transform:translateY(0);}
}
@keyframes pulse {
  0%,100%{opacity:0.5;}
  50%{opacity:1;}
}

/* ══════════════════════════════════════════
   BIRTHDAY CARD
══════════════════════════════════════════ */
.card-section { gap: 0; }

.card-scene {
  perspective: 1200px;
  width: min(300px, 85vw);
  height: min(420px, 120vw);
  min-height: 340px;
  cursor: pointer;
  position: relative;
}

/* glow */
.card-scene::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 30px;
  background: transparent;
  box-shadow: 0 0 40px rgba(244,63,94,0.3);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}
.card-scene.flipped::before {
  box-shadow: 0 0 80px rgba(244,63,94,0.55), 0 0 120px rgba(236,72,153,0.3);
}
@keyframes glowPulse {
  0%,100%{opacity:0.7;} 50%{opacity:1;}
}

.card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.22,1,0.36,1);
}
.card-3d.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* FRONT */
.card-front {
  background: linear-gradient(145deg, #fff1f2, #ffe4e6, #fce7f3);
  box-shadow: 0 24px 56px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
}
.card-top-banner {
  height: 88px;
  background: linear-gradient(135deg, #f43f5e, #ec4899, #fb7185);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  flex-shrink: 0;
}
.card-top-banner span {
  animation: bannerBounce 1.5s ease-in-out infinite alternate;
}
.card-top-banner span:nth-child(1){animation-delay:0s;}
.card-top-banner span:nth-child(2){animation-delay:.2s;}
.card-top-banner span:nth-child(3){animation-delay:.1s;}
.card-top-banner span:nth-child(4){animation-delay:.3s;}
.card-top-banner span:nth-child(5){animation-delay:.15s;}
@keyframes bannerBounce {
  from{transform:translateY(0) rotate(-3deg);}
  to{transform:translateY(-6px) rotate(3deg);}
}
.card-photo-wrap {
  display: flex;
  justify-content: center;
  margin-top: -36px;
  position: relative;
  z-index: 2;
}
.card-photo {
  width: clamp(90px, 22vw, 112px);
  height: clamp(90px, 22vw, 112px);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 28px rgba(244,63,94,0.4);
}
.card-photo-spark {
  position: absolute;
  bottom: -4px;
  right: calc(50% - 70px);
  font-size: 1.2rem;
  animation: sparkSpin 2s ease-in-out infinite;
}
@keyframes sparkSpin {
  0%,100%{transform:rotate(0deg) scale(1);}
  50%{transform:rotate(15deg) scale(1.3);}
}
.card-front-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px 20px;
  text-align: center;
}
.card-name {
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  font-weight: 700;
  color: #be123c;
  margin-bottom: 8px;
}
.card-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #fda4af, transparent);
  margin: 6px 0;
}
.card-hb {
  color: #fb7185;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.1em;
}
.card-tap-hint {
  color: rgba(251,113,133,0.55);
  font-size: 0.72rem;
  margin-top: 10px;
  animation: pulse 2s ease-in-out infinite;
}

/* BACK */
.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #fff1f2, #fce7f3);
  box-shadow: 0 24px 56px rgba(0,0,0,0.45);
}
.card-inside {
  width: 100%;
  height: 100%;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}
.card-inside-top {
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.card-inside-top > span {
  font-size: 1.1rem;
  animation: bounceUp 1s ease-in-out infinite alternate;
}
.card-inside-top > div { display:flex; gap:4px; }
.card-from-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #be123c;
  margin-top: 4px;
}
.card-message-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}
.card-message-scroll::-webkit-scrollbar { width: 3px; }
.card-message-scroll::-webkit-scrollbar-thumb { background: #fda4af; border-radius: 2px; }
.card-message {
  font-size: clamp(0.7rem, 2.5vw, 0.82rem);
  line-height: 1.7;
  color: #7f1d1d;
  white-space: pre-line;
}
.card-inside-bottom {
  text-align: center;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.card-hearts { display: flex; gap: 6px; font-size: 1.1rem; }
.card-hearts span { animation: heartBeat 1s ease-in-out infinite; }
.card-hearts span:nth-child(1){animation-delay:0s;}
.card-hearts span:nth-child(2){animation-delay:.3s;}
.card-hearts span:nth-child(3){animation-delay:.6s;}
@keyframes heartBeat {
  0%,100%{transform:scale(1);}
  50%{transform:scale(1.2);}
}
.card-close-btn {
  background: none;
  border: none;
  color: #fb7185;
  font-size: 0.72rem;
  cursor: pointer;
  transition: color 0.2s;
}
.card-close-btn:hover { color: #be123c; }

.card-hint {
  margin-top: 18px;
  color: rgba(251,113,133,0.55);
  font-size: 0.82rem;
  font-family: 'Lato', sans-serif;
  animation: pulse 2s ease-in-out infinite;
  transition: opacity 0.4s;
}

/* ══════════════════════════════════════════
   GALLERY
══════════════════════════════════════════ */
.carousel-wrap {
  width: 100%;
  max-width: 250px;
}

.carousel-main {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  height: min(380px, 54vw + 100px);
  min-height: 220px;
  box-shadow: inset 0 0 0 1px rgba(244,63,94,0.2), 0 0 50px rgba(244,63,94,0.15);
  cursor: zoom-in;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(to top, rgba(26,10,15,0.9), transparent);
}
.slide-caption { color: #fff; font-size: clamp(0.9rem,3vw,1.05rem); font-weight: 600; }
.slide-date    { color: #fda4af; font-size: 0.8rem; font-family:'Lato',sans-serif; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.carousel-arrow:hover { transform: translateY(-50%) scale(1.1); background: rgba(244,63,94,0.5); }
.arrow-left  { left: 10px; }
.arrow-right { right: 10px; }

.carousel-caption {
  display: none; /* shown in slide-overlay */
}

.zoom-hint {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fda4af;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Lato', sans-serif;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.dot {
  height: 8px;
  border-radius: 4px;
  background: rgba(244,63,94,0.3);
  border: none;
  cursor: pointer;
  transition: width 0.3s, background 0.3s;
  width: 8px;
}
.dot.active {
  width: 22px;
  background: #f43f5e;
}

.carousel-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.carousel-thumbs::-webkit-scrollbar { display: none; }
.thumb {
  width: 68px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
  border: 2px solid transparent;
}
.thumb:hover { transform: scale(1.05) translateY(-2px); }
.thumb.active { border-color: #f43f5e; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  transition: opacity 0.2s;
}
.thumb.active .thumb-overlay { opacity: 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-inner {
  position: relative;
  max-width: 900px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  transform: scale(0.85);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
}
.lightbox.open .lightbox-inner { transform: scale(1); }
.lightbox-img { width: 100%; max-height: 80vh; object-fit: contain; display: block; }
.lightbox-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
}
.lightbox-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: #f43f5e; }

/* ══════════════════════════════════════════
   WISHES TIMELINE
══════════════════════════════════════════ */
.timeline {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.node-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  box-shadow: 0 0 18px rgba(244,63,94,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  position: relative;
  flex-shrink: 0;
}
.node-circle::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(244,63,94,0.5);
  animation: nodeRing 1.5s ease-in-out infinite;
}
@keyframes nodeRing {
  0%,100%{transform:scale(1);opacity:1;}
  50%{transform:scale(1.5);opacity:0;}
}
.node-line {
  width: 2px;
  height: 36px;
  background: linear-gradient(to bottom, #f43f5e, transparent);
  margin-top: 4px;
}

.wish-card {
  flex: 1;
  background: rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: clamp(14px,4vw,22px);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.wish-card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 28px rgba(244,63,94,0.2);
}
.wish-quote {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 3.5rem;
  font-family: Georgia, serif;
  line-height: 1;
  color: rgba(244,63,94,0.08);
  pointer-events: none;
}
.wish-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.wish-author { color: #fda4af; font-weight: 600; font-size: clamp(0.9rem,3vw,1rem); }
.wish-date   { color: rgba(253,164,175,0.5); font-size: 0.72rem; font-family:'Lato',sans-serif; }
.wish-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(244,63,94,0.3), transparent);
  margin-bottom: 10px;
}
.wish-message {
  font-family: 'Lato', sans-serif;
  font-size: clamp(0.82rem,3vw,0.92rem);
  line-height: 1.75;
  color: rgba(253,164,175,0.85);
  font-weight: 300;
}

/* ══════════════════════════════════════════
   SPECIAL MESSAGE
══════════════════════════════════════════ */
.message-section { overflow: hidden; }

/* ── envelope wrapper ── */
.msg-envelope {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

/* ══ SEALED ENVELOPE ══ */
.msg-seal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.msg-seal-wrap.hide {
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

.msg-env-body {
  width: min(300px, 80vw);
  height: min(200px, 55vw);
  position: relative;
  filter: drop-shadow(0 20px 50px rgba(244,63,94,0.35));
  animation: envFloat 3s ease-in-out infinite;
}
@keyframes envFloat {
  0%,100% { transform: translateY(0)   rotate(-1deg); }
  50%     { transform: translateY(-10px) rotate(1deg); }
}

/* bottom rectangle */
.msg-env-bottom {
  position: absolute;
  inset: 0;
  border-radius: 8px 8px 16px 16px;
  background: linear-gradient(160deg, #3d0a1e 0%, #1a0a0f 100%);
  border: 1px solid rgba(244,63,94,0.3);
}

/* left triangle */
.msg-env-left {
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 0;
  border-bottom: min(200px,55vw) solid rgba(244,63,94,0.12);
  border-right:  calc(min(300px,80vw)/2) solid transparent;
  border-radius: 0 0 0 16px;
  z-index: 1;
}
/* right triangle */
.msg-env-right {
  position: absolute;
  bottom: 0; right: 0;
  width: 0; height: 0;
  border-bottom: min(200px,55vw) solid rgba(244,63,94,0.12);
  border-left:   calc(min(300px,80vw)/2) solid transparent;
  border-radius: 0 0 16px 0;
  z-index: 1;
}
/* top flap triangle */
.msg-env-flap {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-top: calc(min(200px,55vw) * 0.52) solid rgba(244,63,94,0.22);
  border-left:  calc(min(300px,80vw)/2) solid transparent;
  border-right: calc(min(300px,80vw)/2) solid transparent;
  z-index: 2;
  border-radius: 8px 8px 0 0;
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.msg-envelope.opening .msg-env-flap {
  transform: rotateX(180deg);
}

/* wax seal */
.msg-seal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 0 4px rgba(244,63,94,0.25), 0 8px 24px rgba(244,63,94,0.5);
  animation: sealPulse 2s ease-in-out infinite;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.msg-envelope.opening .msg-seal {
  transform: translate(-50%, -50%) scale(1.3);
  opacity: 0;
}
@keyframes sealPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(244,63,94,0.25), 0 8px 24px rgba(244,63,94,0.5); }
  50%     { box-shadow: 0 0 0 8px rgba(244,63,94,0.15), 0 8px 36px rgba(244,63,94,0.7); }
}

/* open button */
.msg-open-btn {
  padding: clamp(13px,3vw,17px) clamp(36px,8vw,56px);
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem,3.5vw,1.15rem);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 32px rgba(244,63,94,0.45), 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.02em;
}
.msg-open-btn:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 0 55px rgba(244,63,94,0.75), 0 8px 28px rgba(0,0,0,0.4);
}
.msg-open-btn:active { transform: scale(0.97); }

/* ══ LETTER ══ */
.msg-letter {
  width: 100%;
  max-width: 580px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 1.2s cubic-bezier(0.22,1,0.36,1);
}
.msg-envelope.opened .msg-letter {
  max-height: 900px;
}

.msg-letter-inner {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(244,63,94,0.25);
  border-radius: 20px;
  padding: clamp(28px,6vw,52px) clamp(24px,5vw,48px);
  margin-top: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 60px rgba(244,63,94,0.1);
  overflow: hidden;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.22,1,0.36,1) 0.6s,
              opacity   0.9s ease                          0.6s;
}
.msg-envelope.opened .msg-letter-inner {
  transform: translateY(0);
  opacity: 1;
}

/* decorative top row */
.msg-letter-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.msg-deco-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,63,94,0.4), transparent);
  display: block;
}
.msg-deco-rose {
  font-size: 1.6rem;
  animation: roseWobble 3s ease-in-out infinite;
  display: block;
}

/* message body */
.msg-body {
  min-height: 120px;
}

/* THE TEXT — clear and readable */
.message-text {
  font-family: 'Lato', sans-serif;
  font-size: clamp(1.05rem, 3vw, 1.22rem);
  line-height: 2;
  color: #fce7f3;
  font-weight: 300;
  letter-spacing: 0.02em;
  word-spacing: 0.05em;
}

/* cursor */
.message-text::after {
  content: '|';
  color: #f43f5e;
  font-weight: 400;
  animation: blink 0.85s ease-in-out infinite;
  margin-left: 1px;
}
.message-text.done::after { display: none; }
@keyframes blink { 0%,49%{opacity:1;} 50%,100%{opacity:0;} }

/* each word fades+slides in */
.msg-word {
  display: inline;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(6px);
  transition: opacity 0.45s ease, filter 0.45s ease, transform 0.45s ease;
}
.msg-word.show {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* bottom divider + sender */
.msg-letter-bottom {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.msg-bottom-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,63,94,0.35), transparent);
}
.message-sender {
  text-align: center;
  color: #fda4af;
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
  font-style: italic;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1s ease, transform 1s ease;
}
.message-sender.show {
  opacity: 1;
  transform: translateY(0);
}

/* floating petals */
.msg-petals-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 20px;
}
.msg-petal {
  position: absolute;
  top: -30px;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  pointer-events: none;
  opacity: 0;
  animation: petalDrift linear infinite;
}
@keyframes petalDrift {
  0%   { transform: translateY(0)    rotate(0deg);   opacity: 0;    }
  8%   { opacity: 0.6; }
  88%  { opacity: 0.3; }
  100% { transform: translateY(110%) rotate(360deg); opacity: 0;    }
}

/* glow ring */
.msg-envelope.opened::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 24px;
  pointer-events: none;
  animation: envelopeGlow 3.5s ease-in-out infinite;
  z-index: -1;
}
@keyframes envelopeGlow {
  0%,100% { box-shadow: 0 0 40px rgba(244,63,94,0.15); }
  50%     { box-shadow: 0 0 80px rgba(244,63,94,0.35); }
}

/* light theme */
[data-theme="light"] .msg-letter-inner {
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(255,240,243,0.9));
  border-color: rgba(244,63,94,0.2);
  box-shadow: 0 24px 60px rgba(0,0,0,0.12), 0 0 40px rgba(244,63,94,0.1);
}
[data-theme="light"] .message-text  { color: #3d0a1e; }
[data-theme="light"] .message-sender { color: #be123c; }
[data-theme="light"] .msg-env-bottom {
  background: linear-gradient(160deg, #ffe4e6, #fff0f3);
}

/* ══════════════════════════════════════════
   FINAL CELEBRATION
══════════════════════════════════════════ */
.celebration-section {
  background: linear-gradient(135deg, #1a0a0f 0%, #3d0a1e 40%, #1a0a0f 100%);
  text-align: center;
}
#fireworks-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
.floating-hearts-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.float-heart {
  position: absolute;
  bottom: -50px;
  animation: floatHeart linear infinite;
  font-size: 1.4rem;
  opacity: 0;
}
@keyframes floatHeart {
  0%  { transform: translateY(0) rotate(0deg) scale(1);  opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100%{ transform: translateY(-110vh) rotate(360deg) scale(0.5); opacity: 0; }
}
.celebration-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px,3vw,24px);
}
.celebration-title {
  font-size: clamp(1.9rem,8vw,3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, #fda4af 0%, #f43f5e 40%, #fce7f3 70%, #fb7185 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter 0.5s;
  line-height: 1.2;
}
.celebration-title.exploded {
  filter: drop-shadow(0 0 18px rgba(244,63,94,0.9));
}
.celebration-sub {
  font-family: 'Lato', sans-serif;
  color: rgba(253,164,175,0.7);
  font-size: clamp(0.95rem,3.5vw,1.1rem);
  font-weight: 300;
}

.after-celebrate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.pulsing-heart {
  font-size: clamp(3rem,12vw,5rem);
  animation: heartPulse 1s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(244,63,94,0.5));
}
@keyframes heartPulse {
  0%,100%{transform:scale(1);filter:drop-shadow(0 0 10px rgba(244,63,94,0.4));}
  50%{transform:scale(1.2);filter:drop-shadow(0 0 30px rgba(244,63,94,1));}
}
.after-text {
  font-family: 'Lato', sans-serif;
  color: rgba(253,164,175,0.9);
  font-size: clamp(1rem,4vw,1.3rem);
  font-weight: 300;
  max-width: 380px;
  line-height: 1.7;
  animation: pulse 3s ease-in-out infinite;
}
.after-emojis {
  display: flex;
  gap: 14px;
  font-size: clamp(1.5rem,6vw,2.2rem);
}
.after-emojis span {
  animation: emojiDance 1s ease-in-out infinite alternate;
}
.after-emojis span:nth-child(1){animation-delay:0s;}
.after-emojis span:nth-child(2){animation-delay:.15s;}
.after-emojis span:nth-child(3){animation-delay:.3s;}
.after-emojis span:nth-child(4){animation-delay:.45s;}
.after-emojis span:nth-child(5){animation-delay:.6s;}
@keyframes emojiDance {
  from{transform:translateY(0) rotate(-10deg) scale(1);}
  to{transform:translateY(-12px) rotate(10deg) scale(1.3);}
}
.after-credit {
  font-family: 'Lato', sans-serif;
  color: rgba(251,113,133,0.55);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   GLASS CARD (shared utility)
══════════════════════════════════════════ */
.glass-card {
  background: rgba(255,255,255,0.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
}

/* ══════════════════════════════════════════
   RESPONSIVE TWEAKS
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .navbar { gap: 2px; padding: 6px 10px; }
  .navbar a { padding: 3px 5px; font-size: 1rem; }
  .theme-toggle { width: 36px; height: 36px; font-size: 1rem; top: 10px; right: 10px; }
  .card-top-banner { height: 70px; }
  .timeline-item { gap: 10px; }
  .node-circle { width: 38px; height: 38px; font-size: 1rem; }
}
