/* ============================================================
   MOTION POLISH — Emil Kowalski design-engineering pass.
   Scroll reveals · press feedback · directional CTAs · hover craft.
   Loaded LAST. Uses the shared --ease-out / --transition tokens.

   SAFETY: reveal-hiding is gated behind BOTH the `.js` class (set by the
   inline <head> script) AND @media (prefers-reduced-motion: no-preference).
   So with JavaScript off/blocked OR reduced-motion on, .reveal content is
   never hidden — everything is visible by default (no blank-page trap).
   ============================================================ */

/* ---- Scroll reveal (hidden only when JS on + motion welcome) ---- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal,
  .js .reveal-group > * {
    opacity: 0;
    transform: translateY(40px) scale(.985);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  }
  .js .reveal.in,
  .js .reveal-group.in > * { opacity: 1; transform: none; }

  /* tight stagger for grouped children (Emil: 30-80ms between items) */
  .js .reveal-group.in > *:nth-child(1) { transition-delay: 0ms; }
  .js .reveal-group.in > *:nth-child(2) { transition-delay: 60ms; }
  .js .reveal-group.in > *:nth-child(3) { transition-delay: 120ms; }
  .js .reveal-group.in > *:nth-child(4) { transition-delay: 180ms; }
  .js .reveal-group.in > *:nth-child(5) { transition-delay: 240ms; }
  .js .reveal-group.in > *:nth-child(6) { transition-delay: 300ms; }
}

/* ---- Press feedback: every pressable confirms the tap.
   These selectors consume var(--transition) (now transform-aware), so the
   scale animates; scale() also scales the element's children. ---- */
.hs-cta:active, .hs-link:active, .hs-shot:active, .hs-more:active,
.btn:active, .btn-primary:active, .btn-outline:active, .nav-cta:active,
.mobile-cta:active, .post-card:active, .service-card:active,
.service-img-card:active, .chat-fab:active, .scroll-top:active,
.spanel-cta:active, .chat-send:active, .hamburger:active,
.chat-dot-close:active, .pricing-btn:active, .select-btn:active,
.next-btn:active { transform: scale(.97); }

/* Hero CTAs define their hover lift in an inline <style> that loads AFTER
   motion.css, so a plain :active ties and loses. Raise specificity with
   :hover:active (3 classes beats 2) and keep each lift + add the press scale.
   The plain :active rules above still cover touch/keyboard (no :hover). */
@media (hover: hover) and (pointer: fine) {
  .hs-cta:hover:active  { transform: translateY(-2px) scale(.97); }
  .hs-more:hover:active { transform: translateY(-3px) scale(.97); }
  .hs-shot:hover:active { transform: translateY(-5px) scale(.97); }
}

/* ---- Directional icon travel + proof-thumbnail lift (fine pointers only) ---- */
@media (hover: hover) and (pointer: fine) {
  .hs-cta span[aria-hidden], .hs-link span[aria-hidden], .hs-more span[aria-hidden] {
    display: inline-block;
    transition: transform .18s var(--ease-out);
  }
  .hs-cta:hover span[aria-hidden],
  .hs-link:hover span[aria-hidden],
  .hs-more:hover span[aria-hidden] { transform: translateX(4px); }

  /* proof thumbnails: lift + inner image zoom */
  .hs-shot { transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out), border-color .28s var(--ease-out); overflow: hidden; }
  .hs-shot img { transition: transform .5s var(--ease-out); }
  .hs-shot:hover { transform: translateY(-5px); box-shadow: 0 22px 48px -22px rgba(0,0,0,.6); }
  .hs-shot:hover img { transform: scale(1.04); }

  /* cursor-tracked gold spotlight on cards — the "it's alive" moment.
     --mx/--my are set per-card by js/main.js on pointermove. */
  .card, .value-card, .service-card { position: relative; isolation: isolate; }
  .card::after, .value-card::after, .service-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    pointer-events: none;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(242,176,74,.16), transparent 62%);
    opacity: 0; transition: opacity .35s var(--ease-out);
  }
  .card:hover::after, .value-card:hover::after, .service-card:hover::after { opacity: 1; }
  /* punchier lift on hover */
  .card:hover, .value-card:hover { transform: translateY(-5px); }
}

/* ---- Touch: neutralize hover-transforms so a tap never leaves a stuck lift ---- */
@media (hover: none) {
  .post-card:hover, .chat-fab:hover, .hs-shot:hover { transform: none; }
  .service-img-card:hover img { transform: none; }
}

/* ---- Reduced motion: strip movement, keep opacity/colour ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-group > * { opacity: 1 !important; transform: none !important; }
  .hs-cta:active, .hs-link:active, .hs-shot:active, .hs-more:active, .btn:active,
  .nav-cta:active, .mobile-cta:active, .post-card:active, .service-card:active,
  .service-img-card:active, .chat-fab:active, .scroll-top:active { transform: none; }
  /* keep the spotlight (opacity), drop the movement */
  .card:hover, .value-card:hover, .hs-shot:hover { transform: none; }
  .hs-shot:hover img { transform: none; }
}
