/**
 * Ultra Preloader Studio - Public Frontend Stylesheet
 * Lightweight, GPU-composited animations with prefers-reduced-motion support.
 */

html.ups-scroll-locked,
body.ups-scroll-locked {
	overflow: hidden !important;
}

.ups-overlay,
#ups-preloader-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483640;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
	box-sizing: border-box;
	will-change: opacity, transform;
}

.ups-overlay.ups-boxed {
	padding: 24px;
}

.ups-overlay.ups-is-hidden,
#ups-preloader-overlay.ups-is-hidden {
	display: none !important;
	pointer-events: none !important;
	visibility: hidden !important;
}

/* Position Alignment */
.ups-overlay.ups-pos-center { align-items: center; justify-content: center; }
.ups-overlay.ups-pos-top { align-items: flex-start; justify-content: center; padding-top: 10vh; }
.ups-overlay.ups-pos-bottom { align-items: flex-end; justify-content: center; padding-bottom: 10vh; }
.ups-overlay.ups-pos-left { align-items: center; justify-content: flex-start; padding-left: 10vw; }
.ups-overlay.ups-pos-right { align-items: center; justify-content: flex-end; padding-right: 10vw; }

/* Background Layer & Scrim */
.ups-bg-layer {
	position: absolute;
	inset: -24px;
	background: var(--ups-bg, #0b0f19);
	background-position: center;
	background-repeat: no-repeat;
	filter: blur(var(--ups-bg-blur, 0px));
	transform: translateZ(0);
	z-index: 0;
	pointer-events: none;
}

.ups-bg-scrim {
	position: absolute;
	inset: 0;
	background-color: var(--ups-overlay-color, rgba(0, 0, 0, 0.45));
	z-index: 1;
	pointer-events: none;
}

/* Background Animations */
.ups-bg-anim-gradient-shift .ups-bg-layer {
	background-size: 200% 200% !important;
	animation: upsBgGradientShift 8s ease infinite;
}

.ups-bg-anim-subtle-zoom .ups-bg-layer {
	animation: upsBgSubtleZoom 12s ease-in-out infinite alternate;
}

.ups-bg-anim-pulse-fade .ups-bg-layer {
	animation: upsBgPulseFade 4s ease-in-out infinite;
}

.ups-bg-anim-pan-slow .ups-bg-layer {
	background-size: 120% 120% !important;
	animation: upsBgPanSlow 14s ease-in-out infinite alternate;
}

/* Stage Container */
.ups-stage {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--ups-stack-gap, 24px);
	max-width: 90vw;
	text-align: center;
	will-change: transform, opacity;
}

/* Media Wrapper & Image */
.ups-media-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ups-logo-image {
	display: block;
	width: var(--ups-img-width, 110px);
	height: var(--ups-img-height, auto);
	max-width: min(var(--ups-img-max-width, 260px), 80vw);
	opacity: var(--ups-img-opacity, 1);
	border-radius: var(--ups-img-radius, 16px);
	filter: var(--ups-img-filter, none);
	transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1));
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	will-change: transform, opacity;
}

/* =========================================================
   ENTRANCE ANIMATIONS (10 Presets)
   ========================================================= */
