/*!
 * Luxury Animated Preloader — front-end styles
 * All motion uses transform, opacity and clip-path only.
 * Responsive rules use container queries on the overlay itself, so the
 * admin live preview behaves exactly like a real phone or desktop screen.
 */

/* ------------------------------------------------------------------ *
 * Root overlay
 * ------------------------------------------------------------------ */
.luxap-preloader {
	--luxap-ease: cubic-bezier(.22, .61, .36, 1);
	--luxap-ease-line: cubic-bezier(.65, 0, .35, 1);
	--luxap-ease-exit: cubic-bezier(.76, 0, .24, 1);
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: block;
	overflow: hidden;
	background: none;
	container: lap / inline-size;
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	isolation: isolate;
	contain: layout paint style;
	-webkit-tap-highlight-color: transparent;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	line-height: 1.25;
	cursor: progress;
}

.luxap-preloader[hidden] { display: none !important; }

.luxap-preloader *,
.luxap-preloader *::before,
.luxap-preloader *::after {
	box-sizing: border-box;
}

/* Neutralise theme styles that commonly leak into images/text. */
.luxap-preloader img,
.luxap-preloader picture {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	max-width: none;
}

/* ------------------------------------------------------------------ *
 * Background (two halves so the "curtain split" exit is possible)
 * ------------------------------------------------------------------ */
.luxap-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: var(--luxap-bg-opacity, 1);
}

.luxap-bg-half {
	position: absolute;
	left: 0;
	right: 0;
	height: 50.5%;
	overflow: hidden;
	will-change: transform;
	transition: transform var(--luxap-exit-dur) var(--luxap-ease-exit);
}

.luxap-bg-top { top: 0; }
.luxap-bg-bottom { bottom: 0; }

.luxap-bg-fill {
	position: absolute;
	left: 0;
	right: 0;
	height: 198.02%; /* 100 / 50.5 — the fill always spans the full overlay */
	background: var(--luxap-bg-d);
}

.luxap-bg-top .luxap-bg-fill { top: 0; }
.luxap-bg-bottom .luxap-bg-fill { bottom: 0; }

.luxap-bg-fx {
	position: absolute;
	inset: 0;
	pointer-events: none;
	transition: opacity calc(var(--luxap-exit-dur) * .5) ease;
}

.luxap-fx-vignette .luxap-bg-fx {
	background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .42) 100%);
}

.luxap-fx-spotlight .luxap-bg-fx {
	background: radial-gradient(circle at 50% 50%, var(--luxap-accent-soft) 0, rgba(0, 0, 0, 0) 42%);
}

.luxap-fx-grain .luxap-bg-fx {
	opacity: .085;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 160px 160px;
	mix-blend-mode: overlay;
}

/* ------------------------------------------------------------------ *
 * Composition: [ line ] [ logo ] [ line ]   + text below
 * The logo stays in the exact center; text hangs below it.
 * ------------------------------------------------------------------ */
.luxap-stage {
	--luxap-logo-w: var(--luxap-logo-w-d);
	--luxap-logo-h: var(--luxap-logo-h-d);
	--luxap-line-len: var(--luxap-line-len-d);
	--luxap-gap: var(--luxap-gap-d);
	--luxap-h-size: var(--luxap-h-size-d);
	--luxap-s-size: var(--luxap-s-size-d);
	--luxap-text-top: var(--luxap-text-top-d);
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity calc(var(--luxap-exit-dur) * .7) ease, transform var(--luxap-exit-dur) var(--luxap-ease-exit);
}

.luxap-composition {
	position: relative;
	width: 100%;
}

.luxap-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--luxap-gap);
	width: 100%;
}

/* Lines -------------------------------------------------------------- */
.luxap-line {
	position: relative;
	display: block;
	flex: 0 1 calc(var(--luxap-line-len) * 1vw);
	min-width: 0;
	height: 0;
	border-top: var(--luxap-line-t) var(--luxap-line-style) var(--luxap-line-color);
}

