/* OPTIMIZACIÓN: Animaciones más rápidas y suaves */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -30px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(50px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}


@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translate3d(-200px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate3d(-200px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}


/* ============================================
   ANIMACIONES ADICIONALES PARA SINATRA
   ============================================ */

/* ANIMACIONES INICIALES - Estados por defecto */
.service-box {
  opacity: 0;
  transform: translate3d(0, 60px, 0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.experience-card {
  opacity: 0;
  transform: translate3d(0, 80px, 0) scale(0.9);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}



.contact-box,
.contact-info {
  opacity: 0;
  transform: translate3d(0, 50px, 0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ANIMACIONES DE ENTRADA */
.service-box.animate-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.experience-card.animate-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}


/* ANIMACIÓN DE PULSO PARA EXPERIENCE CARDS */
.experience-card.pulse-animation {
  animation: gentlePulse 0.8s infinite alternate;
}

@keyframes gentlePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 81, 47, 0.1);
  }

  100% {
    box-shadow: 0 0 0 20px rgba(255, 81, 47, 0);
  }
}

/* ANIMACIÓN ESPECIAL PARA NÚMEROS */
.experience-number {
  background: white;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ANIMACIONES HOVER MEJORADAS */
.service-box {
  position: relative;
  overflow: hidden;
}

.service-box::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 81, 47, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.service-box:hover::after {
  opacity: 1;
}

/* ANIMACIÓN FLOTANTE PARA WORK ITEMS */
.work-item.work-animate {
  animation: floatGentle 6s ease-in-out infinite;
}

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

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

@keyframes floatGentle {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -10px, 0);
  }
}

/* EFECTO PARALLAX PARA SECCIONES */
.hero-container {
  transform-style: preserve-3d;
}

.s-icon {
  will-change: transform, opacity;
}

/* ANIMACIONES DE TEXTO MEJORADAS */
.ideas h2 {
  opacity: 0;
  transform: translate3d(-100px, 0, 0);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.ideas .light {
  opacity: 0;
  transform: translate3d(100px, 0, 0);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.ideas h2.animate,
.ideas .light.animate {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ANIMACIÓN DE ESCRITURA TYPEWRITER */
.typewriter {
  border-right: 3px solid #ff512f;
  animation: blink-caret 1s infinite;
}

@keyframes blink-caret {

  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: #ff512f;
  }
}

/* EFECTOS DE SCROLL SUAVES */
html {
  scroll-behavior: smooth;
}

/* ANIMACIONES PARA FORMULARIO DE CONTACTO */
.contact-form input:focus,
.contact-form textarea:focus {
  transform: scale(1.02);
  transition: all 0.3s ease;
}

.contact-form button {
  position: relative;
  overflow: hidden;
}

.contact-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.contact-form button:hover::before {
  left: 100%;
}

/* LOADING STATES */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ff512f;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* MICRO-INTERACCIONES */
.btn {
  position: relative;
  overflow: hidden;
}

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

.btn:active::before {
  width: 200px;
  height: 200px;
}




.optimize-animation {
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
}

.stagger-animation {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
}

.stagger-animation.animate-stagger {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-animation:nth-child(1) {
  transition-delay: 0.1s;
}

.stagger-animation:nth-child(2) {
  transition-delay: 0.2s;
}

.stagger-animation:nth-child(3) {
  transition-delay: 0.3s;
}

.stagger-animation:nth-child(4) {
  transition-delay: 0.4s;
}

.stagger-animation:nth-child(5) {
  transition-delay: 0.5s;
}

.stagger-animation:nth-child(6) {
  transition-delay: 0.6s;
}

.glow-effect {
  box-shadow: 0 0 20px rgba(255, 81, 47, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(255, 81, 47, 0.3);
  }

  to {
    box-shadow: 0 0 30px rgba(255, 81, 47, 0.6), 0 0 40px rgba(123, 15, 213, 0.3);
  }
}

.reveal-animation {
  position: relative;
  overflow: hidden;
}

.reveal-animation::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ff512f, transparent);
  transition: left 0.8s ease;
}

.reveal-animation.animate::before {
  left: 100%;
}

.socials > a {
  transition: transform 0.5s ease; /* Suaviza la animación */
}

.socials > a:hover {
  transform: scale(1.15);
}