/* =============================================================
   Mitra360 — FX layer (futuristic motion + depth)
   Loads ON TOP of styles.css. Brand tokens (blue palette, Poppins)
   remain authoritative. This file only adds animation, layering,
   3D, glow, and interaction polish — never re-themes.
   ============================================================= */

:root {
  --fx-blue:        #1976D2;
  --fx-blue-d:      #0D47A1;
  --fx-blue-sky:    #BBDEFB;
  --fx-blue-light:  #E3F2FD;
  --fx-navy:        #0D1B2A;
  --fx-glow:        0 10px 40px -10px rgba(25,118,210,.55), 0 4px 14px -4px rgba(13,71,161,.45);
  --fx-glow-soft:   0 0 0 1px rgba(25,118,210,.16), 0 14px 48px -18px rgba(25,118,210,.35);
}

html { scroll-behavior: smooth; }
body.fx-body { overflow-x: clip; }

/* ============================================================
   Boot loader — first 700ms, then fades out
   ============================================================ */
.fx-boot {
  position: fixed; inset: 0;
  z-index: 9999;
  display: grid; place-items: center;
  background: var(--fx-navy);
  pointer-events: none;
  animation: fxBootOut .55s ease .85s forwards;
}
.fx-boot__ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.08);
  border-top-color: var(--fx-blue);
  border-right-color: var(--fx-blue-sky);
  animation: fxSpin .85s linear infinite;
}
.fx-boot__word {
  position: absolute;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #fff;
  margin-top: 110px;
  opacity: .85;
}
.fx-boot__word span { color: var(--fx-blue-sky); }
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxBootOut {
  to { opacity: 0; visibility: hidden; }
}

/* ============================================================
   Scroll progress bar — pinned at very top
   ============================================================ */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9000;
  pointer-events: none;
  background: transparent;
}
.fx-progress span {
  display: block; height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fx-blue-sky), var(--fx-blue), var(--fx-blue-d));
  box-shadow: 0 0 12px rgba(25,118,210,.7);
  transition: width .08s linear;
}

/* ============================================================
   Cursor glow — follows pointer, soft blue halo
   ============================================================ */
.fx-cursor {
  position: fixed; top: 0; left: 0;
  width: 480px; height: 480px;
  margin: -240px 0 0 -240px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(25,118,210,.22) 0%,
    rgba(25,118,210,.10) 25%,
    rgba(25,118,210,0) 65%);
  pointer-events: none;
  z-index: 5;
  transform: translate3d(-50vw, -50vh, 0);
  transition: opacity .25s ease;
  opacity: 0;
  mix-blend-mode: normal;
  will-change: transform;
}
.fx-body.fx-cursor-on .fx-cursor { opacity: 1; }
@media (hover: none), (max-width: 880px) { .fx-cursor { display: none; } }

/* ============================================================
   HERO — animated mesh + grid + sparkles
   ============================================================ */
.hero { isolation: isolate; }
.hero__fx {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.fx-mesh { position: absolute; inset: -20%; filter: blur(80px) saturate(140%); }
.fx-orb {
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  opacity: .55;
  will-change: transform;
}
.fx-orb--a {
  left: -8%; top: 10%;
  background: radial-gradient(circle at 30% 30%, var(--fx-blue) 0%, transparent 60%);
  animation: fxOrbA 18s ease-in-out infinite;
}
.fx-orb--b {
  right: -6%; top: -8%;
  width: 520px; height: 520px;
  background: radial-gradient(circle at 60% 40%, var(--fx-blue-sky) 0%, transparent 60%);
  animation: fxOrbB 22s ease-in-out infinite;
}
.fx-orb--c {
  left: 30%; bottom: -10%;
  width: 540px; height: 540px;
  background: radial-gradient(circle at 50% 50%, var(--fx-blue-d) 0%, transparent 60%);
  opacity: .35;
  animation: fxOrbC 26s ease-in-out infinite;
}
@keyframes fxOrbA {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(80px,40px) scale(1.15); }
}
@keyframes fxOrbB {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-100px,60px) scale(1.1); }
}
@keyframes fxOrbC {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(60px,-50px) scale(1.18); }
}

/* Dotted/grid overlay with radial mask so it fades to edges */
.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(25,118,210,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(25,118,210,.10) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, #000 0%, transparent 80%);
  opacity: .8;
}

