:root {
  --navy: #050816;
  --purple: #2e1f5e;
  --pink: #ff8dbb;
  --pink-light: #ffd1e4;
  --white: #fff4fb;
  --ink: #39293c;
  --glass: rgba(22, 18, 54, 0.52);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--white);
  background: var(--navy);
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--pink-light);
  outline-offset: 4px;
}

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

.sky {
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, .16), rgba(5, 8, 22, .8)),
    url("assets/background.jpg") center / cover;
}

.sky::before {
  content: "";
  background:
    radial-gradient(circle at 75% 15%, rgba(188, 153, 255, .2), transparent 27%),
    linear-gradient(145deg, rgba(46, 31, 94, .42), rgba(5, 8, 22, .54));
}

.sky::after {
  content: "";
  opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.23'/%3E%3C/svg%3E");
}

.star-field,
#shootingStars,
#petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bg-star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 7px #fff, 0 0 13px rgba(180, 205, 255, .8);
  animation: twinkle var(--duration) ease-in-out var(--delay) infinite;
}

.moon {
  position: absolute;
  z-index: 1;
  top: clamp(1rem, 5vw, 3.5rem);
  right: clamp(1rem, 7vw, 6rem);
  width: clamp(7.5rem, 17vw, 13rem);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  clip-path: circle(23.5% at 50% 50%);
  filter: drop-shadow(0 0 10px rgba(155, 211, 255, .5));
  opacity: .92;
  transform: scale(2.05);
  animation: moon-breathe 7s ease-in-out infinite;
}

.horizon-glow {
  position: absolute;
  right: -15vw;
  bottom: -20vh;
  width: 80vw;
  height: 50vh;
  border-radius: 50%;
  background: rgba(105, 65, 161, .22);
  filter: blur(70px);
}

.shooting-star {
  position: absolute;
  width: 9rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, #fff);
  filter: drop-shadow(0 0 4px white);
  transform: rotate(-24deg);
  animation: shoot 1.8s linear forwards;
}

.petal {
  position: absolute;
  top: -4rem;
  width: var(--size);
  height: var(--size);
  border-radius: 55% 15% 55% 35%;
  object-fit: cover;
  mix-blend-mode: screen;
  filter: saturate(1.2) drop-shadow(0 2px 3px rgba(20, 6, 27, .25));
  opacity: .72;
  animation: petal-fall var(--fall-time) linear forwards;
}

#story {
  position: relative;
  z-index: 2;
  min-height: 100svh;
}

.scene {
  position: fixed;
  inset: 0;
  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  overflow: hidden auto;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.15rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.15rem, env(safe-area-inset-left));
  opacity: 0;
  transform: scale(1.025);
  transition: opacity .9s ease, transform 1.2s var(--ease), visibility 0s linear .9s;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 141, 187, .5) transparent;
}

.scene--active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition-delay: 0s;
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, .17);
  background: linear-gradient(135deg, rgba(255, 255, 255, .11), var(--glass));
  box-shadow: 0 2rem 5rem rgba(1, 3, 15, .42), inset 0 1px rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.eyebrow {
  color: var(--pink-light);
  font-size: clamp(.62rem, 1.6vw, .76rem);
  font-weight: 500;
  letter-spacing: .24em;
  line-height: 1.7;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  line-height: 1.05;
  text-shadow: 0 0 25px rgba(255, 189, 220, .28);
}

h1 {
  margin: .6rem 0 1.2rem;
  font-size: clamp(3.5rem, 9vw, 6.8rem);
}

h2 {
  margin: .5rem 0;
  font-size: clamp(2.9rem, 7vw, 5.2rem);
}

.scene-heading {
  position: relative;
  z-index: 2;
  max-width: 50rem;
  text-align: center;
}

.scene-heading > p:last-child:not(.eyebrow) {
  margin-top: .8rem;
  color: rgba(255, 244, 251, .75);
}

.primary-button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  padding: .9rem 1.55rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(100deg, #e85c98, #ff8dbb);
  box-shadow: 0 .7rem 2rem rgba(255, 87, 157, .25);
  font-weight: 500;
  transition: transform .3s var(--ease), box-shadow .3s ease;
}

