/* Service pages: the motion layer (same signature as the landing page). Loaded after page.css.
   Everything here is progressive: without JavaScript, or with reduced motion, the pages stay as page.css draws them. */

/* scroll progress: a thin fibre under the bar */
.fx-prog{position:fixed;left:0;top:0;height:2px;width:100%;z-index:40;background:var(--grad);transform-origin:0 50%;transform:scaleX(0);pointer-events:none}

/* the bar slides away while reading down and comes back on the way up */
html.fx-ready .nav{transition:transform .5s cubic-bezier(.2,.8,.2,1)}
html.fx-ready.fx-navhide .nav{transform:translateY(-100%)}

/* page transitions: a black panel with the fibre line wipes over on leave and lifts on arrival */
.fx-cur{position:fixed;inset:0;z-index:60;background:var(--ink);pointer-events:none;clip-path:inset(100% 0 0 0);display:flex;align-items:center;justify-content:center}
.fx-cur::after{content:"";width:min(320px,50vw);height:2px;background:var(--grad);transform:scaleX(0);transform-origin:0 50%;transition:transform .5s .1s cubic-bezier(.65,0,.35,1)}
.fx-cur.leave{clip-path:inset(0 0 0 0);transition:clip-path .55s cubic-bezier(.76,0,.24,1)}
.fx-cur.leave::after{transform:scaleX(1)}
.fx-cur.arrive{clip-path:inset(0 0 0 0)}
.fx-cur.arrive::after{transform:scaleX(1);transition:none}
.fx-cur.arrive.go{clip-path:inset(0 0 100% 0);transition:clip-path .8s cubic-bezier(.76,0,.24,1)}

/* first paint: hide only what the script is about to bring in (never without JS, never under reduced motion) */
@media (scripting:enabled) and (prefers-reduced-motion:no-preference){
  html:not(.fx-off) .hero h1,html:not(.fx-off) .hero .kick,html:not(.fx-off) .hero .lead,html:not(.fx-off) .hero .row{opacity:0}
  html:not(.fx-ready):not(.fx-off) .hero h1,html:not(.fx-ready):not(.fx-off) .hero .kick,html:not(.fx-ready):not(.fx-off) .hero .lead,html:not(.fx-ready):not(.fx-off) .hero .row{animation:fxFail 0s 2.5s forwards}
}
@keyframes fxFail{to{opacity:1}}

/* words rise out of their own masks */
.fx-wm{display:inline-block;overflow:hidden;vertical-align:top;padding:.12em .04em .14em;margin:-.12em -.04em -.14em}
.fx-wi{display:inline-block;transform:translateY(118%) rotate(5deg);transform-origin:0 100%;transition:transform 1.2s cubic-bezier(.16,1,.3,1)}
.fx-in .fx-wi{transform:none}

/* generic rise */
html.fx-ready .fx-r{opacity:0;transform:translateY(28px);transition:opacity 1s cubic-bezier(.2,.8,.2,1),transform 1.1s cubic-bezier(.16,1,.3,1)}
html.fx-ready .fx-r.fx-in{opacity:1;transform:none}
html.fx-ready .hero .kick.fx-r{transform:translateX(-18px)}
html.fx-ready .hero .kick.fx-r.fx-in{transform:none}

/* hero picture: opens from a rounded inset, the photo settles from 1.15 and drifts with the scroll */
html.fx-ready .hero figure{clip-path:inset(7% 7% 7% 7% round 28px);transition:clip-path 1.4s cubic-bezier(.76,0,.24,1)}
html.fx-ready .hero figure.fx-in{clip-path:inset(0 0 0 0 round 22px)}
html.fx-ready .hero figure img{transform:scale(1.15) translateY(var(--py,0px));transition:transform 1.6s cubic-bezier(.16,1,.3,1);will-change:transform}
html.fx-ready .hero figure.fx-in img{transform:scale(1.08) translateY(var(--py,0px))}
html.fx-ready .hero figure.fx-in.fx-live img{transition:none}

/* cards: a soft light follows the pointer and the border turns into the fibre gradient */
.card{position:relative;isolation:isolate;transition:transform .6s cubic-bezier(.2,.8,.2,1),border-color .3s}
.card::before{content:"";position:absolute;inset:0;border-radius:inherit;z-index:-1;opacity:0;transition:opacity .4s;
  background:radial-gradient(420px circle at var(--mx,50%) var(--my,50%),rgba(30,91,255,.16),rgba(53,234,82,.06) 40%,transparent 70%)}
