/*
 * Juniper Kite ABA Services — motion.css
 * Premium motion layer: logo intro, masked text reveals, clip-path morphs,
 * blob morphs, 3D tilt + glare, magnetic buttons, custom cursor, scroll progress.
 * Everything here is progressive: without JS, or with reduced motion / "Pause
 * animations" on, content shows immediately.
 * WordPress: enqueue as 'jk-motion' after 'jk-sections'.
 */
@property --ang{syntax:'<angle>';initial-value:0deg;inherits:false}

/* ================= LOGO INTRO ================= */
.loader{position:fixed;inset:0;z-index:300;display:none;pointer-events:none}
html.is-loading .loader,.loader.exiting{display:block}
html.is-loading body{overflow:hidden}
.ld-panel{position:absolute;inset:0;will-change:transform}
.ld-sky{background:var(--sky)}
.ld-teal{background:var(--teal)}
.ld-white{display:grid;place-items:center;background:#fff;overflow:hidden}
.ld-white::before{content:"";position:absolute;width:70vmax;height:70vmax;border-radius:50%;background:radial-gradient(closest-side,rgba(178,222,244,.55),rgba(178,222,244,0));animation:ldGlow 3s ease-in-out infinite alternate}
@keyframes ldGlow{from{transform:scale(.8)}to{transform:scale(1.1)}}
.ld-center{position:relative;display:flex;flex-direction:column;align-items:center;transition:transform .7s cubic-bezier(.76,0,.24,1),opacity .5s}
.ld-kite{width:64px;height:auto;margin-bottom:6px;overflow:visible;animation:ldKiteIn 1.4s cubic-bezier(.2,.8,.2,1) both,ldKiteFloat 2.6s 1.4s ease-in-out infinite}
.ld-kite path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.ld-kite-body{stroke:var(--teal);stroke-width:3;stroke-dasharray:300;stroke-dashoffset:300;fill:rgba(65,174,228,0);animation:ldDraw 1.1s .15s var(--ease) forwards,ldFill .6s 1s var(--ease) forwards}
.ld-kite-cross{stroke:#fff;stroke-width:2;opacity:0;animation:ldFade .4s 1.15s forwards}
.ld-kite-tail{stroke:var(--sky);stroke-width:2.5;stroke-dasharray:80;stroke-dashoffset:80;animation:ldDraw .9s .7s var(--ease) forwards}
@keyframes ldDraw{to{stroke-dashoffset:0}}
@keyframes ldFill{to{fill:var(--sky)}}
@keyframes ldFade{to{opacity:1}}
@keyframes ldKiteIn{from{transform:translate(-120px,90px) rotate(-30deg) scale(.6);opacity:0}to{transform:none;opacity:1}}
@keyframes ldKiteFloat{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-8px) rotate(6deg)}}
.ld-logo{width:260px;clip-path:inset(0 100% 0 0);filter:blur(10px);transform:scale(.94);animation:ldLogo 1.1s .45s cubic-bezier(.65,0,.25,1) forwards}
.ld-logo img{width:100%;height:auto}
@keyframes ldLogo{to{clip-path:inset(0 -2% 0 0);filter:blur(0);transform:none}}
.ld-bar{position:relative;width:240px;height:2px;margin-top:22px;border-radius:2px;background:#e6eced;overflow:hidden}
.ld-bar span{position:absolute;inset:0;background:linear-gradient(90deg,var(--sky),var(--teal));transform-origin:left;transform:scaleX(0)}
.ld-slogan{margin-top:18px;font-size:.95rem;letter-spacing:.2em;text-transform:uppercase;color:var(--teal);text-align:center;max-width:90vw}
.ld-slogan .ch{display:inline-block;white-space:pre;opacity:0;transform:translateY(.9em) rotate(6deg);animation:chUp .7s var(--ease) forwards;animation-delay:calc(1.05s + var(--i) * 22ms)}
@keyframes chUp{to{opacity:1;transform:none}}
.ld-count{position:absolute;right:5vw;bottom:5vh;font-family:var(--display);font-weight:500;font-size:clamp(3rem,9vw,7.5rem);line-height:1;color:var(--sky-soft);font-variant-numeric:tabular-nums}
/* exit: three panels wipe upward with a morphing curved edge */
.loader.exiting .ld-center{transform:translateY(-50px);opacity:0}
.loader.exiting .ld-count{opacity:0;transition:opacity .3s}
.loader.exiting .ld-panel{transform:translateY(-105%);border-radius:0 0 50% 50%/0 0 18vh 18vh;transition:transform 1.05s cubic-bezier(.76,0,.24,1),border-radius 1.05s cubic-bezier(.76,0,.24,1)}
.loader.exiting .ld-white{transition-delay:.1s}
.loader.exiting .ld-teal{transition-delay:.22s}
.loader.exiting .ld-sky{transition-delay:.34s}
.loader.quick .ld-kite,.loader.quick .ld-kite *,.loader.quick .ld-logo,.loader.quick .ld-slogan .ch{animation-duration:.5s;animation-delay:0s}
.loader.quick .ld-slogan{display:none}

/* Hero animations wait for the intro to finish */
html.is-loading .hero [data-load],html.is-loading .hero .li,html.is-loading .soar img,html.is-loading .hero-bg{animation-play-state:paused!important}

/* ================= HERO ================= */
.hero-bg{animation:heroZoom 2.8s cubic-bezier(.2,.7,.2,1) both;translate:var(--px,0) var(--py,0);transition:translate .9s cubic-bezier(.2,.8,.2,1)}
@keyframes heroZoom{from{transform:scale(1.1)}to{transform:scale(1.02)}}
.hero-title .line{display:block;overflow:hidden;padding-bottom:.1em;margin-bottom:-.1em}
.hero-title .li{display:block}
html.js .hero-title .li{transform:translateY(112%) skewY(7deg);animation:lineUp 1.25s var(--ease) forwards;animation-delay:var(--d,0s)}
@keyframes lineUp{to{transform:none}}
.soar.float img{animation:soarFloat 6s ease-in-out infinite!important}
html.js .soar.float img{clip-path:none}
@keyframes soarFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px) rotate(-.6deg)}}
.hero-blob{position:absolute;pointer-events:none;filter:blur(50px);opacity:.6;animation:morph 16s ease-in-out infinite alternate}
.hb1{left:-120px;top:120px;width:520px;height:460px;background:#fff}
.hb2{left:28%;bottom:-160px;width:420px;height:360px;background:var(--sky-soft);opacity:.35;animation-duration:20s;animation-direction:alternate-reverse}
@keyframes morph{
  0%{border-radius:42% 58% 63% 37%/45% 41% 59% 55%;transform:translate(0,0) rotate(0)}
  33%{border-radius:63% 37% 38% 62%/58% 63% 37% 42%;transform:translate(30px,-24px) rotate(40deg)}
  66%{border-radius:38% 62% 46% 54%/36% 52% 48% 64%;transform:translate(-18px,18px) rotate(80deg)}
  100%{border-radius:55% 45% 32% 68%/62% 38% 62% 38%;transform:translate(12px,8px) rotate(120deg)}
}
.scroll-cue{position:absolute;left:50%;bottom:30px;z-index:3;width:28px;height:46px;margin-left:-14px;border:2px solid rgba(2,61,72,.5);border-radius:16px;opacity:0;animation:rise 1s 1.4s var(--ease) forwards}
.scroll-cue span{position:absolute;left:50%;top:8px;width:4px;height:8px;margin-left:-2px;border-radius:2px;background:var(--teal);animation:cue 1.8s ease-in-out infinite}
@keyframes cue{0%{transform:translateY(0);opacity:1}70%{transform:translateY(14px);opacity:0}100%{opacity:0}}
html.is-loading .scroll-cue{animation-play-state:paused}

/* ================= SPLIT HEADINGS ================= */
html.js .split[data-reveal]{opacity:1;transform:none}
.split .w{display:inline-block;overflow:hidden;vertical-align:top;padding-bottom:.14em;margin-bottom:-.14em}
.split .wi{display:inline-block}
html.js .split .wi{transform:translateY(108%) rotate(3deg);opacity:0;filter:blur(8px);transition:transform 1.05s var(--ease),opacity .8s var(--ease),filter .9s var(--ease);transition-delay:calc(var(--d,0s) + var(--i,0) * 65ms)}
html.js .split.in .wi{transform:none;opacity:1;filter:none}

/* ================= SCRIPT "HANDWRITING" REVEAL ================= */
html.js .script-write[data-reveal]{opacity:1;transform:none}
html.js img.script-write,html.js .script-write img{clip-path:inset(0 100% 0 0);transition:clip-path 1.9s cubic-bezier(.55,.1,.3,1);transition-delay:calc(var(--d,0s) + .15s)}
html.js img.script-write.in,html.js .script-write.in img{clip-path:inset(-10% -3% -10% 0)}

/* ================= ABOUT: clip-path morph + blob ================= */
.about-visual{isolation:isolate}
html.js .about-media{clip-path:inset(9% 14% 9% 14% round 160px);opacity:1!important;transform:none!important;transition:clip-path 1.6s var(--ease)}
html.js .about-media.in{clip-path:inset(0 0 0 0 round 76px)}
.about-media img{transform:scale(1.2)!important;translate:0 var(--py,0);transition:transform 1.8s var(--ease)!important}
.about-media.in img{transform:scale(1.1)!important}
.morph-blob{position:absolute;inset:-34px -30px -30px -40px;z-index:-1;background:linear-gradient(135deg,var(--sky-soft),rgba(65,174,228,.1));opacity:.7;animation:morphFlat 14s ease-in-out infinite alternate}
@keyframes morphFlat{0%{border-radius:42% 58% 63% 37%/45% 41% 59% 55%;transform:translate(0,0)}50%{border-radius:63% 37% 38% 62%/58% 63% 37% 42%;transform:translate(14px,-10px)}100%{border-radius:38% 62% 46% 54%/36% 52% 48% 64%;transform:translate(-10px,8px)}}
.about-badge{animation:badgeFloat 6s ease-in-out infinite}
@keyframes badgeFloat{0%,100%{translate:0 0}50%{translate:0 -10px}}

/* ================= 3D TILT + GLARE ================= */
[data-tilt]{position:relative}
[data-tilt]::after{content:"";position:absolute;inset:0;z-index:4;border-radius:inherit;pointer-events:none;background:radial-gradient(520px circle at var(--gx,50%) var(--gy,50%),rgba(255,255,255,.55),rgba(255,255,255,0) 42%);opacity:0;mix-blend-mode:soft-light;transition:opacity .45s var(--ease)}
.tilt-on::after{opacity:1}
.tilt-on{transform:perspective(1100px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(var(--ty,0px))!important;transition:transform .18s linear,box-shadow .5s var(--ease)!important}
.card.tilt-on{--ty:-8px}
.tilt-out{transition:transform .8s var(--ease),box-shadow .5s var(--ease)!important}

/* card images wipe in */
html.js .card .card-media img{clip-path:inset(100% 0 0 0);transition:transform .9s var(--ease),clip-path 1.25s var(--ease) calc(var(--d,0s) + .15s)}
html.js .card.in .card-media img{clip-path:inset(0)}

/* icon morph on hover */
.ico{transition:transform .5s var(--ease),box-shadow .5s var(--ease),background-color .4s var(--ease),border-radius .8s var(--ease)!important}
.feature:hover .ico,.card:hover .ico,.card:focus-within .ico,.mv-card:hover .ico,.role:hover .ico,.faq-help:hover .ico,.step-btn:hover .ico{border-radius:42% 58% 55% 45%/52% 44% 56% 48%}
.mv-card:hover .ico,.role:hover .ico,.faq-help:hover .ico{transform:rotate(-8deg) scale(1.05)}

/* ================= BUTTONS: magnetic + shine ================= */
.btn{translate:var(--mx,0px) var(--my,0px);transition:color .35s var(--ease),background-color .35s var(--ease),border-color .35s var(--ease),transform .35s var(--ease),box-shadow .35s var(--ease),translate .6s cubic-bezier(.2,.8,.2,1)}
.btn.magnet-on{transition:color .35s var(--ease),background-color .35s var(--ease),border-color .35s var(--ease),transform .35s var(--ease),box-shadow .35s var(--ease),translate .12s linear}
.btn::after{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:-70%;width:45%;background:linear-gradient(100deg,rgba(255,255,255,0),rgba(255,255,255,.42),rgba(255,255,255,0));transform:skewX(-22deg);pointer-events:none}
.btn:hover::after,.btn:focus-visible::after{animation:shine 1s var(--ease)}
@keyframes shine{from{left:-70%}to{left:135%}}

/* ================= CURSOR ================= */
.cursor{display:none}
@media (hover:hover) and (pointer:fine){html.js .cursor{display:block}}
.cursor span{position:fixed;left:0;top:0;z-index:250;border-radius:50%;pointer-events:none;will-change:transform}
.cursor-dot{width:6px;height:6px;margin:-3px 0 0 -3px;background:var(--sky)}
.cursor-ring{width:38px;height:38px;margin:-19px 0 0 -19px;border:1.5px solid rgba(65,174,228,.55);transition:width .35s var(--ease),height .35s var(--ease),margin .35s var(--ease),background-color .35s,border-color .35s,opacity .3s}
.cursor.hover .cursor-ring{width:66px;height:66px;margin:-33px 0 0 -33px;background:rgba(65,174,228,.1);border-color:rgba(65,174,228,.25)}
.cursor.down .cursor-ring{width:30px;height:30px;margin:-15px 0 0 -15px}
.cursor.gone span{opacity:0}

/* ================= SCROLL PROGRESS + HEADER ================= */
.scroll-progress{position:fixed;top:0;left:0;right:0;z-index:70;height:3px;pointer-events:none}
.scroll-progress span{display:block;height:100%;background:linear-gradient(90deg,var(--sky),var(--teal));transform-origin:left;transform:scaleX(var(--p,0))}
.site-header{transition:height .45s var(--ease),box-shadow .45s var(--ease),border-radius .45s var(--ease),transform .6s var(--ease)}
.site-header.hide{transform:translateY(-115%)}

/* ================= MISSION KITE / GS BLOB / FLY KITES / CTA ================= */
.mv-kite svg{animation:kiteFloat 6s ease-in-out infinite}
.mv-kite .k-tail{transform-box:fill-box;transform-origin:top center;animation:tail 2.6s ease-in-out infinite}
@keyframes kiteFloat{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-16px) rotate(5deg)}}
@keyframes tail{0%,100%{transform:rotate(-7deg)}50%{transform:rotate(7deg)}}
.gs-blob{animation:morphFlat 18s ease-in-out infinite alternate}

