/* [uaf_site_loader] - full-screen intro overlay. The covered state is always a plain Bg Color
   + logo; uaf-site-loader.js builds each reveal style's layers only when the exit starts. */

/* Scroll lock that keeps the scrollbar: hiding it (overflow:hidden on html) makes it pop back in
   on reveal and shifts the whole page sideways. Instead the scrollbar stays, and the page is
   cut to one screen tall so there's simply nothing to scroll. */
html.uaf-sl-on {
	overflow-y: scroll !important;
}

html.uaf-sl-on body {
	height: 100vh !important;
	overflow: hidden !important;
}

html.uaf-sl-skip .uaf-sl:not(.is-leaving) {
	display: none !important;
}

.uaf-sl {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--uaf-sl-bg, #14121f);
	color: var(--uaf-sl-accent, #6c5ce8);
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
	/* Safety net if the script never runs - see uaf_site_loader_markup(). */
	animation: uaf-sl-failsafe 0.6s ease var(--uaf-sl-failsafe, 7000ms) forwards;
}

@keyframes uaf-sl-failsafe {
	to {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}
}

/* Exit running: the layers take over the background, clicks go through to the page. */
.uaf-sl.is-exiting {
	background: transparent;
	pointer-events: none;
	animation: none;
}

.uaf-sl.is-leaving {
	background: transparent;
	animation: none;
}

.uaf-sl.is-preview {
	animation: none;
}

.uaf-sl-layers {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.uaf-sl-layers > *,
.uaf-sl-layers svg {
	position: absolute;
	will-change: transform;
}

.uaf-sl-layers svg {
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.uaf-sl-stage {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 26px;
	pointer-events: none;
}

/* ---------- Logo ---------- */

.uaf-sl-logo {
	width: var(--uaf-sl-logo-w, 140px);
	max-width: 70vw;
	animation: uaf-sl-logo-in 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.uaf-sl-logo img,
.uaf-sl-logo svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 50vh;
	object-fit: contain;
}

@keyframes uaf-sl-logo-in {
	from {
		opacity: 0;
		transform: scale(0.9);
		filter: blur(10px);
	}
	to {
		opacity: 1;
		transform: none;
		filter: blur(0);
	}
}

.uaf-sl--logo-breathe .uaf-sl-logo-inner {
	animation: uaf-sl-breathe 2.6s ease-in-out 1s infinite alternate;
}

@keyframes uaf-sl-breathe {
	from {
		transform: scale(1);
		opacity: 1;
	}
	to {
		transform: scale(1.05);
		opacity: 0.82;
	}
}

.uaf-sl--logo-float .uaf-sl-logo-inner {
	animation: uaf-sl-float 3.4s ease-in-out infinite;
}

@keyframes uaf-sl-float {
	0%,
	100% {
		transform: translate3d(0, -7px, 0) rotate(-1.2deg);
	}
	50% {
		transform: translate3d(0, 7px, 0) rotate(1.2deg);
	}
}

.uaf-sl--logo-glow .uaf-sl-logo-inner {
	animation: uaf-sl-glow 2.2s ease-in-out infinite alternate;
}

@keyframes uaf-sl-glow {
	from {
		filter: drop-shadow(0 0 0 transparent);
	}
	to {
		filter: drop-shadow(0 0 18px var(--uaf-sl-accent)) drop-shadow(0 0 42px var(--uaf-sl-accent));
	}
}

/* Draw: every shape got pathLength="1" server-side, so a dash of 1 is always its full length.
   Stroke traces in the accent color, then the real fills fade in under it. */
.uaf-sl--logo-draw .uaf-sl-logo-inner [pathLength] {
	stroke: var(--uaf-sl-accent);
	stroke-width: 1.5px;
	vector-effect: non-scaling-stroke;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	fill-opacity: 0;
	animation:
		uaf-sl-draw 1.8s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards,
		uaf-sl-fill 0.9s ease 1.6s forwards;
}

@keyframes uaf-sl-draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes uaf-sl-fill {
	to {
		fill-opacity: 1;
		stroke-opacity: 0;
	}
}

/* ---------- Progress ---------- */

.uaf-sl-line {
	position: relative;
	width: min(180px, 50vw);
	height: 2px;
	border-radius: 2px;
	overflow: hidden;
	animation: uaf-sl-logo-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.uaf-sl-line::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: 0.2;
}

.uaf-sl-line-bar {
	position: absolute;
	inset: 0;
	background: currentColor;
	transform: scaleX(var(--uaf-sl-p, 0.04));
	transform-origin: left center;
	box-shadow: 0 0 12px currentColor;
}

.uaf-sl-counter {
	position: absolute;
	right: clamp(16px, 4vw, 56px);
	bottom: clamp(12px, 3vw, 40px);
	z-index: 2;
	display: flex;
	align-items: flex-start;
	font-size: clamp(44px, 9vw, 128px);
	font-weight: 200;
	line-height: 1;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
	animation: uaf-sl-logo-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.uaf-sl-counter-pct {
	margin: 0.12em 0 0 0.08em;
	font-size: 0.32em;
	opacity: 0.7;
}

/* ---------- Builder badge ---------- */

.uaf-sl-badge {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	/* Solid dark card + white text: readable on any section color it's dropped into. */
	border: 1px dashed rgba(255, 255, 255, 0.28);
	border-radius: 10px;
	background: #1f1a33;
	font: 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff;
}

.uaf-sl-badge strong {
	color: #fff;
}

.uaf-sl-badge-swatch {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 8px;
}

.uaf-sl-badge-text {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.uaf-sl-badge-text span {
	color: rgba(255, 255, 255, 0.78);
	font-size: 12px;
}

.uaf-sl-badge .uaf-sl-badge-play {
	flex: none;
	margin: 0;
	padding: 6px 14px;
	min-height: 0;
	border: 0;
	border-radius: 99px;
	background: #6c5ce8;
	color: #fff;
	/* Longhands: `inherit` isn't allowed inside the `font` shorthand (the whole rule was dropped). */
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-transform: none;
	cursor: pointer;
}

.uaf-sl-badge .uaf-sl-badge-play:hover {
	background: #5847d4;
}

@media (prefers-reduced-motion: reduce) {
	.uaf-sl-logo,
	.uaf-sl-line,
	.uaf-sl-counter,
	.uaf-sl-logo-inner {
		animation: none !important;
	}

	.uaf-sl--logo-draw .uaf-sl-logo-inner [pathLength] {
		animation: none;
		stroke-dashoffset: 0;
		fill-opacity: 1;
		stroke-opacity: 0;
	}
}
