/* ═══════════════════════════════════════════════════════════
   HAPPY BIRTHDAY DIYU — Premium Luxury CSS
   Author: Faizuu 💜
   Theme: Purple Glassmorphism + Cinematic + Apple-inspired
═══════════════════════════════════════════════════════════ */

/* ─── CSS CUSTOM PROPERTIES ─────────────────────────────── */
:root {
  --purple-deep:    #0d0015;
  --purple-dark:    #1a0030;
  --purple-mid:     #2d0057;
  --purple-rich:    #4a0080;
  --purple-vivid:   #7b2fff;
  --purple-light:   #a855f7;
  --purple-glow:    #c084fc;
  --purple-soft:    #e9d5ff;
  --pink-accent:    #f472b6;
  --gold:           #fbbf24;
  --gold-light:     #fde68a;
  --white:          #ffffff;
  --white-80:       rgba(255,255,255,0.80);
  --white-60:       rgba(255,255,255,0.60);
  --white-30:       rgba(255,255,255,0.30);
  --white-10:       rgba(255,255,255,0.10);
  --white-06:       rgba(255,255,255,0.06);

  --glass-bg:       rgba(255,255,255,0.07);
  --glass-border:   rgba(255,255,255,0.15);
  --glass-shadow:   0 8px 32px rgba(123,47,255,0.25);

  --font-display:   'Playfair Display', Georgia, serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-script:    'Dancing Script', cursive;

  --ease-smooth:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);

  --section-pad:    clamp(60px, 10vh, 120px) clamp(20px, 5vw, 80px);
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background: var(--purple-deep);
  color: var(--white);
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
button { cursor: none; border: none; background: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--purple-deep); }
::-webkit-scrollbar-thumb { background: var(--purple-vivid); border-radius: 2px; }

/* ─── CUSTOM CURSOR ──────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--purple-glow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s var(--ease-smooth), width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: screen;
}

.cursor-trail {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--purple-light);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-smooth), opacity 0.3s;
  opacity: 0.5;
}

body:hover .cursor { opacity: 1; }

/* ─── PARTICLE CANVAS ────────────────────────────────────── */
.particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ─── LOADER ─────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  background: var(--purple-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s var(--ease-smooth), visibility 0.8s;
}

.loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--purple-vivid);
  transform: translate(-50%, -50%);
  animation: spin 1.2s linear infinite;
}

.loader-ring--2 {
  width: 60px;
  height: 60px;
  border-top-color: var(--purple-light);
  animation-duration: 0.9s;
  animation-direction: reverse;
}

.loader-ring--3 {
  width: 40px;
  height: 40px;
  border-top-color: var(--pink-accent);
  animation-duration: 0.6s;
}

.loader-text {
  margin-top: 60px;
  font-size: 0.85rem;
  color: var(--white-60);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ─── MUSIC TOGGLE ───────────────────────────────────────── */
.music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(123,47,255,0.3);
}

.music-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 30px rgba(123,47,255,0.6);
}

/* ─── SECTION BASE ───────────────────────────────────────── */
.section {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--section-pad);
  overflow: hidden;
  z-index: 1;
}

.hidden-section {
  display: none;
}

/* ─── GLASS COMPONENTS ───────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.1);
}

.glass-badge {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(123,47,255,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: 100px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--purple-soft);
  text-transform: uppercase;
}

.glass-btn {
  padding: 14px 36px;
  background: rgba(123,47,255,0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168,85,247,0.5);
  border-radius: 100px;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.3s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.glass-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.glass-btn:hover {
  background: rgba(123,47,255,0.4);
  border-color: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(123,47,255,0.5);
}

.glass-btn:hover::before { opacity: 1; }

/* ─── GLOW BUTTON ────────────────────────────────────────── */
.glow-btn {
  position: relative;
  padding: 18px 48px;
  background: linear-gradient(135deg, var(--purple-vivid), var(--purple-rich));
  border-radius: 100px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
  box-shadow: 0 0 30px rgba(123,47,255,0.6), 0 4px 20px rgba(0,0,0,0.3);
}

