/**
 * The QRSVP mark's loop, in the site's header, on WordPress's sign-in pages
 * and in WordPress's toolbar (owner, 16 Oct 2026: "I really intentionally
 * make it loop"). Every 6 s the check wipes away, an amber line scans down
 * the code and each finder square lights amber as it passes, then the check
 * draws itself again like a pen stroke, pops, sends out a green ripple, and
 * holds. Until then the header and the sign-in pages drew the check once
 * and the toolbar showed the Site Icon, a still PNG.
 *
 * The keyframes are docs/assets/qrsvp-logo-animated-loop 1b.svg's, renamed:
 * they live here because an inline SVG's <style> is the whole page's, and
 * the mark is printed in several places a page (qrsvp_site_logo_mark()).
 * A copy with the class qs-logo-loop plays; the footer's holds still
 * (owner). Without this file the scan and the ripple stay at their
 * opacity="0" and the check simply shows. Loaded with the site's pages,
 * the sign-in pages and wherever the toolbar shows (inc/assets.php) —
 * never a style of an event's page.
 */

/* The toolbar's mark sits where WordPress puts the Site Icon, at its size:
   core's rules for img.site-icon (wp-includes/css/admin-bar.css), which
   also has to beat its own reset (#wpadminbar * { width: auto; … }). */
#wpadminbar #wp-admin-bar-site-name > .ab-item svg.qs-toolbar-mark {
	flex: none;
	width: 20px;
	height: 20px;
	max-width: 20px;
	max-height: 20px;
	min-width: 20px;
	min-height: 20px;
	border-radius: 3px;
}

@media screen and (max-width: 782px) {
	#wpadminbar #wp-admin-bar-site-name > .ab-item svg.qs-toolbar-mark {
		position: absolute;
		top: 9px;
		left: 12px;
		width: 28px;
		height: 28px;
		max-width: 28px;
		max-height: 28px;
		min-width: 28px;
		min-height: 28px;
		border-radius: 5px;
	}
}

.qs-logo-loop .qs-logo-scan {
	animation: qs-logo-scan 6s linear infinite;
}

.qs-logo-loop .qs-logo-dot {
	transform-box: fill-box;
	transform-origin: center;
}

.qs-logo-loop .qs-logo-dot--top {
	animation: qs-logo-dot-top 6s infinite;
}

.qs-logo-loop .qs-logo-dot--bottom {
	animation: qs-logo-dot-bottom 6s infinite;
}

.qs-logo-loop .qs-check-draw {
	stroke-dasharray: 1;
	stroke-dashoffset: 0;
	animation: qs-logo-check 6s infinite;
}

.qs-logo-loop .qs-logo-pop {
	transform-box: view-box;
	transform-origin: 353px 344px;
	animation: qs-logo-pop 6s infinite;
}

.qs-logo-loop .qs-logo-ripple {
	transform-box: view-box;
	transform-origin: 353px 344px;
	animation: qs-logo-ripple 6s infinite;
}

@keyframes qs-logo-check {
	0%,
	4.2% {
		stroke-dashoffset: 0;
		animation-timing-function: cubic-bezier(.5, 0, .75, 0);
	}

	10.8% {
		stroke-dashoffset: -1;
	}

	33.3% {
		stroke-dashoffset: -1;
		animation-timing-function: cubic-bezier(.25, .6, .3, 1);
	}

	43.3%,
	100% {
		stroke-dashoffset: -2;
	}
}

@keyframes qs-logo-scan {
	0%,
	10% {
		opacity: 0;
		transform: translateY(70px);
	}

	12.5%,
	30.8% {
		opacity: 1;
	}

	33.3%,
	100% {
		opacity: 0;
		transform: translateY(444px);
	}
}

@keyframes qs-logo-dot-top {
	0%,
	13.3% {
		transform: scale(1);
		fill: #f2f5f8;
		animation-timing-function: cubic-bezier(.3, 0, .2, 1);
	}

	15.6% {
		transform: scale(1.28);
		fill: #f7961c;
		animation-timing-function: cubic-bezier(.4, 0, .2, 1);
	}

	20.8%,
	100% {
		transform: scale(1);
		fill: #f2f5f8;
	}
}

@keyframes qs-logo-dot-bottom {
	0%,
	25.3% {
		transform: scale(1);
		fill: #f2f5f8;
		animation-timing-function: cubic-bezier(.3, 0, .2, 1);
	}

	27.6% {
		transform: scale(1.28);
		fill: #f7961c;
		animation-timing-function: cubic-bezier(.4, 0, .2, 1);
	}

	33%,
	100% {
		transform: scale(1);
		fill: #f2f5f8;
	}
}

@keyframes qs-logo-pop {
	0%,
	40.8% {
		transform: scale(1);
		animation-timing-function: cubic-bezier(.3, 0, .3, 1);
	}

	45% {
		transform: scale(1.08);
		animation-timing-function: cubic-bezier(.4, 0, .4, 1);
	}

	50.8%,
	100% {
		transform: scale(1);
	}
}

@keyframes qs-logo-ripple {
	0%,
	41.7% {
		opacity: 0;
		transform: scale(1.1);
		animation-timing-function: cubic-bezier(.2, .6, .3, 1);
	}

	43.3% {
		opacity: .5;
	}

	63.3%,
	100% {
		opacity: 0;
		transform: scale(1.7);
	}
}

/* Without motion the mark holds still, the check simply there. */
@media (prefers-reduced-motion: reduce) {
	.qs-logo-loop .qs-logo-scan,
	.qs-logo-loop .qs-logo-dot--top,
	.qs-logo-loop .qs-logo-dot--bottom,
	.qs-logo-loop .qs-check-draw,
	.qs-logo-loop .qs-logo-pop,
	.qs-logo-loop .qs-logo-ripple {
		animation: none;
	}
}
