/* ==========================================================================
   DIZIGOO GYM — ANIMATIONS & 3D INTERACTION LAYER
   --------------------------------------------------------------------------
   Everything here is progressive: if JavaScript never runs, elements stay in
   their final visible state (see the `.no-js` and "no IntersectionObserver"
   fallbacks at the bottom). Nothing is hidden from crawlers.
   ========================================================================== */

/* ==========================================================================
   01. SCROLL REVEAL
   The `.reveal` class is only *armed* once JS confirms IntersectionObserver
   support (html.js-reveal). Without it, content renders normally.
   ========================================================================== */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  will-change: opacity, transform;
}
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* Directional variants */
.js-reveal .reveal--left  { transform: translateX(-32px); }
.js-reveal .reveal--right { transform: translateX(32px); }
.js-reveal .reveal--scale { transform: scale(.955); }
.js-reveal .reveal--blur  { filter: blur(9px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), filter .8s var(--ease-out); }
.js-reveal .reveal--left.is-visible,
.js-reveal .reveal--right.is-visible,
.js-reveal .reveal--scale.is-visible { transform: none; }
.js-reveal .reveal--blur.is-visible  { filter: none; }

/* Stagger — set inline via style="--d:3" or with data-stagger on a parent */
.js-reveal .reveal { transition-delay: calc(var(--d, 0) * 85ms); }

/* ==========================================================================
   02. HEADLINE LINE REVEAL
   Each line is wrapped by JS in .line > .line__inner and masked upward.
   ========================================================================== */
.line { display: block; overflow: hidden; }
.js-reveal .line__inner {
  display: block;
  transform: translateY(105%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 105ms);
}
.js-reveal .is-visible .line__inner,
.js-reveal .line__inner.is-visible { transform: none; }

/* ==========================================================================
   03. HERO ENTRANCE
   Runs on load, independent of scroll. Kept short so the page feels instant.
   ========================================================================== */
.hero__badge,
.hero__title,
.hero__sub,
.hero__actions,
.hero__stats { animation: heroIn .95s var(--ease-out) backwards; }
.hero__badge   { animation-delay: .10s; }
.hero__title   { animation-delay: .18s; }
.hero__sub     { animation-delay: .30s; }
.hero__actions { animation-delay: .40s; }
.hero__stats   { animation-delay: .52s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* Slow cinematic push-in on the hero photography */
.hero__mid img { animation: heroPush 16s var(--ease-out) forwards; }
@keyframes heroPush {
  from { transform: scale(1.11); }
  to   { transform: scale(1.02); }
}

/* ==========================================================================
   04. 3D PARALLAX (mouse)
   JS writes --mx / --my in the range -1 … 1 on .hero.
   Depth is expressed per-layer so the scene reads as real space.
   ========================================================================== */
.hero {
  --mx: 0;
  --my: 0;
}
.hero__bg,
.hero__mid,
.hero__content,
.hero__light {
  transition: transform .9s var(--ease-out);
  will-change: transform;
}
.hero.has-pointer .hero__bg      { transform: translate3d(calc(var(--mx) * 12px),  calc(var(--my) * 9px),  0) scale(1.06); }
.hero.has-pointer .hero__mid     { transform: translate3d(calc(var(--mx) * -22px), calc(var(--my) * -14px), 0); }
.hero.has-pointer .hero__light   { transform: translate3d(calc(var(--mx) * 36px),  calc(var(--my) * 26px), 0); }
.hero.has-pointer .hero__content {
  transform: translate3d(calc(var(--mx) * -9px), calc(var(--my) * -6px), 0)
             rotateY(calc(var(--mx) * 1.6deg))
             rotateX(calc(var(--my) * -1.1deg));
}

/* Scroll-driven depth: JS sets --scrolled (0 → 1) across the hero's height */
.hero { --scrolled: 0; }
.hero__content { opacity: calc(1 - var(--scrolled) * .85); }
.hero__mid img { will-change: transform; }

/* ==========================================================================
   05. CARD PERSPECTIVE TILT
   JS sets --rx / --ry on [data-tilt]. Small angles only — this should read as
   depth, not as a gimmick.
   ========================================================================== */
[data-tilt] {
  --rx: 0deg;
  --ry: 0deg;
  transform-style: preserve-3d;
  transition: transform var(--t-med) var(--ease);
}
[data-tilt].is-tilting {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-8px);
  transition: transform .12s linear;
}