.glow-btn .btn-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--purple-glow), var(--pink-accent), var(--purple-vivid));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  filter: blur(8px);
}

.glow-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 50px rgba(123,47,255,0.8), 0 8px 30px rgba(0,0,0,0.4);
}

.glow-btn:hover .btn-glow { opacity: 1; }
.glow-btn:active { transform: translateY(-1px) scale(0.99); }

/* ─── SECTION HEADER ─────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: clamp(40px, 6vh, 70px);
}

.section-eyebrow {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple-glow);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--white), var(--purple-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--white-60);
  font-style: italic;
}

.section-nav {
  margin-top: clamp(40px, 6vh, 70px);
  text-align: center;
}

/* ─── FLOATING HEARTS ────────────────────────────────────── */
.floating-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.heart {
  position: absolute;
  font-size: clamp(14px, 2vw, 22px);
  animation: float-heart linear infinite;
  opacity: 0;
  user-select: none;
}

@keyframes float-heart {
  0%   { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-110vh) rotate(360deg) scale(1.2); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   SECTION 1 — HERO
═══════════════════════════════════════════════════════════ */
.section--hero {
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #3d0070 0%, #1a0030 50%, var(--purple-deep) 100%);
  text-align: center;
}

.hero-bg-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: radial-gradient(circle, rgba(123,47,255,0.3) 0%, transparent 70%);
  pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50%       { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vh, 28px);
  max-width: 800px;
}

.hero-badge {
  animation: fade-up 0.8s var(--ease-cinematic) 0.5s both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--white) 0%, var(--purple-soft) 50%, var(--purple-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fade-up 0.8s var(--ease-cinematic) 0.8s both;
  min-height: 1.2em;
}

.typing-cursor {
  display: inline-block;
  color: var(--purple-glow);
  -webkit-text-fill-color: var(--purple-glow);
  animation: blink 0.8s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--white-60);
  font-style: italic;
  animation: fade-up 0.8s var(--ease-cinematic) 1.1s both;
}

.hero-from {
  font-size: 0.9rem;
  color: var(--white-60);
  animation: fade-up 0.8s var(--ease-cinematic) 1.3s both;
}

.hero-from-name {
  color: var(--purple-glow);
  font-weight: 600;
}

.btn-begin {
  animation: fade-up 0.8s var(--ease-cinematic) 1.6s both;
  margin-top: 8px;
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: fade-up 1s var(--ease-cinematic) 2.5s both;
}

.scroll-dot {
  width: 6px;
  height: 6px;
  background: var(--purple-glow);
  border-radius: 50%;
  margin: 0 auto;
  animation: scroll-bounce 2s ease-in-out infinite;
  box-shadow: 0 0 10px var(--purple-glow);
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%       { transform: translateY(12px); opacity: 0.3; }
}

/* ═══════════════════════════════════════════════════════════
   SECTION 2 — CINEMATIC
═══════════════════════════════════════════════════════════ */
.section--cinematic {
  background: #000;
  text-align: center;
}

.cinematic-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(74,0,128,0.4) 0%, transparent 70%);
  pointer-events: none;
}

.cinematic-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.cinematic-line {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--white);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease-cinematic), transform 1s var(--ease-cinematic);
  line-height: 1.3;
}

.cinematic-line--italic {
  font-style: italic;
  background: linear-gradient(135deg, var(--purple-soft), var(--purple-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cinematic-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.cinematic-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
  opacity: 0;
  transition: opacity 1s var(--ease-cinematic) 0.5s;
}

.cinematic-divider.visible { opacity: 1; }

.cinematic-sub {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--white-60);
  font-style: italic;
  opacity: 0;
  transition: opacity 1s var(--ease-cinematic) 0.8s;
}

.cinematic-sub.visible { opacity: 1; }

#btn-cinematic-continue {
  opacity: 0;
  transition: opacity 0.8s var(--ease-cinematic) 1.2s, background 0.3s, transform 0.3s, box-shadow 0.3s;
}