.fly-kites{position:absolute;inset:0;z-index:-1;pointer-events:none}
.fk{position:absolute;width:46px;overflow:visible}
.fk path{fill:rgba(65,174,228,.85);stroke:var(--teal);stroke-width:1.5;stroke-linejoin:round}
.fk .x{fill:none;stroke:rgba(255,255,255,.85)}
.fk .t{fill:none;stroke:var(--teal);stroke-linecap:round}
.fk1{left:7%;top:18%;animation:drift1 11s ease-in-out infinite alternate}
.fk2{left:20%;top:62%;width:30px;opacity:.7;animation:drift2 14s ease-in-out infinite alternate}
.fk3{right:10%;top:12%;width:36px;opacity:.85;animation:drift3 12s ease-in-out infinite alternate}
@keyframes drift1{from{transform:translate(0,0) rotate(-12deg)}to{transform:translate(60px,-40px) rotate(10deg)}}
@keyframes drift2{from{transform:translate(0,0) rotate(8deg)}to{transform:translate(-40px,-60px) rotate(-14deg)}}
@keyframes drift3{from{transform:translate(0,0) rotate(-6deg)}to{transform:translate(-70px,30px) rotate(12deg)}}

.cta-card{position:relative}
.cta-card::before{content:"";position:absolute;inset:0;border-radius:inherit;padding:2px;pointer-events:none;background:conic-gradient(from var(--ang),rgba(65,174,228,0) 0deg,var(--sky) 60deg,rgba(255,255,255,.95) 110deg,rgba(65,174,228,0) 170deg,rgba(65,174,228,0) 360deg);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;animation:spinAng 7s linear infinite}
@keyframes spinAng{to{--ang:360deg}}

