/* ═══════════════════════════════════════════════════════════════
   B-LABS MAXIMUM ANIMATION ENGINE
   High-Precision Keyframes, 3D Physics, Glowing Lasers, Particle Systems
   ═══════════════════════════════════════════════════════════════ */

@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ─────────────────────────────────────────────
   1. CORE ROTATION & DRIFT KEYFRAMES
   ───────────────────────────────────────────── */

@keyframes rotate-beam {
  from { --beam-angle: 0deg; }
  to   { --beam-angle: 360deg; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 14px var(--color-primary); }
  50%       { opacity: 0.35; transform: scale(0.7); box-shadow: 0 0 4px var(--color-primary); }
}

@keyframes scroll-wheel {
  0%   { transform: translateY(0); opacity: 1; }
  80%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes float-smooth {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-14px) rotate(1.5deg); }
  66%       { transform: translateY(-7px) rotate(-1.5deg); }
}

@keyframes float-delayed {
  0%, 100% { transform: translateY(0px) rotate(2deg); }
  50%       { transform: translateY(-18px) rotate(-2deg); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-24px) scale(1.04); }
}

@keyframes float-breathing {
  0%, 100% {
    transform: translateY(0px) scale(1);
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.2));
  }
  50% {
    transform: translateY(-15px) scale(1.025);
    filter: drop-shadow(0 30px 50px rgba(0, 212, 255, 0.35));
  }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes text-gradient-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes laser-sweep {
  0%   { transform: translateX(-150%) skewX(-25deg); opacity: 0; }
  50%  { opacity: 0.8; }
  100% { transform: translateX(250%) skewX(-25deg); opacity: 0; }
}

@keyframes ripple-wave {
  0%   { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; }
}

@keyframes blob-morph {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: translate(0, 0) scale(1); }
  25%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: translate(30px, -25px) scale(1.08); }
  50%  { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; transform: translate(-20px, 30px) scale(0.95); }
  75%  { border-radius: 60% 40% 60% 30% / 60% 30% 40% 60%; transform: translate(25px, 18px) scale(1.05); }
  100% { border-radius: 40% 60% 50% 50% / 40% 50% 60% 50%; transform: translate(0, 0) scale(1); }
}

/* ─────────────────────────────────────────────
   2. SHIMMERING GRADIENT & TEXT EFFECTS
   ───────────────────────────────────────────── */

.text-gradient {
  background: linear-gradient(135deg, #00D4FF 0%, #7C3AED 50%, #3B82F6 100%);
  background-size: 250% 250%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-gradient-flow 5s ease-in-out infinite alternate;
}

/* Floating animation utilities */
.float-1 { animation: float-smooth 6s ease-in-out infinite; }
.float-2 { animation: float-smooth 8s ease-in-out infinite 1s; }
.float-3 { animation: float-delayed 7s ease-in-out infinite 2s; }
.float-breathing { animation: float-breathing 5s ease-in-out infinite; }
.float-delayed { animation: float-delayed 8s ease-in-out infinite; }

/* ─────────────────────────────────────────────
   3. 3D GLASS CARDS & LASER BORDER BEAMS
   ───────────────────────────────────────────── */

.service-card,
.feature-card,
.arch-card,
.newsletter-card,
.process-step,
.privacy-pill-card {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.service-card::after,
.feature-card::after,
.arch-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 212, 255, 0.12),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

.service-card:hover::after,
.feature-card:hover::after,
.arch-card:hover::after {
  opacity: 1;
}

/* Animated laser sweep on primary buttons */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: translateX(-150%) skewX(-20deg);
  pointer-events: none;
}

.btn-primary:hover::after {
  animation: laser-sweep 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────
   4. IMAGERESIZER 3D DEVICE SHOWCASE
   ───────────────────────────────────────────── */

.screenshot-card {
  animation: float-breathing 6s ease-in-out infinite alternate;
}

.screenshot-card:nth-child(even) {
  animation-delay: -3s;
}

.device-mockup {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}

.screenshot-card:hover .device-mockup {
  transform: scale(1.04) translateY(-8px);
  box-shadow: 0 35px 70px -15px rgba(0, 212, 255, 0.4), 0 0 30px rgba(124, 58, 237, 0.25);
  border-color: rgba(0, 212, 255, 0.6);
}

.app-icon-img {
  animation: float-breathing 5s ease-in-out infinite alternate;
}

/* ─────────────────────────────────────────────
   5. CUSTOM CURSOR & SPOTLIGHT
   ───────────────────────────────────────────── */

.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 0 14px var(--color-primary);
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              background 0.2s ease;
  box-shadow: 0 0 24px var(--color-primary-glow);
}

.custom-cursor-ring.is-hovering {
  width: 64px;
  height: 64px;
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--color-secondary);
  box-shadow: 0 0 40px var(--color-secondary-glow);
}

.custom-cursor-dot.is-hovering {
  transform: translate(-50%, -50%) scale(1.6);
  background: #FFFFFF;
}

/* ─────────────────────────────────────────────
   6. ACCESSIBILITY / REDUCED MOTION
   ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .marquee-track,
  .float-1, .float-2, .float-3,
  .float-breathing,
  .screenshot-card,
  .app-icon-img,
  .hero-badge-dot,
  .custom-cursor-dot,
  .custom-cursor-ring {
    animation: none !important;
  }
}
