/* ==========================================================================
   Shabnam's Birthday, version 2
   An immersive, scroll-driven flight through space.
   ========================================================================== */

:root {
  /* Palette */
  --void: #0b0812;
  --ink: #0e0a14;
  --plum: #241337;
  --violet-900: #2e1a52;
  --violet-700: #5a33b0;
  --violet-600: #6b3fdc;
  --violet-500: #8b5cf6;
  --violet-400: #a78bfa;
  --lavender: #cbbbff;
  --lilac: #e7defa;
  --paper: #f7f2fc;
  --gold: #e9cf98;

  --text: #f6f2fc;
  --text-soft: rgba(246, 242, 252, 0.86);
  --text-mute: rgba(246, 242, 252, 0.66);
  --ink-text: #1b1326;
  --ink-soft: rgba(27, 19, 38, 0.78);

  /* Type */
  --display: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --gutter: clamp(22px, 6vw, 56px);
  --vh: 100vh;
}

@supports (height: 100svh) {
  :root { --vh: 100svh; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

body.is-locked { overflow: hidden; height: 100%; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, p, ul { margin: 0; }
h1, h2, p, li { text-wrap: balance; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 4px;
}

.label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lavender);
}
.label--dark { color: var(--violet-700); }

.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 11.5vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.hint {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-mute);
}

.section-head {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 0 var(--gutter);
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 32px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, #9b6cff 0%, #6b3fdc 55%, #4b28a8 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16) inset,
    0 12px 32px -8px rgba(139, 92, 246, 0.75),
    0 0 70px -10px rgba(167, 139, 250, 0.6);
  transition: transform 0.25s var(--ease-out), opacity 0.5s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: sheen 4.2s var(--ease-in-out) 2.4s infinite;
}
.btn:active { transform: scale(0.96); }
.btn__arrow { display: inline-block; transition: transform 0.35s var(--ease-out); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn:hover .btn__arrow { transform: translateX(4px); }
}
@keyframes sheen {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 4px;
  font-family: var(--display);
  font-style: italic;
  font-size: 23px;
  color: var(--lavender);
  border-bottom: 1px solid rgba(203, 187, 255, 0.4);
  transition: color 0.3s ease, opacity 0.5s ease, transform 0.25s var(--ease-out);
}
.link-btn:active { transform: scale(0.97); }
.link-btn.is-used { opacity: 0; pointer-events: none; }
.link-btn--quiet {
  font-family: var(--sans);
  font-style: normal;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mute);
  border-color: transparent;
}
@media (hover: hover) {
  .link-btn:hover { color: #fff; }
}

/* ==========================================================================
   World layers
   ========================================================================== */

.nebula {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(45% 35% at 18% 22%, rgba(91, 51, 176, 0.32), transparent 70%),
    radial-gradient(40% 40% at 85% 60%, rgba(139, 92, 246, 0.2), transparent 70%),
    radial-gradient(60% 40% at 40% 100%, rgba(46, 26, 82, 0.6), transparent 70%),
    var(--void);
}

.space {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.dawn {
  position: fixed;
  left: 0;
  right: 0;
  top: -20%;
  height: 140%;
  z-index: 2;
  pointer-events: none;
  transform: translate3d(0, 100%, 0);
  will-change: transform;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
  background:
    radial-gradient(90% 60% at 50% 110%, rgba(233, 207, 152, 0.35), transparent 70%),
    radial-gradient(80% 60% at 50% -10%, rgba(167, 139, 250, 0.45), transparent 70%),
    linear-gradient(180deg, #e9defb 0%, var(--paper) 45%, #fbf4f2 100%);
}

.fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 50;
  background: linear-gradient(90deg, var(--violet-600), var(--lavender), #fff);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.progress.is-on { opacity: 0.85; }

/* ==========================================================================
   Gate
   ========================================================================== */

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  text-align: center;
  background: radial-gradient(70% 45% at 50% 55%, rgba(91, 51, 176, 0.28), transparent 70%);
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}

.gate__inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  transition: opacity 0.7s ease, transform 1.2s cubic-bezier(0.6, 0, 0.4, 1);
}

.gate__hey {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(56px, 17vw, 110px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 40px rgba(167, 139, 250, 0.5);
  opacity: 0;
  transform: translateY(20px);
  animation: rise 1.4s var(--ease-out) 0.3s forwards;
}

.gate__line {
  max-width: 20ch;
  font-size: clamp(19px, 5.2vw, 22px);
  color: var(--text-soft);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 1.2s var(--ease-out) 1.2s forwards;
}

.gate .btn {
  margin-top: 24px;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 1.1s var(--ease-out) 2s forwards;
}

.gate__tip {
  font-size: 14px;
  color: var(--text-mute);
  opacity: 0;
  animation: fadeIn 1s ease 2.8s forwards;
}

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }

.gate__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #fff 0%, var(--lilac) 35%, rgba(167, 139, 250, 0.6) 70%, rgba(139, 92, 246, 0.3) 100%);
  opacity: 0;
  pointer-events: none;
}

.gate.is-warping .gate__inner {
  opacity: 0;
  transform: scale(1.6);
}
.gate.is-flash .gate__flash {
  opacity: 1;
  transition: opacity 0.35s ease-in;
}
.gate.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ==========================================================================
   Story shell and scenes
   ========================================================================== */

.story {
  position: relative;
  z-index: 3;
  opacity: 0;
}
.story.is-on { opacity: 1; }

.scene { position: relative; }

.pin { height: var(--len); }

.stage {
  position: sticky;
  top: 0;
  height: var(--vh);
  overflow: hidden;
}

.stage--center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  text-align: center;
}

