/* SiteFactory Motion Packs (design guide 14.19). Only copied to sites with client.json extras.motion.
   html.mo is switched on by the inline head snippet (reduced motion off, IntersectionObserver available); motion.js tags
   elements with data-mo (hero | head | item | media | block) and adds .mo-in to reveal them, then removes its marks.
   Each pack only sets custom properties, plus a few small extras. Only opacity, transform and clip-path animate, so
   nothing shifts the layout. Numbers the script reads: --mo-dur-ms, --mo-stagger-ms, --mo-tail-ms, --mo-scroll (1/0),
   --mo-svg (draw|pop|none), --mo-media (zoom|none), --mo-delay-ms (start delay, default 120). */

.mo { --mo-k: 1; }
@media (max-width: 767px) { .mo { --mo-k: .6; } }
/* Desktop starts sooner: half the start delay (phones keep 120ms, Trav 2026-11-19) */
@media (min-width: 1024px) { .mo { --mo-delay: 60ms; --mo-delay-ms: 60; } }

/* Hero text stays hidden from the first paint until motion.js has tagged it (no flash). Removed by .mo-ready. */
.mo:not(.mo-ready) main .hero :has(> h1) > :not(:has(img, picture, form)):not(img, picture, form) { opacity: 0; }
/* Same for section content below the hero (backgrounds stay), so a section already in view when the page opens moves
   in with the hero instead of showing first and then animating (Trav 2026-11-19) */
.mo:not(.mo-ready) main [data-component]:not([data-component="hero"]):not(.hero) .container { opacity: 0; }

/* Slides and scale-ups never cause sideways scrolling (clip, not hidden, so sticky elements keep working) */
.mo main { overflow-x: clip; }

.mo [data-mo] {
  opacity: 0;
  transition: opacity var(--mo-dur) var(--mo-ease-fade, cubic-bezier(.4, 0, .2, 1)), transform var(--mo-dur) var(--mo-ease), clip-path var(--mo-dur) var(--mo-ease);
  transition-delay: calc(var(--mo-delay, 120ms) + var(--mo-i, 0) * var(--mo-stagger));
}
.mo [data-mo]:not([data-mo-fb]) { transform: var(--mo-from); }
.mo [data-mo="item"]:not([data-mo-fb]) { transform: var(--mo-from-item, var(--mo-from)); }
.mo [data-mo="media"]:not([data-mo-fb]) { transform: var(--mo-from-media, var(--mo-from)); }
.mo [data-mo="hero"] { transition-duration: var(--mo-hero-dur, var(--mo-dur)); transition-delay: calc(var(--mo-i, 0) * var(--mo-hero-stagger, 110ms) + 60ms); }
.mo [data-mo="hero"]:not([data-mo-fb]) { transform: var(--mo-from-hero, var(--mo-from)); }
.mo [data-mo].mo-in { opacity: 1; }
.mo [data-mo].mo-in:not([data-mo-fb]) { transform: none; }

/* The header always stays sticky: no pack hides it (Trav 2026-11-19) */

/* ---------- Calm: soft, slow fade-ups ---------- */
.mo-calm {
  --mo-dur: .9s; --mo-dur-ms: 900; --mo-stagger: 80ms; --mo-stagger-ms: 80;
  --mo-ease: cubic-bezier(.25, .6, .3, 1);
  --mo-from: translate3d(0, calc(18px * var(--mo-k, 1)), 0);
  --mo-from-hero: translate3d(0, 12px, 0); --mo-hero-dur: 1s;
  --mo-scroll: 1; --mo-svg: none; --mo-media: none; --mo-tail-ms: 0;
}

/* ---------- Snap: quick, sharp slide-ins from the left ---------- */
.mo-snap {
  --mo-dur: .45s; --mo-dur-ms: 450; --mo-stagger: 45ms; --mo-stagger-ms: 45;
  --mo-ease: cubic-bezier(.16, 1, .3, 1);
  --mo-from: translate3d(calc(-28px * var(--mo-k, 1)), 0, 0);
  --mo-from-media: translate3d(calc(-40px * var(--mo-k, 1)), 0, 0);
  --mo-from-hero: translate3d(-24px, 0, 0); --mo-hero-dur: .55s; --mo-hero-stagger: 70ms;
  --mo-scroll: 1; --mo-svg: none; --mo-media: none; --mo-tail-ms: 0;
}

