/**
 * Imvusa Preloader — logo animation on page load
 */

:root {
	--imvusa-preloader-bg: #b5b07d;
	--imvusa-preloader-accent: #8F714D;
}

body.imvusa-loading {
	overflow: hidden;
}

.imvusa-preloader {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--imvusa-preloader-bg);
	transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.imvusa-preloader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.imvusa-preloader-inner {
	text-align: center;
	position: relative;
	padding: 2rem;
}

.imvusa-preloader-ring {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 220px;
	height: 220px;
	margin: -110px 0 0 -110px;
	border: 2px solid rgba(143, 113, 77, 0.15);
	border-top-color: var(--imvusa-preloader-accent);
	border-radius: 50%;
	animation: imvusaRingSpin 1.2s linear infinite;
}

.imvusa-preloader-logo-wrap {
	position: relative;
	z-index: 2;
	animation: imvusaLogoReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	opacity: 0;
	transform: scale(0.7) translateY(20px);
}

.imvusa-preloader-logo {
	max-width: min(280px, 70vw);
	height: auto;
	display: block;
	margin: 0 auto;
	filter: drop-shadow(0 8px 32px rgba(143, 113, 77, 0.3));
	animation: imvusaLogoPulse 2s ease-in-out 0.8s infinite;
}

.imvusa-preloader-progress {
	width: 180px;
	height: 3px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 3px;
	margin: 2rem auto 0.75rem;
	overflow: hidden;
	opacity: 0;
	animation: imvusaFadeIn 0.5s ease 0.4s forwards;
}

.imvusa-preloader-bar {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--imvusa-preloader-accent), #C4A574);
	border-radius: 3px;
	animation: imvusaProgressBar 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.imvusa-preloader-tagline {
	color: rgba(255, 255, 255, 0.45);
	font-family: 'DM Sans', sans-serif;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin: 0;
	opacity: 0;
	animation: imvusaFadeIn 0.5s ease 0.6s forwards;
}

@keyframes imvusaRingSpin {
	to { transform: rotate(360deg); }
}

@keyframes imvusaLogoReveal {
	0% {
		opacity: 0;
		transform: scale(0.7) translateY(20px);
	}
	60% {
		opacity: 1;
		transform: scale(1.05) translateY(0);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@keyframes imvusaLogoPulse {
	0%, 100% { filter: drop-shadow(0 8px 32px rgba(143, 113, 77, 0.3)); }
	50% { filter: drop-shadow(0 8px 48px rgba(143, 113, 77, 0.55)); }
}

@keyframes imvusaProgressBar {
	0% { width: 0; }
	40% { width: 60%; }
	80% { width: 90%; }
	100% { width: 100%; }
}

@keyframes imvusaFadeIn {
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.imvusa-preloader-ring,
	.imvusa-preloader-logo-wrap,
	.imvusa-preloader-logo,
	.imvusa-preloader-bar {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.imvusa-preloader-progress,
	.imvusa-preloader-tagline {
		opacity: 1;
	}

	.imvusa-preloader-bar {
		width: 100%;
	}
}
