/* Keyframe Animations */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(74, 101, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(74, 101, 246, 0.6);
  }
}

@keyframes rotate3d {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
  }
}

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

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

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

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

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

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

/* Animation Classes */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s 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;
}

.animate-scale-in {
  animation: scaleIn 0.8s ease-out forwards;
}

.animate-slide-in-up {
  animation: slideInUp 0.8s ease-out forwards;
}

/* Initial states for animated elements - ensure content is visible by default */
[data-aos] {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s ease;
}

/* Animation states */
[data-aos]:not(.aos-animate) {
  opacity: 0.3;
  transform: translateY(20px);
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* Specific animation delays */
[data-aos-delay="100"].aos-animate {
  transition-delay: 0.1s;
}

[data-aos-delay="200"].aos-animate {
  transition-delay: 0.2s;
}

[data-aos-delay="300"].aos-animate {
  transition-delay: 0.3s;
}

[data-aos-delay="400"].aos-animate {
  transition-delay: 0.4s;
}

/* Hero animations - simplified to avoid disappearing content */
.hero-content > * {
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero-content .hero-title {
  animation-delay: 0.1s;
}

.hero-content .hero-subtitle {
  animation-delay: 0.3s;
}

.hero-content .hero-cta {
  animation-delay: 0.5s;
}

/* Service card hover animations */
.service-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
  transform: translateY(-10px) scale(1.02);
}

/* Work item animations */
.work-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Crystal structure glow effect */
.crystal-structure::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(circle, rgba(74, 101, 246, 0.3), transparent);
  border-radius: 50%;
  animation: pulse-glow 3s ease-in-out infinite;
  z-index: -1;
}

/* Loading animation for logo */
.logo-loading {
  animation: rotate3d 2s ease-in-out;
}

/* Smooth transitions for all interactive elements */
a, button, input, textarea, .service-card, .work-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger animation for grid items */
.services-grid .service-card:nth-child(1) {
  animation-delay: 0.1s;
}

.services-grid .service-card:nth-child(2) {
  animation-delay: 0.2s;
}

.services-grid .service-card:nth-child(3) {
  animation-delay: 0.3s;
}

.services-grid .service-card:nth-child(4) {
  animation-delay: 0.4s;
}

.services-grid .service-card:nth-child(5) {
  animation-delay: 0.5s;
}

.services-grid .service-card:nth-child(6) {
  animation-delay: 0.6s;
}

.work-grid .work-item:nth-child(1) {
  animation-delay: 0.1s;
}

.work-grid .work-item:nth-child(2) {
  animation-delay: 0.2s;
}

.work-grid .work-item:nth-child(3) {
  animation-delay: 0.3s;
}

.work-grid .work-item:nth-child(4) {
  animation-delay: 0.4s;
}

/* Parallax effect for sections */
.parallax {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
}

/* Glow effects */
.glow {
  box-shadow: 0 0 20px rgba(74, 101, 246, 0.4);
}

.glow-purple {
  box-shadow: 0 0 20px rgba(138, 67, 243, 0.4);
}

/* Text shimmer effect */
.text-shimmer {
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-blue));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

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

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

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

/* Reveal animations - ensure content is visible by default */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s ease;
}

.reveal:not(.revealed) {
  opacity: 0.4;
  transform: translateY(30px);
}

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

/* Button ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}
