/* ============================================================================
   MOTION LAYER
   ----------------------------------------------------------------------------
   Everything here is gated on html.motion, which an inline script in <head>
   adds only when the visitor has NOT asked for reduced motion. With reduced
   motion, or with JavaScript off, none of these rules apply and the page is
   exactly the static page underneath.

   Language borrowed from the reference: words rise out of a soft blur one by
   one, highlights wipe in after their words land, buttons carry a slow sheen,
   cards tilt up into place, and ambient light drifts behind the hero.
   Only opacity, transform, filter and background are animated, so nothing
   reflows while it plays.
   ============================================================================ */
:root{ --ease-soft:cubic-bezier(.22,1,.36,1) }

@keyframes m-word   { from{opacity:0;filter:blur(10px);transform:translateY(.35em)} }
@keyframes m-word-pop{ from{opacity:0;filter:blur(10px);transform:translateY(.35em) scale(.86)}
                       60%{opacity:1;filter:blur(0);transform:translateY(0) scale(1.05)} }
@keyframes m-rise   { from{opacity:0;transform:translateY(16px)} }
@keyframes m-wipe   { from{background-size:0% 100%} }
@keyframes m-shimmer{ to{background-position:-200% 0} }
@keyframes m-sheen  { 0%,72%{transform:translateX(-130%) skewX(-18deg)} 100%{transform:translateX(330%) skewX(-18deg)} }
@keyframes m-ping   { 0%{opacity:.75;transform:scale(.5)} 100%{opacity:0;transform:scale(1.9)} }
@keyframes m-float  { 50%{transform:translateY(-6px)} }
@keyframes m-drift-a{ 50%{transform:translate(7%,9%) scale(1.08)} }
@keyframes m-drift-b{ 50%{transform:translate(-9%,-6%) scale(.94)} }
@keyframes m-failsafe{ to{opacity:1} }

/* ---------------------------------------------------------------- hero ---- */

/* Hold the headline until motion.js has split it, so it never flashes in
   whole and then disappears. The failsafe shows it anyway after 2s. */
.motion .hero h1:not(.split),
.motion .hero .sub:not(.split),
.motion .hero:not(.intro) :is(.aud,.chips > li,.cta,.note,.mentor){
  opacity:0;animation:m-failsafe .4s 2s forwards;
}

.motion .hero .nw{white-space:nowrap}
.motion .hero mark.glue-head{padding-right:0}
.motion .hero mark.glue-tail{padding-left:0}
.motion .hero-top .w{display:inline-block;animation:m-word .8s var(--ease-soft) both;
  animation-delay:var(--d,0s)}

/* Primary header highlight: the words pop in, the mint bar wipes under them,
   then a slow gradient runs through the letters. */
.motion .hero h1 .hx .w{animation-name:m-word-pop}
.motion .hero h1 .hx{background-repeat:no-repeat;background-size:100% 100%;
  animation:m-wipe .7s var(--ease-soft) var(--hd,1s) both}
.motion .hero h1 .hx .w.shim{
  background:linear-gradient(90deg,var(--ink) 0%,var(--ink) 35%,var(--accent-700,var(--accent-600)) 50%,var(--ink) 65%,var(--ink) 100%);
  background-size:200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;
  animation:m-shimmer 9s linear infinite;
}

/* Secondary header: "2 AI projects" pops, its bar wipes in, and a light
   sheen passes over the bar every few seconds. */
.motion .hero .sub .hs .w{animation-name:m-word-pop}
.motion .hero .sub .hs{
  background-image:
    linear-gradient(105deg,transparent 40%,rgb(255 255 255 / .7) 50%,transparent 60%),
    linear-gradient(transparent 52%, var(--accent-200) 52%, var(--accent-200) 94%, transparent 94%);
  background-repeat:no-repeat;
  background-size:300% 100%, 100% 100%;
  background-position:100% 0, 0 0;
  animation:m-wipe-hs .7s var(--ease-soft) var(--hd,1.6s) both,
            m-sheen-bg 7s ease-in-out calc(var(--hd,1.6s) + 1.4s) infinite;
}
@keyframes m-wipe-hs { from{background-size:300% 100%, 0% 100%} }
@keyframes m-sheen-bg{ 0%,70%{background-position:100% 0,0 0} 100%{background-position:0% 0,0 0} }

/* "clear roadmap": the green underline draws itself left to right. Same
   colour, weight and offset as the static text-decoration it replaces. */
.motion .hero .sub .hr{
  text-decoration:none;
  background:linear-gradient(var(--accent-600),var(--accent-600)) no-repeat 0 100% / 100% .09em;
  padding-bottom:.08em;
  animation:m-draw .7s var(--ease-soft) var(--hd,1.8s) both;
}
@keyframes m-draw{ from{background-size:0% .09em} }

