/* =====================================================================
   Clickzix Tech | Site-wide animation layer (works with js/site-fx.js + jQuery)
   Used on: index, about, blog, career, clients, contact + all industry pages.
   (Service pages keep their own layer: css/services-fx.css)

   Every hidden "start" state below only applies when <html> has the
   "cz-fx" class. That class is added by a tiny script in <head> and is
   removed automatically if jQuery / site-fx.js fails, or if the visitor
   prefers reduced motion, so the page is never left invisible.
   ===================================================================== */

/* ---------- 1. start (hidden) states ---------- */
/* slide-in elements must never create a sideways scrollbar */
html.cz-fx main { overflow-x: clip; }

html.cz-fx .cz-up    { opacity: 0; translate: 0 34px; }
html.cz-fx .cz-left  { opacity: 0; translate: -52px 0; }
html.cz-fx .cz-right { opacity: 0; translate: 52px 0; }
html.cz-fx .cz-zoom  { opacity: 0; scale: .86; translate: 0 18px; }
html.cz-fx .cz-pop   { opacity: 0; scale: .55; }
html.cz-fx .cz-drop  { opacity: 0; translate: 0 -16px; }
html.cz-fx .cz-imgz  { opacity: 0; scale: 1.1; }

/* revealed state */
html.cz-fx .cz-in { opacity: 1 !important; translate: 0 0 !important; scale: 1 !important; }

/* timing (delay comes from --d, set by jQuery for the stagger) */
html.cz-fx .cz-anim {
  transition:
    opacity .85s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms),
    translate .85s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms),
    scale .85s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms) !important;
}
html.cz-fx .cz-pop.cz-anim {
  transition:
    opacity .5s ease var(--d, 0ms),
    translate .7s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0ms),
    scale .7s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0ms) !important;
}
html.cz-fx .cz-imgz.cz-anim {
  transition:
    opacity 1s ease var(--d, 0ms),
    scale 1.5s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms) !important;
}

/* ---------- 2. header + nav intro ---------- */
html.cz-fx body > header.cz-drop { translate: 0 -100%; }

/* ---------- 3. hero title: word-mask reveal ---------- */
.cz-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .16em; margin-bottom: -.16em; }
.cz-w > span { display: inline-block; }
html.cz-fx .cz-w > span { transform: translateY(120%); transition: transform .85s cubic-bezier(.22, 1, .36, 1); }
html.cz-fx .cz-w > span.cz-w-in { transform: none; }

/* gradient headline words slowly shimmer */
h1 .bg-clip-text {
  background-size: 220% 100%;
  animation: czShine 7s ease-in-out infinite alternate;
}
@keyframes czShine { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* ---------- 4. hero background: slow zoom (parallax is added by jQuery) ---------- */
.cz-kb { animation: czKen 26s ease-in-out infinite alternate; will-change: scale, translate; }
@keyframes czKen { from { scale: 1.1; } to { scale: 1.18; } }

/* hero visual tilt (mouse devices) */
.cz-tilt-on { transition: transform .35s ease; will-change: transform; }

/* ---------- 5. card extras: icon pop + image settle ---------- */
html.cz-fx .cz-card-in :is(.ico, .sol-ico, .jr-circle, .q-ico) {
  animation: czIco .75s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0ms) + 260ms) both;
}
@keyframes czIco { from { scale: 0; rotate: -120deg; opacity: 0; } to { scale: 1; rotate: 0deg; opacity: 1; } }
html.cz-fx .cz-card-in img:not(.cz-imgz) {
  animation: czImg 1.1s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms) both;
}
@keyframes czImg { from { scale: 1.16; } to { scale: 1; } }

/* ---------- 6. buttons: ripple + pulse ---------- */
.btn, .btn-o, .ind-btn2, .wa-btn, .foot-cta, .feat-btn { position: relative; overflow: hidden; }
.cz-ripple {
  position: absolute; border-radius: 9999px; pointer-events: none;
  background: rgba(255, 255, 255, .5); transform: scale(0);
  animation: czRipple .7s ease-out forwards;
}
.btn-o .cz-ripple, .ind-btn2 .cz-ripple, .wa-btn .cz-ripple { background: rgba(109, 40, 217, .22); }
@keyframes czRipple { to { transform: scale(1); opacity: 0; } }