/* Floating sparkle dots */
.fx-sparkles { position: absolute; inset: 0; }
.fx-sparkles span {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fx-blue);
  box-shadow: 0 0 12px var(--fx-blue);
  opacity: .55;
  animation: fxFloat 9s ease-in-out infinite;
}
.fx-sparkles span:nth-child(1) { left: 12%;  top: 22%; animation-delay: 0s;   width: 4px; height: 4px; }
.fx-sparkles span:nth-child(2) { left: 24%;  top: 78%; animation-delay: -2s;  background: var(--fx-blue-sky); }
.fx-sparkles span:nth-child(3) { left: 48%;  top: 14%; animation-delay: -4s;  width: 3px; height: 3px; }
.fx-sparkles span:nth-child(4) { left: 66%;  top: 84%; animation-delay: -1s;  background: var(--fx-blue-sky); }
.fx-sparkles span:nth-child(5) { left: 82%;  top: 28%; animation-delay: -3s; }
.fx-sparkles span:nth-child(6) { left: 88%;  top: 62%; animation-delay: -5s;  width: 5px; height: 5px; }
.fx-sparkles span:nth-child(7) { left: 8%;   top: 56%; animation-delay: -6s;  width: 3px; height: 3px; background: var(--fx-blue-sky); }
.fx-sparkles span:nth-child(8) { left: 55%;  top: 64%; animation-delay: -7s;  width: 4px; height: 4px; }
@keyframes fxFloat {
  0%,100% { transform: translate(0,0); opacity:.55; }
  50%     { transform: translate(8px,-14px); opacity:.95; }
}

/* The hero's existing ::before glow is now redundant; soften it */
.hero::before { opacity: .35; }
.hero__wrap { position: relative; z-index: 2; }

/* ============================================================
   Eyebrow shimmer — moving highlight stripe across label
   ============================================================ */
.fx-shimmer {
  position: relative;
  background: linear-gradient(90deg,
    var(--fx-blue) 0%, var(--fx-blue) 30%,
    #fff 50%,
    var(--fx-blue) 70%, var(--fx-blue) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: fxShimmer 4.5s ease-in-out infinite;
}
@keyframes fxShimmer {
  0%   { background-position: 100% 50%; }
  50%  { background-position: 0% 50%; }
  100% { background-position: -100% 50%; }
}

/* ============================================================
   Headline reveal — words slide up + blur clear
   ============================================================ */
.fx-headline .fx-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  animation: fxWordIn .9s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 950ms);
  margin-right: .25ch;
}
.fx-headline em { color: var(--fx-blue); }
.fx-headline em.fx-word { color: var(--fx-blue); }
@keyframes fxWordIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ============================================================
   Generic scroll-reveal: data-reveal="up"
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1) var(--rd, 0s),
              transform .9s cubic-bezier(.2,.7,.2,1) var(--rd, 0s);
  will-change: opacity, transform;
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children inside grids */
.fx-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i,0) * 70ms);
}
.fx-stagger.is-in > * { opacity: 1; transform: translateY(0); }

/* ============================================================
   Buttons — magnetic + animated sheen
   ============================================================ */
.btn--primary {
  position: relative;
  overflow: hidden;
  box-shadow: var(--fx-glow);
}
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255,255,255,.42) 50%,
    transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s ease;
  pointer-events: none;
}
.btn--primary:hover::after { transform: translateX(120%); }
.fx-magnetic { transition: transform .25s cubic-bezier(.2,.7,.2,1), background .15s ease, box-shadow .25s ease; }
.fx-magnetic:hover { box-shadow: 0 16px 50px -12px rgba(25,118,210,.7), 0 6px 18px -4px rgba(13,71,161,.55); }

.wa-dot {
  animation: fxPulseDot 2s ease-in-out infinite;
}
@keyframes fxPulseDot {
  0%,100% { box-shadow: 0 0 0 4px rgba(255,255,255,.22); }
  50%     { box-shadow: 0 0 0 7px rgba(255,255,255,.05); }
}

/* ============================================================
   Phone — 3D tilt frame + ambient glow
   ============================================================ */
