@font-face{font-family:Instrument Serif;src:url('/instrument-serif.woff2') format('woff2');font-style:normal;font-display:swap}
@font-face{font-family:Instrument Serif;src:url('/instrument-serif-italic.woff2') format('woff2');font-style:italic;font-display:swap}
@font-face{font-family:Instrument Sans;src:url('/instrument-sans.woff2') format('woff2');font-weight:400 700;font-display:swap}

:root {
  color-scheme: dark;
  --night: #0a0b13;
  --ink: #f2ecdf;
  --muted: #c0bcc7;
  --gold: #e8c38e;
  --line: rgba(237, 207, 165, .24);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --pan-x: 0px;
  --pan-y: 0px;
  --story-curve: cubic-bezier(.2,.72,.23,1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--night); font-family: var(--sans); }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #ffdeaa; outline-offset: 4px; }

.night {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 73% 28%, #111f35 0%, transparent 51%),
    radial-gradient(ellipse at 13% 100%, #1a1627 0%, transparent 58%), #0a0b13;
}
.night::before {
  content: ''; position: absolute; inset: -25%; transform-origin: 60% center;
  background: radial-gradient(ellipse at 73% 29%, #47324a54, transparent 34%), radial-gradient(ellipse at 23% 73%, #253c6260, transparent 39%);
  animation: sky-drift 19s ease-in-out infinite alternate;
}
.night::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 52% 48%, transparent 42%, #05050999 100%); }
.stars { position: absolute; inset: -12px; transform: translate(var(--pan-x), var(--pan-y)); transition: transform .38s var(--story-curve); }
.star { position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); border-radius: 50%; background: #fff1db; opacity: var(--opacity); }
.star:nth-child(5n) { animation: twinkle var(--duration) var(--delay) ease-in-out infinite alternate; box-shadow: 0 0 7px #edcd9c70; }
.meteor { position: absolute; width: 117px; height: 1px; top: 22%; left: 80%; transform: rotate(-28deg); background: linear-gradient(90deg, #ffedcf, transparent 84%); box-shadow: -3px 0 9px #ffcf97a1; opacity: 0; animation: meteor 12s .4s infinite; }
.meteor-alt { top: 49%; left: 29%; width: 72px; animation-duration: 16s; animation-delay: 5.5s; }
@keyframes twinkle { to { opacity: .82; } }
@keyframes meteor { 0% { opacity: 0; } 2.5% { opacity: .85; } 11%, 100% { translate: -178px 98px; opacity: 0; } }
@keyframes sky-drift { from { transform: translate(-3%,-1%) rotate(-4deg); opacity: .39; } to { transform: translate(5%,3%) rotate(5deg); opacity: .9; } }

.shell { position: relative; width: min(100%, 1410px); margin: auto; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding-inline: clamp(22px, 6.3vw, 94px); }
.masthead, .footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead { min-height: 98px; border-bottom: 1px solid var(--line); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: clamp(10px, 2.3vw, 30px); }
.wordmark { display: inline-flex; align-items: center; gap: 13px; font-size: .78rem; letter-spacing: .22em; font-weight: 670; }
.wordmark small { display: block; margin-top: 5px; color: var(--gold); font-size: .52rem; font-weight: 500; letter-spacing: .18em; }
.orbit-mark { width: 28px; height: 28px; position: relative; display: inline-block; border: 1px solid var(--gold); border-radius: 50%; transform: rotate(-33deg); }
.orbit-mark::before { content: ''; position: absolute; background: var(--gold); inset: 8px; border-radius: 50%; box-shadow: 0 0 10px #e8c38e70; }
.orbit-mark::after { content: ''; position: absolute; inset: 8px -5px; border: 1px solid var(--gold); border-radius: 50%; }
.music-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 6px 10px; background: #171422bf; border: 1px solid var(--line); border-radius: 30px; color: var(--gold); white-space: nowrap; cursor: pointer; font-size: .78rem; transition: border-color .2s, background .2s; }
.music-toggle:hover, .music-toggle[aria-pressed=true] { border-color: #e3be859c; background: #261d2b; }
.music-wave { display: inline-flex; gap: 2px; align-items: center; justify-content: center; width: 12px; height: 16px; }
.music-wave i { display: block; width: 2px; height: 10px; border-radius: 1px; background: currentColor; transform: scaleY(.42); }
.music-wave i:nth-child(2) { transform: scaleY(.85); }
.music-toggle[aria-pressed=true] i { animation: sound-wave .8s ease-in-out infinite alternate; }
.music-toggle[aria-pressed=true] i:nth-child(2) { animation-delay: -.4s; }
.music-toggle[aria-pressed=true] i:nth-child(3) { animation-delay: -.6s; }
@keyframes sound-wave { to { transform: scaleY(1.35); } }
.footer { padding-block: 20px 26px; min-height: 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.demo-tools { display: flex; align-items: center; gap: 12px; color: var(--gold); }
.demo-restart { border: 0; background: none; color: var(--gold); min-height: 36px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }

.progress { display: flex; list-style: none; padding: 0; margin: 0; gap: clamp(13px, 2vw, 28px); }
.progress li { display: flex; align-items: center; gap: 7px; color: #a9a3b1; font-size: .75rem; }
.progress li::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; border: 1px solid #a9a3b1; }
.progress [aria-current=step] { color: var(--gold); }
.progress [aria-current=step]::before, .progress .complete::before { background: var(--gold); border-color: var(--gold); }
.progress [aria-current=step]::before { box-shadow: 0 0 12px var(--gold); }
.progress [aria-current=step]::before { animation: point-pulse 2.8s ease-in-out infinite alternate; }
@keyframes point-pulse { to { box-shadow: 0 0 6px 2px #ffdfa569; } }

.scene { min-width: 0; display: grid; align-items: center; }
.cover { position: relative; display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr); align-items: center; min-height: min(660px, 72vh); isolation: isolate; column-gap: 14px; }
.cover-copy { z-index: 1; margin-block: 76px; }
.cover-copy h1, .cover-copy .lede, .gate-form { animation: story-in .8s var(--story-curve) both; }
.cover-copy .lede { animation-delay: .13s; }
.gate-form { animation-delay: .24s; }
h1 { font-family: var(--serif); font-weight: 400; color: var(--ink); margin: 0; line-height: .99; letter-spacing: -.035em; font-size: clamp(3.2rem, 7.4vw, 6.7rem); text-wrap: balance; }
h1 em { color: var(--gold); font-weight: 400; }
.cover h1 { white-space: nowrap; font-size: clamp(4rem, 8.6vw, 8.85rem); }
.lede { color: var(--muted); font-size: clamp(.98rem, 1.45vw, 1.22rem); max-width: 36ch; line-height: 1.65; margin: 22px 0 0; }
.gate-form { max-width: 510px; margin-top: 20px; }
.gate-code-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.gate-form label { display: block; margin: 0 0 9px; color: #eee2d2; font-size: .86rem; }
.gate-row { display: flex; gap: 10px; }
.gate-row input { background: #11101ccc; border: 1px solid #6a586e; border-radius: 9px; padding: 13px 15px; min-height: 52px; flex: 1; width: 100%; color: var(--ink); font-size: max(16px, 1rem); }
.gate-code-fields:disabled .gate-row input { background: #1a1725; border-color: #554b60; color: #c6bdca; opacity: 1; cursor: not-allowed; }
.gate-code-fields:disabled .gate-row .button { color: #e0d3c4; background: #3b303c; border-color: #776478; opacity: 1; cursor: not-allowed; }
input::placeholder { color: #b0a8b8; opacity: 1; }
.button { display: inline-flex; min-height: 50px; gap: 13px; justify-content: center; align-items: center; padding: 12px 18px; border: 1px solid #e2bb83; border-radius: 9px; background: #ebc791; color: #241722; font-weight: 670; font-size: .9rem; cursor: pointer; text-align: center; transition: background .22s, box-shadow .22s, translate .22s; }
.button:hover:not(:disabled) { background: #ffe0ae; box-shadow: 0 6px 26px #e5b77c31; translate: 0 -2px; }
.button:disabled { opacity: .7; cursor: wait; }
.button span { font-size: 1rem; line-height: 1; }
.button > span[aria-hidden] { transition: transform .24s var(--story-curve); }
.button:hover:not(:disabled) > span[aria-hidden] { transform: translate(2px, -2px); }
.button:active:not(:disabled) { translate: 0 0; scale: .98; }
.secondary { background: #161220; color: var(--gold); }
.secondary:hover:not(:disabled) { background: #231e2a; }
.feedback { color: #ffd5c4; font-size: .9rem; line-height: 1.48; margin: 12px 0 0; }
.cover-music-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 24px; }
.cover-music-control .music-toggle { min-height: 44px; padding-inline: 14px; font-size: .86rem; }
.cover-music-gate-note, .cover-music-status { margin: 0; color: #d2c8d6; font-size: .84rem; line-height: 1.45; }
.cover-music-status { flex-basis: 100%; }

.cover-constellation { width: min(100%, 620px); justify-self: center; text-align: center; }
.cover-sky { position: relative; }
.cover-sky::before, .cover-sky::after {
  content: ''; position: absolute; z-index: 1; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, #fae2b1a8, #f5dca62c 55%, #fae2b1a8);
  box-shadow: 0 0 8px #ffd79982; transform-origin: left center;
  opacity: 0; scale: 0 1; transition: opacity .45s, scale .55s var(--story-curve);
}
.cover-sky::before { top: 14%; left: 30%; width: 53.4%; transform: rotate(13deg); }
.cover-sky::after { top: 26%; left: 82%; width: 59.03%; transform: rotate(100.74deg); }
.cover-constellation.is-complete .cover-sky::before,
.cover-constellation.is-complete .cover-sky::after { opacity: .82; scale: 1 1; }
.cover-constellation.is-complete .cover-sky::after { transition-delay: .12s; }
.cover-star {
  position: absolute; z-index: 2; left: var(--star-x); top: var(--star-y); translate: -50% -50%;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid #d5b3846e; border-radius: 50%; background: #171729e8; color: #f1d2ad;
  font-size: 1.35rem; line-height: 1; cursor: pointer;
  transition: color .3s, background .3s, border-color .3s, box-shadow .3s, scale .3s var(--story-curve);
}
.cover-star[data-cover-star="1"] { --star-x: 30%; --star-y: 14%; }
.cover-star[data-cover-star="2"] { --star-x: 82%; --star-y: 26%; }
.cover-star[data-cover-star="3"] { --star-x: 71%; --star-y: 84%; }
.cover-star:hover, .cover-star:focus-visible { border-color: #ffe0ae; scale: 1.08; }
.cover-star:active { scale: .96; }
.cover-star.is-lit { border-color: #fbdb9b; background: #f4d098; color: #352235; box-shadow: 0 0 24px #f0c2788c; }
.cover-star.is-lit span { animation: constellation-star-light .46s var(--story-curve) both; }
@keyframes constellation-star-light { 40% { transform: scale(1.7) rotate(24deg); } to { transform: scale(1); } }
.constellation-caption { max-width: 39ch; margin: -9px auto 0; color: #e3d8e5; font-size: .9rem; line-height: 1.45; }
.constellation-caption p { margin: 0; }
.constellation-caption .constellation-status { margin-top: 6px; color: #eac793; font-size: .79rem; }

.earth { width: 100%; aspect-ratio: 1; position: relative; isolation: isolate; transform: translate(calc(var(--pan-x) * -.7), calc(var(--pan-y) * -.7)); transition: transform .5s var(--story-curve); }
.earth-globe, .earth-orbit, .earth-halo { position: absolute; border-radius: 50%; }
.earth-halo { inset: 4%; z-index: -3; background: radial-gradient(circle, #6489b64a 19%, #2a61734d 45%, transparent 71%); animation: halo-breathe 8s ease-in-out infinite alternate; }
@keyframes halo-breathe { from { scale: .91; opacity: .48; } to { scale: 1.12; opacity: .9; } }
.earth-globe {
  inset: 13%; overflow: hidden; isolation: isolate; background: #123858;
  box-shadow: 0 0 1px 1px #9cd9fc81, 0 0 30px #66bdf088, 0 12px 85px #2674aa69;
  animation: earth-float 10s ease-in-out infinite alternate;
}
.earth-globe::before { content: ''; position: absolute; inset: -2%; border-radius: inherit; background: url('/media/earth-asia.webp') center / cover no-repeat; animation: earth-turn 22s ease-in-out infinite alternate; }
.earth-globe::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 7px 6px 15px #bce8fd58, inset -18px -22px 52px #060d21b3; background: linear-gradient(137deg, #cdf1fa1f, transparent 49%, #04091c4d 77%, #04091cb0); }
@keyframes earth-float { from { translate: 0 4px; } to { translate: 0 -8px; } }
@keyframes earth-turn { from { transform: rotate(-7deg); } to { transform: rotate(8deg); } }
.earth-orbit { z-index: -2; border: 1px solid #b6d8f459; }
.earth-orbit-inner { inset: 6%; transform: rotate(-23deg) scaleY(.76); animation: orbit-inner 13s ease-in-out infinite alternate; }
.earth-orbit-outer { inset: 2%; transform: rotate(25deg) scaleY(.84); border-style: dashed; opacity: .53; animation: orbit-outer 17s ease-in-out infinite alternate; }
.earth-satellite { position: absolute; inset: 7%; border-radius: 50%; animation: satellite 24s linear infinite; }
.earth-satellite::after { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff0cc; box-shadow: 0 0 16px 3px #eeb97565; top: 0; left: calc(50% - 2px); }
@keyframes orbit-inner { to { transform: rotate(-44deg) scaleY(.88); } }
@keyframes orbit-outer { to { transform: rotate(51deg) scaleY(.67); } }
@keyframes satellite { from { transform: rotate(0) scaleY(.92); } to { transform: rotate(360deg) scaleY(.92); } }
@keyframes spark-breathe { from { opacity: .42; scale: .82; } to { opacity: 1; scale: 1.14; } }

.chapter { position: relative; padding-block: clamp(45px, 8vw, 100px); animation: arrival .58s var(--story-curve) both; }
@keyframes arrival { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes story-in { from { opacity: 0; transform: translateY(19px); } to { opacity: 1; transform: translateY(0); } }
.welcome-stage { display: grid; place-items: center; min-height: min(670px, 73vh); isolation: isolate; text-align: center; }
.welcome-sky { position: absolute; z-index: -1; width: min(850px, 100%); aspect-ratio: 1.4; left: 50%; top: 49%; overflow: clip; transform: translate(calc(-50% + var(--pan-x)), calc(-50% + var(--pan-y))); transition: transform .5s var(--story-curve); pointer-events: none; }
.welcome-earth { position: absolute; border-radius: 50%; inset: -20% 0; background: url('/media/earth-asia.webp') center / contain no-repeat; mask-image: radial-gradient(ellipse, #000 15%, #000b 35%, transparent 65%); opacity: .52; animation: earth-float 10s ease-in-out infinite alternate; }
.welcome-orbit { position: absolute; border-radius: 50%; border: 1px solid #f3cc916e; inset: 9% 13%; animation: welcome-orbit 12s ease-in-out infinite alternate; }
.welcome-orbit-inner { --tilt: -18deg; --orbit-scale: .75; }
.welcome-orbit-outer { --tilt: 22deg; --orbit-scale: .96; border-style: dashed; inset: 2% 9%; animation-delay: -4s; }
.welcome-spark { position: absolute; color: #ffdda6; font-size: 1.25rem; text-shadow: 0 0 18px #f6bc70ce; animation: spark-breathe 3s ease-in-out infinite alternate; }
.welcome-spark-left { left: 17%; top: 40%; }
.welcome-spark-right { right: 14%; bottom: 30%; animation-delay: -1s; }
.birthday-portal { display: block; color: #f2eafa; font-size: 3.5rem; text-shadow: 0 0 25px #b6e7ff9e; }
.is-opening-birthday .birthday-portal { animation: birthday-portal .46s var(--story-curve) both; }
@keyframes birthday-portal { from { opacity: .4; scale: .7; } to { opacity: 1; scale: 2.1; } }
.birthday-stage {
  --sky-height: clamp(370px, 61svh, 590px);
  --globe-size: clamp(200px, 40svh, 386px);
  display: grid; justify-items: center; isolation: isolate; width: min(100%, 1100px);
  margin-inline: auto; text-align: center; padding-block: 8px 32px;
}
.birthday-copy { display: contents; }
.birthday-sky { position: relative; width: 100%; height: var(--sky-height); overflow: clip; }
.birthday-sky::before {
  content: ''; position: absolute; inset: 4% 7%; z-index: -1;
  background: radial-gradient(ellipse at 50% 58%, #85c4f828, #35476527 28%, transparent 67%);
  animation: halo-breathe 7s ease-in-out infinite alternate;
}
.birthday-title {
  position: absolute; top: 8px; left: 0; width: 100%; height: var(--sky-height);
  font-size: unset; letter-spacing: normal; color: #f8f2eb; text-align: center; pointer-events: none;
}
.birthday-title span { position: absolute; left: 0; right: 0; display: block; }
.birthday-kicker {
  top: 9%; color: #f1eadf; font: 620 clamp(.75rem, 1.6vw, 1rem)/1.3 var(--sans);
  letter-spacing: .31em; text-transform: uppercase; animation: story-in .78s .1s var(--story-curve) both;
}
.birthday-name {
  top: 53%; z-index: 2; transform: translateY(-50%);
  font: italic 400 clamp(6.9rem, 19vw, 15rem)/.72 var(--serif);
  letter-spacing: -.055em; color: #fff2de; text-shadow: 0 4px 22px #061123be, 0 0 30px #b6daef55;
  animation: birthday-type 1.25s .18s var(--story-curve) both;
}
.birthday-age {
  bottom: 4%; z-index: 2; font: 400 clamp(3rem, 8vw, 5.75rem)/.86 var(--serif);
  color: #f3ce94; letter-spacing: -.05em; text-shadow: 0 2px 16px #061123cc;
  animation: story-in .8s .38s var(--story-curve) both;
}
.birthday-earth {
  position: absolute; z-index: 1; width: var(--globe-size); aspect-ratio: 1; left: 50%; top: 54%;
  translate: -50% -50%; border-radius: 50%; isolation: isolate; overflow: hidden;
  background: #10314f; box-shadow: 0 0 1px 1px #a0dafa88, 0 0 33px #70bdf2a3, 0 0 94px #3c7bcb55;
  animation: birthday-rise 1.25s var(--story-curve) both;
}
.birthday-earth::before {
  content: ''; position: absolute; inset: -2%; background: url('/media/earth-asia.webp') center/cover no-repeat;
  animation: earth-turn 22s ease-in-out infinite alternate;
}
.birthday-earth::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(140deg, #caefff12, transparent 49%, #050c215b);
  box-shadow: inset 7px 7px 17px #bde7ff5f, inset -15px -19px 45px #070b20a1;
}
.birthday-light {
  --fly-x: min(44vw, 410px); --fly-y: -156px; --fly-angle: 156deg;
  position: absolute; z-index: 2; left: 50%; top: 54%; width: clamp(41px, 9vw, 101px); height: 2px;
  border-radius: 100%; font-size: 0; background: linear-gradient(90deg, transparent, #e6f4ff9c 69%, #fff 96%);
  box-shadow: 0 0 7px #bfe6ffaf; pointer-events: none;
  animation: white-flight 5.1s .06s cubic-bezier(.49,.09,.27,1) infinite both;
}
.birthday-light::after { content: ''; position: absolute; right: 0; top: -1px; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 11px 2px #fff; }
.birthday-light:nth-of-type(2) { --fly-x: max(-45vw, -420px); --fly-y: -115px; --fly-angle: 16deg; animation-delay: .88s; }
.birthday-light:nth-of-type(3) { --fly-x: min(45vw, 422px); --fly-y: 129px; --fly-angle: 199deg; animation-delay: 1.73s; }
.birthday-light:nth-of-type(4) { --fly-x: max(-42vw, -390px); --fly-y: 184px; --fly-angle: -27deg; animation-delay: 2.57s; }
.birthday-light:nth-of-type(5) { --fly-x: min(26vw, 290px); --fly-y: -226px; --fly-angle: 132deg; animation-delay: 3.41s; }
.birthday-stage #begin-puzzles { margin-top: 3px; }
.birthday-stage .feedback { grid-column: 1; }
@keyframes birthday-type { from { opacity: 0; translate: 0 15px; } to { opacity: 1; translate: 0 0; } }
@keyframes birthday-rise { from { opacity: 0; scale: .83; } to { opacity: 1; scale: 1; } }
@keyframes white-flight {
  0%, 40%, 100% { opacity: 0; }
  0% { transform: translate(var(--fly-x), var(--fly-y)) rotate(var(--fly-angle)) scaleX(.55); }
  10%, 27% { opacity: .98; }
  40%, 100% { transform: translate(-50%, 0) rotate(var(--fly-angle)) scaleX(.16); }
}

.welcome-dialog {
  width: min(585px, calc(100% - 32px)); max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px);
  padding: 0; margin: auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; text-align: left; color: var(--ink);
  border: 1px solid #eac08b8a; border-radius: 19px; background: #161121;
  box-shadow: 0 26px 95px #030308bd, inset 0 1px 0 #f3cc9133;
}
.welcome-dialog[open] { animation: intro-open .64s var(--story-curve) both; }
.welcome-dialog::backdrop { background: #08060fb0; backdrop-filter: blur(7px); animation: curtain-in .54s ease-out both; }
.welcome-dialog[open].is-closing { animation: intro-close .46s cubic-bezier(.56,.03,.83,.69) both; pointer-events: none; overflow: hidden; }
.welcome-dialog.is-closing::backdrop { animation: curtain-out .46s ease-out both; }
@keyframes intro-open { from { opacity: 0; transform: translateY(22px) scale(.88); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes curtain-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes curtain-out { to { opacity: 0; } }
@keyframes intro-close { to { opacity: 0; transform: translateY(-32px) scale(.23); } }

.intro-panel {
  position: relative; min-height: 390px; isolation: isolate;
  padding: clamp(20px, 5vw, 42px);
  background: radial-gradient(ellipse at 100% 38%, #50405290, transparent 65%), #151122;
}
.intro-meta, .intro-nav { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.intro-meta { justify-content: space-between; margin-bottom: clamp(18px, 5vh, 38px); }
.intro-count { margin: 0; color: #f0c892; font-size: .73rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.intro-page { position: relative; isolation: isolate; min-height: 215px; }
.intro-page:not([hidden]) { animation: intro-page-in .4s var(--story-curve) both; }
@keyframes intro-page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.intro-page h2 { position: relative; margin: 0; font: 400 clamp(2.7rem, 7.5vw, 4.7rem)/.99 var(--serif); letter-spacing: -.03em; }
.intro-page h2 em { color: var(--gold); }
.intro-hello h2 em { display: block; font-size: 1.29em; }
.intro-page .lede { color: #e0d7e0; margin-top: 15px; max-width: 43ch; }
.intro-page .eyebrow { margin-bottom: 12px; }
.intro-earth {
  position: absolute; right: -7%; top: -17%; z-index: -1; width: min(73%, 325px); aspect-ratio: 1;
  border-radius: 50%; opacity: .5; background: url('/media/earth-asia.webp') center / cover no-repeat;
  mask-image: radial-gradient(circle at 65% 45%, #000 14%, #0006 48%, transparent 74%);
  animation: earth-float 9s ease-in-out infinite alternate;
}
.intro-flare { display: inline-block; color: var(--gold); margin-bottom: 11px; font-size: 1.35rem; text-shadow: 0 0 20px #e8c38ecf; animation: spark-breathe 5s ease-in-out infinite alternate; }
.intro-why h2 { font-size: clamp(2.45rem, 7.5vw, 4rem); }
.welcome-geo { margin: 17px 0 0; }
.geo-image { position: relative; isolation: isolate; aspect-ratio: 2.05; overflow: hidden; border: 1px solid #b9d9ec48; border-radius: 12px; background: #081322; }
.geo-image::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 34px #05081098; border-radius: inherit; }
.geo-layer { position: absolute; display: block; inset: 0; background-position: center; background-repeat: no-repeat; background-size: cover; }
.geo-earth { background: url('/media/earth-asia.webp') center 45% / auto 84% no-repeat; animation: geo-globe 1.72s ease-in-out both; }
.geo-indonesia { background-image: url('/media/indonesia.webp'); transform-origin: 32.4% 72%; animation: geo-region 3.9s ease-in-out both; }
.geo-jakarta { background-image: url('/media/jakarta-selatan.webp'); transform-origin: 47.7% 65%; animation: geo-city 1.42s 1.9s var(--story-curve) both; }
.geo-pin {
  position: absolute; z-index: 2; left: 47.7%; top: 65%;
  width: 9px; height: 9px; border-radius: 50%; background: #ffe0a8;
  box-shadow: 0 0 13px 4px #f5c071a0; translate: -50% -50%;
  animation: geo-pin-in .45s 2.75s both;
}
.geo-pin::after { content: ''; position: absolute; inset: -8px; border: 1px solid #ffe0a8; border-radius: inherit; animation: geo-pin-pulse 2.5s 3.15s ease-out infinite; }
.geo-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 11px; margin-top: 8px; color: #dadfea; font-size: .78rem; }
.geo-location-jakarta { color: #ffe0ad; font-weight: 650; animation: geo-words .55s 2.1s var(--story-curve) both; }
.geo-location-indonesia { animation: geo-words .45s .55s var(--story-curve) both; }
.geo-location-jakarta::before { content: '›'; margin-right: 11px; color: #bbc7d0; font-weight: 400; }
.geo-credit { flex-basis: 100%; margin: 0; color: #c6c4d1; font-size: .66rem; line-height: 1.4; }
.geo-credit a { color: inherit; text-underline-offset: 2px; }
.intro-dedication { margin: 14px 0 0; color: #f3e9df; font: 400 clamp(1.42rem, 4.2vw, 2rem)/1.12 var(--serif); text-wrap: pretty; animation: geo-words .7s 1.65s var(--story-curve) both; }
.intro-dedication em { color: var(--gold); }
@keyframes geo-globe { from { opacity: 1; transform: scale(.9); } 46% { opacity: 1; } to { opacity: 0; transform: scale(2.25); } }
@keyframes geo-region { 0%, 12% { opacity: 0; transform: scale(.94); } 33%, 55% { opacity: 1; } 78%, 100% { opacity: 0; transform: scale(1.53); } }
@keyframes geo-city { from { opacity: 0; transform: scale(1.48); } to { opacity: 1; transform: scale(1); } }
@keyframes geo-pin-in { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes geo-pin-pulse { 0% { opacity: .82; scale: .45; } 85%, 100% { opacity: 0; scale: 1.55; } }
@keyframes geo-words { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.intro-route h2 { font-size: clamp(2.45rem, 6vw, 3.8rem); }
.intro-route-list { list-style: none; margin: 15px 0 0; padding: 0; }
.intro-route-list li {
  display: grid; grid-template-columns: auto minmax(72px, 1.1fr) minmax(0, 3fr); align-items: baseline; gap: 9px;
  padding: 8px 0; border-top: 1px solid #dfc2b33b; font-size: .87rem; line-height: 1.42;
}
.intro-route-list li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px #efbd7bb8; }
.intro-route-list strong { color: #ffdbab; font-weight: 640; }
.intro-route-list span { color: #ded4e1; }
.intro-wish { margin-top: 17px; }
.intro-wish label { display: block; margin-bottom: 8px; color: #ffdfaf; font-size: .9rem; font-weight: 630; }
.intro-wish textarea { display: block; width: 100%; min-height: 86px; padding: 11px 13px; resize: vertical; border: 1px solid #987c96; border-radius: 9px; background: #0e0d1833; color: var(--ink); font-size: 1rem; line-height: 1.42; }
.intro-wish textarea::placeholder { color: #bfb3c5; opacity: 1; }
.intro-restart { margin-right: auto; }
.intro-nav { justify-content: flex-end; margin-top: clamp(16px, 5vh, 29px); }
.intro-nav .button { min-height: 48px; }
.intro-panel > .feedback { text-align: right; }
@keyframes welcome-orbit { from { transform: rotate(var(--tilt)) scaleY(var(--orbit-scale)); opacity: .23; } to { transform: rotate(calc(var(--tilt) + 19deg)) scaleY(calc(var(--orbit-scale) * .85)); opacity: .83; } }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .2em; font-weight: 560; font-size: .72rem; margin: 0 0 16px; }
.reply-stage { display: grid; align-items: center; column-gap: clamp(24px, 7vw, 105px); }
.portrait { align-self: center; position: relative; isolation: isolate; margin: 0 auto; padding: 9px; border: 1px solid #ddb78a68; border-radius: 2px; background: #110f1966; box-shadow: 0 24px 65px #040409a6; max-width: 388px; width: 100%; }
.portrait::before { content: ''; position: absolute; inset: -13px; border: 1px solid #debb8532; z-index: -1; }
.portrait img { display: block; height: auto; width: 100%; max-height: 60vh; object-fit: cover; }
.portrait-reply { transform: rotate(-1.5deg); max-width: 314px; }
.portrait-reply img { max-height: 65vh; object-fit: contain; }
.portrait { animation: portrait-arrival .95s .13s var(--story-curve) both, portrait-float 6s 1.12s ease-in-out infinite alternate; }
.portrait::after { content: ''; pointer-events: none; position: absolute; inset: 0; border: 1px solid #ffe6a7; opacity: 0; animation: frame-light 1.25s .25s ease-out both; }
.reply-copy > *, .film-copy > *, .final-stage > :not(.motion-burst):not(.lock-code), .puzzle-card > *, #puzzle-form > .button { animation: story-in .66s var(--story-curve) both; }
.reply-copy h1, .film-copy h1, .final-stage h1, .puzzle-card h1 { animation-delay: .09s !important; }
.reply-copy .lede, .film-copy .lede, .final-stage .lede, .puzzle-card .lede { animation-delay: .17s !important; }
.reply-copy .button { animation-delay: .38s; }
@keyframes portrait-arrival { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } }
@keyframes portrait-float { from { translate: 0 0; } to { translate: 0 -7px; } }
@keyframes frame-light { 35% { opacity: .73; } to { opacity: 0; } }
.reply-stage { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); }
.reply-copy h1 { font-size: clamp(3.7rem, 7vw, 6.5rem); }
.reply-copy .button { margin-top: 27px; }

.puzzle-stage { width: min(100%, 760px); margin-inline: auto; }
.puzzle-card { padding: clamp(23px, 5.4vw, 64px); border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(ellipse at top right, #30243c74, transparent 62%), #13111cce; box-shadow: 0 25px 90px #07060caa; }
.puzzle-card h1 { font-size: clamp(3.4rem, 6.6vw, 5.45rem); }
.puzzle-card .lede { margin: 18px 0 25px; }
.letters { --cell: clamp(24px, 7.55vw, 43px); display: flex; flex-wrap: wrap; column-gap: 20px; row-gap: 10px; margin-block: 0 27px; }
.letter-word { display: flex; gap: clamp(2px, 1vw, 6px); }
.letter-cell { width: var(--cell); height: clamp(38px, 7vw, 52px); display: grid; place-items: center; border: 1px solid #715c78; border-radius: 5px; background: #0d0c17; color: var(--ink); font-size: clamp(1rem, 2.5vw, 1.23rem); font-weight: 650; padding: 0; text-align: center; text-transform: uppercase; }
.letter-cell:focus { border-color: var(--gold); outline-offset: 2px; }
.letter-cell.fixed { color: var(--gold); background: #342438; border-color: #866a64; }
.letter-cell { transition: border-color .2s, background .2s, translate .22s var(--story-curve); animation: arrival .53s var(--story-curve) both; animation-delay: .24s; }
.letter-cell:nth-child(2n) { animation-delay: .31s; }
.letter-cell:nth-child(3n) { animation-delay: .38s; }
.letter-cell:nth-child(5n) { animation-delay: .45s; }
.letter-cell.is-filled { background: #261d2b; border-color: var(--gold); }
.is-mistake { animation: wrong-answer .42s ease-out both; }
@keyframes wrong-answer { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } to { transform: translateX(0); } }

.film-stage { display: grid; width: min(100%, 880px); margin-inline: auto; text-align: center; justify-items: center; }
.film-stage h1 { font-size: clamp(3.15rem, 7vw, 5.55rem); }
.film-stage .lede { margin: 17px auto 24px; max-width: 48ch; }
.film-frame { width: 100%; min-height: min(360px, 50vw); display: grid; place-items: center; position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: radial-gradient(ellipse at center, #282035 0%, #0c0c15 76%); }
.film-frame { animation: arrival .68s .2s var(--story-curve) both; }
.film-frame:not(:has(video:not([hidden])))::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, #d5a06640, transparent 62%); pointer-events: none; animation: halo-breathe 5s ease-in-out infinite alternate; }
.film-placeholder { z-index: 1; }
.film-placeholder span { display: inline-block; animation: spark-breathe 4s ease-in-out infinite alternate; }
.film-play { z-index: 1; }
.film-frame video { display: block; width: 100%; max-height: 65vh; min-height: 0; background: #06060a; }
.film-placeholder { padding: 28px; max-width: 55ch; color: var(--muted); line-height: 1.6; }
.film-placeholder span { font-size: 2.7rem; color: var(--gold); text-shadow: 0 0 20px #f4d6a772; }
.film-play { margin-bottom: 30px; }
#film-retry { margin-top: 19px; }

.candle-stage {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center;
  width: min(100%, 1090px); margin-inline: auto; column-gap: clamp(20px, 4vw, 58px); padding-block: clamp(23px, 5vw, 65px);
}
.candle-art {
  position: relative; width: 100%; aspect-ratio: 1.03; isolation: isolate; border-radius: 21px; border: 1px solid #e1c7a541;
  background: radial-gradient(ellipse at 50% 63%, #3b244b9c 0%, #141526 69%, #11101b);
}
.candle-art::before {
  content: ''; position: absolute; inset: 2% 12% 18%; z-index: -1;
  background: radial-gradient(ellipse at 50% 32%, #fbc07956, #f9884430 24%, transparent 65%);
  transition: opacity .55s ease-out;
}
.candle-art::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: 7%; height: 7%; border-radius: 50%;
  background: #08050db5; filter: blur(13px); z-index: -1;
}
.candle-cake {
  position: absolute; left: 11%; top: 17%; width: 78%; aspect-ratio: 1;
  background: url('/media/birthday-cake.webp') center / contain no-repeat;
  filter: drop-shadow(0 8px 12px #07040c93);
}
.candle-stick {
  position: absolute; z-index: 1; left: 50%; top: 26%; width: 3.5%; height: 13%;
  translate: -50% 0; border-radius: 24% 24% 12% 12%;
  background: repeating-linear-gradient(-32deg, transparent 0 8px, #dc8c884f 8px 11px, transparent 11px 17px),
    linear-gradient(90deg, #e2b5b0, #fff1d5 32%, #f5d5ba 78%, #bb7778);
  box-shadow: 2px 2px 6px #461e34a6;
}
.candle-stick::before { content: ''; position: absolute; top: -16%; left: 43%; width: 15%; height: 17%; border-radius: 2px; background: #271923; }
.candle-flame {
  position: absolute; z-index: 2; left: 50%; top: 17%; width: 4%; height: 9%;
  translate: -50% 0; transform-origin: 50% 100%; border-radius: 63% 37% 51% 49% / 72% 63% 37% 28%;
  background: radial-gradient(ellipse at 52% 75%, #fff9dc 0 20%, #ffe08f 37%, #ffc252 56%, #f37632 81%, #f55a12 100%);
  box-shadow: 0 0 13px #fff4b2c9, 0 0 31px #ffc463c5, 0 0 60px #fcaa567f;
  animation: candle-flicker .7s ease-in-out infinite alternate;
}
.candle-wind, .candle-smoke { position: absolute; left: 50%; top: 24%; pointer-events: none; z-index: 3; }
.candle-wind i, .candle-smoke i { position: absolute; display: block; border-radius: 50%; opacity: 0; }
.candle-wind i { width: clamp(30px, 7vw, 78px); height: 2px; background: linear-gradient(90deg, transparent, #fef8e8a8); }
.candle-wind i:nth-child(2) { top: 10px; width: clamp(25px, 5vw, 55px); --wind-delay: .08s; }
.candle-wind i:nth-child(3) { top: -8px; --wind-delay: .14s; }
.candle-smoke i { width: 13px; height: 17px; background: #e2dfefb3; filter: blur(6px); }
.candle-smoke i:nth-child(2) { --smoke-x: -26px; --smoke-delay: .11s; }
.candle-smoke i:nth-child(3) { --smoke-x: 31px; --smoke-delay: .19s; }
.candle-stage.is-blown .candle-art::before { opacity: .14; }
.candle-stage.is-blown .candle-flame { animation: candle-out .34s ease-out both; }
.candle-stage.is-blown .candle-wind i { animation: candle-breeze .42s var(--wind-delay, 0s) ease-out both; }
.candle-stage.is-blown .candle-smoke i { animation: candle-smoke .55s calc(.16s + var(--smoke-delay, 0s)) ease-out both; }
.candle-copy h1 { font-size: clamp(3.25rem, 7vw, 5.8rem); }
.candle-copy .lede { margin-top: 15px; }
.candle-copy .button { margin-top: 24px; }
@keyframes candle-flicker { from { transform: rotate(-6deg) scale(.94,1.04); } to { transform: rotate(6deg) scale(1.09,.92); } }
@keyframes candle-out { 0% { opacity: 1; } 45% { transform: translateX(6px) rotate(20deg) scale(.86,.68); } to { opacity: 0; transform: translateX(12px) rotate(39deg) scale(.18,.12); } }
@keyframes candle-breeze { from { opacity: 0; translate: -114px 0; } 43% { opacity: .8; } to { opacity: 0; translate: 65px 0; } }
@keyframes candle-smoke { from { opacity: 0; transform: scale(.4); } 35% { opacity: .62; } to { opacity: 0; transform: translate(var(--smoke-x, 10px), -61px) scale(2.25); } }

.final-stage { display: grid; text-align: center; justify-items: center; width: min(100%, 800px); margin-inline: auto; }
.final-stage h1 { font-size: clamp(3.65rem, 8vw, 7rem); }
.final-stage .lede { margin: 19px auto 0; }
.final-emblem { display: flex; gap: 13px; align-items: center; margin: 0 0 23px; color: var(--gold); }
.final-emblem span { font-size: 1.8rem; text-shadow: 0 0 18px #e5bb80a3; }
.final-emblem i { width: 60px; height: 1px; background: linear-gradient(90deg, transparent, #d2a970); }
.final-emblem i:last-child { rotate: 180deg; }
.lock-code { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-block: 31px 22px; }
.lock-letter { display: grid; place-items: center; min-width: clamp(31px, 9vw, 64px); height: clamp(47px, 12vw, 72px); padding-inline: 5px; border: 1px solid #ddb78978; border-radius: 7px; background: #211725; color: #ffdda6; font-family: var(--serif); font-size: clamp(1.9rem, 6vw, 3.55rem); animation: lock-turn .74s var(--story-curve) both; animation-delay: var(--reveal-delay); }
.final-stage { isolation: isolate; }
.final-stage.is-revealed::before { content: ''; position: absolute; z-index: -1; inset: 6% 0; background: radial-gradient(ellipse, #995c5559, transparent 65%); animation: halo-breathe 5s ease-in-out infinite alternate; pointer-events: none; }
.final-stage.is-revealed .final-emblem span { display: inline-block; animation: lock-turn 1.2s var(--story-curve) both; }
@keyframes lock-turn { from { opacity: 0; transform: perspective(220px) rotateX(-85deg) translateY(.25em); } 58% { box-shadow: 0 0 23px #edb77971; } to { opacity: 1; transform: perspective(220px) rotateX(0); } }
.motion-burst { position: absolute; left: 50%; top: 39%; width: 0; height: 0; z-index: 3; pointer-events: none; }
.motion-particle { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffdfa6; box-shadow: 0 0 10px 2px #f5c27d90; animation: burst .98s var(--story-curve) both; animation-delay: calc(var(--burst-i) * 16ms); }
.motion-particle:nth-child(3n) { width: 3px; height: 9px; border-radius: 2px; }
@keyframes burst { from { opacity: .94; transform: translate(0) rotate(10deg) scale(.6); } 38% { opacity: .82; } to { opacity: 0; transform: translate(var(--burst-x), var(--burst-y)) rotate(90deg) scale(.16); } }
.closing { color: var(--muted); line-height: 1.5; margin-block: 22px 0; }
.closing em { color: var(--gold); }

@media (max-width: 820px) {
  .masthead { min-height: 74px; }
  .cover { grid-template-columns: minmax(0, 1fr) minmax(0, .68fr); }
  .cover h1 { font-size: clamp(3.35rem, 10vw, 6.15rem); }
  .gate-row { flex-direction: column; width: min(100%, 340px); }
}
@media (max-width: 610px) {
  .cover { grid-template-columns: 1fr; grid-template-rows: auto auto; justify-items: center; text-align: center; padding-block: 14px 35px; row-gap: 22px; }
  .cover-constellation { grid-row: 1; width: min(100%, 295px); }
  .cover-copy { grid-row: 2; margin: 0; }
  .cover h1 { font-size: clamp(3.6rem, 15vw, 6.3rem); }
  .cover .lede { margin: 16px auto 0; }
  .gate-form { margin-top: 17px; text-align: left; margin-inline: auto; }
  .gate-row { margin: auto; width: 100%; }
  .cover-music-control { justify-content: flex-start; margin-top: 19px; text-align: left; }
  .progress { gap: 11px; }
  .progress li { font-size: 0; gap: 0; }
  .progress [aria-current=step] { font-size: .7rem; gap: 6px; }
  .wordmark { flex: none; }
  .wordmark small { white-space: nowrap; font-size: .48rem; letter-spacing: .14em; }
  .music-toggle { min-height: 38px; padding-inline: 8px; font-size: .72rem; gap: 5px; }
  .welcome-stage { min-height: max(510px, 70svh); }
  .welcome-sky { aspect-ratio: .95; }
  .birthday-stage { --sky-height: clamp(365px, 59svh, 465px); --globe-size: min(65vw, 265px); padding-block: 10px 25px; }
  .birthday-name { font-size: clamp(6.3rem, 26vw, 10rem); }
  .birthday-earth, .birthday-light { top: 54%; }
  .birthday-age { bottom: 7%; }
  .candle-stage { grid-template-columns: 1fr; justify-items: center; row-gap: 22px; text-align: center; }
  .candle-art { width: min(100%, 370px); }
  .candle-copy h1 { font-size: clamp(2.95rem, 11.3vw, 4.4rem); }
  .candle-copy .lede { margin-inline: auto; }
  .reply-stage { grid-template-columns: 1fr; row-gap: 32px; }
  .portrait { width: min(90%, 315px); }
  .portrait img { max-height: 430px; }
  .reply-stage .portrait { grid-row: 2; }
  .puzzle-card { padding-inline: clamp(14px, 4vw, 24px); }
  .letters { --cell: clamp(21px, 7.2vw, 37px); }
  .footer { padding-block: 17px 19px; }
}
@media (max-width: 365px) {
  .shell { padding-inline: 15px; }
  .header-actions { gap: 8px; }
  .header-actions .progress { gap: 7px; }
  .header-actions .progress [aria-current=step] { font-size: 0; gap: 0; }
  .intro-panel { padding-inline: 17px; }
  .intro-route-list li { grid-template-columns: auto minmax(59px, 1fr) minmax(0, 2fr); gap: 7px; font-size: .81rem; }
  .letters { --cell: clamp(19px, 7vw, 28px); }
  .lock-code { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .star:nth-child(5n) { animation: none !important; }
  .meteor, .birthday-light, .candle-smoke, .candle-wind { display: none; }
  .stars, .earth { transform: none; }
  .welcome-sky { transform: translate(-50%, -50%); }
}
