/* aliefxoxo motion layer. Pairs with motion.js. See docs/MOTION.md.
   Rules: content is complete with this file alone. Scroll/hover effects are scoped to html.mo
   (set by motion.js, never under reduced motion). Reveals animate `translate`/`scale`/`opacity`
   so they never fight the `transform` used for hover tilt. */

@property --mo-l{syntax:"<length>";inherits:false;initial-value:0px}
@property --mo-r{syntax:"<length>";inherits:false;initial-value:0px}

/* keyboard focus on brand-work cards: the link's own ring is clipped by .post{overflow:hidden} */
.post:has(a:focus-visible){outline:2px solid var(--gold);outline-offset:2px}

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

/* ---------- page-to-page view transitions (no JS needed) ---------- */
@view-transition{navigation:auto}
nav.top .logo{view-transition-name:mo-logo}
.hero h1,.pagehead h1,.about>div>h2{view-transition-name:mo-title}
main>.stats{view-transition-name:mo-stats}
#cbar{view-transition-name:mo-cbar}
::view-transition-old(root){animation:mo-vt-out .28s cubic-bezier(.4,0,1,1) both}
::view-transition-new(root){animation:mo-vt-in .5s cubic-bezier(.2,.7,.2,1) both}
::view-transition-group(mo-title),::view-transition-group(mo-stats),::view-transition-group(mo-logo){animation-duration:.55s;animation-timing-function:cubic-bezier(.3,.7,.1,1)}
::view-transition-old(mo-title),::view-transition-new(mo-title){height:100%;width:auto}
/* the cookie banner never moves or fades */
::view-transition-group(mo-cbar),::view-transition-new(mo-cbar){animation:none}
::view-transition-old(mo-cbar){display:none}
@keyframes mo-vt-out{to{opacity:0;translate:0 -10px}}
@keyframes mo-vt-in{from{opacity:0;translate:0 16px}}

/* ---------- hero entrance: time-based, self-resolving, runs before JS so nothing flashes ---------- */
.hero>div>*{animation:mo-in .9s cubic-bezier(.3,0,.2,1) backwards}
.hero>div>:nth-child(3){animation-delay:.45s}
.hero>div>:nth-child(4){animation-delay:.55s}
.hero>div>:nth-child(5){animation-delay:.65s}
.hero h1.mo-split{animation:none}
.mo-w{display:inline-block;white-space:nowrap}
.mo-ch{display:inline-block;transform-origin:0 100%;animation:mo-ch 1s cubic-bezier(.2,.75,.15,1) backwards;animation-delay:calc(var(--i)*60ms + 60ms)}
@keyframes mo-in{from{opacity:0;translate:0 14px}}
@keyframes mo-ch{from{opacity:0;translate:0 .42em;rotate:5deg}}

/* ---------- hero atmosphere: drifting light behind the arches, film grain over them ---------- */
html.mo .hero{position:relative}
html.mo .hero::before{content:"";position:absolute;inset:-4% 0 4% 38%;z-index:-1;pointer-events:none;
 background:radial-gradient(closest-side,color-mix(in srgb,var(--rose) 22%,transparent),color-mix(in srgb,var(--gold) 8%,transparent) 55%,transparent);
 animation:mo-drift 16s ease-in-out infinite alternate}
