/* ==========================================================================
   For Susu — to the moon and back
   ========================================================================== */

:root {
  --night: #04050d;
  --ink: #f6eee2;
  --ink-soft: rgba(246, 238, 226, .76);
  --ink-faint: rgba(246, 238, 226, .52);
  --ink-ghost: rgba(246, 238, 226, .26);
  --rose: #ff6f96;
  --rose-deep: #e0245e;
  --blush: #ffc4d3;
  --gold: #f3d8a6;
  --paper-ink: #2a221d;
  --pen: #22305e;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --script: "Pinyon Script", "Snell Roundhand", "Segoe Script", cursive;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.4, .64, 1);

  /* paper: a soft warm sheet with a whisper of fibre */
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --paper:
    radial-gradient(130% 90% at 50% 38%, #fffbf3 0%, #faf3e6 52%, #f1e5cf 100%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--night);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.stage-open, html.stage-open body { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

::selection { background: rgba(255, 111, 150, .38); color: #fff; }

:focus { outline: none; }
:focus-visible {
  outline: 1.5px solid rgba(255, 196, 211, .85);
  outline-offset: 6px;
  border-radius: 10px;
}

button { font: inherit; color: inherit; }

/* --------------------------------------------------------------------------
   The sky
   -------------------------------------------------------------------------- */

.sky-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% 115%, rgba(122, 48, 104, .34), transparent 62%),
    radial-gradient(90% 55% at 88% -12%, rgba(58, 70, 168, .30), transparent 60%),
    radial-gradient(70% 50% at 0% 30%, rgba(40, 32, 110, .22), transparent 70%),
    linear-gradient(180deg, #03040b 0%, #050820 42%, #0a0b28 72%, #140e2e 100%);
}

.nebula {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.n1 {
  width: 110vmax; height: 70vmax;
  left: -45vmax; top: 8vh;
  background: radial-gradient(closest-side, rgba(104, 74, 196, .20), rgba(104, 74, 196, .06) 55%, transparent);
  animation: drift-a 80s ease-in-out infinite alternate;
}
.n2 {
  width: 90vmax; height: 60vmax;
  right: -40vmax; top: 45vh;
  background: radial-gradient(closest-side, rgba(214, 74, 140, .14), rgba(214, 74, 140, .04) 55%, transparent);
  animation: drift-b 95s ease-in-out infinite alternate;
}
.n3 {
  width: 80vmax; height: 50vmax;
  left: 10vw; top: -30vmax;
  background: radial-gradient(closest-side, rgba(60, 120, 200, .12), transparent);
  animation: drift-a 120s ease-in-out infinite alternate-reverse;
}
@keyframes drift-a { to { transform: translate3d(12vmax, 6vmax, 0) rotate(8deg); } }
@keyframes drift-b { to { transform: translate3d(-10vmax, -8vmax, 0) rotate(-10deg); } }

.sky-layer {
  position: fixed;
  left: 0; top: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .055;
  background-image: var(--noise);
  background-size: 240px 240px;
}

main {
  position: relative;
  z-index: 1;
}

/* the glows are wider than a phone; keep them from widening the page */
main > section,
main > footer { overflow: hidden; }
@supports (overflow: clip) {
  main > section,
  main > footer { overflow: visible; overflow-x: clip; }
}

/* --------------------------------------------------------------------------
   Shared type
   -------------------------------------------------------------------------- */

.overline {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: .68rem;
  line-height: 1.6;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.overline .dot { display: inline-block; margin: 0 .9em; opacity: .7; }

.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 1.4s var(--ease-out), transform 1.6s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

.intro {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 1.6s var(--ease-out), transform 1.8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * .2s + .35s);
}
.is-loaded .intro { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   1 · Hero: tonight's moon
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding:
    max(52px, calc(env(safe-area-inset-top) + 36px))
    22px
    max(120px, calc(env(safe-area-inset-bottom) + 104px));
}

.moon-wrap {
  position: relative;
  width: clamp(210px, 64vw, 340px);
  aspect-ratio: 1;
  margin: clamp(26px, 5vh, 48px) 0 clamp(28px, 5.4vh, 50px);
}
@media (max-height: 720px) {
  .moon-wrap { width: clamp(168px, 36vh, 300px); }
}

.moon-glow {
  position: absolute;
  inset: -100%;
  pointer-events: none;
  /* A fixed size, fading to nothing well inside this box on every side, however
     far it leans towards the lit edge, so the glow never ends in a straight line
     (a gradient sized to the farthest corner overran the box once it leaned). */
  background:
    radial-gradient(ellipse 29% 29% at calc(50% + (var(--gx, 50%) - 50%) * .8) var(--gy, 50%),
      rgba(255, 242, 220, var(--g1, .22)) 0%,
      rgba(255, 236, 210, var(--g2, .09)) 33%,
      rgba(186, 176, 255, var(--g3, .035)) 65%,
      transparent 100%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .78; transform: scale(1.04); } }

.moon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0;
  filter: blur(10px);
  transform: scale(.94) translate3d(0, 10px, 0);
  transition: opacity 2.6s var(--ease-out), filter 2.6s var(--ease-out), transform 3.2s var(--ease-out);
}
.moon.is-drawn { opacity: 1; filter: blur(0); transform: none; }
.moon.is-south, .mini-moon.is-south { rotate: 180deg; }

.hero-title {
  margin: 0 0 .34em;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.9rem, 10.4vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.012em;
  color: var(--ink);
  text-shadow: 0 0 46px rgba(255, 232, 205, .16);
}

.hero-sub {
  margin: 0 auto 1.5em;
  max-width: 25ch;
  font-size: clamp(1.16rem, 4.3vw, 1.5rem);
  line-height: 1.42;
  color: var(--ink-soft);
  text-wrap: balance;
}

.moon-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: .64rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.moon-meta::before,
.moon-meta::after {
  content: "";
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 238, 226, .42));
}
.moon-meta::after { transform: scaleX(-1); }

