/* =========================================================
   2nd Anniversary: Rith Jengdavid & Doung sovannavin
   Ultra-Modern Cinematic Slideshow & Grand Finale Letter
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Great+Vibes&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary-rose: #f43f5e;
  --primary-glow: rgba(244, 63, 94, 0.45);
  --accent-gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.4);
  --bg-dark: #070709;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

.font-script {
  font-family: 'Great Vibes', cursive;
}

.font-serif-title {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
}

/* Master Cinema Stage (Mobile first, centers gracefully on desktop) */
#cinema-stage {
  width: 100%;
  height: 100%;
  max-width: 500px;
  max-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b0713 0%, #070709 100%);
  }

  #cinema-stage {
    height: 94vh;
    border-radius: 40px;
    border: 2px solid rgba(251, 191, 36, 0.25);
    box-shadow: 0 0 60px rgba(244, 63, 94, 0.2), 0 0 100px rgba(0, 0, 0, 0.8);
  }
}

/* Background Ambient Canvas for particles */
#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

/* Intro Curtain Screen */
#intro-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(7, 7, 9, 0.85) 0%, rgba(20, 5, 14, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#intro-screen.hidden-intro {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

/* Slide Media Stack */
.slides-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.slide-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide-frame.current-slide {
  opacity: 1;
  visibility: visible;
}

.slide-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.0);
  transition: transform 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide-frame.current-slide img {
  transform: scale(1.12);
}

/* Elegant Cinematic Overlay Vignette */
.cinematic-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.05) 25%,
    rgba(0, 0, 0, 0.05) 60%,
    rgba(0, 0, 0, 0.85) 100%
  );
  pointer-events: none;
  z-index: 10;
}

/* Sleek Minimalist Top Bar */
.cinema-top-bar {
  position: absolute;
  top: 18px;
  left: 16px;
  right: 16px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Sleek Thin Cinema Progress Bar */
.cinema-progress-line-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 30;
}

.cinema-progress-line {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f43f5e, #fbbf24);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  transition: width 0.1s linear;
}

/* Caption on Slide */
.slide-caption-box {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  z-index: 25;
  text-align: center;
  pointer-events: none;
}

/* Grand Finale Scene: "Thank You Doung Sovannavin" */
#finale-stage {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: linear-gradient(180deg, #09090b 0%, #170712 50%, #0d040a 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px 18px;
  scrollbar-width: none;
}

#finale-stage::-webkit-scrollbar {
  display: none;
}

#finale-stage.active-finale {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Letter Card with Rose Gold Border */
.letter-luxury-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(244, 63, 94, 0.15);
  border-radius: 28px;
  padding: 24px 20px;
  position: relative;
}

/* Floating Heart Fountain */
@keyframes heart-fountain {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x-offset), -180px) scale(1.5) rotate(var(--rot));
    opacity: 0;
  }
}

.fountain-heart {
  position: fixed;
  pointer-events: none;
  font-size: 28px;
  animation: heart-fountain 1.4s ease-out forwards;
  z-index: 100;
}

/* Shimmer Gold Effect */
.gold-shimmer {
  background: linear-gradient(135deg, #f59e0b 0%, #fde68a 50%, #d97706 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
