/* ==========================================================================
   kraflex  |  animation.css
   Scroll reveals, hover motion, keyframes.
   All motion is disabled automatically for users who ask for reduced motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   SCROLL REVEAL
   Add  data-reveal  to any element. js/main.js adds .is-revealed when it
   scrolls into view. Add data-reveal-delay="1..6" to stagger siblings.
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="zoom"]  { transform: scale(0.94); }
[data-reveal="fade"]  { transform: none; }

[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }
[data-reveal-delay="5"] { transition-delay: 0.40s; }
[data-reveal-delay="6"] { transition-delay: 0.48s; }

/* If JavaScript is off, show everything immediately. */
.no-js [data-reveal] { opacity: 1; transform: none; }

/* On narrow screens a sideways reveal sticks 32px out past the edge while it
   waits to be scrolled into view, which widens the page. Slide up instead. */
@media (max-width: 767px) {
  [data-reveal="left"],
  [data-reveal="right"] { transform: translateY(24px); }
}

/* --------------------------------------------------------------------------
   KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes kf-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes kf-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes kf-slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes kf-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
@keyframes kf-spin {
  to { transform: rotate(360deg); }
}
@keyframes kf-sheen {
  from { transform: translateX(-120%) skewX(-18deg); }
  to   { transform: translateX(220%)  skewX(-18deg); }
}

/* Hero copy animates in on load, one item after another.
   There must be a delay here for EVERY child of .hero__content. Add a sixth
   item to the hero without adding a matching line below and it will animate
   with no delay at all - which means it arrives first, ahead of the headline. */
.hero__content > * { animation: kf-fade-up 0.85s var(--ease-out) both; }
.hero__content > *:nth-child(1) { animation-delay: 0.05s; }
.hero__content > *:nth-child(2) { animation-delay: 0.18s; }
.hero__content > *:nth-child(3) { animation-delay: 0.31s; }
.hero__content > *:nth-child(4) { animation-delay: 0.44s; }
.hero__content > *:nth-child(5) { animation-delay: 0.57s; }
.hero__content > *:nth-child(6) { animation-delay: 0.70s; }

/* Scroll cue at the bottom of the hero */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--sp-3);
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-pill);
  display: grid;
  justify-items: center;
  padding-top: 7px;
}
.scroll-cue::after {
  content: "";
  width: 4px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: kf-bob 1.7s var(--ease-soft) infinite;
}

/* Sheen sweep across primary buttons on hover */
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
.btn--primary:hover::after { animation: kf-sheen 0.75s var(--ease-out); }

/* Underline grow on nav links (desktop) */
@media (min-width: 1024px) {
  .nav-item > .nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 6px;
    width: 100%; height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-base) var(--ease-out);
  }
  .nav-item > .nav-link:hover::after,
  .nav-item > .nav-link[aria-current="page"]::after { transform: scaleX(1); }
}

/* Counter placeholder shimmer while it animates */
.stat__value.is-counting { opacity: 0.9; }

/* Loading spinner (form submit) */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: kf-spin 0.7s linear infinite;
}

/* --------------------------------------------------------------------------
   REDUCED MOTION - respect the OS setting
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .scroll-cue { display: none; }
}
