/* Motion for the whole site (loaded with /motion.js). Everything here is an enhancement: with no script, or with "reduce motion" set, the pages look as they always did. */

/* Page changes: a short slide and fade between pages (browsers that support cross-document view transitions; others just navigate). */
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  .bar{view-transition-name:bar}
  ::view-transition-old(root){animation:mo-out .1s ease both}
  ::view-transition-new(root){animation:mo-in .21s cubic-bezier(.2,.8,.2,1) both}
  @keyframes mo-out{to{opacity:0;transform:translateX(-14px)}}
  @keyframes mo-in{from{opacity:0;transform:translateX(22px)}}
}

/* Hero: embers behind the circle */
.hero{position:relative}
.hero>*{position:relative;z-index:1}
.hero>canvas.mo-embers{position:absolute;z-index:0;left:-6%;right:-6%;top:-40px;bottom:-30px;width:112%;height:calc(100% + 70px);pointer-events:none}
.sigil-box{transition:transform .18s ease-out}

/* Cards rise in as they scroll into view. The hidden state is only set by the script, and only for cards below the first screen. */
html.mo .rv{opacity:0;transform:translateY(26px)}
html.mo .rv.in{opacity:1;transform:none;transition:opacity .3s ease,transform .33s cubic-bezier(.2,.8,.2,1)}

/* Cards glow in their own colour (taken from the cover) and the cover leans toward the pointer */
html.mo .plug,html.mo .shelf>li,html.mo .spot{transition:box-shadow .15s ease,border-color .15s ease}
html.mo .plug:hover,html.mo .shelf>li:hover{box-shadow:0 0 0 1px var(--c,var(--ember)),0 16px 46px -16px var(--c,var(--ember))}
html.mo .plug .shot,html.mo .shelf>li .shot{transform:perspective(800px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));transition:transform .09s ease-out;will-change:transform}
html.mo .plug:not(:hover) .shot,html.mo .shelf>li:not(:hover) .shot{--rx:0deg;--ry:0deg;transition:transform .25s ease}

/* Catalog cards glide when the list changes (set inline by motion.js) */

/* Release countdown and the next few weeks */
.mo-cd{display:inline-flex;gap:8px;vertical-align:middle;margin-left:6px}
.mo-cd span{display:inline-block;min-width:46px;text-align:center;border:1px solid var(--line);background:var(--bg-2);padding:3px 6px 2px;font:18px/1.1 var(--display);font-variant-numeric:tabular-nums}
.mo-cd small{display:block;font:11px/1.2 var(--body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.mo-road{margin:30px 0 8px;border:1px solid var(--line);background:var(--bg-2);padding:18px 18px 12px}
.mo-road h3{font:22px/1.1 var(--display);margin:0 0 2px}.mo-road p.sub{color:var(--muted);font-size:15px;margin:0 0 4px}
.mo-tl{list-style:none;margin:0;padding:22px 0 6px;display:flex;overflow-x:auto;position:relative;scrollbar-width:thin;gap:0}
.mo-tl::before{content:"";position:absolute;left:0;right:0;top:32px;height:1px;background:var(--line)}
.mo-tl li{flex:0 0 160px;position:relative;padding-top:22px;min-width:0}
.mo-tl li::before{content:"";position:absolute;top:5px;left:0;width:11px;height:11px;border-radius:50%;background:var(--bg-2);border:2px solid var(--muted)}
.mo-tl li.big::before{border-color:var(--ember)}
.mo-tl li.nxt::before{background:var(--ember-hi);border-color:var(--ember-hi);box-shadow:0 0 0 5px #d9622e33;animation:mo-pulse 2.2s ease-in-out infinite}
@keyframes mo-pulse{50%{box-shadow:0 0 0 11px #d9622e00}}
.mo-tl b{display:block;font:18px/1.2 var(--display);font-weight:400}
.mo-tl span{display:block;color:var(--muted);font-size:13.5px;line-height:1.35}

/* The key arriving (thank-you page) */
.mo-arrive{display:flex;flex-direction:column;align-items:center;gap:6px;margin:6px 0 18px}
.mo-arrive svg{width:132px;height:132px}
.mo-arrive .ring{fill:none;stroke:var(--ember);stroke-width:2;stroke-dasharray:340;stroke-dashoffset:340}
.mo-arrive.go .ring{animation:mo-draw .6s ease-out forwards}
.mo-arrive .rn{fill:var(--muted);font:15px var(--display);opacity:.25;transition:opacity .15s,fill .15s}
.mo-arrive .rn.on{opacity:1;fill:var(--ember-hi)}
@keyframes mo-draw{to{stroke-dashoffset:0}}
code.mo-reveal{clip-path:inset(0 100% 0 0);transition:clip-path .7s steps(30,end)}
code.mo-reveal.show{clip-path:inset(0 0 0 0)}

/* Footer: a small candle that flickers, with a spark now and then (a burst when you hover it) */
.mo-flame{display:block;width:34px;height:46px;margin:0 auto -2px;overflow:visible;cursor:default}
.mo-flame .halo{fill:url(#mo-glow);animation:mo-halo 3.4s ease-in-out infinite;transform-origin:50% 62%}
.mo-flame .fl{transform-origin:50% 100%;transform-box:fill-box;animation:mo-flick 1.7s ease-in-out infinite}
.mo-flame .fl2{animation-duration:1.15s;animation-delay:-.4s}
.mo-flame .sp{fill:var(--ember-hi);opacity:0;animation:mo-spark 4.2s ease-out infinite}
.mo-flame .sp2{animation-delay:-1.5s;animation-duration:5s}.mo-flame .sp3{animation-delay:-2.9s;animation-duration:3.6s}
.mo-flame:hover .sp{animation-duration:1.1s}
@keyframes mo-flick{0%,100%{transform:scale(1,1) skewX(0)}20%{transform:scale(.94,1.07) skewX(-3deg)}45%{transform:scale(1.05,.95) skewX(2deg)}70%{transform:scale(.97,1.05) skewX(-1.5deg)}}
@keyframes mo-halo{0%,100%{opacity:.75;transform:scale(1)}50%{opacity:1;transform:scale(1.12)}}
@keyframes mo-spark{0%{opacity:0;transform:translate(0,0)}12%{opacity:.9}100%{opacity:0;transform:translate(var(--dx,6px),-26px)}}

@media (prefers-reduced-motion:reduce){
  .mo-flame .halo,.mo-flame .fl,.mo-flame .sp{animation:none}
  .mo-tl li.nxt::before{animation:none}
  code.mo-reveal{clip-path:none}
}
