/* 3D shapes, scroll reveals, parallax — ClickifyTech (light theme) */

.site-scene-3d,
.scene-3d {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 1200px;
  z-index: 0;
}

.shape-3d {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  will-change: transform;
  animation: float3d 10s ease-in-out infinite;
}

.shape-3d--1 {
  width: 320px;
  height: 320px;
  top: 8%;
  right: 6%;
  background: linear-gradient(135deg, rgba(10, 166, 212, 0.35), rgba(109, 78, 240, 0.28));
  box-shadow: 0 30px 80px rgba(109, 78, 240, 0.18);
  transform: rotateX(25deg) rotateY(-20deg);
}

.shape-3d--2 {
  width: 200px;
  height: 200px;
  bottom: 18%;
  left: 4%;
  background: linear-gradient(225deg, rgba(217, 70, 239, 0.32), rgba(10, 166, 212, 0.22));
  box-shadow: 0 24px 60px rgba(217, 70, 239, 0.15);
  animation-delay: -2s;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.shape-3d--3 {
  width: 130px;
  height: 130px;
  top: 42%;
  left: 38%;
  border: 3px solid rgba(10, 166, 212, 0.35);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  animation-delay: -4s;
  border-radius: 24px;
  transform: rotate(45deg);
}

.shape-3d--ring {
  width: 220px;
  height: 220px;
  bottom: 10%;
  right: 22%;
  border: 4px solid rgba(109, 78, 240, 0.35);
  background: transparent;
  border-radius: 50%;
  animation: spin3d 22s linear infinite;
}

.shape-3d--torus {
  width: 150px;
  height: 150px;
  top: 18%;
  left: 12%;
  border-radius: 50%;
  box-shadow:
    inset 0 0 30px rgba(10, 166, 212, 0.35),
    0 0 50px rgba(109, 78, 240, 0.2),
    0 20px 40px rgba(23, 30, 65, 0.08);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(10, 166, 212, 0.2) 60%, transparent);
  animation-delay: -1s;
}

@keyframes float3d {
  0%, 100% { transform: translateY(0) rotateX(15deg) rotateY(-10deg); }
  50% { transform: translateY(-28px) rotateX(22deg) rotateY(12deg); }
}

@keyframes spin3d {
  from { transform: rotateZ(0deg) rotateX(60deg); }
  to { transform: rotateZ(360deg) rotateX(60deg); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* 3D tilt cards */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}

.tilt-card:hover {
  box-shadow: 0 24px 60px rgba(109, 78, 240, 0.2);
}

.tilt-card-inner {
  transform: translateZ(20px);
}

/* Glass panels */
.glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

/* Hero mesh background */
.hero-mesh {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #f0f9ff 0%, #faf5ff 40%, #fdf4ff 70%, #f8fafc 100%);
}

.hero-mesh::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(10, 166, 212, 0.14), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(109, 78, 240, 0.12), transparent),
    radial-gradient(ellipse 50% 30% at 70% 80%, rgba(217, 70, 239, 0.1), transparent);
  pointer-events: none;
  z-index: 0;
}

.hero-mesh > .container {
  position: relative;
  z-index: 1;
}

/* Parallax layers */
[data-parallax] {
  will-change: transform;
}

/* Service hero 3D frame */
.service-hero-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: 0 24px 80px rgba(109, 78, 240, 0.22);
}

.service-hero-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 166, 212, 0.12), rgba(109, 78, 240, 0.08));
  pointer-events: none;
}

.service-hero-frame img {
  transform: scale(1.02);
  transition: transform 0.6s ease;
}

.service-hero-frame:hover img {
  transform: scale(1.06);
}

/* Animated 3D perspective grid on page heroes */
.page-hero::after,
.hp-hero::after {
  content: '';
  position: absolute;
  bottom: -2rem;
  left: 50%;
  width: 180%;
  height: 45%;
  transform: translateX(-50%) rotateX(74deg);
  transform-origin: center top;
  background-image:
    linear-gradient(rgba(109, 78, 240, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 166, 212, 0.1) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  mask-image: linear-gradient(to top, #000 0%, transparent 85%);
}

.grid-floor {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 200%;
  height: 40%;
  transform: translateX(-50%) rotateX(72deg);
  transform-origin: center top;
  background-image:
    linear-gradient(rgba(109, 78, 240, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 166, 212, 0.1) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* Marquee strip */
.marquee-wrap {
  overflow: hidden;
  padding: 1rem 0;
  border-block: 1px solid var(--color-border);
  background: var(--color-surface);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee 28s linear infinite;
  width: max-content;
}

.marquee-track span {
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.marquee-track span strong {
  background: linear-gradient(90deg, #0aa6d4, #6d4ef0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Cursor glow on hero (desktop) */
.hero-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 78, 240, 0.14), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.hero-mesh:hover .hero-glow {
  opacity: 1;
}

/* Specular shine on JS-tilted cards */
.t3d-tilt::before,
.hp-tilt-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0) 42%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.t3d-tilt.is-tilting::before,
.hp-tilt-3d.is-tilting::before {
  opacity: 1;
}

@media (max-width: 959px) {
  .site-scene-3d .shape-3d--3,
  .site-scene-3d .shape-3d--torus {
    display: none;
  }

  .site-scene-3d .shape-3d--1 {
    width: 200px;
    height: 200px;
    opacity: 0.5;
  }

  .site-scene-3d .shape-3d--2 {
    width: 140px;
    height: 140px;
    opacity: 0.45;
  }

  .page-hero::after,
  .hp-hero::after {
    opacity: 0.35;
    height: 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shape-3d,
  .marquee-track,
  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