@supports (width: 1cqw) {
	.luxap-line { flex-basis: calc(var(--luxap-line-len) * 1cqw); }
}

/* Keep the logo centered when only one line is shown. */
.luxap-line-off { visibility: hidden; }

.luxap-line-fade .luxap-line-left {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 72%);
	mask-image: linear-gradient(to right, transparent 0, #000 72%);
}

.luxap-line-fade .luxap-line-right {
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 72%);
	mask-image: linear-gradient(to left, transparent 0, #000 72%);
}

.luxap-line-ornament .luxap-line::after {
	content: "";
	position: absolute;
	top: calc(var(--luxap-line-t) * -.5);
	width: 7px;
	height: 7px;
	border: 1px solid var(--luxap-line-color);
	transform: translateY(-50%) rotate(45deg);
}

.luxap-line-ornament .luxap-line-left::after { right: -4px; }
.luxap-line-ornament .luxap-line-right::after { left: -4px; }

/* Logo --------------------------------------------------------------- */
.luxap-logo {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 72%;
}

.luxap-logo-box {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	padding: var(--luxap-logo-pad);
}

.luxap-logo-container-rounded .luxap-logo-box {
	background: var(--luxap-logo-cbg);
	border-radius: 18px;
}

.luxap-logo-container-circle .luxap-logo-box {
	background: var(--luxap-logo-cbg);
	border-radius: 50%;
	aspect-ratio: 1 / 1;
}

.luxap-logo-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
}

.luxap-logo-picture { display: contents; }

/* Width is limited by both the width and the max-height setting,
   using the image's real aspect ratio — never distorted, never letterboxed. */
.luxap-logo-img {
	display: block;
	width: min(var(--luxap-logo-w), calc(var(--luxap-logo-h) * var(--luxap-logo-ratio)));
	max-width: 100%;
	height: auto;
	max-height: var(--luxap-logo-h);
	object-fit: contain;
}

.luxap-logo-fallback {
	display: none;
	font-family: var(--luxap-h-font);
	font-size: clamp(18px, calc(var(--luxap-logo-h) * .36), 46px);
	font-weight: 400;
	letter-spacing: .22em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--luxap-line-color);
	padding-left: .22em; /* optically balance trailing letter-spacing */
}

.luxap-no-image .luxap-logo-fallback,
.luxap-logo-failed .luxap-logo-fallback { display: block; }

.luxap-logo-failed .luxap-logo-img,
.luxap-logo-failed .luxap-shimmer { display: none; }

.luxap-logo-glow .luxap-logo-media {
	filter: drop-shadow(0 0 var(--luxap-glow-size) var(--luxap-glow));
}

/* Text --------------------------------------------------------------- */
.luxap-text {
	display: block;
	position: absolute;
	top: 100%;
	left: 50%;
	width: min(680px, 92%);
	transform: translateX(-50%);
	padding-top: var(--luxap-text-top);
	text-align: center;
}

.luxap-align-left .luxap-text { text-align: left; }
.luxap-align-right .luxap-text { text-align: right; }

.luxap-heading,
.luxap-subtitle {
	margin: 0;
	padding: 0;
	overflow-wrap: anywhere;
}

.luxap-heading {
	font-family: var(--luxap-h-font);
	font-size: var(--luxap-h-size);
	font-weight: var(--luxap-h-weight);
	letter-spacing: var(--luxap-h-spacing);
	color: var(--luxap-h-color);
	line-height: 1.2;
}

.luxap-subtitle {
	margin-top: var(--luxap-text-gap);
	font-family: var(--luxap-s-font);
	font-size: var(--luxap-s-size);
	font-weight: var(--luxap-s-weight);
	letter-spacing: var(--luxap-s-spacing);
	color: var(--luxap-s-color);
	line-height: 1.5;
}

.luxap-heading-upper .luxap-heading,
.luxap-subtitle-upper .luxap-subtitle { text-transform: uppercase; }

