/* Hoot v2 motion styles (owner: motion). Pairs with /assets/v2/motion.js; attributes are documented there.
   Every hidden start state is scoped to html.motion-ready, so JS off and html.motion-off show everything.
   Reveals use the individual translate / scale properties, so they never fight an element's own
   transform (hover lifts, sticker tilts) and only borrow its transition list until .h-rv-done. */

@property --h-rd { syntax: "<time>"; inherits: false; initial-value: 0ms; }

:root { --h-rv-y: 24px; --h-rv-x: 32px; }
@media (max-width: 719px) { :root { --h-rv-y: 16px; --h-rv-x: 16px; } }

/* ---------- Reveal + stagger ---------- */
html.motion-ready [data-reveal]:not(.h-rv-done),
html.motion-ready [data-stagger]:not(.h-rv-done) > * {
  transition:
    opacity var(--h-dur-3, 650ms) var(--h-ease-out, ease-out) var(--h-rd, 0ms),
    translate var(--h-dur-3, 650ms) var(--h-ease-out, ease-out) var(--h-rd, 0ms),
    scale var(--h-dur-3, 650ms) var(--h-ease-out, ease-out) var(--h-rd, 0ms);
}
html.motion-ready [data-reveal]:not(.is-in),
html.motion-ready [data-stagger]:not(.is-in) > * { opacity: 0; translate: 0 var(--h-rv-y); }

html.motion-ready :is([data-reveal=""], [data-reveal="fade"]):not(.is-in),
html.motion-ready [data-stagger="fade"]:not(.is-in) > * { translate: none; }

html.motion-ready [data-reveal="scale"]:not(.is-in),
html.motion-ready [data-stagger="scale"]:not(.is-in) > * { translate: none; scale: .94; }

html.motion-ready [data-reveal="left"]:not(.is-in),
html.motion-ready [data-stagger="left"]:not(.is-in) > * { translate: calc(var(--h-rv-x) * -1) 0; }

html.motion-ready [data-reveal="right"]:not(.is-in),
html.motion-ready [data-stagger="right"]:not(.is-in) > * { translate: var(--h-rv-x) 0; }

/* lift: movement only, never an opacity change (safe for the owl) */
html.motion-ready [data-reveal="lift"]:not(.is-in),
html.motion-ready [data-stagger="lift"]:not(.is-in) > * { opacity: 1; }
/* the owl is brand art: any reveal wrapper or stagger child that holds an owl moves but never fades */
html.motion-ready [data-reveal]:not(.is-in):has(.hm-owl, svg.h-owl, .owl-inline),
html.motion-ready [data-stagger]:not(.is-in) > :is(.hm-owl, svg.h-owl, .owl-inline, :has(.hm-owl, svg.h-owl, .owl-inline)) { opacity: 1; }

/* ---------- Page-load entrance (pure CSS, ends visible even if JS stalls) ---------- */
@keyframes h-enter-up    { from { opacity: 0; translate: 0 18px; } }
@keyframes h-enter-down  { from { opacity: 0; translate: 0 -14px; } }
@keyframes h-enter-fade  { from { opacity: 0; } }
@keyframes h-enter-scale { from { opacity: 0; scale: .96; } }
html.motion-ready [data-enter] { animation: h-enter-up var(--h-dur-4, 950ms) var(--h-ease-out, ease-out) var(--h-enter-delay, 0ms) backwards; }
html.motion-ready [data-enter="down"]  { animation-name: h-enter-down; }
html.motion-ready [data-enter="fade"]  { animation-name: h-enter-fade; }
html.motion-ready [data-enter="scale"] { animation-name: h-enter-scale; }

/* ---------- Scroll progress bar (injected by motion.js) ---------- */
.h-progress {
  position: fixed; z-index: calc(var(--h-z-nav, 50) + 1); top: 0; left: 0;
  width: 100%; height: 3px; pointer-events: none;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--h-blue, #94a9ff) 0%, var(--h-sky, #7ccbf5) 22%, var(--h-mint, #82ddd1) 42%, var(--h-leaf, #a6e08c) 58%, var(--h-honey, #ffc65c) 76%, var(--h-apricot, #f6b98e) 90%, var(--h-ember, #ff9473) 100%);
  box-shadow: 0 0 12px rgba(148, 169, 255, .45);
  border-radius: 0 3px 3px 0;
  will-change: transform;
}

/* ---------- Pointer glow (data-glow; .h-card--interactive has its own in base.css) ---------- */
:where(body.v2 [data-glow]) { position: relative; isolation: isolate; }
.h-glow-layer {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--h-mx, 50%) var(--h-my, 0%), rgb(var(--h-accent-rgb, 148 169 255) / .18), transparent 62%);
  opacity: 0;
  transition: opacity var(--h-dur-2, 280ms) var(--h-ease-out, ease-out);
}
@media (hover: hover) {
  [data-glow]:hover > .h-glow-layer { opacity: 1; }
}

/* ---------- Tilt (data-tilt). motion.js writes --h-rx / --h-ry; the element's own transition smooths it ---------- */
@media (hover: hover) and (pointer: fine) {
  :where(html.motion-ready [data-tilt]) { transition: transform var(--h-dur-2, 280ms) var(--h-ease-out, ease-out); }
  html.motion-ready body.v2 [data-tilt] {
    transform: perspective(1100px) rotateX(var(--h-rx, 0deg)) rotateY(var(--h-ry, 0deg)) translateY(var(--h-lift, 0px));
  }
  html.motion-ready body.v2 [data-tilt]:hover { --h-lift: -4px; }
}

/* ---------- Word-by-word lighting (data-scrolltext). Dim state stays at --h-faint (6.1:1) ---------- */
html.motion-ready [data-scrolltext] .h-word {
  transition: color .45s var(--h-ease-out, ease-out), text-shadow .6s var(--h-ease-out, ease-out);
}
html.motion-ready [data-scrolltext] .h-word:not(.is-lit) { color: var(--h-faint, #8a95a6); }
html.motion-ready [data-scrolltext="glow"] .h-word.is-lit { text-shadow: var(--h-glow-text); }

/* ---------- Count-up: steady width while digits change ---------- */
[data-count-to] { font-variant-numeric: tabular-nums; }

/* ---------- Anchor targets focused by script (sections, not controls) ---------- */
.h-anchor-target:focus, .h-anchor-target:focus-visible { outline: none; }

/* ---------- Motion off / reduced motion ---------- */
html.motion-off [data-parallax], html.motion-off [data-magnetic] { translate: none !important; }
@media (prefers-reduced-motion: reduce) {
  .h-progress { box-shadow: none; }
}
@media print { .h-progress, .h-glow-layer { display: none; } }
