/* ==========================================================================
   CONTRA • ULTRA-PREMIUM HOMEPAGE ANIMATIONS & MICRO-INTERACTIONS
   Agency-grade, hardware-accelerated, 60fps cinematic experience.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. AMBIENT BACKGROUND ATMOSPHERE & FLOATING GLOW ORBS
   -------------------------------------------------------------------------- */
.ambient-glow-wrapper {
  overflow: hidden;
  perspective: 1000px;
}

.ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  transition: opacity 1s ease;
}

/* Floating multi-axis keyframes with organic physics curves */
.glow-orb-1 {
  animation: floatOrb1 18s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.glow-orb-2 {
  animation: floatOrb2 22s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.glow-orb-3 {
  animation: floatOrb3 26s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes floatOrb1 {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    opacity: 0.45;
  }
  50% {
    transform: translate3d(80px, 60px, 0) scale(1.18) rotate(15deg);
    opacity: 0.6;
  }
  100% {
    transform: translate3d(-50px, 110px, 0) scale(0.92) rotate(-10deg);
    opacity: 0.4;
  }
}

@keyframes floatOrb2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    opacity: 0.35;
  }
  50% {
    transform: translate3d(-90px, -70px, 0) scale(1.22) rotate(-20deg);
    opacity: 0.55;
  }
  100% {
    transform: translate3d(-40px, 50px, 0) scale(0.95) rotate(12deg);
    opacity: 0.32;
  }
}

@keyframes floatOrb3 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate3d(110px, -60px, 0) scale(1.15);
    opacity: 0.5;
  }
  100% {
    transform: translate3d(40px, -110px, 0) scale(0.88);
    opacity: 0.28;
  }
}

/* Subtle Aurora Sheen along Top */
.global-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.6), rgba(255, 59, 59, 0.7), rgba(225, 29, 72, 0.6), transparent);
  animation: auroraPulse 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auroraPulse {
  0% { opacity: 0.3; filter: blur(1px); }
  50% { opacity: 0.9; filter: blur(2px); }
  100% { opacity: 0.4; filter: blur(1px); }
}

/* --------------------------------------------------------------------------
   2. HEADER & BRAND MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
.brand-icon-box {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  overflow: hidden;
}

.brand-icon-box::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%);
  transform: rotate(25deg) translateY(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.brand-link:hover .brand-icon-box {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}

.brand-link:hover .brand-icon-box::after {
  transform: rotate(25deg) translateY(100%);
}

.nav-link {
  position: relative;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef4444, #ff3b3b);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* Dual-Ring Radar Ping Wave */
.ping-indicator {
  position: relative;
  display: inline-block;
}