/* Very short screens (landscape phones): let the text flow normally so it
   never runs off the bottom. */
@media (max-height: 460px) {
	.luxap-preloader:not(.luxap-preloader--preview) .luxap-text {
		position: static;
		transform: none;
		margin: 0 auto;
	}
}

/* ------------------------------------------------------------------ *
 * Mobile (container query — the overlay is the container)
 * ------------------------------------------------------------------ */
@container lap (max-width: 767px) {
	.luxap-stage {
		--luxap-logo-w: var(--luxap-logo-w-m);
		--luxap-logo-h: var(--luxap-logo-h-m);
		--luxap-line-len: var(--luxap-line-len-m);
		--luxap-gap: var(--luxap-gap-m);
		--luxap-h-size: var(--luxap-h-size-m);
		--luxap-s-size: var(--luxap-s-size-m);
		--luxap-text-top: var(--luxap-text-top-m);
	}
	.luxap-bg-fill { background: var(--luxap-bg-m); }
	.luxap-logo { max-width: 64%; }
}

@supports not (container-type: inline-size) {
	@media (max-width: 767px) {
		.luxap-stage {
			--luxap-logo-w: var(--luxap-logo-w-m);
			--luxap-logo-h: var(--luxap-logo-h-m);
			--luxap-line-len: var(--luxap-line-len-m);
			--luxap-gap: var(--luxap-gap-m);
			--luxap-h-size: var(--luxap-h-size-m);
			--luxap-s-size: var(--luxap-s-size-m);
			--luxap-text-top: var(--luxap-text-top-m);
		}
		.luxap-bg-fill { background: var(--luxap-bg-m); }
		.luxap-logo { max-width: 64%; }
	}
}

/* ------------------------------------------------------------------ *
 * Entrance animations
 * ------------------------------------------------------------------ */
.luxap-logo {
	animation-duration: var(--luxap-logo-dur);
	animation-delay: var(--luxap-logo-delay);
	animation-timing-function: var(--luxap-ease);
	animation-fill-mode: both;
}

.luxap-heading {
	animation-duration: var(--luxap-text-dur);
	animation-delay: var(--luxap-text-delay);
	animation-timing-function: var(--luxap-ease);
	animation-fill-mode: both;
}

.luxap-subtitle {
	animation-duration: var(--luxap-text-dur);
	animation-delay: var(--luxap-sub-delay);
	animation-timing-function: var(--luxap-ease);
	animation-fill-mode: both;
}

.luxap-anim-none { animation-name: none; }
.luxap-anim-fade { animation-name: luxap-fade; }
.luxap-anim-rise { animation-name: luxap-rise; }
.luxap-anim-scale { animation-name: luxap-scale; }
.luxap-anim-zoom { animation-name: luxap-zoom; }
.luxap-anim-unveil { animation-name: luxap-unveil; }

/* Lines */
.luxap-lines-draw .luxap-line,
.luxap-lines-fade .luxap-line {
	animation-duration: var(--luxap-line-dur);
	animation-delay: var(--luxap-line-delay);
	animation-timing-function: var(--luxap-ease-line);
	animation-fill-mode: both;
}

.luxap-lines-fade .luxap-line { animation-name: luxap-fade; }
.luxap-lines-draw.luxap-dir-inward .luxap-line-left { animation-name: luxap-draw-ltr; }
.luxap-lines-draw.luxap-dir-inward .luxap-line-right { animation-name: luxap-draw-rtl; }
.luxap-lines-draw.luxap-dir-outward .luxap-line-left { animation-name: luxap-draw-rtl; }
.luxap-lines-draw.luxap-dir-outward .luxap-line-right { animation-name: luxap-draw-ltr; }

/* Whole-composition presets */
.luxap-comp-fade .luxap-composition {
	animation: luxap-fade calc(var(--luxap-line-dur) * .45) ease var(--luxap-start-delay) both;
}

