/* ==========================================================
   Wealth Grow Research – Global Animation Layer
   Loaded from header.php. Works on every page automatically.
   Content stays visible if JavaScript is disabled.
   ========================================================== */

html { scroll-behavior: smooth; }

/* ── Page load / leave ───────────────────────────────────── */
@keyframes fxPageIn { from { opacity: 0; } to { opacity: 1; } }
body { animation: fxPageIn .55s ease-out both; }
body.fx-leaving { opacity: 0; transition: opacity .22s ease; }

/* ── Scroll progress bar ─────────────────────────────────── */
#fxProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  z-index: 1100; pointer-events: none;
  background: linear-gradient(90deg, #C5A059, #e5cc91, #C5A059);
  transform: scaleX(0); transform-origin: 0 50%;
  box-shadow: 0 0 10px rgba(197,160,89,.55);
}

/* ── Scroll reveal (auto-applied by animations.js) ───────── */
html.fx-on .fx {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--fx-d, 0s);
  will-change: opacity, transform;
}
html.fx-on .fx[data-fx="left"]  { transform: translate3d(-44px, 0, 0); }
html.fx-on .fx[data-fx="right"] { transform: translate3d(44px, 0, 0); }
html.fx-on .fx[data-fx="zoom"]  { transform: scale(.92); }
html.fx-on .fx.fx-in { opacity: 1; transform: none; }
/* after the reveal finishes, free the element for hover effects */
html.fx-on .fx.fx-done {
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease,
              border-color .3s ease, background-color .3s ease, opacity .3s ease;
  transition-delay: 0s; will-change: auto;
}

/* ── Hero entrance (runs on page load) ───────────────────── */
@keyframes fxRise {
  from { opacity: 0; transform: translate3d(0, 30px, 0); }
  to   { opacity: 1; transform: none; }
}
html.fx-on [class*="hero"] h1,
html.fx-on [class*="hero"] h2:first-of-type,
html.fx-on [class*="hero"] p,
html.fx-on [class*="hero"] [class*="breadcrumb"],
html.fx-on [class*="hero"] [class*="actions"],
html.fx-on [class*="hero"] [class*="tag"],
html.fx-on [class*="hero"] .eyebrow {
  animation: fxRise .9s cubic-bezier(.16,1,.3,1) both;
}
html.fx-on [class*="hero"] .eyebrow,
html.fx-on [class*="hero"] [class*="breadcrumb"] { animation-delay: .05s; }
html.fx-on [class*="hero"] h1 { animation-delay: .18s; }
html.fx-on [class*="hero"] h2:first-of-type { animation-delay: .25s; }
html.fx-on [class*="hero"] p { animation-delay: .34s; }
html.fx-on [class*="hero"] [class*="actions"] { animation-delay: .48s; }

/* Shimmering gold highlight in hero headings */
@keyframes fxShimmer { to { background-position: 200% center; } }
[class*="hero"] h1 span {
  background: linear-gradient(90deg, #e5cc91 0%, #fff3cf 25%, #c6a15b 50%, #e5cc91 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fxShimmer 4.5s linear infinite;
}

/* ── Floating decorative orbs (injected into heroes) ─────── */
@keyframes fxFloatA { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(26px,-34px,0) scale(1.08); } }
@keyframes fxFloatB { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-30px,24px,0) scale(.94); } }
.fx-orb {
  position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(229,204,145,.34), rgba(197,160,89,.06) 60%, transparent 72%);
  filter: blur(2px);
}
.fx-orb.o1 { width: 280px; height: 280px; left: -90px; bottom: -110px; animation: fxFloatA 11s ease-in-out infinite; }
.fx-orb.o2 { width: 190px; height: 190px; right: 12%; top: 14%; animation: fxFloatB 9s ease-in-out infinite; }
.fx-orb.o3 { width: 90px;  height: 90px;  left: 44%; top: 62%; animation: fxFloatA 7s ease-in-out infinite reverse; }
.fx-orb-ring {
  position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
  border: 1px dashed rgba(197,160,89,.28);
  width: 340px; height: 340px; left: 6%; top: -170px;
  animation: fxSpin 38s linear infinite;
}
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* ── Cards: lift, glow & icon pop on hover ───────────────── */
body main [class*="-card"]:not([class*="card-"]),
body main [class*="card"]:not([class*="card-"]):not([class*="cards"]),
body main .why-card, body main .plan-card, body main .contact-item,
body main .info-item, body main .trust-item, body main .wgr-trust-item,
body main .process-card, body main .feature-card, body main .service-card {
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, border-color .3s ease;
}
@media (hover: hover) {
  body main .fx-done[class*="card"]:hover,
  body main .feature-card:hover, body main .service-card:hover, body main .why-card:hover,
  body main .plan-card:hover, body main .process-card:hover, body main .info-card:hover,
  body main .content-card:hover, body main .contact-item:hover, body main .wgr-sitemap-card:hover,
  body main .wgr-investor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 46px rgba(11,19,43,.13), 0 0 0 1px rgba(197,160,89,.35);
  }
}
@keyframes fxIconPop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.22) rotate(-8deg); } 70% { transform: scale(.95) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@media (hover: hover) {
  body main [class*="card"]:hover > i:first-child,
  body main [class*="card"]:hover [class*="icon"] i,
  body main [class*="card"]:hover [class*="icon"]:not(:has(i)),
  body main .contact-item:hover [class*="icon"],
  body main .trust-item:hover > i {
    animation: fxIconPop .65s ease;
  }
}

/* ── Buttons: ripple + lift ──────────────────────────────── */
.fx-ripple-host { position: relative; overflow: hidden; }
.fx-ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.45); transform: scale(0);
  animation: fxRipple .65s ease-out forwards;
}
@keyframes fxRipple { to { transform: scale(4); opacity: 0; } }

