html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #faf7f5;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(234, 212, 218, 0.45), transparent 42%),
    radial-gradient(circle at 88% 36%, rgba(226, 238, 248, 0.55), transparent 44%);
}

body.is-locked {
  overflow: hidden;
  height: 100vh;
}

.opening-gate {
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.7s;
}

.opening-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-cta {
  animation: ctaPulse 2.6s ease-in-out infinite;
}

.envelope-card.is-open .envelope-closed {
  display: none;
}

.envelope-card.is-open .letter-paper {
  display: block;
  animation: editorialFadeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reason-body.is-switching {
  animation: editorialFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dora-plushie-wrap.is-hugging {
  animation: gentleHug 0.55s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.dora-plushie .dora-eyes {
  transform-origin: center 70px;
  animation: doraBlink 4.8s ease-in-out infinite;
}

.dora-plushie .dora-bell {
  transform-origin: 130px 158px;
  animation: bellSway 4s ease-in-out infinite;
}

.music-pill.is-playing .music-bars span {
  animation: eqSoft 0.85s ease-in-out infinite alternate;
}

.music-pill.is-playing .music-bars span:nth-child(2) {
  animation-delay: 0.2s;
}

.music-pill.is-playing .music-bars span:nth-child(3) {
  animation-delay: 0.4s;
}

.lightbox {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-dialog {
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-open .lightbox-dialog {
  transform: scale(1);
}

.tap-heart-particle {
  position: fixed;
  z-index: 950;
  pointer-events: none;
  color: #b84a69;
  opacity: 0.85;
  animation: tapHeartRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(184, 74, 105, 0.28), 0 14px 28px rgba(36, 25, 29, 0.14);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(184, 74, 105, 0), 0 16px 32px rgba(184, 74, 105, 0.22);
  }
}

@keyframes gentleHug {
  0% { transform: scale(1); }
  40% { transform: scale(1.05) rotate(-1.5deg); }
  70% { transform: scale(0.98) rotate(1.5deg); }
  100% { transform: scale(1); }
}

@keyframes eqSoft {
  0% { height: 4px; }
  100% { height: 13px; }
}

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

@keyframes tapHeartRise {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.15) rotate(var(--rot));
  }
}

@keyframes doraBlink {
  0%, 45%, 49%, 100% { transform: scaleY(1); }
  47% { transform: scaleY(0.12); }
}

@keyframes bellSway {
  0%, 82%, 100% { transform: rotate(0deg); }
  87% { transform: rotate(7deg); }
  92% { transform: rotate(-7deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
