/* Groundup motion layer (preview). Loaded after style.css.
   Rules: transform/opacity only (plus two tiny paint-only effects: hazard strips and highlighter marks),
   content visible without JS, nothing moves under prefers-reduced-motion.
   Hero: CSS-only keyframes gated on .js (set synchronously in <head>), fill-mode both, so it always ends visible.
   Everything else: gated on .js-motion, which js/motion.js adds before it hides anything. */

/* ---------- 1. Hero ---------- */
@keyframes m-up{from{opacity:0;transform:translateY(105%)}to{opacity:1;transform:none}}
@keyframes m-fade{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes m-card{from{opacity:0;transform:translate(56px,18px) rotate(2.5deg)}to{opacity:1;transform:none}}
@keyframes m-sweep{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes m-haz{from{transform:translateX(0)}to{transform:translateX(25.456px)}}
.hw{display:inline-block;overflow:hidden;vertical-align:top;padding:.1em .04em .14em;margin:-.1em -.04em -.14em}
.hw>span{display:inline-block}
.js .hero .chips{animation:m-fade .6s var(--ease) both}
.js .hero .h1-kicker{animation:m-fade .6s var(--ease) .08s both}
.js .hero .hw>span{animation:m-up .75s var(--ease) both;animation-delay:calc(.18s + var(--i,0)*.07s)}
.js .hero h1 em{position:relative;display:inline-block}
.js .hero h1 em::after{content:"";position:absolute;left:.02em;right:.02em;bottom:-.075em;height:.07em;background:var(--accent);transform-origin:0 50%;animation:m-sweep .55s var(--ease) .78s both}
.js .hero .lead{animation:m-fade .7s var(--ease) .5s both}
.js .hero .hero-cta,.js .hero .hero-note{animation:m-fade .7s var(--ease) .62s both}
.js .hero-card{animation:m-card .95s var(--ease) .3s both}
.hero-card::before,.hero-card::after{background-size:25.456px 25.456px;animation:m-haz 2.4s linear infinite;will-change:transform}
.hero-card::after{animation-direction:reverse}
/* js/motion.js adds .m-off while these loops are off-screen */
.ticker.m-off .ticker-track,.hero-card.m-off::before,.hero-card.m-off::after{animation-play-state:paused}
/* Inner page hero: lighter version */
.js .page-hero h1{animation:m-fade .7s var(--ease) .05s both}
.js .page-hero .lead,.js .page-hero .hero-cta,.js .page-hero .meta-line{animation:m-fade .7s var(--ease) .2s both}
@media (max-width:900px){@keyframes m-card{from{opacity:0;transform:translateY(30px) rotate(1deg)}to{opacity:1;transform:none}}}

/* ---------- 2. Scroll reveals ---------- */
.js-motion .m-rv{opacity:0;transform:translateY(22px);transition:opacity .7s var(--ease),transform .7s var(--ease);transition-delay:var(--d,0s)}
.js-motion .m-rv.m-in{opacity:1;transform:none}
/* Section rule draws in */
.js-motion .eyebrow.bar::after{transform:scaleX(0);transform-origin:0 50%;transition:transform .7s var(--ease) .2s}
.js-motion .eyebrow.bar.m-in::after{transform:none}
/* Highlighter marks sweep left to right (paint-only, no layout) */
.js-motion .paper mark,.js-motion .paper h2 em{background-repeat:no-repeat;background-size:0 100%}
.js-motion .paper mark.m-in,.js-motion .paper h2 em.m-in{background-size:100% 100%;animation:m-mark .8s var(--ease) .35s both}
@keyframes m-mark{from{background-size:0 100%}to{background-size:100% 100%}}
/* Big outlined numerals: a lime fill scans up through the outline */
.js-motion .big-n{position:relative}
.js-motion .big-n::after{content:attr(data-n);position:absolute;left:0;top:0;color:var(--accent);-webkit-text-stroke:0;clip-path:inset(100% 0 0 0)}
.js-motion .big-n.m-in::after{animation:m-scan 1.3s var(--ease) var(--d,0s) both}
@keyframes m-scan{0%{clip-path:inset(100% 0 0 0)}45%{clip-path:inset(0 0 0 0)}100%{clip-path:inset(0 0 100% 0)}}

/* ---------- 3. Ticker (speed is driven by JS playbackRate) ---------- */

/* ---------- 4. Industry tiles ---------- */
/* Service index motion lives with its layout in style.css ("03 Service index"). */
.ind-letter{transition:transform .5s var(--ease),color .3s;transform:translate(calc(var(--mx,0)*16px),calc(var(--my,0)*12px))}
.ind:hover .ind-letter,.ind:focus-visible .ind-letter{color:rgba(203,244,66,.14);transform:translate(calc(-10px + var(--mx,0)*16px),calc(-8px + var(--my,0)*12px))}
.ind:focus-visible{transform:translateY(-3px);border-color:var(--accent)}

/* ---------- 5. Services list: lime fill wipe ---------- */
.disc a{position:relative;isolation:isolate}
.disc a::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--accent);transform:scaleX(0);transform-origin:0 50%;transition:transform .4s var(--ease)}
.disc a:hover::before,.disc a:focus-visible::before{transform:none}
.disc a:hover .d-name,.disc a:hover .d-n,.disc a:hover .d-desc,.disc a:hover .d-arr,
.disc a:focus-visible .d-name,.disc a:focus-visible .d-n,.disc a:focus-visible .d-desc,.disc a:focus-visible .d-arr{color:var(--ink)}
.disc a:focus-visible .d-arr{transform:translateX(5px)}
.disc a:focus-visible{outline-color:var(--paper)}

