:root {
  --night-950: #090718;
  --night-900: #120d2e;
  --night-800: #211344;
  --violet: #8f6bd8;
  --rose: #f3a6bd;
  --gold: #ffd9a8;
  --paper: #fff8f4;
  --ink: #2b1835;
  --text: #fff9f5;
  --muted: rgba(255, 249, 245, 0.68);
  --hairline: rgba(255, 255, 255, 0.16);
  --content-width: 42rem;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--night-950);
}

.js-enabled:not([data-experience="open"]) {
  overflow: hidden;
}

.js-enabled:not([data-experience="open"]) body {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 12%, rgba(243, 166, 189, 0.16), transparent 27rem),
    linear-gradient(180deg, var(--night-950), var(--night-900) 42%, #351744 75%, #7d3e62 100%);
  font-family: var(--sans);
}

button { font: inherit; }

.ambient-stars,
.ambient-stars::before,
.ambient-stars::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-stars {
  z-index: 0;
  overflow: hidden;
  opacity: 0.6;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 248, 232, 0.86) 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 67%, rgba(255, 217, 168, 0.64) 0 1px, transparent 1.7px);
  background-size: 12rem 13rem, 17rem 16rem;
}

.ambient-stars::before,
.ambient-stars::after {
  content: "";
  background-image:
    radial-gradient(circle at 82% 18%, rgba(255, 249, 245, 0.76) 0 1px, transparent 1.6px),
    radial-gradient(circle at 28% 76%, rgba(243, 166, 189, 0.56) 0 1px, transparent 1.8px);
  background-size: 15rem 18rem, 21rem 19rem;
  animation: star-drift 48s linear infinite alternate;
}

.ambient-stars::after {
  opacity: 0.42;
  animation-duration: 67s;
  animation-direction: alternate-reverse;
}

main { position: relative; z-index: 1; }

.scene {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(4rem, env(safe-area-inset-top))
    clamp(1.25rem, 6vw, 3rem)
    max(4rem, env(safe-area-inset-bottom));
}

.scene > * { width: min(100%, var(--content-width)); margin-inline: auto; }

.scene-intro {
  min-height: 100dvh;
  overflow: hidden;
  text-align: center;
}

.intro-copy { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
p { margin-top: 0; }

h1,
h2 { font-family: var(--serif); font-weight: 600; }

.scene-intro h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(4rem, 20vw, 8.5rem);
  letter-spacing: 0.1em;
  line-height: 1;
  text-indent: 0.1em;
  text-shadow: 0 0 2.5rem rgba(243, 166, 189, 0.36);
}

.intro-line {
  max-width: 21rem;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  line-height: 1.9;
}

.moon-glow {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: -6rem;
  width: min(57vw, 24rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 168, 0.53), rgba(243, 166, 189, 0.18) 35%, transparent 69%);
  filter: blur(8px);
}

.js-enabled[data-experience="open"] .moon-glow {
  animation: opening-halo 1.2s cubic-bezier(.16, .78, .37, 1) both;
}

.js-enabled[data-reduced-motion="true"][data-experience="open"] .moon-glow {
  animation: none;
  opacity: 0.18;
  transform: scale(1.85);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.72rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0.7rem 2.4rem rgba(9, 7, 24, 0.2);
  cursor: pointer;
  transition: transform 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0.9rem 2.8rem rgba(9, 7, 24, 0.34);
}

.primary-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.scroll-hint {
  align-self: end;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  opacity: 0.48;
  transition: opacity 500ms ease, transform 500ms ease;
}

.js-enabled[data-experience="open"] .scroll-hint {
  opacity: 0;
  transform: translateY(0.75rem);
}

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

.section-heading h2 {
  margin-bottom: 2.1rem;
  font-size: clamp(2rem, 7vw, 3.3rem);
  line-height: 1.25;
}

.scene-notes { background: linear-gradient(180deg, transparent, rgba(18, 13, 46, 0.26)); }

.notes-list {
  display: grid;
  gap: 1.2rem;
}