.moon-phase {
  margin: .5em 0 0;
  font-style: italic;
  font-size: clamp(1.08rem, 3.9vw, 1.25rem);
  color: var(--ink-soft);
}

.scroll-cue {
  position: absolute;
  left: 0; right: 0;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  margin: 0 auto;
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.scroll-cue svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(5px); opacity: .55; } }

/* --------------------------------------------------------------------------
   2 · The letter
   -------------------------------------------------------------------------- */

.letter-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12vh 16px 14vh;
}

.landing {
  position: relative;
  width: min(100%, 980px);
  height: 78vh;
  height: 78svh;
  min-height: 470px;
  max-height: 820px;
  margin-top: 2vh;
  transition: opacity .5s var(--ease);
}
.landing.is-gone { opacity: 0; }

.flight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.flight-path {
  fill: none;
  stroke: rgba(246, 238, 226, .62);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: .1 9;
  transition: opacity 1.6s var(--ease);
}
.landing.is-landed .flight-path { opacity: .38; }

.origin { opacity: 0; transition: opacity 1s var(--ease); }
.landing.is-ready .origin { opacity: 1; }
.origin-dot { fill: var(--gold); }
.origin-ping {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }
.origin-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  fill: var(--ink-faint);
}

.plane .pl-near { fill: #fffdf8; }
.plane .pl-far { fill: #d7d9e6; }
.plane .pl-keel { fill: #a9adc4; }
.plane .pl-crease { fill: none; stroke: rgba(120, 124, 150, .55); stroke-width: .8; }
.plane-body { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }

.note {
  position: absolute;
  left: calc(50% - var(--nw, 290px) / 2);
  top: calc(var(--ny, 58%) - var(--nh, 180px) / 2);
  width: var(--nw, 290px);
  height: var(--nh, 180px);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(.35) rotate(-14deg);
}
.note.is-here {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: opacity .5s var(--ease), transform .9s var(--ease-back);
}
.landing.is-gone .note { visibility: hidden; }

.note-paper,
.unfold .face.back {
  background-color: #f3e9d6;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 30%, rgba(120, 90, 50, .06)),
    radial-gradient(120% 90% at 30% 20%, #fbf5ea 0%, #f4ead8 55%, #eadcc2 100%);
}
.note-paper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transform: rotate(-2.5deg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .7) inset,
    0 -1px 0 rgba(120, 90, 50, .12) inset,
    /* the folded sheets underneath, just showing at the edge */
    0 2px 0 -1px #e4d5b8,
    0 4px 0 -2px #d9c7a6,
    0 26px 60px -12px rgba(0, 0, 0, .6),
    0 8px 18px rgba(0, 0, 0, .28);
}
/* where the outer flap ends, a few millimetres short of the crease */
.note-paper::after,
.unfold .p-top .face.back::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 7px;
  height: 1px;
  background: linear-gradient(90deg, rgba(110, 80, 40, .1), rgba(110, 80, 40, .2) 12%, rgba(110, 80, 40, .2) 88%, rgba(110, 80, 40, .1));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 -2px 4px rgba(110, 80, 40, .06);
}
.note.is-here .note-paper { animation: hover 5.5s ease-in-out .9s infinite; }
@keyframes hover {
  50% { transform: rotate(-1.2deg) translate3d(0, -7px, 0); }
}
.note:hover .note-paper,
.note:focus-visible .note-paper { box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 30px 70px -10px rgba(0,0,0,.65), 0 0 0 1px rgba(255,196,211,.35), 0 0 60px rgba(255,140,170,.25); }

.note-paper::before,
.unfold .face.back::before,
.letter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--noise);
  background-size: 240px 240px;
  opacity: .16;
  mix-blend-mode: multiply;
}

