/*
 * motion.css: motion & micro-interaction layer (pairs with motion.js).
 * Every hidden / initial state is gated by html.motion-ready (set by motion.js,
 * which never sets it under prefers-reduced-motion), so content is fully visible
 * without JS. Individual `translate` / `scale` properties are used instead of
 * `transform` so they compose with any transform styles.css applies.
 */
:root {
  --mo-ease: cubic-bezier(.65, 0, .35, 1);
  --mo-ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Always-safe helpers (only exist when motion.js created them) */
.mo-line { display: inline-block; }
.stat-card > strong > .mo-sr,
.mo-sr { all: unset; position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.stat-card > strong > .mo-count { all: unset; display: inline-block; white-space: nowrap; }
.stat-card > strong > .mo-count.mo-counting { font-variant-numeric: tabular-nums; }

/* CTA effect layers */
:where(.mo-btn) { position: relative; isolation: isolate; }
.mo-btn > .mo-fx { all: unset; position: absolute; inset: 0; z-index: 1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.mo-btn > .mo-fx > .mo-shine { all: unset; position: absolute; top: -10%; bottom: -10%; left: 0; width: 42%; translate: -130% 0; background: linear-gradient(100deg, transparent 15%, rgba(255, 255, 255, .55) 50%, transparent 85%); }
.announce-cta.mo-btn > .mo-fx > .mo-shine { background: linear-gradient(100deg, transparent 15%, rgba(208, 254, 22, .32) 50%, transparent 85%); }
.mo-btn > .mo-halo { all: unset; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: 0 0 30px 6px rgba(208, 254, 22, .5); }

/* Card spotlight (pointer-tracked, fine pointers only; JS sets --mx/--my) */
:where(.mo-spot-host) { position: relative; }
.mo-spot-host > .mo-spot { all: unset; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0; mix-blend-mode: screen; transition: opacity .35s ease; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(208, 254, 22, .16), transparent 65%); }
.mo-spot-host > .mo-spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(208, 254, 22, .9), transparent 65%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.mo-spot-host.is-spot > .mo-spot { opacity: 1; }

/* Ticker: pause on hover / keyboard focus */
@media (hover: hover) { .ticker:hover .ticker-track { animation-play-state: paused; } }
.ticker:focus-within .ticker-track { animation-play-state: paused; }

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance (< 1s total; never touches the hero photo or .stage) */
  @keyframes mo-intro {
    from { opacity: 0; translate: 0 14px; filter: blur(6px); }
    to { opacity: 1; translate: 0 0; filter: blur(0); }
  }
  .mo-intro .mo-intro-item { animation: mo-intro .55s var(--mo-ease-out) both; animation-delay: calc(var(--mo-i, 0) * 60ms); }

  /* Scroll reveals */
  .motion-ready .mo-reveal:not(.is-in) { opacity: .4; }
  .motion-ready .mo-r-head:not(.is-in) { translate: 0 26px; }
  .motion-ready .mo-r-card:not(.is-in) { translate: 0 36px; scale: .965; }
  .motion-ready .mo-r-side:not(.is-in) { translate: -22px 0; }
  .motion-ready .mo-r-soft:not(.is-in) { translate: 0 14px; }
  .motion-ready .mo-reveal.is-in {
    transition:
      opacity .7s var(--mo-ease-out) var(--mo-d, 0ms),
      translate .8s var(--mo-ease-out) var(--mo-d, 0ms),
      scale .8s var(--mo-ease-out) var(--mo-d, 0ms);
  }

  /* Timeline line fills with scroll (--tl-progress 0..1, default full) */
  .motion-ready .host-note .timeline::before { transform-origin: 50% 0; transform: scaleY(var(--tl-progress, 1)); transition: transform .15s linear; }
  .motion-ready .host-note .tl-item .tl-mark { transition: opacity .45s ease, scale .5s var(--mo-ease-out); }
  .motion-ready .host-note .tl-item:not(.is-lit) .tl-mark { opacity: .3; scale: .8; }

  /* CTA shine sweep (idle, staggered per button) + hover sweep + glow pulse */
  @keyframes mo-sweep { 0% { translate: -130% 0; } 14%, 100% { translate: 340% 0; } }
  @keyframes mo-sweep-hover { from { translate: -130% 0; } to { translate: 340% 0; } }
  @keyframes mo-halo { 0%, 100% { opacity: 0; } 50% { opacity: .85; } }
  .mo-btn > .mo-fx > .mo-shine { animation: mo-sweep 6.5s var(--mo-ease) var(--mo-sd, 1.4s) infinite; }
  .mo-btn > .mo-halo { animation: mo-halo 3.2s ease-in-out infinite; }
  @media (hover: hover) {
    .mo-btn:hover > .mo-fx > .mo-shine { animation: mo-sweep-hover .8s var(--mo-ease) both; }
  }
}
