/* Cloudsquads interactive enhancements */

/* ---- Scroll progress bar ---- */
#cs-scroll-progress{position:fixed;top:0;left:0;height:3px;width:0%;background:linear-gradient(90deg,#00bddd,#156f80);z-index:999;transition:width .1s linear}

/* ---- Header ---- */
.cs-header{transition:box-shadow .3s ease,background-color .3s ease}
.cs-logo{transition:transform .35s ease}
.cs-logo:hover{transform:scale(1.06) rotate(-2deg)}

.cs-menu li a,.cs-menu2 li a{position:relative;transition:color .25s ease,transform .25s ease}
.cs-menu li a:after,.cs-menu2 li a:after{content:"";position:absolute;left:0;bottom:-4px;width:0;height:2px;background:linear-gradient(90deg,#00bddd,#156f80);transition:width .3s ease}
.cs-menu li a:hover:after,.cs-menu2 li a:hover:after{width:100%}
.cs-menu li a:hover,.cs-menu2 li a:hover{transform:translateY(-2px)}

.menu-icon{transition:transform .3s ease}
.menu-icon:hover{transform:scale(1.15) rotate(90deg)}

/* ---- Buttons / inputs ---- */
.cs-home-content .cs-btn,#csContact button{position:relative;overflow:hidden;transition:transform .25s ease,box-shadow .25s ease,background-position .4s ease}
.cs-home-content .cs-btn:hover,#csContact button:hover{transform:translateY(-3px) scale(1.03);box-shadow:0 10px 24px rgba(0,189,221,.35)}
.cs-home-content .cs-btn:active,#csContact button:active{transform:translateY(0) scale(.98)}

.cs-home-content input,#csContact input{transition:box-shadow .25s ease,transform .25s ease}
.cs-home-content input:focus,#csContact input:focus{outline:none;box-shadow:0 0 0 2px #00bddd;transform:translateY(-1px)}

/* ripple */
.cs-ripple{position:absolute;border-radius:50%;transform:scale(0);animation:cs-ripple-anim .6s ease-out;background:rgba(255,255,255,.45);pointer-events:none}
@keyframes cs-ripple-anim{to{transform:scale(3);opacity:0}}

/* ---- Scroll reveal ---- */
.cs-reveal{opacity:0;transform:translateY(40px);transition:opacity .7s ease,transform .7s ease}
.cs-reveal.cs-reveal-visible{opacity:1;transform:translateY(0)}
.cs-reveal-left{transform:translateX(-60px)}
.cs-reveal-left.cs-reveal-visible{transform:translateX(0)}
.cs-reveal-right{transform:translateX(60px)}
.cs-reveal-right.cs-reveal-visible{transform:translateX(0)}
.cs-reveal-scale{transform:scale(.85)}
.cs-reveal-scale.cs-reveal-visible{transform:scale(1)}

/* ---- Illustrations: float + hover tilt ---- */
/* Lottie svgs use viewBox 0 0 1220 1220 (square) with preserveAspectRatio "slice",
   but the box (35em x 40em) is narrower than tall, so the browser cover-scales
   the square content to fill it and crops ~50px off each side (hexagon points
   and lock icons get cut off). Forcing the inner player to stay square via
   aspect-ratio and centering it removes the crop entirely, at any breakpoint,
   and the leftover vertical space reads as padding around the hexagon. */
.cs-illustration{box-sizing:border-box;display:flex;align-items:center;justify-content:center;transition:transform .4s ease,filter .4s ease;animation:cs-float 5s ease-in-out infinite}
.cs-illustration>[role="button"]{width:100%!important;height:auto!important;aspect-ratio:1/1!important}
.cs-illustration:hover{transform:scale(1.04) rotate(1deg);filter:drop-shadow(0 12px 20px rgba(0,189,221,.25))}
.cs-services-row:nth-child(2n) .cs-illustration{animation-delay:.6s}
@keyframes cs-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-14px)}}

/* The bundled Lottie "animation" buttons render one static frame and never
   actually play (verified: no DOM change on hover/click). Give them real
   interactive feedback since the native animation is inert. */
.cs-illustration [role="button"][aria-label="animation"]{cursor:pointer;transition:transform .3s ease}
.cs-illustration [role="button"][aria-label="animation"]:hover{transform:scale(1.06)}
.cs-illustration [role="button"][aria-label="animation"].cs-pulse{animation:cs-pulse-anim .6s ease}
@keyframes cs-pulse-anim{0%{transform:scale(1) rotate(0)}30%{transform:scale(1.1) rotate(-3deg)}60%{transform:scale(.96) rotate(3deg)}100%{transform:scale(1) rotate(0)}}

/* ---- Contact hexagon: give the text more breathing room from the pointed
   top/bottom of the hexagon backdrop (was margin:4em, heading/phone number
   sat close to the vertices). ---- */
