/* ============================================================
   scroll-3d.css — Viral 3D Scroll Experience
   Lightweight: zero external dependencies
   ============================================================ */

/* 1. Hero Canvas */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

/* 2. CSS 3D Floating Cube */
.hero-3d-shape {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
  height: 240px;
  perspective: 700px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
  filter: drop-shadow(0 0 18px rgba(99,102,241,0.35));
}

@media (max-width: 900px) {
  .hero-3d-shape { display: none; }
}

.shape-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: cube-spin 18s linear infinite;
}

.shape-cube .face {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1.5px solid rgba(99,102,241,0.75);
  background: rgba(99,102,241,0.03);
  box-shadow: inset 0 0 40px rgba(99,102,241,0.2), 0 0 30px rgba(99,102,241,0.15);
}

.shape-cube .face::before {
  content: '';
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(168,85,247,0.35);
}

.face.front  { transform: translateZ(110px); }
.face.back   { transform: rotateY(180deg) translateZ(110px); }
.face.left   { transform: rotateY(-90deg) translateZ(110px); }
.face.right  { transform: rotateY(90deg)  translateZ(110px); }
.face.top    { transform: rotateX(90deg)  translateZ(110px); }
.face.bottom { transform: rotateX(-90deg) translateZ(110px); }

.shape-cube .ring {
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(6,182,212,0.4);
  border-radius: 50%;
  animation: ring-spin 6s linear infinite reverse;
}

@keyframes cube-spin {
  0%   { transform: rotateX(15deg) rotateY(0deg); }
  100% { transform: rotateX(15deg) rotateY(360deg); }
}

@keyframes ring-spin {
  from { transform: rotateZ(0deg) rotateX(70deg); }
  to   { transform: rotateZ(360deg) rotateX(70deg); }
}

/* 3. Scroll Reveal - SAFETY: hidden only when JS is confirmed running */
body.js-ready .reveal-3d {
  opacity: 0;
  transform: perspective(900px) translateY(50px) rotateX(10deg);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}

body.js-ready .reveal-3d.is-visible {
  opacity: 1;
  transform: perspective(900px) translateY(0) rotateX(0deg);
}

body.js-ready .reveal-3d:nth-child(1) { transition-delay: 0.05s; }
body.js-ready .reveal-3d:nth-child(2) { transition-delay: 0.15s; }
body.js-ready .reveal-3d:nth-child(3) { transition-delay: 0.25s; }
body.js-ready .reveal-3d:nth-child(4) { transition-delay: 0.35s; }

body.js-ready .reveal-left {
  opacity: 0;
  transform: perspective(900px) translateX(-60px) rotateY(12deg);
  transition: opacity 0.75s cubic-bezier(0.22,1,0.36,1),
              transform 0.75s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}
body.js-ready .reveal-left.is-visible {
  opacity: 1;
  transform: perspective(900px) translateX(0) rotateY(0deg);
}

body.js-ready .reveal-right {
  opacity: 0;
  transform: perspective(900px) translateX(60px) rotateY(-12deg);
  transition: opacity 0.75s cubic-bezier(0.22,1,0.36,1),
              transform 0.75s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}
body.js-ready .reveal-right.is-visible {
  opacity: 1;
  transform: perspective(900px) translateX(0) rotateY(0deg);
}

/* 4. Card 3D Tilt */
.card:hover {
  transform: none !important;
}
.card {
  transform-style: preserve-3d;
  transition: transform 0.12s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: background 0.1s;
  z-index: 2;
  mix-blend-mode: screen;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* 5. Hero parallax layers */
.hero-orb-3 {
  will-change: transform;
  transition: transform 0.05s linear;
}

/* 6. Scroll progress bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-teal));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* 7. Hero system cells hover */
.hero-system-cell {
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s ease !important;
}
.hero-system-cell:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(99,102,241,0.2);
}


/* 9. Proof cells */
.proof-cell {
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
}
.proof-cell:hover {
  transform: translateY(-3px) scale(1.04);
}