/* the rest of the hero rises in after the headline */
.motion .hero.intro :is(.aud,.chips > li,.cta,.note,.mentor){
  animation:m-rise .7s var(--ease-soft) var(--d,0s) both;
}
/* the mentor card then bobs gently (translate, so it never fights the rise) */
.motion .hero.intro .mentor{
  animation:m-rise .7s var(--ease-soft) var(--d,0s) both, m-bob 6s ease-in-out 2.4s infinite;
}
.motion .hero.intro .mentor:hover{animation-play-state:running,paused}
@keyframes m-bob{ 50%{translate:0 -8px} }

/* ambient light: two soft mint orbs drifting behind the copy, nudged by the
   pointer on desktop (motion.js sets --mx / --my between -1 and 1) */
.motion .hero{isolation:isolate}
/* the orbs (and their drift) reach past the hero on narrower desktops; clip
   them at the window edge. clip, not hidden: no scroll box, so sticky still works */
.motion main{overflow-x:clip}
.motion .hero::before,
.motion .hero::after{
  content:"";position:absolute;z-index:-1;pointer-events:none;border-radius:50%;
  translate:calc(var(--mx,0) * 26px) calc(var(--my,0) * 20px);
  transition:translate 1.2s var(--ease-soft);
}
.motion .hero::before{
  width:520px;height:520px;left:-140px;top:40px;
  background:radial-gradient(circle,rgb(var(--accent-rgb) / .16),transparent 65%);
  animation:m-drift-a 24s ease-in-out infinite;
}
.motion .hero::after{
  width:600px;height:600px;right:-180px;top:260px;
  background:radial-gradient(circle,rgb(var(--accent-rgb) / .12),transparent 65%);
  animation:m-drift-b 28s ease-in-out infinite;
  translate:calc(var(--mx,0) * -34px) calc(var(--my,0) * -24px);
}

/* live dot: a ripple instead of a static ring */
.motion .live::after{animation:m-ping 2.4s cubic-bezier(0,0,.2,1) infinite}

/* chips: lift on hover, icon tips over a little */
.motion .chip{transition:translate .35s var(--ease-soft),box-shadow .35s ease,border-color .35s ease}
.motion .chip svg{transition:rotate .45s var(--ease-soft),opacity .3s ease}
.motion .chip:hover{translate:0 -3px;box-shadow:var(--shadow-lg)}
.motion .chip:hover svg{rotate:-12deg;opacity:.85}

/* buttons: a slow sheen, a press, and the existing lift */
.motion :is(.cta,.section-cta,.nav-cta,.rm-cta){position:relative;overflow:hidden;isolation:isolate}
.motion :is(.cta,.section-cta,.nav-cta,.rm-cta)::after{
  content:"";position:absolute;inset:0 auto 0 0;width:38%;z-index:-1;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgb(255 255 255 / .22),transparent);
  animation:m-sheen 6.5s ease-in-out 2.4s infinite;
}
.motion :is(.cta,.section-cta,.nav-cta,.rm-cta):active{scale:.98}


/* scroll progress: a hairline of accent under the sticky nav */
.m-progress{position:absolute;left:0;right:0;bottom:-1px;height:2px;pointer-events:none;
  background:var(--accent-600);transform-origin:0 50%;transform:scaleX(var(--p,0))}

/* ------------------------------------------------------------ sections ---- */

/* the shared reveal, on the reference's softer curve and a little further */
.motion [data-reveal],
.motion [data-reveal-group] > *{
  transform:translateY(24px);
  transition:opacity .9s var(--ease-soft), transform .9s var(--ease-soft);
}
.motion [data-reveal].seen,
.motion [data-reveal-group] > .seen{transform:none}

/* card rows tilt up into place */
.motion :is(.bonus-grid,.recap-list,.tw-grid,.rm-stages) > *,
.motion .said{
  transform:perspective(1000px) rotateX(14deg) translateY(30px);
  transition:opacity .9s var(--ease-soft), transform 1s var(--ease-soft),
             translate .4s var(--ease-soft), box-shadow .4s ease, border-color .4s ease;
}
.motion :is(.bonus-grid,.recap-list,.tw-grid,.rm-stages) > .seen,
.motion .said.seen{transform:none}

/* section headings: word by word out of a blur, once the heading arrives */
.motion .wsplit .w{
  display:inline-block;opacity:0;filter:blur(8px);transform:translateY(.32em);
  transition:opacity .8s var(--ease-soft), filter .8s var(--ease-soft), transform .9s var(--ease-soft);
  transition-delay:calc(var(--i) * 45ms + .08s);
}
.motion .wsplit.seen .w,
.motion .seen .wsplit .w{opacity:1;filter:none;transform:none}
/* the heading box itself only fades, so the words carry the movement */
.motion .wsplit[data-reveal]{transform:none}

/* hover: cards lift (translate, so it never fights the reveal transform) */
.motion :is(.bonus,.said):hover{translate:0 -6px}
.motion .bonus:hover{box-shadow:var(--shadow-lg),0 30px 60px -30px rgb(var(--accent-rgb) / .35)}
.motion .recap-list > li:hover{translate:4px 0}
.motion .recap-list > li svg{transition:rotate .45s var(--ease-soft)}
.motion .recap-list > li:hover svg{rotate:-10deg}

