/* ============================================================
   ANIMATIONS — Ricardo Souza Portfolio
   ============================================================ */

/* ── Keyframes ──────────────────────────────────────────────── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); }
  50%       { box-shadow: 0 0 40px rgba(0, 212, 255, 0.5), 0 0 80px rgba(124, 58, 237, 0.2); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

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

@keyframes orbit {
  from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

@keyframes bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes scroll-down {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ── Scroll Reveal — Initial State ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.reveal-left {
  transform: translateX(-50px);
}

.reveal.reveal-right {
  transform: translateX(50px);
}

.reveal.reveal-scale {
  transform: scale(0.85);
  opacity: 0;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Staggered Children ─────────────────────────────────────── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children.is-visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children.is-visible > *:nth-child(8) { transition-delay: 0.54s; }

.stagger-children.is-visible > * {
  opacity: 1;
  transform: none;
}

/* ── Utility Animation Classes ──────────────────────────────── */
.animate-float        { animation: float 4s ease-in-out infinite; }
.animate-pulse-glow   { animation: pulse-glow 3s ease-in-out infinite; }
.animate-rotate       { animation: rotate 12s linear infinite; }
.animate-gradient     {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* ── Page Load Hero Animations ──────────────────────────────── */
.hero-tag     { animation: fadeInDown 0.6s ease 0.1s both; }
.hero-title   { animation: fadeInUp 0.8s ease 0.2s both; }
.hero-sub     { animation: fadeInUp 0.8s ease 0.4s both; }
.hero-ctas    { animation: fadeInUp 0.8s ease 0.55s both; }
.hero-stats   { animation: fadeInUp 0.8s ease 0.7s both; }
.hero-scroll  { animation: fadeIn 1s ease 1.2s both; }

/* ── Navbar Scroll Effect ───────────────────────────────────── */
.navbar {
  transition: background var(--transition-base),
              box-shadow var(--transition-base),
              backdrop-filter var(--transition-base);
}

.navbar.scrolled {
  background: rgba(8, 13, 24, 0.85) !important;
  backdrop-filter: blur(24px) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06),
              0 4px 20px rgba(0,0,0,0.4);
}

/* ── Hover micro-interactions ───────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-glow {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.hover-glow:hover {
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-3px);
}

/* ── Shimmer Loading ────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.1) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% auto;
  animation: shimmer 2s linear infinite;
}

/* ── Counter Animation ──────────────────────────────────────── */
.count-up {
  display: inline-block;
  transition: transform 0.3s;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  animation: fadeIn 0.25s ease both;
}

.modal-content {
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