#btn-cinematic-continue.visible { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   SECTION 3 — MEMORIES GALLERY
═══════════════════════════════════════════════════════════ */
.section--memories {
  background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(74,0,128,0.4) 0%, var(--purple-deep) 60%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1000px;
}

.gallery-card {
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s;
  opacity: 0;
  transform: translateY(40px);
  animation: none;
}

.gallery-card.animate-in {
  animation: card-in 0.7s var(--ease-cinematic) forwards;
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.gallery-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(123,47,255,0.4);
}

.gallery-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-rich));
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-smooth);
}

.gallery-card:hover .gallery-img {
  transform: scale(1.08);
}

/* Placeholder when image not found */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder::after {
  content: '📸';
  font-size: 3rem;
  opacity: 0.5;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(74,0,128,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-card:hover .gallery-overlay { opacity: 1; }

.gallery-zoom {
  font-size: 2rem;
  transform: scale(0.5);
  transition: transform 0.3s var(--ease-spring);
}

.gallery-card:hover .gallery-zoom { transform: scale(1); }

.gallery-light-orb {
  position: absolute;
  top: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(168,85,247,0.3), transparent 70%);
  pointer-events: none;
  animation: orb-drift 6s ease-in-out infinite;
}

@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(-10px, 10px); }
}

.gallery-caption {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--white-80);
  text-align: center;
  font-style: italic;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 700px);
  padding: 16px;
  transform: scale(0.85);
  transition: transform 0.4s var(--ease-spring);
}

.lightbox.open .lightbox-inner { transform: scale(1); }

.lightbox-inner img {
  width: 100%;
  border-radius: 12px;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-caption {
  text-align: center;
  padding: 12px 0 4px;
  color: var(--white-80);
  font-style: italic;
  font-size: 0.9rem;
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple-vivid);
  color: var(--white);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-spring), background 0.3s;
}

.lightbox-close:hover {
  transform: scale(1.15) rotate(90deg);
  background: var(--pink-accent);
}

/* ═══════════════════════════════════════════════════════════
   SECTION 4 — FUN MOMENTS TIMELINE
═══════════════════════════════════════════════════════════ */
.section--fun {
  background: radial-gradient(ellipse 80% 60% at 30% 50%, rgba(74,0,128,0.35) 0%, var(--purple-deep) 70%);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.timeline {
  position: relative;
  max-width: 700px;
  width: 100%;
  z-index: 1;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--purple-vivid), var(--purple-light), transparent);
}

@media (min-width: 600px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s var(--ease-cinematic), transform 0.6s var(--ease-cinematic);
}

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

@media (min-width: 600px) {
  .timeline-item {
    padding-left: 0;
    width: 45%;
  }
  .timeline-item:nth-child(even) {
    margin-left: 55%;
    transform: translateX(30px);
  }
  .timeline-item:nth-child(even).visible {
    transform: translateX(0);
  }
}

.timeline-dot {
  position: absolute;
  left: 10px;
  top: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple-vivid);
  border: 3px solid var(--purple-deep);
  box-shadow: 0 0 15px var(--purple-vivid);
  z-index: 1;
}

@media (min-width: 600px) {
  .timeline-dot {
    left: auto;
    right: -36px;
  }
  .timeline-item:nth-child(even) .timeline-dot {
    right: auto;
    left: -36px;
  }
}

.timeline-card {
  padding: 20px 24px;
  border-radius: 16px;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(123,47,255,0.4);
}