/* Gold sheen that follows the cursor across a tilted card */
[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    38% 38% at var(--gx, 50%) var(--gy, 50%),
    rgba(245, 215, 122, .17),
    transparent 72%
  );
  transition: opacity var(--t-med) var(--ease);
}
[data-tilt].is-tilting::after { opacity: 1; }

/* ==========================================================================
   06. COUNTERS
   ========================================================================== */
.counting { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   07. MARQUEE / TICKER duplication
   The track is duplicated in the DOM; aria-hidden on the clone.
   ========================================================================== */
.trust__track > [aria-hidden="true"] { pointer-events: none; }

/* ==========================================================================
   08. CUSTOM CURSOR (pointer devices only, never on touch)
   ========================================================================== */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s var(--ease), width .3s var(--ease), height .3s var(--ease),
              background-color .3s var(--ease), border-color .3s var(--ease);
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--gold-light);
}
.cursor-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(212, 175, 55, .55);
}
.has-cursor .cursor-dot,
.has-cursor .cursor-ring { opacity: 1; }

.has-cursor .cursor-ring.is-hover {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-color: var(--gold);
  background: rgba(212, 175, 55, .08);
}
.has-cursor .cursor-dot.is-hover { opacity: 0; }

/* ==========================================================================
   09. PAGE TRANSITION — short by design (≤ 420ms)
   ========================================================================== */
.page-fade {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--black);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .32s var(--ease), visibility .32s;
}
.page-fade.is-active { opacity: 1; visibility: visible; }

/* ==========================================================================
   10. MISC MICROINTERACTIONS
   ========================================================================== */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.float-slow { animation: floatY 6s var(--ease) infinite; }

@keyframes shimmer {
  0%   { background-position: -180% 0; }
  100% { background-position: 180% 0; }
}
.shimmer {
  background: linear-gradient(90deg, transparent 8%, rgba(245, 215, 122, .16) 50%, transparent 92%);
  background-size: 180% 100%;
  animation: shimmer 3.2s linear infinite;
}

/* Section entrance for full-width bands */
.js-reveal .band-reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.05s var(--ease-out);
}
.js-reveal .band-reveal.is-visible { clip-path: inset(0 0 0 0); }

/* ==========================================================================
   11. REDUCED MOTION
   Users who ask for less motion get a fully static, fully visible site.
   This block deliberately sits last so it wins the cascade.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .js-reveal .reveal,
  .js-reveal .reveal--left,
  .js-reveal .reveal--right,
  .js-reveal .reveal--scale,
  .js-reveal .reveal--blur {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .js-reveal .line__inner { transform: none !important; }
  .js-reveal .band-reveal { clip-path: none !important; }

  /* No pointer-driven 3D, no drifting light, no auto-scrolling ticker */
  .hero.has-pointer .hero__bg,
  .hero.has-pointer .hero__mid,
  .hero.has-pointer .hero__light,
  .hero.has-pointer .hero__content { transform: none !important; }
  .hero__content { opacity: 1 !important; }
  [data-tilt].is-tilting { transform: none !important; }
  [data-tilt]::after { display: none; }

  .trust__track { animation: none !important; transform: none !important; flex-wrap: wrap; justify-content: center; width: 100%; }
  .trust__track > [aria-hidden="true"] { display: none; }

  .cursor-dot, .cursor-ring { display: none !important; }
  .float-slow, .shimmer { animation: none !important; }
  .scroll-cue__line::after { animation: none !important; }
  .hero__badge .dot { animation: none !important; }
  .float-wa::before { animation: none !important; }
  .preloader { display: none !important; }
}

/* ==========================================================================
   12. NO-JS FALLBACK
   Without JS the html element never gets `.js-reveal`, so every `.reveal`
   stays at full opacity. This block covers the remaining JS-dependent bits.
   ========================================================================== */
.no-js .preloader { display: none; }
.no-js .hero__mid img { animation: none; transform: none; }
.no-js .cursor-dot,
.no-js .cursor-ring,
.no-js .to-top,
.no-js .sticky-cta { display: none; }
.no-js .faq__a { grid-template-rows: 1fr; }
.no-js .faq__icon { display: none; }
.no-js .program__body p { max-height: none; opacity: 1; }
.no-js .program__more { opacity: 1; transform: none; }
