/* ==========================================================================
   Sendora — motion layer styles (paired with assets/js/sl-motion.js).
   Hand-written (not generated). Scoped to .sl-site / the m-js class, so
   nothing here touches non-Sendora pages or visitors without JavaScript.

   Tokens: entrance easing cubic-bezier(.22,1,.36,1); moving easing
   cubic-bezier(.65,0,.35,1); micro 180ms, small 400ms, reveal 700ms;
   24px travel (16px and ×0.8 durations under 768px). Only transform,
   opacity, clip-path and SVG stroke animate.
   ========================================================================== */

.sl-site {
	--m-ease: cubic-bezier(.22, 1, .36, 1);
	--m-move: cubic-bezier(.65, 0, .35, 1);
	--m-micro: 180ms;
	--m-small: 400ms;
	--m-reveal: 700ms;
	--m-dist: 24px;
}
@media (max-width: 768px) {
	.sl-site { --m-small: 320ms; --m-reveal: 560ms; --m-dist: 16px; }
}

/* ---------- Existing scroll reveals: retimed to the tokens ---------- */
.m-js .sl-site [data-reveal] { transition-duration: var(--m-reveal); transition-timing-function: var(--m-ease); }
.m-js .sl-site [data-reveal="up"]:not(.is-visible) { transform: translateY(var(--m-dist)); }
/* An inner effect (curtain, headline) owns the entrance: show the wrapper at once. */
.m-js .sl-site [data-reveal].m-settled { transition: none; }

/* ---------- Hero moment ---------- */
.m-js .sl-hero__copy { animation: none; }
.m-js .sl-hero__copy > h1:not(.m-ready) { opacity: 0; }
.m-js .sl-hero__copy > .m-fade { opacity: 0; transform: translateY(var(--m-dist)); transition: opacity var(--m-reveal) var(--m-ease), transform var(--m-reveal) var(--m-ease); }
.m-js .sl-hero__copy > .m-fade.m-in { opacity: 1; transform: none; }

/* ---------- Line reveal (m-lines) ----------
   Each word sits in a mask; the padding/negative margin pair gives
   descenders and the italic overhang room without moving the layout. */
.m-lines .m-w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .1em .16em 0; margin: 0 -.1em -.16em 0; }
.m-lines .m-w > span { display: inline-block; transform: translateY(112%); transition: transform var(--m-reveal) var(--m-ease); }
.m-lines.m-in .m-w > span { transform: none; }

/* ---------- Count-up (m-count) ---------- */
.m-num { font-variant-numeric: tabular-nums; }

/* ---------- Drawn underline (m-draw) ---------- */
.m-draw-host { position: relative; display: inline-block; }
.m-draw { position: absolute; left: 0; bottom: -.32em; width: 100%; height: .4em; overflow: visible; pointer-events: none; }
.m-draw path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: stroke-dashoffset 900ms var(--m-move); }

/* ---------- Curtain reveal (m-clip) ---------- */
.m-clip { overflow: hidden; }
.m-clip img { clip-path: inset(100% 0 0 0); transform: scale(1.06); transform-origin: 50% 100%; transition: clip-path var(--m-reveal) var(--m-ease), transform var(--m-reveal) var(--m-ease); }
.m-clip.m-in img { clip-path: inset(0 0 0 0); transform: none; }

/* ---------- Progress through a sequence (m-progress) ---------- */
.m-step { position: relative; }
.m-step .m-rail { position: absolute; top: -1px; left: 0; width: 100%; height: 2px; background: var(--sl-lime); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--m-reveal) var(--m-move); pointer-events: none; }
.m-step.m-reached .m-rail { transform: scaleX(1); }
.m-step .sl-step__num,
.m-step .sl-week__when { opacity: .35; transition: opacity var(--m-small) var(--m-ease); }
.m-step.m-reached .sl-step__num,
.m-step.m-reached .sl-week__when { opacity: 1; }

/* ---------- Review stars (fill left to right) ---------- */
.m-stars { display: inline-block; clip-path: inset(0 100% 0 0); transition: clip-path 900ms var(--m-move) 200ms; }
.m-stars.m-in { clip-path: inset(0 0 0 0); }

