/* ═══════════════════════════════════════════════════════════════
   Scroll Reveal Animations — Hostaccent
   Usage:
     data-reveal="fade-up|fade-left|fade-right|zoom-in|fade-in"
     data-reveal-delay="0.15"   (seconds, overrides nth-child stagger)
     data-reveal-group          (on parent — staggers direct children)
     data-count-to="99"         (counter animation)
     data-count-suffix="%"      (optional suffix for counter)
   ═══════════════════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────────────────────── */
@keyframes ha-reveal-up {
  from { opacity: 0; transform: translateY(44px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes ha-reveal-left {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0);    }
}
@keyframes ha-reveal-right {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0);     }
}
@keyframes ha-reveal-zoom {
  from { opacity: 0; transform: scale(0.86) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes ha-reveal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ha-reveal-slide {
  from { opacity: 0; transform: translateY(80px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Base hidden state (only when reduced-motion is OK) ────────── */
@media (prefers-reduced-motion: no-preference) {
  /* Gated on `html.ha-reveal-armed`, which the reveal script adds just before
     it starts observing. This file is render-blocking while that script is
     not, so an ungated hidden state leaves content blank for the whole gap —
     the blank blocks that showed up on a cold load and vanished on reload.
     The revealed states below animate, and animations outrank this rule. */
  html.ha-reveal-armed [data-reveal] {
    opacity: 0;
  }

  /* ── Revealed states ─────────────────────────────────────────── */
  [data-reveal].is-revealed,
  [data-reveal="fade-up"].is-revealed {
    animation: ha-reveal-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  [data-reveal="fade-left"].is-revealed {
    animation: ha-reveal-left 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  [data-reveal="fade-right"].is-revealed {
    animation: ha-reveal-right 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  [data-reveal="zoom-in"].is-revealed {
    animation: ha-reveal-zoom 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  [data-reveal="fade-in"].is-revealed {
    animation: ha-reveal-fade 0.65s ease both;
  }

  [data-reveal="slide-up"].is-revealed {
    animation: ha-reveal-slide 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  /* ── Stagger delays for group children ───────────────────────── */
  [data-reveal-group] > [data-reveal]:nth-child(1).is-revealed  { animation-delay: 0.04s; }
  [data-reveal-group] > [data-reveal]:nth-child(2).is-revealed  { animation-delay: 0.12s; }
  [data-reveal-group] > [data-reveal]:nth-child(3).is-revealed  { animation-delay: 0.20s; }
  [data-reveal-group] > [data-reveal]:nth-child(4).is-revealed  { animation-delay: 0.28s; }
  [data-reveal-group] > [data-reveal]:nth-child(5).is-revealed  { animation-delay: 0.36s; }
  [data-reveal-group] > [data-reveal]:nth-child(6).is-revealed  { animation-delay: 0.44s; }
  [data-reveal-group] > [data-reveal]:nth-child(7).is-revealed  { animation-delay: 0.52s; }
  [data-reveal-group] > [data-reveal]:nth-child(8).is-revealed  { animation-delay: 0.60s; }
  [data-reveal-group] > [data-reveal]:nth-child(9).is-revealed  { animation-delay: 0.68s; }
  [data-reveal-group] > [data-reveal]:nth-child(10).is-revealed { animation-delay: 0.76s; }
}

/* ── Counter number style ─────────────────────────────────────── */
[data-count-to] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── Floating server particles background (decorative) ─────────── */
.ha-anim-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

@keyframes ha-float-dot {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0.18; }
  50%  { transform: translateY(-22px) rotate(180deg); opacity: 0.32; }
  100% { transform: translateY(0) rotate(360deg); opacity: 0.18; }
}

.ha-anim-dot {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  animation: ha-float-dot linear infinite;
}

/* ── Pulse ring (for feature icons on hover/scroll) ───────────── */
@keyframes ha-pulse-ring {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.65); opacity: 0;   }
}

.ha-has-pulse {
  position: relative;
}

.ha-has-pulse::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid currentColor;
  animation: ha-pulse-ring 1.8s ease-out infinite;
  pointer-events: none;
}

/* ── Gradient text shimmer ────────────────────────────────────── */
@keyframes ha-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.ha-text-shimmer {
  background: linear-gradient(
    90deg,
    #7c3aed 0%,
    #a855f7 25%,
    #06b6d4 50%,
    #a855f7 75%,
    #7c3aed 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: ha-shimmer 4s linear infinite;
}

/* Dark mode: shimmer stays vivid */
body.dark-mode .ha-text-shimmer {
  background-image: linear-gradient(
    90deg,
    #a78bfa 0%,
    #c4b5fd 25%,
    #38bdf8 50%,
    #c4b5fd 75%,
    #a78bfa 100%
  );
}