/* Generic time-based reveals for the non-pinned scenes */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition:
    opacity 0.9s ease var(--d, 0s),
    transform 1.1s var(--ease-out) var(--d, 0s);
}
.js [data-reveal="scale"] { transform: scale(0.88); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Arrival
   ========================================================================== */

.arrival {
  height: var(--vh);
  min-height: 560px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.arrival__fly {
  display: grid;
  justify-items: center;
  padding: 0 var(--gutter);
  will-change: transform, opacity;
}

.arrival__date {
  display: grid;
  justify-items: center;
  line-height: 0.9;
}

.arrival__day {
  font-family: var(--display);
  font-size: clamp(132px, 44vw, 250px);
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums;
  color: #fff;
  text-shadow: 0 0 60px rgba(139, 92, 246, 0.55);
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.8s ease, transform 1.4s var(--ease-out);
}
.arrival.is-date .arrival__day { opacity: 1; transform: none; }

.arrival__month {
  margin-top: -0.05em;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(38px, 11vw, 68px);
  color: var(--lavender);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease 0.6s, transform 1.1s var(--ease-out) 0.6s;
}
.arrival.is-date .arrival__month { opacity: 1; transform: none; }

.arrival__title {
  display: grid;
  justify-items: center;
  margin-top: clamp(26px, 5vh, 44px);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
}

.arrival__hb {
  font-size: clamp(30px, 8.6vw, 54px);
  color: var(--text);
}

.arrival__name {
  font-style: italic;
  font-size: clamp(64px, 19.5vw, 150px);
  white-space: nowrap;
  padding: 0 0.08em 0.06em;
  color: #fff;
  text-shadow: 0 0 36px rgba(167, 139, 250, 0.65), 0 0 2px rgba(255, 255, 255, 0.4);
}

.ch {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.5em, 0) scale(1.4);
  filter: none;
  transition:
    opacity 0.6s ease calc(var(--i) * 50ms + var(--base, 0ms)),
    transform 1s var(--ease-out) calc(var(--i) * 50ms + var(--base, 0ms));
}
.ch--space { width: 0.25em; }
.arrival__name .ch { --base: 450ms; }
.arrival.is-name .ch { opacity: 1; transform: none; }

.cue {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 26px);
  display: grid;
  justify-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.cue i {
  position: relative;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
}
.cue i::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 50%;
  background: #fff;
  animation: cue 2s var(--ease-in-out) infinite;
}
@keyframes cue {
  from { transform: translateY(-100%); }
  to { transform: translateY(200%); }
}
.arrival.is-cue .cue { opacity: 1; }
.arrival.is-scrolled .cue { opacity: 0; }

