/* Motion wave 2, M4: bands and media (qa/final-2026-11-22/MOTION.md).
   CTA light, split rows and ticks, showcase and split badge drift, bento tile glyphs,
   related and post arrows, post image settle, quote stars.
   Rules: everything sits under html.motion-ok; ambient loops also need the `m2-live` class
   that motion2-bands.js toggles while the element is in view (CTA on Rich, Medium and Light
   pages; the other loops on Rich and Medium; nothing on Still pages). The first keyframe of
   every loop is the static design. Paused, reduced motion (motion.css), no JS and print:
   static end state. Only transform, opacity and stroke-dashoffset animate. */

/* ================================================================ CTA band light
   One decorative layer under the copy (later positioned siblings paint above it). An
   ellipse centred on the band's bottom edge, so it only reaches the lower part of the band
   and fades to nothing well below the heading. Invisible at rest (opacity 0), so a loop
   that never starts is today's band. 8s pass from left to right. */
.cta__glow {
	position: absolute; left: -30%; bottom: -75%; width: 60%; height: 130%;
	border-radius: 50%; pointer-events: none; opacity: 0;
	background: radial-gradient(closest-side, rgba(131, 138, 236, .2), rgba(131, 138, 236, 0));
}
.cta--card .cta__glow { background: radial-gradient(closest-side, rgba(222, 224, 255, .9), rgba(222, 224, 255, 0)); }
.cta--lav .cta__glow { background: radial-gradient(closest-side, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); }
@keyframes m2-cta-light {
	0% { opacity: 0; transform: translate3d(0, 0, 0); }
	50% { opacity: 1; transform: translate3d(100%, 0, 0); }
	100% { opacity: 0; transform: translate3d(200%, 0, 0); }
}
html.motion-ok .cta.is-in.m2-live .cta__glow { animation: m2-cta-light 8s var(--ease-in-out) 1s infinite; }

/* ================================================================ Split
   Facts panel: rows rise in order, then a soft lavender light passes down the rows once. */
