/* ============================================================
   VNGG TECHNOLOGY — Subtle motion effects (effects.css)
   Namespace: .fx-*  (safe, no collision with site.css / inline)
   B2B feel: tinh tế, KHÔNG chói, KHÔNG "AI look".
   Loaded after site.css. Every animation has a reduced-motion branch.
   ============================================================ */

/* ---- Brand tokens (local) ----
   navy #1E3A6B · deep navy #0F2547 · gold #F5B91F · amber #D89E0E */

/* ============================================================
   1. FLOAT — gentle hover for hero dashboard mockup
   ============================================================ */
@keyframes fxFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.fx-float {
  animation: fxFloat 6s ease-in-out infinite;
  will-change: transform;
}
/* When the float host already has a 3D tilt (hero mockup), preserve the tilt
   inside the keyframe so the animation does not flatten it. */
@keyframes fxFloatTilt {
  0%, 100% { transform: perspective(1000px) rotateY(-3deg) rotateX(2deg) translateY(0); }
  50%      { transform: perspective(1000px) rotateY(-3deg) rotateX(2deg) translateY(-10px); }
}
.dashboard-mockup.fx-float {
  animation-name: fxFloatTilt;
}

/* ============================================================
   2. BORDER BEAM — thin gold light sweeping the border
   Host element must be position:relative; overflow:hidden.
   ============================================================ */
/* Animatable angle for the conic gradient (modern browsers). */
@property --fx-beam-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes fxBeamSpin {
  to { --fx-beam-angle: 360deg; }
}
.fx-border-beam { position: relative; }
/* Ring layer: a conic gradient whose start-angle animates, masked to a thin
   1.5px frame that follows the border-radius. No transform on the mask, so
   rounded corners never expose square edges. */
.fx-border-beam::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;                 /* beam thickness (ring width) */
  pointer-events: none;
  background: conic-gradient(
    from var(--fx-beam-angle),
    transparent 0deg,
    transparent 290deg,
    rgba(245, 185, 31, 0.5) 350deg,
    rgba(245, 185, 31, 0.0) 360deg
  );
  /* Mask: keep only the ring (padding-box minus content-box). */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: fxBeamSpin 6s linear infinite;
}
/* Keep host content above the beam */
.fx-border-beam > * { position: relative; z-index: 1; }

/* ============================================================
   3. SPOTLIGHT — soft radial glow tracking cursor (pointer:fine)
   JS sets --mx / --my (%). Default centered.
   ============================================================ */
.fx-spotlight { --mx: 50%; --my: 50%; position: relative; }
.fx-spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    420px circle at var(--mx) var(--my),
    rgba(245, 185, 31, 0.10),
    transparent 60%
  );
}
@media (pointer: fine) {
  .fx-spotlight:hover::before { opacity: 1; }
}
.fx-spotlight > * { position: relative; z-index: 1; }

/* ============================================================
   4. TEXT REVEAL — gentle blur-in of the whole heading.
   Whole-element (not per-word) so gradient text / <br> / nowrap
   stay intact and layout never shifts. JS only toggles .is-shown.
   ============================================================ */
.fx-text-reveal {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(0.3em);
  transition: opacity 0.7s ease, filter 0.7s ease, transform 0.7s ease;
  will-change: opacity, filter, transform;
}
.fx-text-reveal.is-shown {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* ============================================================
   5. STAGGER REVEAL helper — extends existing .reveal
   JS sets --reveal-delay; we just apply it as transition-delay.
   Does NOT redefine .reveal base (lives in site.css / inline).
   ============================================================ */
.reveal {
  transition-delay: var(--reveal-delay, 0ms);
}

/* ============================================================
   6. AURORA — very soft moving gradient for dark navy sections
   ============================================================ */
@keyframes fxAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4%, -3%, 0) scale(1.08); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
.fx-aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  overflow: hidden;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(245, 185, 31, 0.18), transparent 70%),
    radial-gradient(45% 55% at 80% 25%, rgba(61, 109, 168, 0.30), transparent 70%),
    radial-gradient(50% 60% at 60% 90%, rgba(245, 185, 31, 0.10), transparent 70%);
  filter: blur(50px);
  animation: fxAurora 18s ease-in-out infinite;
  will-change: transform;
}

/* ============================================================
   7. GRID DARK — drifting dotted grid for navy stat sections
   ============================================================ */
@keyframes fxGridDrift {
  from { background-position: 0 0; }
  to   { background-position: 36px 36px; }
}
.fx-grid-dark {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image: radial-gradient(circle at 1px 1px, rgba(245, 185, 31, 0.06) 1px, transparent 0);
  background-size: 36px 36px;
  animation: fxGridDrift 20s linear infinite;
}

/* ============================================================
   8. IMG ZOOM — subtle scale of thumbnail on .group hover
   Wrapper must be overflow:hidden.
   ============================================================ */
.fx-img-zoom {
  overflow: hidden;
  transition: transform 0.5s ease;
  transform: scale(1);
  will-change: transform;
}
.group:hover .fx-img-zoom {
  transform: scale(1.06);
}

/* ============================================================
   REDUCED MOTION — disable all fx animations / transforms
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .fx-float,
  .fx-aurora,
  .fx-grid-dark { animation: none !important; transform: none !important; }

  .fx-border-beam::after { animation: none !important; display: none !important; }

  .fx-spotlight::before { display: none !important; }

  .fx-text-reveal {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }

  .fx-img-zoom,
  .group:hover .fx-img-zoom {
    transform: none !important;
    transition: none !important;
  }
}