.primary-button::before {
  position: absolute;
  top: -30%;
  left: -45%;
  width: 25%;
  height: 160%;
  content: "";
  background: rgba(255, 255, 255, .4);
  filter: blur(7px);
  transform: skewX(-22deg);
  transition: left .6s ease;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 1rem 2.5rem rgba(255, 87, 157, .4), 0 0 25px rgba(255, 141, 187, .2);
}

.primary-button:hover::before {
  left: 125%;
}

.scene-action {
  position: relative;
  z-index: 4;
}

.scene--welcome {
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, .12), rgba(5, 8, 22, .48)),
    url("assets/night-lake.svg") center / cover;
}

.scene--envelope,
.scene--memory {
  background:
    linear-gradient(145deg, rgba(5, 8, 22, .25), rgba(46, 31, 94, .5)),
    url("assets/sakura-sky.svg") center / cover;
}

.scene--messages {
  background:
    radial-gradient(circle at 50% 45%, rgba(72, 43, 115, .12), rgba(5, 8, 22, .78)),
    url("assets/background.jpg") center / cover;
}

.scene--reasons {
  background:
    linear-gradient(180deg, rgba(5, 8, 22, .3), rgba(5, 8, 22, .72)),
    url("assets/night-lake.svg") center / cover;
}

.scene--promises {
  background:
    linear-gradient(180deg, rgba(5, 8, 22, .42), rgba(5, 8, 22, .78)),
    url("assets/sakura-sky.svg") center / cover;
}

.welcome-card {
  width: min(43rem, 94vw);
  border-radius: 2rem;
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.welcome-copy {
  color: rgba(255, 244, 251, .84);
  line-height: 2;
}

.countdown {
  height: 6rem;
  margin: 1rem 0 .5rem;
  color: var(--pink);
  font-size: clamp(3.5rem, 9vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 0 30px rgba(255, 141, 187, .65);
  animation: count-pulse 1s ease-in-out infinite;
}

.welcome-prompt {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(1rem);
  transition: max-height 1s var(--ease), opacity .8s ease, transform .8s var(--ease);
}

.welcome-prompt.is-visible {
  max-height: 14rem;
  opacity: 1;
  transform: none;
}

.welcome-prompt p:first-child {
  color: var(--pink-light);
  font-weight: 500;
}

.welcome-prompt p:nth-child(2) {
  margin: .45rem 0 1.2rem;
  color: rgba(255, 244, 251, .72);
  font-size: .88rem;
  line-height: 1.7;
}

.scroll-whisper {
  position: absolute;
  bottom: 1.1rem;
  color: rgba(255, 255, 255, .35);
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.scene--envelope,
.scene--reasons,
.scene--promises {
  flex-direction: column;
  gap: clamp(1.3rem, 4vh, 2.5rem);
}

.envelope-button {
  position: relative;
  width: min(24rem, 75vw);
  aspect-ratio: 1.35;
  border: 0;
  cursor: pointer;
  background: transparent;
  filter: drop-shadow(0 2rem 2rem rgba(0, 0, 0, .35));
  animation: envelope-float 4s ease-in-out infinite;
  transition: transform .8s var(--ease), filter .5s ease;
}

.envelope-button:hover {
  filter: drop-shadow(0 2.2rem 2.2rem rgba(0, 0, 0, .42)) brightness(1.05);
}

.envelope-image {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 1.1rem;
  object-fit: cover;
  mix-blend-mode: screen;
}

.letter-preview {
  position: absolute;
  z-index: 1;
  top: 18%;
  left: 12%;
  display: flex;
  width: 76%;
  height: 72%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: .3rem;
  padding-top: 2rem;
  color: var(--ink);
  background: #fff8ef url("assets/paper.png") center / cover;
  box-shadow: 0 0 1rem rgba(0, 0, 0, .3);
  font-family: "Great Vibes", cursive;
  font-size: 2.2rem;
  transition: transform 1.2s var(--ease);
}

.letter-preview small {
  margin-top: .35rem;
  font-family: Poppins, sans-serif;
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.wax-seal {
  position: absolute;
  z-index: 3;
  top: 54%;
  left: 50%;
  display: grid;
  width: 3.2rem;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(255, 220, 228, .5);
  border-radius: 50%;
  color: #ffe5ed;
  background: #b93362;
  box-shadow: 0 .4rem 1rem rgba(70, 8, 31, .4);
  font-family: "Great Vibes", cursive;
  font-size: 1.7rem;
  transform: translate(-50%, -50%);
  transition: opacity .4s ease, transform .5s var(--ease);
}

.envelope-button.is-open {
  animation-play-state: paused;
}

.envelope-button.is-open .letter-preview {
  transform: translateY(-61%);
}

.envelope-button.is-open .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.8);
}

.interaction-hint {
  color: rgba(255, 244, 251, .7);
  font-size: .8rem;
  letter-spacing: .1em;
  transition: opacity .4s ease;
}

.envelope-button.is-open + .interaction-hint {
  opacity: 0;
}

#readLetterBtn {
  visibility: hidden;
  opacity: 0;
  transform: translateY(1rem);
  transition: .6s var(--ease);
}

#readLetterBtn.is-visible {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.scene--letter {
  align-items: flex-start;
  padding-block: clamp(1rem, 4vh, 3rem);
}

