/* Motion wave 2, homepage (builder M1, 2026-11-22). Extends zz-motion.css; never duplicates it.
   - Entrance choreography uses transitions keyed on the card's .is-in (once only), so it never
     replays; .is-instant (already on screen at load) skips it.
   - Ambient loops run only under html.motion-ok, on a [data-loop] element that motion.js marks
     .is-inview, after the card has revealed, and start after the entrance has finished. The
     first keyframe of every loop is the approved still, so a loop that never starts (off screen,
     reduced motion, "Pause animations", no JS, print) shows exactly today's design.
   - Individual transform properties (rotate, scale, translate) compose with the existing
     transforms, so nothing at rest moves. Opacity, transform and stroke-dashoffset only.
   --m2-d is the card's own reveal delay (motion.css), so children follow their card. */

.hm-dial__pivot { position: absolute; inset: 0; }
.hm-ring__wave { display: none; }

html.motion-ok :is(.hm-why__card, .hm-cap, .hm-rating, .hm-lead, .hm-review, .hm-plan, .hm-statement__by)[data-reveal] {
	--m2-d: min(calc(var(--i, 0) * var(--stagger, 0ms) + var(--extra, 0ms)), var(--stagger-cap));
}
html.motion-ok .is-instant :is(:is(.hm-cap__top, .hm-why__card) > .tile, .hm-dial__pivot, .hm-dial__dot, .hm-bar, .hm-vtag, .hm-vlabel, .hm-ring, .hm-ring__ico,
	.hm-stars .ico, .hm-lead__mark, .hm-review__ini, .hm-plan__list .ico path, .hm-plan__tag, .hm-disc),
html.motion-ok .is-instant :is(.hm-cap__top, .hm-why__card) > .tile :is(.ico, ::after),
html.motion-ok .is-instant .hm-plan__tag::after { transition: none !important; }

/* ================================================================ Icon tiles (entrance)
   Capabilities cards without a vignette, and the "What makes us different" tiles shown below
   1200px. The tile pops from 0.86, its glyph turns and settles, one soft sheen passes over it.
   Fine pointers: the glyph nudges up 2px on card hover. */
html.motion-ok :is(.hm-cap__top, .hm-why__card) > .tile { position: relative; overflow: hidden; }
html.motion-ok :is(.hm-cap__top, .hm-why__card) > .tile,
html.motion-ok :is(.hm-cap__top, .hm-why__card) > .tile .ico {
	transition: scale 900ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 260ms), rotate 1000ms var(--ease-spring) calc(var(--m2-d, 0ms) + 320ms), translate var(--dur-hover) var(--ease-out-quart);
}
html.motion-ok :is(.hm-cap, .hm-why__card):not(.is-in) :is(.hm-cap__top, .hm-why__card) > .tile { scale: .86; }
html.motion-ok :is(.hm-cap, .hm-why__card):not(.is-in) :is(.hm-cap__top, .hm-why__card) > .tile .ico { rotate: -24deg; scale: .7; }
html.motion-ok :is(.hm-cap__top, .hm-why__card) > .tile::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
	translate: 120% 0; transition: translate 900ms var(--ease-in-out) calc(var(--m2-d, 0ms) + 650ms);
}
html.motion-ok :is(.hm-cap, .hm-why__card):not(.is-in) :is(.hm-cap__top, .hm-why__card) > .tile::after { translate: -120% 0; }
@media (hover: hover) and (pointer: fine) {
	html.motion-ok .hm-cap[data-card-link]:hover .hm-cap__top > .tile .ico { translate: 0 -2px; }
}
/* Wide capability cards keep their vignette as the motion; their tile stays still on desktop. */
@media (min-width: 1024px) {
	html.motion-ok .hm-cap--wide .hm-cap__top > .tile, html.motion-ok .hm-cap--wide .hm-cap__top > .tile .ico { scale: none !important; rotate: none !important; }
	html.motion-ok .hm-cap--wide .hm-cap__top > .tile::after { content: none; }
}

/* ================================================================ What makes us different, art (>= 1200px)
   The art shows from 1200px only (zz-fix-sections.css hides it from 768 to 1199). */
