/* ==========================================================================
   Manuel Angeles — Portfolio · Animations CSS
   Keyframes para shimmer, glow, pulse-on-hover
   ========================================================================== */

/* Shimmer para CTAs */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.btn-primary {
  background-size: 200% 100%;
  background-image: linear-gradient(
    135deg,
    #6366f1 0%,
    #22d3ee 50%,
    #a855f7 100%
  );
}

.btn-primary:hover {
  background-image: linear-gradient(
    135deg,
    #4f46e5 0%,
    #06b6d4 50%,
    #9333ea 100%
  );
}

/* Subtle float for primary CTA */
@keyframes glow {
  0%, 100% { box-shadow: 0 8px 30px rgba(99,102,241,0.35); }
  50% { box-shadow: 0 8px 50px rgba(99,102,241,0.6), 0 0 80px rgba(168,85,247,0.25); }
}

.btn-primary { animation: glow 4s ease-in-out infinite; }
.btn-primary:hover { animation: none; }

/* Gradient text con animación lenta */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.gradient {
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

/* Subtle text glow on hover for nav-links */
.nav-links a:not(.nav-cta):hover {
  text-shadow: 0 0 12px rgba(99,102,241,0.5);
}

/* Project cards subtle gradient ring on hover */
@keyframes ring-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Stagger reveal for project cards */
.projects-grid .project-card:nth-child(1) { transition-delay: 0s; }
.projects-grid .project-card:nth-child(2) { transition-delay: 0.1s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.2s; }
.projects-grid .project-card:nth-child(4) { transition-delay: 0.05s; }
.projects-grid .project-card:nth-child(5) { transition-delay: 0.15s; }
.projects-grid .project-card:nth-child(6) { transition-delay: 0.25s; }

/* Skills grid stagger */
.skills-grid .skill-group:nth-child(1) { transition-delay: 0s; }
.skills-grid .skill-group:nth-child(2) { transition-delay: 0.05s; }
.skills-grid .skill-group:nth-child(3) { transition-delay: 0.1s; }
.skills-grid .skill-group:nth-child(4) { transition-delay: 0.15s; }
.skills-grid .skill-group:nth-child(5) { transition-delay: 0.2s; }

/* Smooth scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 5px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: #818cf8; }

/* Selection color */
::selection {
  background: rgba(99,102,241,0.35);
  color: var(--text-0);
}

/* hero-card slide-in subtle pulse on number counters */
.hero-metric-value {
  animation: pulse-fade 0.6s ease;
}
@keyframes pulse-fade {
  0% { opacity: 0.4; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Active nav link visual */
.nav-links a.active:not(.nav-cta) {
  color: var(--text-0);
  background: rgba(255,255,255,0.06);
  position: relative;
}
.nav-links a.active:not(.nav-cta)::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 14px; right: 14px;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 1px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bg-orbs::before, .bg-orbs::after, .bg-orbs .orb-3,
  .hero-float-element { animation: none !important; }
  .typed-cursor { animation: none; }
}
