:root {
  color-scheme: light;
  --pink: #ff4f86;
  --deep-pink: #f42f6f;
  --cream: #fff8f4;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #ffd8e5;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  overscroll-behavior: none;
}

button {
  font: inherit;
}

.experience,
.welcome,
.surprise {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.experience {
  isolation: isolate;
}

.welcome {
  z-index: 2;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 42%, rgb(255 255 255 / 0.95) 0 8%, transparent 35%),
    linear-gradient(145deg, #fff3f7, #ffd1e1 54%, #ffc4d9);
  transition: opacity 650ms cubic-bezier(0.22, 1, 0.36, 1), visibility 650ms;
}

.welcome::before,
.welcome::after {
  position: absolute;
  width: min(58vw, 330px);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: rgb(255 255 255 / 0.2);
}

.welcome::before {
  top: -18%;
  left: -18%;
}

.welcome::after {
  right: -20%;
  bottom: -16%;
}

.welcome__glow {
  position: absolute;
  width: min(72vw, 390px);
  aspect-ratio: 1;
  border: 2px solid rgb(255 255 255 / 0.58);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgb(255 255 255 / 0.12), 0 0 0 46px rgb(255 255 255 / 0.08);
  animation: soft-breathe 2.6s ease-in-out infinite;
}

.reveal-button {
  position: relative;
  z-index: 1;
  min-width: 174px;
  min-height: 62px;
  padding: 16px 34px 18px;
  border: 2px solid rgb(255 255 255 / 0.8);
  border-radius: 999px;
  outline: none;
  color: white;
  background: linear-gradient(180deg, #ff79a4, var(--pink));
  box-shadow: 0 12px 30px rgb(221 58 111 / 0.3), inset 0 2px 1px rgb(255 255 255 / 0.42);
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}

.reveal-button:active {
  transform: scale(0.94);
  box-shadow: 0 6px 18px rgb(221 58 111 / 0.28), inset 0 2px 1px rgb(255 255 255 / 0.42);
}

.reveal-button:focus-visible {
  outline: 4px solid rgb(255 255 255 / 0.95);
  outline-offset: 5px;
}

.surprise {
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #ffd8e5;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 800ms ease, transform 1.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.surprise::before {
  position: absolute;
  inset: -2px;
  content: "";
  background: url("assets/kawaii-wallpaper.jpg") center / cover no-repeat;
  transform: translateZ(0);
}

.surprise::after {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(circle at center, rgb(255 246 245 / 0.1) 0 25%, rgb(255 112 154 / 0.06) 74%, rgb(255 82 131 / 0.14) 100%);
}

.is-revealed .welcome {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.is-revealed .surprise {
  opacity: 1;
  transform: scale(1);
}

.heart-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  width: clamp(150px, 42vw, 225px);
  aspect-ratio: 1;
  place-items: center;
  transform: translateY(1.5vh);
}

.heart {
  position: relative;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 18% 0 18% 18%;
  background: linear-gradient(135deg, #ff8faf 0%, #ff3f78 52%, #ed1e5b 100%);
  box-shadow: 0 16px 38px rgb(203 38 91 / 0.34), inset -8px -10px 18px rgb(157 16 63 / 0.14), inset 8px 10px 18px rgb(255 255 255 / 0.24);
  transform: rotate(-45deg);
  animation: heartbeat 1.45s cubic-bezier(0.3, 0.05, 0.3, 1) infinite;
  will-change: transform;
}

.heart::before,
.heart::after {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  content: "";
  background: inherit;
}

.heart::before {
  top: -50%;
  left: 0;
}

.heart::after {
  top: 0;
  left: 50%;
}

.heart-shine {
  position: absolute;
  z-index: 2;
  top: 27%;
  left: 34%;
  width: 15%;
  height: 8%;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.64);
  transform: rotate(-27deg);
  animation: shine-beat 1.45s cubic-bezier(0.3, 0.05, 0.3, 1) infinite;
}

.heart-ring {
  position: absolute;
  z-index: -1;
  width: 75%;
  aspect-ratio: 1;
  border: 4px solid rgb(255 83 137 / 0.34);
  border-radius: 50%;
  animation: ripple 1.45s ease-out infinite;
}

.sparkles {
  position: absolute;
  z-index: 2;
  width: min(78vw, 420px);
  aspect-ratio: 1;
  pointer-events: none;
}

.sparkles i {
  position: absolute;
  width: 10px;
  aspect-ratio: 1;
  background: white;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: twinkle 1.8s ease-in-out infinite;
}

.sparkles i:nth-child(1) { top: 13%; left: 24%; }
.sparkles i:nth-child(2) { top: 25%; right: 16%; animation-delay: -0.55s; transform: scale(0.7); }
.sparkles i:nth-child(3) { right: 7%; bottom: 28%; animation-delay: -1.1s; }
.sparkles i:nth-child(4) { bottom: 12%; left: 30%; animation-delay: -0.3s; transform: scale(0.6); }
.sparkles i:nth-child(5) { top: 44%; left: 6%; animation-delay: -0.9s; }
.sparkles i:nth-child(6) { top: 7%; right: 38%; animation-delay: -1.4s; transform: scale(0.65); }

@keyframes soft-breathe {
  50% { transform: scale(1.045); opacity: 0.72; }
}

@keyframes heartbeat {
  0%, 100% { transform: rotate(-45deg) scale(0.96); }
  18% { transform: rotate(-45deg) scale(1.08); }
  31% { transform: rotate(-45deg) scale(1); }
  45% { transform: rotate(-45deg) scale(1.055); }
  68% { transform: rotate(-45deg) scale(0.96); }
}

@keyframes shine-beat {
  0%, 100% { transform: rotate(-27deg) scale(0.96); }
  18% { transform: rotate(-27deg) scale(1.08); }
  31% { transform: rotate(-27deg) scale(1); }
  45% { transform: rotate(-27deg) scale(1.055); }
  68% { transform: rotate(-27deg) scale(0.96); }
}

@keyframes ripple {
  0% { opacity: 0.7; transform: scale(0.72); }
  65%, 100% { opacity: 0; transform: scale(1.62); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; scale: 0.7; }
  50% { opacity: 0.95; scale: 1.15; }
}

@media (min-aspect-ratio: 3 / 4) {
  .surprise::before {
    background-size: 100% auto;
    background-color: #ffd8e5;
  }
}

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

  .welcome,
  .surprise {
    transition-duration: 200ms;
  }
}
