/* ============================================================
   ANIMATIONS.CSS — Dr. Rauph Batista Guimarães
   Partículas, transições, efeitos visuais
   ============================================================ */

/* ==================== HERO PARTICLES ==================== */
.particles-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: float-particle linear infinite;
}

/* Generate particles with CSS (sizes and positions varied) */
.particle:nth-child(1)  { width:3px;height:3px; left:5%;  top:20%; animation-duration:18s; animation-delay:0s; }
.particle:nth-child(2)  { width:2px;height:2px; left:10%; top:80%; animation-duration:22s; animation-delay:-4s; }
.particle:nth-child(3)  { width:4px;height:4px; left:15%; top:40%; animation-duration:16s; animation-delay:-8s; }
.particle:nth-child(4)  { width:2px;height:2px; left:20%; top:60%; animation-duration:25s; animation-delay:-2s; }
.particle:nth-child(5)  { width:3px;height:3px; left:25%; top:30%; animation-duration:20s; animation-delay:-6s; }
.particle:nth-child(6)  { width:2px;height:2px; left:30%; top:70%; animation-duration:18s; animation-delay:-10s; }
.particle:nth-child(7)  { width:5px;height:5px; left:35%; top:15%; animation-duration:24s; animation-delay:-3s; }
.particle:nth-child(8)  { width:2px;height:2px; left:40%; top:85%; animation-duration:19s; animation-delay:-7s; }
.particle:nth-child(9)  { width:3px;height:3px; left:45%; top:45%; animation-duration:21s; animation-delay:-1s; }
.particle:nth-child(10) { width:2px;height:2px; left:50%; top:25%; animation-duration:17s; animation-delay:-5s; }
.particle:nth-child(11) { width:4px;height:4px; left:55%; top:65%; animation-duration:23s; animation-delay:-9s; }
.particle:nth-child(12) { width:2px;height:2px; left:60%; top:35%; animation-duration:20s; animation-delay:-2s; }
.particle:nth-child(13) { width:3px;height:3px; left:65%; top:75%; animation-duration:18s; animation-delay:-6s; }
.particle:nth-child(14) { width:2px;height:2px; left:70%; top:10%; animation-duration:26s; animation-delay:-4s; }
.particle:nth-child(15) { width:3px;height:3px; left:75%; top:55%; animation-duration:15s; animation-delay:-8s; }
.particle:nth-child(16) { width:2px;height:2px; left:80%; top:90%; animation-duration:22s; animation-delay:-3s; }
.particle:nth-child(17) { width:4px;height:4px; left:85%; top:20%; animation-duration:19s; animation-delay:-7s; }
.particle:nth-child(18) { width:2px;height:2px; left:90%; top:50%; animation-duration:24s; animation-delay:-1s; }
.particle:nth-child(19) { width:3px;height:3px; left:95%; top:75%; animation-duration:17s; animation-delay:-5s; }
.particle:nth-child(20) { width:2px;height:2px; left:8%;  top:95%; animation-duration:21s; animation-delay:-9s; }

/* Green-tinted particles (synaptic nodes) */
.particle:nth-child(3n) {
  background: rgba(82, 183, 136, 0.5);
  box-shadow: 0 0 6px rgba(82, 183, 136, 0.4);
}

/* Blue-tinted particles */
.particle:nth-child(5n) {
  background: rgba(72, 202, 228, 0.4);
  box-shadow: 0 0 6px rgba(72, 202, 228, 0.3);
}

@keyframes float-particle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translate(var(--tx, 80px), var(--ty, -120px)) scale(0.5);
    opacity: 0;
  }
}

/* Override individual particle directions */
.particle:nth-child(odd)  { --tx: 60px;  --ty: -100px; }
.particle:nth-child(even) { --tx: -60px; --ty: -120px; }
.particle:nth-child(3n)   { --tx: 30px;  --ty: -140px; }
.particle:nth-child(4n)   { --tx: -40px; --ty: -80px; }

/* ==================== SYNAPSE LINES ==================== */
.synapse-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.synapse-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(82, 183, 136, 0.2), transparent);
  animation: synapse-pulse 4s ease-in-out infinite;
}

.synapse-line:nth-child(1) { width: 200px; left: 10%; top: 30%; animation-delay: 0s; }
.synapse-line:nth-child(2) { width: 150px; left: 40%; top: 60%; animation-delay: 1.5s; transform: rotate(-30deg); }
.synapse-line:nth-child(3) { width: 180px; left: 65%; top: 25%; animation-delay: 3s; transform: rotate(20deg); }
.synapse-line:nth-child(4) { width: 120px; left: 75%; top: 70%; animation-delay: 0.8s; transform: rotate(-15deg); }

@keyframes synapse-pulse {
  0%, 100% { opacity: 0; transform: scaleX(0); }
  50% { opacity: 1; transform: scaleX(1); }
}

/* ==================== FADE IN (scroll) ==================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Delays for staggered children */
.stagger > *:nth-child(1) { transition-delay: 0.05s; }
.stagger > *:nth-child(2) { transition-delay: 0.15s; }
.stagger > *:nth-child(3) { transition-delay: 0.25s; }
.stagger > *:nth-child(4) { transition-delay: 0.35s; }
.stagger > *:nth-child(5) { transition-delay: 0.45s; }
.stagger > *:nth-child(6) { transition-delay: 0.55s; }

/* ==================== COUNTER ANIMATION ==================== */
.counter-value {
  display: inline-block;
  transition: all 0.1s linear;
}

/* ==================== HERO CONTENT ENTRANCE ==================== */
@keyframes hero-enter-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-enter-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.hero-label  { animation: hero-enter-up 0.7s ease 0.1s both; }
.hero-title  { animation: hero-enter-up 0.7s ease 0.2s both; }
.hero-tagline { animation: hero-enter-up 0.7s ease 0.3s both; }
.hero-ctas   { animation: hero-enter-up 0.7s ease 0.45s both; }
.hero-image  { animation: hero-enter-right 0.8s ease 0.3s both; }

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== GLOW EFFECT ==================== */
.glow-green {
  box-shadow: 0 0 30px rgba(82, 183, 136, 0.3);
}

.glow-blue {
  box-shadow: 0 0 30px rgba(72, 202, 228, 0.3);
}

/* ==================== PROFILE FRAME ==================== */
.profile-frame {
  position: relative;
  display: inline-block;
}

.profile-frame::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--radius-lg) + 6px);
  background: var(--grad-accent);
  z-index: -1;
  animation: frame-rotate 8s linear infinite;
}

@keyframes frame-rotate {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(30deg); }
  100% { filter: hue-rotate(0deg); }
}

/* Award badge on profile */
.profile-badge {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dourado-titulo);
  color: var(--branco-puro);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.4);
  letter-spacing: 0.05em;
}

/* ==================== FLOATING ELEMENTS ==================== */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.float-anim {
  animation: float-y 4s ease-in-out infinite;
}

/* ==================== HOVER LIFT ==================== */
.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.13);
}

/* ==================== PULSE RING ==================== */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(82, 183, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0); }
}

.pulse-ring {
  animation: pulse-ring 2.5s infinite;
}

/* ==================== SECTION TRANSITION ==================== */
.wave-bottom {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  overflow: hidden;
  line-height: 0;
}

.wave-bottom svg {
  display: block;
  width: 100%;
}

/* ==================== LOADING SKELETON ==================== */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius);
}
