/* ---------- Type motion ----------
   Only the type moves, with two moves used everywhere: labels "decode" like a HUD readout,
   and heading words "rise" from behind a mask. Numbers count up like a score screen.
   1. Home load: the HUD and title kicker decode, EVA and SONG rise, the rest fades in.
   2. Kickers (01 · WORK ...) decode; the heading under each rises. Same on every page.
   3. Scrolling away from the title pulls EVA and SONG apart; scrolling into the
      footer brings "Ready" and "up?" together. Same move, opposite ends of the page.
   4. Trophies count up, then unlock (icon pops, line fades in); 00 / 08 counts with them.
   5. Season pass: picking 01–10 makes the new featured title rise.
   6. Project pages: hero title rises, "TIER 01 · REWARD UNLOCKED" decodes, results count up.
   7. History: each chapter's date line decodes as it arrives.
   Hidden starting states apply only while <html> has .mo, which motion.js sets
   when the visitor has not asked for reduced motion. No JS = no motion, all text visible. */

.mo .mo-w { display: inline-block; }
.mo .mo-c { display: inline-block; }

/* rise: each word slides up from behind its own mask */
.mo .mo-rise .mo-w { clip-path: inset(-0.4em -0.3em -0.3em -0.3em); }
.mo .mo-rise .mo-c { transform: translateY(140%); transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.mo .mo-rise.mo-on .mo-c { transform: none; }
.mo .mo-rise.mo-done .mo-w { clip-path: none; }

/* decode: mono labels start empty, then resolve left to right */
.mo .mo-dec:not(.mo-on) { visibility: hidden; }

/* title: keep the name hidden until motion.js has wrapped it (no flash of the still name) */
.mo .es-title__name:not(.mo-rise) { visibility: hidden; }

/* title: supporting lines fade in after the name lands */
.mo .es-title__sub, .mo .es-title__main .es-status, .mo .es-title__main .es-start { opacity: 0; transition: opacity 0.8s ease; }
.mo .es-title.mo-on .es-title__sub { opacity: 1; transition-delay: 0.55s; }
.mo .es-title.mo-on .es-status { opacity: 1; transition-delay: 0.7s; }
.mo .es-title.mo-on .es-start { opacity: 1; transition-delay: 0.85s; }

/* title: scrolling away pulls the two words apart (--p goes 0 to 1 as the title leaves) */
.mo .es-title__name .mo-w:first-child { transform: translateX(calc(var(--p, 0) * -0.32em)); }
.mo .es-title__name .mo-w:last-child { transform: translateX(calc(var(--p, 0) * 0.32em)); }
.mo .es-title__name { opacity: calc(1 - var(--p, 0) * 0.55); }

/* footer: "Ready" and "up?" slide together as the footer arrives (--q goes 0 to 1) */
.mo .es-contact { overflow-x: clip; }
.mo .es-contact__head .mo-w:first-child { transform: translateX(calc((1 - var(--q, 1)) * -0.45em)); }
.mo .es-contact__head .mo-w:last-child { transform: translateX(calc((1 - var(--q, 1)) * 0.9em)); }
.mo .es-contact__head { opacity: calc(0.25 + var(--q, 1) * 0.75); }

/* trophy numbers keep their width steady while they count */
.mo .es-trophy__value, .mo .es-count, .mo .es-results b { font-variant-numeric: tabular-nums; }

/* trophy unlock: when a number lands, its icon pops once, the number flashes orange
   and the line under it fades in */
.mo .es-trophies .es-trophy__label { opacity: 0; transition: opacity 0.6s ease; }
.mo .es-trophy.mo-unlock .es-trophy__label { opacity: 1; }
.mo .es-trophy.mo-unlock .es-trophy__meta::before { animation: mo-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mo .es-trophy.mo-unlock .es-trophy__value { animation: mo-flash 0.9s ease-out; }
@keyframes mo-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-10deg); } 100% { transform: none; } }
@keyframes mo-flash { 0%, 25% { color: var(--es-accent-text); } 100% { color: inherit; } }

@media (max-width: 767px) {
  /* the phone title stacks EVA over SONG, left aligned: both drift right, SONG further */
  .mo .es-title__name .mo-w { display: block; width: max-content; }
  .mo .es-title__name .mo-w:first-child { transform: translateX(calc(var(--p, 0) * 0.12em)); }
  .mo .es-title__name .mo-w:last-child { transform: translateX(calc(var(--p, 0) * 0.4em)); }
}

@media (prefers-reduced-motion: reduce) {
  .mo .mo-c, .mo .es-title__name .mo-w, .mo .es-contact__head .mo-w { transform: none !important; transition: none !important; }
  .mo .es-title__name, .mo .es-contact__head, .mo .es-title__sub, .mo .es-status, .mo .es-start { opacity: 1 !important; }
  .mo .mo-dec { visibility: visible !important; }
  .mo .es-trophies .es-trophy__label { opacity: 1 !important; }
  .mo .es-trophy__meta::before, .mo .es-trophy__value { animation: none !important; }
}
