:root {
  --cream: #fff8d8;
  --gold: #ffc83d;
  --violet: #9c4dff;
  --ink: #2b1909;
  --progress: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; background: #090817; }
body { margin: 0; color: var(--cream); font-family: "Nunito", system-ui, sans-serif; background: #090817; }
button, a { font: inherit; }
button { cursor: pointer; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; color: #111; background: #fff; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20; height: 92px; display: grid;
  grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px clamp(22px,4vw,68px);
  color: #fff; text-shadow: 0 2px 16px rgb(0 0 0 / .46);
}
.site-header::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg,rgb(4 5 18 / .52),transparent); }
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; color: inherit; text-decoration: none; }
.brand img { width: 48px; height: 36px; object-fit: contain; filter: drop-shadow(0 3px 10px rgb(0 0 0 / .42)); }
.brand span { display: grid; line-height: 1; }
.brand b { font-size: 15px; letter-spacing: .18em; }
.brand small { margin-top: 6px; font-size: 6.5px; letter-spacing: .17em; }
.concept-label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.concept-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.store-link { justify-self: end; color: #fff; border: 1px solid rgb(255 255 255 / .72); border-radius: 999px; padding: 10px 18px; background: rgb(0 0 0 / .14); backdrop-filter: blur(14px); }
.store-link span { color: #ffe36a; font-size: .82em; }

.journey { position: relative; height: 920vh; }
.film-stage { position: sticky; top: 0; height: 100vh; overflow: clip; background: #0b0a1b; isolation: isolate; }
.film-stack { position: absolute; inset: 0; z-index: -5; background: #0b0a1b; }
.frame-film,.world-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; background: #0b0a1b; will-change: opacity; }
.frame-film { z-index: 2; }
.world-film { z-index: 1; opacity: 0 !important; pointer-events: none; }
.frame-film.is-visible,.world-film.is-visible { opacity: 1; }
.world-film.is-visible { opacity: 0 !important; }
.film-grade { position: absolute; inset: 0; z-index: -3; pointer-events: none; background: linear-gradient(90deg,rgb(4 5 16 / .46) 0%,transparent 40%,transparent 65%,rgb(4 5 16 / .3) 100%),linear-gradient(180deg,transparent 54%,rgb(2 3 12 / .34)); }
.film-grain { position: absolute; inset: -40%; z-index: -2; opacity: .045; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); animation: grain .55s steps(2) infinite; }
.light-wipe { position: absolute; inset: -15%; z-index: 4; opacity: 0; pointer-events: none; background: radial-gradient(circle at center,rgb(255 247 184 / .98) 0%,rgb(255 190 48 / .58) 34%,transparent 70%); mix-blend-mode: screen; filter: blur(18px); }
@keyframes grain { 0% { transform: translate3d(-2%,1%,0); } 50% { transform: translate3d(2%,-1%,0); } 100% { transform: translate3d(-1%,2%,0); } }

.loading-card { position: absolute; left: 50%; top: 50%; z-index: 8; display: flex; align-items: center; gap: 12px; transform: translate(-50%,-50%); padding: 12px 18px; border: 1px solid rgb(255 255 255 / .34); border-radius: 999px; background: rgb(4 5 18 / .68); backdrop-filter: blur(16px); transition: opacity .4s ease; }
.loading-card.is-hidden { opacity: 0; pointer-events: none; }
.loading-card i { width: 14px; height: 14px; border: 2px solid rgb(255 255 255 / .28); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.copy-track { position: absolute; inset: 0; pointer-events: none; }
.story-copy { position: absolute; top: 34%; width: min(620px,47vw); opacity: 0; filter: blur(7px); will-change: transform,opacity,filter; text-shadow: 0 5px 28px rgb(0 0 0 / .62); }
.story-copy--left { left: clamp(30px,8vw,130px); transform-origin: left center; }
.story-copy--right { right: clamp(30px,8vw,130px); text-align: right; transform-origin: right center; }
.story-copy--center { left: 50%; top: 48%; width: min(900px,88vw); text-align: center; transform-origin: center; }
.story-copy--social { left: clamp(30px,5vw,78px); top: 31%; width: min(530px,43vw); }
.story-copy.is-active { pointer-events: auto; filter: blur(0); }
.scene-number { margin: 0 0 10px; color: #ffe77a; font-size: clamp(10px,.8vw,13px); font-weight: 900; letter-spacing: .18em; }
.story-copy--danger .scene-number { color: #d9a7ff; text-shadow: 0 0 22px var(--violet); }
.story-copy--battle .scene-number { color: #fff3a2; text-shadow: 0 0 26px var(--gold); }
.story-copy h1,.story-copy h2 { margin: 0; color: var(--cream); font-family: "Baloo 2",system-ui,sans-serif; font-weight: 800; letter-spacing: -.055em; line-height: .88; }
.story-copy h1 { font-size: clamp(58px,7.25vw,118px); }
.story-copy h2 { font-size: clamp(52px,6.25vw,102px); }
.story-copy--social h2 { font-size: clamp(48px,4.1vw,66px); }
.story-copy--final h2 { font-size: clamp(46px,5.15vw,84px); line-height: .9; }
.support { max-width: 570px; margin: 24px 0 0; font-size: clamp(16px,1.3vw,22px); font-weight: 800; line-height: 1.4; }
.story-copy--right .support { margin-left: auto; }
.story-copy--center .support { margin-inline: auto; }
.story-copy--danger h2 { text-shadow: 0 0 40px rgb(117 32 233 / .32),0 5px 28px #000; }
.story-copy--final h2 { text-shadow: 0 0 48px rgb(255 195 49 / .34),0 5px 28px #000; }
.story-copy--final small { display: block; margin-top: 15px; color: rgb(255 255 255 / .8); }

.begin-button,.app-store-button { margin-top: 30px; border: 1px solid #ffe98f; border-radius: 999px; padding: 15px 25px; color: var(--ink); font-weight: 900; box-shadow: inset 0 2px 0 rgb(255 255 255 / .62),0 12px 30px rgb(77 35 0 / .3); background: linear-gradient(180deg,#ffed79,#f2a51c); transition: transform .15s ease,box-shadow .15s ease; }
.begin-button:hover,.app-store-button:hover { transform: translateY(-2px); box-shadow: inset 0 2px 0 rgb(255 255 255 / .72),0 16px 38px rgb(77 35 0 / .38); }
.begin-button:active,.app-store-button:active { transform: translateY(1px) scale(.98); }
.begin-button span { margin-left: 14px; }

.scroll-hint { position: absolute; left: 50%; bottom: 70px; display: grid; justify-items: center; gap: 8px; transform: translateX(-50%); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; transition: opacity .4s ease; }
.scroll-hint.is-hidden { opacity: 0; }
.scroll-hint i { display: block; width: 1px; height: 30px; background: linear-gradient(#fff,transparent); animation: drift 1.5s ease-in-out infinite; }
@keyframes drift { 50% { transform: translateY(8px); opacity: .35; } }

.timeline { position: absolute; left: clamp(22px,4vw,68px); right: clamp(22px,4vw,68px); bottom: 24px; z-index: 8; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.timeline-track { height: 2px; overflow: hidden; background: rgb(255 255 255 / .34); }
.timeline-track i { display: block; width: calc(var(--progress) * 100%); height: 100%; background: linear-gradient(90deg,#fff4b8,var(--gold),#b068ff); box-shadow: 0 0 16px var(--gold); }
.timeline-time { font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .1em; }

.toast { position: fixed; left: 50%; bottom: 38px; z-index: 40; max-width: min(600px,calc(100vw - 32px)); padding: 13px 19px; opacity: 0; transform: translate(-50%,20px); border: 1px solid rgb(255 255 255 / .3); border-radius: 999px; color: #fff; text-align: center; background: rgb(4 5 18 / .86); backdrop-filter: blur(16px); transition: .25s ease; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 760px) {
  .site-header { height: 72px; grid-template-columns: 1fr auto; padding: 12px 16px; }
  .brand img { width: 42px; height: 32px; }
  .brand b { font-size: 13px; }
  .brand small,.concept-label,.store-link span { display: none; }
  .store-link { padding: 9px 14px; font-size: 12px; }
  .journey { height: 850vh; }
  .frame-film,.world-film { bottom: auto; height: 56vh; object-fit: cover; object-position: center; background: #bfeaf7; }
  .film-grade { background: linear-gradient(180deg,transparent 30%,rgb(3 4 14 / .12) 44%,rgb(3 4 14 / .78) 100%); }
  .story-copy,.story-copy--left,.story-copy--right,.story-copy--center { left: 22px; right: 22px; top: auto; bottom: 105px; width: auto; text-align: left; transform-origin: left bottom; }
  .story-copy h1 { font-size: clamp(48px,15vw,74px); }
  .story-copy h2 { font-size: clamp(43px,12.8vw,64px); }
  .story-copy--social h2 { font-size: clamp(40px,11.8vw,58px); }
  .story-copy--final h2 { font-size: clamp(36px,10.5vw,52px); }
  .support { max-width: 40ch; margin-top: 14px; font-size: 15px; line-height: 1.32; }
  .story-copy--right .support,.story-copy--center .support { margin-left: 0; }
  .begin-button,.app-store-button { margin-top: 18px; padding: 13px 20px; }
  .story-copy--final small { font-size: 10px; }
  .scroll-hint { display: none; }
  .timeline { bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .film-grain,.loading-card i,.scroll-hint i { animation: none; }
  .toast { transition: none; }
}
