/* ============================================================
   PLANET HAULAGE SOLUTIONS - Animations
   Scroll reveals, counters, parallax, keyframes
   ============================================================ */

/* ─── SCROLL REVEALS ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children (add .stagger to the parent) */
.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}

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

/* ─── HERO KEN BURNS ──────────────────────────────────────── */
@keyframes ken-burns {
  0%   { transform: scale(1) translateY(0); }
  100% { transform: scale(1.12) translateY(-1.5%); }
}

.hero__bg {
  animation: ken-burns 18s ease-out forwards;
}

/* ─── TYPEWRITER ──────────────────────────────────────────── */
.typewriter__caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -0.12em;
  /* Soft, slow pulse instead of a hard on/off blink */
  animation: caret-blink 1.6s ease-in-out infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ─── FLOATING / HOVER MOTIONS ────────────────────────────── */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.float-y {
  animation: float-y 5s ease-in-out infinite;
}

/* ─── LOADING / SHIMMER (image placeholders) ──────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.img-skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s linear infinite;
}

/* ─── ACCENT PULSE DOT (live indicator) ───────────────────── */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 hsla(145,55%,42%,0.5); }
  70%      { box-shadow: 0 0 0 8px hsla(145,55%,42%,0); }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-light);
  animation: pulse-dot 2s ease-out infinite;
}

/* ─── PARALLAX (background-attachment fallback) ───────────── */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (max-width: 768px) {
  .parallax {
    background-attachment: scroll;
  }
}

/* ─── REDUCED MOTION ──────────────────────────────────────── */
@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-left,
  .reveal-right,
  .reveal-scale,
  .stagger > * {
    opacity: 1;
    transform: none;
  }
}
