/* Scoped to the loader so Vue app body, #app and global styles are unchanged. */
.avatar-loader,
.avatar-loader *,
.avatar-loader *::before,
.avatar-loader *::after {
	box-sizing: border-box;
}

.avatar-loader {
	color-scheme: dark;
	font-family: Georgia, "Times New Roman", serif;
	--gold-1: #fff2ac;
	--gold-2: #ffd45a;
	--gold-3: #e69a13;
	--gold-4: #7d3d04;
	position: fixed;
	inset: 0;
	z-index: 9999;
	isolation: isolate;
	width: 100%;
	height: 100dvh;
	min-height: 560px;
	overflow: hidden;
	background: #03070c;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition:
		opacity 280ms ease,
		visibility 280ms ease;
}

.avatar-loader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.avatar-loader__background {
	position: absolute;
	inset: 0;
	z-index: -3;
	background:
		url("../img/preloader/background.webp")
		center center / cover no-repeat;
	transform: scale(1.004);
}

.avatar-loader__vignette {
	position: absolute;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background:
		radial-gradient(
			circle at 50% 43%,
			rgba(0, 0, 0, 0) 0 27%,
			rgba(0, 0, 0, .08) 48%,
			rgba(0, 0, 0, .31) 100%
		),
		linear-gradient(
			180deg,
			rgba(2, 6, 12, .04),
			rgba(2, 6, 12, 0) 58%,
			rgba(0, 0, 0, .12)
		);
}

.avatar-loader__stage {
	position: absolute;
	left: 50%;
	top: 47%;
	display: grid;
	justify-items: center;
	width: min(88vmin, 900px);
	transform: translate(-50%, -50%);
}

.loader-orbit {
	position: relative;
	width: min(72vmin, 720px);
	aspect-ratio: 1;
}