/* ---------- Rise: cards rise into place one after another ---------- */
.mo-rise {
  --mo-dur: .7s; --mo-dur-ms: 700; --mo-stagger: 95ms; --mo-stagger-ms: 95;
  --mo-ease: cubic-bezier(.22, 1, .36, 1);
  --mo-from: translate3d(0, calc(28px * var(--mo-k, 1)), 0);
  --mo-from-item: translate3d(0, calc(48px * var(--mo-k, 1)), 0);
  --mo-from-hero: translate3d(0, 22px, 0); --mo-hero-dur: .8s;
  --mo-scroll: 1; --mo-svg: none; --mo-media: none; --mo-tail-ms: 0;
}

/* ---------- Glide: sections slide in from alternating sides ---------- */
.mo-glide {
  --mo-dur: .85s; --mo-dur-ms: 850; --mo-stagger: 70ms; --mo-stagger-ms: 70;
  --mo-ease: cubic-bezier(.22, 1, .36, 1);
  --mo-from: translate3d(calc(var(--mo-x, -1) * 56px * var(--mo-k, 1)), 0, 0);
  --mo-from-hero: translate3d(-32px, 0, 0); --mo-hero-dur: .9s;
  --mo-scroll: 1; --mo-svg: none; --mo-media: none; --mo-tail-ms: 0;
}
.mo-glide [data-mo-side="r"] { --mo-x: 1; }

/* ---------- Stamp: settles in from slightly bigger with a firm landing ---------- */
.mo-stamp {
  --mo-dur: .5s; --mo-dur-ms: 500; --mo-stagger: 75ms; --mo-stagger-ms: 75;
  --mo-ease: cubic-bezier(.34, 1.3, .64, 1);
  --mo-from: scale(1.08);
  --mo-from-item: scale(1.12);
  --mo-from-media: scale(1.04);
  --mo-from-hero: scale(1.06); --mo-hero-dur: .55s;
  --mo-scroll: 1; --mo-svg: none; --mo-media: none; --mo-tail-ms: 0;
}

/* ---------- Draw: headings and photos revealed left to right, line icons draw themselves ---------- */
.mo-draw {
  --mo-dur: .9s; --mo-dur-ms: 900; --mo-stagger: 90ms; --mo-stagger-ms: 90;
  --mo-ease: cubic-bezier(.65, 0, .35, 1);
  --mo-from: translate3d(0, calc(12px * var(--mo-k, 1)), 0);
  --mo-from-hero: none; --mo-hero-dur: .9s;
  --mo-scroll: 1; --mo-svg: draw; --mo-media: none; --mo-tail-ms: 1100;
}
/* Anything already on screen when the page opens (data-mo-now) draws in with the hero too, so the section under an
   inner-page hero matches it (Trav 2026-11-19) */
.mo .mo-draw [data-mo="head"]:not([data-mo-fb]), .mo .mo-draw [data-mo="media"]:not([data-mo-fb]), .mo .mo-draw [data-mo="hero"]:not([data-mo-fb]), .mo .mo-draw [data-mo][data-mo-now]:not([data-mo-fb]) {
  opacity: 1; transform: none; clip-path: inset(-64px 100% -64px -64px);
}
/* 64px of room round the box, so a soft card shadow (up to 40px blur) is never cut off with a visible edge (Trav 2026-11-20) */
.mo .mo-draw [data-mo].mo-in:not([data-mo-fb]) { clip-path: inset(-64px -64px -64px -64px); }
.mo .mo-draw [data-mo-svg] [data-mo-len] { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.65, 0, .35, 1) calc(var(--mo-delay, 120ms) + var(--mo-i, 0) * var(--mo-stagger) + 200ms); }
.mo .mo-draw .mo-in [data-mo-svg] [data-mo-len] { stroke-dashoffset: 0; }

/* ---------- Bloom: blocks grow softly into place, photos settle from a gentle zoom ---------- */
.mo-bloom {
  --mo-dur: .9s; --mo-dur-ms: 900; --mo-stagger: 80ms; --mo-stagger-ms: 80;
  --mo-ease: cubic-bezier(.2, .8, .2, 1);
  --mo-from: translate3d(0, calc(10px * var(--mo-k, 1)), 0) scale(.96);
  --mo-from-item: scale(.93);
  --mo-from-media: none;
  --mo-from-hero: scale(.97); --mo-hero-dur: 1s;
  --mo-scroll: 1; --mo-svg: none; --mo-media: zoom; --mo-tail-ms: 900;
}
.mo .mo-bloom [data-mo-zoom] img { transform: scale(1.14); transition: transform 1.8s cubic-bezier(.2, .8, .2, 1) calc(var(--mo-delay, 120ms) + var(--mo-i, 0) * var(--mo-stagger)); }
.mo .mo-bloom [data-mo-zoom].mo-in img { transform: none; }

