/* Motion layer for the whole site. Everything here is extra: without JS (no .mo class) or with Reduce Motion the pages are fully visible and still.
   Uses the separate `translate` / `scale` properties so it never fights the existing `transform: rotate(...)` on the phone and the notes. */

@media (prefers-reduced-motion: no-preference){

/* ---------- hero entrance ---------- */
.mo .hero .wrap > div:first-child > *,
.mo .studio .wrap > *{opacity:0;animation:rise .9s cubic-bezier(.2,.7,.2,1) forwards}
.mo .hero .wrap > div:first-child > :nth-child(2),.mo .studio .wrap > :nth-child(2){animation-delay:.12s}
.mo .hero .wrap > div:first-child > :nth-child(3),.mo .studio .wrap > :nth-child(3){animation-delay:.5s}
.mo .hero .wrap > div:first-child > :nth-child(4){animation-delay:.62s}
.mo .hero .wrap > div:first-child > :nth-child(5){animation-delay:.74s}
.mo .hero .wrap > div:first-child > :nth-child(6){animation-delay:.86s}
@keyframes rise{from{opacity:0;translate:0 26px}to{opacity:1;translate:0 0}}

/* LUMEN: letters drop in one by one, then the subtitle glows in */
.mo #title{opacity:1 !important;animation:none !important}
.mo #title .ch{display:inline-block;opacity:0;animation:letter 1s cubic-bezier(.2,.8,.2,1.15) forwards;animation-delay:calc(.15s + var(--i) * .09s)}
@keyframes letter{from{opacity:0;translate:0 -.5em;filter:blur(8px)}to{opacity:1;translate:0 0;filter:blur(0)}}
.mo #title .sub{opacity:0;animation:subIn 1.2s ease forwards .75s}
@keyframes subIn{from{opacity:0;letter-spacing:.6em;filter:blur(4px)}to{opacity:1;letter-spacing:.28em;filter:blur(0)}}

.mo #title .word{display:inline-block;white-space:nowrap}
/* a soft glow runs through the letters now and then */
.mo #title .ch{animation:letter 1s cubic-bezier(.2,.8,.2,1.15) forwards,glint 7s ease-in-out infinite;animation-delay:calc(.15s + var(--i) * .09s),calc(2.4s + var(--i) * .14s)}
@keyframes glint{0%,14%,100%{text-shadow:none}7%{text-shadow:0 0 14px #fff8ec,0 0 34px rgba(255,236,210,.9)}}

/* phone and board float in, then breathe */
.mo .hero-art .phone{opacity:0;animation:phoneIn 1.2s cubic-bezier(.2,.7,.2,1) .35s forwards,bob 6s ease-in-out 1.6s infinite}
@keyframes phoneIn{from{opacity:0;translate:60px 40px;scale:.92}to{opacity:1;translate:0 0;scale:1}}
@keyframes bob{50%{translate:0 -12px}}
.mo .hero-art .board{opacity:0;animation:boardIn 1.3s cubic-bezier(.2,.7,.2,1) .2s forwards,drift 9s ease-in-out 1.5s infinite}
@keyframes boardIn{from{opacity:0;translate:0 30px}to{opacity:1;translate:0 0}}
@keyframes drift{50%{translate:0 8px}}
.hero-art{transition:translate .6s cubic-bezier(.2,.7,.2,1)}

/* the sun breathes */
.mo .sun{animation:sunIn 1.6s ease forwards,glow 8s ease-in-out 1.6s infinite}
@keyframes sunIn{from{opacity:0;scale:.6}to{opacity:.95;scale:1}}
@keyframes glow{50%{scale:1.08;opacity:.8}}

/* extra motes made by motion.js: drift up and twinkle */
.mote.gen{width:var(--s,5px);height:var(--s,5px);animation:rise2 var(--d,14s) linear var(--dl,0s) infinite}
@keyframes rise2{0%{translate:0 0;opacity:0}12%{opacity:.85}50%{translate:var(--x,10px) -45vh;opacity:.6}88%{opacity:.8}100%{translate:0 -90vh;opacity:0}}

/* a little ball of light rolls along the bottom of the hero */
.rollball{position:absolute;z-index:1;bottom:18px;left:-40px;width:18px;height:18px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle at 35% 35%,#fff,#fff3dc 45%,#ffd9a8 100%);box-shadow:0 0 18px 6px rgba(255,240,210,.85),0 0 40px 14px rgba(255,220,180,.45);
  animation:roll 16s cubic-bezier(.45,0,.55,1) 2s infinite}
.rollball::after{content:'';position:absolute;left:50%;top:100%;width:26px;height:6px;margin:4px 0 0 -13px;border-radius:50%;background:rgba(110,60,70,.18);filter:blur(3px)}
@keyframes roll{0%{left:-40px;opacity:0}5%{opacity:1}45%{left:calc(50% - 9px)}50%{left:calc(50% - 9px);translate:0 -18px}55%{left:calc(50% - 9px);translate:0 0}95%{opacity:1}100%{left:calc(100% + 40px);opacity:0}}

/* ---------- reveal on scroll ---------- */
.mo .rv{opacity:0;translate:0 34px;transition:opacity .8s ease,translate .9s cubic-bezier(.2,.7,.2,1),box-shadow .35s ease,scale .35s ease;transition-delay:var(--dl,0s)}
.mo .rv.in{opacity:1;translate:0 0}
.mo .rv.zoom{translate:0 0;scale:.92}
.mo .rv.zoom.in{scale:1}
.mo .rv.in.zoom:not(.balls):hover{scale:1.03}
/* notes land like paper dropped on a table */
.mo .note.rv{translate:0 50px;rotate:-4deg}
.mo .note.rv:nth-child(2n){rotate:4deg}
.mo .note.rv.in{translate:0 0;rotate:0deg}
/* section labels draw a short line */
.mo .head .label{position:relative}
.mo .head.rv .label::after{content:'';position:absolute;left:0;bottom:-6px;height:2px;width:0;background:var(--accent);border-radius:2px;opacity:.5;transition:width 1s cubic-bezier(.2,.7,.2,1) .4s}
.mo .head.rv.in .label::after{width:36px}

/* ---------- hover ---------- */
.card,.note,.world,.gallery a{transition:translate .35s cubic-bezier(.2,.7,.2,1),box-shadow .35s ease}
.steps .card:hover,.feats .card:hover,.mechs .card:hover,.game:hover,.gallery a:hover{translate:0 -6px;box-shadow:inset 0 0 0 1px var(--card-line),0 32px 70px rgba(110,60,70,.2)}
.mo .rv.in.card:hover,.mo .rv.in.world:hover{translate:0 -6px}
.mo .rv.in.note:hover{translate:0 -4px}
.note:hover{translate:0 -4px;rotate:0deg}
.mechs img,.world img,.game .art img,.gallery img{transition:scale .9s cubic-bezier(.2,.7,.2,1)}
.mechs .card:hover img,.world:hover img,.game:hover .art img,.gallery a:hover img{scale:1.07}
.world:hover{translate:0 -6px}
.feats .card:hover .ico{animation:wiggle .6s ease}
@keyframes wiggle{30%{rotate:-10deg;scale:1.1}60%{rotate:8deg}100%{rotate:0deg;scale:1}}
.steps .card:hover .n{animation:pop .5s ease}
@keyframes pop{40%{scale:1.2}}
.feats .ico svg path,.feats .ico svg circle,.feats .ico svg rect{stroke-dasharray:200;stroke-dashoffset:0}
.mo .feats .card.rv .ico svg *{stroke-dashoffset:200;transition:stroke-dashoffset 1.4s ease calc(var(--dl,0s) + .3s)}
.mo .feats .card.rv.in .ico svg *{stroke-dashoffset:0}

/* buttons: a light glint passes over */
.btn{position:relative;overflow:hidden;transition:translate .25s ease,box-shadow .25s ease}
.btn::after{content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent 35%,rgba(255,255,255,.75) 50%,transparent 65%);translate:-120% 0;pointer-events:none}
.btn:hover::after{transition:translate .8s ease;translate:120% 0}
.btn.solid:hover{box-shadow:0 18px 38px rgba(110,60,70,.22)}
.mo .btn.solid#store{animation:nudge 5s ease-in-out 3s infinite}
@keyframes nudge{0%,88%,100%{scale:1}92%{scale:1.04}96%{scale:.99}}

/* centred heading: the little line sits under the middle of the label */
.mo .skins .head.rv .label::after{left:50%;transform:translateX(-50%)}

/* parents checklist ticks pop one after another */
.mo .parents.rv li{opacity:0;translate:-14px 0;transition:opacity .5s ease,translate .5s ease}
.mo .parents.rv.in li{opacity:1;translate:0 0}
.mo .parents.rv.in li:nth-child(1){transition-delay:.3s}.mo .parents.rv.in li:nth-child(2){transition-delay:.42s}.mo .parents.rv.in li:nth-child(3){transition-delay:.54s}.mo .parents.rv.in li:nth-child(4){transition-delay:.66s}.mo .parents.rv.in li:nth-child(5){transition-delay:.78s}

/* header: soft shadow once you scroll */
.top{transition:box-shadow .3s ease,background-color .3s ease}
.top.scrolled{box-shadow:0 8px 30px rgba(110,60,70,.12)}

/* studio "+" card breathes */
.game.soon b{display:inline-block;animation:breathe 3.5s ease-in-out infinite}
@keyframes breathe{50%{scale:1.18;opacity:.6}}

/* 404 */
.mo .page .wrap > *{opacity:0;animation:rise .9s cubic-bezier(.2,.7,.2,1) forwards}
.mo .page .wrap > :nth-child(2){animation-delay:.12s}.mo .page .wrap > :nth-child(3){animation-delay:.24s}.mo .page .wrap > :nth-child(4){animation-delay:.36s}
}

/* progress line under the header (also fine with reduced motion: it only follows the scroll) */
.scrollbar{position:fixed;top:0;left:0;height:3px;width:100%;transform-origin:0 50%;scale:0 1;background:linear-gradient(90deg,var(--accent),#f2b3a3);z-index:30;pointer-events:none}