.loader-orbit__svg {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.arc {
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.arc--outline {
	stroke: rgba(222, 151, 40, .86);
	stroke-width: 36;
	filter:
		drop-shadow(0 0 3px rgba(255, 211, 111, .42))
		drop-shadow(0 0 7px rgba(190, 106, 13, .26));
}

.arc--progress-glow {
	stroke: rgba(255, 174, 24, .88);
	stroke-width: 42;
	filter: url("#arcGlow");
	opacity: .76;
}

.arc--progress {
	stroke: url("#arcGold");
	stroke-width: 21;
	filter:
		drop-shadow(0 0 3px rgba(255, 255, 221, .95))
		drop-shadow(0 0 13px rgba(255, 180, 34, .96));
}

.arc-start circle {
	fill: #120904;
	stroke: #e5a52c;
	stroke-width: 4;
	filter: drop-shadow(0 0 7px rgba(255, 165, 25, .70));
}

.arc-start circle:nth-child(2) {
	stroke: #ffe68c;
	stroke-width: 3;
}

.arc-start circle:nth-child(3) {
	fill: #fff1a5;
	stroke: none;
}

.arc-end rect {
	fill: #140b05;
	stroke: #da9220;
	stroke-width: 3;
}

.arc-end rect:nth-child(2) {
	fill: #ffc638;
	stroke: #fff0a2;
	stroke-width: 2;
	filter: drop-shadow(0 0 7px rgba(255, 177, 34, .75));
}

.arc-head {
	pointer-events: none;
}

.arc-head__halo {
	fill: rgba(255, 181, 35, .20);
	stroke: none;
	filter: blur(5px);
}

.arc-head__ring {
	fill: #130a04;
	stroke: #ffd35a;
	stroke-width: 4;
	filter:
		drop-shadow(0 0 5px rgba(255, 236, 165, .95))
		drop-shadow(0 0 12px rgba(255, 153, 17, .90));
}

.arc-head__core {
	fill: #fff1a4;
	stroke: #db8d13;
	stroke-width: 1.5;
}

.arc-particles circle {
	fill: #ffeaa0;
	stroke: #ffb52f;
	stroke-width: 1;
	opacity: 0;
}

.arc-particles circle:nth-child(2n) {
	fill: #ffbf35;
}

.loader-orbit__logo {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 62%;
	transform: translate(-50%, -49%);
	filter:
		drop-shadow(0 0 9px rgba(255, 195, 59, .20))
		drop-shadow(0 0 24px rgba(205, 120, 8, .16));
}

.loader-orbit__logo img {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
	pointer-events: none;
}

.loader-copy {
	position: relative;
	display: grid;
	justify-items: center;
	width: min(58vmin, 520px);
	margin-top: clamp(-20px, -1.5vh, -6px);
	transform: translateY(-40px);
	text-align: center;
}

/* Texture compilation: thin blue loader centered between the ring and percentage. */
.loader-texture-progress {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: -43px;
	width: min(74vw, 320px);
	height: 4px;
	transform: translateX(-50%);
	border-radius: 999px;
	isolation: isolate;
	pointer-events: none;
}
.loader-texture-progress::before {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: -1;
	border: 1px solid rgba(91, 160, 255, .42);
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(10, 35, 76, .62), rgba(24, 66, 112, .54), rgba(9, 32, 78, .62));
	box-shadow: 0 0 9px rgba(28, 116, 236, .2), inset 0 0 5px rgba(42, 134, 255, .22);
}
.loader-texture-progress__fill {
	position: relative;
	display: block;
	width: 0%;
	height: 100%;
	border-radius: inherit;
	opacity: 0;
	background: linear-gradient(90deg, #1267c9 0%, #278cf7 34%, #65d2ff 78%, #e2f9ff 100%);
	box-shadow: 0 0 7px rgba(30, 131, 255, .95), 0 0 16px rgba(22, 104, 247, .5);
	transition: width 220ms ease-out, opacity 120ms ease-out;
}
.loader-texture-progress__fill::after {
	content: "";
	position: absolute;
	right: -4px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	transform: translateY(-50%);
	background: #e0f9ff;
	box-shadow: 0 0 5px #e0f9ff, 0 0 12px #37afff, 0 0 21px rgba(35, 114, 255, .72);
}

.loader-copy__percent {
	color: #fff0b5;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(44px, 5.2vw, 74px);
	font-variant-numeric: tabular-nums;
	line-height: 1;
	letter-spacing: .015em;
	text-shadow:
		0 0 6px rgba(255, 245, 203, .84),
		0 0 18px rgba(255, 159, 20, .48);
}

.loader-copy__ornament {
	display: grid;
	grid-template-columns: minmax(50px, 150px) auto minmax(50px, 150px);
	align-items: center;
	gap: 12px;
	width: min(72vw, 390px);
	margin: 10px 0 4px;
	color: #e0a23a;
}

.loader-copy__ornament span {
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(251, 197, 91, .88),
		transparent
	);
}

.loader-copy__ornament i {
	font-style: normal;
	font-size: 14px;
	text-shadow: 0 0 8px rgba(255, 175, 35, .55);
}

.loader-copy__label {
	margin: 0;
	color: #f2d894;
	font-size: clamp(15px, 1.4vw, 22px);
	letter-spacing: .29em;
	text-indent: .29em;
	text-shadow: 0 0 7px rgba(255, 169, 33, .42);
}

@media (max-aspect-ratio: 4 / 5) {
	.avatar-loader__stage {
		top: 47%;
		width: min(96vw, 820px);
	}

	.loader-orbit {
		width: min(92vw, 690px);
	}

	.loader-orbit__logo {
		width: 62%;
	}

	.loader-copy {
		width: 90vw;
	}
}

@media (max-width: 560px) {
	.loader-texture-progress {
		top: -33px;
		width: min(78vw, 320px);
	}
	.loader-orbit {
		width: min(96vw, 620px);
	}

	.loader-copy__percent {
		font-size: clamp(40px, 12vw, 62px);
	}

	.loader-copy__label {
		font-size: 14px;
		letter-spacing: .20em;
		text-indent: .20em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.loader-texture-progress__fill { transition: none; }
	.avatar-loader {
		transition-duration: 0.001ms;
	}

	.arc-particles circle,
	.arc-head {
		transition: none;
	}
}