.luxap-comp-zoom .luxap-composition {
	animation: luxap-comp-zoom calc(var(--luxap-line-dur) * 1.4) var(--luxap-ease) var(--luxap-start-delay) both;
}

/* Gold shimmer — a light band sweeping across the logo shape and lines */
.luxap-shimmer {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	background: linear-gradient(105deg, rgba(255, 255, 255, 0) 32%, rgba(255, 246, 220, .85) 50%, rgba(255, 255, 255, 0) 68%) no-repeat;
	background-size: 260% 100%;
	-webkit-mask: var(--luxap-logo-mask) center / contain no-repeat;
	mask: var(--luxap-logo-mask) center / contain no-repeat;
}

.luxap-has-shimmer .luxap-shimmer {
	animation: luxap-shimmer var(--luxap-loop-dur) ease-in-out var(--luxap-loop-delay) infinite;
}

.luxap-has-shimmer .luxap-line::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: calc(var(--luxap-line-t) * -1);
	height: calc(var(--luxap-line-t) + 0px);
	min-height: 1px;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 248, 228, .95), rgba(255, 255, 255, 0)) no-repeat;
	background-size: 28% 100%;
	background-position: -40% 0;
	opacity: 0;
}

.luxap-has-shimmer .luxap-line-left::before {
	animation: luxap-sweep-ltr var(--luxap-loop-dur) ease-in-out var(--luxap-loop-delay) infinite;
}

.luxap-has-shimmer .luxap-line-right::before {
	animation: luxap-sweep-rtl var(--luxap-loop-dur) ease-in-out var(--luxap-loop-delay) infinite;
}

