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

:root {
  --pink:    #ff6b9d;
  --rose:    #ff4081;
  --purple:  #9c27b0;
  --lavender:#e1bee7;
  --gold:    #ffd700;
  --cream:   #fff8f0;
  --white:   #ffffff;
  --shadow:  rgba(255,107,157,.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
}

/* =============================================
   PARTICLES
   ============================================= */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: floatParticle linear infinite;
  opacity: .7;
}

@keyframes floatParticle {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: .7; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  overflow: hidden;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,107,157,.15) 0%, transparent 70%);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: .5; }
  50%       { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.crown {
  font-size: clamp(2.5rem, 8vw, 5rem);
  animation: crownBounce 2s ease-in-out infinite;
  display: inline-block;
}

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

.title {
  font-size: clamp(2rem, 9vw, 6rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  background-size: 200% 200%;
  line-height: 1.1;
  text-shadow: none;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.name {
  font-size: clamp(3rem, 14vw, 9rem);
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 0 30px var(--pink), 0 0 60px var(--rose);
  animation: namePulse 2s ease-in-out infinite;
  line-height: 1;
}

@keyframes namePulse {
  0%, 100% { text-shadow: 0 0 30px var(--pink), 0 0 60px var(--rose); }
  50%       { text-shadow: 0 0 50px var(--gold), 0 0 100px var(--pink), 0 0 150px var(--rose); }
}

.subtitle {
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--lavender);
  margin-top: .8rem;
  animation: fadeInUp 1s ease .5s both;
}

.scroll-hint {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  animation: fadeInUp 1s ease 1s both;
}

.arrow-down {
  width: 20px;
  height: 20px;
  border-right: 3px solid var(--pink);
  border-bottom: 3px solid var(--pink);
  transform: rotate(45deg);
  animation: arrowBounce 1.5s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50%       { transform: rotate(45deg) translateY(6px); }
}

/* Balloons */
.balloons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.balloon {
  position: absolute;
  font-size: clamp(2rem, 6vw, 3.5rem);
  animation: balloonFloat linear infinite;
  opacity: .8;
}

.b1 { left: 5%;  animation-duration: 6s;  animation-delay: 0s; }
.b2 { left: 20%; animation-duration: 8s;  animation-delay: 1s; }
.b3 { left: 50%; animation-duration: 7s;  animation-delay: 2s; }
.b4 { left: 75%; animation-duration: 9s;  animation-delay: .5s; }
.b5 { left: 90%; animation-duration: 6.5s;animation-delay: 1.5s; }

@keyframes balloonFloat {
  0%   { transform: translateY(110vh) rotate(-10deg); opacity: .8; }
  50%  { transform: translateY(50vh) rotate(10deg); }
  100% { transform: translateY(-10vh) rotate(-5deg); opacity: 0; }
}

/* =============================================
   SECTION TITLE
   ============================================= */
.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

/* =============================================
   CAROUSEL SECTION
   ============================================= */
.carousel-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1rem 3rem;
}

.carousel-wrapper {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  touch-action: pan-y;
}

.slide {
  display: none;
  animation: slideIn .5s ease;
}

.slide.active {
  display: block;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px) scale(.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.photo-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid rgba(255,107,157,.5);
  box-shadow: 0 8px 32px rgba(255,107,157,.3), 0 0 60px rgba(156,33,176,.2);
  background: rgba(255,255,255,.05);
  aspect-ratio: 4/5;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.photo-frame:hover img {
  transform: scale(1.04);
}

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 1rem .9rem;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
  font-size: clamp(.9rem, 3.5vw, 1.1rem);
  font-weight: 600;
  text-align: center;
  color: var(--white);
  letter-spacing: .02em;
}

/* Carousel buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,107,157,.85);
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255,107,157,.4);
  transition: background .2s, transform .2s;
  z-index: 5;
}

.carousel-btn:hover   { background: var(--rose); transform: translateY(-50%) scale(1.1); }
.carousel-btn:active  { transform: translateY(-50%) scale(.95); }
.prev { left: -16px; }
.next { right: -16px; }

/* Dots */
.dots {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.2rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  transition: background .3s, transform .3s;
}

.dot.active {
  background: var(--pink);
  transform: scale(1.4);
}

/* =============================================
   MESSAGE / ENVELOPE SECTION
   ============================================= */
.message-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1rem;
  display: flex;
  justify-content: center;
}

