/* =====================================================================
   Clickzix Tech | Services page animation layer (works with js/services-fx.js + jQuery)
   Every hidden state below only applies when <html> has the "js-fx" class,
   so the page stays fully visible if JavaScript fails or motion is reduced.
   ===================================================================== */

html.js-fx { scroll-behavior: auto; }
html.js-fx main { overflow-x: clip; }

/* ---------- scroll progress + header ---------- */
#fx-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; pointer-events: none;
  background: linear-gradient(90deg, #6d28d9, #a78bfa, #f59e0b); box-shadow: 0 0 12px rgba(167,139,250,.75); }
body > header { transition: box-shadow .3s ease; }
body > header.fx-scrolled { box-shadow: 0 10px 34px rgba(109,40,217,.16); }

/* ---------- mega menus ---------- */
#svc-menu:not(.hidden), #ind-menu:not(.hidden) { animation: fxMenu .32s cubic-bezier(.22,1,.36,1) both; }
#svc-grid > *, #ind-grid > * { animation: fxItem .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 fxMenu { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes fxItem { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

/* ---------- hero: living background, particles, shine ---------- */
html.js-fx .hero-band { background-size: 240% 240%; animation: fxGrad 18s ease-in-out infinite; }
@keyframes fxGrad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
html.js-fx .hero-band .dot { animation: fxDrift 14s ease-in-out infinite alternate; }
html.js-fx .hero-band .dot + .dot { animation-duration: 18s; animation-direction: alternate-reverse; }
@keyframes fxDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(-36px, 28px) scale(1.12); } }
.fx-spark { position: absolute; bottom: -14px; z-index: 1; border-radius: 9999px; background: rgba(255,255,255,.55); pointer-events: none; animation: fxRise linear infinite; }
@keyframes fxRise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-460px) scale(1.15); opacity: 0; } }

.pill-link { position: relative; overflow: hidden; }
.pill-link::after { content: ""; position: absolute; top: 0; left: -130%; width: 60%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(110deg, transparent, rgba(167,139,250,.38), transparent); transition: left .7s ease; pointer-events: none; }
.pill-link:hover::after { left: 150%; }

html.js-fx .hero-photo img { animation: fxKen 22s ease-in-out infinite alternate; }
@keyframes fxKen { from { scale: 1; } to { scale: 1.09; } }

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

/* ---------- hidden start states ---------- */
html.js-fx .hero-crumb, html.js-fx .hero-sub, html.js-fx .hero-pills .pill-link, html.js-fx .hero-cta > *,
html.js-fx .svc-h2, html.js-fx .svc-h3, html.js-fx .svc-p,
html.js-fx .fx-up { opacity: 0; translate: 0 30px; }
html.js-fx .hero-title { opacity: 0; }
html.js-fx .tick-list li, html.js-fx .fx-left { opacity: 0; translate: -34px 0; }
html.js-fx .fx-right { opacity: 0; translate: 34px 0; }
html.js-fx .hero-media { opacity: 0; translate: 70px 0; scale: .94; }
html.js-fx .hero-badge, html.js-fx .viz-chip, html.js-fx .fx-zoom { opacity: 0; scale: .82; }
html.js-fx .viz { opacity: 0; scale: .9; translate: 0 26px; }
html.js-fx .viz.fx-vl { translate: -64px 0; }
html.js-fx .viz.fx-vr { translate: 64px 0; }
html.js-fx .viz-art > * { scale: 0; transform-box: fill-box; transform-origin: center;
  transition: scale .65s cubic-bezier(.34,1.56,.64,1) var(--d, 0ms); }
html.js-fx .viz-art > .fx-svg-in { scale: 1; }
html.js-fx .fx-tw { opacity: 0; transition: opacity .35s ease; }
html.js-fx .fx-tw.fx-in { opacity: 1 !important; }

/* revealed state + animation timing */
html.js-fx .fx-in { opacity: 1 !important; translate: 0 0 !important; scale: 1 !important; }
html.js-fx .fx-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.js-fx .fx-anim.fx-pop { transition: opacity .6s 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; }

/* ---------- headings: animated underline ---------- */
.svc-h2::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 4px; margin-top: 12px; background: linear-gradient(90deg, #6d28d9, #f59e0b); }
.wk-head .svc-h2::after, .fmt-head .svc-h2::after, .cmp-head .svc-h2::after { margin-inline: auto; }
html.js-fx .svc-h2::after { width: 0; transition: width .9s cubic-bezier(.22,1,.36,1) .35s; }
html.js-fx .svc-h2.fx-in::after { width: 64px; }

/* ---------- illustration life ---------- */
html.js-fx .viz { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s ease, box-shadow .4s ease; will-change: transform; }
html.js-fx .hero-media { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s ease; will-change: transform; }
html.js-fx .viz:hover { box-shadow: 0 28px 64px rgba(109,40,217,.28); }
html.js-fx .viz-art { animation: fxFloat 7s ease-in-out infinite; }
@keyframes fxFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -9px; } }
html.js-fx .viz-chip { animation: fxBob 4.6s ease-in-out infinite; }
html.js-fx .viz-chip.c2 { animation-delay: 1.3s; } html.js-fx .viz-chip.c3 { animation-delay: 2.4s; }
@keyframes fxBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
html.js-fx .viz::before { animation: fxDrift 12s ease-in-out infinite alternate; }
html.js-fx .viz::after { animation: fxDrift 15s ease-in-out infinite alternate-reverse; }

/* ---------- ticks: icon pop ---------- */
html.js-fx .tick-list li.fx-in .material-symbols-outlined { animation: fxPop .6s cubic-bezier(.34,1.56,.64,1) .1s both; }
@keyframes fxPop { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }

/* ---------- page specific ---------- */
html.js-fx .lp-card.fx-in .lp-pin { animation: fxDrop .8s cubic-bezier(.34,1.56,.64,1) both; }
html.js-fx .lp-card.fx-in .lp-pin.p1 { animation-delay: .45s; } html.js-fx .lp-card.fx-in .lp-pin.p2 { animation-delay: .7s; } html.js-fx .lp-card.fx-in .lp-pin.p3 { animation-delay: .95s; }
@keyframes fxDrop { from { opacity: 0; transform: translateY(-46px) scale(.6); } to { opacity: 1; transform: none; } }
html.js-fx .fmt-play { animation: fxBeat 2.6s ease-in-out infinite; }
@keyframes fxBeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
html.js-fx .fmt-bar::after { animation: fxBar 4s ease-in-out infinite alternate; }
@keyframes fxBar { from { width: 20%; } to { width: 90%; } }
html.js-fx .wk-card:hover .wk-bar i { background: #6d28d9; }

/* ---------- CTA pulse + card polish ---------- */
.fx-pulse { position: relative; }
.fx-pulse::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: fxRing 2.6s ease-out infinite; }
@keyframes fxRing { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); } 70%,100% { box-shadow: 0 0 0 18px rgba(255,255,255,0); } }
main .card { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
main .card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(109,40,217,.16); }

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