.ping-indicator::before,
.ping-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ping-indicator::before {
  animation: radarWave 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

.ping-indicator::after {
  animation: radarWave 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.2s infinite;
}

@keyframes radarWave {
  0% {
    width: 100%;
    height: 100%;
    opacity: 0.8;
  }
  100% {
    width: 340%;
    height: 340%;
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   3. HERO SECTION ENTRANCE & LIQUID TEXT SHIMMER
   -------------------------------------------------------------------------- */
.hero-pill-badge {
  animation: heroBadgeEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards, floatPill 4.5s ease-in-out infinite 0.8s alternate;
  will-change: transform;
}

@keyframes heroBadgeEntrance {
  0% {
    opacity: 0;
    transform: translateY(-18px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatPill {
  0% {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }
  100% {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
  }
}

.hero-title {
  animation: heroTextFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.hero-subtitle {
  animation: heroTextFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s backwards;
}

.hero-buttons {
  animation: heroTextFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s backwards;
}

@keyframes heroTextFadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Liquid Metallic Text Gradient Shimmer */
.hero-title-gradient {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #cbd5e1 25%,
    #ffffff 50%,
    #93c5fd 75%,
    #e2e8f0 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientTextShimmer 7s ease-in-out infinite alternate;
}

@keyframes gradientTextShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* --------------------------------------------------------------------------
   4. HERO BUTTONS & HOVER ENHANCEMENTS
   -------------------------------------------------------------------------- */
.btn-hero-main {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.3s ease;
  animation: pulseGlow 4s ease-in-out infinite;
}

.btn-hero-main::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -70%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  transform: rotate(30deg);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.btn-hero-main:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px rgba(255, 255, 255, 0.32), 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-hero-main:hover::after {
  transform: rotate(30deg) translateX(350%);
}

.btn-hero-main svg {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-hero-main:hover svg {
  transform: rotate(-8deg) scale(1.15);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.16);
  }
  50% {
    box-shadow: 0 10px 34px rgba(255, 255, 255, 0.28), 0 0 24px rgba(239, 68, 68, 0.25);
  }
}

.btn-hero-secondary {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.btn-hero-secondary:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.08);
}

.btn-hero-secondary svg {
  transition: transform 0.35s ease;
}

.btn-hero-secondary:hover svg {
  transform: scale(1.15) rotate(5deg);
}

/* --------------------------------------------------------------------------
   5. HERO GLASS SHOWCASE: BORDER-BEAM & 3D PARALLAX TILT
   -------------------------------------------------------------------------- */
.hero-glass-showcase {
  position: relative;
  overflow: hidden;
  animation: heroShowcaseEntrance 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  will-change: transform;
}

@keyframes heroShowcaseEntrance {
  0% {
    opacity: 0;
    transform: translateY(35px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Traveling Border-Beam Neon Glow Line */
.hero-glass-showcase::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 70deg,
    rgba(239, 68, 68, 0.6) 100deg,
    rgba(255, 59, 59, 0.8) 120deg,
    rgba(225, 29, 72, 0.6) 140deg,
    transparent 170deg,
    transparent 360deg
  );
  animation: borderBeamRotate 9s linear infinite;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

@keyframes borderBeamRotate {
  100% {
    transform: rotate(360deg);
  }
}

/* Inner masking to preserve glass backdrop inside */
.hero-glass-showcase > * {
  position: relative;
  z-index: 1;
}

/* Stats Row micro-animations */
.showcase-stat-item {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, border-color 0.3s ease;
}

.showcase-stat-item:hover {
  transform: translateY(-3px) scale(1.03);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.showcase-stat-number {
  display: inline-block;
  transition: transform 0.3s ease, color 0.3s ease;
}

.showcase-stat-item:hover .showcase-stat-number {
  transform: scale(1.05);
  color: #ff3b3b;
}

/* Live Ping ticker pulse */
.ping-pulse-active {
  animation: pingGreenFlash 0.8s ease-out;
}

@keyframes pingGreenFlash {
  0% {
    color: #10b981;
    text-shadow: 0 0 14px rgba(16, 185, 129, 0.8);
    transform: scale(1.1);
  }
  100% {
    color: #fff;
    text-shadow: none;
    transform: scale(1);
  }
}

/* --------------------------------------------------------------------------
   6. FEATURES SECTION: CURSOR SPOTLIGHT & 3D CARD HOVER
   -------------------------------------------------------------------------- */
.glass-feature-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
}

/* Radial Cursor Spotlight Follower */
.glass-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(239, 68, 68, 0.14),
    rgba(255, 59, 59, 0.04) 40%,
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.glass-feature-card:hover::before {
  opacity: 1;
}

.glass-feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45), 0 0 25px rgba(239, 68, 68, 0.2);
}

.glass-feature-card > * {
  position: relative;
  z-index: 1;
}

/* Feature Icon Micro-Animations */
.feature-card-icon {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, background 0.35s ease, color 0.35s ease;
}

.glass-feature-card:hover .feature-card-icon {
  transform: scale(1.12) translateY(-2px);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
  color: #ffffff;
}

/* Card 1: Shield cyber pulse */
.glass-feature-card:nth-child(1):hover .feature-card-icon svg {
  animation: iconShieldPulse 0.9s ease-in-out infinite alternate;
}

@keyframes iconShieldPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px #ff3b3b); }
  100% { transform: scale(1.14); filter: drop-shadow(0 0 10px #ff3b3b); }
}

/* Card 2: Components V2 button click */
.glass-feature-card:nth-child(2):hover .feature-card-icon svg {
  animation: iconButtonPress 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}

@keyframes iconButtonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.92); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 8px #e11d48); }
}

/* Card 3: Transcript document wave */
.glass-feature-card:nth-child(3):hover .feature-card-icon svg {
  animation: iconDocDraw 0.9s ease-in-out infinite alternate;
}

@keyframes iconDocDraw {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-6deg) scale(1.12); filter: drop-shadow(0 0 8px #10b981); }
}

/* Card 4: Lightning electrical spark */
.glass-feature-card:nth-child(4):hover .feature-card-icon svg {
  animation: iconLightningSpark 0.6s ease-in-out infinite alternate;
}

@keyframes iconLightningSpark {
  0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 2px #f59e0b); }
  50% { transform: rotate(8deg) scale(1.18); filter: drop-shadow(0 0 14px #fbbf24); }
  100% { transform: rotate(-5deg) scale(1.1); filter: drop-shadow(0 0 6px #f59e0b); }
}

/* --------------------------------------------------------------------------
   8. SCROLL REVEAL STAGGER ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.glass-cards-grid .glass-feature-card:nth-child(1) { transition-delay: 0.05s; }
.glass-cards-grid .glass-feature-card:nth-child(2) { transition-delay: 0.15s; }
.glass-cards-grid .glass-feature-card:nth-child(3) { transition-delay: 0.25s; }
.glass-cards-grid .glass-feature-card:nth-child(4) { transition-delay: 0.35s; }

/* --------------------------------------------------------------------------
   9. CALLOUT CARD BORDER-BEAM & GLOW
   -------------------------------------------------------------------------- */
.glass-callout-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.glass-callout-card:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 35px rgba(239, 68, 68, 0.2);
}

.glass-callout-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 180deg,
    transparent 0deg,
    transparent 80deg,
    rgba(239, 68, 68, 0.45) 120deg,
    rgba(255, 59, 59, 0.6) 140deg,
    transparent 180deg,
    transparent 360deg
  );
  animation: borderBeamRotate 12s linear infinite reverse;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.glass-callout-card > * {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   10. REDUCED MOTION PREFERENCES
   -------------------------------------------------------------------------- */
@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;
  }
  .ambient-canvas {
    display: none !important;
  }
}