/* ==========================================================================
   Portal
   ========================================================================== */

.portal {
  position: absolute;
  inset: 0;
}

.portal__clip {
  position: absolute;
  inset: 0;
  clip-path: circle(0px at 50% 50%);
  will-change: clip-path;
}

.portal__img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100vw, 560px, calc(var(--vh) * 0.62));
  transform-origin: 57% 22%;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  will-change: transform;
}

.portal__ring,
.portal__glow {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
.portal__ring {
  width: 100px;
  height: 100px;
  border: 1.5px solid rgba(203, 187, 255, 0.55);
  box-shadow:
    0 0 30px rgba(167, 139, 250, 0.55),
    0 0 50px rgba(139, 92, 246, 0.35) inset;
}
.portal__glow {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.55) 0%, rgba(107, 63, 220, 0.35) 45%, rgba(46, 26, 82, 0) 70%);
}

.portal__text {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 9vh);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 var(--gutter);
  text-align: center;
  opacity: 0;
  will-change: transform, opacity;
}
.portal__kicker {
  font-family: var(--display);
  font-size: clamp(36px, 10.5vw, 64px);
  line-height: 1.04;
  color: #fff;
  text-shadow: 0 2px 30px rgba(11, 8, 18, 0.8);
}
.portal__sub {
  font-size: clamp(17px, 4.8vw, 20px);
  color: var(--text-soft);
  text-shadow: 0 1px 16px rgba(11, 8, 18, 0.9);
}

/* ==========================================================================
   Words
   ========================================================================== */

.words {
  max-width: 11ch;
  font-family: var(--display);
  font-size: clamp(46px, 13.5vw, 104px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: #fff;
}
.w {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity;
}
.w--hi {
  font-style: italic;
  color: var(--lavender);
  text-shadow: 0 0 34px rgba(167, 139, 250, 0.7);
}

.words__after {
  font-size: clamp(19px, 5.2vw, 23px);
  color: var(--text-soft);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease, transform 0.9s var(--ease-out);
}
.words__after.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Tunnel
   ========================================================================== */

.tunnel__head {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 0 var(--gutter);
  text-align: center;
  will-change: transform, opacity;
}

.tunnel__space {
  position: absolute;
  inset: 0;
  perspective: 900px;
  perspective-origin: 50% 44%;
}

.tframe {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(70vw, 340px, calc(var(--vh) * 0.42));
  aspect-ratio: 3 / 4;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--plum);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 40px 80px -30px rgba(0, 0, 0, 0.8),
    0 0 60px -10px rgba(139, 92, 246, 0.45);
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.tframe img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tframe:nth-child(2) img { object-position: 50% 22%; }

.tunnel__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8vh);
  z-index: 2;
  margin: 0 auto;
  max-width: 30ch;
  padding: 0 var(--gutter);
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(23px, 6.4vw, 32px);
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 24px rgba(11, 8, 18, 0.9);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.6s var(--ease-out);
}
.tunnel__caption.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Constellation
   ========================================================================== */

.sky-game {
  min-height: var(--vh);
  padding: 14vh 0 12vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
}

.constellation {
  position: relative;
  width: min(84vw, 380px, calc(var(--vh) * 0.48));
  aspect-ratio: 300 / 340;
  border-radius: 28px;
}
.constellation svg { width: 100%; height: 100%; overflow: visible; }

.star__halo {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.4);
  transition: opacity 0.6s ease, transform 0.9s var(--ease-back);
}
.star__core {
  fill: var(--lavender);
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.4s ease, fill 0.4s ease, transform 0.6s var(--ease-back);
}
.star.is-next .star__core { opacity: 1; animation: nextPulse 1.4s ease-in-out infinite; }
.star.is-lit .star__core { fill: #fff; opacity: 1; transform: scale(1.4); animation: none; }
.star.is-lit .star__halo { opacity: 1; transform: scale(1); }
@keyframes nextPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.9); }
}

