/* ==========================================================
   animations.css | Professional but restrained motion.
   - Scroll reveal uses a CSS animation (not a transition) so card hover
     effects keep working. Content is never hidden if JS fails: the
     hidden state only applies when JS adds .js-reveal to <html>.
   - Everything is switched off for prefers-reduced-motion users.
   ========================================================== */

@keyframes fadeUp   { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes floatY   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes shine    { to { transform: translateX(260%) skewX(-20deg); } }
@keyframes pulseRing{ 0% { box-shadow: 0 0 0 0 rgba(224, 176, 79, .55); } 70%, 100% { box-shadow: 0 0 0 14px rgba(224, 176, 79, 0); } }
@keyframes drawLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Scroll reveal (delay set per element by animations.js via --d) */
.js-reveal .reveal { opacity: 0; }
.js-reveal .reveal.is-visible { opacity: 1; animation: fadeUp .75s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: var(--d, 0s); }

/* Entrance on page load: hero and page-hero text */
.hero .split > div > *, .page-hero__grid > div > *, .page-hero .container > * { animation: fadeUp .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero .split > div > :nth-child(2), .page-hero__grid > div > :nth-child(2), .page-hero .container > :nth-child(2) { animation-delay: .12s; }
.hero .split > div > :nth-child(3), .page-hero__grid > div > :nth-child(3), .page-hero .container > :nth-child(3) { animation-delay: .24s; }
.hero .split > div > :nth-child(4), .page-hero__grid > div > :nth-child(4) { animation-delay: .36s; }

/* Floating hero visuals */
.hero__visual, .page-hero__img { animation: floatY 7s ease-in-out infinite; }

/* Buttons: light sweep on hover */
.btn { position: relative; overflow: hidden; }
.btn::after { content: ""; position: absolute; inset: 0 auto 0 -60%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(0) skewX(-20deg); pointer-events: none; }
.btn:hover::after { animation: shine .8s ease; }
.nav__cta .btn { animation: pulseRing 3.2s ease-out infinite; }

/* Cards: image zoom + icon lift */
.card__img { transition: transform .6s ease, filter .4s ease; }
.card:hover .card__img { transform: scale(1.05); filter: brightness(1.08); }
.card__icon { transition: transform .3s ease, background-color .3s ease; }
.card:hover .card__icon { transform: translateY(-3px) rotate(-4deg) scale(1.06); }

/* Section headings: animated accent underline when revealed */
.section-head h2 { position: relative; padding-bottom: .6rem; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--sky), var(--gold)); transform-origin: left; animation: drawLine .9s ease .2s backwards; }
.cta-band .section-head h2::after, .cta-band h2::after { display: none; }

/* Header: shadow + blur after scrolling */
.site-header { transition: box-shadow .3s ease, background-color .3s ease; }
.site-header.is-scrolled { box-shadow: 0 8px 28px rgba(10,40,100, .12); background: rgba(255, 255, 255, .97); }

/* Scroll progress bar (created by animations.js) */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 300; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--sky), var(--gold)); pointer-events: none; }

