/* ============================================================================
   MUDIT COMPUTERS — FX LAYER (cinematic polish, v1.1)
   ----------------------------------------------------------------------------
   style.css ke upar ek halki parat. Sirf transform/opacity animate hote hain
   (GPU friendly). prefers-reduced-motion par sab shaant ho jaata hai.
   Ise hata do to site pehle jaisi ho jaati hai — koi layout dependency nahi.
   ========================================================================= */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --glow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
          0 10px 30px -6px color-mix(in srgb, var(--accent) 38%, transparent);
}

/* ── Page enter transition ─────────────────────────────────────── */
@keyframes fx-page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#main { animation: fx-page-in .55s var(--ease-out) both; }
html.fx-leaving #main { opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }

/* Top progress bar (page navigation) */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  transform: scaleX(0); transform-origin: left;
  box-shadow: 0 0 10px color-mix(in srgb, var(--highlight) 60%, transparent);
}
html.fx-leaving .fx-progress { transform: scaleX(.7); transition: transform 1.2s var(--ease-out); }

/* Scroll progress (thin line under header) */
.fx-scrollbar {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 9998; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  transform: scaleX(var(--fx-scroll, 0)); transform-origin: left; opacity: .85;
}

/* ── Hero: animated gradient mesh ──────────────────────────────── */
.hero > .fx-mesh, .fx-mesh { position: absolute; inset: -10%; z-index: 0 !important; pointer-events: none; overflow: hidden; }
/* perf: filter:blur(60px) hataya — soft edge ab radial-gradient se (raster cost ~0, same look) */
.fx-mesh span {
  position: absolute; border-radius: 50%; opacity: .55;
  will-change: transform; contain: strict;
}
.fx-mesh span:nth-child(1) { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; top: -8%; right: 2%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--highlight) 45%, transparent), transparent); animation: fx-drift1 22s ease-in-out infinite alternate; }
.fx-mesh span:nth-child(2) { width: 40vw; height: 40vw; max-width: 540px; max-height: 540px; bottom: -12%; left: -4%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent); animation: fx-drift2 26s ease-in-out infinite alternate; }
.fx-mesh span:nth-child(3) { width: 26vw; height: 26vw; max-width: 360px; max-height: 360px; top: 30%; left: 38%;
  background: radial-gradient(closest-side, color-mix(in srgb, #8B5CF6 22%, transparent), transparent); animation: fx-drift3 30s ease-in-out infinite alternate; opacity: .4; }
@media (max-width: 760px) { .fx-mesh span:nth-child(3) { display: none; } }
[data-theme="dark"] .fx-mesh span { opacity: .32; }
@keyframes fx-drift1 { to { transform: translate3d(-8%, 10%, 0) scale(1.12); } }
@keyframes fx-drift2 { to { transform: translate3d(12%, -8%, 0) scale(1.08); } }
@keyframes fx-drift3 { to { transform: translate3d(-18%, 14%, 0) scale(.9); } }

/* Hero headline word reveal (words are wrapped by fx.js) */
.fx-word { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(2deg); filter: blur(6px);
  animation: fx-word .8s var(--ease-out) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes fx-word { to { opacity: 1; transform: none; filter: blur(0); } }
.hero h1 .grad { background-size: 200% 100%; animation: fx-shine 7s ease-in-out 4 alternate; } /* perf: 4 passes then rest (was infinite) */
@keyframes fx-shine { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.hero .eyebrow, .hero .lead, .hero-cta, .hero-trust { animation: fx-page-in .8s var(--ease-out) both; }
.hero .lead { animation-delay: .35s; } .hero-cta { animation-delay: .5s; } .hero-trust { animation-delay: .65s; }

/* Hero image: soft parallax (set via --fx-par from JS) + floating cards bob */
.hero-img { transform: translate3d(0, var(--fx-par, 0px), 0); transition: box-shadow .4s var(--ease-out); }
.hero-img img { transition: transform 1.2s var(--ease-out); }
.hero-visual:hover .hero-img img { transform: scale(1.04); }
.hero-float { animation: fx-bob 6s ease-in-out infinite; }
.hero-float-2 { animation-delay: -3s; }
@keyframes fx-bob { 50% { transform: translateY(-8px); } }

/* ── Buttons: sheen, glow, press ───────────────────────────────── */
.btn { position: relative; overflow: hidden; isolation: isolate;
  transition: transform .25s var(--ease-out), box-shadow .3s var(--ease-out), background-color .25s, color .25s, border-color .25s; }
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease-out);
}
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary { background-image: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--highlight))); }
.btn-primary:hover { box-shadow: var(--glow); }
.btn-wa:hover { box-shadow: 0 10px 28px -6px rgba(37,211,102,.55); }
/* click ripple */
.fx-ripple { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  background: currentColor; opacity: .25; transform: scale(0); animation: fx-ripple .6s var(--ease-out) forwards; }
@keyframes fx-ripple { to { transform: scale(1); opacity: 0; } }