.constellation__lines line {
  stroke: var(--lavender);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.8;
  transition: stroke-dashoffset 0.7s var(--ease-out), opacity 0.6s ease;
}
.sky-game.is-done .constellation__lines line { opacity: 1; stroke: #fff; }
.sky-game.is-done .constellation svg { animation: glowOnce 2.4s ease-out 1 forwards; }
@keyframes glowOnce {
  0% { filter: drop-shadow(0 0 0 rgba(167, 139, 250, 0)); }
  30% { filter: drop-shadow(0 0 16px rgba(203, 187, 255, 0.95)); }
  100% { filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5)); }
}

.sky-game__done {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 0 var(--gutter);
  min-height: 96px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease 0.4s, transform 1s var(--ease-out) 0.4s;
}
.sky-game.is-done .sky-game__done { opacity: 1; transform: none; }
.sky-game.is-done #skyHint { opacity: 0; }
.sky-game__msg {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.2;
  color: #fff;
  max-width: 20ch;
}

/* ==========================================================================
   Gift
   ========================================================================== */

.gift {
  min-height: var(--vh);
  padding: 12vh 0 10vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
}

.gift__stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: clamp(420px, 112vw, 500px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
}

.gift__beams {
  position: absolute;
  left: 50%;
  bottom: 50px;
  width: 600px;
  height: 600px;
  margin-left: -300px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(203, 187, 255, 0.18) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 1.2s ease, transform 1.6s var(--ease-out);
  pointer-events: none;
}
.gift.is-open .gift__beams {
  opacity: 1;
  transform: scale(1);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.giftbox {
  position: relative;
  z-index: 2;
  width: min(62vw, 250px);
  display: grid;
  justify-items: center;
  gap: 6px;
}
.giftbox svg { width: 100%; height: auto; overflow: visible; }
.giftbox__lid {
  transform-box: fill-box;
  transform-origin: 30% 100%;
  transition: transform 0.9s var(--ease-back), opacity 0.6s ease 0.4s;
}
.giftbox__body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--ease-back);
}
.gift.is-near:not(.is-open) .giftbox svg {
  animation: wiggle 3.6s ease-in-out 0.6s infinite;
  transform-origin: 50% 90%;
}
@keyframes wiggle {
  0%, 72%, 100% { transform: rotate(0); }
  76% { transform: rotate(-5deg) scale(1.02); }
  80% { transform: rotate(4deg) scale(1.02); }
  84% { transform: rotate(-3deg); }
  88% { transform: rotate(2deg); }
  92% { transform: rotate(0); }
}
.giftbox.is-shaking svg { animation: shake 0.5s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-6px) rotate(-3deg); }
  40% { transform: translateX(6px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-2deg); }
  80% { transform: translateX(3px) rotate(1deg); }
}
.gift.is-open .giftbox__lid { transform: translate(-30px, -120px) rotate(-28deg); opacity: 0; }
.gift.is-open .giftbox__body { transform: scale(1.04, 0.96); }

.giftbox__tag {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mute);
  transition: opacity 0.4s ease;
}
.gift.is-open .giftbox__tag { opacity: 0; }