@keyframes fxPulseGold {
  0%   { box-shadow: 0 0 0 0 rgba(197,160,89,.55); }
  70%  { box-shadow: 0 0 0 14px rgba(197,160,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(197,160,89,0); }
}
.btn-gold, .btn-cta, [class*="hero"] a[class*="btn"]:first-child { animation: fxPulseGold 2.8s ease-out 1.6s infinite; }
.btn-gold:hover, .btn-cta:hover, [class*="hero"] a[class*="btn"]:hover { animation: none; }

/* ── Header polish ───────────────────────────────────────── */
@keyframes fxNavIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.nav > a, .nav > .dropdown { animation: fxNavIn .6s cubic-bezier(.16,1,.3,1) both; }
.nav > *:nth-child(1) { animation-delay: .15s; } .nav > *:nth-child(2) { animation-delay: .22s; }
.nav > *:nth-child(3) { animation-delay: .29s; } .nav > *:nth-child(4) { animation-delay: .36s; }
.nav > *:nth-child(5) { animation-delay: .43s; } .nav > *:nth-child(6) { animation-delay: .50s; }
.nav > *:nth-child(7) { animation-delay: .57s; }
.header-split.is-scrolled .header-in { height: 72px; }
.header-split .header-in { transition: height .35s ease; }
.header-split.is-scrolled .logo-block img { max-height: 52px; }
.logo-block img { transition: max-height .35s ease, transform .3s ease; }

/* Mobile drawer links slide in one by one */
.mobile-drawer .mobile-drawer-body > * {
  opacity: 0; transform: translateX(26px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.22,1,.36,1), background .2s, color .2s;
}
.mobile-drawer.is-on .mobile-drawer-body > * { opacity: 1; transform: none; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(1) { transition-delay: .12s; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(2) { transition-delay: .18s; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(3) { transition-delay: .24s; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(4) { transition-delay: .30s; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(5) { transition-delay: .36s; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(6) { transition-delay: .42s; }
.mobile-drawer.is-on .mobile-drawer-body > *:nth-child(n+7) { transition-delay: .48s; }

/* ── Market chart: line draws itself ─────────────────────── */
@keyframes fxDraw { to { stroke-dashoffset: 0; } }
@keyframes fxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxDot  { 0%,100% { r: 5; opacity: 1; } 50% { r: 9; opacity: .45; } }
.chart-area svg path[stroke] { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); animation: fxDraw 2.6s .5s cubic-bezier(.65,0,.35,1) forwards; }
.chart-area svg path[fill^="url"] { opacity: 0; animation: fxFade 1.4s 1.6s ease forwards; }
.chart-area svg circle { opacity: 0; animation: fxFade .4s 3s forwards, fxDot 1.8s 3.2s ease-in-out infinite; }
@keyframes fxBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.floating-note { animation: fxBob 4s ease-in-out infinite; }

/* ── WhatsApp pulse + back-to-top ────────────────────────── */
@keyframes fxWaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.6); }
  70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.wgr-whatsapp-float { animation: fxWaPulse 2.4s ease-out infinite; }
#fxTop {
  position: fixed; right: 22px; bottom: 76px; z-index: 950;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(197,160,89,.5);
  background: #0B132B; color: #e5cc91; cursor: pointer;
  display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 8px 22px rgba(11,19,43,.25);
  opacity: 0; transform: translateY(16px) scale(.8); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1), background .2s, color .2s;
}
#fxTop.show { opacity: 1; transform: none; pointer-events: auto; }
#fxTop:hover { background: #C5A059; color: #0B132B; transform: translateY(-3px); }

/* ── Footer links ────────────────────────────────────────── */
footer a, .wgr-footer a { transition: color .25s ease, padding-left .25s ease, transform .25s ease; }
footer li a:hover, .wgr-footer li a:hover { transform: translateX(5px); }

/* ── Accessibility: respect reduced-motion ───────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.fx-on .fx { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .chart-area svg path[stroke] { stroke-dashoffset: 0; }
  .chart-area svg path[fill^="url"], .chart-area svg circle { opacity: 1; }
  .fx-orb, .fx-orb-ring { display: none; }
}