@media (min-width: 1200px) {
	/* ---- Dial: the needle swings in from the top and settles; the dot pops. Loop: every 6s the
	   needle sweeps back and settles on its design angle (pivot on its inner rounded end). */
	.hm-dial__pivot { transform-origin: calc(50% + 19px) 143px; }
	html.motion-ok .hm-why__card[data-reveal] .hm-dial__pivot { transition: rotate 1400ms var(--ease-spring) calc(var(--m2-d, 0ms) + 300ms); }
	html.motion-ok .hm-why__card:not(.is-in) .hm-dial__pivot { rotate: -40deg; }
	html.motion-ok .hm-why__card[data-reveal] .hm-dial__dot { transition: scale 700ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 650ms), opacity 300ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 650ms); }
	html.motion-ok .hm-why__card:not(.is-in) .hm-dial__dot { scale: .4; opacity: 0; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview .hm-dial__pivot { animation: hm2-needle 6s 2.2s infinite; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview .hm-dial__dot { animation: hm2-dot 6s 2.2s infinite; }

	/* ---- Bars: the bars grow from the baseline in order, then the tags pop. Loop: a soft wave
	   runs left to right through the bars (4% dip) and the tags answer. */
	.hm-bar { transform-origin: 50% 100%; }
	html.motion-ok .hm-why__card[data-reveal] .hm-bar { transition: scale 1000ms var(--ease-spring) calc(var(--m2-d, 0ms) + 260ms + var(--b, 0) * 90ms); }
	html.motion-ok .hm-why__card:not(.is-in) .hm-bar { scale: 1 .2; }
	.hm-bar:nth-of-type(2) { --b: 1; }
	.hm-bar:nth-of-type(3) { --b: 2; }
	.hm-bar:nth-of-type(4) { --b: 3; }
	html.motion-ok .hm-why__card[data-reveal] :is(.hm-vtag, .hm-vlabel) {
		transition: scale 700ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 720ms + var(--b, 0) * 110ms), opacity 300ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 720ms + var(--b, 0) * 110ms);
	}
	html.motion-ok .hm-why__card:not(.is-in) :is(.hm-vtag, .hm-vlabel) { scale: .8; opacity: 0; }
	.hm-vlabel--req { --b: 1; transform-origin: 50% 100%; }
	.hm-vlabel--dep { --b: 2; transform-origin: 50% 100%; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview .hm-bar { animation: hm2-bar 6s var(--ease-in-out) calc(2.6s + var(--b, 0) * 140ms) infinite; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview :is(.hm-vtag, .hm-vlabel) { animation: hm2-tag 6s calc(2.6s + var(--b, 0) * 140ms) infinite; }

	/* ---- Shield: the rings open from the centre outwards, then the shield pops. Loop: every
	   4.8s the rings swell in turn (2%) and a faint ripple leaves the outer ring. */
	.hm-ring__wave {
		display: block; position: absolute; left: calc(50% - 85px); top: 20px; width: 170px; height: 170px;
		border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(1, 14, 208, .16); opacity: 0;
	}
	.hm-ring:nth-child(2) { --b: 2; }
	.hm-ring:nth-child(3) { --b: 1; }
	html.motion-ok .hm-why__card[data-reveal] .hm-ring {
		transition: scale 1000ms var(--ease-spring) calc(var(--m2-d, 0ms) + 260ms + var(--b, 0) * 120ms), opacity 500ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 260ms + var(--b, 0) * 120ms);
	}
	html.motion-ok .hm-why__card:not(.is-in) .hm-ring { scale: .82; opacity: 0; }
	html.motion-ok .hm-why__card[data-reveal] .hm-ring__ico { transition: scale 700ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 700ms), opacity 300ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 700ms); }
	html.motion-ok .hm-why__card:not(.is-in) .hm-ring__ico { scale: .5; opacity: 0; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview .hm-ring { animation: hm2-ring 4.8s var(--ease-in-out) calc(2.4s + var(--b, 0) * 160ms) infinite; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview .hm-ring__ico { animation: hm2-shield 4.8s var(--ease-in-out) 2.3s infinite; }
	html.motion-ok .hm-why__card.is-in .hm-vig.is-inview .hm-ring__wave { animation: hm2-wave 4.8s var(--ease-out-quart) 2.75s infinite; }
}

/* ================================================================ Reviews
   Rating card (768px and up): the stars pop in order and the value counts up (facts-stats.js,
   data-count). Its soft glow drifts slowly while in view. Lead quote: the quote mark (desktop)
   and stars (phones) pop. Review cards: the initials discs pop. */
.hm-rating__v [data-count] { display: inline-block; text-align: center; }
html.motion-ok :is(.hm-rating, .hm-lead)[data-reveal] .hm-stars .ico {
	transition: scale 650ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 380ms + var(--b, 0) * 80ms), opacity 250ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 380ms + var(--b, 0) * 80ms);
}
html.motion-ok :is(.hm-rating, .hm-lead):not(.is-in) .hm-stars .ico { scale: .4; opacity: 0; }
.hm-stars .ico:nth-child(2) { --b: 1; }
.hm-stars .ico:nth-child(3) { --b: 2; }
.hm-stars .ico:nth-child(4) { --b: 3; }
.hm-stars .ico:nth-child(5) { --b: 4; }
html.motion-ok .hm-rating.is-in .hm-rating__glow.is-inview { will-change: transform; animation: hm2-glow 8s var(--ease-in-out) 1.4s infinite alternate; }
html.motion-ok .hm-lead[data-reveal] .hm-lead__mark {
	transition: scale 800ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 420ms), translate 800ms var(--ease-spring) calc(var(--m2-d, 0ms) + 420ms), opacity 300ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 420ms);
}
html.motion-ok .hm-lead:not(.is-in) .hm-lead__mark { scale: .6; translate: 0 6px; opacity: 0; }
html.motion-ok .hm-review[data-reveal] .hm-review__ini { transition: scale 700ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 360ms), opacity 300ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 360ms); }
html.motion-ok .hm-review:not(.is-in) .hm-review__ini { scale: .7; opacity: 0; }

