:root {
  --bg-1: #140817;
  --bg-2: #26112b;
  --bg-3: #4f1f4e;
  --text: #fff8fb;
  --muted: rgba(255, 248, 251, 0.74);
  --accent: #ff98c7;
  --accent-strong: #ff6bb0;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 130, 188, 0.18), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(183, 124, 255, 0.18), transparent 28%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
  overflow: hidden;
}

.app {
  position: relative;
  min-height: 100svh;
  width: 100%;
  isolation: isolate;
}

.ambient {
  position: absolute;
  inset: auto;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.55;
  animation: drift 10s ease-in-out infinite alternate;
}
.ambient--one {
  width: 220px; height: 220px; top: 8%; left: -8%;
  background: rgba(255, 120, 181, 0.32);
}
.ambient--two {
  width: 240px; height: 240px; right: -10%; top: 18%;
  background: rgba(174, 111, 255, 0.28);
  animation-duration: 12s;
}
.ambient--three {
  width: 280px; height: 280px; bottom: -10%; left: 25%;
  background: rgba(255, 172, 206, 0.22);
  animation-duration: 14s;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 24%, rgba(255,255,255,0.8) 0 1px, transparent 1.2px),
    radial-gradient(circle at 72% 30%, rgba(255,255,255,0.55) 0 1px, transparent 1.2px),
    radial-gradient(circle at 36% 78%, rgba(255,255,255,0.65) 0 1px, transparent 1.2px),
    radial-gradient(circle at 82% 64%, rgba(255,255,255,0.5) 0 1px, transparent 1.2px);
  animation: sparkle 5s ease-in-out infinite;
  opacity: 0.75;
}

.intro, .reveal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}

.intro {
  z-index: 3;
  opacity: 1;
  transition: opacity 900ms ease, transform 1100ms ease, visibility 0s linear 0s;
}
.intro.is-opening {
  opacity: 0;
  transform: scale(1.04);
  visibility: hidden;
}

.intro__content {
  text-align: center;
  width: min(100%, 420px);
}

.gift-shell {
  position: relative;
  width: min(68vw, 270px);
  aspect-ratio: 1 / 1.08;
  margin: 0 auto 28px;
  cursor: pointer;
  border-radius: 32px;
  outline: none;
  transform: translateZ(0);
  animation: pulse 3s ease-in-out infinite;
}
.gift-shell:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}
.gift-shell__glow,
.gift-shell__core,
.gift-shell__line {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.gift-shell__glow {
  inset: -8%;
  background: radial-gradient(circle, rgba(255, 132, 193, 0.35), transparent 60%);
  filter: blur(20px);
}
.gift-shell__core {
  background:
    linear-gradient(155deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05)),
    linear-gradient(180deg, rgba(255, 161, 208, 0.18), rgba(191, 133, 255, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.25);
  backdrop-filter: blur(16px);
}
.gift-shell__line {
  border: 1px solid rgba(255,255,255,0.08);
  mix-blend-mode: screen;
}
.gift-shell__line--one { transform: rotate(9deg) scale(0.96); }
.gift-shell__line--two { transform: rotate(-11deg) scale(0.88); }
.gift-shell__line--three { transform: rotate(20deg) scale(0.8); }

.intro__eyebrow,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.intro__title {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1.08;
  font-weight: 700;
}

.reveal {
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 1100ms ease 220ms, transform 1100ms ease 220ms;
}
.reveal.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.scene-glow {
  position: absolute;
  width: min(82vw, 460px);
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 142, 199, 0.28), rgba(171, 118, 255, 0.16), transparent 70%);
  filter: blur(22px);
  animation: breathe 6s ease-in-out infinite;
}

.content-card {
  position: relative;
  width: min(100%, 420px);
  text-align: center;
  z-index: 2;
}

.photo-frame {
  position: relative;
  width: min(72vw, 280px);
  margin: 0 auto 26px;
  border-radius: 32px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transform: translateY(18px);
  opacity: 0;
}
.reveal.is-visible .photo-frame {
  animation: riseIn 900ms ease forwards 450ms;
}

.photo-frame__halo {
  position: absolute;
  inset: -12px;
  border-radius: 40px;
  background: radial-gradient(circle, rgba(255, 152, 199, 0.3), transparent 62%);
  filter: blur(20px);
  z-index: -1;
}
.photo-frame__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.message-block {
  opacity: 0;
  transform: translateY(16px);
}
.reveal.is-visible .message-block {
  animation: riseIn 900ms ease forwards 700ms;
}
.message-block h2 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.35rem);
  line-height: 1.14;
}
.eyebrow--soft { color: rgba(255, 224, 238, 0.82); }
.subcopy {
  margin: 0 auto;
  width: min(100%, 34ch);
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

.heart-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.heart {
  position: absolute;
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.9);
  animation: floatHeart var(--duration) ease-in forwards;
  filter: drop-shadow(0 4px 10px rgba(255, 107, 176, 0.2));
}
.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 16px;
  background: linear-gradient(180deg, rgba(255, 196, 220, 0.95), rgba(255, 107, 176, 0.9));
  border-radius: 10px 10px 0 0;
}
.heart::before {
  left: 8px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}
.heart::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}

.music-toggle {
  position: absolute;
  top: max(22px, env(safe-area-inset-top));
  right: 18px;
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.1);
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}
.music-toggle.is-muted { opacity: 0.7; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(16px, -20px, 0) scale(1.08); }
}
@keyframes sparkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatHeart {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(var(--scale));
  }
  12% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x), calc(-1 * var(--rise)), 0) scale(calc(var(--scale) + 0.25));
  }
}

@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;
  }
}