.fx-tilt {
  transform-style: preserve-3d;
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.phone__glow {
  position: absolute;
  inset: -28px;
  border-radius: 60px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(25,118,210,.45) 0%, transparent 70%);
  filter: blur(30px);
  z-index: -1;
  animation: fxPhoneGlow 5s ease-in-out infinite;
}
@keyframes fxPhoneGlow {
  0%,100% { opacity: .55; transform: scale(1); }
  50%     { opacity: .9;  transform: scale(1.06); }
}
.phone__bezel {
  transform: rotate(0deg);   /* JS handles tilt — kill the static -2deg */
  border: 1px solid rgba(255,255,255,.08);
}
.phone__head {
  background: linear-gradient(120deg, var(--fx-blue-d), var(--fx-blue));
}
/* Online status pulsing dot before "online" text */
.phone__heading span::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2ee37b;
  box-shadow: 0 0 8px rgba(46,227,123,.8);
  margin-right: 6px;
  animation: fxPulseDot 1.6s ease-in-out infinite;
  vertical-align: 1px;
}

/* ============================================================
   Chat bubbles — entrance pop + typing indicator
   ============================================================ */
.fx-chat .bubble {
  animation: fxBubbleIn .35s cubic-bezier(.2,.9,.25,1.2) backwards;
  transform-origin: bottom left;
}
.fx-chat .bubble--out { transform-origin: bottom right; }
@keyframes fxBubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fx-chat .typing {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 4px;
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex; gap: 5px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  animation: fxBubbleIn .25s ease backwards;
}
.fx-chat .typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fx-blue);
  opacity: .45;
  animation: fxTypingDot 1.1s ease-in-out infinite;
}
.fx-chat .typing i:nth-child(2) { animation-delay: .18s; }
.fx-chat .typing i:nth-child(3) { animation-delay: .36s; }
@keyframes fxTypingDot {
  0%,100% { transform: translateY(0); opacity: .35; }
  50%     { transform: translateY(-3px); opacity: 1; }
}

/* ============================================================
   Verticals — 3D tilt + spotlight + glassy hover lift
   ============================================================ */
.fx-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease;
  will-change: transform;
}
.fx-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px 200px at var(--mx, 50%) var(--my, 0%),
    rgba(25,118,210,.18),
    transparent 70%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  z-index: 0;
}
.fx-card > * { position: relative; z-index: 1; }
.fx-card:hover::before { opacity: 1; }
.fx-card:hover {
  border-color: var(--fx-blue-sky);
  box-shadow: var(--fx-glow-soft);
}
.fx-card .vcard__glyph {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease;
  transform: translateZ(20px);
}
.fx-card:hover .vcard__glyph {
  transform: translateZ(35px) scale(1.06) rotate(-3deg);
  box-shadow: 0 12px 28px -10px rgba(25,118,210,.45);
}
.fx-card .vcard__title  { transition: transform .35s ease; }
.fx-card:hover .vcard__title { transform: translateZ(14px); }
.fx-card .vcard__cta::after {
  /* arrow trail */
  display: none;
}

/* ============================================================
   Steps — animated horizontal wire + number glow
   ============================================================ */
.steps { position: relative; }
.steps__wire {
  position: absolute;
  left: 0; right: 0;
  top: 64px;
  width: 100%;
  height: 4px;
  pointer-events: none;
  z-index: 0;
}
.steps__wire line {
  stroke: var(--fx-blue);
  stroke-width: 2;
  stroke-dasharray: 4 8;
  stroke-linecap: round;
  opacity: .35;
  animation: fxWire 14s linear infinite;
}
@keyframes fxWire {
  to { stroke-dashoffset: -240; }
}
@media (max-width: 980px) { .steps__wire { display: none; } }

.fx-step { position: relative; z-index: 1; transition: background .25s ease; }
.fx-step:hover { background: color-mix(in oklab, var(--fx-blue) 5%, #fff); }
.fx-step .step__num {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600;
  color: var(--fx-blue);
}
.fx-step .step__num::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fx-blue);
  box-shadow: 0 0 0 4px rgba(25,118,210,.18), 0 0 14px rgba(25,118,210,.55);
  animation: fxPulseDot 2.4s ease-in-out infinite;
}

/* ============================================================
   Coverage (dark) — animated grid + radar ring on LIVE
   ============================================================ */