.letter-sheet {
  position: relative;
  width: min(48rem, 95vw);
  min-height: calc(100svh - 2rem);
  overflow: hidden;
  border-radius: .4rem;
  padding: clamp(2rem, 7vw, 5rem) clamp(1.5rem, 8vw, 5.5rem);
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 249, 240, .88), rgba(255, 244, 238, .88)),
    url("assets/paper.png") center top / cover;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .55);
}

.letter-sheet::before {
  position: absolute;
  inset: .8rem;
  border: 1px solid rgba(129, 66, 87, .15);
  content: "";
  pointer-events: none;
}

.letter-sheet header {
  position: relative;
  z-index: 1;
  text-align: center;
}

.letter-kicker {
  color: #a05f78;
  font-size: .65rem;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.letter-sheet h2 {
  color: #803f5d;
  text-shadow: none;
}

.letter-body {
  position: relative;
  z-index: 1;
  max-width: 37rem;
  margin: 1.5rem auto 0;
  font-family: "Kalam", "Comic Sans MS", cursive;
  font-size: clamp(1.02rem, 2.5vw, 1.16rem);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: .012em;
}

.letter-body p {
  margin-bottom: 1.1rem;
}

.letter-word {
  display: inline-block;
  opacity: 0;
  filter: blur(2px);
  transform: translateY(.25em);
  transition: opacity .32s ease, filter .32s ease, transform .32s var(--ease);
}

.letter-word.is-written,
.letter-body.is-complete .letter-word {
  opacity: 1;
  filter: none;
  transform: none;
}

.letter-emphasis {
  color: #8a3c61;
  font-family: "Kalam", cursive;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.65;
}

.signature {
  margin-top: 2rem;
  color: #713653;
  font-family: "Great Vibes", cursive !important;
  font-size: 1.8rem !important;
  line-height: 1.5 !important;
}

.letter-controls {
  position: relative;
  z-index: 2;
  display: flex;
  max-width: 37rem;
  margin: 2rem auto 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.text-button {
  border: 0;
  border-bottom: 1px solid #9c5674;
  padding: .35rem;
  cursor: pointer;
  color: #82435f;
  background: transparent;
  font-size: .8rem;
}

.scene--messages {
  flex-direction: column;
  justify-content: space-between;
  padding-block: clamp(1.25rem, 4vh, 3rem);
}

.message-constellation {
  position: relative;
  width: min(58rem, 94vw);
  height: clamp(17rem, 48vh, 30rem);
  flex: 0 1 auto;
}

.message-star {
  position: absolute;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 0;
  cursor: pointer;
  background: transparent;
  transform: translate(-50%, -50%);
}

.message-star::before {
  width: .65rem;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: #fff;
  box-shadow: 0 0 .5rem #fff, 0 0 1.6rem .3rem var(--pink-light);
  animation: message-star 2.3s ease-in-out var(--star-delay) infinite;
  transition: background .3s ease, transform .3s var(--ease);
}

.message-star::after {
  position: absolute;
  color: rgba(255, 255, 255, .45);
  content: "✦";
  font-size: 1.6rem;
}

.message-star:hover::before,
.message-star:focus-visible::before {
  transform: scale(1.5);
}

.message-star.is-found::before {
  background: var(--pink);
  box-shadow: 0 0 .7rem var(--pink), 0 0 1.8rem .4rem rgba(255, 141, 187, .55);
}

.star-message {
  display: flex;
  width: min(38rem, 92vw);
  min-height: 5.2rem;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  border-radius: 1.2rem;
  padding: 1rem 1.4rem;
  text-align: center;
}

.star-message > span {
  color: var(--pink);
  font-size: 1.4rem;
}

.star-message.is-changing {
  animation: message-pop .5s var(--ease);
}

.discovery-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 244, 251, .6);
  font-size: .75rem;
}

