/* ============================================================
   Liberty Partners — Motion layer
   Opt-in, information-bearing motion. Reduced-motion safe.
   Primitives (set via data-anim / data-parallax):
     mask     → image clip-wipe + settle scale
     lines    → headline / paragraph rises line by line
     stagger  → children deal in, one after another
     parallax → image drifts slowly against the scroll
   ============================================================ */

/* ── 1 · Masked image reveal ──────────────────────────────── */
[data-anim="mask"] {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.15s var(--ease-out);
  will-change: clip-path;
}
[data-anim="mask"] > img,
[data-anim="mask"] .pimg {
  transform: scale(1.07);
  transition: transform 1.5s var(--ease-out);
  will-change: transform;
}
[data-anim="mask"].in { clip-path: inset(0 0 0 0); }
[data-anim="mask"].in > img,
[data-anim="mask"].in .pimg { transform: scale(1); }

/* directional variant — wipe from the left edge */
[data-anim="mask"][data-from="left"]    { clip-path: inset(0 100% 0 0); }
[data-anim="mask"][data-from="left"].in { clip-path: inset(0 0 0 0); }

/* ── 2 · Line reveal ──────────────────────────────────────── */
/* Pre-hide only once JS is present, to avoid a flash of final text. */
.js [data-anim="lines"]:not(.m-ready) { visibility: hidden; }
.m-line {
  display: block;
  overflow: hidden;
  /* breathing room so descenders are not clipped at rest */
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.m-line-i {
  display: block;
  transform: translateY(110%);
  transition: transform .95s var(--ease-out);
  will-change: transform;
}
[data-anim="lines"].in .m-line-i { transform: translateY(0); }
.m-w { display: inline; }

/* ── 3 · Staggered deal-in ────────────────────────────────── */
[data-anim="stagger"] > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
[data-anim="stagger"].in > * { opacity: 1; transform: none; }

/* ── 4 · Parallax ─────────────────────────────────────────── */
[data-parallax] { will-change: transform; }
/* oversize parallax images so the drift never exposes an edge */
.fullbleed > img[data-parallax],
.contact-close > img[data-parallax] {
  position: absolute;
  inset: -9% 0 auto 0;
  width: 100%;
  height: 118%;
  object-fit: cover;
}

/* ── Respect reduced-motion: show everything, move nothing ── */
@media (prefers-reduced-motion: reduce) {
  [data-anim],
  [data-anim] > img,
  [data-anim] .pimg,
  [data-anim="stagger"] > *,
  .m-line-i {
    clip-path: none !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .js [data-anim="lines"]:not(.m-ready) { visibility: visible; }
  [data-parallax] { transform: none !important; }
}