.section--dark { position: relative; overflow: hidden; }
.section--dark::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right,  rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 95%);
  pointer-events: none;
}
.section--dark::after {
  content: "";
  position: absolute;
  width: 800px; height: 800px;
  left: 50%; top: 50%;
  margin: -400px 0 0 -400px;
  background: radial-gradient(circle, rgba(25,118,210,.22) 0%, transparent 60%);
  filter: blur(30px);
  pointer-events: none;
  animation: fxRadar 10s ease-in-out infinite;
}
@keyframes fxRadar {
  0%,100% { transform: scale(1); opacity: .65; }
  50%     { transform: scale(1.1); opacity: 1; }
}
.section--dark .wrap { position: relative; z-index: 1; }

.fx-society { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.fx-society:hover {
  transform: translateY(-4px);
  border-color: var(--fx-blue);
  box-shadow: 0 18px 40px -16px rgba(25,118,210,.45);
}
.society--live { position: relative; }
.society--live::after {
  content: "";
  position: absolute;
  top: 14px; right: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fx-blue);
  box-shadow: 0 0 0 0 rgba(25,118,210,.7);
  animation: fxPing 1.8s ease-out infinite;
  z-index: 2;
}
@keyframes fxPing {
  0%   { box-shadow: 0 0 0 0   rgba(25,118,210,.6); }
  70%  { box-shadow: 0 0 0 18px rgba(25,118,210,0); }
  100% { box-shadow: 0 0 0 0   rgba(25,118,210,0); }
}

/* ============================================================
   FAQ — slide-in answers + animated icon
   ============================================================ */
.fx-faq summary {
  transition: padding-left .25s ease, color .2s ease;
}
.fx-faq summary:hover {
  padding-left: 8px;
  color: var(--fx-blue);
}
.fx-faq .faq__a {
  animation: fxFaqIn .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes fxFaqIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fx-faq[open] summary { color: var(--fx-blue); }

/* ============================================================
   CTA section — rotating conic gradient orb behind copy
   ============================================================ */
.section--cta { position: relative; overflow: hidden; isolation: isolate; }
.fx-cta-orb {
  position: absolute;
  width: 760px; height: 760px;
  left: 50%; top: 50%;
  margin: -380px 0 0 -380px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      rgba(25,118,210,0) 0deg,
      rgba(25,118,210,.45) 90deg,
      rgba(187,222,251,.55) 180deg,
      rgba(25,118,210,.45) 270deg,
      rgba(25,118,210,0) 360deg);
  filter: blur(40px);
  animation: fxSpin 22s linear infinite;
  z-index: 0;
}
.section--cta::before {
  /* re-stack so cta orb sits behind copy */
  z-index: -1;
}
.section--cta .wrap { position: relative; z-index: 2; }

/* CTA dotted halo around the button */
.section--cta .btn--xl {
  position: relative;
}
.section--cta .btn--xl::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 1px dashed rgba(25,118,210,.45);
  animation: fxSpin 18s linear infinite reverse;
  pointer-events: none;
}

/* ============================================================
   Footer — subtle starfield
   ============================================================ */
.footer {
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px   at 38% 64%, rgba(187,222,251,.45) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 18%, rgba(255,255,255,.3)  50%, transparent 51%),
    radial-gradient(1px 1px   at 88% 76%, rgba(187,222,251,.4)  50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 56% 88%, rgba(255,255,255,.3)  50%, transparent 51%);
  pointer-events: none;
  opacity: .8;
  animation: fxTwinkle 5s ease-in-out infinite;
}
@keyframes fxTwinkle {
  0%,100% { opacity: .7; }
  50%     { opacity: 1; }
}
.footer__wrap, .footer__base { position: relative; z-index: 1; }

/* Nav link underline animation */
.nav__links a {
  position: relative;
  padding-bottom: 2px;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--fx-blue);
  border-radius: 2px;
  transition: right .25s cubic-bezier(.2,.7,.2,1);
}
.nav__links a:hover::after { right: 0; }

/* Brand mark — micro hover bounce */
.nav__brand:hover .brand-mark {
  transform: scale(1.06) rotate(-4deg);
  transition: transform .35s cubic-bezier(.2,.9,.25,1.2);
}
.nav__brand .brand-mark {
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}

/* ============================================================
   Reduced motion — disable all keyframe animation
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .fx-stagger > * { opacity: 1; transform: none; }
}
