/* WakeUp Labs - CSS Animations
   Converted from Framer Motion to CSS + Alpine.js */

/* ============================================
   BASE TRANSITIONS
   ============================================ */

.transition-opacity {
  transition: opacity 0.3s ease;
}

.transition-transform {
  transition: transform 0.3s ease;
}

.transition-all {
  transition: all 0.3s ease;
}

.transition-colors {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   FADE ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   SCROLL INDICATOR ANIMATION
   ============================================ */

@keyframes bounceY {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.animate-bounce-y {
  animation: bounceY 2s ease-in-out infinite;
}

/* ============================================
   ROTATION ANIMATIONS
   ============================================ */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-spin-slow {
  animation: spinSlow 20s linear infinite;
}

/* ============================================
   ORBIT ANIMATION (for TeamSection)
   ============================================ */

@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(240px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(240px) rotate(-360deg);
  }
}

.animate-orbit {
  animation: orbit 25s linear infinite;
}

.animate-orbit-1 { animation-delay: 0s; }
.animate-orbit-2 { animation-delay: -5s; }
.animate-orbit-3 { animation-delay: -10s; }
.animate-orbit-4 { animation-delay: -15s; }
.animate-orbit-5 { animation-delay: -20s; }

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ============================================
   STAGGER ANIMATION DELAYS
   ============================================ */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* ============================================
   INTERSECTION OBSERVER STATES
   (Used with Alpine x-intersect)
   ============================================ */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   3D TRANSFORMS
   ============================================ */

.perspective-1000 {
  perspective: 1000px;
}

.transform-style-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
}

/* ============================================
   CUSTOM EASING
   ============================================ */

.ease-spring {
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ease-smooth {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   LOADING SCREEN
   ============================================ */

@keyframes loadingPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-loading {
  animation: loadingPulse 1.5s ease-in-out infinite;
}

/* ============================================
   GRADIENT ANIMATIONS
   ============================================ */

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

/* ============================================
   MARQUEE / SCROLL ANIMATIONS (for BrandsSection)
   ============================================ */

@keyframes scrollLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes scrollRight {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-scroll-left {
  animation: scrollLeft 40s linear infinite;
}

.animate-scroll-right {
  animation: scrollRight 40s linear infinite;
}

/* ============================================
   VERTICAL CAROUSEL (Hero section)
   ============================================ */

@keyframes carouselExit {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

@keyframes carouselEnter {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.carousel-exit {
  animation: carouselExit 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.carousel-enter {
  animation: carouselEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ============================================
   PORTFOLIO CARD SUBTLE FLOAT
   ============================================ */

@keyframes cardFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

.portfolio-card-float {
  animation: cardFloat 4s ease-in-out infinite;
}

/* ============================================
   TEAM SECTION - Orbit & Core Animations
   ============================================ */

@keyframes coreFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(15px, -10px); }
  50% { transform: translate(-8px, 12px); }
  75% { transform: translate(-12px, -6px); }
}

@keyframes corePulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 1; }
}

@keyframes coreGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes teamOrbit {
  0% { transform: rotate(0deg) translateX(175px) rotate(0deg); }
  25% { transform: rotate(90deg) translateX(190px) rotate(-90deg); }
  50% { transform: rotate(180deg) translateX(170px) rotate(-180deg); }
  75% { transform: rotate(270deg) translateX(185px) rotate(-270deg); }
  100% { transform: rotate(360deg) translateX(175px) rotate(-360deg); }
}

.team-core-float {
  animation: coreFloat 8s ease-in-out infinite;
}

.team-core-pulse {
  animation: corePulse 3s ease-in-out infinite;
}

.team-core-glow {
  animation: coreGlow 2.5s ease-in-out infinite;
}

.team-orbit-label {
  animation: teamOrbit 25s linear infinite;
}

.team-orbit-label:nth-child(1) { animation-delay: 0s; }
.team-orbit-label:nth-child(2) { animation-delay: -5s; }
.team-orbit-label:nth-child(3) { animation-delay: -10s; }
.team-orbit-label:nth-child(4) { animation-delay: -15s; }
.team-orbit-label:nth-child(5) { animation-delay: -20s; }

/* Mobile — smaller orbit radius */
@media (max-width: 767px) {
  @keyframes teamOrbitMobile {
    0% { transform: rotate(0deg) translateX(105px) rotate(0deg); }
    25% { transform: rotate(90deg) translateX(115px) rotate(-90deg); }
    50% { transform: rotate(180deg) translateX(100px) rotate(-180deg); }
    75% { transform: rotate(270deg) translateX(110px) rotate(-270deg); }
    100% { transform: rotate(360deg) translateX(105px) rotate(-360deg); }
  }
  .team-orbit-label {
    animation-name: teamOrbitMobile;
  }
}

/* ============================================
   MATRIX PILLS (Experience Choice)
   ============================================ */

@keyframes pillFloat {
  0%, 100% { transform: translateY(0) rotate(12deg); }
  50% { transform: translateY(-10px) rotate(12deg); }
}

@keyframes pillGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

@keyframes matrixDrop {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(400%); }
}

.pill-float {
  animation: pillFloat 3s ease-in-out infinite, pillGlow 4s ease-in-out infinite;
}

.matrix-col {
  position: absolute;
  top: -30%;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #00ff41;
  writing-mode: vertical-lr;
  animation: matrixDrop linear infinite;
  white-space: nowrap;
  letter-spacing: 8px;
  pointer-events: none;
}

/* ============================================
   MISSILE (AGO → MISSILE) ANIMATIONS
   ============================================ */

@keyframes missileShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 2px); }
}

@keyframes missileFlame {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(1.4); opacity: 0.8; }
}

.missile-shake {
  animation: missileShake 0.1s infinite;
}

.missile-flame {
  animation: missileFlame 0.08s infinite;
}

/* ============================================
   FOOTER LETTER-DROP ANIMATION
   Letters fall from above one by one (staggered)
   ============================================ */

@keyframes footerLetterDrop {
  from {
    opacity: 0;
    transform: perspective(600px) translateY(-80px) rotateX(-25deg) rotate(-8deg);
    text-shadow: 1px 3px 0 #E72300, 2px 6px 0 #c41e00, 3px 9px 0 #8b1500;
  }
  50% {
    opacity: 1;
    transform: perspective(600px) translateY(6px) rotateX(5deg) rotate(1deg);
    text-shadow: 1px 2px 0 #E72300, 2px 4px 0 #c41e00;
  }
  75% {
    transform: perspective(600px) translateY(-3px) rotateX(-2deg) rotate(0deg);
    text-shadow: 1px 1px 0 #E72300;
  }
  to {
    opacity: 1;
    transform: perspective(600px) translateY(0) rotateX(0deg) rotate(0deg);
    text-shadow: inherit;
  }
}

.footer-letter {
  opacity: 0;
  transform: translateY(-80px);
  display: inline-block;
}

.footer-letter-in {
  animation: footerLetterDrop 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--letter-delay, 0ms);
}
