/* A nocturne for Kate: one long night in a garden that grows from music.
   Dusk at the top, midnight at the letter, first light at the end. */
:root {
  --midnight: #0f1630;
  --violet: #2a2350;
  --moss: #1e3b33;
  --moon: #f4ebd0;
  --gold: #f7d774;
  --pink: #f3b6c8;
  --lav: #a99be0;
  --ink: #241d46;
  --ink-soft: #5d4d8c;
  --text: #efe8d6;
  --text-soft: #d6cdea;

  --display: "Cormorant Garamond", "Cormorant", "Iowan Old Style", Georgia, serif;
  --ui: "Jost", "Futura", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--midnight);
}
body {
  margin: 0;
  color: var(--text);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
::selection { background: rgba(247, 215, 116, 0.42); color: #1a1438; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 10px;
}

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 30;
  background: var(--moon); color: var(--violet);
  padding: 10px 16px; border-radius: 10px;
  font: 500 15px/1.2 var(--ui); text-decoration: none;
}
.skip:focus { top: 12px; }

/* =========================================================
   THE SKY (fixed, behind everything)
   ========================================================= */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, #080c22 0%, #0f1630 36%, #17183c 70%, #241f4a 100%);
}
.sky-dusk {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 50% at 50% 104%, rgba(243, 160, 170, 0.55), rgba(243, 182, 200, 0) 70%),
    linear-gradient(180deg, #11183f 0%, #22275d 30%, #3e3576 58%, #74518a 82%, #a8708f 100%);
}
.stars-wrap { position: absolute; inset: 0; transition: opacity 0.3s linear; }
.stars {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100vh; height: 100lvh;
}
.stars-a { animation: breathe 9s ease-in-out -2s infinite alternate; }
.stars-b { animation: breathe 6s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: 1; } to { opacity: 0.42; } }

.moon {
  position: absolute;
  width: 96px; height: 96px;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  right: 10px;
  overflow: visible;
  transition: opacity 0.4s linear, transform 1.2s cubic-bezier(.2, .8, .2, 1);
}
.moon-halo { transform-box: fill-box; transform-origin: center; opacity: 0.75; transition: opacity 1s; }
.moon.full { transform: scale(1.12); filter: drop-shadow(0 0 16px rgba(244, 235, 208, 0.55)); }
.moon.full .moon-halo { opacity: 1; animation: halo 3.6s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.18); } }
@media (min-width: 900px) {
  .moon { width: 150px; height: 150px; top: 84px; right: 8vw; }
}

#fx {
  position: fixed; left: 0; top: 0; z-index: 5;
  width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none;
}

/* sound toggle */
.sound {
  position: fixed; z-index: 10;
  top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(244, 235, 208, 0.24);
  background: rgba(13, 18, 44, 0.62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--moon);
  font: 500 13px/1 var(--ui); letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}
.sound svg { width: 20px; height: 20px; }
.sound .s-off { display: none; }
.sound.off { color: var(--text-soft); }
.sound.off .s-off { display: inline; }
.sound.off .s-waves { display: none; }
.sound:hover { border-color: rgba(247, 215, 116, 0.6); }

/* =========================================================
   MOVEMENT LABELS: a little moon phase for each part of the night
   ========================================================= */
.mvt {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 16px;
  font: 500 12px/1 var(--ui); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--lav);
}
.mvt-sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.phase {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid rgba(244, 235, 208, 0.35);
  margin-right: 3px;
}
.phase-1 { box-shadow: inset -3px 0 0 0 var(--moon); }
.phase-2 { box-shadow: inset -6px 0 0 0 var(--moon); }
.phase-3 { background: var(--moon); box-shadow: inset 3px 0 0 0 #1d2147; }
.phase-4 { background: var(--moon); border-color: var(--moon); box-shadow: 0 0 10px rgba(244, 235, 208, 0.75); }
.phase-5 {
  border: 0; border-radius: 13px 13px 0 0; height: 7px; margin-top: 5px;
  background: #e38a52; box-shadow: 0 2px 0 -1px #e38a52, 0 0 10px rgba(247, 180, 110, 0.7);
}

/* =========================================================
   I. DUSK
   ========================================================= */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center;
  padding: 92px var(--gutter) 170px;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; max-width: 780px; margin: 0 auto; }
