/* ai-ready.in motion tokens and reveal classes (BUILD_BRIEF §6.2–6.3).
   Rules: content is visible by default. Hidden start states apply only under html.motion-ok, which
   motion.js adds when JS runs AND the visitor has not asked for reduced motion. Opacity and
   transform only, plus stroke-dashoffset for fine lines. */

:root{
  --t-micro-d:150ms;      --t-micro-e:ease-out;
  --t-interface-d:240ms;  --t-interface-e:cubic-bezier(.2,.8,.2,1);
  --t-reveal-d:550ms;     --t-reveal-e:cubic-bezier(.22,1,.36,1);
  --t-hero-d:900ms;
  --stagger:75ms;
  --travel:16px;
}
/* shorthand tokens for component code */
:root{
  --t-micro:var(--t-micro-d) var(--t-micro-e);
  --t-interface:var(--t-interface-d) var(--t-interface-e);
  --t-reveal:var(--t-reveal-d) var(--t-reveal-e);
}

/* ---------- reveal: [data-reveal] rises var(--travel) and fades in once (.is-in) ---------- */
.motion-ok [data-reveal]{opacity:0;transform:translate3d(0,var(--travel),0);
  transition:opacity var(--t-reveal-d) var(--t-reveal-e),transform var(--t-reveal-d) var(--t-reveal-e);
  transition-delay:calc(var(--i,0) * var(--stagger))}
.motion-ok [data-reveal="fade"]{transform:none}
.motion-ok [data-reveal].is-in{opacity:1;transform:none}

/* ---------- rules extend from the left ---------- */
.motion-ok [data-extend]{transform:scaleX(0);transform-origin:left center;transition:transform var(--t-reveal-d) var(--t-reveal-e);transition-delay:calc(var(--i,0) * var(--stagger))}
.motion-ok [data-extend].is-in{transform:scaleX(1)}

/* ---------- SVG fine-line drawing: paths need pathLength="1" ---------- */
.motion-ok [data-draw] :is(path,line,circle,polyline){stroke-dasharray:1;stroke-dashoffset:1}
.motion-ok [data-draw].is-in :is(path,line,circle,polyline){stroke-dashoffset:0;transition:stroke-dashoffset var(--t-hero-d) var(--t-reveal-e);transition-delay:calc(var(--d,0ms) + var(--i,0) * 40ms)}

/* ---------- masked line rise (hero H1): <span class="mask"><span class="mask__in">…</span></span> ---------- */
.mask{display:block;overflow:clip;overflow-clip-margin:.18em;padding-bottom:.06em}
.motion-ok .is-hero .mask__in{display:block;animation:rise 700ms var(--t-reveal-e) both}
.motion-ok .is-hero .mask:nth-child(2) .mask__in{animation-delay:120ms}
@keyframes rise{from{transform:translate3d(0,var(--travel),0)}to{transform:none}}
/* Transform only: the text is visible from 0 ms (§6.3); the mask just trims the 16px rise.
   The CTAs never animate. */

/* ---------- hero art helpers ---------- */
.motion-ok .is-hero .sun-in{transform-box:fill-box;transform-origin:center;animation:sun var(--t-hero-d) var(--t-reveal-e) both}
@keyframes sun{from{transform:scale(.92);opacity:0}to{transform:none;opacity:1}}
.motion-ok .is-hero .profile-l{animation:meet-l var(--t-hero-d) var(--t-reveal-e) both}
.motion-ok .is-hero .profile-r{animation:meet-r var(--t-hero-d) var(--t-reveal-e) both}
@keyframes meet-l{from{transform:translateX(-6px)}to{transform:none}}
@keyframes meet-r{from{transform:translateX(6px)}to{transform:none}}

/* ---------- ticker: 60s linear loop, pause button sets [data-paused] ---------- */
.ticker__track{display:flex;width:max-content;gap:3rem;white-space:nowrap}
.motion-ok .ticker__track{animation:ticker 60s linear infinite}
.ticker[data-paused="true"] .ticker__track{animation-play-state:paused}
@keyframes ticker{to{transform:translate3d(-50%,0,0)}}

/* ---------- step crossfade (assessment, tab panels) ---------- */
.motion-ok .xfade-in{animation:xfade var(--t-interface-d) var(--t-interface-e) both}
@keyframes xfade{from{opacity:0;transform:translate3d(0,8px,0)}to{opacity:1;transform:none}}

/* ---------- assessment result: items unfold with a 75ms stagger (rendered by discover.js, so CSS-driven) ---------- */
.motion-ok .disc__view--result :is(.disc__idea,.disc__line){animation:unfold var(--t-reveal-d) var(--t-reveal-e) both}
.motion-ok .disc__view--result .disc__idea:nth-child(2){animation-delay:var(--stagger)}
.motion-ok .disc__view--result .disc__idea:nth-child(3){animation-delay:calc(2 * var(--stagger))}
.motion-ok .disc__view--result .disc__line{animation-delay:calc(3 * var(--stagger))}
.motion-ok .disc__view--result .disc__line+.disc__line{animation-delay:calc(4 * var(--stagger))}
@keyframes unfold{from{opacity:0;transform:translate3d(0,8px,0)}to{opacity:1;transform:none}}

/* ---------- sequence highlight (process stages, 300ms each) ---------- */
.motion-ok [data-seq].is-in>*{animation:seq 300ms var(--t-interface-e) both;animation-delay:calc(var(--i,0) * 300ms)}
@keyframes seq{50%{transform:translate3d(0,-4px,0)}}

/* ---------- hover shift for numerals ---------- */
.shift-on-hover{transition:transform var(--t-interface-d) var(--t-interface-e)}
:is(a,button):is(:hover,:focus-visible) .shift-on-hover{transform:translateX(8px)}

/* ---------- reduced motion: everything visible at rest, nothing moves ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:1ms!important;animation-iteration-count:1!important;transition-duration:1ms!important;transition-delay:0s!important;scroll-behavior:auto!important}
  [data-reveal],[data-extend]{opacity:1!important;transform:none!important}
  [data-draw] :is(path,line,circle,polyline){stroke-dashoffset:0!important}
  .ticker__track{animation:none!important;transform:none!important}
  .mask__in,.sun-in,.profile-l,.profile-r,.disc__idea,.disc__line{animation:none!important;transform:none!important;opacity:1!important}
}
@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