/* Gradient accent text in headings */
.text-accent { background: linear-gradient(90deg, #0858B8, #2BB3FF); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

/* ==========================================================
   v2 additions: richer professional motion
   ========================================================== */
@keyframes fadeLeft  { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes fadeRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn    { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes imgIn     { from { clip-path: inset(0 0 100% 0 round 22px); transform: scale(1.08); } to { clip-path: inset(0 0 0 0 round 22px); transform: none; } }
@keyframes blobA     { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(70px, 50px) scale(1.18); } }
@keyframes blobB     { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-80px, -40px) scale(1.12); } }
@keyframes marquee   { to { transform: translateX(-50%); } }
@keyframes starPop   { from { transform: scale(0) rotate(-40deg); } 60% { transform: scale(1.3) rotate(8deg); } to { transform: none; } }
@keyframes pageIn    { from { opacity: 0; } to { opacity: 1; } }

body { animation: pageIn .6s ease; }

/* Reveal variants (set data-reveal="left|right|zoom" on a .reveal element) */
.js-reveal .reveal[data-reveal="left"].is-visible  { animation-name: fadeLeft; }
.js-reveal .reveal[data-reveal="right"].is-visible { animation-name: fadeRight; }
.js-reveal .reveal[data-reveal="zoom"].is-visible  { animation-name: zoomIn; }

/* Hero: drifting colour blobs behind content + image wipe-in */
.hero .container { position: relative; z-index: 1; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; z-index: 0; }
.hero::before { width: 460px; height: 460px; left: -120px; top: -140px; background: rgba(59, 157, 255, .30); animation: blobA 16s ease-in-out infinite; }
.hero::after  { width: 420px; height: 420px; right: -100px; bottom: -160px; background: rgba(224, 176, 79, .26); animation: blobB 19s ease-in-out infinite; }
.hero__visual img { animation: imgIn 1.1s cubic-bezier(.2, .7, .2, 1) .2s backwards; }
.page-hero__img { animation: imgIn 1.1s cubic-bezier(.2, .7, .2, 1) .15s backwards, floatY 7s ease-in-out 1.3s infinite; }

/* Services ticker */
.ticker__track { animation: marquee 38s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }

/* Cards: cursor spotlight (position set by animations.js) */
.card:not(.card--dark):hover { background-image: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(59, 157, 255, .13), transparent 62%); }
.card--tilt { will-change: transform; transform-style: preserve-3d; }
.card--tilt.is-tilting { transition: transform .12s ease-out, box-shadow .25s, border-color .25s; }

/* Service images: slow settle zoom when they scroll into view */
.js-reveal .reveal.is-visible .card__img { animation: imgSettle 1.2s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes imgSettle { from { transform: scale(1.18); } to { transform: scale(1); } }

/* Reviews: stars pop in one by one when the carousel is revealed */
.js-reveal .reviews__carousel.is-visible .star.is-on { animation: starPop .5s cubic-bezier(.2, .9, .3, 1.4) backwards; animation-delay: calc(.35s + var(--i) * .08s); }
.review-card__quote { transition: transform .4s; }
.review-card:hover .review-card__quote { transform: translateY(-4px) scale(1.12); }
.review-form-wrap.is-visible { animation-name: zoomIn; }

/* Nav links: underline slide */
.nav__link { position: relative; }
.nav__link::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .35rem; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.nav__link:hover::after { transform: scaleX(1); }

/* "How it works" numbered cards: gentle lift of the number */
ol.grid > li.card h3 { transition: color .3s, transform .3s; }
ol.grid > li.card:hover h3 { color: var(--blue); transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .hero__visual, .page-hero__img, .nav__cta .btn, .btn:hover::after, .section-head h2::after,
  .hero .split > div > *, .page-hero__grid > div > *, .page-hero .container > *,
  .js-reveal .reveal.is-visible, .js-reveal .reveal.is-visible .card__img, .hero::before, .hero::after, .hero__visual img,
  .ticker__track, body, .js-reveal .reviews__carousel.is-visible .star.is-on { animation: none !important; }
  .js-reveal .reveal { opacity: 1; transform: none; }
}


/* Print: show everything, hide floating UI */
@media print {
  .js-reveal .reveal { opacity: 1 !important; animation: none !important; transform: none !important; }
  .wa-float-wrap, .back-to-top, .scroll-progress, .nav__burger, .ticker, .reviews__controls, .hero__visual::before, .hero::before, .hero::after { display: none !important; }
  .site-header { position: static; backdrop-filter: none; box-shadow: none; }
  body, .hero__visual, .page-hero__img, .hero__visual img { animation: none !important; }
  .section { padding-block: 1.5rem; }
  .review-card, .card { break-inside: avoid; }
}