.note-card {
  min-height: 13.5rem;
  padding: 1.65rem;
  border: 1px solid var(--hairline);
  border-radius: 1.1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035));
  box-shadow: 0 1.25rem 3rem rgba(9, 7, 24, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.note-card:nth-child(1) { --note-card-rotation: -1.25deg; transform: rotate(var(--note-card-rotation)); }
.note-card:nth-child(2) { --note-card-rotation: 0.85deg; transform: rotate(var(--note-card-rotation)); }
.note-card:nth-child(3) { --note-card-rotation: -0.45deg; transform: rotate(var(--note-card-rotation)); }

.note-index {
  display: block;
  margin-bottom: 1.7rem;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.note-card p {
  margin-bottom: 0;
  color: rgba(255, 249, 245, 0.88);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.95;
}

.scene-constellation { gap: 1rem; text-align: center; }

.name-constellation {
  display: block;
  width: min(100%, 30rem);
  height: auto;
  margin: 0.3rem auto 1rem;
  overflow: visible;
}

.name-constellation line {
  stroke: url("#constellation-gold") var(--gold);
  stroke-width: 1.2;
  stroke-dasharray: 1 7;
  stroke-linecap: round;
  opacity: 0.8;
}

.name-constellation circle {
  fill: var(--gold);
  filter: drop-shadow(0 0 0.38rem rgba(255, 217, 168, 0.95));
}

.js-enabled .name-constellation.is-visible line {
  animation: constellation-draw 1.7s ease-out both;
}

.js-enabled .name-constellation.is-visible .constellation-word:nth-of-type(2) line { animation-delay: 180ms; }
.js-enabled .name-constellation.is-visible .constellation-word:nth-of-type(3) line { animation-delay: 360ms; }

.constellation-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 2;
}

.scene-letter {
  align-content: center;
  gap: 2rem;
  background: radial-gradient(circle at 50% 18%, rgba(255, 217, 168, 0.22), transparent 25rem);
}

.love-letter {
  padding: clamp(2rem, 8vw, 4.25rem);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1.35rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1.7rem 4rem rgba(92, 26, 68, 0.4), 0 0 0 0.55rem rgba(243, 166, 189, 0.09);
  text-align: center;
}

.love-letter .eyebrow { color: #8f4f68; }

.love-letter h2 {
  margin-bottom: 1.35rem;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.22;
}

.love-letter > p:not(.eyebrow):not(.final-message) {
  margin-bottom: 2rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 2;
}

.accept-button {
  border-color: #704051;
  color: #fffaf6;
  background: #6c304b;
  box-shadow: 0 0.9rem 1.7rem rgba(108, 48, 75, 0.25);
}

.accept-button:hover { background: #512139; }

.final-message {
  margin: 1.6rem 0 0;
  color: #68334b;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.8;
  opacity: 1;
  transition: opacity 700ms ease, transform 700ms ease;
}

.js-enabled:not([data-accepted="true"]) .final-message {
  min-height: 3.9rem;
  opacity: 0;
  transform: translateY(0.55rem);
}

.js-enabled[data-accepted="true"] .final-message {
  opacity: 1;
  transform: none;
}

footer {
  color: rgba(255, 249, 245, 0.68);
  font-size: 0.67rem;
  letter-spacing: 0.16em;
  text-align: center;
}

.reveal-on-scroll { opacity: 1; transform: none; }

.js-enabled .reveal-on-scroll {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 800ms ease, transform 800ms cubic-bezier(.2, .75, .2, 1);
}

.js-enabled .reveal-on-scroll.is-visible { opacity: 1; transform: none; }

.js-enabled .note-card.reveal-on-scroll {
  transform: translateY(1.5rem) rotate(var(--note-card-rotation, 0deg));
}

.js-enabled .note-card.reveal-on-scroll.is-visible {
  transform: rotate(var(--note-card-rotation, 0deg));
}

.celebration-layer {
  position: fixed;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.celebration-particle {
  position: absolute;
  top: -10vh;
  left: var(--x, 50%);
  width: 0.75rem;
  aspect-ratio: 1;
  box-shadow: 0 0 0.8rem rgba(255, 217, 168, 0.75);
  opacity: 0;
  transform: rotate(var(--rotate, 0deg));
  animation: celebrate-fall 3s cubic-bezier(.16, .78, .37, 1) var(--delay, 0s) both;
}

.celebration-particle[data-shape="star"] {
  background: transparent;
  filter: drop-shadow(0 0 0.32rem rgba(255, 217, 168, 0.86));
}

.celebration-particle[data-shape="star"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 94%, 50% 71%, 21% 94%, 32% 56%, 2% 35%, 39% 35%);
}

.celebration-particle[data-shape="star"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 64%;
  width: 1.4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 217, 168, 0.58));
  transform: translateY(-50%);
}

.celebration-particle[data-shape="petal"] {
  border-radius: 55% 0 55% 55%;
  background: var(--rose);
}

.celebration-particle[data-shape="heart"] {
  background: #ffb2c8;
  clip-path: polygon(50% 92%, 8% 50%, 8% 28%, 20% 12%, 38% 12%, 50% 27%, 62% 12%, 80% 12%, 92% 28%, 92% 50%);
}

@keyframes star-drift {
  to { transform: translate3d(-3rem, 4rem, 0); }
}

@keyframes opening-halo {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.18; transform: scale(1.85); }
}

@keyframes constellation-draw {
  from { opacity: 0; stroke-dashoffset: 32; }
  to { opacity: 0.8; stroke-dashoffset: 0; }
}

@keyframes celebrate-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--rotate, 0deg)); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(4vw, 112dvh, 0) rotate(calc(var(--rotate, 0deg) + 380deg)); }
}

@media (orientation: landscape) and (max-height: 560px) {
  .scene { min-height: auto; padding-block: 4rem; }
  .scene-intro { padding-block: 1rem; }
  .scene-intro h1 { font-size: clamp(4rem, 13vw, 7rem); }
}

@media (min-width: 900px) {
  .scene { padding-inline: max(8vw, calc((100vw - var(--content-width)) / 2)); }
  .notes-list { grid-template-columns: repeat(3, 1fr); }
  .note-card { min-height: 16.5rem; }
}

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