.cz-pulse { animation: none; }
.cz-pulse:hover { animation-play-state: paused; }
@keyframes czPulse {
  0%   { box-shadow: 0 6px 20px rgba(109, 40, 217, .3), 0 0 0 0 rgba(109, 40, 217, .5); }
  70%  { box-shadow: 0 6px 20px rgba(109, 40, 217, .3), 0 0 0 18px rgba(109, 40, 217, 0); }
  100% { box-shadow: 0 6px 20px rgba(109, 40, 217, .3), 0 0 0 0 rgba(109, 40, 217, 0); }
}

/* ---------- 7. forms ---------- */
.cz-focus > .label, .cz-focus > label { color: #6d28d9; transition: color .25s ease; }
.cz-focus .input { box-shadow: 0 0 0 3px rgba(109, 40, 217, .12); }

/* ---------- 8. dark bands: rising sparks + ambient blobs ---------- */
.cz-spark {
  position: absolute; bottom: -14px; z-index: 0; border-radius: 9999px; pointer-events: none;
  background: rgba(196, 181, 253, .55); animation: czRise linear infinite;
}
@keyframes czRise {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  15%  { opacity: .9; }
  100% { transform: translateY(-420px) scale(1.15); opacity: 0; }
}
main [class*="blur-3xl"], main [class*="blur-2xl"], main [class*="blur-[100px]"], main [class*="blur-[80px]"] {
  animation: czBlob 16s ease-in-out infinite alternate;
}
@keyframes czBlob { from { translate: 0 0; scale: 1; } to { translate: 26px -22px; scale: 1.1; } }

/* ---------- 9. menus: desktop mega menu + mobile panel ---------- */
#svc-menu:not(.hidden), #ind-menu:not(.hidden) { animation: czMenu .32s cubic-bezier(.22, 1, .36, 1) both; }
#svc-grid > *, #ind-grid > * { animation: czItem .45s cubic-bezier(.22, 1, .36, 1) both; }
#svc-grid > *:nth-child(1), #ind-grid > *:nth-child(1) { animation-delay: .02s; }
#svc-grid > *:nth-child(2), #ind-grid > *:nth-child(2) { animation-delay: .05s; }
#svc-grid > *:nth-child(3), #ind-grid > *:nth-child(3) { animation-delay: .08s; }
#svc-grid > *:nth-child(4), #ind-grid > *:nth-child(4) { animation-delay: .11s; }
#svc-grid > *:nth-child(5), #ind-grid > *:nth-child(5) { animation-delay: .14s; }
#svc-grid > *:nth-child(6), #ind-grid > *:nth-child(6) { animation-delay: .17s; }
#svc-grid > *:nth-child(7), #ind-grid > *:nth-child(7) { animation-delay: .20s; }
#svc-grid > *:nth-child(8), #ind-grid > *:nth-child(8) { animation-delay: .23s; }
#svc-grid > *:nth-child(n+9), #ind-grid > *:nth-child(n+9) { animation-delay: .26s; }
@keyframes czMenu { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes czItem { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

#mob-panel:not(.hidden) { animation: czMenu .35s cubic-bezier(.22, 1, .36, 1) both; }
#mob-panel:not(.hidden) > * { animation: czItem .4s cubic-bezier(.22, 1, .36, 1) both; }
#mob-panel:not(.hidden) > *:nth-child(1) { animation-delay: .03s; }
#mob-panel:not(.hidden) > *:nth-child(2) { animation-delay: .06s; }
#mob-panel:not(.hidden) > *:nth-child(3) { animation-delay: .09s; }
#mob-panel:not(.hidden) > *:nth-child(4) { animation-delay: .12s; }
#mob-panel:not(.hidden) > *:nth-child(5) { animation-delay: .15s; }
#mob-panel:not(.hidden) > *:nth-child(6) { animation-delay: .18s; }
#mob-panel:not(.hidden) > *:nth-child(n+7) { animation-delay: .21s; }

/* ---------- 10. misc polish ---------- */
.cz-count { font-variant-numeric: tabular-nums; }
.soc { transition: transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease; }

/* ---------- 11. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html.cz-fx *, html.cz-fx *::before, html.cz-fx *::after { animation: none !important; }
}
