/* ═══════════════════════════════════════════════════════════════════════
   HERO PARTICLES + 3D TILT — Interactive particle network + perspective
   All classes prefixed with .zp- to avoid collisions
   z-index: sits behind hero content (z-index: 0, same layer as hero-bg)

   IMPORTANT: perspective/preserve-3d are applied ONLY via JS on
   mouseenter and removed on mouseleave to avoid breaking fixed
   positioning and stacking contexts permanently.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Particle Canvas ── */
.zp-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── 3D Tilt Container ──
   perspective is set via JS only during hover to avoid permanent
   stacking context issues with fixed-position navbar/modals.
   DO NOT add perspective or transform-style here in CSS. */
.zp-tilt-wrap {
  /* No perspective/transform-style here — JS sets on mouseenter */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The actual tilting element — transition only, no persistent transforms */
.zp-tilt {
  transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

/* Depth layers — ONLY active when parent has .zp-tilt--active (set by JS on hover) */
.zp-tilt--active [data-depth="1"] {
  transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99);
  transform: translateZ(15px);
}
.zp-tilt--active [data-depth="2"] {
  transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99);
  transform: translateZ(30px);
}
.zp-tilt--active [data-depth="3"] {
  transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99);
  transform: translateZ(45px);
}

/* Reset depth when tilt is not active */
.zp-tilt:not(.zp-tilt--active) [data-depth="1"],
.zp-tilt:not(.zp-tilt--active) [data-depth="2"],
.zp-tilt:not(.zp-tilt--active) [data-depth="3"] {
  transform: translateZ(0);
}

/* ── Glow Cursor Follow ── */
.zp-cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.06) 0%,
    rgba(245, 158, 11, 0.02) 30%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.zp-cursor-glow.zp-cursor-glow--visible {
  opacity: 1;
}

/* ── Particle interaction ripple (on click) ── */
.zp-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.3);
  pointer-events: none;
  z-index: 1;
  animation: zp-rippleOut 1s ease-out forwards;
}

@keyframes zp-rippleOut {
  0%   { width: 0; height: 0; opacity: 0.8; transform: translate(-50%, -50%); }
  100% { width: 200px; height: 200px; opacity: 0; transform: translate(-50%, -50%); }
}

/* Shine overlay on tilt */
.zp-tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.0) 0%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(255, 255, 255, 0.0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zp-tilt:hover .zp-tilt-shine {
  opacity: 1;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .zp-tilt {
    transform: none !important;
    transition: none !important;
  }

  .zp-tilt--active [data-depth="1"],
  .zp-tilt--active [data-depth="2"],
  .zp-tilt--active [data-depth="3"] {
    transform: none !important;
    transition: none !important;
  }

  .zp-cursor-glow,
  .zp-ripple {
    display: none !important;
  }

  .zp-particle-canvas {
    opacity: 0.3;
  }
}

/* ── Mobile: disable tilt, keep particles light ── */
@media (max-width: 768px) {
  .zp-tilt {
    transform: none !important;
  }

  .zp-cursor-glow {
    display: none;
  }

  .zp-particle-canvas {
    opacity: 0.5;
  }
}
