/* ============================================================
   Quickzii — 3D Enhancement Layer v2
   ============================================================ */

/* ── Base tilt wrapper ─────────────────────────────────────── */
.qz-3d-tilt {
  transform-style: preserve-3d;
  will-change: transform;
  height: 100%;
  cursor: default;
}
.qz-3d-tilt > * { height: 100%; }

/* ── Cursor spotlight ─────────────────────────────────────── */
.qz-cursor-spot {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122,64,240,0.07) 0%, rgba(157,107,255,0.03) 40%, transparent 70%);
  top: 0;
  left: 0;
  will-change: transform;
  mix-blend-mode: screen;
}

/* ── Hero 3D perspective grid background ───────────────────── */
.qz-3d-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.qz-3d-grid-bg::before {
  content: '';
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -20%;
  height: 80%;
  background-image:
    linear-gradient(rgba(122,64,240,0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122,64,240,0.13) 1px, transparent 1px);
  background-size: 52px 52px;
  transform: perspective(500px) rotateX(58deg);
  transform-origin: bottom center;
  animation: qz-grid-scroll 14s linear infinite;
}
.qz-3d-grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(245,241,254,0.7) 60%, rgba(245,241,254,1) 100%);
}
@keyframes qz-grid-scroll {
  from { background-position: 0 0; }
  to   { background-position: 0 104px; }
}

/* ── Dark section grid (stats / process) ─────────────────── */
.qz-3d-grid-dark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.qz-3d-grid-dark::before {
  content: '';
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -10%;
  height: 60%;
  background-image:
    linear-gradient(rgba(157,107,255,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157,107,255,0.09) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(55deg);
  transform-origin: bottom center;
  animation: qz-grid-scroll 20s linear infinite;
}
.qz-3d-grid-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(14,7,38,0.9) 0%, transparent 50%, rgba(14,7,38,0.9) 100%);
}

/* ── Floating orbs ─────────────────────────────────────────── */
.qz-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: qz-orb-float 8s ease-in-out infinite;
}
.qz-orb--a { animation-duration: 7s; }
.qz-orb--b { animation-duration: 11s; animation-delay: -3.5s; }
.qz-orb--c { animation-duration: 9.5s; animation-delay: -6s; }
@keyframes qz-orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  33%       { transform: translateY(-24px) scale(1.04); }
  66%       { transform: translateY(16px) scale(0.97); }
}

/* ── Particle dots ─────────────────────────────────────────── */
.qz-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

/* ── Flip card ─────────────────────────────────────────────── */
.qz-flip-card {
  perspective: 1100px;
  height: 100%;
  min-height: 240px;
  cursor: pointer;
}
.qz-flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.qz-flip-card:hover .qz-flip-card__inner {
  transform: rotateY(180deg);
}
.qz-flip-card__front,
.qz-flip-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.qz-flip-card__back {
  transform: rotateY(180deg);
}
/* Hint arrow on front */
.qz-flip-hint {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--violet-50);
  border: 1px solid var(--violet-200);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.qz-flip-card:hover .qz-flip-hint { opacity: 0; }

/* ── Animated gradient border on service cards ─────────────── */
@property --qz-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.qz-anim-border {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius-lg);
}
.qz-anim-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: conic-gradient(from var(--qz-border-angle), #7A40F0 0%, #C0A4FA 30%, #E8D5FF 50%, #C0A4FA 70%, #7A40F0 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
  animation: qz-border-spin 3.5s linear infinite;
}
.qz-anim-border:hover::before { opacity: 1; }

@keyframes qz-border-spin {
  to { --qz-border-angle: 360deg; }
}

/* ── Glow pulse on hover ───────────────────────────────────── */
@keyframes qz-glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(122,64,240,0.18), 0 8px 32px rgba(0,0,0,0.07); }
  50%       { box-shadow: 0 0 55px rgba(122,64,240,0.42), 0 16px 54px rgba(0,0,0,0.12); }
}
.qz-glow-card {
  transition: box-shadow 0.4s;
}
.qz-glow-card:hover {
  animation: qz-glow-pulse 1.5s ease-in-out infinite;
}

