/* Solid pink background */
body {
  background-color: #FFF9FB;
  font-family: 'Quicksand', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

/* Envelope container */
.envelope {
  position: relative;
  width: 350px;
  height: 250px;
  background-color: #f8bbd0;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s ease;
  z-index: 2;
  animation: slideFadeIn 1s ease-out forwards;
}

.envelope.open {
  animation: pulseGlow 2s infinite;
}

@keyframes slideFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.6);
  }
}

/* Flap */
.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: #f48fb1;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 1.2s ease;
  z-index: 3;
}

.envelope.open .flap {
  transform: rotateX(180deg);
}

/* Card inside envelope */
.card {
  position: absolute;
  top: 50px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background-color: #fce4ec;
  border-radius: 8px;
  padding: 20px 20px 30px 20px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.envelope.open .card {
  opacity: 1;
}

/* Cursive title */
.cursive {
  font-family: 'Great Vibes', cursive;
  font-size: 32px;
  color: #f48fb1;
  margin-bottom: 5px;
  text-align: center;
  animation: fadeInLetters 1s ease-out forwards;
}

/* Subtitle */
.subtitle {
  font-size: 14px;
  color: #f48fb1;
  margin-bottom: 15px;
  text-align: center;
  animation: fadeInLetters 1.5s ease-out forwards;
}

/* Text animation */
@keyframes fadeInLetters {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Icon links */
.links {
  margin-top: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: #f48fb1;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 22px;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
}

.links a:hover {
  background-color: #f48fb1;
  transform: scale(1.1);
}

/* Butterfly background */
.butterfly-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.butterfly {
  position: absolute;
  background-image: url('butterfly.png'); /* Replace with your image */
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  animation-name: fallButterflies;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

@keyframes fallButterflies {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(120vh) rotate(360deg);
    opacity: 0;
  }
}