/* ═══════════════════════════════════════════════════════════
   BRUNO RESENDE — PORTFÓLIO
   animations.css — Keyframes, transições e efeitos visuais
   ═══════════════════════════════════════════════════════════ */

/* ─── KEYFRAMES BASE ─────────────────────────────────────── */

/* Cursor piscando */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Pulso do badge dot */
@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 6px rgba(0, 255, 136, .5);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 14px rgba(0, 255, 136, .8);
  }
}

/* Scroll indicator */
@keyframes scroll-pulse {
  0%   { opacity: 1; transform: scaleY(1);   }
  50%  { opacity: 0.4; transform: scaleY(0.6); }
  100% { opacity: 1; transform: scaleY(1);   }
}

/* Glow da timeline */
@keyframes timeline-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 255, 136, .4); }
  50%       { box-shadow: 0 0 24px rgba(0, 255, 136, .8), 0 0 48px rgba(0, 255, 136, .3); }
}

/* Pulso das setas de workflow */
@keyframes wf-pulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 0.9; transform: translateY(3px); }
}

/* Fade-in geral */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide up */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */
@keyframes slide-left {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slide-right {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fluxo de linha de dados — movimento horizontal */
@keyframes data-flow {
  0%   { transform: translateX(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* Fluxo de dados vertical */
@keyframes data-flow-down {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(100%); opacity: 0; }
}

/* Rotação lenta — elementos decorativos */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Flutuação suave */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* Glow pulsante em bordas */
@keyframes border-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,255,0); }
  50%       { box-shadow: 0 0 0 4px rgba(0,212,255,.1), 0 0 24px rgba(0,212,255,.15); }
}

/* Shimmer de loading */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Scanline — efeito terminal */
@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Aparecer com blur */
@keyframes blur-in {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* Pipeline ETL — pacote de dados viajando */
@keyframes packet-travel {
  0%   { left: -8px;   opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { left: calc(100% + 8px); opacity: 0; }
}

/* Pulso radial */
@keyframes radial-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Typing cursor após texto */
@keyframes type-blink {
  0%, 100% { border-right-color: var(--accent); }
  50%       { border-right-color: transparent; }
}

/* ─── HERO — ANIMAÇÕES DE ENTRADA ────────────────────────── */

/* Aplicadas diretamente nos elementos do hero via JS ao carregar */
.hero-badge.is-visible    { animation: blur-in .8s var(--ease-out) both; }
.hero-name.is-visible     { animation: blur-in .9s .1s var(--ease-out) both; }
.hero-title.is-visible    { animation: slide-up .7s .2s var(--ease-out) both; }
.hero-description.is-visible { animation: fade-in .8s .35s both; }
.hero-actions.is-visible  { animation: slide-up .6s .5s var(--ease-out) both; }
.hero-stats.is-visible    { animation: fade-in .7s .65s both; }
.hero-pipeline.is-visible { animation: fade-in .8s .9s both; }

/* ─── NAV — ENTRADA ──────────────────────────────────────── */
.nav-header {
  animation: slide-up .5s var(--ease-out) both;
}

/* ─── PIPELINE VISUAL — PARTÍCULA VIAJANDO ───────────────── */
.etl-line {
  position: relative;
  overflow: hidden;
}

.etl-line::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -8px;
  width: 8px;
  height: 3px;
  background: var(--accent);
  border-radius: 99px;
  animation: packet-travel 2.8s ease-in-out infinite;
  box-shadow: 0 0 6px var(--accent);
}

/* Delay escalonado nas linhas do ETL */
.etl-connector:nth-child(2)  .etl-line::before { animation-delay: 0s; }
.etl-connector:nth-child(4)  .etl-line::before { animation-delay: .4s; }
.etl-connector:nth-child(6)  .etl-line::before { animation-delay: .8s; }
.etl-connector:nth-child(8)  .etl-line::before { animation-delay: 1.2s; }
.etl-connector:nth-child(10) .etl-line::before { animation-delay: 1.6s; }
.etl-connector:nth-child(12) .etl-line::before { animation-delay: 2.0s; }

/* ─── ARCH DIAGRAM — FLUXO VERTICAL ─────────────────────── */
.arch-flow-line {
  position: relative;
  overflow: hidden;
}

.arch-flow-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: data-flow-down 1.6s ease-in-out infinite;
  border-radius: 99px;
}

/* ─── CARDS — HOVER MICRO-INTERAÇÕES ─────────────────────── */
.card,
.tech-category,
.projeto-card,
.contato-card {
  will-change: transform;
}

/* Linha de acento no topo do card no hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  opacity: 0;
  transition: opacity .3s ease;
}

.card:hover::before { opacity: 1; }

.card--bigdata::before {
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
}

.card--cloud::before  { background: linear-gradient(90deg, transparent, #7dd3fc, transparent); }
.card--auto::before   { background: linear-gradient(90deg, transparent, #c4b5fd, transparent); }
.card--web::before    { background: linear-gradient(90deg, transparent, #fca5a5, transparent); }

/* Projeto card em destaque — borda animada */
.projeto-card--full::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% 200%;
  animation: gradient-border 4s linear infinite;
  z-index: -1;
  opacity: 0.4;
}