.luxap-has-shimmer.luxap-no-image .luxap-logo-fallback,
.luxap-has-shimmer.luxap-logo-failed .luxap-logo-fallback {
	background: linear-gradient(105deg, var(--luxap-line-color) 35%, #fff6dc 50%, var(--luxap-line-color) 65%);
	background-size: 260% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: luxap-text-shimmer var(--luxap-loop-dur) ease-in-out var(--luxap-loop-delay) infinite;
}

/* Soft glow — a slow, gentle breathing halo */
.luxap-has-pulse .luxap-logo-media {
	animation: luxap-pulse calc(var(--luxap-loop-dur) * 1.15) ease-in-out var(--luxap-logo-delay) infinite;
}

.luxap-has-pulse.luxap-lines-fade .luxap-line,
.luxap-has-pulse.luxap-lines-draw .luxap-line {
	box-shadow: 0 0 10px var(--luxap-glow);
}

/* ------------------------------------------------------------------ *
 * Keyframes
 * ------------------------------------------------------------------ */
@keyframes luxap-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes luxap-rise {
	from { opacity: 0; transform: translate3d(0, 14px, 0); }
	to { opacity: 1; transform: none; }
}

@keyframes luxap-scale {
	from { opacity: 0; transform: scale(.84); }
	to { opacity: 1; transform: none; }
}

@keyframes luxap-zoom {
	from { opacity: 0; transform: scale(1.22); }
	to { opacity: 1; transform: none; }
}

@keyframes luxap-unveil {
	from { opacity: 0; transform: translate3d(0, 10px, 0); clip-path: inset(0 0 100% 0); }
	to { opacity: 1; transform: none; clip-path: inset(-25% -5% -25% -5%); }
}

@keyframes luxap-comp-zoom {
	from { opacity: 0; transform: scale(1.08); }
	to { opacity: 1; transform: none; }
}

@keyframes luxap-draw-ltr {
	from { clip-path: inset(-6px 100% -6px 0); }
	to { clip-path: inset(-6px -6px -6px -6px); }
}

@keyframes luxap-draw-rtl {
	from { clip-path: inset(-6px 0 -6px 100%); }
	to { clip-path: inset(-6px -6px -6px -6px); }
}

@keyframes luxap-shimmer {
	0% { opacity: 1; background-position: 140% 0; }
	45% { opacity: 1; background-position: -40% 0; }
	46%, 100% { opacity: 0; background-position: -40% 0; }
}

@keyframes luxap-text-shimmer {
	0% { background-position: 140% 0; }
	45%, 100% { background-position: -40% 0; }
}

@keyframes luxap-sweep-ltr {
	0% { opacity: 1; background-position: -40% 0; }
	45% { opacity: 1; background-position: 140% 0; }
	46%, 100% { opacity: 0; background-position: 140% 0; }
}

@keyframes luxap-sweep-rtl {
	0% { opacity: 1; background-position: 140% 0; }
	45% { opacity: 1; background-position: -40% 0; }
	46%, 100% { opacity: 0; background-position: -40% 0; }
}

@keyframes luxap-pulse {
	0%, 100% { filter: drop-shadow(0 0 calc(var(--luxap-glow-size) * .35) var(--luxap-glow)); }
	50% { filter: drop-shadow(0 0 var(--luxap-glow-size) var(--luxap-glow)); }
}

/* ------------------------------------------------------------------ *
 * Exit
 * ------------------------------------------------------------------ */
.luxap-preloader.luxap-is-leaving {
	pointer-events: none;
	cursor: auto;
	visibility: hidden;
	transition:
		opacity var(--luxap-exit-dur) ease,
		transform var(--luxap-exit-dur) var(--luxap-ease-exit),
		visibility 0s linear calc(var(--luxap-exit-dur) * 1.2);
}

.luxap-is-leaving.luxap-exit-fade { opacity: 0; }

.luxap-is-leaving.luxap-exit-zoom { opacity: 0; }
.luxap-is-leaving.luxap-exit-zoom .luxap-stage { transform: scale(1.07); }

.luxap-is-leaving.luxap-exit-slide_up { transform: translate3d(0, -100%, 0); }

.luxap-is-leaving.luxap-exit-split .luxap-stage {
	opacity: 0;
	transition-duration: calc(var(--luxap-exit-dur) * .35);
}
.luxap-is-leaving.luxap-exit-split .luxap-bg-fx { opacity: 0; }
.luxap-is-leaving.luxap-exit-split .luxap-bg-half { transition-delay: calc(var(--luxap-exit-dur) * .18); }
.luxap-is-leaving.luxap-exit-split .luxap-bg-top { transform: translate3d(0, -100%, 0); }
.luxap-is-leaving.luxap-exit-split .luxap-bg-bottom { transform: translate3d(0, 100%, 0); }

.luxap-is-leaving.luxap-exit-none { opacity: 0; transition: none; }

/* While the overlay is up, html has the class "luxap-lock". Scrolling is
   blocked by the script with event listeners rather than overflow:hidden,
   so the page underneath never changes width and nothing shifts. */
.luxap-preloader {
	touch-action: none;
	overscroll-behavior: contain;
}

/* ------------------------------------------------------------------ *
 * Reduced motion: no movement, only a quick, gentle fade.
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	.luxap-preloader * {
		animation-duration: 1ms !important;
		animation-delay: 0ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .25s !important;
		transition-delay: 0s !important;
	}
	.luxap-preloader .luxap-shimmer,
	.luxap-preloader .luxap-line::before { display: none !important; }
	.luxap-preloader.luxap-is-leaving {
		opacity: 0 !important;
		transform: none !important;
		transition: opacity .25s ease, visibility 0s linear .3s !important;
	}
	.luxap-preloader.luxap-is-leaving .luxap-stage,
	.luxap-preloader.luxap-is-leaving .luxap-bg-half { transform: none !important; }
}

/* ------------------------------------------------------------------ *
 * Admin live preview instance
 * ------------------------------------------------------------------ */
.luxap-preloader--preview {
	position: absolute;
	z-index: 1;
	animation: none;
	cursor: default;
}

.luxap-preloader.luxap-static,
.luxap-preloader.luxap-static * {
	animation: none !important;
}
