* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Georgia", serif;
  color: #333;
  overflow-x: hidden;
  background: #faf8f5;
}

/* --- New Envelope Styles --- */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5e6d3 0%, #faf8f5 100%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: opacity 1s ease-out;
}

.envelope-container {
  position: relative;
  width: 320px;
  height: 200px;
  margin: auto;
  cursor: pointer;
  perspective: 1000px;
  transform: scale(0.9);
  transition: transform 0.5s ease-out;
}

/* Envelope Body (Background) */
.envelope-body {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #e3cea4; /* Off-white paper */
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Invitation Card (The content that slides out) */
.invitation-card {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 310px;
  height: 190px;
  background: #faf8f5; /* Light background for card */
  border-radius: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateY(0);
  transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #d4af37;
  box-sizing: border-box;
}

.invitation-card.slid-out {
  transform: translateY(-190px); /* Slide up a lot! */
}

.card-names {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  color: #6b4423;
  margin-bottom: 10px;
}

.card-date {
  font-size: 1.1rem;
  color: #d4af37;
  font-weight: 500;
}

.tap-message {
  position: absolute;
  bottom: 10px;
  font-size: 0.9rem;
  color: #6b4423;
  font-weight: bold;
}

/* Envelope Flap */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: #e3cea4;
  border-radius: 0 0 10px 10px;
  z-index: 20;
  /* Triangle shape using clip-path */
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transform: rotateX(0deg);
  transition: transform 0.6s ease-in-out, background 0.3s;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.envelope-flap.opened {
  transform: rotateX(180deg);
  z-index: 5; /* Move behind the card */
}

/* Wax Seal */
.wax-seal {
  position: absolute;
  top: 85px; /* Position on the folded flap */
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #d42d32; /* Wax Seal Color */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4),
    inset 0 0 15px rgba(255, 255, 255, 0.3);
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease-out;
  cursor: pointer;
  animation: pulse-seal 2s infinite;
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.seal-inner {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  color: #ffc9a8; /* Lighter color for stamped effect */
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.tap-hint {
  position: absolute;
  top: 100%;
  margin-top: 15px;
  font-size: 0.8rem;
  color: #6b4423;
  font-weight: bold;
  animation: bounce 1.5s infinite;
}

/* Crack Effect */
.seal-crack {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 48%,
    rgba(0, 0, 0, 0.5) 50%,
    transparent 52%
  );
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.wax-seal.cracked {
  animation: none;
}

.wax-seal.cracked .seal-crack {
  opacity: 1;
  /* Split the seal visually */
  transform: rotate(45deg) scale(1.2);
}

.wax-seal.cracked {
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0.5; /* Fade out cracked seal */
}

/* Animations */
@keyframes pulse-seal {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* --- Confetti Styles (Simple CSS for effect) --- */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2001;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #d4af37; /* Gold */
  opacity: 0;
  animation: fall 3s ease-in forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* --- Countdown Styles (New) --- */
.countdown-timer {
  margin: 2rem 0;
  font-family: "Playfair Display", serif;
  color: #6b4423;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.countdown-timer div {
  display: inline-block;
  margin: 0 10px;
  font-size: 1.5rem;
  font-weight: 500;
}

.countdown-timer span {
  display: block;
  font-size: 0.8rem;
  color: #d4af37;
  margin-top: 5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
/* --- Existing Styles Follow --- */
.language-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: white;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #d4af37;
}

.music-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: white;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #d4af37;
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 25px rgba(0, 0, 0, 0.2);
}

.music-toggle button {
  background: none;
  border: none;
  color: #6b4423;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.music-icon {
  animation: pulse 2s ease-in-out infinite;
}

.music-icon.playing {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.language-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 25px rgba(0, 0, 0, 0.2);
}

.language-toggle button {
  background: none;
  border: none;
  color: #6b4423;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

.language-toggle button.active {
  color: #d4af37;
}

.ganesh-section {
  padding: 2rem 1rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, #f5e6d3 0%, #faf8f5 100%);
  position: relative;
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.ganesh-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: fadeInDown 1s ease-out 0.3s backwards;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mantra-title {
  font-size: 1.3rem;
  color: #6b4423;
  font-weight: 600;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out 0.5s backwards;
}

.mantra-verse {
  font-size: 1.1rem;
  color: #6b4423;
  max-width: 700px;
  margin: 0 auto 0.5rem;
  line-height: 1.8;
  animation: fadeInUp 1s ease-out 0.7s backwards;
}

.mantra-verse:last-of-type {
  animation-delay: 0.9s;
}

.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f5e6d3 0%, #faf8f5 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(218, 165, 32, 0.1) 1px,
    transparent 1px
  );
  background-size: 50px 50px;
  animation: float 20s linear infinite;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

.decorative-line {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
  margin: 1.5rem auto;
  position: relative;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s ease-out;
}

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

.invitation-text {
  font-size: 1.2rem;
  color: #8b7355;
  letter-spacing: 3px;
  margin-bottom: 2rem;
  text-transform: uppercase;
  font-weight: 300;
}

.hindi .invitation-text {
  font-size: 1.3rem;
  letter-spacing: 1px;
  text-transform: none;
}

.names {
  font-size: 4rem;
  color: #6b4423;
  margin: 1rem 0;
  font-family: "Playfair Display", serif;
  font-weight: 400;
  line-height: 1.2;
}

.ampersand {
  font-size: 3rem;
  color: #d4af37;
  margin: 0 1rem;
  font-style: italic;
}

.date-container {
  margin: 2rem 0;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.date {
  font-size: 1.8rem;
  color: #6b4423;
  font-weight: 500;
  letter-spacing: 2px;
}

.story-section {
  padding: 5rem 2rem;
  text-align: center;
  background: white;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.story-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.story-section h2 {
  font-size: 2.5rem;
  color: #6b4423;
  margin-bottom: 2rem;
  font-family: "Playfair Display", serif;
}

.story-text {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.2rem;
  line-height: 1.8;
  color: #666;
}

.venue-section {
  padding: 5rem 2rem;
  background: linear-gradient(135deg, #faf8f5 0%, #f5e6d3 100%);
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.venue-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.venue-section h2 {
  font-size: 2.5rem;
  color: #6b4423;
  margin-bottom: 1rem;
  font-family: "Playfair Display", serif;
}

.venue-details {
  max-width: 600px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.6s ease-out;
}

.venue-section.visible .venue-details {
  transform: scale(1);
  opacity: 1;
  transition-delay: 0.2s;
}

.venue-name {
  font-size: 1.8rem;
  color: #d4af37;
  margin-bottom: 1rem;
  font-weight: 500;
}

.venue-address {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.map-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: #d4af37;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.map-button:hover {
  background: #b8941f;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.map-container {
  max-width: 900px;
  margin: 3rem auto 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.venue-section.visible .map-container {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

.map-container iframe {
  width: 100%;
  height: 450px;
  border: none;
}

.footer {
  padding: 3rem 2rem;
  text-align: center;
  background: #6b4423;
  color: #f5e6d3;
}

.footer p {
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.lang-content {
  display: none;
}

.lang-content.active {
  display: block;
}

.main-content {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.main-content.visible-page {
  opacity: 1;
}

@media (max-width: 768px) {
  .names {
    font-size: 2.5rem;
  }

  .ampersand {
    font-size: 2rem;
    display: block;
    margin: 0.5rem 0;
  }

  .invitation-text {
    font-size: 0.9rem;
  }

  .hindi .invitation-text {
    font-size: 1rem;
  }

  .date {
    font-size: 1.4rem;
  }

  .story-section h2,
  .venue-section h2 {
    font-size: 2rem;
  }

  .map-container iframe {
    height: 300px;
  }

  .music-toggle {
    top: 10px;
    left: 10px;
    padding: 10px 15px;
  }

  .music-toggle button {
    font-size: 1rem;
  }

  .language-toggle {
    top: 10px;
    right: 10px;
    padding: 8px 15px;
  }

  .language-toggle button {
    font-size: 0.9rem;
    padding: 3px 8px;
  }

  .ganesh-icon {
    width: 40px;
    height: 40px;
  }

  .mantra-title {
    font-size: 1.1rem;
  }

  .mantra-verse {
    font-size: 0.95rem;
  }

  .envelope-container {
    width: 280px;
    height: 180px;
  }

  .invitation-card {
    width: 270px;
    height: 170px;
  }

  .invitation-card.slid-out {
    transform: translateY(-170px);
  }

  .card-names {
    font-size: 1.5rem;
  }

  .envelope-flap {
    height: 90px;
  }

  .wax-seal {
    width: 50px;
    height: 50px;
    top: 75px;
  }

  .seal-inner {
    font-size: 1.2rem;
  }

  .countdown-timer div {
    font-size: 1.2rem;
    margin: 0 5px;
  }

  .countdown-timer span {
    font-size: 0.7rem;
    margin-top: 3px;
  }
}
