/* ==========================================================================
   Premium 3D effects layer (pairs with fx-3d.js)
   Everything here is scoped to classes that fx-3d.js adds, so the pages look
   normal if the script does not run.
   ========================================================================== */

/* ---------- 3D word-by-word heading reveal ---------- */
.fx-heading { perspective: 800px; }

.fx-word {
  display: inline-block;
  transform-origin: 50% 100%;
  backface-visibility: hidden;
}

.fx-heading:not(.fx-in) .fx-word { opacity: 0; }

.fx-heading.fx-in .fx-word {
  animation: fxWordIn .85s cubic-bezier(.2, .75, .2, 1) both;
  animation-delay: calc(var(--fx-i) * 70ms);
}

@keyframes fxWordIn {
  from { opacity: 0; transform: translate3d(0, .55em, -140px) rotateX(-85deg); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Pointer tilt + glare ---------- */
.fx-tilt.fx-tilting {
  transform: perspective(1000px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) translateY(-6px) scale(1.015) !important;
  transition: transform .12s ease-out, box-shadow .25s ease !important;
  box-shadow: 0 26px 50px -18px rgba(15, 23, 42, .28), 0 0 0 1px rgba(14, 165, 164, .28) !important;
  transform-style: preserve-3d;
  z-index: 3;
}

.fx-tilt.fx-leaving { transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease !important; }

.fx-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--fx-gx, 50%) var(--fx-gy, 50%),
    rgba(45, 212, 191, .18), rgba(255, 255, 255, .08) 35%, transparent 62%);
}

.fx-tilting > .fx-glare { opacity: 1; }

/* Lift key content off the card face while tilting */
.fx-tilt > * { transition: translate .3s ease; }
.fx-tilting .card-top,
.fx-tilting .card-action,
.fx-tilting .doc-profile-top,
.fx-tilting .stat-num,
.fx-tilting .case-proof-box { translate: 0 0 32px; }
.fx-tilting .card-content,
.fx-tilting .case-narrative-col { translate: 0 0 16px; }

/* ---------- 3D parallax for the hero story text ---------- */
.fx-parallax { transform-style: preserve-3d; }

/* ---------- Service cards driven by scroll ---------- */
.fx-rail { will-change: transform, opacity; backface-visibility: hidden; }