/* ── 3D floating card auto-animation ──────────────────────── */
@keyframes qz-card-float {
  0%, 100% { transform: perspective(900px) rotateX(0deg) rotateY(0deg) translateZ(0); }
  25%       { transform: perspective(900px) rotateX(2.5deg) rotateY(-2.5deg) translateZ(14px); }
  50%       { transform: perspective(900px) rotateX(-1.5deg) rotateY(3deg) translateZ(7px); }
  75%       { transform: perspective(900px) rotateX(1.5deg) rotateY(-1.5deg) translateZ(11px); }
}
.qz-card-float {
  animation: qz-card-float 9s ease-in-out infinite;
  transform-style: preserve-3d;
}

/* ── Pulse ring around icons ───────────────────────────────── */
@keyframes qz-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.75; }
  100% { transform: scale(2.2); opacity: 0; }
}
.qz-pulse-wrap {
  position: relative;
  display: inline-flex;
}
.qz-pulse-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(157,107,255,0.55);
  animation: qz-pulse-ring 2.6s ease-out var(--pulse-delay, 0s) infinite;
}

/* ── 3D why-item card ──────────────────────────────────────── */
.qz-why-3d {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
  height: 100%;
  box-sizing: border-box;
}
.qz-why-3d::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
}
.qz-3d-tilt:hover .qz-why-3d::before { transform: scaleX(1); }
.qz-3d-tilt:hover .qz-why-3d {
  border-color: var(--violet-200);
  box-shadow: 0 8px 32px rgba(122,64,240,0.14);
}

/* ── 3D process step sphere ────────────────────────────────── */
.qz-step-sphere {
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.45s;
}
.qz-step-sphere:hover {
  transform: perspective(400px) rotateY(-14deg) rotateX(10deg) translateZ(18px) scale(1.1);
  box-shadow: 10px -10px 36px rgba(122,64,240,0.42), 0 22px 44px rgba(0,0,0,0.16);
}

/* ── Magnetic button wrapper ───────────────────────────────── */
.qz-magnetic {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.23,1,0.32,1);
}

/* ── Depth shadow ──────────────────────────────────────────── */
.qz-depth {
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 16px rgba(122,64,240,0.08),
    0 20px 48px rgba(0,0,0,0.07);
  transition: box-shadow 0.35s, transform 0.35s;
}
.qz-depth:hover {
  box-shadow:
    0 6px 20px rgba(122,64,240,0.22),
    0 32px 72px rgba(0,0,0,0.13);
}

/* ── 3D hero card ──────────────────────────────────────────── */
.qz-hero-netcard { transform-style: preserve-3d; }

/* ── Industry glass ─────────────────────────────────────────── */
.qz-ind-glass {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ── 3D button press ────────────────────────────────────────── */
.qz-btn:active {
  transform: translateY(2px) scale(0.97) !important;
}

/* ── Section depth gradient ─────────────────────────────────── */
.qz-3d-section-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(122,64,240,0.06) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Stat orb ───────────────────────────────────────────────── */
.qz-stat-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.5;
}

/* ── Text 3D depth shadow ───────────────────────────────────── */
.qz-text-3d {
  text-shadow:
    1px 1px 0 rgba(122,64,240,0.12),
    3px 3px 0 rgba(122,64,240,0.08),
    5px 5px 0 rgba(122,64,240,0.04);
}

/* ── Shine overlay on tilt ──────────────────────────────────── */
.qz-3d-shine {
  position: relative;
  overflow: hidden;
}
.qz-3d-shine::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 55%, rgba(255,255,255,0.05) 100%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
  z-index: 10;
}
.qz-3d-tilt:hover .qz-3d-shine::after { opacity: 1; }

/* ── Geo floating shapes ────────────────────────────────────── */
@keyframes qz-geo-spin {
  from { transform: perspective(300px) rotateY(0deg) rotateX(15deg); }
  to   { transform: perspective(300px) rotateY(360deg) rotateX(15deg); }
}
.qz-geo {
  position: absolute;
  pointer-events: none;
  border-radius: 14px;
  opacity: 0.1;
  animation: qz-geo-spin 28s linear infinite;
}
.qz-geo--b { animation-direction: reverse; animation-duration: 38s; }

/* ── Motion preference ──────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .qz-3d-tilt {
    transition: transform 0.08s linear, box-shadow 0.08s linear;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qz-3d-tilt,
  .qz-card-float,
  .qz-orb,
  .qz-geo,
  .qz-3d-grid-bg::before,
  .qz-3d-grid-dark::before,
  .qz-step-sphere,
  .qz-pulse-wrap::after { animation: none !important; transition: none !important; }
}
