/* =====================================================
   ANIMATIONS.CSS
   Responsável por: todas as animações do portfólio.

   Índice:
   1. Animação de digitação (typing) — hero-subtitle
   2. Fade In para cima — entrada de elementos
   3. Fade In lateral — entrada de colunas
   4. Section Reveal — seções ao aparecer na tela
   5. Glow Pulse — elementos com brilho pulsante
   ===================================================== */

/* ─────────────────────────────────────────────────────
   1. TYPING — efeito de cursor digitando
   ───────────────────────────────────────────────────── */

/* O subtítulo do hero ganha efeito de digitação */
.hero-subtitle {
  overflow: visible;
  white-space: normal;
}

.hero-subtitle-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--green);
  animation:
    typing 2.4s steps(20, end) 0.8s both,
    blinkCaret 0.75s step-end infinite;
}

/* Garante que em mobile o typing não quebre layout */
@media (max-width: 768px) {
  .hero-subtitle-text {
    white-space: normal;
    overflow: visible;
    border-right: none;
    animation: none;
  }
}

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

@keyframes blinkCaret {
  0%,
  100% {
    border-color: var(--green);
  }
  50% {
    border-color: transparent;
  }
}

/* ─────────────────────────────────────────────────────
   2. FADE IN UP — entrada suave vindo de baixo
   ───────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aplicação escalonada nos elementos do Hero */
.hero-greeting {
  animation: fadeInUp 0.7s ease 0.1s both;
}
.hero-title {
  animation: fadeInUp 0.7s ease 0.25s both;
}
.hero-desc {
  animation: fadeInUp 0.7s ease 0.55s both;
}
.hero-btns {
  animation: fadeInUp 0.7s ease 0.7s both;
}
.hero-social {
  animation: fadeInUp 0.7s ease 0.85s both;
}

/* Imagem do hero */
.hero-image-wrapper {
  animation: fadeInUp 0.9s ease 0.4s both;
}

/* ─────────────────────────────────────────────────────
   3. FADE IN LATERAL — entrada horizontal
   ───────────────────────────────────────────────────── */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Imagem do Sobre vem da esquerda */
.about-image-wrapper {
  animation: fadeInLeft 0.9s ease 0.2s both;
}
/* Texto do Sobre vem da direita */
.about-content {
  animation: fadeInRight 0.9s ease 0.4s both;
}

/* ─────────────────────────────────────────────────────
   4. SECTION REVEAL — seções com entrada suave
      (usa animation-timeline quando disponível,
       com fallback via delay para todos os navegadores)
   ───────────────────────────────────────────────────── */
@keyframes sectionReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards de projeto */
.project-card:nth-child(1) {
  animation: sectionReveal 0.6s ease 0.1s both;
}
.project-card:nth-child(2) {
  animation: sectionReveal 0.6s ease 0.22s both;
}
.project-card:nth-child(3) {
  animation: sectionReveal 0.6s ease 0.34s both;
}

/* Cards de interesse */
.interest-card:nth-child(1) {
  animation: sectionReveal 0.5s ease 0.1s both;
}
.interest-card:nth-child(2) {
  animation: sectionReveal 0.5s ease 0.18s both;
}
.interest-card:nth-child(3) {
  animation: sectionReveal 0.5s ease 0.26s both;
}
.interest-card:nth-child(4) {
  animation: sectionReveal 0.5s ease 0.34s both;
}
.interest-card:nth-child(5) {
  animation: sectionReveal 0.5s ease 0.42s both;
}
.interest-card:nth-child(6) {
  animation: sectionReveal 0.5s ease 0.5s both;
}

/* Cards de tecnologia */
.tech-card:nth-child(1) {
  animation: sectionReveal 0.5s ease 0.1s both;
}
.tech-card:nth-child(2) {
  animation: sectionReveal 0.5s ease 0.17s both;
}
.tech-card:nth-child(3) {
  animation: sectionReveal 0.5s ease 0.24s both;
}
.tech-card:nth-child(4) {
  animation: sectionReveal 0.5s ease 0.31s both;
}
.tech-card:nth-child(5) {
  animation: sectionReveal 0.5s ease 0.38s both;
}
.tech-card:nth-child(6) {
  animation: sectionReveal 0.5s ease 0.45s both;
}

/* ─────────────────────────────────────────────────────
   5. GLOW PULSE — brilho pulsante em elementos-chave
   ───────────────────────────────────────────────────── */
@keyframes glowPulse {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(59, 130, 246, 0.2),
      0 0 30px rgba(59, 130, 246, 0.08);
  }
  50% {
    box-shadow:
      0 0 24px rgba(59, 130, 246, 0.45),
      0 0 60px rgba(59, 130, 246, 0.2),
      0 0 100px rgba(59, 130, 246, 0.08);
  }
}

/* Badge do Hero pulsa suavemente */
.hero-badge {
  animation:
    float 3.2s ease-in-out infinite,
    glowPulse 3.5s ease-in-out infinite;
}

/* Linha decorativa das seções pisca suavemente */
@keyframes lineShimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.section-line {
  background: linear-gradient(
    90deg,
    var(--green-dark),
    var(--green-light),
    var(--green-dark)
  );
  background-size: 200% auto;
  animation: lineShimmer 3s linear infinite;
}