@media (hover:none){
  .motion :is(.bonus,.said):hover,.motion .recap-list > li:hover,.motion .chip:hover{translate:none}
}

/* phones: lighter orbs, no pointer drift */
@media (max-width:760px){
  .motion .hero::before{width:340px;height:340px;left:-120px;top:20px}
  .motion .hero::after{width:380px;height:380px;right:-160px;top:300px}
}

/* ---- roadmap: each stage's mock UI plays once its card arrives ---- */
.motion .rm-checks li{opacity:0;translate:-8px 0;transition:opacity .5s var(--ease-soft), translate .5s var(--ease-soft)}
.motion .rm-card.seen .rm-checks li{opacity:1;translate:0 0}
.motion .rm-bars i::after{width:0;transition:width 1.1s var(--ease-soft)}
.motion .rm-card.seen .rm-bars i::after{width:var(--w)}
.motion .rm-path path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 1.4s var(--ease-soft) .35s}
.motion .rm-card.seen .rm-path path{stroke-dashoffset:0}
.motion .rm-node{scale:0;transition:scale .45s cubic-bezier(.34,1.56,.64,1)}
.motion .rm-card.seen .rm-node{scale:1}
.motion .rm-hired{opacity:0;translate:0 12px;transition:opacity .6s var(--ease-soft) 1.5s, translate .6s var(--ease-soft) 1.5s}
.motion .rm-card.seen .rm-hired{opacity:1;translate:0 0}
.motion .rm-card.seen .rm-checks li:nth-child(1),.motion .rm-card.seen .rm-bars li:nth-child(1) i::after{transition-delay:.35s}
.motion .rm-card.seen .rm-checks li:nth-child(2),.motion .rm-card.seen .rm-bars li:nth-child(2) i::after{transition-delay:.45s}
.motion .rm-card.seen .rm-checks li:nth-child(3),.motion .rm-card.seen .rm-bars li:nth-child(3) i::after{transition-delay:.55s}
.motion .rm-card.seen .rm-checks li:nth-child(4),.motion .rm-card.seen .rm-bars li:nth-child(4) i::after{transition-delay:.65s}
.motion .rm-card.seen .rm-node.n1{transition-delay:.35s}
.motion .rm-card.seen .rm-node.n2{transition-delay:.95s}
.motion .rm-card.seen .rm-node.n3{transition-delay:1.5s}
.motion .rm-node.n3::after{content:"";position:absolute;inset:-7px;border-radius:50%;border:1px solid var(--f);animation:m-ping 2.4s cubic-bezier(0,0,.2,1) 2.2s infinite;opacity:0}
.motion .rm-arrow{animation:m-nudge 2.6s ease-in-out infinite}
@keyframes m-nudge{ 50%{box-shadow:0 0 0 9px rgb(var(--accent-rgb) / .1)} }
.motion .rm-goal .rm-take-ic{animation:m-float 3.6s ease-in-out infinite}

/* ---- studio: the app mock comes alive once its frame arrives ---- */
.motion .st-live i::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid var(--st-red);animation:m-ping 2s cubic-bezier(0,0,.2,1) infinite}
.motion .st-rec{animation:m-blink 1.4s steps(1) infinite}
@keyframes m-blink{ 50%{opacity:.25} }
.motion .st-eq i{animation:m-eq .9s ease-in-out infinite alternate;transform-origin:bottom}
.motion .st-eq i:nth-child(2){animation-delay:-.3s}.motion .st-eq i:nth-child(3){animation-delay:-.6s}
@keyframes m-eq{ from{scale:1 .35} to{scale:1 1} }
.motion .st-caret{animation:m-blink 1s steps(1) infinite}
.motion .st-cursor{animation:m-cursor 6s ease-in-out infinite}
@keyframes m-cursor{ 0%,100%{translate:0 0} 40%{translate:-60px 16px} 70%{translate:-20px 8px} }
.motion .st-typed{max-width:0;transition:max-width 1.6s steps(34,end) .5s}
.motion .seen .st-typed{max-width:34ch}
.motion .st-prog i{width:0;transition:width 2.4s var(--ease-soft) 1.2s}
.motion .seen .st-prog i{width:38%}
.motion .st-msg,.motion .st-jump{opacity:0;translate:0 10px;transition:opacity .55s var(--ease-soft), translate .55s var(--ease-soft)}
.motion .seen .st-msg.me{opacity:1;translate:0 0;transition-delay:1.8s}
.motion .seen .st-msg.ai{opacity:1;translate:0 0;transition-delay:2.5s}
.motion .seen .st-jump{opacity:1;translate:0 0;transition-delay:3s}
.motion .st-pbtn{transition:scale .35s cubic-bezier(.34,1.56,.64,1)}
.motion .st-player:hover .st-pbtn{scale:1.08}
.motion .st-yt{animation:m-float 4s ease-in-out infinite}