html.mo .hero::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;opacity:.11;
 -webkit-mask-image:radial-gradient(ellipse at 62% 46%,#000 30%,transparent 72%);mask-image:radial-gradient(ellipse at 62% 46%,#000 30%,transparent 72%);
 background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .5 1.8 0 0 0 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
@keyframes mo-drift{from{translate:-6% 3%;scale:.94}to{translate:5% -4%;scale:1.06}}

/* pointer parallax (transform, vars set by JS) + scroll parallax (translate, CSS timeline) */
html.mo .stack img{transition:transform .7s cubic-bezier(.2,.7,.2,1);transform:translate3d(calc(var(--px,0)*var(--k,0px)),calc(var(--py,0)*var(--k,0px)),0)}
html.mo .stack .a{--k:-10px}html.mo .stack .b{--k:14px}html.mo .stack .me{--k:26px}

/* ---------- scroll progress hairline ---------- */
.mo-bar{position:fixed;inset:0 0 auto 0;height:2px;z-index:40;pointer-events:none;transform-origin:0 50%;transform:scaleX(0);
 background:linear-gradient(90deg,var(--rose),var(--gold))}

/* ---------- brand marquee ---------- */
.mo-marquee{overflow:hidden;margin:0 0 44px;padding-block:6px;cursor:default;border-radius:4px;
 -webkit-mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent);mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent)}
.mo-marquee:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.mo-track{display:flex;width:max-content;animation:mo-marq var(--d,40s) linear infinite}
.mo-track ul{display:flex;flex:none;margin:0;padding:0;list-style:none}
.mo-track li{display:flex;align-items:center;gap:.9em;padding-left:.9em;white-space:nowrap;font:italic 400 clamp(26px,3.6vw,46px)/1.25 var(--display);color:var(--ink)}
.mo-track li:nth-child(even){color:var(--muted)}
.mo-track li::after{content:"";width:7px;height:7px;rotate:45deg;background:var(--gold);flex:none}
.mo-marquee:is(:focus-visible,.mo-paused) .mo-track{animation-play-state:paused}
@keyframes mo-marq{to{translate:-50% 0}}

