/* animation utilities */
:root {
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.anim-fade {
  animation: fadeIn 0.6s var(--ease) both;
}
.anim-slide {
  animation: slideUp 0.7s var(--ease) both;
}
@media (prefers-reduced-motion: reduce) {
  .anim-fade,
  .anim-slide {
    animation: none;
  }
}

/* rotating project-word animation */
@keyframes wordIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98) rotate(-1deg);
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.02) rotate(0deg);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}
@keyframes wordOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    filter: blur(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-word-item {
    animation: none !important;
    opacity: 1;
  }
}

/* ripple animation */

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.click-effect {
  animation: click-pulse 0.3s ease;
}

@keyframes click-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* Basics */
/* Animation Classes */
.animate-text {
  opacity: 0;
  transform: translateY(30px);
}

.animate-fade-in {
  opacity: 0;
  transform: translateY(20px);
}

.animate-slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
}

.animate-slide-in-right {
  opacity: 0;
  transform: translateX(50px);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.8);
}

/* Animation Delays */
.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}

/* Floating Animation */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Gradient Animation */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animated-gradient {
  background: linear-gradient(
    -45deg,
    var(--color-orange),
    var(--color-brown),
    var(--color-dark-red),
    var(--color-peach)
  );
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-orange);
  }
}

/* slide in animations for manual section */
.section-manual.visible .manual-copy {
  animation: slideInLeft 1s ease forwards;
}

.section-manual.visible .ebook-card {
  animation: slideInRight 1s ease forwards;
}

@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 neon-flicker {
  0%,
  100% {
    box-shadow: 0 0 2px var(--dark-color), 0 0 5px var(--dark-color),
      0 0 10px var(--dark-color);
    border-color: var(--dark-color);
  }
  50% {
    box-shadow: 0 0 5px var(--light-color), 0 0 10px var(--light-color),
      0 0 15px var(--light-color);
    border-color: var(--light-color);
  }
}

/* Staggered animation for comunidad section */
.section-comunidad.visible .animate-item {
  animation: fadeIn 0.6s var(--ease) both;
}

.section-comunidad.visible .animate-item:nth-child(1) {
  animation-delay: 0.1s;
}

.section-comunidad.visible .animate-item:nth-child(2) {
  animation-delay: 0.2s;
}

.section-comunidad.visible .animate-item:nth-child(3) {
  animation-delay: 0.3s;
}