.addr { position: relative; display: flex; flex-direction: column; align-items: center; color: var(--paper-ink); }
.addr-for {
  font-style: italic;
  font-size: clamp(.95rem, 3.4vw, 1.1rem);
  color: rgba(42, 34, 29, .58);
  margin-bottom: -.1em;
}
.addr-name {
  font-family: var(--script);
  font-size: clamp(2.6rem, 10vw, 3.6rem);
  line-height: 1.2;
  color: var(--pen);
  padding: 0 .2em;
}
.addr-heart { width: 20px; height: 18px; margin-top: .2em; fill: var(--rose-deep); opacity: .9; }

.note-hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--ny, 58%) + var(--nh, 180px) / 2 + 30px);
  margin: 0;
  text-align: center;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 1s var(--ease) .8s;
  pointer-events: none;
}
.note-hint.is-here { opacity: 1; animation: glow-text 3s ease-in-out 1.8s infinite; }
@keyframes glow-text { 50% { opacity: .5; } }

/* the letter itself */
.letter {
  position: relative;
  width: min(100%, 660px);
  margin: 0 auto;
  padding: clamp(36px, 8vw, 70px) clamp(26px, 7.4vw, 74px) clamp(36px, 7vw, 62px);
  border-radius: 3px;
  color: var(--paper-ink);
  font-size: clamp(1.14rem, 4vw, 1.32rem);
  font-weight: 500;
  line-height: 1.66;
  background:
    /* the two creases it was folded along */
    linear-gradient(180deg,
      transparent calc(33.333% - 2px), rgba(110, 80, 40, .09) calc(33.333% - 1px),
      rgba(255, 255, 255, .7) calc(33.333% + 1px), transparent calc(33.333% + 3px)),
    linear-gradient(180deg,
      transparent calc(66.666% - 2px), rgba(110, 80, 40, .08) calc(66.666% - 1px),
      rgba(255, 255, 255, .65) calc(66.666% + 1px), transparent calc(66.666% + 3px)),
    /* each third catches the light a little differently */
    linear-gradient(180deg,
      rgba(255, 255, 255, .25) 0%, rgba(120, 90, 50, .03) 33.33%,
      rgba(255, 255, 255, .18) 33.34%, rgba(120, 90, 50, .04) 66.66%,
      rgba(255, 255, 255, .2) 66.67%, rgba(120, 90, 50, .05) 100%),
    var(--paper);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .8) inset,
    0 40px 90px -30px rgba(0, 0, 0, .7),
    0 14px 30px rgba(0, 0, 0, .3);
}
.letter p { position: relative; margin: 0 0 1.02em; text-wrap: pretty; }
.letter-place {
  text-align: right;
  font-style: italic;
  font-weight: 400;
  font-size: .8em;
  color: rgba(42, 34, 29, .55);
  margin-bottom: 1.7em !important;
}
.letter-hello {
  font-family: var(--script);
  font-weight: 400;
  font-size: 2.35em;
  line-height: 1.15;
  color: var(--pen);
  margin: 0 0 .45em -.06em !important;
}
.letter-bye {
  margin-top: 1.7em !important;
  margin-bottom: .2em !important;
  font-style: italic;
}
.letter-sign {
  font-family: var(--script);
  font-weight: 400;
  font-size: 2.6em;
  line-height: 1.1;
  color: var(--pen);
  margin: 0 0 1.05em .9em !important;
  clip-path: inset(-40% 100% -40% -12%);
}
.letter.is-open .letter-sign { animation: write 2s var(--ease) .55s forwards; }
@keyframes write { to { clip-path: inset(-40% -12% -40% -12%); } }

