@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap');

:root {
  color-scheme: dark;
  --night: #080b1d;
  --lavender: #c8b5ff;
  --pink: #f2bad7;
  --text: #f8f0ff;
  --muted: #c3bdd9;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 35%, #202044 0%, #10132b 42%, var(--night) 100%);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.glow { position: fixed; width: 260px; height: 260px; border-radius: 50%; filter: blur(95px); opacity: .15; pointer-events: none; }
.glow-one { background: #b78aff; top: 8%; left: -140px; }
.glow-two { background: #ff91c8; right: -150px; bottom: 8%; }
main { position: relative; z-index: 1; min-height: calc(100vh - 52px); }
.screen {
  display: none;
  width: 100%;
  min-height: calc(100vh - 52px);
  padding: 72px 22px 64px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  animation: appear .8s ease both;
}
.screen.active { display: flex; }
.intro { min-height: calc(100svh - 52px); }
.moon { font-size: 54px; color: #f5d9ff; margin-bottom: 20px; text-shadow: 0 0 35px #c3a1ff; }
.eyebrow { color: var(--lavender); font-size: .68rem; letter-spacing: .22em; line-height: 1.8; font-weight: 600; }
h1, h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; }
h1 { font-size: clamp(2.8rem, 10vw, 5.2rem); line-height: 1.12; margin: 14px 0; }
h1 span { display: block; font-style: italic; color: var(--pink); }
h2 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.25; margin: 12px 0 18px; }
.subtitle { color: var(--muted); line-height: 1.8; max-width: 440px; margin: 12px auto 26px; }
.primary {
  border: 1px solid rgba(229, 203, 255, .55);
  border-radius: 999px;
  padding: 15px 23px;
  margin-top: 22px;
  color: #171027;
  background: linear-gradient(120deg, #f1c9e2, #d1c0ff);
  font: 600 .95rem 'DM Sans', sans-serif;
  box-shadow: 0 0 35px #c2a5ff25;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 0 38px #c2a5ff45; }
.primary:focus-visible { outline: 2px solid white; outline-offset: 4px; }
.primary span { margin-left: 8px; }
.hint { color: #9893b6; font-size: .8rem; margin-top: 25px; }
.letter { padding-top: 55px; }
.paper {
  width: min(100%, 650px);
  padding: clamp(24px, 6vw, 48px);
  border: 1px solid #e3c8e526;
  border-radius: 18px;
  background: linear-gradient(145deg, #201d37eF, #15162bea);
  box-shadow: 0 20px 80px #00000030;
  text-align: left;
}
.paper-star { text-align: center; color: var(--pink); font-size: 1.8rem; margin-bottom: 24px; }
#letter-text p { white-space: pre-wrap; color: #eee7f8; font-size: 1rem; line-height: 1.95; margin: 0 0 20px; }
.signature { margin: 30px 0 5px; color: var(--muted); font-family: 'Playfair Display', Georgia, serif; font-style: italic; }
.signature-name { margin: 0; color: var(--pink); font-family: 'Playfair Display', Georgia, serif; font-size: 1.4rem; }
.gift { padding-top: 60px; }
.video-frame { position: relative; width: min(100%, 760px); margin-top: 12px; border: 1px solid #e4c9ff3b; border-radius: 16px; overflow: hidden; background: #070814; box-shadow: 0 20px 70px #0005; }
video { display: block; width: 100%; max-height: 70vh; background: #070814; }
.video-placeholder { padding: 36px 20px; color: var(--muted); }
.video-placeholder p { line-height: 1.7; }
.play-symbol { color: var(--pink); font-size: 2.5rem; }
.small { font-size: .8rem; color: #9690b0; }
.heart { font-size: 4rem; color: var(--pink); text-shadow: 0 0 35px #ff9fce75; animation: heartbeat 2s ease-in-out infinite; }
.final-message { max-width: 570px; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.25rem, 4vw, 1.65rem); line-height: 1.9; color: #f1e8fa; }
.final-signature { font-size: 1.2rem; color: var(--pink); font-family: 'Playfair Display', Georgia, serif; font-style: italic; }
.ending-stars { margin-top: 30px; color: var(--lavender); letter-spacing: .3em; }
footer { position: relative; z-index: 1; min-height: 52px; padding: 15px 10px; text-align: center; font-size: .72rem; color: #8f8aa9; }
@keyframes appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
@media (min-width: 800px) {
  .screen { padding-left: 40px; padding-right: 40px; }
}

.music-toggle {
  position: fixed;
  z-index: 5;
  right: 16px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border: 1px solid #e3c8e555;
  border-radius: 999px;
  color: #f8f0ff;
  background: #17152beF;
  box-shadow: 0 5px 25px #0004;
  font: 500 .82rem 'DM Sans', sans-serif;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.music-toggle[hidden] { display: none; }
.music-toggle span:first-child { color: #f2bad7; font-size: 1.1rem; }
@media (max-width: 480px) {
  .music-toggle { right: 12px; bottom: 12px; }
}