/* ---------- brand-work strip: edge fades (classes toggled by JS on scroll) ---------- */
html.mo .grid:not(.full){padding-top:12px;margin-top:-12px;transition:--mo-l .35s,--mo-r .35s;
 -webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--mo-l),#000 calc(100% - var(--mo-r)),transparent);
 mask-image:linear-gradient(90deg,transparent,#000 var(--mo-l),#000 calc(100% - var(--mo-r)),transparent)}
html.mo .grid.mo-l{--mo-l:64px}html.mo .grid.mo-r{--mo-r:64px}

/* ---------- /collab steps: progress line + numerals that light in order ---------- */
html.mo .steps{position:relative}
html.mo .steps::before,html.mo .steps::after{content:"";position:absolute;left:0;right:0;top:-15px;height:1px;background:var(--line)}
html.mo .steps::after{height:2px;top:-15.5px;background:linear-gradient(90deg,var(--rose),var(--gold));transform-origin:0 50%;transform:scaleX(var(--mo-sp,1))}

/* ---------- IntersectionObserver fallback reveal (only used without scroll timelines) ---------- */
html.mo .mo-rv{transition:opacity .8s cubic-bezier(.2,.6,.2,1),translate .8s cubic-bezier(.2,.6,.2,1),transform .25s}
html.mo .mo-wait{opacity:0;translate:0 24px}

/* ---------- scroll-driven layer ---------- */
@supports (animation-timeline:view()){
 .mo-bar{animation:mo-grow linear both;animation-timeline:scroll(root)}

 html.mo :is(.sh,.pillars>div,.pkg article,.prods .prod,.stores .store,.grid.full .post,.book,.contact,.ctaband,.about>*,.faq details,.mo-marquee){
  animation:mo-rise linear both;animation-timeline:view();animation-range:entry 10px entry 250px}
 html.mo :is(.pillars>div,.pkg article,.prods .prod,.stores .store,.grid.full .post):nth-child(3n+2){animation-range:entry 10px entry 310px}
 html.mo :is(.pillars>div,.pkg article,.prods .prod,.stores .store,.grid.full .post):nth-child(3n){animation-range:entry 10px entry 370px}

 html.mo .stack img{animation:mo-par linear both;animation-timeline:view();animation-range:cover}
 html.mo .stack .a{--d:16px}html.mo .stack .b{--d:40px}html.mo .stack .me{--d:64px}

 html.mo .steps{view-timeline:--mo-steps block}
 html.mo .steps::after{transform:none;animation:mo-grow linear both;animation-timeline:--mo-steps;animation-range:cover 12% cover 50%}
 html.mo .steps li::before{transform-origin:0 60%;animation:mo-num linear both;animation-timeline:--mo-steps;animation-range:cover 12% cover 20%}
 html.mo .steps li:nth-child(2)::before{animation-range:cover 19.5% cover 27.5%}
 html.mo .steps li:nth-child(3)::before{animation-range:cover 27% cover 35%}
 html.mo .steps li:nth-child(4)::before{animation-range:cover 34.5% cover 42.5%}
 html.mo .steps li:nth-child(5)::before{animation-range:cover 42% cover 50%}

 /* pinned feel: for 48px of scroll around viewport centre the doors counter-move and appear to hold.
    Stays inside the 88px section margins, so nothing overlaps. */
 @media (min-width:861px){
  html.mo .split .door{animation:mo-hold linear both;animation-timeline:view();animation-range:cover calc(50% - 24px) cover calc(50% + 24px)}
 }
}
@keyframes mo-grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes mo-rise{from{opacity:0;translate:0 26px;animation-timing-function:cubic-bezier(.2,.6,.2,1)}}
@keyframes mo-par{from{translate:0 var(--d)}to{translate:0 calc(var(--d)*-1)}}
@keyframes mo-num{from{opacity:.25;scale:.78}}
@keyframes mo-hold{from{translate:0 -24px}to{translate:0 24px}}

/* ---------- desktop pointer only: tilt, spotlight, magnet, glow, drag ---------- */
@media (hover:hover) and (pointer:fine){
 .mo-marquee:hover .mo-track{animation-play-state:paused}

 html.mo .grid:not(.full){scroll-snap-type:none;cursor:grab;user-select:none;-webkit-user-select:none}
 html.mo .grid.mo-drag{cursor:grabbing}
 html.mo .grid:not(.full) :is(a,img){-webkit-user-drag:none}

 html.mo :is(.post,.store){transition:transform .35s cubic-bezier(.2,.7,.2,1),box-shadow .35s}
 html.mo :is(.post,.store):hover{transform:perspective(800px) rotateX(calc((.5 - var(--my,.5))*7deg)) rotateY(calc((var(--mx,.5) - .5)*9deg)) translateY(-5px);
  box-shadow:0 26px 40px -28px color-mix(in srgb,var(--rose) 70%,#000)}
 html.mo .grid.mo-drag .post{transform:none}

 html.mo :is(.prod,.door){position:relative}
 html.mo :is(.prod,.door)::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .45s;
  background:radial-gradient(280px circle at calc(var(--mx,.5)*100%) calc(var(--my,.5)*100%),color-mix(in srgb,var(--rose) 17%,transparent),transparent 70%)}
 html.mo :is(.prod,.door):hover::after{opacity:1}
 html.mo .pimg img{transition:transform .9s cubic-bezier(.2,.7,.2,1)}
 html.mo .prod:is(:hover,:focus-within) .pimg img{transform:scale(1.1)}

 html.mo .btn{transition:translate .4s cubic-bezier(.2,.8,.2,1)}

 .mo-glow{position:fixed;left:-260px;top:-260px;width:520px;height:520px;border-radius:50%;z-index:-1;pointer-events:none;opacity:0;
  background:radial-gradient(closest-side,color-mix(in srgb,var(--rose) 13%,transparent),transparent);
  transition:opacity .8s,transform .6s cubic-bezier(.2,.7,.2,1);will-change:transform}
 html.mo-ptr .mo-glow{opacity:1}
}
@media not ((hover:hover) and (pointer:fine)){.mo-glow{display:none}}

}/* end no-preference */

@media print{.mo-bar,.mo-glow,.mo-marquee{display:none}html.mo *{animation:none!important}}