.coupon {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 120px;
  width: min(84vw, 340px);
  padding: 28px 26px 24px;
  color: var(--ink-text);
  text-align: center;
  background:
    radial-gradient(circle at 0 50%, transparent 11px, var(--paper) 12px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 11px, var(--paper) 12px) right / 51% 100% no-repeat;
  border-radius: 14px;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 30px rgba(167, 139, 250, 0.35));
  opacity: 0;
  transform: translate3d(-50%, 90px, 0) scale(0.5);
  transition: transform 1.2s var(--ease-out) 0.35s, opacity 0.5s ease 0.35s;
  pointer-events: none;
}
.gift.is-open .coupon {
  z-index: 3;
  opacity: 1;
  transform: translate3d(-50%, -78px, 0) rotate(-2deg);
}
.coupon::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(90, 51, 176, 0.4);
  border-radius: 8px;
  pointer-events: none;
}
.coupon__kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet-700);
}
.coupon__main {
  margin-top: 10px;
  font-family: var(--display);
  font-size: clamp(27px, 7.6vw, 33px);
  line-height: 1.12;
}
.coupon__main em { color: var(--violet-700); }
.coupon__fine {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ==========================================================================
   Dawn
   ========================================================================== */

.dawn-stage { color: var(--text); transition: color 0.6s ease; }
body.is-light .dawn-stage { color: var(--ink-text); }

.dawn__phase {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: left;
}

.dl,
.dw {
  display: block;
  opacity: 0;
  will-change: transform, opacity;
}

.dawn__lead {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 9.6vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.dl--accent { font-style: italic; color: var(--violet-700); }

.dawn__sub {
  margin-top: 26px;
  max-width: 24ch;
  font-size: clamp(19px, 5.2vw, 23px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-soft);
}

.wishes {
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.wishes li {
  padding: 20px 0;
  border-top: 1px solid rgba(27, 19, 38, 0.16);
  font-family: var(--display);
  font-size: clamp(26px, 7.2vw, 38px);
  line-height: 1.18;
}
.dw--accent { font-style: italic; color: var(--violet-700); }

/* ==========================================================================
   Finale
   ========================================================================== */

.finale {
  min-height: var(--vh);
  padding: 16vh var(--gutter) calc(14vh + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.finale__glow {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 1000px;
  height: 1000px;
  margin: -500px 0 0 -500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.4) 0%, rgba(139, 92, 246, 0.14) 30%, transparent 62%);
  opacity: 0.3;
  transform: scale(0.6);
  transition: opacity 1.8s ease, transform 2.6s var(--ease-out);
  pointer-events: none;
}
.finale.is-celebrated .finale__glow { opacity: 1; transform: scale(1.15); }

.finale__so {
  position: relative;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(28px, 7.6vw, 38px);
  color: var(--lavender);
}

.finale__title {
  position: relative;
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(64px, 19vw, 150px);
  line-height: 0.98;
  color: #fff;
  text-shadow: 0 0 50px rgba(139, 92, 246, 0.55);
}

.finale__wish {
  position: relative;
  margin-top: 22px;
  max-width: 24ch;
  font-size: clamp(19px, 5.2vw, 22px);
  line-height: 1.5;
  color: var(--text-soft);
}

.finale__stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 210px;
  margin-top: 5vh;
}

.finale__text {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Candle */
.candle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 22px;
  height: 150px;
  margin-left: -11px;
  transition: opacity 1s ease, transform 1.2s var(--ease-out);
}
.candle__stick {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 92px;
  border-radius: 5px 5px 3px 3px;
  background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, 0.9) 0 7px, rgba(203, 187, 255, 0.95) 7px 14px);
  box-shadow: inset -4px 0 6px rgba(46, 26, 82, 0.35), 0 10px 30px -6px rgba(139, 92, 246, 0.5);
}
.candle__wick {
  position: absolute;
  left: 50%;
  bottom: 92px;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: #3a2d22;
}
.candle__flame {
  position: absolute;
  left: 50%;
  bottom: 99px;
  width: 16px;
  height: 34px;
  margin-left: -8px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 78%, #fff 0%, #fff3cf 22%, var(--gold) 48%, rgba(233, 140, 70, 0.9) 72%, rgba(233, 140, 70, 0) 100%);
  transform-origin: 50% 100%;
  animation: flicker 2.2s ease-in-out infinite;
  transition: opacity 0.5s ease, transform 0.6s var(--ease-in-out);
}
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  25% { transform: scale(0.94, 1.06) rotate(1.5deg); }
  50% { transform: scale(1.04, 0.95) rotate(-0.5deg); }
  75% { transform: scale(0.97, 1.04) rotate(1deg); }
}
.candle__glow {
  position: absolute;
  left: 50%;
  bottom: 36px;
  width: 160px;
  height: 160px;
  margin-left: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 207, 152, 0.42) 0%, rgba(233, 207, 152, 0.1) 35%, transparent 65%);
  transition: opacity 0.8s ease;
}
.candle__smoke {
  position: absolute;
  left: 50%;
  bottom: 104px;
}
.candle__smoke i {
  position: absolute;
  left: -5px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(220, 210, 240, 0.5);
  opacity: 0;
}
.candle.is-out .candle__flame { opacity: 0; transform: scale(0.2, 0.1); animation: none; }
.candle.is-out .candle__glow { opacity: 0; }
.candle.is-out .candle__smoke i { animation: smoke 2.4s ease-out forwards; }
.candle.is-out .candle__smoke i:nth-child(2) { animation-delay: 0.25s; }
.candle.is-out .candle__smoke i:nth-child(3) { animation-delay: 0.5s; }
@keyframes smoke {
  0% { opacity: 0.6; transform: translate(0, 0) scale(0.6); }
  50% { opacity: 0.35; transform: translate(-8px, -50px) scale(1.6); }
  100% { opacity: 0; transform: translate(6px, -110px) scale(2.6); }
}
.candle.is-gone { opacity: 0; transform: translateY(30px); }