.card::after{content:"";position:absolute;inset:-1px;border-radius:inherit;padding:1px;background:var(--grad);opacity:0;transition:opacity .4s;pointer-events:none;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
@media (hover:hover){.card:hover{transform:translateY(-4px)}.card:hover::before,.card:hover::after{opacity:1}}

/* project pictures: slow zoom on hover, the caption title underlines in the gradient */
.proj figure{position:relative;transition:border-color .3s}
.proj figure img{transition:transform 1.2s cubic-bezier(.16,1,.3,1)}
.proj figure h3{background:linear-gradient(var(--white),var(--white)) 0 100%/0 1px no-repeat;display:inline;transition:background-size .6s cubic-bezier(.2,.8,.2,1)}
@media (hover:hover){.proj figure:hover img{transform:scale(1.06)}.proj figure:hover h3{background-image:var(--grad);background-size:100% 1px}}
.proj figure{overflow:hidden}

/* process: each step's hairline draws from the left as it arrives */
.steps li{position:relative}
html.fx-ready .steps li::after{content:"";position:absolute;left:0;bottom:-1px;height:1px;width:100%;background:var(--grad);transform:scaleX(0);transform-origin:0 50%;transition:transform 1.2s cubic-bezier(.65,0,.35,1) .2s}
html.fx-ready .steps li.fx-in::after{transform:scaleX(1);opacity:.7}
.facts b{font-variant-numeric:tabular-nums}

/* buttons: gradient ring like the landing page, magnetic on a mouse */
.btn{position:relative;transition:transform .5s cubic-bezier(.2,.8,.2,1),background .25s}
.btn:not(.solid){border-color:transparent;background:rgba(8,12,16,.42)}
.btn:not(.solid)::before{content:"";position:absolute;inset:0;border-radius:inherit;padding:1px;background:var(--grad);pointer-events:none;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
@media (hover:hover){.btn:not(.solid):hover{background:rgba(30,91,255,.22)}}

/* links in the bar and the footer roll their label */
.fx-roll{display:inline-grid;overflow:hidden;vertical-align:top}
.fx-roll>span{grid-area:1/1;transition:translate .55s cubic-bezier(.2,.8,.2,1)}
.fx-roll>span+span{translate:0 105%}
a:hover>.fx-roll>span:first-child,a:focus-visible>.fx-roll>span:first-child{translate:0 -105%}
a:hover>.fx-roll>span+span,a:focus-visible>.fx-roll>span+span{translate:0 0}

/* cursor (mouse and trackpad only) */
.fx-dot,.fx-ring{position:fixed;left:0;top:0;z-index:70;pointer-events:none;border-radius:50%;mix-blend-mode:difference;opacity:0;transition:opacity .3s}
html.fx-cur-in .fx-dot,html.fx-cur-in .fx-ring{opacity:1}
html.fx-has-cur,html.fx-has-cur *{cursor:none!important}
html.fx-has-cur :is(input,textarea){cursor:text!important}
.fx-dot{width:6px;height:6px;margin:-3px 0 0 -3px;background:#fff}
.fx-ring{width:40px;height:40px;margin:-20px 0 0 -20px;border:1px solid rgba(255,255,255,.6);
  transition:opacity .3s,width .45s cubic-bezier(.2,.8,.2,1),height .45s cubic-bezier(.2,.8,.2,1),margin .45s cubic-bezier(.2,.8,.2,1),background-color .45s,border-color .45s}
html.fx-link .fx-ring{width:64px;height:64px;margin:-32px 0 0 -32px;background:#fff;border-color:transparent}
html.fx-link .fx-dot{opacity:0}
html.fx-down .fx-ring{width:30px;height:30px;margin:-15px 0 0 -15px}

@media (prefers-reduced-motion:reduce){.fx-prog,.fx-cur,.fx-dot,.fx-ring{display:none}.fx-roll>span+span{display:none}.fx-roll>span{translate:none!important}.card,.btn{transition:none}}
@media (pointer:coarse){.fx-dot,.fx-ring{display:none}}

/* e2e pass: photo reveals in the project grid, FAQ hover */
html.fx-ready .proj figure{clip-path:inset(8% 5% 8% 5% round 18px);transition:clip-path 1.3s cubic-bezier(.76,0,.24,1),border-color .3s}
html.fx-ready .proj figure.fx-in{clip-path:inset(0 round 18px)}
.faq-i summary{transition:color .3s,padding-left .5s cubic-bezier(.2,.8,.2,1)}
@media (hover:hover){.faq-i summary:hover{color:var(--white);padding-left:8px}}
@media (prefers-reduced-motion:reduce){html.fx-ready .proj figure{clip-path:none}.faq-i summary{transition:none}}