#csContact .cs-contact-info{margin-top:6em;margin-bottom:6em}
/* On desktop the hexagon column bleeds off the right edge of the viewport
   (margin-right:-2.7em on the column itself), so the text needs extra
   margin-right there to stay clear of the actual page edge. Below 650px the
   original stylesheet resets that column's margin to 0 (no more bleed) and
   centers everything, so this extra margin must not apply there or it
   pushes the text off-center. */
@media screen and (min-width:651px){
  #csContact .cs-contact-info{margin-right:7em}
}

/* ---- Service rows ---- */
.cs-services-row .cs-services-txt h1,.cs-services-row .cs-services-txt h3{transition:letter-spacing .3s ease}
.cs-services-row:hover .cs-services-txt h1{letter-spacing:1px}

/* ---- Home hero cube background subtle parallax ---- */
.cs-home-img{transition:transform .2s ease-out}

/* ---- Footer social icons ---- */
.cs-footer .cs-social-icons div{transition:transform .3s ease,filter .3s ease;cursor:pointer}
.cs-footer .cs-social-icons div:hover{transform:translateY(-5px) scale(1.2);filter:brightness(1.4)}

/* ---- Back to top button ---- */
#cs-back-to-top{position:fixed;right:24px;bottom:24px;width:44px;height:44px;border-radius:50%;background:linear-gradient(90deg,#00bddd,#156f80);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;pointer-events:none;transform:translateY(20px) scale(.8);transition:opacity .3s ease,transform .3s ease;z-index:998;box-shadow:0 6px 18px rgba(0,0,0,.25);font-size:20px}
#cs-back-to-top.cs-visible{opacity:1;pointer-events:auto;transform:translateY(0) scale(1)}
#cs-back-to-top:hover{transform:translateY(-4px) scale(1.08)}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .cs-reveal,.cs-illustration,.cs-logo,.cs-menu li a,.cs-menu2 li a,.menu-icon,.cs-home-content .cs-btn,#csContact button,#cs-back-to-top{transition:none!important;animation:none!important}
  .cs-reveal{opacity:1;transform:none}
}

/* =====================================================================
   v8 motion layer: additive animation only. Nothing here changes
   layout, colours, copy or structure; every "hidden" start state is gated on
   html.cs-anim (set by enhancements.js) or on a parent that JS tagged
   .cs-reveal, so if the script never runs the page renders exactly as before.
   ===================================================================== */

/* ---- Header ----
   No entrance animation here on purpose: the bundle fades the header in with
   gsap.from({autoAlpha:0}), which reads the current computed opacity as its
   end value. A CSS entrance on the header makes GSAP tween 0 -> 0 and the
   header stays invisible. */
/* Scroll-spy: the link for the section in view keeps its underline. */
.cs-menu li a.cs-active:after{width:100%}

/* ---- Hero: staggered entrance ---- */
html.cs-anim #csHome .cs-home-content>*{animation:cs-rise .9s cubic-bezier(.2,.8,.2,1) backwards}
html.cs-anim #csHome .cs-home-content>h1{animation-name:cs-focus-in;animation-delay:.45s}
html.cs-anim #csHome .cs-home-content>h4{animation-delay:.7s}
html.cs-anim #csHome .cs-home-content>input{animation-delay:.85s}
html.cs-anim #csHome .cs-home-content>.cs-btn{animation-delay:1s}
@keyframes cs-rise{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}
@keyframes cs-focus-in{from{opacity:0;filter:blur(10px);letter-spacing:.12em}to{opacity:1;filter:blur(0);letter-spacing:normal}}
/* h4 is opacity:.5 in the base CSS; keep that as the end state. */
html.cs-anim #csHome .cs-home-content>h4{animation-name:cs-rise-half}
@keyframes cs-rise-half{from{opacity:0;transform:translateY(24px)}to{opacity:.5;transform:none}}

/* Hero cubes: a slow breathing glow so the scene feels alive. */
.cs-home-img{animation:cs-cube-glow 6s ease-in-out infinite}
@keyframes cs-cube-glow{0%,100%{filter:drop-shadow(0 0 0 rgba(0,189,221,0))}50%{filter:drop-shadow(0 0 18px rgba(0,189,221,.35))}}

/* CTA: periodic light sweep across the button. */
.cs-home-content .cs-btn:before,#csContact button:before{content:"";position:absolute;top:0;left:-75%;width:50%;height:100%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.45),transparent);transform:skewX(-20deg);animation:cs-shine 4s ease-in-out 2s infinite;pointer-events:none}
@keyframes cs-shine{0%{left:-75%}25%,100%{left:130%}}

/* Constellation canvas over the hero (drawn by JS, never blocks clicks). */
#cs-particles{position:absolute;top:0;left:0;width:100%;pointer-events:none;z-index:2;opacity:0;transition:opacity 1.5s ease}
#cs-particles.cs-on{opacity:1}

/* Cursor spotlight (desktop pointers only, see JS). */
#cs-spotlight{position:fixed;top:0;left:0;width:520px;height:520px;margin:-260px 0 0 -260px;border-radius:50%;background:radial-gradient(circle,rgba(0,189,221,.10) 0%,rgba(0,189,221,.04) 35%,transparent 70%);pointer-events:none;z-index:50;opacity:0;transition:opacity .4s ease;will-change:transform}
#cs-spotlight.cs-on{opacity:1}