/* ================================================================ Engagement
   Check marks draw in order once the card has revealed; the "Published rates" tag pops and a
   single sheen passes over it. */
html.motion-ok .hm-plan[data-reveal] .hm-plan__list .ico path {
	stroke-dasharray: 19; transition: stroke-dashoffset 520ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 420ms + var(--b, 0) * 90ms);
}
html.motion-ok .hm-plan:not(.is-in) .hm-plan__list .ico path { stroke-dashoffset: 19; }
.hm-plan__list li:nth-child(2) { --b: 1; }
.hm-plan__list li:nth-child(3) { --b: 2; }
.hm-plan__list li:nth-child(4) { --b: 3; }
.hm-plan__list li:nth-child(5) { --b: 4; }
@media (min-width: 768px) {
	html.motion-ok .hm-plan[data-reveal] .hm-plan__tag {
		position: relative; overflow: hidden;
		transition: scale 700ms var(--ease-spring-ui) calc(var(--m2-d, 0ms) + 340ms), opacity 300ms var(--ease-out-quart) calc(var(--m2-d, 0ms) + 340ms);
	}
	html.motion-ok .hm-plan:not(.is-in) .hm-plan__tag { scale: .8; opacity: 0; }
	html.motion-ok .hm-plan[data-reveal] .hm-plan__tag::after {
		content: ""; position: absolute; inset: 0; pointer-events: none;
		background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%);
		translate: 110% 0; transition: translate 1000ms var(--ease-in-out) calc(var(--m2-d, 0ms) + 900ms);
	}
	html.motion-ok .hm-plan:not(.is-in) .hm-plan__tag::after { translate: -110% 0; }
}

/* ================================================================ Statement: the logo disc pops */
html.motion-ok .hm-statement__by[data-reveal] .hm-disc { transition: scale 800ms var(--ease-spring-ui) 200ms, rotate 1000ms var(--ease-spring) 200ms; }
html.motion-ok .hm-statement__by:not(.is-in) .hm-disc { scale: .6; rotate: -60deg; }

/* ================================================================ Projects: the shown image drifts
   very slowly while the card is in view (like the bento lead): one loop for the section. */
html.motion-ok .hm-proj__card.is-inview .hm-proj__panel.is-active .hm-proj__media img { animation: hm2-drift 8s var(--ease-in-out) 1.2s infinite alternate; }
html.motion-ok .hm-proj__card.is-inview .hm-proj__panel.is-active.is-entering .hm-proj__media img { animation: hm-fade 500ms var(--ease-out-quart) both, hm2-drift 8s var(--ease-in-out) 1.2s infinite alternate; }

/* ================================================================ Keyframes */
@keyframes hm2-needle {
	0%, 42% { rotate: 0deg; animation-timing-function: var(--ease-in-out); }
	58% { rotate: -18deg; animation-timing-function: var(--ease-spring); }
	84%, 100% { rotate: 0deg; }
}
@keyframes hm2-dot { 0%, 72% { scale: 1; } 78% { scale: .82; animation-timing-function: var(--ease-spring-ui); } 90%, 100% { scale: 1; } }
@keyframes hm2-bar { 0%, 44% { scale: 1 1; } 54% { scale: 1 .96; } 68%, 100% { scale: 1 1; } }
@keyframes hm2-tag { 0%, 56% { scale: 1; } 62% { scale: 1.03; animation-timing-function: var(--ease-spring-ui); } 76%, 100% { scale: 1; } }
@keyframes hm2-ring { 0%, 6% { scale: 1; } 20% { scale: 1.02; } 40%, 100% { scale: 1; } }
@keyframes hm2-shield { 0% { scale: 1; } 10% { scale: 1.03; } 26%, 100% { scale: 1; } }
@keyframes hm2-wave { 0% { opacity: 0; scale: 1; } 8% { opacity: 1; } 60%, 100% { opacity: 0; scale: 1.36; } }
@keyframes hm2-glow { from { translate: 0 0; scale: 1; } to { translate: -8px 6px; scale: 1.03; } }
@keyframes hm2-drift { from { scale: 1; translate: 0 0; } to { scale: 1.03; translate: 0 -4px; } }

@media print {
	.hm-ring__wave { display: none !important; }
}
