/* ==========================================================================
   Motion graphics — Royal Blueprint
   Decorative, on-brand, white-on-royal. All motion stops for people who
   ask for reduced motion.
   ========================================================================== */

@keyframes mgDraw { to { stroke-dashoffset: 0; } }
@keyframes mgFadeIn { to { opacity: 1; } }
@keyframes mgPop {
	0% { opacity: 0; transform: scale(0); }
	70% { opacity: 1; transform: scale(1.35); }
	100% { opacity: 1; transform: scale(1); }
}
@keyframes mgRing {
	0% { opacity: .7; transform: scale(1); }
	100% { opacity: 0; transform: scale(4.5); }
}
@keyframes mgPacket {
	0% { opacity: 0; transform: translateY(-4px); }
	20% { opacity: 1; }
	80% { opacity: 1; }
	100% { opacity: 0; transform: translateY(16px); }
}
@keyframes mgSale {
	0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
	100% { box-shadow: 0 0 0 16px rgba(255,255,255,0); }
}
@keyframes mgSpark {
	0% { stroke-dashoffset: 1; opacity: 1; }
	45% { stroke-dashoffset: 0; opacity: 1; }
	85% { stroke-dashoffset: 0; opacity: 1; }
	100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes mgSparkDot {
	0%, 40% { opacity: 0; transform: scale(0); }
	50% { opacity: 1; transform: scale(1.4); }
	60%, 85% { opacity: 1; transform: scale(1); }
	100% { opacity: 0; transform: scale(1); }
}
@keyframes mgIcon { to { stroke-dashoffset: 0; } }
@keyframes mgIconAgain { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes mgRadar {
	0% { opacity: .55; transform: scale(.3); }
	100% { opacity: 0; transform: scale(2.6); }
}

/* ---------- 1. Hero growth line ---------- */
.hero > .mg-hero {
	position: absolute; right: 0; bottom: 0; z-index: 0;
	width: min(78%, 1040px);
	pointer-events: none;
}
.mg-hero svg { display: block; width: 100%; height: auto; overflow: visible; }
.mg-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mgDraw 2.8s .3s cubic-bezier(.2,.7,.2,1) forwards; }
.mg-area { opacity: 0; animation: mgFadeIn 1.4s 2s forwards; }
.mg-node, .mg-ring { transform-box: fill-box; transform-origin: center; opacity: 0; }
.mg-node { animation: mgPop .55s forwards; }
.mg-node.n1 { animation-delay: 1.1s; }
.mg-node.n2 { animation-delay: 1.8s; }
.mg-node.n3 { animation-delay: 2.5s; }
.mg-ring { animation: mgRing 3s infinite; }
.mg-ring.n1 { animation-delay: 1.3s; }
.mg-ring.n2 { animation-delay: 2.3s; }
.mg-ring.n3 { animation-delay: 3.3s; }
.mg-dot { opacity: 0; animation: mgFadeIn .6s 3s forwards; }
.mg-arrow { opacity: 0; animation: mgFadeIn .5s 2.9s forwards; }
.hero .hero-grid { position: relative; z-index: 1; }

/* Parallax: the chart sits in a far layer */
.px-on .hero > .mg-hero { transform: translate3d(0, calc(var(--p, 0) * 110px * var(--pxs, 1)), 0); will-change: transform; }

/* ---------- 2. Blueprint card: data packets + sale pulse ---------- */
.flow li + li::after {
	content: ""; position: absolute; left: 32px; top: -19px;
	width: 8px; height: 8px; border-radius: 50%;
	background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.18);
	opacity: 0;
	animation: mgPacket 2.4s infinite;
}
.flow li:nth-child(2)::after { animation-delay: 1s; }
.flow li:nth-child(3)::after { animation-delay: 1.5s; }
.flow li:nth-child(4)::after { animation-delay: 2s; }
.flow li:nth-child(5)::after { animation-delay: 2.5s; }
.flow li:last-child .flow-ic { animation: mgSale 2.4s 1.2s infinite; }

/* Mini growth chart */
.mg-spark { position: relative; height: 56px; margin-top: 18px; border-radius: var(--r-12); overflow: hidden; }
.mg-spark svg { display: block; width: 100%; height: 100%; }
.mg-spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mgSpark 5s 1.2s infinite; }
.mg-spark-dot { transform-box: fill-box; transform-origin: center; opacity: 0; animation: mgSparkDot 5s 1.2s infinite; }

/* ---------- 3. Icons draw themselves ---------- */
html:not(.no-js) .reveal .card-ic svg *,
html:not(.no-js) .reveal .report-list .ic svg * {
	stroke-dasharray: 120;
	stroke-dashoffset: 120;
}
.reveal.in .card-ic svg *,
.reveal.in .report-list .ic svg * {
	animation: mgIcon 1.4s .25s cubic-bezier(.2,.7,.2,1) forwards;
}
.reveal.in .report-list li:nth-child(2) .ic svg * { animation-delay: .45s; }
.reveal.in .report-list li:nth-child(3) .ic svg * { animation-delay: .65s; }
.card:hover .card-ic svg *,
.svc:hover .card-ic svg * {
	stroke-dashoffset: 0;
	animation: mgIconAgain .9s cubic-bezier(.2,.7,.2,1);
}

/* ---------- 4. Process progress line ---------- */
.mg-track {
	position: relative; height: 4px; border-radius: 4px;
	background: rgba(255,255,255,.22);
	margin: -16px 0 32px; overflow: visible;
}
.mg-track-fill {
	position: absolute; inset: 0; border-radius: 4px;
	background: #fff;
	transform-origin: left center;
	transform: scaleX(clamp(0, calc((var(--p, .4) + .6) / 1.2), 1));
	transition: transform .15s linear;
}
@media (max-width: 1080px) { .mg-track { display: none; } }

/* ---------- 5. Call-to-action radar pulses ---------- */
.cta-band { position: relative; }
.cta-band > .wrap { position: relative; z-index: 1; }
.mg-pulse { position: absolute; left: 50%; top: 66%; width: 0; height: 0; z-index: 0; pointer-events: none; }
.mg-pulse i {
	position: absolute; left: -170px; top: -170px; width: 340px; height: 340px;
	border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
	opacity: 0; animation: mgRadar 4.8s cubic-bezier(.2,.7,.2,1) infinite;
}
.mg-pulse i:nth-child(2) { animation-delay: 1.6s; }
.mg-pulse i:nth-child(3) { animation-delay: 3.2s; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
	.hero > .mg-hero { width: 120%; right: -10%; opacity: .55; }
	.mg-pulse i { left: -120px; top: -120px; width: 240px; height: 240px; }
}

/* ---------- Reduced motion: show the finished picture, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
	.mg-line, .mg-spark-line { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; }
	.mg-area, .mg-node, .mg-dot, .mg-arrow, .mg-spark-dot { animation: none !important; opacity: 1 !important; transform: none !important; }
	.mg-ring, .mg-pulse, .flow li + li::after { display: none !important; }
	.flow li:last-child .flow-ic { animation: none !important; }
	.reveal .card-ic svg *, .reveal .report-list .ic svg * { stroke-dashoffset: 0 !important; animation: none !important; }
	.mg-track-fill { transform: scaleX(1) !important; }
	.px-on .hero > .mg-hero { transform: none !important; }
}