/* ---- Services: text staggers in after its row reveals ---- */
.cs-reveal .cs-services-txt>*{transition:opacity .7s ease,transform .7s cubic-bezier(.2,.8,.2,1)}
.cs-reveal:not(.cs-reveal-visible) .cs-services-txt>*{opacity:0;transform:translateY(18px)}
.cs-reveal .cs-services-txt>:nth-child(1){transition-delay:.2s}
.cs-reveal .cs-services-txt>:nth-child(2){transition-delay:.35s}
.cs-reveal .cs-services-txt>:nth-child(3){transition-delay:.5s}
/* "SERVICES" title settles from wide tracking. */
.cs-reveal:not(.cs-reveal-visible) .cs-services-txt>h1{letter-spacing:.4em}
.cs-reveal .cs-services-txt>h1{transition:opacity .9s ease .1s,transform .9s ease .1s,letter-spacing 1.1s cubic-bezier(.2,.8,.2,1) .1s}

/* Illustration: 3D tilt toward the cursor (vars set by JS) layered on the
   existing float. Applies to the inner player so it doesn't fight the
   float keyframes on the outer box. */
.cs-illustration>[role="button"]{transform:perspective(900px) rotateX(var(--cs-rx,0deg)) rotateY(var(--cs-ry,0deg)) scale(var(--cs-s,1));transition:transform .25s ease-out!important;will-change:transform}
.cs-illustration [role="button"][aria-label="animation"]:hover{transform:perspective(900px) rotateX(var(--cs-rx,0deg)) rotateY(var(--cs-ry,0deg)) scale(1.05)}

/* ---- About: blocks stagger ---- */
.cs-about.cs-reveal .cs-about-txt{transition:opacity .7s ease,transform .7s cubic-bezier(.2,.8,.2,1)}
.cs-about.cs-reveal:not(.cs-reveal-visible) .cs-about-txt{opacity:0;transform:translateY(24px)}
.cs-about.cs-reveal .cs-about-txt:nth-child(1){transition-delay:.15s}
.cs-about.cs-reveal .cs-about-txt:nth-child(2){transition-delay:.4s}

/* ---- Contact: form fields and info lines stagger ---- */
.cs-reveal .cs-contact-col:first-child>*,.cs-reveal .cs-contact-info>*{transition:opacity .6s ease,transform .6s cubic-bezier(.2,.8,.2,1)}
.cs-reveal:not(.cs-reveal-visible) .cs-contact-col:first-child>*{opacity:0;transform:translateX(-24px)}
.cs-reveal:not(.cs-reveal-visible) .cs-contact-info>*{opacity:0;transform:translateY(14px)}
.cs-reveal .cs-contact-col:first-child>:nth-child(1),.cs-reveal .cs-contact-info>:nth-child(1){transition-delay:.15s}
.cs-reveal .cs-contact-col:first-child>:nth-child(2),.cs-reveal .cs-contact-info>:nth-child(2){transition-delay:.25s}
.cs-reveal .cs-contact-col:first-child>:nth-child(3),.cs-reveal .cs-contact-info>:nth-child(3){transition-delay:.35s}
.cs-reveal .cs-contact-col:first-child>:nth-child(4),.cs-reveal .cs-contact-info>:nth-child(4){transition-delay:.45s}
.cs-reveal .cs-contact-col:first-child>:nth-child(5),.cs-reveal .cs-contact-info>:nth-child(5){transition-delay:.55s}
.cs-reveal .cs-contact-info>:nth-child(6){transition-delay:.65s}
.cs-reveal .cs-contact-info>:nth-child(n+7){transition-delay:.75s}
/* Hexagon card: soft teal halo. */
#csContact .cs-contact-col:last-child{animation:cs-hex-glow 5s ease-in-out infinite}
@keyframes cs-hex-glow{0%,100%{filter:drop-shadow(0 0 0 rgba(0,189,221,0))}50%{filter:drop-shadow(0 0 22px rgba(0,189,221,.3))}}

/* ---- Footer: LinkedIn icon gentle bob ---- */
.cs-footer .cs-social-icons a>div{animation:cs-bob 3s ease-in-out infinite}
@keyframes cs-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.cs-footer .cs-social-icons a>div:hover{animation:none}

@media (prefers-reduced-motion:reduce){
  html.cs-anim #csHome .cs-home-content>*,
  .cs-home-img,.cs-home-content .cs-btn:before,#csContact button:before,
  #csContact .cs-contact-col:last-child,.cs-footer .cs-social-icons a>div{animation:none!important}
  .cs-reveal .cs-services-txt>*,.cs-about.cs-reveal .cs-about-txt,
  .cs-reveal .cs-contact-col:first-child>*,.cs-reveal .cs-contact-info>*{opacity:1!important;transform:none!important;transition:none!important;letter-spacing:inherit}
  #cs-particles,#cs-spotlight{display:none}
}