.sign-heart {
  display: inline-block;
  width: .52em;
  height: .5em;
  margin-left: .2em;
  vertical-align: .02em;
  overflow: visible;
}
.sign-heart path {
  fill: none;
  stroke: var(--rose-deep);
  stroke-opacity: .85;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 84;
  stroke-dashoffset: 84;
}
.letter.is-open .sign-heart path { animation: draw 1.2s ease-in-out 2.3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.letter-ps {
  padding-top: 1.1em;
  margin: 0 !important;
  border-top: 1px solid rgba(42, 34, 29, .12);
  font-style: italic;
  font-weight: 500;
  font-size: .93em;
  color: rgba(42, 34, 29, .8);
}
.letter.is-open .letter-ps { animation: fade-in 1.6s var(--ease) 2.2s both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

/* the unfolding (a temporary 3D copy of the letter, folded in thirds) */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: radial-gradient(ellipse at 50% 50%, rgba(4, 5, 13, .35), rgba(4, 5, 13, .7));
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s var(--ease);
}
.scrim.on { opacity: 1; }

.unfold {
  position: fixed;
  left: 0; top: 0;
  z-index: 30;
  transform-origin: 0 0;
  perspective: 2400px;
  pointer-events: none;
}
.unfold .panel {
  position: absolute;
  left: 0;
  width: 100%;
  transform-style: preserve-3d;
}
.unfold .p-top { transform-origin: 50% 100%; }
.unfold .p-bot { transform-origin: 50% 0%; }
.unfold .face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.unfold .face.back {
  transform: rotateX(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.unfold .face .letter {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  box-shadow: none;
}
.unfold .shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, rgba(60, 40, 20, .28), rgba(60, 40, 20, .06));
}

/* --------------------------------------------------------------------------
   3 · To the moon and back
   -------------------------------------------------------------------------- */

.orbit-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16vh 16px 14vh;
}
.orbit-stage {
  width: min(100%, 1000px);
  margin: 26px auto 6px;
}
#orbit { display: block; width: 100%; height: 440px; }

.orbit-quote {
  margin: 14px auto 26px;
  max-width: 21ch;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.85rem, 6.8vw, 3.3rem);
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
.orbit-quote .ph {
  color: var(--ink-ghost);
  transition: color 1.4s var(--ease), text-shadow 1.4s var(--ease);
}
.orbit-quote .ph.lit {
  color: var(--ink);
  text-shadow: 0 0 28px rgba(255, 150, 180, .45);
}
.orbit-caption {
  margin: 0 auto;
  max-width: 46ch;
  font-family: var(--sans);
  font-size: .66rem;
  line-height: 2.1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   4 · The heart
   -------------------------------------------------------------------------- */

.heart-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14vh 16px 12vh;
}
.heart-title {
  margin: 16px 0 0;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.3rem, 8.6vw, 4rem);
  line-height: 1.04;
  color: var(--ink);
}

.heart-stage {
  position: relative;
  width: clamp(168px, 46vw, 228px);
  aspect-ratio: 200 / 180;
  margin: clamp(60px, 10vh, 96px) auto clamp(46px, 7vh, 64px);
}
.heart-glow {
  position: absolute;
  inset: -60%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 86, 136, .5), rgba(255, 70, 125, .17) 50%, transparent 78%);
  animation: glow-beat 1.6s ease-in-out infinite;
}
@keyframes glow-beat {
  0%, 100% { opacity: .75; transform: scale(.94); }
  38% { opacity: 1; transform: scale(1.06); }
}

