/* Scout, the jumping-spider mascot (assets/scout.js). Decorative only: aria-hidden, never takes clicks.
   Layers: .scout = where it sits (+ scroll parallax), .scout-body = lean / hops, img = breathing.
   It only animates while on screen (.on) and stands still with reduced motion. */
.scout{position:absolute;z-index:4;pointer-events:none;width:var(--sw,160px);aspect-ratio:600/542;transform:translate3d(0,var(--par,0px),0)}
.scout-body{position:relative;width:100%;height:100%;translate:var(--px,0px) var(--py,0px);rotate:var(--lean,0deg);transform-origin:50% 92%;transition:translate .7s cubic-bezier(.2,.8,.2,1),rotate .7s cubic-bezier(.2,.8,.2,1)}
.scout img{position:relative;z-index:1;display:block;width:100%;height:auto;transform-origin:50% 96%}
/* contact shadow under the feet */
.scout-body::after{content:"";position:absolute;z-index:0;left:14%;right:14%;bottom:-1%;height:10%;border-radius:50%;background:radial-gradient(closest-side,rgba(11,10,26,.32),transparent)}
/* on the night sections: a soft violet glow so it sits in the light of the page, not on top of it */
.scout.glow .scout-body::before{content:"";position:absolute;z-index:0;inset:-18% -14%;border-radius:50%;background:radial-gradient(closest-side,rgba(140,128,240,.26),transparent 72%)}
.scout.glow .scout-body::after{background:radial-gradient(closest-side,rgba(0,0,0,.5),transparent)}

/* breathing: always, slow and small */
.scout.on .sc-face{animation:sc-breathe 3.4s ease-in-out infinite}   /* .sc-face: scout-life.js wraps the picture + eyelids */
/* the peek on a card edge (scout-life.js .sc-edge): breathes from the edge, no lift */
.sc-face.sc-edge{animation-name:sc-breathe-edge!important}
@keyframes sc-breathe-edge{0%,100%{transform:scale(1,1)}50%{transform:scale(1.012,1.03)}}
@keyframes sc-breathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.012,1.028) translateY(-1px)}}

/* 1. HERO: Scout juggling four website panels (drawn by scout-life.js). Each .sc-jug fills the scene, so its
   translate in % moves the panel's centre across the scene: a loop above the head, paw to paw, always in front and
   never over Scout (so it never looks flat).
   Without motion they rest where they are in the original picture. Positions are % of the cropped scene */
.scout--hero{--sw:clamp(270px,27vw,430px);aspect-ratio:1460/1256;right:max(24px,calc((100vw - 1320px) / 2));top:30%}
/* the spiral script wraps the hero in .vh-frame and makes its children relative: keep Scout placed */
.hero .scout--hero,.vh .vh-frame>.scout--hero{position:absolute;z-index:3}
.scout--hero .scout-body{position:absolute;z-index:1;left:.41%;top:.48%;width:99.18%;height:auto}
.scout--hero .scout-body::after{display:none}
.sc-jug{position:absolute;inset:0;z-index:2;pointer-events:none;transform:translate(var(--x),var(--y))}
.sc-jug svg{position:absolute;left:0;top:0;width:var(--w);height:auto;overflow:visible;
  transform:translate(calc(-50% + var(--px,0px) * var(--k)),calc(-50% + var(--py,0px) * var(--k))) rotate(var(--r));filter:drop-shadow(0 6px 10px rgba(10,8,30,.35))}
.sc-jug--a{--x:18%;--y:10%;--w:26%;--r:-6deg;--k:1.3}
.sc-jug--b{--x:77%;--y:12%;--w:19%;--r:8deg;--k:1.5}
.sc-jug--c{--x:88%;--y:30%;--w:22%;--r:-4deg;--k:1.2}
.sc-jug--d{--x:9%;--y:54%;--w:18%;--r:-8deg;--k:1.4}
.scout--hero.on .sc-jug{animation:sc-juggle 9s linear infinite}
.scout--hero.on .sc-jug svg{animation:sc-spin 9s linear infinite;animation-delay:inherit}
.scout--hero .sc-jug--b{animation-delay:-2.25s!important}
.scout--hero .sc-jug--c{animation-delay:-4.5s!important}
.scout--hero .sc-jug--d{animation-delay:-6.75s!important}
/* the loop (panel centres, % of the scene): tossed high from the left paw, caught by the right paw, passed back low
   just over the hair. The paws sit at about (16%,26%) and (84%,34%), the top of the hair at 11% */