.timeline-emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.timeline-text {
  font-size: 0.88rem;
  color: var(--white-60);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 5 — APPRECIATION
═══════════════════════════════════════════════════════════ */
.section--appreciation {
  background: radial-gradient(ellipse 80% 60% at 70% 40%, rgba(123,47,255,0.4) 0%, var(--purple-deep) 70%);
  text-align: center;
}

.appreciation-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(168,85,247,0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: breathe 5s ease-in-out infinite;
}

.appreciation-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.appreciation-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--white), var(--purple-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.appreciation-text-wrap {
  padding: clamp(24px, 4vw, 48px);
  border-radius: 24px;
  text-align: center;
}

.appreciation-line {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--white-80);
  line-height: 1.8;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.appreciation-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.appreciation-line--highlight {
  color: var(--purple-glow);
  font-weight: 600;
  font-style: italic;
}

.appreciation-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 6 — GIFT BOX
═══════════════════════════════════════════════════════════ */
.section--gift {
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(74,0,128,0.5) 0%, var(--purple-deep) 70%);
  gap: 40px;
}

.fireworks-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Gift Scene ── */
.gift-scene {
  position: relative;
  width: 200px;
  height: 220px;
  perspective: 600px;
  cursor: pointer;
  z-index: 2;
  flex-shrink: 0;
}

.gift-box {
  position: relative;
  width: 160px;
  height: 160px;
  transform-style: preserve-3d;
  animation: gift-float 3s ease-in-out infinite;
  transition: transform 0.3s var(--ease-spring);
  margin: 0 auto;
}

.gift-box:hover {
  animation-play-state: paused;
  transform: scale(1.05) rotateY(10deg);
}

@keyframes gift-float {
  0%, 100% { transform: translateY(0) rotateY(-5deg); }
  50%       { transform: translateY(-12px) rotateY(5deg); }
}

/* Box body faces */
.gift-body {
  position: absolute;
  width: 160px;
  height: 100px;
  bottom: 0;
  transform-style: preserve-3d;
}