.heart-ripples {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ripple {
  fill: none;
  stroke: rgba(255, 150, 178, .6);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: 50% 52%;
  opacity: 0;
  animation: ripple 4.8s var(--ease-out) infinite;
}
.ripple:nth-child(2) { animation-delay: 1.6s; }
.ripple:nth-child(3) { animation-delay: 3.2s; }
@keyframes ripple {
  0% { transform: scale(1); opacity: .75; }
  100% { transform: scale(2.1); opacity: 0; }
}

.heart {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 46% 46% 50% 50%;
}
.heart-press {
  position: absolute;
  inset: 0;
  display: block;
  transition: transform .5s var(--ease-back);
}
.heart:active .heart-press { transform: scale(.9); transition-duration: .12s; }
.heart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 55%;
  animation: beat 1.6s var(--ease) infinite;
}
.heart:hover .heart-svg, .heart:focus-visible .heart-svg { animation-duration: 1.05s; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  13% { transform: scale(1.085); }
  26% { transform: scale(.99); }
  39% { transform: scale(1.12); }
  62% { transform: scale(1); }
}
.heart.is-pressed .heart-press { animation: pop .7s var(--ease) forwards; }
@keyframes pop {
  0% { transform: scale(.9); }
  45% { transform: scale(1.24); opacity: 1; }
  100% { transform: scale(.6); opacity: 0; }
}
.heart.is-back .heart-press { animation: back .8s var(--ease-back) both; }
@keyframes back { from { transform: scale(.4); opacity: 0; } }

.heart-hint {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(2.1rem, 7.6vw, 2.8rem);
  line-height: 1.2;
  color: var(--blush);
  text-shadow: 0 0 30px rgba(255, 100, 140, .35);
}
.heart-sub {
  margin: 12px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.heart-sub::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 4V5L8 9z' fill='black'/><path d='M16 8.5a5 5 0 0 1 0 7M18.5 6a8.5 8.5 0 0 1 0 12' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 4V5L8 9z' fill='black'/><path d='M16 8.5a5 5 0 0 1 0 7M18.5 6a8.5 8.5 0 0 1 0 12' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>") center / contain no-repeat;
}

/* --------------------------------------------------------------------------
   5 · Closing
   -------------------------------------------------------------------------- */

.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10vh 22px max(90px, calc(env(safe-area-inset-bottom) + 70px));
}
.mini-moon {
  width: 58px;
  height: 58px;
  margin-bottom: 30px;
  filter: drop-shadow(0 0 18px rgba(255, 240, 214, .3));
}
.countdown {
  margin: 0 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.countdown-n {
  font-weight: 300;
  font-size: clamp(4rem, 16vw, 6.4rem);
  line-height: .9;
  color: var(--ink);
  font-variant-numeric: lining-nums;
}
.countdown-l {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.closing-line {
  margin: 0 0 3.4em;
  font-size: clamp(1.5rem, 5.6vw, 2.2rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-soft);
}
.closing-line em { color: var(--ink); font-weight: 300; }
.footnote {
  margin: 0;
  font-family: var(--sans);
  font-size: .6rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}

/* --------------------------------------------------------------------------
   Our song
   -------------------------------------------------------------------------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: #03040f;
  outline: none;
  touch-action: manipulation;
}
.show {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.stage-now {
  position: absolute;
  top: max(18px, calc(env(safe-area-inset-top) + 12px));
  left: max(18px, calc(env(safe-area-inset-left) + 14px));
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s var(--ease) .4s;
}
.stage-now span {
  font-family: var(--sans);
  font-style: normal;
  font-size: .58rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.stage.is-playing .stage-now { opacity: 1; }

.stage-words { position: absolute; inset: 0; pointer-events: none; }
.word {
  position: absolute;
  left: 7%;
  right: 7%;
  /* high in the sky: the two of them and the moon stay at the bottom all song */
  top: max(11vh, calc(env(safe-area-inset-top) + 72px));
  margin: 0;
  text-align: center;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.45rem, 5.6vw, 2.3rem);
  line-height: 1.25;
  color: var(--ink);
  text-shadow: 0 0 28px rgba(3, 4, 15, .95), 0 0 3px rgba(3, 4, 15, .7);
  text-wrap: balance;
  opacity: 0;
  filter: blur(5px);
  transform: translateY(10px);
  transition: opacity 1.6s var(--ease), filter 1.6s var(--ease), transform 1.8s var(--ease-out);
}
.word.on { opacity: 1; filter: blur(0); transform: none; }
.word-center { bottom: auto; top: 47%; transform: translateY(calc(-50% + 10px)); }
.word-center.on { transform: translateY(-50%); }
.word-last { font-size: clamp(2.3rem, 9.5vw, 3.8rem); line-height: 1.1; }
.word-last span {
  display: block;
  margin: 1.1em auto 0;
  max-width: 30ch;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: .62rem;
  line-height: 2;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-shadow: none;
}
@media (min-aspect-ratio: 1/1) {
  /* wide screens: the heart in the middle, the two of them and the moon below it;
     the lines sit low on the right, beside them */
  .word { left: 66%; right: 3%; top: auto; bottom: 18vh; }
  .word-center { left: 7%; right: 7%; width: auto; top: 44%; }
  .stage-end { left: 60%; right: 2%; bottom: 16vh; }
}