#toReasonsBtn {
  opacity: .55;
}

#toReasonsBtn.is-ready {
  opacity: 1;
  animation: ready-glow 2s ease-in-out infinite;
}

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

.floating-heart {
  position: absolute;
  color: var(--pink);
  filter: drop-shadow(0 0 .5rem rgba(255, 141, 187, .7));
  animation: float-heart 1.8s var(--ease) forwards;
}

.scene--reasons::before {
  position: absolute;
  width: min(70rem, 100vw);
  height: 70vh;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, rgba(255, 141, 187, .11), transparent 65%);
  transform: rotate(-6deg);
}

.scrapbook {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(66rem, 94vw);
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(.7rem, 2vw, 1.4rem);
}

.reason-card {
  position: relative;
  display: flex;
  min-height: 12rem;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(126, 74, 96, .2);
  padding: 1rem;
  color: #5d354b;
  background: #fff7ee;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(4rem) rotate(var(--rotation));
  transition: opacity .8s ease, transform 1s var(--ease);
}

.reason-card::before {
  position: absolute;
  top: -.8rem;
  left: 50%;
  width: 3.6rem;
  height: 1.3rem;
  content: "";
  background: rgba(255, 196, 215, .68);
  transform: translateX(-50%) rotate(-2deg);
}

.reason-card:nth-child(1) { --rotation: -5deg; }
.reason-card:nth-child(2) { --rotation: 3deg; }
.reason-card:nth-child(3) { --rotation: -2deg; }
.reason-card:nth-child(4) { --rotation: 4deg; }
.reason-card:nth-child(5) { --rotation: -3deg; }

.scene--active .reason-card {
  opacity: 1;
  transform: translateY(0) rotate(var(--rotation));
}

.scene--active .reason-card:nth-child(2) { transition-delay: .15s; }
.scene--active .reason-card:nth-child(3) { transition-delay: .3s; }
.scene--active .reason-card:nth-child(4) { transition-delay: .45s; }
.scene--active .reason-card:nth-child(5) { transition-delay: .6s; }

.reason-card span {
  color: #ca779a;
  font-family: "Great Vibes", cursive;
  font-size: 1.8rem;
}

.reason-card p {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.25;
}

.scene--memory {
  flex-direction: column;
  gap: 1.5rem;
}

.memory-layout {
  display: grid;
  width: min(61rem, 94vw);
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .7fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
}

.memory-lock {
  border-radius: 2rem;
  padding: clamp(1.7rem, 5vw, 3.5rem);
  text-align: center;
}

.lock-icon {
  display: grid;
  width: 4.5rem;
  margin: 0 auto 1rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: var(--pink-light);
  background: rgba(255, 141, 187, .08);
  font-size: 2.4rem;
  box-shadow: 0 0 2rem rgba(255, 141, 187, .14);
}

.memory-lock h2 {
  font-size: clamp(2.7rem, 6vw, 4.5rem);
}

#passwordForm {
  margin-top: 2rem;
  text-align: left;
}

#passwordForm label {
  display: block;
  margin: 0 0 .45rem .5rem;
  color: rgba(255, 244, 251, .65);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.password-row {
  display: flex;
  padding: .3rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(5, 8, 22, .4);
}

.password-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0 1rem;
  color: var(--white);
  outline: 0;
  background: transparent;
}

.password-row input::placeholder {
  color: rgba(255, 255, 255, .35);
}

.password-row input:focus-visible {
  outline: 0;
}

.form-message {
  min-height: 1.3rem;
  margin: .8rem 0 0 .5rem;
  color: rgba(255, 244, 251, .6);
  font-size: .75rem;
}