.ups-entrance-fade-in { animation: upsFadeIn var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-zoom-in { animation: upsZoomIn var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-slide-up { animation: upsSlideUp var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-slide-down { animation: upsSlideDown var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-slide-left { animation: upsSlideLeft var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-slide-right { animation: upsSlideRight var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-bounce-in { animation: upsBounceIn var(--ups-entrance-duration, 750ms) cubic-bezier(0.215, 0.61, 0.355, 1) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-rotate-in { animation: upsRotateIn var(--ups-entrance-duration, 650ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; }
.ups-entrance-flip-in { animation: upsFlipIn var(--ups-entrance-duration, 700ms) var(--ups-anim-timing, ease-out) var(--ups-anim-delay, 0ms) both; backface-visibility: visible; }
.ups-entrance-elastic-in { animation: upsElasticIn var(--ups-entrance-duration, 850ms) cubic-bezier(0.34, 1.56, 0.64, 1) var(--ups-anim-delay, 0ms) both; }

/* =========================================================
   CONTINUOUS ANIMATIONS (11 Presets)
   ========================================================= */
.ups-continuous-pulse { animation: upsPulse var(--ups-continuous-duration, 2000ms) var(--ups-anim-timing, ease-in-out) var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-floating { animation: upsFloating var(--ups-continuous-duration, 2400ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-breathing { animation: upsBreathing var(--ups-continuous-duration, 2200ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-swing { transform-origin: top center; animation: upsSwing var(--ups-continuous-duration, 1800ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-shake { animation: upsShake var(--ups-continuous-duration, 1200ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-bounce { animation: upsBounce var(--ups-continuous-duration, 1400ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-rotate { animation: upsRotate var(--ups-continuous-duration, 2400ms) linear var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-heartbeat { animation: upsHeartbeat var(--ups-continuous-duration, 1500ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-glow { animation: upsGlow var(--ups-continuous-duration, 2000ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-swinging { transform-origin: center center; animation: upsSwinging var(--ups-continuous-duration, 2200ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }
.ups-continuous-rubber-band { animation: upsRubberBand var(--ups-continuous-duration, 1800ms) ease-in-out var(--ups-anim-delay, 0ms) var(--ups-anim-iteration, infinite); }

/* =========================================================
   EXIT ANIMATIONS (7 Presets)
   ========================================================= */
.ups-overlay.ups-exit-fade-out { animation: upsFadeOut var(--ups-exit-duration, 500ms) ease forwards; pointer-events: none; }
.ups-overlay.ups-exit-zoom-out { animation: upsZoomOut var(--ups-exit-duration, 500ms) ease forwards; pointer-events: none; }
.ups-overlay.ups-exit-slide-up-out { animation: upsSlideUpOut var(--ups-exit-duration, 500ms) cubic-bezier(0.16, 1, 0.3, 1) forwards; pointer-events: none; }
.ups-overlay.ups-exit-slide-down-out { animation: upsSlideDownOut var(--ups-exit-duration, 500ms) cubic-bezier(0.16, 1, 0.3, 1) forwards; pointer-events: none; }
.ups-overlay.ups-exit-rotate-out .ups-stage { animation: upsRotateOut var(--ups-exit-duration, 500ms) ease forwards; }
.ups-overlay.ups-exit-rotate-out { animation: upsFadeOut var(--ups-exit-duration, 500ms) ease forwards; pointer-events: none; }
.ups-overlay.ups-exit-flip-out .ups-stage { animation: upsFlipOut var(--ups-exit-duration, 500ms) ease forwards; }
.ups-overlay.ups-exit-flip-out { animation: upsFadeOut var(--ups-exit-duration, 500ms) ease forwards; pointer-events: none; }
.ups-overlay.ups-exit-bounce-out .ups-stage { animation: upsBounceOut var(--ups-exit-duration, 500ms) ease forwards; }
.ups-overlay.ups-exit-bounce-out { animation: upsFadeOut var(--ups-exit-duration, 500ms) ease forwards; pointer-events: none; }

/* =========================================================
   LOADING INDICATORS (8 Styles)
   ========================================================= */
.ups-indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.ups-indicator.ups-ind-around {
	position: absolute;
	inset: -16px;
	pointer-events: none;
}

/* 1. Circular Spinner */
.ups-spinner-circle {
	width: var(--ups-ind-size, 38px);
	height: var(--ups-ind-size, 38px);
	border-radius: 50%;
	border: 3px solid var(--ups-ind-track, rgba(255, 255, 255, 0.16));
	border-top-color: var(--ups-ind-color, #3b82f6);
	animation: upsRotate var(--ups-ind-speed, 900ms) linear infinite;
	box-sizing: border-box;
}

/* 2. Dots Loader */
.ups-ind-dots-loader {
	gap: 8px;
}
.ups-ind-dots-loader .ups-dot {
	width: calc(var(--ups-ind-size, 38px) * 0.24);
	height: calc(var(--ups-ind-size, 38px) * 0.24);
	border-radius: 50%;
	background-color: var(--ups-ind-color, #3b82f6);
	animation: upsDotBounce var(--ups-ind-speed, 900ms) ease-in-out infinite both;
}
.ups-ind-dots-loader .ups-dot:nth-child(1) { animation-delay: -0.32s; }
.ups-ind-dots-loader .ups-dot:nth-child(2) { animation-delay: -0.16s; }

/* 3. Progress Bar */
.ups-progress-track {
	display: block;
	width: calc(var(--ups-ind-size, 38px) * 4.5);
	max-width: 72vw;
	height: max(4px, calc(var(--ups-ind-size, 38px) * 0.12));
	background-color: var(--ups-ind-track, rgba(255, 255, 255, 0.16));
	border-radius: 999px;
	overflow: hidden;
}
.ups-progress-fill {
	display: block;
	width: 45%;
	height: 100%;
	background-color: var(--ups-ind-color, #3b82f6);
	border-radius: 999px;
	animation: upsProgressSlide var(--ups-ind-speed, 1200ms) ease-in-out infinite;
}

/* 4. Pulsing Circle */
.ups-ind-pulsing-circle {
	width: var(--ups-ind-size, 38px);
	height: var(--ups-ind-size, 38px);
}
.ups-pulse-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--ups-ind-color, #3b82f6);
	animation: upsPulseRing var(--ups-ind-speed, 1200ms) cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
.ups-pulse-core {
	width: 42%;
	height: 42%;
	border-radius: 50%;
	background-color: var(--ups-ind-color, #3b82f6);
}

/* 5. Rotating Ring (Dual Orbit) */
.ups-dual-ring {
	width: var(--ups-ind-size, 38px);
	height: var(--ups-ind-size, 38px);
	border-radius: 50%;
	border: 3px solid transparent;
	border-top-color: var(--ups-ind-color, #3b82f6);
	border-bottom-color: var(--ups-ind-color, #3b82f6);
	animation: upsRotate var(--ups-ind-speed, 1000ms) linear infinite;
	box-sizing: border-box;
}

/* 6. Animated Lines (Equalizer) */
.ups-ind-animated-lines {
	gap: 4px;
	height: var(--ups-ind-size, 38px);
	align-items: center;
}
.ups-eq-bar {
	width: max(3px, calc(var(--ups-ind-size, 38px) * 0.1));
	height: 100%;
	border-radius: 3px;
	background-color: var(--ups-ind-color, #3b82f6);
	animation: upsEqWave var(--ups-ind-speed, 950ms) ease-in-out infinite;
}
.ups-eq-bar:nth-child(2) { animation-delay: 0.1s; }
.ups-eq-bar:nth-child(3) { animation-delay: 0.2s; }
.ups-eq-bar:nth-child(4) { animation-delay: 0.3s; }
.ups-eq-bar:nth-child(5) { animation-delay: 0.4s; }

/* 7. Percentage Counter */
.ups-percent-value {
	font-family: var(--ups-text-family, system-ui);
	font-size: calc(var(--ups-ind-size, 38px) * 0.52);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ups-ind-color, #3b82f6);
	line-height: 1;
}

/* =========================================================
   LOADING TEXT
   ========================================================= */
.ups-text {
	font-family: var(--ups-text-family, system-ui);
	font-size: var(--ups-text-size, 15px);
	font-weight: var(--ups-text-weight, 500);
	color: var(--ups-text-color, #e2e8f0);
	letter-spacing: var(--ups-text-spacing, 1px);
	line-height: 1.4;
	margin: 0;
}

.ups-text-anim-fade-pulse {
	animation: upsTextFadePulse 1.8s ease-in-out infinite;
}
.ups-text-anim-slide-up {
	animation: upsSlideUp 0.6s ease-out both;
}
.ups-text-anim-shimmer {
	opacity: 0.92;
	animation: upsTextShimmer 2s linear infinite;
}
.ups-text-anim-typing-dots::after {
	content: "";
	animation: upsTypingDots 1.4s steps(4, end) infinite;
}

/* =========================================================
   KEYFRAMES
   ========================================================= */
@keyframes upsFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes upsZoomIn {
	from { opacity: 0; transform: scale(0.72); }
	to { opacity: 1; transform: scale(1); }
}
@keyframes upsSlideUp {
	from { opacity: 0; transform: translate3d(0, 32px, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes upsSlideDown {
	from { opacity: 0; transform: translate3d(0, -32px, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes upsSlideLeft {
	from { opacity: 0; transform: translate3d(36px, 0, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes upsSlideRight {
	from { opacity: 0; transform: translate3d(-36px, 0, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes upsBounceIn {
	0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); }
	50% { opacity: 1; transform: scale3d(1.06, 1.06, 1.06); }
	75% { transform: scale3d(0.95, 0.95, 0.95); }
	100% { opacity: 1; transform: scale3d(1, 1, 1); }
}
@keyframes upsRotateIn {
	from { opacity: 0; transform: rotate(-160deg) scale(0.75); }
	to { opacity: 1; transform: rotate(0deg) scale(1); }
}
@keyframes upsFlipIn {
	from { opacity: 0; transform: perspective(600px) rotateX(75deg); }
	to { opacity: 1; transform: perspective(600px) rotateX(0deg); }
}
@keyframes upsElasticIn {
	0% { opacity: 0; transform: scale(0.4); }
	60% { opacity: 1; transform: scale(1.12); }
	80% { transform: scale(0.96); }
	100% { opacity: 1; transform: scale(1); }
}

/* Continuous Keyframes */
@keyframes upsPulse {
	0%, 100% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); opacity: var(--ups-img-opacity, 1); }
	50% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(calc(var(--ups-img-scale, 1) * 1.07)); opacity: calc(var(--ups-img-opacity, 1) * 0.82); }
}
@keyframes upsFloating {
	0%, 100% { transform: translateY(0) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	50% { transform: translateY(-10px) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
}
@keyframes upsBreathing {
	0%, 100% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	50% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(calc(var(--ups-img-scale, 1) * 1.06)); }
}
@keyframes upsSwing {
	20% { transform: rotate(calc(var(--ups-img-rotation, 0deg) + 12deg)) scale(var(--ups-img-scale, 1)); }
	40% { transform: rotate(calc(var(--ups-img-rotation, 0deg) - 9deg)) scale(var(--ups-img-scale, 1)); }
	60% { transform: rotate(calc(var(--ups-img-rotation, 0deg) + 5deg)) scale(var(--ups-img-scale, 1)); }
	80% { transform: rotate(calc(var(--ups-img-rotation, 0deg) - 4deg)) scale(var(--ups-img-scale, 1)); }
	100% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
}
@keyframes upsShake {
	0%, 100% { transform: translateX(0) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	20%, 60% { transform: translateX(-6px) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	40%, 80% { transform: translateX(6px) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
}
@keyframes upsBounce {
	0%, 20%, 53%, 80%, 100% { transform: translateY(0) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	40%, 43% { transform: translateY(-14px) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	70% { transform: translateY(-7px) rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
}
@keyframes upsRotate {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}
@keyframes upsHeartbeat {
	0%, 100% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	14% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(calc(var(--ups-img-scale, 1) * 1.14)); }
	28% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
	42% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(calc(var(--ups-img-scale, 1) * 1.12)); }
	70% { transform: rotate(var(--ups-img-rotation, 0deg)) scale(var(--ups-img-scale, 1)); }
}
@keyframes upsGlow {
	0%, 100% { filter: drop-shadow(0 0 6px var(--ups-ind-color, #3b82f6)); }
	50% { filter: drop-shadow(0 0 22px var(--ups-ind-color, #3b82f6)); }
}
@keyframes upsSwinging {
	0%, 100% { transform: rotate(calc(var(--ups-img-rotation, 0deg) - 7deg)) scale(var(--ups-img-scale, 1)); }
	50% { transform: rotate(calc(var(--ups-img-rotation, 0deg) + 7deg)) scale(var(--ups-img-scale, 1)); }
}
@keyframes upsRubberBand {
	0%, 100% { transform: scale3d(1, 1, 1); }
	30% { transform: scale3d(1.16, 0.84, 1); }
	45% { transform: scale3d(0.88, 1.12, 1); }
	65% { transform: scale3d(1.06, 0.94, 1); }
}

/* Exit Keyframes */
@keyframes upsFadeOut {
	from { opacity: 1; }
	to { opacity: 0; }
}
@keyframes upsZoomOut {
	from { opacity: 1; transform: scale(1); }
	to { opacity: 0; transform: scale(1.12); }
}
@keyframes upsSlideUpOut {
	from { opacity: 1; transform: translate3d(0, 0, 0); }
	to { opacity: 0; transform: translate3d(0, -100%, 0); }
}
@keyframes upsSlideDownOut {
	from { opacity: 1; transform: translate3d(0, 0, 0); }
	to { opacity: 0; transform: translate3d(0, 100%, 0); }
}
@keyframes upsRotateOut {
	from { opacity: 1; transform: rotate(0deg) scale(1); }
	to { opacity: 0; transform: rotate(120deg) scale(0.7); }
}
@keyframes upsFlipOut {
	from { opacity: 1; transform: perspective(600px) rotateX(0deg); }
	to { opacity: 0; transform: perspective(600px) rotateX(75deg); }
}
@keyframes upsBounceOut {
	0% { opacity: 1; transform: scale(1); }
	35% { opacity: 1; transform: scale(1.08); }
	100% { opacity: 0; transform: scale(0.35); }
}

/* Indicator & Text Keyframes */
@keyframes upsDotBounce {
	0%, 80%, 100% { transform: scale(0.45); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}
@keyframes upsProgressSlide {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(260%); }
}
@keyframes upsPulseRing {
	0% { transform: scale(0.35); opacity: 0.9; }
	100% { transform: scale(1.25); opacity: 0; }
}
@keyframes upsEqWave {
	0%, 100% { transform: scaleY(0.35); opacity: 0.65; }
	50% { transform: scaleY(1); opacity: 1; }
}
@keyframes upsTextFadePulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}
@keyframes upsTextShimmer {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}
@keyframes upsTypingDots {
	0% { content: ""; }
	25% { content: "."; }
	50% { content: ".."; }
	75% { content: "..."; }
}
@keyframes upsBgGradientShift {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}
@keyframes upsBgSubtleZoom {
	from { transform: scale(1); }
	to { transform: scale(1.08); }
}
@keyframes upsBgPulseFade {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.78; }
}
@keyframes upsBgPanSlow {
	from { background-position: 0% 0%; }
	to { background-position: 100% 100%; }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.ups-stage,
	.ups-logo-image,
	.ups-bg-layer,
	.ups-spinner-circle,
	.ups-dot,
	.ups-progress-fill,
	.ups-pulse-ring,
	.ups-dual-ring,
	.ups-eq-bar,
	.ups-text {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