.envelope-container {
  width: 100%;
  max-width: 420px;
}

.envelope {
  position: relative;
  background: linear-gradient(135deg, #ff6b9d, #ff4081, #9c27b0);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 32px var(--shadow);
  transition: transform .3s, box-shadow .3s;
  overflow: hidden;
}

.envelope::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  border-radius: 16px;
}

.envelope:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px var(--shadow);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  border-left: 210px solid transparent;
  border-right: 210px solid transparent;
  border-top: 80px solid rgba(255,255,255,.15);
}

.envelope-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: .8rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  20%       { transform: scale(1.15); }
  40%       { transform: scale(1); }
  60%       { transform: scale(1.1); }
}

.tap-hint {
  font-size: 1rem;
  color: rgba(255,255,255,.9);
  font-weight: 600;
}

/* Letter */
.letter {
  display: none;
  background: var(--cream);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  margin-top: 1rem;
  color: #333;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  animation: letterOpen .6s ease;
}

.letter.open {
  display: block;
}

@keyframes letterOpen {
  from { opacity: 0; transform: translateY(-20px) scaleY(.8); }
  to   { opacity: 1; transform: translateY(0) scaleY(1); }
}

.letter-content h3 {
  font-size: 1.2rem;
  color: var(--rose);
  margin-bottom: 1rem;
  font-style: italic;
}

.letter-content p {
  font-size: clamp(.9rem, 3.5vw, 1rem);
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #444;
}

.signature {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--purple);
  font-size: 1rem;
  text-align: right;
}

.hearts-row {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.2rem;
}

.heart-pop {
  font-size: 1.5rem;
  display: inline-block;
  animation: heartPop .6s ease both;
  animation-delay: var(--delay, 0s);
}

@keyframes heartPop {
  from { opacity: 0; transform: scale(0) rotate(-30deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* =============================================
   WISHES SECTION
   ============================================= */
.wishes-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1rem 3rem;
}

.wishes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.wish-card {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,107,157,.3);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  animation: wishCardIn .6s ease var(--delay) both;
  transition: transform .3s, box-shadow .3s;
}

.wish-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(255,107,157,.25);
}

@keyframes wishCardIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wish-icon {
  font-size: 2.2rem;
  margin-bottom: .6rem;
}

.wish-card p {
  font-size: clamp(.8rem, 3vw, .95rem);
  color: var(--lavender);
  line-height: 1.4;
}

/* =============================================
   CLOSING SECTION
   ============================================= */
.closing-section {
  position: relative;
  z-index: 1;
  padding: 5rem 1rem 6rem;
  text-align: center;
  overflow: hidden;
}

.cake-container {
  margin-bottom: 1.5rem;
}

.cake-emoji {
  font-size: clamp(4rem, 15vw, 8rem);
  display: inline-block;
  animation: cakeBounce 1.5s ease-in-out infinite;
}

@keyframes cakeBounce {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.12) rotate(3deg); }
}

.closing-title {
  font-size: clamp(1.8rem, 7vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 1rem;
  animation: gradientShift 4s ease infinite;
  background-size: 200% 200%;
}

.closing-sub {
  font-size: clamp(1rem, 4vw, 1.3rem);
  color: var(--lavender);
}

/* Fireworks */
.fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.firework {
  position: absolute;
  font-size: clamp(1.2rem, 4vw, 2rem);
  animation: fireworkPop 1.5s ease-out forwards;
  opacity: 0;
}

@keyframes fireworkPop {
  0%   { opacity: 1; transform: scale(0) translateY(0); }
  60%  { opacity: 1; transform: scale(1.3) translateY(-30px); }
  100% { opacity: 0; transform: scale(.8) translateY(-60px); }
}

/* =============================================
   UTILITIES
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 600px) {
  .wishes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .prev { left: -22px; }
  .next { right: -22px; }
}

@media (min-width: 900px) {
  .carousel-wrapper {
    max-width: 560px;
  }

  .envelope-container {
    max-width: 520px;
  }
}
