/* ─────────────────────────────────────────────────────────────
   A LITTLE UNIVERSE — visual system
   ───────────────────────────────────────────────────────────── */
:root {
  --night-0: #101522;
  --night-1: #161c2a;
  --night-2: #1b2233;
  --ink: #222039;
  --cream: #fff7ed;
  --paper: #fff8e9;
  --rose: #efafc0;
  --rose-deep: #d989a1;
  --lavender: #c9d9e8;
  --blue: #97ccec;
  --gold: #f2d8a7;
  --mint: #9fd3c3;
  --glow: rgba(243, 221, 179, .72);
  --serif: Georgia, "Times New Roman", serif;
  --script: "Snell Roundhand", "Segoe Script", "Bradley Hand", cursive;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wand-x: 50vw;
  --wand-y: 50vh;
  --safe-top: max(20px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; background: var(--night-0); }
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--night-0);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
body.is-transitioning { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.noscript {
  position: fixed; z-index: 1000; inset: 0;
  display: grid; place-items: center; padding: 24px;
  background: #09091d; color: var(--cream); text-align: center;
}

/* Shared atmosphere */
#magic-canvas { position: fixed; z-index: 30; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.grain {
  position: fixed; z-index: 90; inset: 0; pointer-events: none; opacity: .026;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.loader {
  position: fixed; z-index: 999; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(circle at 50% 43%, #273048 0, #161c2a 48%, #0c111c 100%);
  transition: opacity 1s ease, visibility 1s ease;
}
.loader.is-gone { opacity: 0; visibility: hidden; }
.loader__star { font-size: 36px; color: var(--gold); text-shadow: 0 0 16px #fff, 0 0 38px var(--gold); animation: breathe 1.5s ease-in-out infinite; }
.loader p { margin: 0; color: rgba(255,249,237,.66); font-family: var(--serif); font-style: italic; letter-spacing: .04em; }
@keyframes breathe { 50% { opacity: .5; transform: scale(.78) rotate(12deg); } }

.cinematic-flash { position: fixed; z-index: 500; inset: 0; pointer-events: none; background: #fffdf4; opacity: 0; visibility: hidden; }
.cinematic-flash.is-active { visibility: visible; animation: whiteGate 1.65s cubic-bezier(.7,0,.2,1) both; }
@keyframes whiteGate { 0% { opacity: 0; } 38% { opacity: .98; } 58% { opacity: 1; } 100% { opacity: 0; } }

.eyebrow {
  margin: 0 0 20px; color: var(--gold); font-size: .67rem; font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase;
}
.eyebrow::before { content: "✦"; display: inline-block; margin-right: 11px; font-size: .7rem; }
em { color: var(--rose); font-family: var(--script); font-weight: 400; }

.audio-toggle {
  position: fixed; z-index: 110; top: var(--safe-top); right: max(20px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 8px; min-width: 44px; min-height: 44px;
  padding: 9px 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 99px;
  background: rgba(9,9,29,.82); color: rgba(255,255,255,.72);
  cursor: pointer; transition: color .3s, border-color .3s, background .3s;
}
.audio-toggle:hover { color: #fff; border-color: rgba(242,217,165,.6); background: rgba(15,15,42,.76); }
.audio-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.audio-toggle .sound-wave { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.audio-toggle[aria-pressed="true"] .sound-wave { opacity: 1; }
.audio-toggle span { font-size: .59rem; letter-spacing: .18em; text-transform: uppercase; }

.wand {
  position: fixed; z-index: 95; left: var(--wand-x); top: var(--wand-y); width: 9px; height: 9px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: #fff; box-shadow: 0 0 9px 3px #fff, 0 0 24px 10px rgba(242,217,165,.44);
  transform: translate(-50%,-50%); transition: width .25s, height .25s, opacity .5s;
}
body.has-pointer .wand { opacity: .65; }
body.wand-active .wand { width: 14px; height: 14px; box-shadow: 0 0 12px 4px #fff, 0 0 38px 18px rgba(239,185,195,.4); }

.phase { position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; }

/* Entrance / constellation */
.phase--entrance {
  overflow: hidden; display: grid; place-items: center; height: 100svh; height: 100dvh; min-height: 100svh; min-height: 100dvh; padding: 10vh 6vw;
  background:
    radial-gradient(circle at 74% 26%, rgba(239,175,192,.16) 0, transparent 25%),
    radial-gradient(circle at 25% 74%, rgba(217,137,161,.11) 0, transparent 32%),
    linear-gradient(155deg, #0c111c 0%, #101522 46%, #1b2233 100%);
  transition: opacity 1.1s ease, transform 1.3s cubic-bezier(.7,0,.2,1), filter 1s;
}
.phase--entrance::before {
  content: ""; position: absolute; inset: 0; opacity: .48; pointer-events: none;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.5px);
  background-size: 113px 97px; background-position: 20px 33px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.phase--entrance.is-releasing { transform: scale(1.13); filter: blur(3px) brightness(1.65); opacity: 0; }
.night-orbit { position: absolute; border: 1px solid rgba(196,185,239,.07); border-radius: 50%; pointer-events: none; }
.night-orbit--one { width: min(70vw,900px); aspect-ratio: 1; left: -25vw; top: -30vw; }
.night-orbit--two { width: min(54vw,720px); aspect-ratio: 1; right: -22vw; bottom: -28vw; }
.entrance-copy { position: absolute; z-index: 2; left: clamp(26px, 8vw, 140px); top: clamp(90px, 14vh, 150px); max-width: 620px; pointer-events: none; }
.entrance-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.35rem, 5vw, 5.6rem); font-weight: 400; line-height: .98; letter-spacing: -.04em; }
.entrance-copy h1 em { display: inline-block; margin-top: .18em; color: #f0b7c6; font-family: "Palatino Linotype", Palatino, Georgia, serif; font-size: .7em; font-style: italic; font-weight: 400; line-height: 1.08; letter-spacing: -.025em; transform: none; }
.entrance-hint { max-width: 420px; margin: 22px 0 0; color: rgba(255,249,237,.68); font-family: var(--serif); font-size: .95rem; font-style: italic; line-height: 1.45; }
.entrance-hint strong { color: rgba(242,216,167,.82); font-size: .78em; font-style: normal; font-weight: 400; letter-spacing: .13em; text-transform: uppercase; }
.constellation { position: relative; z-index: 3; width: min(100%, 1060px); height: min(68vh, 650px); margin-top: 16vh; }
.rune-field, .constellation__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.constellation__lines { overflow: visible; pointer-events: none; }
.constellation__lines line { stroke: rgba(225,216,255,.17); stroke-width: 1; stroke-dasharray: 4 9; vector-effect: non-scaling-stroke; }
.constellation__lines line.is-lit { stroke: rgba(250,226,179,.8); stroke-width: 1.5; stroke-dasharray: none; filter: drop-shadow(0 0 8px var(--gold)); animation: drawLine .8s ease both; }
@keyframes drawLine { from { stroke-dasharray: 1 1000; stroke-dashoffset: 300; opacity: 0; } to { stroke-dasharray: 1000 1; stroke-dashoffset: 0; opacity: 1; } }
.rune {
  --rune-delay: 0s; position: absolute; display: grid; place-items: center; width: 64px; height: 64px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: rgba(226,222,255,.78); font-family: var(--serif); font-size: 1.38rem; letter-spacing: .04em;
  text-shadow: 0 0 10px rgba(199,185,239,.6); transform: translate(-50%,-50%);
  animation: runeFloat 5s ease-in-out var(--rune-delay) infinite;
  transition: color .25s, text-shadow .25s, opacity .35s;
}
.rune::before, .rune::after { content: ""; position: absolute; border-radius: 50%; transition: transform .35s, opacity .35s, border-color .35s; }
.rune::before { inset: 8px; border: 1px solid rgba(199,185,239,.16); }
.rune::after { inset: 21px; background: rgba(221,211,255,.1); filter: blur(5px); }
.rune:hover, .rune:focus-visible, .rune.is-near { color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--lavender), 0 0 34px var(--lavender); }
.rune:hover::before, .rune:focus-visible::before { transform: scale(1.35) rotate(45deg); border-color: rgba(242,217,165,.55); }
.rune.is-selected { color: #fff7d8; text-shadow: 0 0 8px #fff, 0 0 25px var(--gold), 0 0 55px var(--gold); animation-play-state: paused; }
.rune.is-selected::before { transform: scale(1.6); border-color: rgba(242,217,165,.72); }
.rune.is-wrong { animation: runeWrong .42s ease; color: var(--rose); }
.rune[disabled] { cursor: default; }
@keyframes runeFloat { 0%,100% { transform: translate(-50%,-50%) translate3d(0,-4px,0) rotate(-3deg); } 50% { transform: translate(-50%,-50%) translate3d(3px,7px,0) rotate(3deg); } }
@keyframes runeWrong { 25% { transform: translate(-56%,-50%); } 50% { transform: translate(-44%,-50%); } 75% { transform: translate(-53%,-50%); } }
.password-progress { position: absolute; left: 50%; bottom: -4px; display: flex; gap: 12px; transform: translateX(-50%); }
.password-progress span { display: block; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.2); transition: transform .4s, background .4s, box-shadow .4s; }
.password-progress span.is-lit { transform: scale(1.8); background: var(--gold); box-shadow: 0 0 9px var(--gold); }
.scroll-whisper { position: absolute; right: 4vw; bottom: 5vh; margin: 0; color: rgba(255,255,255,.24); font-family: var(--serif); font-size: .7rem; font-style: italic; writing-mode: vertical-rl; }

/* On larger screens, reserve the right half for the interactive constellation. */
@media (min-width: 1100px) {
  .constellation {
    position: absolute;
    top: 50%;
    right: clamp(24px, 1.5vw, 32px);
    width: min(51vw, 1060px);
    height: min(70vh, 680px);
    margin: 0;
    transform: translateY(-42%);
  }
}

/* Enchanted memory world */
.phase--memories {
  min-height: 420vh; overflow-x: clip; overflow-y: visible;
  background:
    radial-gradient(circle at 18% 35%, rgba(239,175,192,.13), transparent 26%),
    radial-gradient(circle at 84% 62%, rgba(217,137,161,.09), transparent 30%),
    linear-gradient(to bottom, #101522 0%, #1b2233 22%, #222b3a 49%, #203039 75%, #172725 100%);
}
.phase--memories::before {
  content: ""; position: fixed; z-index: -7; inset: 0; opacity: .38; pointer-events: none;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.6px); background-size: 89px 109px;
}
.world-sky { position: absolute; z-index: -5; top: 0; inset-inline: 0; height: 80vh; transform: translate3d(0,var(--parallax-y,0),0); }
.moon {
  position: absolute; top: 8vh; right: 8vw; width: clamp(110px, 17vw, 220px); aspect-ratio: 1;
  border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 34% 30%, #fffdf2 0 8%, #f4e9cb 40%, #d4c8bd 72%, #8e94ae 100%);
  box-shadow: 0 0 36px rgba(255,248,211,.44), 0 0 120px rgba(200,196,241,.24), 0 0 250px rgba(178,183,237,.16);
  transition: filter .5s, transform .5s;
}
.moon:hover { filter: brightness(1.14); transform: scale(1.025); }
.moon__crater { position: absolute; border-radius: 50%; background: rgba(118,120,146,.12); box-shadow: inset 3px 2px 4px rgba(92,93,125,.13); }
.moon__crater--one { width: 18%; height: 18%; left: 22%; top: 48%; }
.moon__crater--two { width: 10%; height: 10%; right: 23%; top: 27%; }
.moon__crater--three { width: 7%; height: 7%; right: 32%; bottom: 18%; }
.distant-hills { position: absolute; z-index: -4; top: 48vh; left: -5%; width: 110%; height: 42vh; transform: translate3d(0,var(--parallax-y,0),0); opacity: .7; }
.distant-hills::before, .distant-hills::after { content: ""; position: absolute; inset: 0; clip-path: polygon(0 65%, 14% 35%, 25% 55%, 41% 22%, 58% 60%, 73% 30%, 88% 51%, 100% 25%, 100% 100%, 0 100%); }
.distant-hills::before { background: #222b3a; }
.distant-hills::after { transform: translateY(15%); background: #1c3032; opacity: .8; }
.forest { position: fixed; z-index: -3; inset: 0; width: 100%; height: 100vh; opacity: .46; pointer-events: none; contain: strict; }
.forest::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(72deg, transparent 49%, currentColor 50% 52%, transparent 53%),
    radial-gradient(ellipse at 20% 30%, currentColor 0 9%, transparent 10%),
    radial-gradient(ellipse at 75% 44%, currentColor 0 11%, transparent 12%);
  background-size: 260px 500px, 310px 430px, 370px 520px;
}
.forest--far { color: #1b3030; transform: translateY(43vh); }
.forest--near { color: #172725; opacity: .68; transform: translateY(62vh) scale(1.08); }
.mist { position: fixed; z-index: -2; width: 68vw; height: 20vh; border-radius: 50%; filter: blur(28px); opacity: .065; pointer-events: none; background: #efafc0; }
.mist--one { left: -20vw; top: 35vh; }
.mist--two { right: -25vw; top: 66vh; animation-delay: -8s; }
@keyframes mistDrift { to { transform: translateX(28vw) scale(1.12); opacity: .14; } }
.journey-intro { position: relative; z-index: 2; width: min(820px, 88vw); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; margin: auto; padding-bottom: 15vh; }
.journey-intro h2 { max-width: 680px; margin: 0; font-family: var(--serif); font-size: clamp(2.8rem, 7vw, 6.8rem); line-height: .95; font-weight: 400; letter-spacing: -.045em; }
.journey-intro > p:last-of-type { max-width: 440px; margin: 34px 0 0; color: rgba(255,249,237,.62); font-family: var(--serif); font-style: italic; line-height: 1.7; }
.journey-intro__line { position: absolute; left: 0; bottom: 10vh; width: 1px; height: 70px; background: linear-gradient(var(--gold), transparent); }
.journey-layout { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 38vw); gap: 4vw; width: min(1280px, 92vw); margin: auto; padding-bottom: 16vh; }
.timeline { position: relative; z-index: 2; min-width: 0; }
.chapter { min-height: 40vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 10vh 0 4vh; }
.chapter span { color: var(--gold); font-size: .63rem; letter-spacing: .34em; text-transform: uppercase; }
.chapter h3 { margin: 8px 0 0; font-family: var(--script); color: var(--rose); font-size: clamp(2.1rem,4vw,3.5rem); font-weight: 400; transform: rotate(-2deg); }
.chapter p { max-width: 540px; margin: 20px 0 0; color: rgba(255,247,237,.6); font-family: var(--serif); font-size: clamp(.86rem,1.4vw,1rem); font-style: italic; line-height: 1.7; }
.chapter--together { min-height: 52vh; }
.chapter--together h3 { color: #f3bdca; text-shadow: 0 0 28px rgba(239,175,192,.16); }
.chapter--together p { color: rgba(255,229,234,.78); }
.memory { position: relative; min-height: 82vh; display: flex; align-items: center; padding: 7vh 0; opacity: .58; transition: opacity .42s ease; }
.memory:nth-of-type(3n), .memory:nth-of-type(5n) { justify-content: flex-end; }
.memory.is-discovered { opacity: 1; }
.memory::before { content: ""; position: absolute; left: 2%; top: 14%; width: 82%; height: 72%; border-radius: 50%; background: radial-gradient(ellipse, var(--memory-glow, rgba(239,185,195,.1)), transparent 70%); opacity: 0; transition: opacity .7s; pointer-events: none; }
.memory.is-discovered::before { opacity: 1; }
.memory-card {
  --rotation: -2deg; position: relative; width: min(460px, 90%); padding: 13px 13px 76px;
  border: 1px solid rgba(255,255,255,.38); border-radius: 3px;
  background: linear-gradient(145deg, rgba(255,252,242,.96), rgba(239,225,213,.92)); color: var(--ink);
  box-shadow: 0 25px 70px rgba(0,0,0,.4), 0 0 0 1px rgba(242,217,165,.08), 0 0 60px rgba(217,177,195,.08);
  transform: translate3d(0,28px,0) rotate(var(--rotation)) scale(.975); opacity: 0;
  transition: transform .52s cubic-bezier(.2,.8,.2,1), opacity .36s ease, box-shadow .28s;
}
.memory-card--wide { width: min(560px, 96%); }
.memory--together .memory-card { border-color: rgba(255,220,230,.5); box-shadow: 0 25px 70px rgba(0,0,0,.4), 0 0 48px rgba(239,175,192,.1); }
.memory.is-discovered .memory-card { transform: translate3d(0,0,0) rotate(var(--rotation)) scale(1); opacity: 1; }
.memory-card:hover, .memory-card.is-open { transform: translate3d(0,-9px,0) rotate(calc(var(--rotation) * .45)) scale(1.018) !important; box-shadow: 0 34px 90px rgba(0,0,0,.5), 0 0 45px rgba(242,217,165,.18); }
.memory-card::before { content: "✦   ·   ✧"; position: absolute; right: 18px; bottom: 17px; color: rgba(77,67,93,.34); font-size: .72rem; letter-spacing: .2em; }
.memory-photo { position: relative; aspect-ratio: var(--photo-aspect, 4 / 5); overflow: hidden; background: #25263c; }
.memory-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--photo-position, 50% 50%); transform: scale(1.012); transition: transform .45s ease; }
.memory-card:hover img, .memory-card.is-open img { transform: scale(1.055); }
.memory-photo--contain img { object-fit: contain; transform: none; background: linear-gradient(145deg,#25283b,#161b2a); }
.memory-photo::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 50px rgba(10,10,30,.28); pointer-events: none; }
.memory-photo--contain::after { box-shadow: inset 0 0 28px rgba(10,10,30,.18); }
.memory-photo.is-fallback { display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #566077, #25283f 55%, #17192e); }
.memory-photo.is-fallback::before { content: "✦"; color: rgba(255,255,255,.7); font-size: clamp(3rem,8vw,6rem); text-shadow: 0 0 30px var(--lavender); }
.memory-photo.is-fallback::after { content: "Your photograph belongs here"; inset: auto 0 18%; box-shadow: none; color: rgba(255,255,255,.55); font-family: var(--serif); font-size: .83rem; text-align: center; }
.memory-caption { position: absolute; inset: auto 21px 17px 20px; display: flex; align-items: end; gap: 18px; }
.memory-caption strong { flex: 1; font-family: var(--script); font-size: clamp(1.18rem,2.4vw,1.65rem); font-weight: 400; line-height: 1; }
.memory-date { flex: 0 0 auto; color: rgba(34,32,57,.52); font-family: var(--serif); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.memory-story { position: absolute; z-index: 4; top: 50%; width: var(--story-width,240px); margin: 0; padding: 4px 0; border: 0; background: transparent; box-shadow: none; color: rgba(255,249,237,.9); font-family: var(--serif); font-size: .92rem; font-style: italic; line-height: 1.7; opacity: 0; pointer-events: none; text-shadow: 0 2px 12px rgba(4,7,18,.9),0 0 22px rgba(239,175,192,.12); transition: opacity .3s ease, transform .38s cubic-bezier(.22,1,.36,1); }
.memory-story::before { display: none; }
.memory-story.story--right { left: calc(100% + 18px); right: auto; text-align: left; transform: translate(12px,-50%); }
.memory-story.story--left { right: calc(100% + 18px); left: auto; text-align: right; transform: translate(-12px,-50%); }
.memory-story.story--inline { position: static; width: auto; max-width: none; margin: 18px 2px 0; padding: 14px 0 0; border: 0; border-top: 1px solid rgba(77,67,93,.18); border-radius: 0; background: transparent; box-shadow: none; color: #3f354a; opacity: .82; transform: none; text-align: left; }
.memory-story.story--inline::before { display: none; }
.memory-card--wide .memory-story { position: static; width: auto; max-width: none; margin: 18px 2px 0; padding: 14px 0 0; border: 0; border-top: 1px solid rgba(77,67,93,.18); color: #3f354a; opacity: .78; transform: none; text-align: left; }
.memory-card--wide .memory-story::before { display: none; }
.memory-card:hover .memory-story.story--right, .memory-card.is-open .memory-story.story--right, .memory-card:focus-within .memory-story.story--right { opacity: 1; transform: translate(0,-50%); }
.memory-card:hover .memory-story.story--left, .memory-card.is-open .memory-story.story--left, .memory-card:focus-within .memory-story.story--left { opacity: 1; transform: translate(0,-50%); }
.memory-card--wide:hover .memory-story, .memory-card--wide.is-open .memory-story, .memory-card--wide:focus-within .memory-story { transform: none; }
.memory-deco { position: absolute; z-index: 3; top: -14px; right: -11px; color: #bd8192; font-size: 29px; transform: rotate(14deg); filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }

.tree-sanctuary { position: sticky; z-index: 1; top: 8vh; align-self: start; height: 86vh; display: flex; flex-direction: column; justify-content: center; padding: 0 2vw; }
.tree-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: rgba(255,249,237,.42); font-family: var(--serif); font-size: .72rem; font-style: italic; }
.tree-heading strong { color: var(--gold); font-family: var(--sans); font-size: .58rem; font-style: normal; letter-spacing: .15em; }
.life-tree { width: 100%; height: min(67vh,600px); overflow: visible; }
.tree-trunk, .tree-branch, .tree-ground { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tree-trunk { stroke: url(#trunkGradient); stroke-width: 12; opacity: .64; }
.tree-ground { stroke: rgba(159,211,195,.25); stroke-width: 2; }
.tree-branch { stroke: #d7a9a7; stroke-width: 5; stroke-dasharray: var(--branch-length,300); stroke-dashoffset: var(--branch-length,300); opacity: .15; transition: stroke-dashoffset .9s cubic-bezier(.22,1,.36,1), opacity .55s ease; }
.tree-branch.is-grown { stroke-dashoffset: 0; opacity: .78; }
.tree-leaf { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0) rotate(-18deg); transition: opacity .42s var(--leaf-delay,0s), transform .58s cubic-bezier(.22,1,.36,1) var(--leaf-delay,0s); }
.tree-leaf.is-grown { opacity: .9; transform: scale(1) rotate(0); }
.tree-note { margin: -12px 0 0; color: rgba(255,249,237,.36); font-family: var(--script); font-size: 1rem; text-align: center; }
.guide-firefly { position: fixed; z-index: 24; left: 8vw; bottom: 12vh; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 1s; animation: guideDrift 7s ease-in-out infinite; }
.phase--memories.is-active .guide-firefly { opacity: 1; pointer-events: auto; }
.guide-firefly span, .guide-firefly::before, .guide-firefly::after { position: absolute; content: ""; border-radius: 50%; }
.guide-firefly span { inset: 19px; background: #fff4b5; box-shadow: 0 0 8px 3px #fff, 0 0 24px 11px rgba(255,223,120,.58); }
.guide-firefly::before, .guide-firefly::after { top: 17px; width: 10px; height: 6px; background: rgba(220,231,255,.5); }
.guide-firefly::before { left: 9px; transform: rotate(-28deg); }.guide-firefly::after { right: 9px; transform: rotate(28deg); }
@keyframes guideDrift { 0%,100% { transform: translate3d(0,0,0); } 33% { transform: translate3d(28px,-18px,0); } 66% { transform: translate3d(-8px,-38px,0); } }
.secret-toast { position: fixed; z-index: 120; left: 50%; bottom: 9vh; max-width: min(420px,84vw); padding: 13px 22px; border: 1px solid rgba(242,217,165,.25); border-radius: 99px; background: rgba(10,12,32,.92); color: rgba(255,249,237,.86); font-family: var(--serif); font-size: .86rem; font-style: italic; text-align: center; opacity: 0; transform: translate(-50%,15px); pointer-events: none; transition: opacity .5s, transform .5s; }
.secret-toast.is-visible { opacity: 1; transform: translate(-50%,0); }
body.heartbeat::after { content: ""; position: fixed; z-index: 80; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px rgba(239,185,195,.12); animation: heartPulse 1.45s ease-out both; }
@keyframes heartPulse { 0%,100% { opacity: 0; } 24% { opacity: .75; } 48% { opacity: .15; } 70% { opacity: .5; } }

/* Intentional doorway from the memories to the private letter */
.letter-invitation {
  position: relative; z-index: 5; display: grid; place-items: center; width: min(920px,92vw); min-height: 88svh;
  margin: 0 auto; padding: 12vh 24px 16vh; text-align: center; opacity: 0; transform: translate3d(0,34px,0);
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.16,1,.3,1);
}
.letter-invitation[hidden] { display: none; }
.letter-invitation.is-visible { opacity: 1; transform: none; }
.letter-invitation__halo { position: absolute; width: min(650px,82vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle,rgba(239,175,192,.16),rgba(242,217,165,.06) 38%,transparent 68%); animation: invitationGlow 4.8s ease-in-out infinite; pointer-events: none; }
.letter-invitation__card { position: relative; width: min(630px,100%); padding: clamp(38px,7vw,72px) clamp(24px,7vw,68px); border: 1px solid rgba(242,217,165,.25); background: linear-gradient(145deg,rgba(16,18,40,.9),rgba(35,28,48,.78)); box-shadow: 0 32px 90px rgba(0,0,0,.38),0 0 70px rgba(239,175,192,.08),inset 0 0 45px rgba(255,255,255,.025); backdrop-filter: blur(12px); }
.letter-invitation__card::before, .letter-invitation__card::after { content: ""; position: absolute; width: 34px; height: 34px; opacity: .38; }
.letter-invitation__card::before { top: 15px; left: 15px; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); }
.letter-invitation__card::after { right: 15px; bottom: 15px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.letter-invitation .eyebrow { margin-bottom: 30px; }
.letter-invitation h2 { margin: 30px 0 0; font-family: var(--serif); font-size: clamp(2rem,5vw,4.2rem); font-weight: 400; line-height: 1.02; letter-spacing: -.035em; }
.letter-invitation h2 em { color: var(--rose); font-family: var(--script); font-size: 1.15em; font-weight: 400; }
.letter-invitation__note { max-width: 430px; margin: 24px auto 30px; color: rgba(255,249,237,.58); font-family: var(--serif); font-size: .9rem; font-style: italic; line-height: 1.7; }
.letter-envelope { position: relative; width: 150px; height: 98px; margin: 0 auto; border-radius: 4px; background: linear-gradient(145deg,#f3e8d8,#d9c2bd); box-shadow: 0 16px 38px rgba(0,0,0,.28),0 0 42px rgba(242,217,165,.13); animation: envelopeFloat 4s ease-in-out infinite; }
.letter-envelope::after { content: ""; position: absolute; z-index: 3; inset: 0; border-radius: 4px; background: linear-gradient(150deg,transparent 49.5%,#ead7ca 50%) left/50% 100% no-repeat,linear-gradient(210deg,transparent 49.5%,#e2cbbf 50%) right/50% 100% no-repeat; }
.letter-envelope__paper { position: absolute; z-index: 1; left: 13px; right: 13px; top: -13px; height: 76px; border-radius: 3px; background: linear-gradient(#fff9eb,#eee0d3); box-shadow: 0 -5px 18px rgba(255,248,222,.1); }
.letter-envelope__paper::before { content: "A little note for you"; position: absolute; inset: 19px 10px auto; color: rgba(82,61,83,.46); font-family: var(--script); font-size: .82rem; }
.letter-envelope__flap { position: absolute; z-index: 2; inset: 0 0 auto; height: 66px; clip-path: polygon(0 0,100% 0,50% 100%); background: linear-gradient(#e9d2c6,#d7bbb2); transform-origin: top; animation: envelopeFlap 4s ease-in-out infinite; }
.letter-envelope__heart { position: absolute; z-index: 5; left: 50%; top: 48px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #a85f78; box-shadow: 0 0 20px rgba(216,137,161,.48); color: #fce8df; font-size: 13px; transform: translateX(-50%); animation: invitationHeart 2s ease-in-out infinite; }
.open-letter-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 58px; padding: 0 30px; border: 1px solid rgba(242,217,165,.55); border-radius: 99px; background: rgba(239,175,192,.1); box-shadow: 0 0 28px rgba(239,175,192,.1); color: var(--cream); cursor: pointer; transition: transform .3s ease,background .3s ease,box-shadow .3s ease; }
.open-letter-button:hover, .open-letter-button:focus-visible { transform: translateY(-3px); background: rgba(239,175,192,.2); box-shadow: 0 0 38px rgba(239,175,192,.22); }
.open-letter-button span { font-family: var(--serif); font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; }
.open-letter-button i { color: var(--gold); font-style: normal; animation: invitationSpark 1.8s ease-in-out infinite; }
.letter-invitation__sparkles i { position: absolute; z-index: 2; width: 4px; height: 4px; border-radius: 50%; background: #fff8d6; box-shadow: 0 0 10px 3px rgba(242,217,165,.5); animation: invitationSpark 2.8s ease-in-out infinite; }
.letter-invitation__sparkles i:nth-child(1) { left: 11%; top: 31%; }.letter-invitation__sparkles i:nth-child(2) { left: 23%; top: 69%; animation-delay: -.8s; }.letter-invitation__sparkles i:nth-child(3) { right: 16%; top: 25%; animation-delay: -1.6s; }.letter-invitation__sparkles i:nth-child(4) { right: 7%; top: 64%; animation-delay: -.35s; }.letter-invitation__sparkles i:nth-child(5) { left: 48%; bottom: 9%; animation-delay: -2.1s; }
@keyframes envelopeFloat { 50% { transform: translate3d(0,-9px,0) rotate(1deg); } }
@keyframes envelopeFlap { 0%,100% { transform: rotateX(0); } 45%,60% { transform: rotateX(20deg); } }
@keyframes invitationHeart { 50% { transform: translateX(-50%) scale(1.12); box-shadow: 0 0 28px rgba(216,137,161,.66); } }
@keyframes invitationGlow { 50% { opacity: .65; transform: scale(1.06); } }
@keyframes invitationSpark { 50% { opacity: .3; transform: scale(.65); } }

/* Finale */
.phase--finale {
  overflow: hidden; display: grid; place-items: center; height: 100svh; height: 100dvh; min-height: 100svh; min-height: 100dvh; padding: 5vh 5vw;
  background: radial-gradient(circle at 72% 23%, rgba(239,175,192,.16), transparent 25%), linear-gradient(170deg,#0c111c,#101522 56%,#1b2930);
}
.phase--finale.is-entering { animation: finaleIn 1.6s ease both; }
@keyframes finaleIn { from { opacity: 0; filter: blur(8px); } }
.back-to-memories { position: fixed; z-index: 24; top: max(22px,env(safe-area-inset-top)); left: max(22px,env(safe-area-inset-left)); display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px; border: 1px solid rgba(242,217,165,.28); border-radius: 99px; background: rgba(10,12,29,.66); box-shadow: 0 10px 30px rgba(0,0,0,.18); color: rgba(255,249,237,.82); cursor: pointer; backdrop-filter: blur(10px); transition: color .3s,border-color .3s,background .3s,transform .3s; }
.back-to-memories:hover, .back-to-memories:focus-visible { color: #fff; border-color: rgba(242,217,165,.56); background: rgba(35,29,49,.9); transform: translateX(-2px); }
.back-to-memories:disabled { opacity: .38; cursor: wait; transform: none; }
.back-to-memories i { color: var(--gold); font-family: var(--serif); font-size: 1.05rem; font-style: normal; }
.back-to-memories span { font-family: var(--serif); font-size: .69rem; letter-spacing: .12em; text-transform: uppercase; }
.finale-moon { position: absolute; z-index: -3; top: 7vh; right: 9vw; width: min(38vw,430px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%,#fffdf0,#e9dfcc 54%,#a5a5b9); box-shadow: 0 0 60px rgba(255,248,211,.34),0 0 190px rgba(194,185,227,.22); transition: filter 2s, box-shadow 2s, transform 2s; }
.finale-horizon { position: absolute; z-index: -2; inset: 55% -10% -20%; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at top,#294044,#111c20 65%); }
.finale-tree-wrap { position: absolute; z-index: -1; left: 2vw; bottom: -7vh; width: min(43vw,510px); opacity: .48; filter: drop-shadow(0 0 35px rgba(239,185,195,.15)); }
.finale-tree { width: 100%; height: auto; }
.letter-stage { z-index: 3; width: min(650px,88vw); display: grid; justify-items: center; perspective: 1400px; }
.letter {
  position: relative; width: 100%; min-height: 470px; max-height: min(72vh,680px); overflow-y: auto; padding: clamp(34px,6vw,76px);
  color: #342a3b; background-color: var(--paper);
  background-image: linear-gradient(rgba(98,76,107,.05) 1px, transparent 1px), radial-gradient(circle at 18% 9%,rgba(255,255,255,.9),transparent 26%);
  background-size: 100% 29px,100% 100%; border-radius: 2px;
  box-shadow: 0 35px 90px rgba(0,0,0,.48),0 0 60px rgba(242,217,165,.12);
  opacity: 0; transform: rotateX(74deg) translateY(60px) scale(.92); transform-origin: center bottom;
  transition: opacity 1.2s, transform 1.8s cubic-bezier(.16,1,.3,1);
  scrollbar-width: thin; scrollbar-color: rgba(89,67,97,.25) transparent;
}
.letter::after { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(110,85,105,.1); pointer-events: none; }
.letter.is-open { opacity: 1; transform: rotateX(0) translateY(0) scale(1); }
.letter__flower { position: absolute; top: 23px; right: 28px; color: #b8788e; font-size: 30px; opacity: .55; transform: rotate(14deg); }
.letter__date { margin: 0 0 24px; color: rgba(52,42,59,.48); font-family: var(--serif); font-size: .7rem; letter-spacing: .17em; text-transform: uppercase; }
.letter h2 { margin: 0 0 25px; font-family: var(--script); font-size: clamp(2rem,5vw,3rem); font-weight: 400; line-height: 1; }
.typed-letter { min-height: 160px; margin: 0; white-space: pre-wrap; font-family: var(--script); font-size: clamp(1.1rem,2.3vw,1.38rem); line-height: 1.75; }
.typed-letter::after { content: ""; display: inline-block; width: 1px; height: 1.1em; margin-left: 3px; vertical-align: -.13em; background: #6d536d; animation: blink .8s steps(1) infinite; }
.typed-letter.is-complete::after { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.final-message { margin: 25px 0 0; color: #a65e78; font-family: var(--script); font-size: clamp(1.45rem,3vw,2rem); text-align: center; opacity: 0; transform: translateY(10px); transition: opacity .8s, transform .8s; }
.final-message.is-visible { opacity: 1; transform: none; }
.letter__signature { display: block; margin-top: 30px; color: rgba(52,42,59,.62); font-family: var(--script); text-align: right; opacity: 0; transform: translateY(8px); transition: opacity .8s, transform .8s; }
.letter.is-signed .letter__signature { opacity: .8; transform: none; }
.wish-button { margin-top: -23px; z-index: 3; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 29px; border: 1px solid rgba(242,217,165,.58); border-radius: 99px; background: rgba(10,11,29,.88); box-shadow: 0 0 25px rgba(242,217,165,.13); color: var(--cream); cursor: pointer; opacity: 0; transform: translateY(18px); pointer-events: none; transition: opacity 1s, transform 1s, background .35s, box-shadow .35s; }
.wish-button.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.wish-button:hover { background: rgba(47,38,60,.95); box-shadow: 0 0 35px rgba(242,217,165,.3); }
.wish-button span { font-family: var(--serif); font-size: .76rem; letter-spacing: .21em; text-transform: uppercase; }
.wish-button i { color: var(--gold); font-style: normal; }
.wish-button.is-dissolving { opacity: 0; transform: scale(.78); pointer-events: none; filter: blur(7px); }
.wish-heart-scene { position: fixed; z-index: 46; inset: 0; display: grid; place-items: center; padding: calc(var(--safe-top) + 20px) var(--safe-right) calc(var(--safe-bottom) + 12px) var(--safe-left); opacity: 0; pointer-events: none; background: rgba(5,6,18,.34); filter: brightness(1.82); transition: opacity .28s ease; }
.wish-heart-scene[hidden] { display: none; }
.wish-heart-scene.is-active { opacity: 1; }
.wish-heart-scene.is-dissolving { opacity: 0; transition-duration: .42s; }
.wish-heart-scene__art { width: min(540px,88vw); max-height: 78vh; overflow: visible; }
.wish-heart-path { fill: rgba(239,175,192,.025); stroke: url(#wishHeartGradient); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: url(#wishHeartGlow); opacity: .95; }
.wish-heart-star { filter: url(#wishHeartGlow); }
.wish-heart-star circle { fill: rgba(255,248,214,.18); stroke: rgba(255,255,255,.7); stroke-width: 1; }
.wish-heart-star path { fill: #fffdf0; }
.wish-heart-sparkles { opacity: 0; }
.wish-heart-sparkles circle { fill: #fff8d6; filter: url(#wishHeartGlow); transform-box: fill-box; transform-origin: center; }
.wish-heart-scene.is-complete .wish-heart-path { transform-box: fill-box; transform-origin: center; animation: completedHeartPulse .62s cubic-bezier(.2,.8,.2,1) both; }
.wish-heart-scene.is-complete .wish-heart-star { animation: completedStarGlow .62s ease-out both; }
.wish-heart-scene.is-complete .wish-heart-sparkles { opacity: 1; }
.wish-heart-scene.is-complete .wish-heart-sparkles circle { animation: heartSparkleBloom .72s ease-out both; }
.wish-heart-scene.is-complete .wish-heart-sparkles circle:nth-child(2n) { animation-delay: .08s; }
.wish-heart-scene.is-complete .wish-heart-sparkles circle:nth-child(3n) { animation-delay: .16s; }
.wish-heart-scene.is-reduced .wish-heart-path { fill: rgba(239,175,192,.08); }
.wish-heart-scene.is-reduced .wish-heart-star { display: none; }
@keyframes completedHeartPulse { 45% { stroke-width: 6; opacity: 1; transform: scale(1.035); transform-origin: 50% 50%; } }
@keyframes completedStarGlow { 55% { opacity: .35; } 100% { opacity: 0; } }
@keyframes heartSparkleBloom { 0% { opacity: 0; transform: scale(.1); } 45% { opacity: 1; transform: scale(1.5); } 100% { opacity: .45; transform: scale(.8); } }
body.wish-ritual .letter-stage,
body.wish-ritual .finale-moon,
body.wish-ritual .finale-horizon,
body.wish-ritual .finale-tree-wrap { filter: brightness(.55); transition: filter 1.8s; }
body.wish-fulfilled .letter-stage,
body.wish-fulfilled .finale-moon,
body.wish-fulfilled .finale-horizon,
body.wish-fulfilled .finale-tree-wrap { filter: brightness(1); transition: filter .8s; }
body.wish-fulfilled .finale-moon { filter: brightness(1.45); transform: scale(1.04); box-shadow: 0 0 90px rgba(255,248,211,.68),0 0 280px rgba(210,192,239,.4); }
.celebration-message { position: fixed; z-index: 50; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; min-width: 0; padding: calc(var(--safe-top) + 24px) var(--safe-right) calc(var(--safe-bottom) + 24px) var(--safe-left); text-align: center; opacity: 0; overflow: hidden; pointer-events: none; transform: scale(.92); transition: opacity 1.2s, transform 1.4s cubic-bezier(.16,1,.3,1); text-shadow: 0 2px 30px #070714; }
.celebration-message::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at center, rgba(8,7,24,.64), rgba(5,5,17,.9)); }
.celebration-message.is-visible { opacity: 1; transform: scale(1); }
.celebration-message span { color: var(--gold); font-family: var(--serif); font-size: clamp(1rem,2vw,1.4rem); letter-spacing: .25em; text-transform: uppercase; }
.celebration-message strong { display: block; max-width: 100%; margin: 10px 0; color: #fff; font-family: var(--script); font-size: clamp(4rem,12vw,9rem); font-weight: 400; line-height: .9; letter-spacing: -.035em; white-space: nowrap; }
.celebration-message small { max-width: 32rem; color: rgba(255,255,255,.78); font-family: var(--serif); font-size: clamp(.9rem,2vw,1.15rem); font-style: italic; line-height: 1.4; }
.epilogue-star { position: fixed; z-index: 70; right: 8vw; bottom: 13vh; width: 48px; height: 48px; border: 0; background: transparent; color: var(--gold); font-size: 22px; cursor: pointer; text-shadow: 0 0 9px #fff,0 0 24px var(--gold); animation: epilogueBlink 2.2s ease-in-out infinite; }
@keyframes epilogueBlink { 50% { opacity: .3; transform: scale(.72) rotate(25deg); } }
.epilogue { position: fixed; z-index: 150; inset: 50% auto auto 50%; width: min(440px,88vw); max-height: 86vh; overflow: auto; padding: 35px; border: 1px solid rgba(242,217,165,.25); background: rgba(10,10,27,.98); box-shadow: 0 30px 100px rgba(0,0,0,.66),0 0 60px rgba(239,185,195,.1); text-align: center; transform: translate(-50%,-50%); }
.epilogue > p:first-of-type { margin: 0; color: var(--gold); font-family: var(--script); font-size: 1.5rem; }
.epilogue h3 { margin: 7px 0 22px; font-family: var(--serif); font-size: 1.4rem; font-weight: 400; }
.epilogue > p:last-of-type { color: rgba(255,249,237,.72); font-family: var(--serif); font-style: italic; line-height: 1.6; }
.epilogue__close { position: absolute; top: 9px; right: 10px; width: 44px; height: 44px; border: 0; background: none; color: rgba(255,255,255,.65); font-size: 28px; cursor: pointer; }
.epilogue__photo { display: none; aspect-ratio: 4/3; margin-bottom: 20px; background-position: center; background-size: cover; box-shadow: inset 0 0 30px rgba(0,0,0,.4); }
.epilogue__photo.has-photo { display: block; }
.replay-button { min-height: 44px; margin-top: 8px; padding: 0 20px; border: 1px solid rgba(242,217,165,.35); border-radius: 99px; background: transparent; color: var(--gold); cursor: pointer; font-family: var(--serif); font-size: .75rem; letter-spacing: .12em; }

/* Responsive and capability adaptations */
@media (max-width: 1024px) {
  .journey-layout { grid-template-columns: minmax(0,1fr) minmax(250px,34vw); }
  .memory-story { position: static; width: auto; max-width: 400px; margin-top: 20px; padding: 14px 2px 0; border: 0 !important; border-top: 1px solid rgba(77,67,93,.18) !important; border-radius: 0; background: transparent; box-shadow: none; color: #3f354a; opacity: .82; transform: none !important; text-align: left !important; }
  .memory-story::before { display: none; }
  .memory-card:hover .memory-story, .memory-card.is-open .memory-story { opacity: 1; }
  .memory-card { padding-bottom: 24px; }
  .memory-caption { position: static; margin-top: 17px; }
  .memory-card::before { bottom: 30px; }
}
@media (max-width: 700px) {
  .audio-toggle { right: var(--safe-right); padding: 9px; }.audio-toggle span { display: none; }
  .wand { display: none; }
  .phase--entrance { padding: 0; }
  .entrance-copy { top: max(82px,calc(env(safe-area-inset-top) + 64px)); left: max(20px,var(--safe-left)); right: max(20px,var(--safe-right)); }
  .entrance-copy h1 { font-size: clamp(2.15rem,10.5vw,3.35rem); line-height: .99; }
  .entrance-copy h1 em { font-size: .66em; }
  .entrance-hint { max-width: 100%; margin-top: 16px; font-size: clamp(.84rem,3.55vw,.95rem); line-height: 1.42; }
  .constellation { width: 100%; height: min(56dvh,540px); margin-top: 31dvh; }
  .rune { width: 48px; height: 48px; }
  .password-progress { bottom: max(8px,env(safe-area-inset-bottom)); gap: 10px; }
  .scroll-whisper { display: none; }
  .moon { top: 10vh; right: -7vw; width: 39vw; }
  .journey-intro { width: min(86vw,520px); min-height: 100dvh; align-items: flex-start; padding-top: var(--safe-top); padding-bottom: max(13vh,var(--safe-bottom)); }
  .journey-intro h2 { font-size: clamp(2.55rem,12.5vw,4.5rem); }
  .journey-layout { display: block; width: min(90vw,520px); padding-bottom: max(10vh,var(--safe-bottom)); }
  .tree-sanctuary { position: fixed; z-index: 0; top: 14dvh; right: 0; left: 0; width: 100%; height: 72dvh; margin: 0; opacity: .22; padding: 0 0 0 28vw; pointer-events: none; contain: layout paint; }
  .tree-heading, .tree-note { display: none; }
  .timeline { position: relative; z-index: 2; }
  .chapter { min-height: 30vh; }
  .memory { min-height: 84svh; min-height: 84dvh; justify-content: center !important; padding: 5vh 0; }
  .memory-card { width: min(calc(100vw - 32px),420px); }
  .memory-caption { align-items: flex-start; gap: 10px; }
  .memory-caption strong { min-width: 0; line-height: 1.08; }
  .memory-date { max-width: 38%; text-align: right; line-height: 1.3; }
  .memory:nth-of-type(3n) .memory-card, .memory:nth-of-type(5n) .memory-card { --rotation: 2deg; }
  .guide-firefly { left: 3vw; bottom: 7vh; }
  .letter-invitation { width: min(92vw,520px); min-height: 82svh; min-height: 82dvh; padding: 8vh 0 max(13vh,var(--safe-bottom)); }
  .letter-invitation__card { width: 100%; padding: 42px 22px; }
  .letter-invitation .eyebrow { line-height: 1.5; }
  .letter-envelope { width: 132px; height: 87px; }
  .letter-envelope__flap { height: 58px; }
  .letter-envelope__heart { top: 42px; }
  .phase--finale { padding: calc(var(--safe-top) + 62px) var(--safe-right) calc(var(--safe-bottom) + 24px) var(--safe-left); }
  .back-to-memories { top: max(14px,env(safe-area-inset-top)); left: var(--safe-left); padding: 0 13px; }
  .back-to-memories span { font-size: .6rem; }
  .mist { display: none; }
  .parallax-layer { transform: none !important; }
  .finale-moon { top: 5vh; right: -9vw; width: 53vw; }
  .finale-tree-wrap { width: 72vw; left: -22vw; opacity: .28; }
  .letter-stage { width: min(calc(100vw - 32px),520px); max-height: 100%; }
  .letter { width: 100%; min-height: 0; height: min(74dvh,650px); max-height: calc(100dvh - 150px); padding: 44px clamp(26px,7vw,36px) 55px; overscroll-behavior: contain; }
  .letter h2 { font-size: clamp(1.9rem,9.5vw,2.65rem); }
  .typed-letter { min-height: 0; font-size: clamp(1.04rem,4.5vw,1.24rem); line-height: 1.65; }
  .letter__signature { padding-bottom: 15px; }
  .wish-heart-scene__art { width: min(88vw,430px); max-height: min(72dvh,520px); }
  .celebration-message span { font-size: clamp(.78rem,4vw,1rem); letter-spacing: .2em; }
  .celebration-message strong { font-size: clamp(3.1rem,17vw,5.4rem); line-height: .88; }
  .celebration-message small { max-width: 82vw; font-size: clamp(.88rem,3.8vw,1rem); }
  .epilogue-star { right: var(--safe-right); bottom: max(10vh,var(--safe-bottom)); }
  .epilogue { width: min(calc(100vw - 32px),440px); max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px); padding: 34px 24px 28px; overscroll-behavior: contain; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .phase--entrance { height: 100dvh; min-height: 100dvh; padding: 0; }
  .entrance-copy { top: max(22px,calc(env(safe-area-inset-top) + 12px)); left: max(28px,calc(env(safe-area-inset-left) + 18px)); right: auto; width: min(47vw,440px); max-width: none; }
  .entrance-copy .eyebrow { margin-bottom: 12px; font-size: .58rem; }
  .entrance-copy h1 { font-size: clamp(2rem,4.6vw,3rem); line-height: .94; }
  .entrance-copy h1 em { margin-top: .12em; font-size: .67em; }
  .entrance-hint { max-width: 390px; margin-top: 13px; font-size: clamp(.78rem,1.5vw,.88rem); line-height: 1.34; }
  .constellation { position: absolute; top: max(42px,calc(env(safe-area-inset-top) + 24px)); right: max(8px,env(safe-area-inset-right)); width: 51vw; height: calc(100dvh - 54px - env(safe-area-inset-bottom)); margin: 0; }
  .password-progress { bottom: max(7px,env(safe-area-inset-bottom)); }
  .scroll-whisper { display: none; }
  .audio-toggle { top: max(10px,env(safe-area-inset-top)); right: max(10px,env(safe-area-inset-right)); padding: 9px; }
  .audio-toggle span { display: none; }
  .journey-intro { min-height: 100dvh; width: min(88vw,760px); padding: calc(var(--safe-top) + 20px) 0 var(--safe-bottom); }
  .journey-intro h2 { max-width: 72vw; font-size: clamp(2.4rem,7vw,4rem); }
  .journey-intro > p:last-of-type { margin-top: 18px; line-height: 1.5; }
  .journey-intro__line { display: none; }
  .phase--finale { height: 100dvh; min-height: 100dvh; padding: calc(var(--safe-top) + 18px) var(--safe-right) var(--safe-bottom) var(--safe-left); }
  .back-to-memories { top: max(10px,env(safe-area-inset-top)); left: var(--safe-left); min-height: 44px; padding: 0 12px; }
  .back-to-memories span { display: none; }
  .letter-stage { position: absolute; top: 50%; left: 50%; width: min(68vw,610px); height: auto; align-content: initial; transform: translate(-50%,-50%); }
  .letter { min-height: 0; height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 36px); max-height: 340px; padding: 30px clamp(34px,6vw,58px) 44px; }
  .letter__flower { top: 14px; right: 20px; font-size: 23px; }
  .letter__date { margin-bottom: 13px; font-size: .62rem; }
  .letter h2 { margin-bottom: 16px; font-size: clamp(1.7rem,4vw,2.3rem); }
  .typed-letter { min-height: 0; font-size: clamp(.94rem,2.2vw,1.12rem); line-height: 1.55; }
  .final-message { margin-top: 18px; font-size: clamp(1.25rem,3vw,1.7rem); }
  .letter__signature { margin-top: 20px; }
  .wish-button { min-height: 48px; margin-top: -18px; }
  .wish-heart-scene__art { width: min(52vw,390px); max-height: 84dvh; }
  .celebration-message span { font-size: clamp(.76rem,2vw,1rem); }
  .celebration-message strong { font-size: clamp(3.2rem,11vw,6rem); }
  .celebration-message small { font-size: clamp(.82rem,1.8vw,1rem); }
  .epilogue { width: min(66vw,520px); max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px); padding: 26px 30px 22px; }
}

@media (hover: none), (pointer: coarse) {
  .grain { animation: none; }
  .memory-card { cursor: pointer; }
  .memory-card:hover { transform: translate3d(0,0,0) rotate(var(--rotation)) scale(1) !important; box-shadow: 0 25px 70px rgba(0,0,0,.4), 0 0 0 1px rgba(242,217,165,.08), 0 0 60px rgba(217,177,195,.08); }
  .memory-card.is-open { transform: translate3d(0,-4px,0) rotate(calc(var(--rotation) * .7)) scale(1.006) !important; }
  .memory-card:hover img { transform: scale(1.012); }
  .memory-card.is-open img { transform: scale(1.035); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .18s !important; }
  .wand, .grain { display: none; }
  .parallax-layer { transform: none !important; }
  .memory-card { transform: none; }
  .memory { opacity: 1; }
}
