* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f8f4ee;
  color: #7d6c9a;
  overflow-x: hidden;
  font-family: Georgia, "Times New Roman", serif;
}

.convite {
  width: 100%;
  min-height: 100vh;
  background: #f8f4ee;
}

/* CENAS */

.scene {
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* ENVELOPE */

.envelope-button {
  width: min(82vw, 560px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  color: inherit;
  transition: transform 0.55s ease, opacity 0.55s ease;
}

.envelope-button:hover {
  transform: translateY(-5px);
}

.envelope-img {
  width: auto;
  max-width: 100%;
  height: min(62vh, 620px);
  margin: 0 auto;
  display: block;
}

.microtext {
  display: block;
  margin-top: 30px;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: #6e6486;
}

.envelope-button.fade-out {
  opacity: 0;
  transform: translateY(-24px) scale(0.98);
  pointer-events: none;
}

/* CARTA */

.scene-letter {
  padding-top: 72px;
  padding-bottom: 72px;
}

.letter-wrap {
  width: min(86vw, 520px);
  text-align: center;
}

.letter-closed {
  animation: letterClosedReveal 0.85s ease both;
}

.letter-open {
  animation: letterOpenReveal 1s ease both;
}

.letter-img {
  width: 100%;
  display: block;
}

.letter-hint {
  margin-top: 24px;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: #6e6486;
  opacity: 0.85;
}

/* CARDS */

.cards-section {
  width: 100%;
  padding: 64px 24px 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 72px;
}

.paper-card {
  width: min(86vw, 540px);
  position: relative;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.paper-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-img {
  width: 100%;
  display: block;
}

.card-with-link {
  position: relative;
}

/* Área clicável aproximada do botão dentro do PNG */
.card-click-area {
  position: absolute;
  left: 50%;
  bottom: 31%;
  transform: translateX(-50%);
  width: 42%;
  height: 10%;
  border-radius: 999px;
  text-decoration: none;
}

/* ANIMAÇÕES */

@keyframes letterClosedReveal {
  from {
    opacity: 0;
    transform: translateY(48px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes letterOpenReveal {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* MOBILE */

@media (max-width: 480px) {
  .scene {
    padding-left: 18px;
    padding-right: 18px;
  }

  .envelope-button {
    width: 88vw;
  }

  .letter-wrap {
    width: 90vw;
  }

  .paper-card {
    width: 90vw;
  }

  .microtext {
    font-size: 1.08rem;
  }

  .cards-section {
    gap: 56px;
  }
}
/* REFINAMENTO DE EXPERIÊNCIA */

/* Entrada inicial do envelope */
.scene-envelope {
  position: relative;
}

.envelope-button {
  animation: envelopeIntro 1.1s ease both;
  transform-origin: center center;
}

.envelope-button.is-opening {
  transform: translateY(-8px) scale(1.015);
}

.envelope-button.fade-out {
  opacity: 0;
  transform: translateY(-42px) scale(0.96);
  pointer-events: none;
}

.microtext {
  animation: microtextPulse 3.2s ease-in-out infinite;
}

/* Carta fechada */
.scene-active .letter-closed {
  animation: letterClosedReveal 0.95s ease both;
}

.letter-transition-out .letter-closed {
  animation: letterClosedExit 0.5s ease both;
}

/* Carta aberta */
.scene-active .letter-open {
  animation: letterOpenRevealSoft 1.15s ease both;
}

/* Cards com entrada mais nobre */
.paper-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.paper-card:nth-child(1).visible {
  transition-delay: 0s;
}

.paper-card:nth-child(2).visible {
  transition-delay: 0.08s;
}

.paper-card:nth-child(3).visible {
  transition-delay: 0.16s;
}

.paper-card:nth-child(4).visible {
  transition-delay: 0.24s;
}

.paper-card:nth-child(5).visible {
  transition-delay: 0.32s;
}

/* Animações novas */

@keyframes envelopeIntro {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes microtextPulse {
  0% {
    opacity: 0.68;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-2px);
  }

  100% {
    opacity: 0.68;
    transform: translateY(0);
  }
}

@keyframes letterClosedExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-26px) scale(0.98);
  }
}

@keyframes letterOpenRevealSoft {
  from {
    opacity: 0;
    transform: translateY(44px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Acessibilidade: reduz movimento se o usuário preferir */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .envelope-button,
  .letter-closed,
  .letter-open,
  .paper-card,
  .microtext {
    animation: none !important;
    transition: none !important;
  }
}
/* MODAL DA CARTA AMPLIADA */

.letter-open {
  cursor: zoom-in;
}

.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 32px 18px;
  background: rgba(248, 244, 238, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-modal.hidden {
  display: none !important;
}

.letter-modal-img {
  width: min(94vw, 720px);
  max-height: 92vh;
  object-fit: contain;
  display: block;
  animation: modalLetterIn 0.45s ease both;
}

.letter-modal-close {
  position: fixed;
  top: 22px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(125, 108, 154, 0.35);
  border-radius: 999px;
  background: rgba(243, 235, 221, 0.9);
  color: #7d6c9a;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

@keyframes modalLetterIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* BOTÕES DE CALENDÁRIO ABAIXO DO RSVP */

.rsvp-card-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.rsvp-card-group .card-with-link {
  width: 100%;
  position: relative;
}

.calendar-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 3;
}

.calendar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 10px 24px;
  border: 1px solid rgba(180, 169, 210, 0.82);
  border-radius: 999px;
  background: rgba(243, 235, 221, 0.9);
  color: #7d6c9a;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  transition: transform 0.35s ease, opacity 0.35s ease;
  position: relative;
  z-index: 4;
}

.calendar-link-secondary {
  min-width: 170px;
  font-size: 0.88rem;
  opacity: 0.78;
}

.rsvp-card-group .card-click-area {
  z-index: 1;
}
