/**
 * Worldbrains Foundation - animations and motion utilities.
 * Complements the AOS scroll animation library.
 */

@keyframes wb-fade-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes wb-fade-up {
	from { opacity: 0; transform: translateY(28px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes wb-float {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-10px); }
}

@keyframes wb-pulse-ring {
	0%   { box-shadow: 0 0 0 0 rgba(20, 184, 166, .45); }
	70%  { box-shadow: 0 0 0 16px rgba(20, 184, 166, 0); }
	100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

@keyframes wb-shimmer {
	from { background-position: -400px 0; }
	to   { background-position: 400px 0; }
}

.wb-anim-fade-up { animation: wb-fade-up .7s ease both; }
.wb-anim-float { animation: wb-float 6s ease-in-out infinite; }

.wb-header__donate:hover { animation: wb-pulse-ring 1.4s ease-out infinite; }

.wb-hero__title,
.wb-hero__text { animation: wb-fade-up .8s ease both; }
.wb-hero__text { animation-delay: .12s; }

.wb-card,
.wb-events__item,
.wb-team__media img { will-change: transform; }

/* Skeleton shimmer for lazily loaded media. */
.wb-skeleton {
	background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
	background-size: 800px 100%;
	animation: wb-shimmer 1.4s linear infinite;
}

/* Underline sweep for footer and menu links. */
.wb-menu > li > a { position: relative; }
.wb-menu > li > a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 4px;
	height: 2px;
	background: var(--wb-primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s ease;
}
.wb-menu > li > a:hover::after,
.wb-menu > li.current-menu-item > a::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
	.wb-anim-fade-up,
	.wb-anim-float,
	.wb-hero__title,
	.wb-hero__text,
	.wb-header__donate:hover,
	.wb-skeleton { animation: none !important; }
}
