/* ==========================================================================
   Luxury layer – shared by the theme, colors come from --lx-* variables
   ========================================================================== */

/* Refined typography */
h1, h2, h3, .hero-title, .intro-title, .article-title, .entry-title { text-wrap: balance; }
.entry-content p { text-wrap: pretty; }
body { font-feature-settings: "kern", "liga"; text-rendering: optimizeLegibility; }

/* Fine grain – the feel of honed stone */
body::after {
	content: ""; position: fixed; inset: 0; z-index: 9990; pointer-events: none;
	opacity: var(--lx-grain, .04);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Accent scrollbar */
html { scrollbar-color: var(--lx-accent) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--lx-accent); border: 3px solid var(--lx-bg); border-radius: 10px; }

/* ---------- Preloader ---------- */
#lx-preloader { display: none; }
.lx-preload #lx-preloader {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; align-items: center; justify-content: center;
	background: var(--lx-bg); color: var(--lx-text);
	transition: opacity .8s cubic-bezier(.6, 0, .2, 1), visibility .8s;
	animation: lx-failsafe .6s 3.2s forwards;
}
.lx-preload.lx-loaded #lx-preloader { opacity: 0; visibility: hidden; }
.lx-pre-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 24px; text-align: center; }
.lx-pre-mark { width: 12px; height: 12px; border: 1px solid var(--lx-accent); transform: rotate(45deg); animation: lx-spin 2.4s cubic-bezier(.6, 0, .4, 1) infinite; }
.lx-pre-name {
	font-family: inherit; font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: .06em;
	background: var(--lx-foil); background-size: 250% 100%;
	-webkit-background-clip: text; background-clip: text; color: transparent;
	animation: lx-rise 1s cubic-bezier(.2, .7, .2, 1) both, lx-sheen 2.4s ease-in-out .3s infinite;
}
.lx-pre-line { display: block; width: 160px; height: 1px; background: linear-gradient(90deg, transparent, var(--lx-accent), transparent); transform-origin: center; animation: lx-line 1.4s cubic-bezier(.6, 0, .2, 1) .2s both; }
.lx-pre-name { font-family: var(--ml-serif, var(--on-serif, var(--tr-serif, var(--az-display, serif)))); }

/* ---------- Metallic foil ---------- */
.lx-foil, .lx-foil-title {
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: transparent;
	background-size: 250% 100%; background-position: 100% 0;
}
.lx-foil { background-image: var(--lx-foil); animation: lx-sheen 7s ease-in-out 1.2s infinite; }
.lx-foil-title { background-image: var(--lx-foil-title); animation: lx-sheen-once 2.6s cubic-bezier(.4, 0, .2, 1) .5s both; }
.lx-foil-title * { -webkit-text-fill-color: transparent; }
a:hover .lx-foil, a:hover.lx-foil { filter: brightness(1.15); }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
	.lx-foil, .lx-foil-title { -webkit-text-fill-color: currentColor; color: inherit; background: none; }
}

/* ---------- Scroll reveal ---------- */
.lx-js .lx-reveal {
	opacity: 0; transform: translate3d(0, 34px, 0);
	transition: opacity 1.1s cubic-bezier(.2, .7, .2, 1), transform 1.3s cubic-bezier(.2, .7, .2, 1);
	will-change: opacity, transform;
}
.lx-js .lx-reveal.lx-in { opacity: 1; transform: none; }
.lx-js .lx-reveal.lx-in:hover { transition-delay: 0s !important; }

/* Images inside revealed blocks open like a curtain */
.lx-js .lx-reveal img { clip-path: inset(0 0 0 0); }
.lx-js .lx-reveal:not(.lx-in) img { clip-path: inset(6% 6% 6% 6%); }
.lx-js .lx-reveal img { transition: clip-path 1.4s cubic-bezier(.2, .7, .2, 1), transform 1.2s cubic-bezier(.2, .7, .2, 1), filter .6s; }

/* ---------- Parallax stone ---------- */
.lx-parallax { background-position: center calc(50% + var(--lx-shift, 0px)) !important; }

/* ---------- Button sheen ---------- */
.btn, .wp-block-button__link { position: relative; overflow: hidden; isolation: isolate; }
.btn::after, .wp-block-button__link::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: -75%; width: 50%; z-index: 1; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
	transform: skewX(-20deg); transition: left .9s cubic-bezier(.2, .7, .2, 1);
}
.btn:hover::after, .wp-block-button__link:hover::after { left: 130%; }

/* ---------- Reading progress ---------- */
#lx-progress {
	position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9995;
	background: var(--lx-foil); background-size: 100% 100%;
	transform: scaleX(0); transform-origin: left;
	box-shadow: 0 0 12px var(--lx-accent);
}
[dir="rtl"] #lx-progress { transform-origin: right; }
.admin-bar #lx-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar #lx-progress { top: 46px; } }

/* ---------- Keyframes ---------- */
@keyframes lx-sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes lx-sheen-once { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes lx-rise { from { opacity: 0; transform: translateY(14px); letter-spacing: .2em; } to { opacity: 1; transform: none; } }
@keyframes lx-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lx-spin { 0% { transform: rotate(45deg); } 50% { transform: rotate(225deg); } 100% { transform: rotate(405deg); } }
@keyframes lx-failsafe { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
	.lx-foil, .lx-foil-title, .lx-pre-name { animation: none !important; background-position: 50% 0; }
	.lx-js .lx-reveal { opacity: 1 !important; transform: none !important; }
	.lx-js .lx-reveal img { clip-path: none !important; }
	.lx-parallax { background-position: center !important; }
}
@media print {
	body::after, #lx-preloader, #lx-progress { display: none !important; }
}