/* ---------- 6. Buttons: magnetic offset (JS sets --bx/--by) + press ---------- */
.btn{transform:translate(var(--bx,0),var(--by,0)) scale(var(--bs,1))}
.btn:active{--bs:.96}

/* ---------- 7. Cursor dot (JS creates it on fine pointers only) ---------- */
.m-cur{position:fixed;left:0;top:0;z-index:9990;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 1.5px var(--ink);pointer-events:none;opacity:0;transition:opacity .2s,background-color .15s,box-shadow .15s}
.m-cur>i{display:block;width:100%;height:100%;border-radius:50%;background:inherit;transition:transform .25s var(--ease),opacity .25s}
.m-cur.on{opacity:1}
.m-cur.big>i{transform:scale(3.4);opacity:.45}
/* Over lime / green backgrounds the dot turns ink (js/motion.js toggles .on-lime); elsewhere it stays lime. */
.m-cur.on-lime{background:var(--ink);box-shadow:0 0 0 1.5px rgba(251,250,247,.55)}

/* ---------- 9. Footer wordmark letters ---------- */
.foot-word .fl{display:inline-block}
.js-motion .foot-word .fl{opacity:0;transform:translateY(55%);transition:opacity .6s var(--ease),transform .7s var(--ease);transition-delay:calc(var(--i,0)*.05s)}
.js-motion .foot-word.m-in .fl{opacity:1;transform:none}
/* Lime scan: a lime copy of the outline is wiped across once after the letters land (runs once; then static). */
.js-motion .foot-word::after{content:attr(data-text);position:absolute;left:0;top:0;color:transparent;-webkit-text-stroke:1.2px var(--accent);clip-path:inset(0 100% 0 0);pointer-events:none}
.js-motion .foot-word.m-in::after{animation:fw-scan 1.8s var(--ease) .7s 1 both}
@keyframes fw-scan{0%{clip-path:inset(0 100% 0 0)}55%{clip-path:inset(0 0 0 0)}100%{clip-path:inset(0 0 0 100%)}}
.js-motion .fw-ast{transform:scale(0) rotate(-140deg);transition:transform .9s var(--ease) 1.4s}
.js-motion .foot-word.m-in + .fw-ast{transform:none}

@media (prefers-reduced-motion:reduce){
  .hero-card::before,.hero-card::after{animation:none}
  .btn,.ind-letter{transform:none}
  .m-cur{display:none}
}
