:root {
  color-scheme: light;
  --pink: #ff5f9e;
  --hot: #ff2f78;
  --peach: #ffd0dc;
  --cream: #fff7f0;
  --text: #311725;
  --muted: #7c5365;
  --glass: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.7);
  --shadow: 0 28px 80px rgba(195, 42, 96, 0.22);
  --font-body: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --font-romantic: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 95, 158, 0.34), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(255, 210, 225, 0.88), transparent 30%),
    radial-gradient(circle at 70% 85%, rgba(255, 182, 197, 0.44), transparent 32%),
    linear-gradient(135deg, #fff4f7 0%, #ffe2ec 48%, #fff8ed 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.ambient span,
.confetti-heart {
  position: fixed;
  pointer-events: none;
  z-index: 1;
}

.ambient span {
  width: 18px;
  height: 18px;
  background: var(--pink);
  opacity: 0.18;
  transform: rotate(45deg);
  animation: drift 12s ease-in-out infinite;
}

.ambient span::before,
.ambient span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: inherit;
}

.ambient span::before { left: -9px; }
.ambient span::after { top: -9px; }
.ambient span:nth-child(1) { left: 8%; top: 18%; animation-delay: -1s; }
.ambient span:nth-child(2) { left: 22%; top: 76%; animation-delay: -5s; }
.ambient span:nth-child(3) { right: 12%; top: 20%; animation-delay: -2s; }
.ambient span:nth-child(4) { right: 20%; bottom: 14%; animation-delay: -7s; }
.ambient span:nth-child(5) { left: 50%; top: 8%; animation-delay: -4s; }
.ambient span:nth-child(6) { left: 66%; bottom: 28%; animation-delay: -9s; }

.music-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--hot);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 36px rgba(195, 42, 96, 0.18);
  backdrop-filter: blur(16px);
  cursor: pointer;
}

.music-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--hot));
}

.music-toggle.playing .music-icon {
  animation: spin 2.8s linear infinite;
}

.story-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.scene {
  display: none;
  min-height: 100vh;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 74px 20px 42px;
  animation: sceneIn 0.75s ease both;
}

.scene.active {
  display: grid;
}

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
}

.hero-copy,
.glass-panel,
.answer-card,
.memory-copy,
.video-card,
.photo-frame {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-copy {
  padding: clamp(34px, 6vw, 66px);
  border-radius: 38px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--hot);
  font-family: "Montserrat", "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-romantic);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.02em;
}

h1 {
  max-width: 680px;
  font-size: clamp(3rem, 9vw, 7rem);
}

h2 {
  font-size: clamp(2rem, 5.6vw, 4.6rem);
}

.lead,
.memory-copy p,
.typewriter,
.photo-frame figcaption,
.answer-text {
  color: var(--muted);
  line-height: 1.9;
  font-size: clamp(1rem, 2.2vw, 1.22rem);
}

.name-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--hot);
  font-weight: 900;
  box-shadow: 0 12px 34px rgba(195, 42, 96, 0.12);
}

.name-card i {
  color: var(--muted);
  font-style: normal;
  font-size: 0.9rem;
}

button {
  font: inherit;
}

.primary-btn,
.ghost-btn,
.round-btn {
  border: 0;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.primary-btn {
  border-radius: 999px;
  padding: 15px 30px;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--hot));
  box-shadow: 0 18px 42px rgba(255, 47, 120, 0.28);
  font-weight: 900;
}

.primary-btn:hover,
.ghost-btn:hover,
.round-btn:hover {
  transform: translateY(-3px);
}

.photo-orbit {
  position: relative;
  min-height: 560px;
}

.photo-orbit::before {
  content: "";
  position: absolute;
  inset: 64px 34px;
  border: 2px dashed rgba(255, 95, 158, 0.24);
  border-radius: 50%;
  animation: rotate 22s linear infinite;
}

.photo-orbit img {
  position: absolute;
  width: 46%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 10px solid rgba(255, 255, 255, 0.88);
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(74, 21, 46, 0.25);
  animation: floatPhoto 6s ease-in-out infinite;
}