/* ── Cards: depth + cursor spotlight ───────────────────────────── */
.card { transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s; }
.card-hover { position: relative; }
.card-hover::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 9%, transparent), transparent 45%);
  transition: opacity .35s;
}
.card-hover:hover::after { opacity: 1; }
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--sh-xl); }
.icon-box { transition: transform .4s var(--ease-out); }
.card-hover:hover .icon-box { transform: scale(1.08) rotate(-4deg); }

/* ── Nav + dropdown polish ─────────────────────────────────────── */
/* perf: sticky header par backdrop-filter har scroll frame par peeche ka sab resample karta tha.
   Top par (kuch peeche scroll nahi ho raha) halka 6px blur; scroll hote hi solid-ish bg, koi filter nahi. */
.header { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.header.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 97%, transparent); }
.nav-link { position: relative; transition: color .2s, background-color .2s; }
.dropdown { transform-origin: top center; transition: opacity .22s var(--ease-out), transform .28s var(--ease-out), visibility .22s; }
.dropdown a { position: relative; transition: background-color .2s, color .2s, transform .25s var(--ease-out); }
.dropdown a:hover { transform: translateX(4px); }
.dropdown a::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--highlight)); transform: scaleY(0); transition: transform .25s var(--ease-out); }
.dropdown a:hover::before { transform: scaleY(1); }

/* Mobile drawer: staggered links */
.drawer-panel { transition: transform .45s var(--ease-out) !important; }
.drawer .m-nav > li { opacity: 0; transform: translateX(18px); transition: opacity .35s, transform .45s var(--ease-out); }
.drawer.open .m-nav > li { opacity: 1; transform: none; }
.drawer.open .m-nav > li:nth-child(1) { transition-delay: .08s; } .drawer.open .m-nav > li:nth-child(2) { transition-delay: .12s; }
.drawer.open .m-nav > li:nth-child(3) { transition-delay: .16s; } .drawer.open .m-nav > li:nth-child(4) { transition-delay: .20s; }
.drawer.open .m-nav > li:nth-child(5) { transition-delay: .24s; } .drawer.open .m-nav > li:nth-child(n+6) { transition-delay: .28s; }

/* ── Sound toggle ──────────────────────────────────────────────── */
.sound-toggle { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--text-muted); transition: background-color .2s, color .2s; }
.sound-toggle:hover { background: var(--bg-softer); color: var(--accent); }
.sound-toggle svg { width: 19px; height: 19px; }
.sound-toggle .snd-on { display: none; }
.sound-toggle[aria-pressed="true"] .snd-on { display: block; }
.sound-toggle[aria-pressed="true"] .snd-off { display: none; }
.sound-toggle[aria-pressed="true"] { color: var(--accent); }
.sound-toggle .snd-hint { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--highlight); box-shadow: 0 0 0 0 var(--highlight); animation: fx-ping 2.2s ease-out 3; }
.sound-toggle.seen .snd-hint { display: none; }
@keyframes fx-ping { 70%,100% { box-shadow: 0 0 0 8px transparent; } }

