/* ============================================
   THE LOFT IT SOLUTIONS - ANIMATIONS
   Keyframes, transitions, and micro-interactions
   ============================================ */

/* ------------------------------------------
   SCROLL REVEAL ANIMATIONS
   ------------------------------------------ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(14, 165, 255, 0.15);
  }
  50% { 
    box-shadow: 0 0 40px rgba(14, 165, 255, 0.3);
  }
}

/* ------------------------------------------
   HERO ENTRANCE ANIMATIONS
   ------------------------------------------ */
.hero-entrance .hero-content > * {
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-entrance .hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-entrance .hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-entrance .hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-entrance .hero-content > *:nth-child(4) { animation-delay: 0.4s; }

.hero-entrance .hero-card {
  opacity: 0;
  animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* ------------------------------------------
   FLOATING ELEMENTS
   ------------------------------------------ */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

/* ------------------------------------------
   PULSE GLOW (for CTAs)
   ------------------------------------------ */
.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* ------------------------------------------
   STAGGER ANIMATIONS
   ------------------------------------------ */
.stagger-fade > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-fade.animate-in > * {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-fade.animate-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-fade.animate-in > *:nth-child(2) { animation-delay: 80ms; }
.stagger-fade.animate-in > *:nth-child(3) { animation-delay: 160ms; }
.stagger-fade.animate-in > *:nth-child(4) { animation-delay: 240ms; }
.stagger-fade.animate-in > *:nth-child(5) { animation-delay: 320ms; }
.stagger-fade.animate-in > *:nth-child(6) { animation-delay: 400ms; }

/* ------------------------------------------
   CARD HOVER LIFT
   ------------------------------------------ */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow-lg);
}

/* ------------------------------------------
   GRADIENT BORDER ANIMATION
   ------------------------------------------ */
@keyframes gradient-rotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

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

.gradient-border-animated {
  position: relative;
  background: var(--color-bg-tertiary);
}

.gradient-border-animated::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--color-accent), var(--color-accent-secondary), var(--color-accent-light), var(--color-accent));
  animation: gradient-rotate 4s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gradient-border-animated:hover::before {
  opacity: 1;
}

/* ------------------------------------------
   SHIMMER LOADING EFFECT
   ------------------------------------------ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 25%,
    rgba(30, 41, 59, 0.8) 50%,
    var(--color-bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ------------------------------------------
   TYPING CURSOR (for hero text)
   ------------------------------------------ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--color-accent);
  margin-left: 2px;
}

/* ------------------------------------------
   REDUCED MOTION
   ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .hero-entrance .hero-content > *,
  .hero-entrance .hero-card,
  .stagger-fade > *,
  .float-animation,
  .pulse-glow,
  .shimmer {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .gradient-border-animated::before {
    animation: none;
  }
}