.photo-orbit img:nth-child(1) { left: 4%; top: 4%; transform: rotate(-9deg); }
.photo-orbit img:nth-child(2) { right: 0; top: 18%; transform: rotate(8deg); animation-delay: -1.4s; }
.photo-orbit img:nth-child(3) { left: 10%; bottom: 2%; transform: rotate(7deg); animation-delay: -2.5s; }
.photo-orbit img:nth-child(4) { right: 10%; bottom: 10%; transform: rotate(-7deg); animation-delay: -3.6s; }

.letter,
.answer-scene {
  place-items: center;
}

.glass-panel,
.answer-card {
  width: min(860px, 100%);
  padding: clamp(34px, 7vw, 76px);
  border-radius: 42px;
  text-align: center;
}

.typewriter {
  min-height: 150px;
  margin: 28px auto 26px;
  max-width: 720px;
}

.heart-meter {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0;
}

.heart-meter span {
  width: 24px;
  height: 24px;
  background: var(--pink);
  transform: rotate(45deg) scale(0.8);
  animation: beat 1.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.16s);
}

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

.heart-meter span::before { left: -12px; }
.heart-meter span::after { top: -12px; }

.gallery {
  align-content: center;
  gap: 26px;
}

.section-title {
  text-align: center;
}

.carousel {
  display: grid;
  grid-template-columns: 56px minmax(0, 620px) 56px;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.photo-frame {
  margin: 0;
  padding: 16px 16px 22px;
  border-radius: 34px;
  text-align: center;
}

.photo-frame img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 24px;
  background: #fff;
}

.photo-frame figcaption {
  margin-top: 16px;
  font-weight: 800;
}

.round-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--hot));
  box-shadow: 0 16px 34px rgba(255, 47, 120, 0.24);
  font-size: 2rem;
}

.thumbs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.thumbs button {
  width: 64px;
  height: 64px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.thumbs button.active {
  border-color: var(--hot);
}

.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.gallery > .primary-btn {
  justify-self: center;
}

.memory {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: center;
  gap: clamp(24px, 5vw, 58px);
}

.video-card,
.memory-copy {
  border-radius: 34px;
  padding: 16px;
}

.video-card video {
  display: block;
  width: 100%;
  max-height: 72vh;
  border-radius: 24px;
  background: #111;
}

.memory-copy {
  padding: clamp(30px, 5vw, 52px);
}

.memory.memory-only {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.memory.memory-only .memory-copy {
  text-align: center;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 30px 0 12px;
}

.ghost-btn {
  border-radius: 999px;
  padding: 15px 30px;
  color: var(--hot);
  background: white;
  box-shadow: 0 18px 42px rgba(195, 42, 96, 0.12);
  font-weight: 900;
}

.ghost-btn.thinking {
  animation: softWiggle 0.42s ease-in-out;
}

.answer-text {
  min-height: 44px;
  color: var(--hot);
  font-weight: 900;
}

.confetti-heart {
  bottom: -40px;
  color: var(--hot);
  font-size: 28px;
  animation: confetti 3s ease-out forwards;
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(45deg) scale(1); }
  50% { transform: translate3d(18px, -34px, 0) rotate(45deg) scale(1.2); }
}

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatPhoto {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -20px; }
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

@keyframes beat {
  0%, 100% { transform: rotate(45deg) scale(0.82); opacity: 0.68; }
  50% { transform: rotate(45deg) scale(1.12); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes softWiggle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-5px) rotate(-1.2deg); }
  50% { transform: translateX(4px) rotate(1deg); }
  75% { transform: translateX(-3px) rotate(-0.7deg); }
}

@keyframes confetti {
  from { transform: translate(0, 0) scale(0.8); opacity: 1; }
  to { transform: translate(var(--x), -105vh) scale(1.35); opacity: 0; }
}

@media (max-width: 860px) {
  .hero,
  .memory {
    grid-template-columns: 1fr;
  }

  .photo-orbit {
    min-height: 430px;
  }

  .carousel {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .round-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 560px) {
  .scene {
    padding: 74px 14px 30px;
  }

  .hero-copy,
  .glass-panel,
  .answer-card,
  .memory-copy {
    border-radius: 28px;
  }

  .photo-orbit img {
    width: 54%;
    border-width: 7px;
  }

  .music-toggle {
    left: 14px;
    right: auto;
  }
}
