/* ============================================================
   CODING HARBOR — animations.css
   Keyframes, scroll-reveal system, reduced-motion safety net
============================================================ */

/* ---------- Keyframes ---------- */
@keyframes blob-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(46px, -34px) scale(1.09); }
  100% { transform: translate(-30px, 28px) scale(.96); }
}

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

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes ring-pulse {
  0%   { transform: scale(1);    opacity: .65; }
  100% { transform: scale(1.85); opacity: 0; }
}

@keyframes core-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.25); }
}

@keyframes particle-float {
  0%   { transform: translateY(0);      opacity: 0; }
  12%  { opacity: var(--po, .35); }
  88%  { opacity: var(--po, .35); }
  100% { transform: translateY(-110vh); opacity: 0; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes grad-shift {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Variant: settle in with a slight scale */
.reveal-scale { transform: translateY(30px) scale(.96); }

/* Staggered children inside card grids */
.services-grid  .reveal:nth-child(5n+2),
.portfolio-grid .reveal:nth-child(2n),
.stats-grid     .reveal:nth-child(2),
.blog-grid      .reveal:nth-child(2) { transition-delay: .12s; }

.services-grid  .reveal:nth-child(5n+3),
.stats-grid     .reveal:nth-child(3),
.blog-grid      .reveal:nth-child(3) { transition-delay: .24s; }

.services-grid  .reveal:nth-child(5n+4),
.stats-grid     .reveal:nth-child(4) { transition-delay: .36s; }

.services-grid  .reveal:nth-child(5n+5) { transition-delay: .48s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
    transition-delay: 0s !important;
  }

  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .comets, .particle { display: none; }
  .timeline::after { transition: none; }
}
