/* ==========================================================================
   POWER SILICON TECHNOLOGIES — 3D SOFT ANIMATIONS & KEYFRAMES
   ========================================================================== */

/* --------------------------------------------------------------------------
   3D FLOATING & GYROSCOPIC MOTIONS
   -------------------------------------------------------------------------- */
@keyframes float3D {
  0% {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0px);
  }
  25% {
    transform: perspective(1000px) rotateX(3deg) rotateY(4deg) translateY(-8px);
  }
  50% {
    transform: perspective(1000px) rotateX(0deg) rotateY(6deg) translateY(-14px);
  }
  75% {
    transform: perspective(1000px) rotateX(-3deg) rotateY(2deg) translateY(-6px);
  }
  100% {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0px);
  }
}

.floating-3d {
  animation: float3D 8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);
  transform-style: preserve-3d;
}

@keyframes chipSpin3D {
  0% {
    transform: perspective(800px) rotateY(0deg) rotateX(8deg);
  }
  50% {
    transform: perspective(800px) rotateY(180deg) rotateX(12deg);
  }
  100% {
    transform: perspective(800px) rotateY(360deg) rotateX(8deg);
  }
}

.spin-chip-3d {
  animation: chipSpin3D 20s infinite linear;
  transform-style: preserve-3d;
}

@keyframes holographicRing {
  0% {
    transform: rotateX(65deg) rotateZ(0deg);
  }
  100% {
    transform: rotateX(65deg) rotateZ(360deg);
  }
}

.hologram-ring {
  animation: holographicRing 14s infinite linear;
  transform-origin: center center;
}

/* --------------------------------------------------------------------------
   CINEMATIC BACKGROUND PANNING & AMBIENT VIDEO MOTION
   -------------------------------------------------------------------------- */
@keyframes subtleHeroPan {
  0% {
    transform: scale(1.02) translate(0px, 0px);
  }
  50% {
    transform: scale(1.06) translate(-8px, -4px);
  }
  100% {
    transform: scale(1.02) translate(0px, 0px);
  }
}

/* --------------------------------------------------------------------------
   SHIMMER, GLOW & PULSE EFFECTS
   -------------------------------------------------------------------------- */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.25), 0 0 40px rgba(0, 210, 255, 0.08);
  }
  50% {
    box-shadow: 0 0 32px rgba(0, 210, 255, 0.6), 0 0 60px rgba(0, 210, 255, 0.25), 0 0 12px rgba(245, 130, 31, 0.4);
  }
}

@keyframes pulseOrange {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 130, 31, 0.3), 0 0 35px rgba(245, 130, 31, 0.1);
  }
  50% {
    box-shadow: 0 0 32px rgba(245, 130, 31, 0.75), 0 0 60px rgba(245, 130, 31, 0.3);
  }
}

.pulse-cyan {
  animation: pulseGlow 3.5s infinite ease-in-out;
}

.pulse-orange {
  animation: pulseOrange 3.5s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   LIGHT SWEEP & SHIMMER ACROSS 3D SURFACES
   -------------------------------------------------------------------------- */
@keyframes lightSweep {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-text {
  background: linear-gradient(90deg, #ffffff 0%, #00d2ff 25%, #ffffff 50%, #f5821f 75%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lightSweep 6s linear infinite;
}

/* --------------------------------------------------------------------------
   CIRCUIT DATA STREAM FLOW
   -------------------------------------------------------------------------- */
@keyframes circuitFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.circuit-gradient-anim {
  background-size: 200% 200%;
  animation: circuitFlow 5s ease infinite;
}

/* --------------------------------------------------------------------------
   DYNAMIC SLIDE-FROM-LEFT & SIT IN POSITION REVEALS
   -------------------------------------------------------------------------- */
.slide-from-left,
.fade-in-left,
.fade-in-up {
  opacity: 0;
  transform: perspective(1000px) translateX(-110px) translateZ(-20px) rotateY(-10deg);
  filter: blur(5px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.15s cubic-bezier(0.16, 1, 0.3, 1), filter 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.slide-from-left.visible,
.fade-in-left.visible,
.fade-in-up.visible {
  opacity: 1;
  transform: perspective(1000px) translateX(0px) translateZ(0px) rotateY(0deg);
  filter: blur(0px);
}

/* Once seated in position, allow free floating physics & tilt */
.seated-in-position {
  filter: none !important;
}

/* Staggered Left-to-Position Delays for Grids (Extended Deliberate Cascade) */
.card-grid > *:nth-child(1), .grid-4 > *:nth-child(1), .grid-3 > *:nth-child(1), .workflow-grid > *:nth-child(1) { transition-delay: 0.18s; }
.card-grid > *:nth-child(2), .grid-4 > *:nth-child(2), .grid-3 > *:nth-child(2), .workflow-grid > *:nth-child(2) { transition-delay: 0.52s; }
.card-grid > *:nth-child(3), .grid-4 > *:nth-child(3), .grid-3 > *:nth-child(3), .workflow-grid > *:nth-child(3) { transition-delay: 0.86s; }
.card-grid > *:nth-child(4), .grid-4 > *:nth-child(4), .grid-3 > *:nth-child(4), .workflow-grid > *:nth-child(4) { transition-delay: 1.20s; }
.card-grid > *:nth-child(5), .grid-4 > *:nth-child(5) { transition-delay: 1.54s; }
.card-grid > *:nth-child(6), .grid-4 > *:nth-child(6) { transition-delay: 1.88s; }

/* Hero Section Glide-from-Left Keyframe */
@keyframes slideFromLeftAndSit {
  0% {
    opacity: 0;
    transform: perspective(1000px) translateX(-120px) translateZ(-30px) rotateY(-12deg);
    filter: blur(8px);
  }
  75% {
    opacity: 1;
    transform: perspective(1000px) translateX(6px) translateZ(6px) rotateY(0.8deg);
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) translateX(0px) translateZ(0px) rotateY(0deg);
    filter: blur(0px);
  }
}

.hero-slide-left-1 {
  animation: slideFromLeftAndSit 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
  opacity: 0;
}

.hero-slide-left-2 {
  animation: slideFromLeftAndSit 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.70s forwards;
  opacity: 0;
}

.hero-slide-left-3 {
  animation: slideFromLeftAndSit 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.15s forwards;
  opacity: 0;
}

/* --------------------------------------------------------------------------
   CLEAN CARD HOVER ELEVATION & FLUID SCROLLING
   -------------------------------------------------------------------------- */
.tilt-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.tilt-card.slide-from-left {
  transition: opacity 1.1s var(--ease-out-expo), transform 1.15s var(--ease-out-expo), filter 1.05s var(--ease-out-expo), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.tilt-card.seated-in-position {
  transition: transform var(--transition-fast), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.tilt-card:hover {
  transform: translateY(-6px);
  box-shadow: 
    0 20px 48px rgba(0, 0, 0, 0.45),
    0 0 25px rgba(0, 210, 255, 0.2);
}

.tilt-card .card-icon,
.tilt-card .card-title,
.tilt-card .badge {
  transition: transform var(--transition-fast);
}

.tilt-card:hover .card-icon {
  transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   MAP RED POINTER & BEACON KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes redPinBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes redBeaconPulse {
  0% {
    transform: translate(-50%, 50%) scale(0.4);
    opacity: 0.9;
  }
  70% {
    transform: translate(-50%, 50%) scale(2.4);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 50%) scale(2.4);
    opacity: 0;
  }
}