/* timeline cards slide from their side */
html.js .tl-item[data-reveal]{transform:none;opacity:1}
html.js .tl-item .tl-card{opacity:0;transform:translateX(40px) scale(.97);transition:opacity .9s var(--ease),transform 1s var(--ease)}
html.js .tl-item:nth-of-type(even) .tl-card{transform:translateX(-40px) scale(.97)}
html.js .tl-item .tl-node{scale:.4;opacity:0;transition:scale .7s cubic-bezier(.3,1.6,.5,1),opacity .4s,background-color .5s var(--ease),color .5s var(--ease),box-shadow .5s var(--ease),transform .5s var(--ease)}
html.js .tl-item.in .tl-card{opacity:1;transform:none}
html.js .tl-item.in .tl-node{scale:1;opacity:1}

/* impact wave: gentle breathing handled by SMIL inside the SVG */

/* mobile menu staggered links */
@media (max-width:1180px){
  .mobile-nav{max-height:100vh;overflow:auto}
  .mobile-nav li,.mobile-nav .btn{opacity:0;transform:translateY(16px);transition:opacity .45s var(--ease),transform .55s var(--ease)}
  .mobile-nav.open li,.mobile-nav.open .btn{opacity:1;transform:none;transition-delay:calc(.15s + var(--i,0) * 45ms)}
  html.js .about-media.in{clip-path:inset(0 0 0 0 round 56px)}
  .scroll-cue{display:none}
}
@media (max-width:860px){
  .fk2{display:none}
  .fk1{top:auto;bottom:12%;left:6%}
  .fk3{top:auto;bottom:40%;right:6%}
  html.js .tl-item:nth-of-type(even) .tl-card,html.js .tl-item .tl-card{transform:translateY(24px)}
  .ld-logo{width:210px}
  .ld-slogan{font-size:.78rem;letter-spacing:.14em}
}

/* ================= REDUCED MOTION / PAUSE ANIMATIONS ================= */
@media (prefers-reduced-motion:reduce){
  .loader,.cursor,.hero-blob{display:none!important}
  html.js .hero-title .li,html.js .split .wi,html.js .tl-item .tl-card{transform:none;opacity:1;filter:none}
  html.js .tl-item .tl-node{scale:1;opacity:1}
  html.js img.script-write,html.js .script-write img,html.js .card .card-media img{clip-path:none}
  html.js .about-media{clip-path:none}
  .ico{transition:none!important}
}
html.no-motion .loader,html.no-motion .cursor,html.no-motion .hero-blob{display:none!important}
html.no-motion .hero-title .li,html.no-motion .split .wi,html.no-motion .tl-item .tl-card{transform:none!important;opacity:1!important;filter:none!important}
html.no-motion .tl-item .tl-node{scale:1!important;opacity:1!important}
html.no-motion img.script-write,html.no-motion .script-write img,html.no-motion .card .card-media img,html.no-motion .about-media{clip-path:none!important}
html.no-motion .btn{translate:none!important}
html.no-motion .tilt-on{transform:none!important}
html.no-motion .site-header.hide{transform:none}