/* ── Auto reveal for sections (JS adds .fx-rv) ─────────────────── */
.fx-rv { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0s); }
.fx-rv.in { opacity: 1; transform: none; }
/* v3 reveal variety (JS section ke hisaab se chunta hai; sab one-shot, IO se) */
.fx-rv.fx-v-scale { transform: scale(.9); transition-timing-function: var(--ease-out), cubic-bezier(.34, 1.4, .64, 1); }
.fx-rv.fx-v-left  { transform: translateX(-40px); }
.fx-rv.fx-v-right { transform: translateX(40px); }
.fx-rv.fx-v-tilt  { transform: translateY(30px) rotate(-2.5deg); transform-origin: 0 100%; }
.fx-rv.fx-v-flip  { transform: perspective(900px) rotateX(14deg) translateY(20px); transform-origin: 50% 100%; }
.fx-rv.in.fx-v-scale, .fx-rv.in.fx-v-left, .fx-rv.in.fx-v-right, .fx-rv.in.fx-v-tilt, .fx-rv.in.fx-v-flip { transform: none; }
/* Section h2: reveal ke saath accent underline draw-in */
h2.fx-rv::after { content: ''; display: block; width: 56px; height: 3px; margin-top: .45em; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--highlight)); transform: scaleX(0); transform-origin: left;
  transition: transform .9s var(--ease-out) .25s; }
.text-center h2.fx-rv::after, h2.fx-rv.text-center::after, .center h2.fx-rv::after { margin-left: auto; margin-right: auto; transform-origin: center; }
h2.fx-rv.in::after { transform: scaleX(1); }
/* Stat number pop jab count-up khatam ho */
.fx-count-done { animation: fx-count-pop .5s var(--ease-out); }
@keyframes fx-count-pop { 40% { transform: scale(1.12); } }

/* ── Ambient animation pausing (JS: off-screen => .fx-paused, tab hidden => html.fx-hidden) ── */
.fx-paused, .fx-paused *, .fx-paused::before, .fx-paused::after, .fx-paused *::before, .fx-paused *::after,
html.fx-hidden *, html.fx-hidden *::before, html.fx-hidden *::after { animation-play-state: paused !important; }

/* Hero cursor trail canvas */
.fx-trail { position: absolute; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }

/* Button click: expanding ring + squash */
.fx-ring { position: fixed; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none; z-index: 9996;
  border: 2px solid var(--c, var(--accent)); animation: fx-ring .55s var(--ease-out) forwards; }
@keyframes fx-ring { from { transform: translate3d(var(--x), var(--y), 0) scale(1); opacity: .8; } to { transform: translate3d(var(--x), var(--y), 0) scale(9); opacity: 0; } }
.btn.fx-squash { animation: fx-squash .38s var(--ease-out); }
@keyframes fx-squash { 30% { scale: .94 1.04; } 60% { scale: 1.03 .98; } }

/* Footer: below the fold — browser layout/paint skip karta hai jab tak paas na aaye */
.footer { content-visibility: auto; contain-intrinsic-size: auto 520px; }

/* Stats / float-card numbers get tabular digits so count-up doesn't jitter */
[data-count], .hf-num { font-variant-numeric: tabular-nums; }

/* WhatsApp: gentle breathing */
.wa-float { transition: transform .3s var(--ease-out), box-shadow .3s; }

/* Section headings: accent underline draw-in */
.section h2.fx-line { position: relative; }

/* ── Reduced motion: everything calm ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #main, .hero .eyebrow, .hero .lead, .hero-cta, .hero-trust, .fx-word, .hero-float, .hero h1 .grad { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .fx-mesh span { animation: none !important; }
  .fx-rv { opacity: 1 !important; transform: none !important; transition: none !important; }
  h2.fx-rv::after { transform: none !important; transition: none !important; }
  .fx-trail, .fx-ring { display: none !important; }
  .fx-ch { animation: none !important; opacity: 1 !important; transform: none !important; }
  .btn.fx-squash, .fx-count-done { animation: none !important; }
  .btn::before, .fx-ripple { display: none; }
  .hero-img { transform: none !important; }
  .drawer .m-nav > li { opacity: 1; transform: none; transition: none; }
}
@media print { .fx-mesh, .fx-progress, .fx-scrollbar, .sound-toggle { display: none !important; } }

/* Hero eyebrow: letters fly in (fx.js 3b) — sirf transform/opacity */
.hero .eyebrow.fx-fly-on { animation: none; }
.fx-fly-w { display: inline-block; white-space: nowrap; }
.fx-ch { display: inline-block; animation: fx-ch-in .75s cubic-bezier(.2,.9,.25,1.15) both; animation-delay: calc(.15s + var(--i) * .03s); }
@keyframes fx-ch-in { from { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(.4); } to { opacity: 1; transform: none; } }