.split__row { position: relative; isolation: isolate; }
.split__row::before {
	content: ""; position: absolute; inset: 0 -12px; z-index: -1; border-radius: 10px;
	background: var(--c-lav-soft); opacity: 0; pointer-events: none;
}
@keyframes m2-row-light { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
html.motion-ok .split__panel .split__row > * {
	transition: opacity 600ms var(--ease-out-quart), transform 600ms var(--ease-out-quart);
	transition-delay: calc(250ms + var(--ri, 0) * var(--stagger-list));
}
html.motion-ok .split__panel:not(.is-in) .split__row > * { opacity: 0; transform: translateX(-8px); }
html.motion-ok .split__panel.is-in:not(.is-instant) .split__row::before {
	animation: m2-row-light 1100ms var(--ease-out-quart) both;
	animation-delay: calc(650ms + var(--ri, 0) * 180ms);
}

/* Check marks (split copy and showcase points): the tick draws after its box pops. */
html.motion-ok [data-reveal] .ss-check__tick .ico path {
	stroke-dasharray: 18; stroke-dashoffset: 0;
	transition: stroke-dashoffset 450ms var(--ease-out-quart);
	transition-delay: calc(var(--extra, 0ms) + 320ms + var(--i, 0) * var(--stagger-list));
}
html.motion-ok [data-reveal]:not(.is-in) .ss-check__tick .ico path { stroke-dashoffset: 18; }
html.motion-ok .is-instant .ss-check__tick .ico path { transition: none; }

/* Image split badge (floating tag): a slow 5px float once it has landed. */
@keyframes m2-float { from { transform: none; } to { transform: translateY(-5px); } }
html.motion-ok .split__media.is-in .split__badge.m2-live { animation: m2-float 6s var(--ease-in-out) 1.2s infinite alternate; }

/* Quote stars (split quote panel and the quote section rating) pop in order. */
html.motion-ok :is(.split__quote, .quote__rating)[data-reveal] :is(.split__stars, .quote__stars) > svg {
	transition: opacity 400ms var(--ease-out-quart), transform 600ms var(--ease-spring-ui);
}
html.motion-ok :is(.split__quote, .quote__rating)[data-reveal]:not(.is-in) :is(.split__stars, .quote__stars) > svg { opacity: 0; transform: scale(.6); }
:is(.split__stars, .quote__stars) > svg:nth-child(1) { transition-delay: 200ms; }
:is(.split__stars, .quote__stars) > svg:nth-child(2) { transition-delay: 260ms; }
:is(.split__stars, .quote__stars) > svg:nth-child(3) { transition-delay: 320ms; }
:is(.split__stars, .quote__stars) > svg:nth-child(4) { transition-delay: 380ms; }
:is(.split__stars, .quote__stars) > svg:nth-child(5) { transition-delay: 440ms; }
html.motion-ok .is-instant :is(.split__stars, .quote__stars) > svg { transition: none; }

/* ================================================================ Showcase
   After the image settles, it drifts very slowly while in view (as the bento lead). */
html.motion-ok .showcase__visual.is-in.m2-live .ss-media > img {
	animation: sth-drift 7s var(--ease-in-out) 1.4s infinite alternate;
}

/* ================================================================ Bento tiles
   The icon tile pops and its layers glyph draws; the number follows. */
html.motion-ok .bento__tile[data-reveal] .bento__ico {
	transition: opacity 400ms var(--ease-out-quart), transform 600ms var(--ease-spring-ui);
	transition-delay: calc(min(calc(var(--i, 0) * var(--stagger-grid)), var(--stagger-cap)) + 180ms);
}
html.motion-ok .bento__tile[data-reveal] .bento__ico .ico path {
	stroke-dasharray: 92; stroke-dashoffset: 0;
	transition: stroke-dashoffset 900ms var(--ease-out-quart);
	transition-delay: calc(min(calc(var(--i, 0) * var(--stagger-grid)), var(--stagger-cap)) + 280ms);
}
html.motion-ok .bento__tile[data-reveal] .bento__k {
	transition: opacity 500ms var(--ease-out-quart), transform 500ms var(--ease-out-quart);
	transition-delay: calc(min(calc(var(--i, 0) * var(--stagger-grid)), var(--stagger-cap)) + 360ms);
}
html.motion-ok .bento__tile[data-reveal]:not(.is-in) .bento__ico { opacity: 0; transform: scale(.9); }
html.motion-ok .bento__tile[data-reveal]:not(.is-in) .bento__ico .ico path { stroke-dashoffset: 92; }
html.motion-ok .bento__tile[data-reveal]:not(.is-in) .bento__k { opacity: 0; transform: translateY(4px); }
html.motion-ok .bento__tile.is-instant :is(.bento__ico, .bento__ico .ico path, .bento__k) { transition: none; }

/* ================================================================ Related and post arrows
   The arrow slides in from the lower left once its card has risen. An animation with
   backwards fill, so the hover nudge in components.css keeps working afterwards. */
@keyframes m2-arrow-in { from { opacity: 0; transform: translate(-6px, 6px); } to { opacity: 1; transform: none; } }
html.motion-ok :is(.related__item, .post).is-in:not(.is-instant) .arrow-ne {
	animation: m2-arrow-in 600ms var(--ease-out-quart) backwards;
	animation-delay: calc(min(calc(var(--i, 0) * var(--stagger-grid)), var(--stagger-cap)) + 350ms);
}

/* Post card images settle from 1.06 with their card (spec 6.1). */
html.motion-ok .post.is-in:not(.is-instant) .post__media img {
	animation: sth-settle var(--dur-settle) var(--ease-out-expo) backwards;
	animation-delay: min(calc(var(--i, 0) * var(--stagger-grid)), var(--stagger-cap));
}

/* ================================================================ Paused, reduced, print */
html.motion-paused :is(.split__row > *, .ss-check__tick .ico path, .split__stars > svg, .quote__stars > svg, .bento__ico, .bento__ico .ico path, .bento__k) {
	opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important;
}
html.motion-paused .cta__glow, html.motion-paused .split__row::before { opacity: 0 !important; }
@media print {
	.cta__glow, .split__row::before { display: none !important; }
}
