/* =========================================================
   SagarPay – shared animations (all pages)
   Uses the individual `translate` / `scale` properties for
   scroll effects so they never clash with the `transform`
   used by existing hover effects and keyframes.
   ========================================================= */

/* ---------- keyframes ---------- */
@keyframes gxDown   { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes gxGrow   { from { opacity: 0; transform: translateY(34px) scale(.82); } to { opacity: 1; transform: none; } }
@keyframes gxLeft   { from { opacity: 0; transform: translateX(-70px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes gxRight  { from { opacity: 0; transform: translateX(90px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes gxPop    { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes gxFloat  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes gxFloat2 { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(12px) rotate(3deg); } }
@keyframes gxSpin   { to { transform: rotate(360deg); } }
@keyframes gxPulse  { 0% { transform: scale(.55); opacity: .6; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes gxRise   { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .85; } 100% { transform: translateY(-760px); opacity: 0; } }
@keyframes gxDrift  { from { transform: translate(0,0) scale(1); } to { transform: translate(50px,-40px) scale(1.25); } }
@keyframes gxGridMv { to { background-position: 44px 44px, 44px 44px; } }
@keyframes gxShine  { 0% { left: -80%; } 60%,100% { left: 140%; } }
@keyframes gxCountIn { from { opacity: 0; transform: rotate(-6deg) scale(.4); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
@keyframes gxWobble  { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-9px); } }

/* ---------- navbar ---------- */
.main-navbar { animation: gxDown .7s cubic-bezier(.2,.7,.2,1) both; }
.main-navbar.gx-scrolled { box-shadow: 0 8px 28px rgba(16, 24, 40, .12); }

/* ---------- scroll progress bar ---------- */
.gx-progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 100%;
  background: linear-gradient(90deg, #087bdc, #48b91d);
  transform-origin: 0 50%; transform: scaleX(0);
  z-index: 10000; pointer-events: none;
}

/* ---------- hero background effects ---------- */
.gx-host { position: relative; overflow: hidden; }
.gx-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.gx-orb { position: absolute; border-radius: 50%; filter: blur(46px); animation: gxDrift 13s ease-in-out infinite alternate; }
.gx-dot { position: absolute; bottom: -12px; border-radius: 50%; background: rgba(255,255,255,.6); animation: gxRise linear infinite; }
.gx-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 60% 40%, #000, transparent 75%);
          mask-image: radial-gradient(circle at 60% 40%, #000, transparent 75%);
  animation: gxGridMv 18s linear infinite;
}
.hero-section::after, .hero::after { z-index: 3; }

/* hero content must sit above the effects */
.hero-container, .hero .wrap, .terms-hero-section .container { position: relative; z-index: 2; }

/* ---------- hero entrance (page load) ---------- */
.gx-hero-in { animation: gxGrow .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--gx-d, 0s); }
.gx-hero-left  { animation: gxLeft  .95s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--gx-d, 0s); }
.gx-hero-right { animation: gxRight 1.1s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--gx-d, .3s); }
.gx-hero-pop   { animation: gxPop .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--gx-d, 0s); }

/* hero scroll-linked parallax (driven by --gx-p, 0 → 1 while the hero scrolls away) */
.gx-par-text   { translate: 0 calc(var(--gx-p, 0) * 70px);  opacity: calc(1 - var(--gx-p, 0) * .85); }
.gx-par-visual { translate: 0 calc(var(--gx-p, 0) * -50px); scale: calc(1 + var(--gx-p, 0) * .12); }
.gx-fx { translate: 0 calc(var(--gx-p, 0) * 40px); }

/* index hero extras */
.hero-pulse { position: absolute; top: 50%; left: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); animation: gxPulse 3.2s ease-out infinite; z-index: 1; }
.hero-pulse.p2 { animation-delay: 1.6s; }
.hero-orbit { position: absolute; top: 50%; left: 50%; width: 470px; height: 470px; margin: -235px 0 0 -235px; border: 1.5px dashed rgba(255,255,255,.4); border-radius: 50%; z-index: 4; animation: gxSpin 28s linear infinite; pointer-events: none; }
.hero-orbit.o2 { width: 570px; height: 570px; margin: -285px 0 0 -285px; border-color: rgba(255,255,255,.16); animation-duration: 46s; animation-direction: reverse; z-index: 0; }
.orbit-item { position: absolute; width: 48px; height: 48px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 21px; box-shadow: 0 12px 26px rgba(0,0,0,.25); animation: gxSpin 28s linear infinite reverse; }
.oi1 { top: -24px; left: calc(50% - 24px); color: #087bdc; }
.oi2 { right: -24px; top: calc(50% - 24px); color: #7c3aed; }
.oi3 { bottom: -24px; left: calc(50% - 24px); color: #168b38; }
.oi4 { left: -24px; top: calc(50% - 24px); color: #f59e0b; }
.floating-icon.amber { color: #d97706; background: #fff4dc; }
.instant-card { top: 30px; left: 10px; animation: gxPop .7s 1.2s both, floating 3.6s 1.9s ease-in-out infinite; }
.payment-card { animation: gxPop .7s 1.4s both, floating 3s 2.1s ease-in-out infinite; }
.secure-card  { animation: gxPop .7s 1.6s both, floating 3s 2.3s ease-in-out infinite; }
.badge-dot { position: relative; animation: gxPulse 1.8s ease-out infinite; }
.hero-primary-btn { position: relative; overflow: hidden; }
.hero-primary-btn::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(8,123,220,.28), transparent); transform: skewX(-20deg); animation: gxShine 3.2s 1.6s infinite; }

/* about / services hero art */
.gx-ring { position: absolute; left: 50%; top: 50%; width: 440px; height: 440px; margin: -220px 0 0 -220px; border: 2px dashed rgba(255,255,255,.38); border-radius: 50%; animation: gxSpin 38s linear infinite; pointer-events: none; z-index: 0; }
.gx-ring::before { content: ""; position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #48b91d; box-shadow: 0 0 18px 4px rgba(72,185,29,.8); }
.gx-ring::after  { content: ""; position: absolute; bottom: -6px; left: 22%; width: 11px; height: 11px; border-radius: 50%; background: #7cc7ff; box-shadow: 0 0 14px 3px rgba(124,199,255,.8); }
.art svg.main { animation: gxFloat 6s ease-in-out infinite; position: relative; z-index: 1; }
.float.note   { animation: gxPop .7s 1s both, gxFloat2 5s 1.7s ease-in-out infinite; z-index: 3; }
.tile.t1 { animation: gxPop .6s 1.2s both,  gxFloat  4.2s 1.8s  ease-in-out infinite; }
.tile.t2 { animation: gxPop .6s 1.35s both, gxFloat2 4.8s 1.95s ease-in-out infinite; }
.tile.t3 { animation: gxPop .6s 1.5s both,  gxFloat  5.2s 2.1s  ease-in-out infinite; }
.tile.t4 { animation: gxPop .6s 1.65s both, gxFloat2 4.4s 2.25s ease-in-out infinite; }
.float.tile { z-index: 3; }
.visual .phone { animation: gxFloat 6s ease-in-out infinite; }
.visual .f1 { animation: gxPop .6s 1s both,   gxFloat  4.2s 1.7s ease-in-out infinite; }
.visual .f2 { animation: gxPop .6s 1.2s both, gxFloat2 4.8s 1.9s ease-in-out infinite; }
.visual .f3 { animation: gxPop .6s 1.4s both, gxFloat  5.2s 2.1s ease-in-out infinite; }
.visual .count { animation: gxCountIn .7s 1.6s both, gxWobble 5s 2.4s ease-in-out infinite; }
.visual .blob { animation: gxDrift 9s ease-in-out infinite alternate; }

/* terms / privacy / contact hero */
.terms-hero-badge { display: inline-flex; }

/* ---------- scroll reveal (grow on scroll) ---------- */
.gx {
  opacity: 0;
  translate: 0 46px;
  scale: .84;
  transition: opacity .8s ease, translate .9s cubic-bezier(.2,.7,.2,1), scale .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--gx-d, 0s);
  will-change: opacity, translate, scale;
}
.gx[data-gx="left"]  { translate: -70px 0; scale: .94; }
.gx[data-gx="right"] { translate: 70px 0;  scale: .94; }
.gx[data-gx="up"]    { translate: 0 50px;  scale: 1; }
.gx[data-gx="zoom"]  { translate: 0 0;     scale: .6; }
.gx.gx-in { opacity: 1; translate: 0 0; scale: 1; will-change: auto; }

/* scroll-scrubbed grow (set from JS, no transition so it follows the scroll smoothly) */
.gx-scrub { will-change: scale, opacity; transform-origin: 50% 60%; }

/* ---------- accessibility ---------- */
@media (max-width: 1100px) { .hero-orbit.o2 { display: none; } }
@media (max-width: 850px)  { .hero-orbit { width: 430px; height: 430px; margin: -215px 0 0 -215px; } }
@media (max-width: 600px) {
  .hero-orbit { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
  .orbit-item { width: 38px; height: 38px; font-size: 17px; border-radius: 11px; }
  .oi1 { top: -19px; left: calc(50% - 19px); } .oi2 { right: -19px; top: calc(50% - 19px); }
  .oi3 { bottom: -19px; left: calc(50% - 19px); } .oi4 { left: -19px; top: calc(50% - 19px); }
  .instant-card { top: 0; left: -4px; scale: .8; }
  .hero-pulse { width: 220px; height: 220px; margin: -110px 0 0 -110px; }
  .gx-ring { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
  .gx { translate: 0 30px; scale: .9; }
  .gx[data-gx="left"], .gx[data-gx="right"] { translate: 0 30px; }
  .gx-par-text, .gx-par-visual { translate: none; scale: none; opacity: 1; }
}
@media (max-width: 450px) { .hero-orbit { width: 270px; height: 270px; margin: -135px 0 0 -135px; } }
@media (max-width: 380px) { .hero-orbit { width: 240px; height: 240px; margin: -120px 0 0 -120px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gx { opacity: 1; translate: none; scale: none; }
  .gx-progress { display: none; }
}
