/* =====================================================
   Animations & Keyframes
   ===================================================== */

/* ========== Page Load Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

/* ========== Hero Animations ========== */
.hero-content {
  animation: fadeInUp 1s ease-out;
}

.hero-title {
  animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-subtitle {
  animation: fadeInUp 1s ease-out 0.4s backwards;
}

.hero-links {
  animation: fadeInUp 1s ease-out 0.6s backwards;
}

/* Title letter stagger effect */
.title-line {
  animation: titleReveal 1s ease-out 0.3s backwards;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Subtitle letter animation */
.subtitle-text {
  animation: fadeInUp 1s ease-out 0.5s backwards;
}

/* ========== Parallax Effect ========== */
.hero-parallax {
  transform: translateY(var(--parallax-offset, 0));
  transition: transform 0.1s linear;
}

/* ========== Scroll Reveal Animation ========== */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger effect for multiple items */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.stagger-item:nth-child(1) { transition-delay: 0ms; }
.stagger-item:nth-child(2) { transition-delay: 50ms; }
.stagger-item:nth-child(3) { transition-delay: 100ms; }
.stagger-item:nth-child(4) { transition-delay: 150ms; }
.stagger-item:nth-child(5) { transition-delay: 200ms; }
.stagger-item:nth-child(6) { transition-delay: 250ms; }
.stagger-item:nth-child(7) { transition-delay: 300ms; }
.stagger-item:nth-child(8) { transition-delay: 350ms; }
.stagger-item:nth-child(9) { transition-delay: 400ms; }
.stagger-item:nth-child(10) { transition-delay: 450ms; }
.stagger-item:nth-child(11) { transition-delay: 500ms; }
.stagger-item:nth-child(12) { transition-delay: 550ms; }

/* ========== Gallery Item Animations ========== */
.gallery-item {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item.visible {
  animation: galleryFadeIn 0.6s ease-out forwards;
}

@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Gallery filter animation */
.gallery-item.filter-out {
  animation: galleryFadeOut 0.3s ease-out forwards;
}

@keyframes galleryFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.gallery-item.filter-in {
  animation: galleryFadeIn 0.4s ease-out forwards;
}

/* Hover scale effect */
.gallery-item:hover {
  transform: translateY(-5px);
}

/* ========== Navigation Animation ========== */
.nav {
  transition: all 0.3s ease;
}

.nav.hidden {
  transform: translateY(-100%);
}

.nav.visible {
  transform: translateY(0);
}

/* ========== Button Hover Effects ========== */
.filter-btn, .hero-link, .contact-btn {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========== Speed Lines Effect ========== */
.speed-line {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--primary-red) 50%,
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
}

.speed-line.active {
  animation: speedLine 1.2s ease-out forwards;
}

@keyframes speedLine {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(200%);
    opacity: 0;
  }
}

/* Multiple speed lines */
.speed-lines .line-1 { top: 20%; animation-delay: 0s; }
.speed-lines .line-2 { top: 40%; animation-delay: 0.1s; }
.speed-lines .line-3 { top: 60%; animation-delay: 0.2s; }
.speed-lines .line-4 { top: 80%; animation-delay: 0.3s; }

/* ========== Motion Blur Effect ========== */
.motion-blur {
  filter: blur(2px);
  transition: filter 0.3s ease;
}

.motion-blur:hover {
  filter: blur(0);
}

/* ========== Pulse Animation ========== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========== Shimmer Effect ========== */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* ========== Text Reveal Animation ========== */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.text-reveal.visible span {
  transform: translateY(0);
}

/* ========== Border Animation ========== */
@keyframes borderDraw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.border-animate {
  position: relative;
}

.border-animate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid var(--primary-red);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.5s ease-out;
}

.border-animate:hover::before {
  clip-path: inset(0 0 0 0);
}

/* ========== Zoom Effects ========== */
@keyframes zoomIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.zoom-in {
  animation: zoomIn 0.5s ease-out forwards;
}

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

.zoom-out {
  animation: zoomOut 0.3s ease-out forwards;
}

/* ========== Rotate Animation ========== */
@keyframes rotateIn {
  from {
    transform: rotate(-180deg) scale(0);
    opacity: 0;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

.rotate-in {
  animation: rotateIn 0.6s ease-out forwards;
}

/* ========== Bounce Animation ========== */
@keyframes bounceIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 0.5s ease-out forwards;
}

/* ========== Glow Effect ========== */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(225, 6, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(225, 6, 0, 0.6);
  }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* ========== Float Animation ========== */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ========== Wiggle Animation ========== */
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

.wiggle {
  animation: wiggle 0.5s ease-in-out;
}

/* ========== Skew Animation ========== */
@keyframes skewIn {
  from {
    transform: skewX(20deg) translateX(-50%);
    opacity: 0;
  }
  to {
    transform: skewX(0) translateX(0);
    opacity: 1;
  }
}

.skew-in {
  animation: skewIn 0.5s ease-out forwards;
}