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

body {
  font-family: "Cormorant Garamond", serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

/* Pantalla inicial del sobre */
.envelope-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #f8f3ed 0%, #e8dfd5 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.envelope-screen.opening {
  animation: simpleFadeOut 1s ease-out forwards;
}

@keyframes simpleFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.envelope-container.opening {
  animation: none;
}

.envelope-container {
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.envelope-container:hover {
  transform: scale(1.05);
}

.envelope-image {
  max-width: 1000px;
  width: 95%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
  animation: floatEnvelope 3s ease-in-out infinite;
}

.tap-instruction {
  font-family: "Lato", sans-serif;
  font-size: 1.2rem;
  color: #8b7355;
  margin-top: 2rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes floatEnvelope {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
}

/* Wrapper de invitación */
/* Wrapper de invitación */
.invitation-wrapper {
  opacity: 0;
  transition: opacity 1.5s ease-out;
}

.invitation-wrapper.show {
  opacity: 1;
}

.invitation-wrapper.hidden {
  display: none;
}

/* Efecto de confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: #d4a574;
  position: absolute;
  animation: confettiFall 3s ease-out forwards;
  z-index: 1001;
}

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

/* Pantalla de agradecimiento intermedia */
.thank-you-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #f8f3ed 0%, #e8dfd5 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 0;
  transition: opacity 1s ease-out;
  gap: 2rem;
  padding: 2rem;
}

.thank-you-background {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 600px;
  width: 100%;
}

.hearts-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
}

.thank-you-screen.show {
  opacity: 1;
}

.thank-you-screen.hidden {
  display: none;
}

.thank-you-message {
  text-align: center;
}

.thank-you-message h2 {
  font-family: "Great Vibes", cursive;
  font-size: 3.5rem;
  color: #2d2d2d;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9);
  padding: 0.5rem 2rem;
  max-width: 800px;
  line-height: 1.3;
  min-height: 4rem;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 3rem;
  background-color: #2d2d2d;
  margin-left: 5px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

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

.background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(1px);
  z-index: 0;
}

/* Estrellas parpadeantes */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.star {
  position: absolute;
  width: 12px;
  height: 12px;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  animation: falling 8s linear infinite;
}

@keyframes twinkle {
  0% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

@keyframes falling {
  0% {
    top: -10%;
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 110%;
    opacity: 0;
    transform: translateY(0) rotate(360deg) scale(0.5);
  }
}

.container {
  text-align: center;
  padding: 3rem 2rem;
  background: transparent;
  max-width: 700px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 20;
  opacity: 0;
  animation: fadeIn 1.5s ease-in 0.3s forwards;
}

.names h1 {
  font-family: "Great Vibes", cursive;
  font-size: 4rem;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  text-shadow:
    2px 2px 8px rgba(255, 255, 255, 0.95),
    0 0 20px rgba(255, 255, 255, 0.8);
}

.subtitle p {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  color: #1a1a1a;
  font-style: italic;
  margin-bottom: 3rem;
  font-weight: 400;
  text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  letter-spacing: 0.5px;
  padding: 0.8rem 2rem;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 10px;
  backdrop-filter: blur(15px);
  display: inline-block;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(212, 165, 116, 0.2);
}

.scroll-indicator {
  margin: 2rem 0;
  text-align: center;
  animation: fadeInOut 2s ease-in-out infinite;
  position: relative;
  z-index: 25;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  padding: 1rem 2rem;
  border-radius: 20px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  max-width: 250px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(212, 165, 116, 0.3);
}

.scroll-indicator p {
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  color: #2d2d2d;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.arrow-down {
  font-size: 2.5rem;
  color: #d4a574;
  animation: bounce 2s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

.details {
  margin: 3rem 0;
  padding: 2.5rem;
  background-color: #ffffff !important;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 50;
  border: 2px solid rgba(212, 165, 116, 0.5);
}

.detail-item {
  margin: 2rem 0;
}

.detail-item h3 {
  font-family: "Lato", sans-serif;
  font-size: 1.3rem;
  color: #000000;
  margin-bottom: 0.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.detail-item p {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  color: #000000;
  margin: 0.3rem 0;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.detail-item .address {
  font-size: 1.2rem;
  color: #1a1a1a;
  font-weight: 600;
}

.location-link {
  font-family: "Lato", sans-serif;
  color: #000000;
  text-decoration: none;
  font-weight: 800;
  padding: 0.6rem 1.8rem;
  display: inline-block;
  border: 3px solid #000000;
  border-radius: 25px;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

.location-link:hover {
  background: #000000;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.calendar-section {
  margin: 2.5rem 0;
  text-align: center;
}

.calendar-btn {
  font-family: "Lato", sans-serif;
  background: linear-gradient(135deg, #d4a574 0%, #b8935c 100%);
  color: white;
  text-decoration: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 50px;
  display: inline-block;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(180, 147, 92, 0.3);
  font-weight: 600;
}

.calendar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(180, 147, 92, 0.4);
}

.intolerance-notice {
  margin: 2.5rem 0;
  padding: 1.8rem 2rem;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(212, 165, 116, 0.4);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 15;
}

.intolerance-notice p {
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  color: #2d2d2d;
  margin: 0;
  line-height: 1.6;
  text-align: center;
  font-weight: 500;
}

.footer {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 15;
  border: 1px solid rgba(212, 165, 116, 0.2);
}

.footer p {
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  color: #4a4a4a;
  margin: 0.3rem 0;
  font-weight: 500;
}

.footer .signature {
  font-family: "Great Vibes", cursive;
  font-size: 2rem;
  color: #2d2d2d;
  margin-top: 0.5rem;
}

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

@media (max-width: 768px) {
  .envelope-image {
    max-width: 100%;
    width: 85%;
  }

  .tap-instruction {
    font-size: 1rem;
    margin-top: 1.5rem;
  }

  .thank-you-message h2 {
    font-size: 2.5rem;
    padding: 0 1rem;
    min-height: 3rem;
    line-height: 1.2;
  }

  .cursor {
    height: 2.5rem;
  }

  .thank-you-background {
    max-width: 90%;
  }

  .thank-you-screen {
    gap: 1.5rem;
    padding: 1rem;
  }

  .names h1 {
    font-size: 3rem;
  }

  .subtitle p {
    font-size: 1.2rem;
    padding: 0.4rem 1.5rem;
    letter-spacing: 0.3px;
  }

  .couple {
    font-size: 6rem;
  }

  .container {
    padding: 2rem 1.5rem;
  }

  .floral-top {
    font-size: 3rem;
  }
}