.stage-help {
  position: absolute;
  left: 50%;
  top: calc(50% - min(24vw, 135px) - 18px);
  transform: translate(-50%, -100%);
  width: min(86vw, 420px);
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(12, 8, 26, .62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 196, 211, .18);
  text-align: center;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--ink);
  animation: fade-in .8s var(--ease) both;
}
.stage-help p { margin: 0; }
.stage-help a { color: var(--blush); text-decoration: none; border-bottom: 1px solid rgba(255, 196, 211, .4); }
.stage-help[data-kind="fail"] {
  top: auto;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 84px));
  transform: translateX(-50%);
}

.stage-end {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(104px, calc(env(safe-area-inset-bottom) + 92px));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  animation: fade-in 1.4s var(--ease) both;
}
.stage-end button {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 211, .35);
  background: rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background .3s, border-color .3s;
}
.stage-end button:hover { background: rgba(255, 111, 150, .18); border-color: rgba(255, 196, 211, .6); }

.stage-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, .07);
}
.stage-bar span {
  display: block;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--rose), var(--gold));
  box-shadow: 0 0 12px rgba(255, 111, 150, .6);
  transition: transform .25s linear;
}

.stage-pause,
.stage-close {
  position: absolute;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s var(--ease) .3s, background .3s;
}
.stage-pause:hover, .stage-close:hover { background: rgba(255, 255, 255, .14); }
.stage-pause svg, .stage-close svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.stage-pause {
  left: 50%;
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 16px));
  transform: translateX(-50%);
}
.stage-pause .i-play { display: none; fill: var(--ink); stroke: none; }
.stage.is-paused .stage-pause .i-play { display: block; }
.stage.is-paused .stage-pause .i-pause { display: none; }
.stage.is-playing .stage-pause { opacity: .8; pointer-events: auto; }
.stage-close {
  top: max(14px, calc(env(safe-area-inset-top) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 10px));
}
.stage.is-open .stage-close { opacity: 1; pointer-events: auto; }

/* where the YouTube player waits: in the window (so it keeps playing) but unseen */
.yt-park {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 200px;
  height: 113px;
  overflow: hidden;
  opacity: .01;
  pointer-events: none;
}
.yt-park iframe { display: block; width: 100%; height: 100%; border: 0; }
.yt-park.reveal {
  z-index: 45;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(86vw, 480px);
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(255, 196, 211, .2), 0 0 80px -10px rgba(255, 60, 120, .4), 0 30px 80px rgba(0, 0, 0, .6);
  animation: fade-in .6s var(--ease) both;
}

.fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Larger screens
   -------------------------------------------------------------------------- */