/* ---------- Steady: almost nothing moves (hero fade and soft press only) ---------- */
.mo-steady {
  --mo-dur: .7s; --mo-dur-ms: 700; --mo-stagger: 0ms; --mo-stagger-ms: 0;
  --mo-ease: cubic-bezier(.4, 0, .2, 1);
  --mo-from: translate3d(0, 6px, 0); --mo-hero-stagger: 60ms;
  --mo-scroll: 0; --mo-svg: none; --mo-media: none; --mo-tail-ms: 0;
}

/* ---------- Spark: bright and quick, a little bounce, icons spring in ---------- */
.mo-spark {
  --mo-dur: .55s; --mo-dur-ms: 550; --mo-stagger: 50ms; --mo-stagger-ms: 50;
  --mo-ease: cubic-bezier(.34, 1.56, .64, 1);
  --mo-from: translate3d(0, calc(22px * var(--mo-k, 1)), 0) scale(.96);
  --mo-from-item: translate3d(0, calc(26px * var(--mo-k, 1)), 0) scale(.92);
  --mo-from-media: scale(.96);
  --mo-from-hero: translate3d(0, 16px, 0); --mo-hero-dur: .6s; --mo-hero-stagger: 80ms;
  --mo-scroll: 1; --mo-svg: pop; --mo-media: none; --mo-tail-ms: 500;
}
.mo .mo-spark [data-mo-svg] { transform: scale(.4) rotate(-14deg); transform-box: fill-box; transform-origin: center; transition: transform .6s cubic-bezier(.34, 1.56, .64, 1) calc(var(--mo-delay, 120ms) + var(--mo-i, 0) * var(--mo-stagger) + 150ms); }
.mo .mo-spark .mo-in [data-mo-svg] { transform: none; }

/* ---------- Hover (Trav 2026-11-19) ----------
   The pack sets the hover MOVEMENT only; the site's design keeps its colours, borders and shadows. motion.js marks
   data-moh="card" (boxed cards with text), "card-flat" (photo effects only, never moves), "img" (a photo inside a
   cropping frame, data-moh-frame) and "btn" (main-area buttons, not the flat button styles). Rules start with
   "html.mo body" so they replace the site's own card lift and photo zoom on pack sites. Values per pack:
   --moh-dur/--moh-ease (cards and buttons), --moh-card, --moh-img, --moh-img-dur, --moh-img-filter, --moh-btn,
   --moh-icon (arrow or icon inside a button or "Learn more" link). */
.mo-calm   { --moh-dur: .5s;  --moh-ease: cubic-bezier(.25, .6, .3, 1);  --moh-card: translateY(-3px); --moh-img: scale(1.04); --moh-img-dur: .9s; --moh-btn: translateY(-2px); --moh-icon: translateX(2px); }
.mo-snap   { --moh-dur: .18s; --moh-ease: cubic-bezier(.16, 1, .3, 1);   --moh-card: translateX(4px);  --moh-img: scale(1.06); --moh-img-dur: .3s; --moh-btn: translateX(3px); --moh-icon: translateX(4px); }
.mo-rise   { --moh-dur: .35s; --moh-ease: cubic-bezier(.22, 1, .36, 1);  --moh-card: translateY(-8px); --moh-img: scale(1.05); --moh-img-dur: .6s; --moh-btn: translateY(-3px); --moh-icon: translateY(-2px); }
.mo-glide  { --moh-dur: .45s; --moh-ease: cubic-bezier(.22, 1, .36, 1);  --moh-card: translateX(6px);  --moh-img: scale(1.08) translateX(-2%); --moh-img-dur: .9s; --moh-btn: translateX(-3px); --moh-icon: translateX(4px); }
.mo-stamp  { --moh-dur: .25s; --moh-ease: cubic-bezier(.34, 1.3, .64, 1); --moh-card: scale(1.02);   --moh-img: scale(1.03); --moh-img-dur: .35s; --moh-btn: scale(1.03); --moh-icon: none; }
.mo-draw   { --moh-dur: .3s;  --moh-ease: cubic-bezier(.65, 0, .35, 1);  --moh-card: translateY(-2px); --moh-img: scale(1.06) rotate(.6deg); --moh-img-dur: .6s; --moh-btn: translateY(-2px); --moh-icon: translateX(2px); }
.mo-bloom  { --moh-dur: .5s;  --moh-ease: cubic-bezier(.2, .8, .2, 1);   --moh-card: scale(1.03);     --moh-img: scale(1.1);  --moh-img-dur: 1.2s; --moh-btn: scale(1.03); --moh-icon: none; }
.mo-steady { --moh-dur: .3s;  --moh-ease: cubic-bezier(.4, 0, .2, 1);    --moh-card: translateY(-2px); --moh-img: scale(1.03); --moh-img-dur: 1s; --moh-btn: translateY(-1px); --moh-icon: none; }
.mo-spark  { --moh-dur: .3s;  --moh-ease: cubic-bezier(.34, 1.56, .64, 1); --moh-card: translateY(-6px) rotate(-.6deg); --moh-img: scale(1.03); --moh-img-dur: .45s; --moh-img-filter: brightness(1.06); --moh-btn: scale(1.04); --moh-icon: rotate(-10deg) scale(1.1); }

