/* Animation Keyframes */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

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

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

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

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

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

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

@keyframes glowPulse {
  0% { box-shadow: 0 0 5px rgba(108, 43, 217, 0.5); }
  50% { box-shadow: 0 0 20px rgba(108, 43, 217, 0.8); }
  100% { box-shadow: 0 0 5px rgba(108, 43, 217, 0.5); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Applied Animations */
.hero-title {
  animation: fadeIn 1s ease-out;
}

.speed-text {
  animation: slideInLeft 1s ease-out forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

.type-text {
  animation: slideInRight 1s ease-out forwards;
  opacity: 0;
  animation-delay: 0.6s;
}

.master-text {
  animation: slideInUp 1s ease-out forwards;
  opacity: 0;
  animation-delay: 0.9s;
}

.hero-tagline {
  animation: fadeIn 1.5s ease-out forwards;
  opacity: 0;
  animation-delay: 1.2s;
}

.hero-buttons {
  animation: fadeIn 1.5s ease-out forwards;
  opacity: 0;
  animation-delay: 1.5s;
}

.btn-primary {
  animation: glowPulse 3s infinite;
}

.racing-preview {
  animation: fadeIn 1.5s ease-out forwards, float 5s ease-in-out infinite;
  opacity: 0;
  animation-delay: 1.8s;
}

.feature-icon {
  animation: pulse 3s ease-in-out infinite;
}

.typed {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--secondary);
  padding-right: 5px;
  animation: typing 3.5s steps(40, end);
}

.cursor {
  animation: blink 0.7s step-end infinite;
}

.section-title::before,
.section-title::after {
  content: '⚡';
  display: inline-block;
  margin: 0 var(--space-md);
  animation: pulse 2s infinite;
}

.feature-card {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

.feature-card:nth-child(1) {
  animation-delay: 0.2s;
}

.feature-card:nth-child(2) {
  animation-delay: 0.4s;
}

.feature-card:nth-child(3) {
  animation-delay: 0.6s;
}

/* Shimmer effect for buttons */
.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(30deg);
  background-size: 200% 200%;
  animation: shimmer 3s infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::after {
  opacity: 1;
}