@media (min-width: 760px) {
  .overline { font-size: .72rem; }
  .moon-meta { font-size: .68rem; }
  .orbit-caption { font-size: .7rem; }
  .hero-sub { max-width: 34ch; }
}
@media (min-width: 760px) and (max-height: 760px) {
  .moon-wrap { width: clamp(160px, 31vh, 280px); margin: 22px 0 26px; }
  .hero-title { font-size: clamp(2.9rem, 9vh, 4.6rem); }
}

/* --------------------------------------------------------------------------
   A sweet secret: a small star shining in the corner, and its note
   -------------------------------------------------------------------------- */

.sweet-star {
  position: fixed;
  right: max(18px, calc(env(safe-area-inset-right) + 14px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 16px));
  z-index: 30;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: scale(.3);
  transition: opacity 1.4s var(--ease-out) 1.6s, transform 1.4s var(--ease-back) 1.6s;
}
.is-loaded .sweet-star { opacity: 1; pointer-events: auto; transform: none; }
html.stage-open .sweet-star { opacity: 0; pointer-events: none; transition-delay: 0s; }
/* its light, breathing */
.sweet-star::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 222, .6), rgba(255, 180, 205, .2) 38%, rgba(255, 180, 205, 0) 68%);
  animation: sweet-star-glow 3s ease-in-out infinite;
}
.sweet-star svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255, 248, 235, .95)) drop-shadow(0 0 12px rgba(255, 160, 195, .65));
  animation: sweet-star-twinkle 3s ease-in-out infinite;
}
/* long faint rays, turning slowly, flashing now and then */
.sweet-star-rays {
  transform-origin: 50px 50px;
  opacity: .5;
  animation: sweet-star-rays 6s ease-in-out infinite;
}
.sweet-star:hover svg, .sweet-star:focus-visible svg { animation-play-state: paused; transform: scale(1.2); }
.sweet-star:focus-visible { outline: none; }
.sweet-star:focus-visible::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--blush);
}
@keyframes sweet-star-glow { 0%, 100% { opacity: .5; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes sweet-star-twinkle { 0%, 100% { transform: scale(.86) rotate(0deg); } 50% { transform: scale(1.04) rotate(10deg); } }
@keyframes sweet-star-rays {
  0%, 70%, 100% { opacity: .4; transform: rotate(0deg) scale(1); }
  80% { opacity: 1; transform: rotate(45deg) scale(1.5); }
  90% { opacity: .55; transform: rotate(90deg) scale(1.1); }
}

.sweet {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 3, 14, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.sweet[hidden] { display: none; }
.sweet.is-open { opacity: 1; }
.sweet-card {
  position: relative;
  width: min(100%, 410px);
  padding: 34px 28px 26px;
  border-radius: 24px;
  text-align: center;
  color: #4b1428;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 196, 211, .55), rgba(255, 196, 211, 0) 60%),
    linear-gradient(170deg, #fff8f1, #f9e7dd);
  box-shadow: 0 30px 80px rgba(8, 2, 20, .6), 0 0 0 1px rgba(255, 196, 211, .5) inset;
  transform: translateY(18px) scale(.94);
  transition: transform .7s var(--ease-back);
}
.sweet.is-open .sweet-card { transform: none; }
.sweet-over {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #c2406a;
}
.sweet-title {
  margin: 0 0 14px;
  font-family: "Pinyon Script", var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 10vw, 3rem);
  line-height: 1.1;
  color: #b3164c;
}
.sweet-text {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.45;
  text-wrap: pretty;
}
.sweet-close {
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid rgba(179, 22, 76, .35);
  background: rgba(255, 255, 255, .6);
  color: #8e1240;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
}
.sweet-close:hover, .sweet-close:focus-visible { background: #fff; outline: none; border-color: rgba(179, 22, 76, .6); }

/* --------------------------------------------------------------------------
   Less motion, if she's asked her phone for it
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .nebula, .moon-glow, .scroll-cue svg, .origin-ping, .note-paper, .note-hint,
  .heart-glow, .heart-svg, .ripple,
  .sweet-star::before, .sweet-star svg, .sweet-star-rays { animation: none !important; }
  .reveal, .intro { transform: none; transition-duration: .8s; }
  .ripple { display: none; }
}