/* Action states share one grid cell so nothing jumps */
.finale__action {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: start;
  margin-top: 34px;
  min-height: 130px;
  width: 100%;
}
.finale__action > * {
  grid-area: 1 / 1;
  transition: opacity 0.6s ease, transform 0.8s var(--ease-out), visibility 0s linear 0s;
}
.finale__action > .is-hidden {
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.6s ease, visibility 0s linear 0.6s;
}

.wishing,
.granted {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.wishing__text,
.granted__text {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(25px, 6.8vw, 32px);
  line-height: 1.2;
  color: #fff;
}
.wishing__dots { display: flex; gap: 10px; }
.wishing__dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.5s var(--ease-back);
}
.wishing__dots i.on {
  background: var(--lavender);
  box-shadow: 0 0 12px var(--violet-400);
  transform: scale(1.3);
}

.note {
  position: relative;
  max-width: 440px;
  margin-top: 26px;
  padding: 32px 28px 22px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(46, 26, 82, 0.85), rgba(22, 15, 32, 0.9));
  box-shadow: 0 0 0 1px rgba(203, 187, 255, 0.2) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.9s ease, transform 1.1s var(--ease-out);
}
.note[hidden] { display: none; }
.note.is-in { opacity: 1; transform: none; }
.note__body {
  font-family: var(--display);
  font-size: clamp(23px, 6.2vw, 27px);
  line-height: 1.32;
  color: #fff;
}
.note__sign {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--lavender);
}
.note .link-btn--quiet { margin-top: 8px; }

/* ==========================================================================
   Larger screens
   ========================================================================== */

@media (min-width: 900px) {
  .arrival__title { margin-top: 3vh; }
  .portal__text { top: auto; bottom: 12vh; left: 6vw; right: auto; justify-items: start; text-align: left; max-width: 34vw; }
  .tframe { width: min(30vw, 380px, calc(var(--vh) * 0.5)); }
  .dawn__phase { max-width: 820px; }
}

/* ==========================================================================
   Reduced motion: JS adds .rm and renders final states
   ========================================================================== */

.rm .pin { height: auto; }
.rm .stage { position: relative; height: auto; min-height: var(--vh); overflow: visible; padding: 14vh 0; }
.rm .portal { position: relative; height: 80vh; }
.rm .portal__clip { clip-path: none; }
.rm .portal__ring, .rm .portal__glow { display: none; }
.rm .portal__text { position: relative; top: auto; opacity: 1; margin-bottom: 4vh; }
.rm .tunnel { display: grid; gap: 6vh; justify-items: center; }
.rm .tunnel__head { position: relative; }
.rm .tunnel__space { position: relative; display: grid; gap: 4vh; justify-items: center; perspective: none; }
.rm .tframe { position: relative; left: auto; top: auto; opacity: 1; transform: none; }
.rm .tunnel__caption { display: none; }
.rm .dawn__phase { position: relative; top: auto; transform: none; margin-bottom: 8vh; }
.rm .dl, .rm .dw, .rm .w { opacity: 1; }
.rm .dawn { display: none; }
.rm .dawn-stage { color: var(--text); }
.rm .dawn__sub, .rm .wishes li { color: var(--text-soft); border-color: rgba(255, 255, 255, 0.16); }
.rm .dl--accent, .rm .dw--accent { color: var(--lavender); }
.rm .label--dark { color: var(--lavender); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { transform: none; transition: opacity 0.6s ease; }
  .ch { transform: none; transition: opacity 0.6s ease; }
  .arrival__day, .arrival__month { transform: none; }
  .gift__beams { display: none; }
  .btn::after { display: none; }
}
