/* ==========================================================================
   ANIMATIONS & DYNAMIC MICRO-INTERACTIONS — HASHIM BAJWA PORTFOLIO
   Aesthetic: Ultra-Smooth, Architectural, Luxury Spring Physics
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scroll Progress Bar at Top of Viewport
   -------------------------------------------------------------------------- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-light));
  box-shadow: 0 0 12px var(--color-gold);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. Dynamic Cursor Ambient Spotlight
   -------------------------------------------------------------------------- */
.cursor-ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    700px circle at var(--mouse-x, 50vw) var(--mouse-y, 50vh),
    rgba(229, 195, 126, 0.055) 0%,
    rgba(131, 29, 61, 0.035) 35%,
    transparent 70%
  );
  transition: opacity 0.4s ease;
}

/* --------------------------------------------------------------------------
   3. Staggered Scroll Reveal Animations
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.94) translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger Delays */
.delay-1 { transition-delay: 120ms; }
.delay-2 { transition-delay: 240ms; }
.delay-3 { transition-delay: 360ms; }
.delay-4 { transition-delay: 480ms; }
.delay-5 { transition-delay: 600ms; }

/* --------------------------------------------------------------------------
   4. Radiant Backlight Aura & Halo Pulse Keyframes
   -------------------------------------------------------------------------- */
@keyframes auraPulse {
  0% {
    opacity: 0.75;
    transform: scale(0.95) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) rotate(3deg);
  }
  100% {
    opacity: 0.75;
    transform: scale(0.95) rotate(0deg);
  }
}

@keyframes ringGlow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(229, 195, 126, 0.35);
    border-color: rgba(229, 195, 126, 0.4);
  }
  50% {
    box-shadow: 0 0 60px rgba(229, 195, 126, 0.65), 0 0 90px rgba(131, 29, 61, 0.35);
    border-color: rgba(229, 195, 126, 0.75);
  }
}

.portrait-glow-ring {
  animation: ringGlow 6s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   5. Button Shimmer & Traveling Light Effect
   -------------------------------------------------------------------------- */
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%
  );
  transform: translateX(-100%) rotate(35deg);
  transition: transform 0.75s ease-in-out;
}

.btn-primary:hover::after {
  transform: translateX(100%) rotate(35deg);
}

/* --------------------------------------------------------------------------
   6. Card Hover Tilt & Dynamic Glare
   -------------------------------------------------------------------------- */
.tilt-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   7. Background Floating Ambient Canvas
   -------------------------------------------------------------------------- */
#ambient-particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   8. Floating Badge Floating Keyframe
   -------------------------------------------------------------------------- */
@keyframes floatBadge {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

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

/* --------------------------------------------------------------------------
   9. Toast Notifications
   -------------------------------------------------------------------------- */
.toast-notice {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--color-gold);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(229, 195, 126, 0.25);
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.4s var(--ease-spring), opacity 0.4s var(--ease-spring);
  max-width: calc(100vw - 32px);
  width: max-content;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (min-width: 768px) {
  .toast-notice {
    bottom: var(--space-6);
    right: var(--space-6);
    left: auto;
    transform: translateY(100px);
  }

  .toast-notice.show {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   10. 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;
  }
  
  .reveal-on-scroll,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }

  .portrait-glow-aura,
  .portrait-glow-ring,
  .portrait-floating-badge {
    animation: none !important;
  }
}