@keyframes sc-juggle{
  0%,100%{transform:translate(14%,19%)}15%{transform:translate(25%,-14%)}30%{transform:translate(50%,-27%)}
  45%{transform:translate(75%,-14%)}60%{transform:translate(86%,26%)}70%{transform:translate(72%,6%)}
  80%{transform:translate(50%,-3%)}90%{transform:translate(30%,4%)}
}
@keyframes sc-spin{0%,100%{rotate:-8deg}30%{rotate:0deg}60%{rotate:10deg}80%{rotate:2deg}}

/* 2. PROJECTS: lets itself down on a gold thread (it runs down behind the head: one cord) and waves, gently bobbing */
.scout--hang{--sw:clamp(110px,9vw,150px);aspect-ratio:320/383;right:max(20px,calc((100vw - 1200px) / 2 + 8px));top:clamp(130px,18vh,180px)}
.scout--hang .scout-body::after{display:none}
/* scout.js: --par lowers it down the thread on scroll, --lean swings it from high up the thread (a pendulum) */
.scout--hang .scout-body{transform-origin:50% -240px;transition:none}
.scout-thread{position:absolute;z-index:0;left:50.16%;bottom:70%;width:2px;margin-left:-1px;height:100vh;background:linear-gradient(to top,#C9A043,#D8B35A 70%,rgba(216,179,90,0))}
.scout--hang.on .scout-body{animation:sc-bob 4.6s ease-in-out infinite}
@keyframes sc-bob{0%,100%{transform:translateY(0) rotate(0)}30%{transform:translateY(7px) rotate(1.5deg)}70%{transform:translateY(-4px) rotate(-1.5deg)}}

/* 3. SERVICES: at work on the top edge of the "Online stores" card (laptop, phone and coffee: eight legs, four jobs) */
.services .cards.two .card{position:relative}
.scout--perch{--sw:clamp(150px,13vw,200px);aspect-ratio:480/409;top:0;right:clamp(16px,2.5vw,36px);transform:translateY(calc(-100% + 10px))}

/* 4. TEN-DAY PLAN: side-on with its stopwatch, jumps from dot to dot just ahead of the gold line (scout.js sets left) */
.scout--hop{--sw:clamp(78px,6.4vw,96px);aspect-ratio:260/203;left:0;top:calc(22px - var(--sw) * .76);transition:left .4s cubic-bezier(.45,0,.2,1)}
.scout--hop .scout-body{scale:var(--dir,1) 1}
.scout--hop.jump .scout-body{animation:sc-jump .4s cubic-bezier(.3,0,.3,1)}
@keyframes sc-jump{0%{transform:translateY(0) scale(1.06,.9)}15%{transform:translateY(0) scale(.94,1.08)}50%{transform:translateY(-34px) scale(1)}85%{transform:translateY(0) scale(1.08,.9)}100%{transform:translateY(0) scale(1)}}

/* 5. OFFER FORM: beside the Send button with a paper airplane; leans in while you type; when the form is sent the
   plane flies off and Scout celebrates */
.offer-in{position:relative}
.scout--fan{--sw:clamp(120px,11vw,160px);aspect-ratio:600/531;right:0;bottom:-28px}
.scout--fan.lean{--lean:-7deg;--px:-6px}
.scout--fan.celebrate .scout-body{animation:sc-yay 1.3s cubic-bezier(.3,0,.3,1) 2}
@keyframes sc-yay{0%,100%{transform:translateY(0) scale(1)}10%{transform:scale(1.08,.9)}30%{transform:translateY(-30px) scale(.95,1.06)}48%{transform:translateY(0) scale(1.08,.92)}62%{transform:translateY(-16px)}78%{transform:translateY(0) scale(1.04,.96)}}
/* the paper airplane in Scout's raised front leg: drawn here (SVG in the page) so it can really fly off when the form is sent */
.scout-plane{position:absolute;z-index:2;left:-52%;top:-15%;width:70%;filter:drop-shadow(0 6px 10px rgba(0,0,0,.35));height:auto;overflow:visible}
.scout--fan.on .scout-plane{animation:sc-plane-hover 3s ease-in-out infinite}
.scout--fan.celebrate .scout-plane{animation:sc-plane-fly 1.5s cubic-bezier(.35,0,.6,1) forwards}
@keyframes sc-plane-hover{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px) rotate(-2deg)}}
@keyframes sc-plane-fly{0%{transform:none;opacity:1}18%{transform:translate(16px,10px) rotate(8deg)}100%{transform:translate(-480px,-260px) rotate(-6deg) scale(.55);opacity:0}}

/* 6. CLOSING: the call to action becomes one night card; Scout peeks over its top edge and waves (the flat bottom
   of the picture sits exactly on the card edge: 86% down) */