.form-message.is-error {
  color: #ffc0d8;
}

.polaroid {
  visibility: hidden;
  max-width: 22rem;
  justify-self: center;
  padding: 1rem 1rem 1.8rem;
  color: #5d354b;
  background: #fff9f2;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateX(5rem) rotate(8deg) scale(.8);
  transition: visibility 0s linear 1s, opacity 1s ease, transform 1.2s var(--ease);
}

.polaroid.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateX(0) rotate(3deg) scale(1);
  transition-delay: 0s;
}

.photo-frame {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #e8dce2;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid figcaption {
  padding: 1.2rem .5rem 0;
  font-family: "Great Vibes", cursive;
  font-size: 1.55rem;
  line-height: 1.2;
  text-align: center;
}

#toPromisesBtn {
  visibility: hidden;
  opacity: 0;
  transition: opacity .7s ease;
}

#toPromisesBtn.is-visible {
  visibility: visible;
  opacity: 1;
}

.promise-wall {
  display: grid;
  width: min(47rem, 94vw);
  gap: 1rem;
}

.promise-wall p {
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 1rem;
  padding: 1rem 1.3rem;
  color: rgba(255, 244, 251, .82);
  background: linear-gradient(90deg, rgba(255, 255, 255, .07), transparent);
  opacity: 0;
  transform: translateX(-2rem);
  transition: opacity .8s ease, transform .9s var(--ease), box-shadow .8s ease;
}

.promise-wall p.is-visible {
  opacity: 1;
  transform: none;
}

.promise-wall p:last-child.is-visible {
  border-color: rgba(255, 141, 187, .35);
  color: #fff;
  box-shadow: 0 0 2rem rgba(255, 141, 187, .13), inset 0 0 1.5rem rgba(255, 141, 187, .08);
  text-shadow: 0 0 1rem rgba(255, 141, 187, .5);
}

#toEndingBtn {
  visibility: hidden;
  opacity: 0;
  transition: opacity .8s ease;
}

#toEndingBtn.is-visible {
  visibility: visible;
  opacity: 1;
}

.scene--ending {
  flex-direction: column;
  background: radial-gradient(circle at center, rgba(46, 31, 94, .2), rgba(5, 8, 22, .72));
}

.constellation-heart {
  width: min(21rem, 62vw);
  margin-bottom: -1rem;
  opacity: 0;
  filter: drop-shadow(0 0 1rem rgba(255, 198, 223, .35));
  transition: opacity 1.5s ease .4s;
}

.scene--active .constellation-heart {
  opacity: 1;
}

.constellation-heart svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.heart-line {
  fill: rgba(255, 141, 187, .03);
  stroke: rgba(255, 215, 233, .72);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-width: 1.5;
}

.scene--active .heart-line {
  animation: draw-heart 4s ease-in-out .7s forwards;
}

.heart-points {
  fill: white;
}

