/* ==========================================================================
   Integrated Life Safety Systems
   animations.css
   Keyframes and animation utility classes. Kept separate so the animation
   system can be tuned without touching layout.
   ========================================================================== */

/* --- Keyframes ------------------------------------------------------------ */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}
@keyframes pulseRing {
  0%   { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes scrollHint {
  0%, 100% { transform: scaleY(1); opacity: 0.8; }
  50%      { transform: scaleY(0.3); opacity: 0.3; }
}
@keyframes trackPulse {
  0%   { left: 0; }
  100% { left: calc(100% - 80px); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.03); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes dash {
  to { stroke-dashoffset: 0; }
}
@keyframes ping {
  75%, 100% { transform: scale(2.4); opacity: 0; }
}

/* --- Hero pulse dot ------------------------------------------------------- */
.hero-pill .pulse { animation: pulse 2s ease-in-out infinite; }

/* --- Scroll hint bar ------------------------------------------------------ */
.scroll-hint .bar {
  width: 1px; height: 28px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  transform-origin: top center;
  animation: scrollHint 2.5s ease-in-out infinite;
}

/* --- Centered hero scroll indicator dot travel --------------------------- */
@keyframes scrollDotTravel {
  0%   { top: -10px; opacity: 0; }
  20%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 56px;  opacity: 0; }
}
.hero-scroll-dot {
  animation: scrollDotTravel 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* --- Pipeline track pulse ------------------------------------------------- */
.pipeline-track { position: absolute; }
.pipeline-track::after {
  content: ""; position: absolute; left: 0; top: -1px;
  width: 80px; height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  filter: blur(2px);
  animation: trackPulse 5s linear infinite;
}
.pstage .pdot::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: 50%; border: 2px solid var(--accent);
  opacity: 0;
}
.pstage.in-view .pdot::after {
  animation: pulseRing 1.6s ease-out 0.3s;
}

/* --- Reveal on scroll ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; }
.reveal-delay-4 { transition-delay: 0.40s; }
.reveal-delay-5 { transition-delay: 0.50s; }

/* Reveal variants */
.reveal.from-left {
  transform: translateX(-32px);
}
.reveal.from-left.in {
  transform: translateX(0);
}
.reveal.from-right {
  transform: translateX(32px);
}
.reveal.from-right.in {
  transform: translateX(0);
}
.reveal.scale-in {
  transform: scale(0.96);
}
.reveal.scale-in.in {
  transform: scale(1);
}

/* --- Title char reveal ---------------------------------------------------- */
/* Used when a headline is split into spans by JS for per-character entrance. */
.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) rotateX(-12deg);
  transform-origin: bottom center;
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.char.in {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* --- Count-up number pop -------------------------------------------------- */
.count-up {
  display: inline-block;
  transition: transform 0.6s var(--ease-spring);
}
.count-up.counting {
  transform: scale(1.02);
}

/* --- Button shimmer (optional hover) -------------------------------------- */
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.btn-primary:hover::before {
  opacity: 1;
  animation: shimmer 1.1s var(--ease-out);
}

/* --- Hero title cursor parallax hint -------------------------------------- */
h1.hero-title {
  transition: transform 0.6s var(--ease-out);
}

/* --- Autonomous visual subtle float on hover ------------------------------ */
.autonomous-visual { transition: transform 0.6s var(--ease-out); }
.autonomous-visual:hover { transform: translateY(-6px); }

/* --- Logo breathing (nav only, subtle) ------------------------------------ */
.nav .logo-img {
  animation: breathe 5.5s ease-in-out infinite;
}

/* --- Statement line cascade ---------------------------------------------- */
.statement-head .line {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1s var(--ease-out),
    transform 1s var(--ease-out);
}
.statement-head .line.in {
  opacity: 1;
  transform: translateY(0);
}

/* --- Animated SVG lines (capability visuals) ------------------------------ */
.draw-line {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
}
.in-view .draw-line {
  animation: dash 1.6s var(--ease-out) forwards 0.2s;
}

/* --- Nav link underline handled in main.css ------------------------------- */

/* --- Reduced motion overrides -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal.in,
  .char, .char.in,
  .statement-head .line, .statement-head .line.in {
    opacity: 1 !important;
    transform: none !important;
  }
  .pipeline-track::after,
  .nav .logo-img,
  .hero-pill .pulse,
  .scroll-hint .bar {
    animation: none !important;
  }
}