@keyframes gradient-border {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── TECH PILLS — HOVER ─────────────────────────────────── */
.tech-pill {
  position: relative;
  overflow: hidden;
}

.tech-pill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,.06), transparent);
  transform: translateX(-100%);
  transition: transform .4s var(--ease-out);
}

.tech-pill:hover::after {
  transform: translateX(100%);
}

/* ─── TIMELINE — PROGRESSÃO ANIMADA ─────────────────────── */
.timeline::before {
  background: linear-gradient(to bottom, var(--accent) 0%, var(--accent2) 60%, transparent 100%);
  animation: timeline-progress 3s ease-out both;
}

@keyframes timeline-progress {
  from { transform: scaleY(0); transform-origin: top; }
  to   { transform: scaleY(1); transform-origin: top; }
}

/* ─── WORKFLOW — SETAS PULSANTES ─────────────────────────── */
.wf-arrow {
  position: relative;
}

.wf-arrow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,212,255,.15);
  animation: radial-pulse 2s ease-out infinite;
}

/* ─── TERMINAL — EFEITO SCANLINE ─────────────────────────── */
.cta-terminal {
  position: relative;
  overflow: hidden;
}

.cta-terminal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,.3), transparent);
  animation: scanline 4s linear infinite;
  pointer-events: none;
  z-index: 2;
}

/* ─── HERO STATS — COUNTER SHIMMER ──────────────────────── */
.stat-number {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent2) 50%,
    var(--accent) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ─── BADGE DOT — RIPPLE ─────────────────────────────────── */
.badge-dot {
  position: relative;
}

.badge-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent2);
  opacity: 0;
  animation: radial-pulse 2s ease-out infinite;
}

/* ─── PIPE NODE — PULSO NO ATIVO ─────────────────────────── */
.pipe-node--active {
  animation: border-glow 2s ease-in-out infinite;
}

/* ─── ARQUITETURA — HOVER LAYER ──────────────────────────── */
.arch-layer {
  position: relative;
  overflow: hidden;
}

.arch-layer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity .4s;
}

.arch-layer:hover::before { opacity: 1; }

.arch-layer--analytics::before {
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
}

/* ─── SECTION HEADER — TAG SUBLINHADO ───────────────────── */
.section-tag {
  position: relative;
  display: inline-block;
}

.section-tag::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width .6s var(--ease-out);
}

.section-header.revealed .section-tag::after {
  width: 100%;
}

/* ─── NAV LINK — INDICADOR ATIVO ─────────────────────────── */
.nav-link.active {
  animation: fade-in .3s both;
}

/* ─── CONTATO CARD — ÍCONE BOUNCE ────────────────────────── */
.contato-card:hover .contato-icon {
  animation: float .6s ease-in-out;
}

/* ─── PROJETO CARD — SHINE ───────────────────────────────── */
.projeto-card {
  position: relative;
  overflow: hidden;
}

.projeto-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,.04) 50%,
    transparent 60%
  );
  transform: skewX(-15deg);
  transition: none;
  pointer-events: none;
}

.projeto-card:hover::after {
  animation: card-shine .6s ease forwards;
}

@keyframes card-shine {
  from { left: -75%; }
  to   { left: 125%; }
}

/* ─── HERO GRID — FADE RADIAL ────────────────────────────── */
.hero-grid {
  animation: fade-in 2s ease both;
}

/* ─── SOBRE — TEXTO HIGHLIGHT ────────────────────────────── */
.sobre-p--highlight {
  position: relative;
  overflow: hidden;
}

.sobre-p--highlight::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  animation: border-glow 2.5s ease-in-out infinite;
}

/* ─── SCROLL PROGRESS BAR ────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 200;
  width: 0%;
  transition: width .1s linear;
  box-shadow: 0 0 8px rgba(0,212,255,.5);
}

/* ─── PREFERS-REDUCED-MOTION ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .etl-line::before,
  .arch-flow-line::after,
  .badge-dot,
  .badge-dot::after,
  .pipe-node--active,
  .stat-number,
  .cta-terminal::after,
  .wf-arrow,
  .wf-arrow::after,
  .timeline-dot--glow,
  .scroll-line,
  .hero-badge,
  .hero-name,
  .hero-title,
  .hero-description,
  .hero-actions,
  .hero-stats,
  .hero-pipeline,
  .projeto-card--full::before,
  .timeline::before,
  #scroll-progress {
    animation: none !important;
    transition: none !important;
  }

  .stat-number {
    -webkit-text-fill-color: var(--accent);
    background: none;
  }
}