.closing-in{position:relative;max-width:1100px;margin-inline:auto;background:radial-gradient(60% 70% at 85% 15%,rgba(92,78,168,.35),transparent 70%),var(--night);color:var(--mist);border-radius:32px;padding:clamp(64px,8vw,104px) clamp(24px,5vw,72px) clamp(48px,6vw,80px);box-shadow:0 40px 80px -40px rgba(27,24,56,.55)}
.closing h2{color:var(--mist)}
.closing .spiral path{stroke:var(--mist)}
.closing .spiral circle{fill:var(--gold)}
.closing .write-alt{color:#B9B4CC}
.closing .write-alt a{color:var(--mist)}
.scout--wave{--sw:clamp(150px,14vw,210px);aspect-ratio:480/349;top:0;left:clamp(24px,6vw,72px);transform:translateY(-86%)}
.scout--wave .scout-body::after{display:none}

/* waving legs (scout-life.js waves them): cut from the picture, behind the body, swinging at the shoulder */
.scout .sc-leg,.ag-scout .sc-leg{position:absolute;z-index:0;display:block;height:auto;pointer-events:none}
.scout .sc-leg--hang{left:0;top:53.52%;width:19.06%;transform-origin:65.6% 87.5%}
.scout .sc-leg--peek,.ag-scout .sc-leg--peek{left:62.29%;top:42.41%;width:31.67%;transform-origin:67.8% 96.2%}
/* services: steam from the coffee, a notification ping on the phone */
.sc-steam{position:absolute;z-index:2;left:83.5%;top:24%;width:12%;height:18%;pointer-events:none}
.sc-steam i{position:absolute;bottom:0;width:46%;aspect-ratio:1;border-radius:50%;background:radial-gradient(closest-side,rgba(255,255,255,.9),rgba(255,255,255,0));opacity:0}
.sc-steam i:nth-child(1){left:0}.sc-steam i:nth-child(2){left:32%;animation-delay:1s!important}.sc-steam i:nth-child(3){left:62%;animation-delay:2s!important}
.scout.on .sc-steam i{animation:sc-steam 3s ease-out infinite}
@keyframes sc-steam{0%{transform:translateY(0) scale(.6);opacity:0}25%{opacity:.9}100%{transform:translateY(-160%) translateX(20%) scale(1.3);opacity:0}}
.sc-ping{position:absolute;z-index:2;left:9.5%;top:30.5%;width:3.6%;aspect-ratio:1;border-radius:50%;background:#D8B35A;border:2px solid #1B1838;transform:scale(0);pointer-events:none}
.scout.on .sc-ping{animation:sc-ping 6s cubic-bezier(.3,1.6,.5,1) 1.5s infinite}
@keyframes sc-ping{0%,8%{transform:scale(0)}14%{transform:scale(1.25)}18%,40%{transform:scale(1)}46%,100%{transform:scale(0)}}

/* speech bubbles (hero, services, form only): short lines, pop in once Scout is on screen */
.scout-say{position:absolute;z-index:5;width:max-content;max-width:clamp(150px,15vw,210px);padding:9px 14px;border-radius:16px;background:#F3F1F7;color:var(--ink);border:2px solid #1B1838;box-shadow:0 10px 24px -12px rgba(11,10,26,.55);font:600 15px/1.3 var(--sans,"Instrument Sans",system-ui,sans-serif);letter-spacing:-.005em;text-align:left;transform-origin:100% 50%}
.scout-say::after{content:"";position:absolute;top:50%;right:-9px;width:14px;height:14px;margin-top:-7px;background:inherit;border:inherit;border-width:0 2px 2px 0;rotate:-45deg}
.scout.on .scout-say{animation:sc-say .5s cubic-bezier(.3,1.5,.5,1) .5s both}
@keyframes sc-say{from{opacity:0;scale:.6;translate:10px 0}to{opacity:1;scale:1;translate:0 0}}
.scout--perch .scout-say{right:98%;top:14%}
/* form: left of Scout, below its plane, in the empty end of the Send row */
.scout--fan .scout-say{right:96%;top:52%}

/* phones and tablets: smaller, never over the text */
@media (max-width:760px){
  .scout--hero{--sw:230px;right:0;top:auto;bottom:9svh}
  .scout--hang{--sw:108px;right:12px;top:96px}
  .scout--perch{--sw:128px;right:12px}
  .scout--perch .scout-say{top:40%}
  .scout-say{font-size:14px;max-width:160px}
  .services .cards.two .card:nth-child(2){margin-top:84px}   /* room for Scout above the card, clear of the card before */
  .scout--fan{display:none}
  .scout--wave{--sw:150px;left:50%;margin-left:-75px}
  .closing-in{border-radius:24px;margin-inline:16px}
}

@media (prefers-reduced-motion:reduce){
  .scout,.scout *{animation:none!important;transition:none!important}
  .scout-body{translate:none;rotate:none}
}