.heart-points circle {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.scene--active .heart-points circle {
  animation: point-in .5s var(--ease) forwards;
}

.scene--active .heart-points circle:nth-child(1) { animation-delay: .7s; }
.scene--active .heart-points circle:nth-child(2) { animation-delay: 1s; }
.scene--active .heart-points circle:nth-child(3) { animation-delay: 1.3s; }
.scene--active .heart-points circle:nth-child(4) { animation-delay: 1.6s; }
.scene--active .heart-points circle:nth-child(5) { animation-delay: 1.9s; }
.scene--active .heart-points circle:nth-child(6) { animation-delay: 2.2s; }
.scene--active .heart-points circle:nth-child(7) { animation-delay: 2.5s; }
.scene--active .heart-points circle:nth-child(8) { animation-delay: 2.8s; }
.scene--active .heart-points circle:nth-child(9) { animation-delay: 3.1s; }
.scene--active .heart-points circle:nth-child(10) { animation-delay: 3.4s; }
.scene--active .heart-points circle:nth-child(11) { animation-delay: 3.7s; }
.scene--active .heart-points circle:nth-child(12) { animation-delay: 4s; }

.ending-copy {
  text-align: center;
  opacity: 0;
  transform: translateY(1rem);
}

.scene--active .ending-copy {
  animation: ending-in 1.5s var(--ease) 4.4s forwards;
}

.ending-copy h2 {
  margin-bottom: 1rem;
}

.ending-copy > p:not(.eyebrow, .signature) {
  margin: .32rem 0;
  color: rgba(255, 244, 251, .76);
}

.ending-heart {
  display: block;
  margin: 1.1rem 0 .4rem;
  font-size: 1.6rem;
  animation: count-pulse 1.8s ease-in-out infinite;
}

.ending-copy .signature {
  color: var(--pink-light);
  text-shadow: 0 0 1rem rgba(255, 141, 187, .3);
}

@keyframes twinkle {
  0%, 100% { opacity: .2; transform: scale(.65); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes moon-breathe {
  0%, 100% { transform: translateY(0) scale(2.05); }
  50% { transform: translateY(.35rem) scale(2.1); }
}

@keyframes shoot {
  0% { opacity: 0; transform: translate(-10vw, -5vh) rotate(-24deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(125vw, 65vh) rotate(-24deg); }
}

@keyframes petal-fall {
  to { transform: translate(var(--drift), 115vh) rotate(var(--turn)); }
}

@keyframes count-pulse {
  50% { transform: scale(1.08); }
}

@keyframes envelope-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-.9rem) rotate(1deg); }
}

@keyframes message-star {
  50% { opacity: .55; transform: scale(.65); }
}

@keyframes message-pop {
  50% { transform: scale(1.025); }
}

@keyframes ready-glow {
  50% { box-shadow: 0 1rem 2.8rem rgba(255, 87, 157, .55), 0 0 2rem rgba(255, 141, 187, .3); }
}

@keyframes float-heart {
  0% { opacity: 0; transform: translate(-50%, 0) rotate(0) scale(.5); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--heart-drift)), -10rem) rotate(var(--heart-turn)) scale(1.25); }
}

@keyframes draw-heart {
  to { stroke-dashoffset: 0; fill: rgba(255, 141, 187, .06); }
}

@keyframes point-in {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ending-in {
  to { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .moon {
    opacity: .62;
  }

  .welcome-card {
    padding-block: 2rem;
  }

  .welcome-copy {
    font-size: .88rem;
  }

  .countdown {
    height: 4.4rem;
  }

  .scrapbook {
    display: flex;
    overflow: auto hidden;
    width: 100vw;
    padding: 1.5rem 1.5rem 2rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .reason-card {
    min-width: min(15rem, 70vw);
    min-height: 11rem;
    scroll-snap-align: center;
  }

  .memory-layout {
    display: block;
  }

  .memory-lock {
    width: 100%;
  }

  .polaroid {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: min(18rem, 76vw);
    transform: translate(-35%, -45%) rotate(8deg) scale(.8);
  }

  .polaroid.is-visible {
    transform: translate(-50%, -50%) rotate(2deg) scale(1);
  }

  .memory-layout:has(.polaroid.is-visible) .memory-lock {
    opacity: .12;
    pointer-events: none;
  }

  .message-constellation {
    height: 43vh;
  }

  .discovery-row {
    flex-direction: column;
    gap: .65rem;
  }

  .letter-controls {
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .scene-heading h2 {
    font-size: 2.75rem;
  }

  .scene--messages {
    padding-inline: .75rem;
  }

  .message-constellation {
    width: 100%;
  }

  .star-message {
    min-height: 4.7rem;
    font-size: .82rem;
  }

  .promise-wall {
    gap: .7rem;
  }

  .promise-wall p {
    padding: .8rem 1rem;
    font-size: .86rem;
  }

  .password-row {
    border-radius: 1rem;
    flex-direction: column;
    background: transparent;
  }

  .password-row input {
    min-height: 3rem;
    border-radius: .8rem;
    background: rgba(5, 8, 22, .4);
  }

  .password-row button {
    margin-top: .5rem;
  }

  .constellation-heart {
    width: min(17rem, 72vw);
  }

  .ending-copy {
    font-size: .85rem;
  }
}

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

  .petal,
  .shooting-star {
    display: none;
  }

  .letter-body p,
  .reason-card,
  .promise-wall p,
  .ending-copy,
  .heart-points circle {
    opacity: 1;
    transform: none;
  }

  .heart-line {
    stroke-dashoffset: 0;
  }
}