/* Reveal marks win while a card is still animating in; hover only applies once it has landed (marks removed) */
html.mo body [data-moh="card"]:not([data-mo]) {
  transition: transform var(--moh-dur) var(--moh-ease), box-shadow .25s ease, border-color .2s ease, background-color .2s ease, color .2s ease;
}
html.mo body [data-moh-frame="made"] { overflow: hidden; border-radius: var(--moh-r, 0); }
html.mo body [data-moh="img"] { transition: transform var(--moh-img-dur) var(--moh-ease), filter var(--moh-img-dur) ease; }
html.mo body main .btn[data-moh="btn"]:not([data-mo]) {
  transition: transform var(--moh-dur) var(--moh-ease), background-color .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
}
html.mo body .btn svg, html.mo body .link-arrow svg { transition: transform var(--moh-dur) var(--moh-ease); }
@media (hover: hover) {
  html.mo body [data-moh="card"]:not([data-mo]):hover { transform: var(--moh-card); }
  html.mo body [data-moh-frame]:hover [data-moh="img"],
  html.mo body [data-moh="card"]:hover [data-moh="img"],
  html.mo body [data-moh="card-flat"]:hover [data-moh="img"] { transform: var(--moh-img); filter: var(--moh-img-filter, none); }
  html.mo body main .btn[data-moh="btn"]:not([data-mo]):hover { transform: var(--moh-btn); }
  html.mo body .btn:hover svg, html.mo body .link-arrow:hover svg { transform: var(--moh-icon, none); }
  /* Stamp: the "Learn more" underline draws itself left to right (swapped from Draw, Trav 2026-11-19) */
  html.mo body.mo-stamp .link-arrow { position: relative; }
  html.mo body.mo-stamp .link-arrow::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(50% - .8em); height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left center; transition: transform .35s cubic-bezier(.65, 0, .35, 1); }
  html.mo body.mo-stamp .link-arrow:hover { text-decoration: none; }
  html.mo body.mo-stamp .link-arrow:hover::after { transform: scaleX(1); }
}
/* Phones and tablets: a quick press-in on tap */
@media (hover: none) {
  html.mo body [data-moh="card"]:not([data-mo]) { transition-duration: .15s; }
  html.mo body [data-moh="card"]:not([data-mo]):active { transform: scale(.98); }
  html.mo body main .btn[data-moh="btn"]:not([data-mo]):active { transform: scale(.97); transition-duration: .1s; }
}
/* Draw: a firm press on click everywhere (swapped from Stamp, Trav 2026-11-19) */
html.mo body.mo-draw main .btn[data-moh="btn"]:not([data-mo]):active { transform: scale(.96); transition-duration: .08s; }

/* Belt and braces: never hidden when printing or when the visitor asks for less motion */
@media print { .mo [data-mo] { opacity: 1 !important; transform: none !important; clip-path: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .mo [data-mo], .mo [data-mo] img, .mo [data-mo-svg], .mo [data-mo-len] { opacity: 1 !important; transform: none !important; clip-path: none !important; stroke-dashoffset: 0 !important; transition: none !important; }
  .mo:not(.mo-ready) main .hero :has(> h1) > *, .mo:not(.mo-ready) main [data-component] .container { opacity: 1 !important; }
}