.gift-body-face {
  position: absolute;
  background: linear-gradient(135deg, #5b0fa8, #3d0070);
  border: 1px solid rgba(168,85,247,0.4);
}

.gift-body-front  { width: 160px; height: 100px; bottom: 0; transform: translateZ(80px); }
.gift-body-back   { width: 160px; height: 100px; bottom: 0; transform: translateZ(-80px) rotateY(180deg); }
.gift-body-left   { width: 160px; height: 100px; bottom: 0; transform: rotateY(-90deg) translateZ(80px); }
.gift-body-right  { width: 160px; height: 100px; bottom: 0; transform: rotateY(90deg) translateZ(80px); }
.gift-body-bottom { width: 160px; height: 160px; transform: rotateX(-90deg) translateZ(0); }

/* Box lid faces */
.gift-lid {
  position: absolute;
  width: 170px;
  height: 40px;
  top: 60px;
  left: -5px;
  transform-style: preserve-3d;
  transform-origin: center top;
  transition: transform 1.2s var(--ease-cinematic);
}

.gift-lid-face {
  position: absolute;
  background: linear-gradient(135deg, #7b2fff, #5b0fa8);
  border: 1px solid rgba(192,132,252,0.5);
}

.gift-lid-top    { width: 170px; height: 170px; top: -170px; transform: rotateX(90deg) translateZ(0); background: linear-gradient(135deg, #9333ea, #6b21a8); }
.gift-lid-front  { width: 170px; height: 40px; transform: translateZ(85px); }
.gift-lid-back   { width: 170px; height: 40px; transform: translateZ(-85px) rotateY(180deg); }
.gift-lid-left   { width: 170px; height: 40px; transform: rotateY(-90deg) translateZ(85px); }
.gift-lid-right  { width: 170px; height: 40px; transform: rotateY(90deg) translateZ(85px); }

/* Ribbon */
.ribbon-h, .ribbon-v {
  position: absolute;
  background: linear-gradient(90deg, var(--gold-light), var(--gold), var(--gold-light));
  z-index: 10;
  border-radius: 2px;
}

.ribbon-h {
  width: 170px;
  height: 14px;
  top: -170px;
  left: 0;
  transform: rotateX(90deg) translateZ(1px);
  top: calc(-170px + 78px);
}

.ribbon-v {
  width: 14px;
  height: 170px;
  top: -170px;
  left: 78px;
  transform: rotateX(90deg) translateZ(1px);
}

.ribbon-bow {
  position: absolute;
  top: -210px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.bow-left, .bow-right {
  position: absolute;
  width: 30px;
  height: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50% 0 50% 0;
  top: -10px;
}

.bow-left  { left: -28px; transform: rotate(-30deg); }
.bow-right { right: -28px; transform: rotate(30deg) scaleX(-1); }

.bow-center {
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 50%;
  position: absolute;
  top: -7px;
  left: -7px;
  box-shadow: 0 0 10px var(--gold);
}

/* Lid open animation */
.gift-lid.open {
  transform: rotateX(-120deg) translateY(-20px);
}

/* Glow ring */
.gift-glow-ring {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 30px;
  background: radial-gradient(ellipse, rgba(123,47,255,0.6) 0%, transparent 70%);
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scaleX(1); }
  50%       { opacity: 1; transform: translateX(-50%) scaleX(1.2); }
}

/* Sparkles */
.gift-sparkles {
  position: absolute;
  inset: -40px;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: sparkle-burst 1s var(--ease-cinematic) forwards;
}

@keyframes sparkle-burst {
  0%   { transform: translate(0,0) scale(0); opacity: 1; }
  100% { transform: var(--tx) scale(0); opacity: 0; }
}

/* ── Letter ── */
.letter-wrap {
  display: none;
  width: 100%;
  max-width: 600px;
  z-index: 2;
  animation: letter-rise 1s var(--ease-cinematic) forwards;
}

@keyframes letter-rise {
  from { opacity: 0; transform: translateY(60px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.letter {
  padding: clamp(24px, 5vw, 48px);
  border-radius: 24px;
  border-color: rgba(168,85,247,0.4);
  box-shadow: 0 0 60px rgba(123,47,255,0.3), var(--glass-shadow);
}

.letter-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.letter-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.letter-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  background: linear-gradient(135deg, var(--purple-glow), var(--pink-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.letter-body {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 2;
  color: var(--white-80);
  min-height: 100px;
  white-space: pre-line;
}

.letter-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  text-align: right;
  color: var(--white-60);
  font-size: 0.9rem;
  line-height: 1.8;
}

.letter-sign {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--purple-glow);
}

/* ═══════════════════════════════════════════════════════════
   SECTION 7 — GRAND FINALE
═══════════════════════════════════════════════════════════ */
.section--finale {
  background: radial-gradient(ellipse 100% 80% at 50% 50%, rgba(74,0,128,0.6) 0%, var(--purple-deep) 70%);
  text-align: center;
  overflow: hidden;
}

.finale-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vh, 32px);
  max-width: 800px;
}

.finale-badge {
  animation: fade-up 0.8s var(--ease-cinematic) 0.3s both;
}

.finale-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em;
}

.finale-word {
  display: inline-block;
  background: linear-gradient(135deg, var(--white), var(--purple-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(40px) scale(0.8);
  transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
}

.finale-word--name {
  background: linear-gradient(135deg, var(--purple-glow), var(--pink-accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.finale-word.pop {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.finale-sub {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--white-60);
  font-style: italic;
  opacity: 0;
  animation: fade-up 0.8s var(--ease-cinematic) 1.5s forwards;
}

.finale-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.finale-from {
  padding: 20px 32px;
  border-radius: 16px;
  text-align: center;
  color: var(--white-60);
  font-size: 0.9rem;
  line-height: 1.8;
  opacity: 0;
  animation: fade-up 0.8s var(--ease-cinematic) 2s forwards;
}

.finale-from-name {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--purple-glow);
  display: block;
}

.btn-replay {
  opacity: 0;
  animation: fade-up 0.8s var(--ease-cinematic) 2.5s forwards;
}

/* ─── SHARED ANIMATIONS ──────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 16px; }
  .timeline-item { padding-left: 50px; }
  .timeline-dot { left: 6px; }
  .gift-scene { transform: scale(0.85); }
  .letter { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}