
:root {
  --bg: #0b0820;
  --n1: #161135;
  --deep: #1b1545;
  --n2: #231c54;
  --n3: #2f2770;
  --ink: #f4f1ff;
  --ink2: #b9b2e0;
  --ink3: #9a93cc;
  --amber: #ffb23e;
  --cyan: #4fd8f5;
  --gold: #ffe08a;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Lexend", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink2);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--amber); color: var(--bg); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 8px; }

.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 700px at 72% 30%, rgba(58, 36, 112, 0.75), transparent 65%),
    radial-gradient(700px 500px at 10% 100%, rgba(35, 28, 84, 0.9), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--n1) 100%);
}
.sky i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: var(--gold); opacity: 0.2;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: 0.9; transform: scale(1.6); } }


.stage {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(96px, 16vh, 160px) var(--gutter) clamp(28px, 5vh, 56px);
  overflow: hidden;
}

.gate {
  position: absolute; top: clamp(48px, 9vh, 88px); left: 50%;
  width: min(420px, 62vw); height: 6px; margin-left: calc(min(420px, 62vw) / -2);
  border-radius: 6px; background: var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 0 40px rgba(255, 178, 62, 0.8), 0 0 90px rgba(255, 178, 62, 0.5);
  transform: scaleX(0); opacity: 0;
}
.gate::before, .gate::after {
  content: ""; position: absolute; top: -5px; width: 12px; height: 16px; border-radius: 6px; background: var(--amber);
}
.gate::before { left: -6px; } .gate::after { right: -6px; }
.beam {
  position: absolute; top: calc(clamp(48px, 9vh, 88px) + 4px); left: 50%; translate: -50% 0;
  width: min(760px, 120vw); height: 70vh; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 178, 62, 0.28), rgba(255, 178, 62, 0.06) 55%, transparent);
  clip-path: polygon(calc(50% - min(210px, 31vw)) 0, calc(50% + min(210px, 31vw)) 0, 100% 100%, 0 100%);
  opacity: 0;
}

.cast { position: relative; width: 220px; height: 170px; margin-bottom: 18px; }
.ember {
  position: absolute; left: 70px; top: 18px; width: 128px; height: 128px; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fff6d6 0%, #ffc24a 30%, #ff7a1e 72%, #d9430e 100%);
  box-shadow: 0 0 40px rgba(255, 122, 30, 0.75), 0 0 120px rgba(255, 122, 30, 0.45);
  opacity: 0; transform: scale(0.3);
}
.ember .eyes { position: absolute; left: 50%; top: 50%; display: flex; gap: 16px; translate: -50% -50%; transition: transform 70ms linear; }
.ember .eyes i {
  width: 14px; height: 26px; border-radius: 8px; background: #3a1406;
  transform: scaleY(0.08); transform-origin: center;
}
.echo {
  position: absolute; left: 16px; top: 74px; width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #d8faff 0%, #36d6ff 45%, #1f6fd6 100%);
  box-shadow: 0 0 30px rgba(54, 214, 255, 0.55);
  opacity: 0; translate: 60px 0;
}
.echo svg { position: absolute; inset: 0; }

.stalker {
  position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #d8faff 0%, #36d6ff 45%, #1f6fd6 100%);
  box-shadow: 0 0 22px rgba(54, 214, 255, 0.6);
  opacity: 0; pointer-events: none; z-index: 5; transition: opacity 300ms ease; will-change: transform;
}
.stalker.on { opacity: 0.85; }
.stalker svg { position: absolute; inset: 0; }

.whisper {
  position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none;
  font: 700 clamp(18px, 2.6vw, 26px)/1.3 var(--display); color: var(--ink); letter-spacing: 0.01em;
}
.whisper span { position: absolute; opacity: 0; padding: 0 var(--gutter); }

h1 { margin: 0; }
.wordmark { width: min(520px, 86vw); height: auto; filter: drop-shadow(0 8px 40px rgba(79, 216, 245, 0.25)); opacity: 0; }
.tagline {
  margin: 18px 0 0;
  font: 800 clamp(24px, 3.6vw, 40px)/1.1 var(--display); letter-spacing: -0.01em;
  color: var(--amber); text-shadow: 0 0 28px rgba(255, 178, 62, 0.4);
  opacity: 0;
}
.line { margin: 12px 0 0; max-width: 34ch; font-size: clamp(16px, 1.6vw, 19px); opacity: 0; }

.store {
  position: relative; display: inline-flex; align-items: center; gap: 12px; text-align: start;
  margin-top: 30px; padding: 11px 22px 11px 18px;
  border-radius: 14px; background: #000; color: #fff; text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
  opacity: 0;
}
.store::after {
  content: ""; position: absolute; inset: -2px; border-radius: 16px; z-index: -1;
  box-shadow: 0 0 0 0 rgba(255, 178, 62, 0.7); animation: call 2.2s 6s ease-out infinite;
}
@keyframes call { 0% { box-shadow: 0 0 0 0 rgba(255, 178, 62, 0.6); } 100% { box-shadow: 0 0 0 18px rgba(255, 178, 62, 0); } }
.store:hover { transform: translateY(-2px) scale(1.03); }
.store:active { transform: scale(0.97); }
.store svg { width: 30px; height: 30px; }
.store small { display: block; font: 500 12px/1.1 -apple-system, var(--body); letter-spacing: 0.01em; }
.store strong { display: block; font: 600 23px/1.1 -apple-system, var(--body); letter-spacing: -0.02em; }
.meta { margin: 14px 0 0; font: 600 11px/1 var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink3); opacity: 0; }
.skip { position: fixed; right: 18px; top: 18px; z-index: 6; background: none; border: 0; color: var(--ink3); font: 500 13px var(--body); cursor: pointer; opacity: 0.7; }
.skip:hover { color: var(--ink); }

