/* ========================================
   ANIMAÇÕES OTIMIZADAS PARA PERFORMANCE
   ======================================== */

/* Estado inicial */
.animate-element {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
  transition-delay: var(--animation-delay, 0s);
  will-change: opacity, transform;
}

/* Estado final (quando entra em tela) */
.animate-in {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Variações sutis */
.fade-up   { transform: translateY(30px); }
.fade-left { transform: translateX(-30px); }
.fade-right{ transform: translateX(30px); }
.scale-in  { transform: scale(0.95); }

.fade-up.animate-in,
.fade-left.animate-in,
.fade-right.animate-in,
.scale-in.animate-in {
  transform: none;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero h1 {
  opacity: 0;
  transform: translateY(-30px);
  animation: heroFadeIn 0.9s ease-out 0.2s forwards;
}

.hero p {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 1s ease-out 0.5s forwards;
}

.btns {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 1s ease-out 0.8s forwards;
}

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   INTERAÇÕES SUAVES
   ======================================== */

.card-projeto-home,
.card-arte-portfolio,
.submit-btn {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-projeto-home:hover,
.submit-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* ========================================
   FORMULÁRIOS
   ======================================== */

.contact-form .form-group {
  opacity: 0;
  transform: translateY(15px);
  animation: formFieldIn 0.5s ease-out forwards;
}

.contact-form .form-group:nth-child(1) { animation-delay: 0.1s; }
.contact-form .form-group:nth-child(2) { animation-delay: 0.2s; }
.contact-form .form-group:nth-child(3) { animation-delay: 0.3s; }
.contact-form .form-submit            { animation-delay: 0.4s; }

@keyframes formFieldIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   LOADING E CURSOR
   ======================================== */

.submit-btn.loading {
  pointer-events: none;
}

.submit-btn.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Cursor piscando do typing */
#typed-text::after {
  content: '|';
  margin-left: 4px;
  opacity: 1;
  animation: blink 0.8s steps(2, start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ========================================
   MOVIMENTO REDUZIDO / MOBILE
   ======================================== */

@media (max-width: 768px), (prefers-reduced-motion: reduce) {
  .animate-element,
  .hero h1,
  .hero p,
  .btns,
  .contact-form .form-group {
    animation: none !important;
    transition: opacity 0.3s ease !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