.hero .mvt { animation: rise 1.2s 0.1s both; }
.eyebrow {
  margin: 0;
  font: italic 400 clamp(22px, 6vw, 30px)/1.1 var(--display);
  color: var(--text-soft);
  animation: rise 1.2s 0.25s both;
}
.name-wrap { position: relative; display: inline-block; padding: 6px 28px 18px; margin: 0 auto; }
.name {
  margin: 0;
  font: italic 300 clamp(124px, 40vw, 250px)/0.92 var(--display);
  letter-spacing: -0.005em;
  color: var(--moon);
  text-shadow: 0 0 28px rgba(244, 235, 208, 0.3);
  padding: 0 0.08em;
  animation: name-in 2s 0.55s backwards;
}
.name-wrap::before {
  /* the soft halo behind her name (a gradient, so nothing gets clipped mid-blur) */
  content: ""; position: absolute; inset: -10% -14%;
  background: radial-gradient(closest-side, rgba(169, 155, 224, 0.22), rgba(169, 155, 224, 0) 100%);
  pointer-events: none;
  animation: rise 2.4s 0.4s backwards;
}
@keyframes name-in {
  from { opacity: 0; filter: blur(10px); }
  to { opacity: 1; filter: blur(0); }
}
.constellation { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.name-play {
  position: absolute; inset: 0;
  background: none; border: 0; padding: 0; cursor: pointer;
  border-radius: 24px;
  -webkit-tap-highlight-color: transparent;
}
.lede {
  margin: 4px auto 0; max-width: 20em;
  font: italic 400 clamp(21px, 5.6vw, 27px)/1.4 var(--display);
  color: #f0e9f8;
  text-shadow: 0 1px 14px rgba(13, 18, 44, 0.6);
  animation: rise 1.2s 1.25s both;
}
.cta {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-top: 28px;
  animation: rise 1.2s 1.5s both;
}
.cta .btn { width: min(100%, 300px); }
@media (min-width: 640px) { .cta { flex-direction: row; justify-content: center; } .cta .btn { width: auto; min-width: 230px; } }
.from {
  margin: 24px 0 0;
  font: italic 400 19px/1.3 var(--display);
  color: var(--lav);
  animation: rise 1.2s 1.75s both;
}
.hint {
  margin: 8px 0 0;
  font: 400 12px/1.4 var(--ui); letter-spacing: 0.08em;
  color: rgba(214, 205, 234, 0.6);
  animation: rise 1.2s 2.2s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero-ground {
  position: absolute; left: 0; bottom: 0; z-index: 1;
  width: 100%; height: 190px;
  pointer-events: none;
}
.scroll-cue {
  position: absolute; z-index: 3; left: 50%; bottom: 18px;
  width: 30px; height: 46px; margin-left: -15px;
  display: block;
}
.scroll-cue::before {
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 1px;
  background: linear-gradient(rgba(244, 235, 208, 0), rgba(244, 235, 208, 0.4));
}
.scroll-cue span {
  position: absolute; left: 50%; top: 0; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: #fffbe6; box-shadow: 0 0 10px 3px rgba(247, 215, 116, 0.7);
  animation: drift-down 2.6s ease-in-out infinite;
}
@keyframes drift-down { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(38px); opacity: 0; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(244, 235, 208, 0.3);
  background: rgba(13, 18, 44, 0.4);
  color: var(--moon);
  font: 500 15px/1.2 var(--ui); letter-spacing: 0.06em;
  text-decoration: none;
  transition: transform 0.25s, border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(247, 215, 116, 0.7); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-glow {
  color: #fff6dc;
  border-color: rgba(247, 215, 116, 0.62);
  background: radial-gradient(120% 160% at 50% 130%, rgba(247, 215, 116, 0.3), rgba(247, 215, 116, 0.04) 62%), rgba(13, 18, 44, 0.42);
  box-shadow: 0 0 26px rgba(247, 215, 116, 0.18), inset 0 0 14px rgba(247, 215, 116, 0.1);
}
.btn .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fffbe6; box-shadow: 0 0 8px 3px rgba(247, 215, 116, 0.75);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 55% { opacity: 0.35; } }
.btn small {
  font: 500 10px/1 var(--ui); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--lav); margin-left: 4px;
}
.mini-lantern { width: 16px; height: 22px; color: #3a2f5e; filter: drop-shadow(0 0 6px rgba(247, 215, 116, 0.7)); }
.btn-quiet .mini-lantern { color: #b5a8e8; }

/* =========================================================
   SHARED SECTION BITS
   ========================================================= */
main { position: relative; z-index: 1; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.head { text-align: center; max-width: 760px; }
h2 {
  margin: 0 0 14px;
  font: italic 400 clamp(44px, 12vw, 80px)/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--moon);
  text-wrap: balance;
}
.sec-lede {
  margin: 0 auto; max-width: 32em;
  font: 400 clamp(19px, 5vw, 23px)/1.5 var(--display);
  color: #e8e1f4;
  text-shadow: 0 1px 14px rgba(13, 18, 44, 0.7);
  text-wrap: pretty;
}

/* =========================================================
   II. THE GARDEN
   ========================================================= */
.garden-sec { padding: 84px 0 0; overflow: hidden; }
.keys-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .keys-hint { display: block; margin: 14px 0 0; font: 400 13px/1.6 var(--ui); color: #c4b9ee; letter-spacing: 0.03em; }
}
kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 5px;
  font: 500 11px/1.5 var(--ui); text-align: center;
  border: 1px solid rgba(169, 155, 224, 0.5); border-bottom-width: 2px; border-radius: 5px;
  color: var(--moon);
}

.stage {
  position: relative;
  height: 640px;
  height: clamp(560px, calc(100svh - 20px), 720px);
  margin: 22px 0 0;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 900px) { .stage { height: clamp(600px, 84vh, 740px); } }
.garden-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.stage-top {
  position: absolute; z-index: 4; top: 10px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 14px;
  pointer-events: none;
}
.stage-top > * { pointer-events: auto; }
.stage-controls { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(247, 215, 116, 0.6);
  background: rgba(13, 18, 44, 0.55);
  color: #fff6dc;
  font: 500 14px/1 var(--ui); letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
}
.chip:active { transform: scale(0.97); }
.chip-ico {
  width: 0; height: 0;
  border-left: 9px solid var(--gold); border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent;
  filter: drop-shadow(0 0 4px rgba(247, 215, 116, 0.8));
}
.chip.playing .chip-ico { width: 9px; height: 9px; border: 0; background: var(--gold); border-radius: 2px; }
.chip.playing { background: rgba(247, 215, 116, 0.14); }
.chip-quiet { border-color: rgba(244, 235, 208, 0.24); color: var(--text-soft); }
.progress { display: flex; flex-direction: column; align-items: center; gap: 6px; transition: opacity 0.6s; }
.pips { display: flex; gap: 7px; list-style: none; margin: 0; padding: 0; }
.pips li {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(244, 235, 208, 0.18);
  transition: background 0.4s, box-shadow 0.4s, transform 0.4s;
}
.pips li.on { background: #fff3c2; box-shadow: 0 0 8px 2px rgba(247, 215, 116, 0.75); transform: scale(1.15); }
.status { margin: 0; font: italic 400 18px/1.3 var(--display); color: var(--text-soft); text-align: center; }
.stage.bloomed .progress { opacity: 0; pointer-events: none; }

/* moonstones */
.stones, .threads { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.stone {
  position: absolute;
  padding: 0; border: 0;
  border-radius: 47% 53% 44% 56% / 56% 48% 52% 44%;
  background:
    radial-gradient(70% 60% at 50% 70%, rgba(20, 18, 54, 0) 30%, rgba(10, 10, 30, 0.55) 100%),
    linear-gradient(160deg, #3a3568 0%, #1f1d45 55%, #14132f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -6px 12px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.16s cubic-bezier(.3, 1.6, .5, 1), box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.stone::before {
  /* the inner light, in the stone's own colour */
  content: ""; position: absolute; inset: 14%;
  border-radius: inherit;
  background: radial-gradient(circle at 45% 40%, #fffaf0 0%, var(--c) 35%, transparent 75%);
  opacity: 0.62;
  filter: blur(3px);
  transition: opacity 0.5s, transform 0.4s;
  animation: stone-breathe 4.5s ease-in-out infinite;
}
.stone:nth-child(2n)::before { animation-delay: -1.6s; }
.stone:nth-child(3n)::before { animation-delay: -3.1s; }
@keyframes stone-breathe { 50% { opacity: 0.85; } }
.stone.back { filter: brightness(0.88); }
.stone::after {
  content: ""; position: absolute; left: 22%; top: 14%; width: 30%; height: 18%;
  border-radius: 50%; background: rgba(255, 255, 255, 0.28); filter: blur(1.5px);
  transform: rotate(-18deg);
}
.stone-ring {
  position: absolute; inset: -4px; border-radius: inherit;
  border: 1.5px solid var(--c); opacity: 0; pointer-events: none;
}
.stone-name {
  position: absolute; left: 0; right: 0; bottom: -20px;
  font: 500 11px/1 var(--ui); letter-spacing: 0.08em;
  color: rgba(214, 205, 234, 0.55);
  pointer-events: none;
}
.stone.on {
  transform: translateY(2px) scale(0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 26px 6px var(--c), 0 4px 10px rgba(0, 0, 0, 0.4);
  transition-duration: 0.05s;
}
.stone.on::before { opacity: 1; transform: scale(1.25); transition-duration: 0.05s; animation: none; }
.stone.on .stone-name { color: var(--moon); }

.thread {
  position: absolute; left: 0; right: 0; height: 28px;
  background: none; border: 0; padding: 0;
  pointer-events: none;
}
.thread:focus-visible { outline: 2px solid var(--gold); outline-offset: -8px; border-radius: 999px; }

.bloom-call {
  position: absolute; z-index: 5; left: 50%; top: 56px;
  width: min(96%, 460px);
  padding: 4px 10px 14px;
  text-align: center;
  background: radial-gradient(closest-side, rgba(10, 14, 38, 0.72), rgba(10, 14, 38, 0));
  opacity: 0; transform: translate(-50%, 10px);
  transition: opacity 1s, transform 1s cubic-bezier(.2, .8, .2, 1);
}
.bloom-call.show { opacity: 1; transform: translate(-50%, 0); }
.bloom-line { margin: 0 0 8px; line-height: 1.25; }
.bloom-title { font: italic 500 27px/1 var(--display); color: var(--gold); text-shadow: 0 0 18px rgba(247, 215, 116, 0.6); }
.bloom-sub { font: italic 400 19px/1.3 var(--display); color: var(--text-soft); white-space: nowrap; }
.bloom-call .btn { min-height: 46px; }

/* =========================================================
   III. LANTERNS (photos)
   ========================================================= */
.memories { padding: 110px 0 30px; overflow: hidden; }
.hangings {
  list-style: none; margin: 34px auto 0; padding: 0;
  max-width: 1200px;
  display: grid; gap: 34px;
}
.hang { position: relative; }
.bough { display: block; width: 100%; height: auto; aspect-ratio: 400 / 64; overflow: visible; }
.pend {
  position: relative;
  width: 84%; max-width: 540px;
  margin: -7.8% auto 0;
  transform-origin: 50% 0;
  will-change: transform;
}
.cord {
  display: block; width: 1.2px; height: 38px; margin: 0 auto;
  background: linear-gradient(rgba(244, 235, 208, 0.2), rgba(244, 235, 208, 0.7));
}
.frame { margin: 0; position: relative; }
.cap {
  display: block; height: 11px; width: 46%; margin: 0 auto;
  border-radius: 5px;
  background: linear-gradient(#3b3062, #1b1737);
}
.cap-top { box-shadow: inset 0 2px 0 rgba(247, 215, 116, 0.5); margin-bottom: -3px; position: relative; z-index: 1; }
.cap-bot { box-shadow: inset 0 -2px 0 rgba(247, 215, 116, 0.42); margin-top: -3px; position: relative; z-index: 1; width: 40%; }
.frame-btn {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: #1c1838;
  cursor: zoom-in;
  box-shadow:
    0 0 0 1px rgba(247, 215, 116, 0.4),
    0 0 36px rgba(247, 215, 116, 0.2),
    0 0 110px rgba(243, 182, 200, 0.12),
    0 30px 60px rgba(0, 0, 0, 0.45);
}
.frame-btn img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9) brightness(0.9);
  transition: filter 0.6s, transform 0.8s;
}
.frame-btn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 46px rgba(247, 205, 120, 0.4), inset 0 0 3px rgba(255, 240, 200, 0.7);
}
.frame-btn:hover img { filter: saturate(1) brightness(1); transform: scale(1.015); }
.hang.inview .frame-btn { animation: light-up 1.5s ease-out both; }
@keyframes light-up {
  0% { opacity: 0.15; } 18% { opacity: 0.8; } 26% { opacity: 0.35; } 40% { opacity: 0.95; } 52% { opacity: 0.7; } 100% { opacity: 1; }
}
.tassel { display: block; position: relative; width: 2px; height: 26px; margin: 0 auto; background: linear-gradient(var(--pink), rgba(243, 182, 200, 0)); }
.tassel::before { content: ""; position: absolute; left: -3px; top: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.frame figcaption {
  margin-top: 2px; text-align: center;
  font: italic 400 22px/1.3 var(--display); color: #ebe3f5;
}
@media (min-width: 860px) {
  .hangings { grid-template-columns: 1fr 1fr; gap: 0 3vw; padding: 0 var(--gutter); }
  .hang:nth-child(even) { margin-top: 140px; }
  .pend { width: 88%; }
}

/* =========================================================
   IV. MIDNIGHT: lantern + letter
   ========================================================= */
.letter-sec { padding: 120px 0 90px; outline: none; overflow: hidden; }
.lantern-stage { position: relative; margin-top: 18px; text-align: center; }
.lantern-bough { display: block; width: 100%; height: 72px; overflow: visible; }
.lantern-swing {
  position: relative; width: 190px; margin: -40px auto 0;
  transform-origin: 50% 0;
}
.lantern-glow {
  position: absolute; z-index: -1; left: 50%; top: 52%;
  width: 460px; height: 460px; margin: -230px 0 0 -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 140, 0.42) 0%, rgba(247, 170, 100, 0.16) 32%, rgba(243, 182, 200, 0.06) 52%, rgba(243, 182, 200, 0) 70%);
  animation: glow-flicker 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glow-flicker {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.03); }
  45% { opacity: 0.82; }
  70% { opacity: 0.97; transform: scale(0.99); }
}
.lantern {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
}
.lantern svg { display: block; width: 100%; height: auto; overflow: visible; }
.l-flame { animation: flame 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes flame { 0%, 100% { opacity: 0.85; transform: scale(1); } 40% { opacity: 1; transform: scale(1.05, 1.08); } 60% { opacity: 0.78; transform: scale(0.97); } }
.lantern:active svg { transform: scale(0.98); }
.tag {
  position: absolute; left: 57%; top: 87%;
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 14px 6px 18px;
  background: linear-gradient(#f7f0dc, #eadfc0);
  color: var(--violet);
  border-radius: 3px 9px 9px 3px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  transform: rotate(-9deg);
  transform-origin: 0 50%;
}
.tag::before {
  content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: #1a1838;
}
.tag-for { font: 500 9px/1 var(--ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); }
.tag-name { font: italic 600 20px/1 var(--display); }
.lantern-note {
  margin: 34px auto 0; max-width: 21em; padding: 0 var(--gutter);
  font: italic 400 clamp(21px, 5.4vw, 25px)/1.45 var(--display);
  color: #ece4f6;
  min-height: 2.9em;
}
.sealed .lantern-note::after {
  content: ""; display: block; width: 64px; height: 1px; margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, rgba(247, 215, 116, 0.7), transparent);
}
.ready .lantern-glow { animation-duration: 2.2s; }
.ready .lantern { animation: beckon 3.2s ease-in-out infinite; }
@keyframes beckon { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
.nudge .lantern-glow { animation: flare 1s ease-out; }
@keyframes flare { 30% { opacity: 1; transform: scale(1.25); } }
.opened .lantern { animation: none; transform: scale(0.8); }
.opened .lantern-note { min-height: 0; margin-top: 0; }
.opened .lantern-glow { animation: flare 1.4s ease-out, glow-flicker 3.4s 1.4s ease-in-out infinite; }
.text-btn {
  margin-top: 10px; padding: 10px 14px;
  background: none; border: 0; cursor: pointer;
  font: 400 15px/1.4 var(--ui); letter-spacing: 0.03em; color: var(--lav);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}

.paper {
  position: relative;
  width: calc(100% - 2 * var(--gutter)); max-width: 680px;
  margin: 26px auto 0;
  padding: clamp(40px, 9vw, 72px) clamp(24px, 7vw, 72px) clamp(44px, 9vw, 72px);
  color: var(--ink);
  border-radius: 4px;
  background:
    radial-gradient(130% 70% at 50% 0%, rgba(255, 252, 240, 0.95), rgba(255, 252, 240, 0) 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .25 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #f7f0dc, #efe3c5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 0 60px rgba(214, 180, 120, 0.25),
    0 0 70px rgba(247, 215, 116, 0.22),
    0 40px 90px rgba(0, 0, 0, 0.55);
  outline: none;
  opacity: 0;
  transform: translateY(-18px) scaleY(0.96);
  transform-origin: 50% 0;
  clip-path: inset(-120px -120px 100% -120px);
  transition: opacity 0.7s, transform 1.2s cubic-bezier(.2, .8, .2, 1), clip-path 1.5s cubic-bezier(.3, .7, .2, 1);
}
.paper.open { opacity: 1; transform: none; clip-path: inset(-120px -120px -120px -120px); }
.paper-body p {
  margin: 0 0 1.05em;
  font: 500 clamp(20px, 5.3vw, 22.5px)/1.6 var(--display);
  text-wrap: pretty;
}
.paper-body .greet { font-style: italic; font-size: clamp(28px, 7.6vw, 34px); line-height: 1.2; margin-bottom: 0.8em; color: #2e2560; }
.paper-body .signoff { margin: 1.7em 0 0; font-style: italic; }
.paper-body .sig {
  margin: 4px 0 0;
  font: italic 500 clamp(44px, 12vw, 60px)/1 var(--display);
  color: #3a2f70;
}
.paper-body .sig::after {
  content: ""; display: block; width: 120px; height: 10px; margin-top: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10'%3E%3Cpath d='M2 7C30 1 60 9 90 4s22 0 28-1' fill='none' stroke='%23c8962e' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
}
.pressed {
  position: absolute; top: -26px; right: 10px;
  width: 66px; height: 88px;
  transform: rotate(16deg);
  filter: drop-shadow(0 2px 2px rgba(80, 50, 30, 0.2));
  pointer-events: none;
}
.paper-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.card-thumb {
  width: 110px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: zoom-in;
  box-shadow: 0 4px 12px rgba(40, 30, 60, 0.3);
}
.card-thumb img { display: block; width: 100%; height: auto; }

/* =========================================================
   V. FIRST LIGHT
   ========================================================= */
.dawn {
  position: relative;
  margin-top: 30px;
  padding: 50vh 0 56px;
  overflow: hidden;
  color: var(--ink);
  text-align: center;
  background: linear-gradient(180deg,
    rgba(15, 22, 48, 0) 0,
    rgba(36, 31, 76, 0.85) 9vh,
    #3f3374 17vh,
    #6e4d89 26vh,
    #b2789f 35vh,
    #e59fb3 43vh,
    #f6c2bd 51vh,
    #fad8bf 62vh,
    #fde7cd 78vh,
    #fdf1dd 100%);
}
.dawn-sky { position: absolute; left: 0; right: 0; top: 0; height: 62vh; }
.sun {
  position: absolute; left: 50%; top: 22vh;
  width: 86vw; max-width: 620px; aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, calc((1 - var(--rise, 0)) * 34%));
  background: radial-gradient(circle,
    rgba(255, 248, 226, 1) 0%,
    rgba(255, 233, 180, 0.95) 13%,
    rgba(250, 196, 150, 0.5) 30%,
    rgba(243, 182, 200, 0.18) 48%,
    rgba(243, 182, 200, 0) 68%);
  pointer-events: none;
}
.blossom {
  position: absolute; top: 3vh; right: -6px;
  width: min(96vw, 600px); height: auto;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.bl { transform-box: fill-box; transform-origin: center; animation: bl-sway 6s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes bl-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.bl.shiver { animation: shiver 0.7s ease-out; }
@keyframes shiver { 20% { transform: rotate(14deg) scale(1.1); } 45% { transform: rotate(-10deg); } 70% { transform: rotate(5deg); } }
.dawn-inner { position: relative; z-index: 1; }
.dawn .mvt { color: #4b3d7e; }
.dawn .mvt-sep { opacity: 0.5; }
.dawn h2 { color: #261e52; text-shadow: 0 1px 20px rgba(255, 240, 220, 0.5); }
.dawn-lines { margin: 22px auto 0; max-width: 30em; }
.dawn-lines p {
  margin: 0 auto 0.9em; max-width: 25em;
  font: 500 clamp(21px, 5.5vw, 26px)/1.5 var(--display);
  color: #2a2256;
  text-wrap: pretty;
}

.programme {
  max-width: 500px;
  margin: 56px auto 0;
  padding: 34px 24px 22px;
  background: rgba(255, 252, 244, 0.6);
  border: 1px solid rgba(42, 35, 80, 0.32);
  outline: 1px solid rgba(42, 35, 80, 0.18);
  outline-offset: 5px;
  border-radius: 2px;
  box-shadow: 0 30px 60px rgba(160, 90, 90, 0.16);
}
.prog-kicker { margin: 0; font: 500 11px/1 var(--ui); letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-soft); }
.programme h3 { margin: 10px 0 20px; font: italic 400 clamp(32px, 8.6vw, 40px)/1.05 var(--display); color: #261e52; }
.prog-list { list-style: none; margin: 0; padding: 0; }
.prog-list li { padding: 10px 0; }
.prog-list li + li::before {
  content: "✦"; display: block; margin: -6px 0 10px;
  font-size: 9px; line-height: 1; color: #c47c9a;
}
.prog-name { display: block; font: 500 24px/1.2 var(--display); color: #261e52; }
.prog-meta { display: block; margin-top: 5px; font: 500 11.5px/1.3 var(--ui); letter-spacing: 0.17em; text-transform: uppercase; color: var(--ink-soft); }
.prog-foot { margin: 8px 0 0; font-size: 10px; color: #c47c9a; }

.coda {
  margin: 70px 0 28px;
  font: italic 400 clamp(38px, 10vw, 62px)/1.05 var(--display);
  color: #261e52;
}
.foot { font: 400 14px/1.8 var(--ui); color: var(--ink-soft); letter-spacing: 0.03em; }
.foot p { margin: 0; }
.foot a { color: #3a2f70; }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--moon);
}
.lightbox::backdrop { background: rgba(7, 9, 26, 0.9); }
.lightbox figure {
  margin: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 12px 28px;
}
.lightbox img {
  max-width: 100%; max-height: calc(100% - 56px);
  object-fit: contain; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(247, 215, 116, 0.35), 0 0 70px rgba(247, 215, 116, 0.2);
}
.lightbox figcaption { margin-top: 14px; font: italic 400 22px/1.3 var(--display); }
.lb-btn {
  position: absolute;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(244, 235, 208, 0.3);
  background: rgba(13, 18, 44, 0.7);
  color: var(--moon); font: 300 30px/1 var(--ui);
  cursor: pointer;
  display: grid; place-items: center;
}
.lb-close { top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; }
.lb-prev { left: 8px; top: 50%; margin-top: -24px; }
.lb-next { right: 8px; top: 50%; margin-top: -24px; }
body.lb-open { overflow: hidden; }
@media (max-width: 700px) {
  /* on phones, keep the arrows off the photo (and off people's faces) */
  .lightbox figure { padding-bottom: 96px; }
  .lb-prev, .lb-next { top: auto; margin-top: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}

.noscript { position: relative; z-index: 2; text-align: center; padding: 20px; font: italic 22px var(--display); }

/* =========================================================
   QUIET MODE: big motion becomes gentle fades
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }
  .paper { transform: none; clip-path: none; transition: opacity 0.6s; }
  .bloom-call, .lantern, .moon { transition-duration: 0.3s; }
}