/* ---------- Magnetic primary CTA (m-magnetic) ---------- */
.m-mag { transition: transform var(--m-small) var(--m-ease); will-change: transform; }
.m-mag:hover,
.m-mag:focus-visible { transition-duration: var(--m-micro); }
.m-mag .sl-btn__arrow { display: inline-block; transition: transform var(--m-micro) var(--m-ease); }
.m-mag:hover .sl-btn__arrow,
.m-mag:focus-visible .sl-btn__arrow { transform: translateX(4px); }

/* ---------- Long email pan (m-pan) ---------- */
.sl-gallery__open.m-panning img { max-height: none; height: auto; object-fit: fill; transition: transform 2s linear; }

/* ---------- Reading progress (m-readbar) ---------- */
.m-readbar { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: var(--sl-lime); transform: scaleX(0); transform-origin: 0 50%; z-index: 9999; pointer-events: none; }
.admin-bar .m-readbar { top: 32px; }
@media (max-width: 782px) { .admin-bar .m-readbar { top: 46px; } }

/* ---------- Hero photo depth (m-parallax) ---------- */
.m-parallax { will-change: transform; transform: scale(1.08); }

/* ---------- Hero clips: dip to dark between clips (m-clipfade) ---------- */
.m-clipfade { transition: opacity 400ms var(--m-move); }
.m-clipfade.m-dip { opacity: 0; }

/* ---------- Page transitions ----------
   Same-site page loads cross-fade in 250ms (Chrome, Edge, Safari 18+;
   other browsers simply load the page). Off for reduced motion. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 250ms; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }
}

/* ---------- 13. 3D layer (service pages, proof band, case notes) ---------- */
/* Hero depth: the photo leans toward the pointer inside a perspective box. */
.m-depth { perspective: 1200px; }
.m-depth .sl-hero__inner { transition: transform var(--m-small) var(--m-ease); will-change: transform; }
.m-depth .m-parallax { transition: transform .5s var(--m-ease); }

/* Tilt cards: transform is set inline; the sheen follows the pointer. */
.m-tilt { transform-style: preserve-3d; transition: transform var(--m-small) var(--m-ease), box-shadow .35s ease; will-change: transform; }
.m-tilt.m-tilting { transition: transform 120ms linear, box-shadow .35s ease; box-shadow: 0 28px 50px -26px rgba(10, 10, 11, .5); }
.m-tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--m-small) var(--m-ease); background: radial-gradient(420px circle at var(--m-gx, 50%) var(--m-gy, 50%), rgba(255, 255, 255, .28), transparent 55%); }
.sl-card.m-tilt { position: relative; }
.m-tilt.m-tilting::after { opacity: 1; }

/* Proof stack: starts as a flat pile, fans out into the 3D scene. */
.m-stack .sl-stack__card { transition: transform 1s var(--m-ease), opacity .6s var(--m-ease); }
.m-stack:not(.m-in) .sl-stack__scene { transform: rotateX(0deg) rotateY(0deg); }
.m-stack:not(.m-in) .sl-stack__card { opacity: 0; transform: translate3d(0, 40px, 0) rotate(-2deg); }
.m-stack.m-in .sl-stack__card--b { transition-delay: 120ms; }
.m-stack.m-in .sl-stack__card--c { transition-delay: 240ms; }
.m-stack.m-in .sl-stack__card { animation: m-float 7s var(--m-move) 1.4s infinite alternate; }
.m-stack.m-in .sl-stack__card--b { animation-duration: 8s; animation-delay: 1.6s; }
.m-stack.m-in .sl-stack__card--c { animation-duration: 9s; animation-delay: 1.8s; }
@keyframes m-float { from { translate: 0 0; } to { translate: 0 -10px; } }

/* Steps turn up into place. */
.m-flip { transform-origin: 50% 100%; transition: transform 800ms var(--m-ease), opacity 600ms var(--m-ease); }
.m-flip:not(.m-in) { opacity: 0; transform: perspective(900px) rotateX(-38deg) translateY(var(--m-dist)); }

@media (max-width: 768px) {
	.m-stack.m-in .sl-stack__card { animation: none; }
}