.play .whisper span:nth-child(1) { animation: say 2.2s 0.4s both; }
.play .whisper span:nth-child(2) { animation: say 2.2s 2.6s both; }
@keyframes say { 0% { opacity: 0; filter: blur(8px); } 25%, 70% { opacity: 1; filter: blur(0); } 100% { opacity: 0; filter: blur(6px); } }
.play .ember { animation: wake 900ms 2.9s cubic-bezier(.2, 1.4, .3, 1) both; }
@keyframes wake { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }
.play .ember .eyes i { animation: open 260ms 3.8s ease-out both, blink 4.6s 5s infinite; }
@keyframes open { to { transform: scaleY(1); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.play .echo { animation: creep 1.1s 4.6s cubic-bezier(.2, .8, .2, 1) both, hover 3.2s 6s ease-in-out infinite; }
@keyframes creep { from { opacity: 0; translate: 60px 0; } to { opacity: 0.85; translate: 0 0; } }
@keyframes hover { 50% { translate: 0 -6px; } }
.play .gate { animation: gate 700ms 5.4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes gate { to { transform: scaleX(1); opacity: 1; } }
.play .beam { animation: beam 1.2s 5.7s ease-out both, flicker 3.4s 7s ease-in-out infinite; }
@keyframes beam { to { opacity: 1; } }
@keyframes flicker { 50% { opacity: 0.7; } }
.play .wordmark { animation: slam 650ms 6s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes slam { from { opacity: 0; transform: scale(1.6); filter: blur(10px); } to { opacity: 1; transform: none; } }
.play .tagline { animation: rise 600ms 6.5s cubic-bezier(.2, .8, .2, 1) both; }
.play .line { animation: rise 600ms 6.8s cubic-bezier(.2, .8, .2, 1) both; }
.play .store { animation: rise 600ms 7.1s cubic-bezier(.2, 1.3, .3, 1) both; }
.play .meta { animation: rise 600ms 7.4s both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.play .skip { animation: fade 400ms 7.4s forwards; }
@keyframes fade { to { opacity: 0; visibility: hidden; } }

.ready .whisper { display: none; }
.ready .ember, .ready .gate, .ready .beam, .ready .wordmark, .ready .tagline, .ready .line, .ready .store, .ready .meta { animation: none; opacity: 1; transform: none; }
.ready .ember .eyes i { animation: blink 4.6s infinite; transform: none; }
.ready .echo { animation: hover 3.2s ease-in-out infinite; opacity: 0.85; translate: 0 0; }
.ready .beam { animation: flicker 3.4s ease-in-out infinite; }
.ready .skip { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stalker { display: none; }
}


.foot {
  width: min(1120px, 100% - 2 * var(--gutter)); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink3);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }


.top {
  width: min(1120px, 100% - 2 * var(--gutter)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0;
}
.top .home { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.top .home img:first-child { width: 36px; height: 36px; border-radius: 9px; }
.top .home img + img { height: 20px; width: auto; }
.top .get { font: 700 12px/1 var(--display); letter-spacing: 0.04em; color: var(--bg); background: var(--amber); padding: 11px 16px; border-radius: 999px; text-decoration: none; }
.top .get:hover { background: var(--gold); }

.doc { flex: 1; width: min(760px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: clamp(24px, 5vw, 56px) 0 80px; }
.doc h1 { font: 800 clamp(30px, 5vw, 46px)/1.1 var(--display); color: var(--ink); letter-spacing: -0.01em; }
.doc .updated { font-size: 14px; color: var(--ink3); margin: 14px 0 32px; }
.doc h2 { font: 700 19px/1.3 var(--display); color: var(--ink); margin: 40px 0 10px; }
.doc h3 { font: 600 17px/1.4 var(--body); color: var(--ink); margin: 26px 0 6px; }
.doc p, .doc li { color: var(--ink2); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--amber); text-underline-offset: 3px; }
.doc ul { padding-inline-start: 1.2em; }
.doc li { margin: 6px 0; }
.doc .card { padding: 22px 24px; border-radius: 20px; background: rgba(35, 28, 84, 0.6); box-shadow: 0 0 0 1px var(--line2) inset; margin: 24px 0; }
.doc .card p { margin: 0; color: var(--ink); }
.doc pre { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; color: var(--ink3); background: rgba(0, 0, 0, 0.25); padding: 16px; border-radius: 12px; max-height: 320px; overflow: auto; }

@media (max-width: 560px) {
  .foot { justify-content: center; text-align: center; }
  .foot nav { justify-content: center; }
  .top .home img + img { display: none; }
}
@media (max-height: 760px) and (min-width: 821px) {
  .cast { transform: scale(0.85); margin-bottom: 4px; }
}

.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.about { margin: 28px 0 0; max-width: 56ch; font-size: 15px; line-height: 1.65; color: var(--ink3); opacity: 0; }
.play .about { animation: rise 600ms 7.6s both; }
.ready .about { animation: none; opacity: 1; transform: none; }
.langs {
  width: min(1120px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 18px 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink3);
}
.langs a { text-decoration: none; }
.langs a:hover, .langs a[aria-current] { color: var(--ink); }

/* Scripts with no letter-spacing tradition, and Arabic, whose letters join. */
:lang(ar) *, :lang(ja) *, :lang(ko) *, :lang(zh) * { letter-spacing: 0 !important; }
:lang(ja) .about, :lang(ko) .about, :lang(zh) .about { max-width: 34em; line-break: strict; }
