/* ==========================================================================
   Maciej Szeląg - Portfolio | Dynamic Micro-Interactions & Keyframe Animations
   ========================================================================== */

/* Ambient Mesh Orbs Floating */
@keyframes floatOrb1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-40px, 60px) scale(1.08);
  }
  100% {
    transform: translate(30px, -40px) scale(0.95);
  }
}

@keyframes floatOrb2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(50px, -50px) scale(1.12);
  }
  100% {
    transform: translate(-30px, 40px) scale(0.92);
  }
}

@keyframes floatOrb3 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-35px, -45px) scale(1.05);
  }
  100% {
    transform: translate(45px, 25px) scale(0.96);
  }
}

/* Pulsing Status Indicator */
@keyframes pulseRipple {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Scroll Reveal Classes (Progressive Enhancement) */
/* By default, elements are visible (opacity: 1) to prevent blank pages if JS is delayed or blocked */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* When JavaScript is verified and active, apply hidden state to un-revealed elements below the fold */
.js-reveal .reveal:not(.active) {
  opacity: 0;
  transform: translateY(28px);
}

.js-reveal .reveal-left:not(.active) {
  opacity: 0;
  transform: translateX(-28px);
}

.js-reveal .reveal-right:not(.active) {
  opacity: 0;
  transform: translateX(28px);
}

.js-reveal .reveal-scale:not(.active) {
  opacity: 0;
  transform: scale(0.96);
}

/* Active State */
.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* Above-the-fold Hero content must ALWAYS be visible immediately */
.hero-section .reveal,
.hero-section .reveal-left,
.hero-section .reveal-right,
.hero-section .reveal-scale {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* Stagger Delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Subtle Button Shine Animation */
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  transition: all 0.75s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 140%;
}

/* Interactive Card Tilt Shadow & Lighting Effect */
.mockup-container:hover .browser-card {
  box-shadow: 0 35px 70px -15px rgba(37, 99, 235, 0.2), 0 0 0 1px rgba(37, 99, 235, 0.15);
}

/* Floating Badge Animation */
@keyframes softBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.floating-badge {
  animation: softBounce 5s ease-in-out infinite;
}

/* Magnetic Button Transition */
.magnetic {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
}

/* Text Shimmer Effect */
@keyframes textShimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.shimmer-gradient {
  background: linear-gradient(90deg, #2563EB 0%, #7C3AED 50%, #2563EB 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 6s ease infinite;
}
