/**
 * Lyor Slogan Reveal — single-layer typography motion (scoped).
 *
 * Reveal happens on ONE text node per unit via overflow wrappers + inner transform.
 * No duplicate text stacks.
 *
 * @package LyorCore
 */

/* -------------------------------------------------------------------------- */
/* Root                                                                       */
/* -------------------------------------------------------------------------- */

.lyor-slogan,
.lyor-slogan-reveal {
	--lsr-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--lsr-duration: 1.05s;
	--lsr-stagger: 72ms;
	--lsr-distance: 1.15;
	--lsr-blur-max: 8px;
	--lsr-scale-from: 1.02;
	--lsr-text: #14171d;
	--lsr-accent: #c5a059;
	--lsr-eyebrow: #7d766d;
	--lsr-heading: #121418;
	--lsr-line-height: 1.02;
	--lsr-gap: 10px;
	--lsr-letter-spacing: -0.02em;
	--lsr-block-max: 1120px;
	--lsr-text-max: 760px;
	--lsr-parallax: 0;
	--lsr-hover-underline-offset: 6px;
	--lsr-hover-underline-opacity: 0.65;
	display: block;
	width: min(100% - 48px, var(--lsr-block-max));
	max-width: var(--lsr-block-max);
	margin-inline: auto;
	color: var(--lsr-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-kerning: normal;
	font-feature-settings: "kern" 1, "liga" 1;
}

.lyor-slogan__inner {
	width: min(100%, min(var(--lsr-text-max), var(--lsr-block-max)));
	max-width: min(var(--lsr-text-max), var(--lsr-block-max));
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 3vw, 36px);
}

/* -------------------------------------------------------------------------- */
/* Meta                                                                       */
/* -------------------------------------------------------------------------- */

.lyor-slogan__meta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	opacity: 0;
	transform: translate3d(0, 12px, 0);
	transition:
		opacity calc(var(--lsr-duration) * 0.9) var(--lsr-ease),
		transform calc(var(--lsr-duration) * 0.9) var(--lsr-ease);
}

.lyor-slogan.is-active .lyor-slogan__meta,
.lyor-slogan.is-revealed .lyor-slogan__meta {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}

.lyor-slogan__eyebrow {
	margin: 0;
	color: var(--lsr-eyebrow);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	line-height: 1.15;
	font-size: 0.72rem;
}

.lyor-slogan__heading {
	margin: 0;
	color: var(--lsr-heading);
	line-height: 0.98;
	letter-spacing: -0.045em;
	text-wrap: balance;
}

/* -------------------------------------------------------------------------- */
/* Statement — lines & units                                                  */
/* -------------------------------------------------------------------------- */

.lyor-slogan__statement {
	display: flex;
	flex-direction: column;
	gap: var(--lsr-gap);
	width: 100%;
}

.lyor-slogan__line {
	margin: 0;
	padding: 0;
	color: var(--lsr-text);
	line-height: var(--lsr-line-height);
	letter-spacing: var(--lsr-letter-spacing);
	text-wrap: balance;
}

/* Overflow mask — clips the SINGLE inner text node */
.lyor-word,
.lyor-line {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	max-width: 100%;
	line-height: inherit;
	letter-spacing: inherit;
}

.lyor-word--space {
	width: 0.28em;
	overflow: hidden;
}

.lyor-word--space .lyor-word-inner {
	width: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* The only painted text layer */
.lyor-word-inner,
.lyor-line-inner {
	display: inline-block;
	color: inherit;
	white-space: pre-wrap;
	word-break: break-word;
	transform: translate3d(0, calc(var(--lsr-distance) * 100%), 0);
	opacity: 0;
	filter: blur(var(--lsr-blur-max));
	will-change: transform, opacity, filter;
}

.lyor-slogan.is-revealed .lyor-word-inner,
.lyor-slogan.is-revealed .lyor-line-inner,
.lyor-slogan.is-complete .lyor-word-inner,
.lyor-slogan.is-complete .lyor-line-inner {
	will-change: auto;
}

.lyor-word--accent .lyor-word-inner {
	color: var(--lsr-accent);
}

/* In-view / load reveal — CSS stagger via --unit-index */
.lyor-slogan[data-engine="inview"] .lyor-word-inner,
.lyor-slogan[data-engine="inview"] .lyor-line-inner,
.lyor-slogan[data-engine="load"] .lyor-word-inner,
.lyor-slogan[data-engine="load"] .lyor-line-inner {
	transition:
		transform var(--lsr-duration) var(--lsr-ease),
		opacity var(--lsr-duration) var(--lsr-ease),
		filter var(--lsr-duration) var(--lsr-ease);
	transition-delay: calc(var(--unit-index, 0) * var(--lsr-stagger));
}

.lyor-slogan.is-active .lyor-word-inner,
.lyor-slogan.is-active .lyor-line-inner,
.lyor-slogan.is-revealed .lyor-word-inner,
.lyor-slogan.is-revealed .lyor-line-inner,
.lyor-slogan.is-complete .lyor-word-inner,
.lyor-slogan.is-complete .lyor-line-inner {
	transform: translate3d(0, 0, 0);
	opacity: 1;
	filter: blur(0);
}

/* -------------------------------------------------------------------------- */
/* Preset color fallbacks (overridden by Elementor Style tab)                 */
/* -------------------------------------------------------------------------- */

.lyor-slogan--preset-luxury_fade {
	--lsr-text: #5c574f;
	--lsr-accent: #14171d;
	--lsr-eyebrow: #8a8378;
	--lsr-heading: #121418;
}

.lyor-slogan--preset-cinematic_mask {
	--lsr-text: #14171d;
	--lsr-accent: #c5a059;
	--lsr-eyebrow: #7d766d;
	--lsr-heading: #121418;
}

.lyor-slogan--preset-quiet_parallax {
	--lsr-text: #4a4540;
	--lsr-accent: #14171d;
	--lsr-eyebrow: #7d766d;
	--lsr-heading: #121418;
}

.lyor-slogan--preset-golden_hover {
	--lsr-text: #6b6560;
	--lsr-accent: #c5a059;
	--lsr-eyebrow: #8a8378;
	--lsr-heading: #14171d;
}

.lyor-slogan--preset-editorial_reveal {
	--lsr-text: #6b6560;
	--lsr-accent: #14171d;
	--lsr-eyebrow: #8a8378;
	--lsr-heading: #14171d;
}

.lyor-slogan--preset-instant {
	--lsr-text: #14171d;
	--lsr-accent: #14171d;
	--lsr-eyebrow: #7d766d;
	--lsr-heading: #121418;
}

/* -------------------------------------------------------------------------- */
/* Motion presets (same text node, different motion curves)                   */
/* -------------------------------------------------------------------------- */

/* Luxury Fade — minimal lift, soft opacity */
.lyor-slogan--motion-fade {
	--lsr-distance: 1.08;
	--lsr-blur-max: 0px;
	--lsr-scale-from: 1;
}

/* Cinematic Mask — blur reduction + subtle scale */
.lyor-slogan--motion-mask {
	--lsr-distance: 1.12;
	--lsr-blur-max: 8px;
}

.lyor-slogan--motion-mask .lyor-word-inner,
.lyor-slogan--motion-mask .lyor-line-inner {
	transform: translate3d(0, calc(var(--lsr-distance) * 100%), 0) scale(var(--lsr-scale-from));
}

.lyor-slogan.is-active.lyor-slogan--motion-mask .lyor-word-inner,
.lyor-slogan.is-active.lyor-slogan--motion-mask .lyor-line-inner,
.lyor-slogan.is-revealed.lyor-slogan--motion-mask .lyor-word-inner,
.lyor-slogan.is-revealed.lyor-slogan--motion-mask .lyor-line-inner {
	transform: translate3d(0, 0, 0) scale(1);
}

/* Editorial — line units, letter-spacing settle */
.lyor-slogan--motion-editorial {
	--lsr-stagger: 140ms;
}

.lyor-slogan--motion-editorial .lyor-line-inner {
	letter-spacing: 0.06em;
	transition:
		transform var(--lsr-duration) var(--lsr-ease),
		opacity var(--lsr-duration) var(--lsr-ease),
		filter var(--lsr-duration) var(--lsr-ease),
		letter-spacing calc(var(--lsr-duration) * 1.15) var(--lsr-ease);
	transition-delay: calc(var(--unit-index, 0) * var(--lsr-stagger));
}

.lyor-slogan.is-active.lyor-slogan--motion-editorial .lyor-line-inner,
.lyor-slogan.is-revealed.lyor-slogan--motion-editorial .lyor-line-inner {
	letter-spacing: var(--lsr-letter-spacing);
}

/* Golden Hover / Hover FX — desktop luxury interaction (after reveal) */
@media (hover: hover) and (pointer: fine) {
	.lyor-slogan--hover-fx.is-revealed .lyor-slogan__statement,
	.lyor-slogan--motion-hover.is-revealed .lyor-slogan__statement {
		position: relative;
	}

	.lyor-slogan--hover-fx.is-revealed:not(.lyor-slogan--hover-underline-off) .lyor-slogan__statement::after,
	.lyor-slogan--motion-hover.is-revealed:not(.lyor-slogan--hover-underline-off) .lyor-slogan__statement::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: calc(-1 * var(--lsr-hover-underline-offset, 6px));
		width: 100%;
		height: 1px;
		background: linear-gradient(90deg, transparent, var(--lsr-accent), transparent);
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform 0.7s var(--lsr-ease);
		opacity: var(--lsr-hover-underline-opacity, 0.65);
		pointer-events: none;
	}

	.lyor-slogan--hover-fx.is-revealed:not(.lyor-slogan--hover-underline-off):hover .lyor-slogan__statement::after,
	.lyor-slogan--motion-hover.is-revealed:not(.lyor-slogan--hover-underline-off):hover .lyor-slogan__statement::after {
		transform: scaleX(1);
	}

	.lyor-slogan--hover-fx.is-revealed:not(.lyor-slogan--hover-glow-off):hover .lyor-word--accent .lyor-word-inner,
	.lyor-slogan--motion-hover.is-revealed:not(.lyor-slogan--hover-glow-off):hover .lyor-word--accent .lyor-word-inner {
		text-shadow: 0 0 36px color-mix(in srgb, var(--lsr-accent) 40%, transparent);
	}
}

/* Elementor editor — immediate revealed state when enabled */
.elementor-editor-active .lyor-slogan[data-editor-reveal="yes"] {
	/* style hook for deterministic preview */
}

/* -------------------------------------------------------------------------- */
/* Scroll scrub — progress on same inner nodes                                  */
/* -------------------------------------------------------------------------- */

.lyor-slogan[data-engine="scroll"] .lyor-word-inner,
.lyor-slogan[data-engine="scroll"] .lyor-line-inner {
	transition: none !important;
	transition-delay: 0ms !important;
	opacity: var(--unit-progress, 0);
	transform: translate3d(
		0,
		calc((1 - var(--unit-progress, 0)) * var(--lsr-distance) * 100%),
		0
	);
	filter: blur(calc((1 - var(--unit-progress, 0)) * var(--lsr-blur-max)));
}

.lyor-slogan[data-engine="scroll"].lyor-slogan--motion-mask .lyor-word-inner,
.lyor-slogan[data-engine="scroll"].lyor-slogan--motion-mask .lyor-line-inner {
	transform: translate3d(
			0,
			calc((1 - var(--unit-progress, 0)) * var(--lsr-distance) * 100%),
			0
		)
		scale(calc(1 + (var(--lsr-scale-from) - 1) * (1 - var(--unit-progress, 0))));
}

.lyor-slogan[data-engine="scroll"] .lyor-slogan__line {
	transform: translate3d(0, calc(var(--line-parallax, 0) * -1px), 0);
}

/* -------------------------------------------------------------------------- */
/* Static — fully visible, no motion                                            */
/* -------------------------------------------------------------------------- */

.lyor-slogan[data-engine="static"] .lyor-word-inner,
.lyor-slogan[data-engine="static"] .lyor-line-inner {
	transform: none;
	opacity: 1;
	filter: none;
	transition: none;
}

/* -------------------------------------------------------------------------- */
/* Actions                                                                    */
/* -------------------------------------------------------------------------- */

.lyor-slogan__actions {
	opacity: 0;
	transform: translate3d(0, 10px, 0);
	transition:
		opacity 0.85s var(--lsr-ease) 0.14s,
		transform 0.85s var(--lsr-ease) 0.14s;
}

.lyor-slogan.is-active .lyor-slogan__actions,
.lyor-slogan.is-revealed .lyor-slogan__actions {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}

/* -------------------------------------------------------------------------- */
/* Responsive & accessibility                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.lyor-slogan,
	.lyor-slogan-reveal {
		width: min(100% - 38px, var(--lsr-block-max));
	}
}

@media (max-width: 767px) {
	.lyor-slogan,
	.lyor-slogan-reveal {
		width: min(100% - 28px, var(--lsr-block-max));
		--lsr-blur-max: min(var(--lsr-blur-max), 5px);
		--lsr-stagger: calc(var(--lsr-stagger) * 0.75);
	}

	.lyor-slogan[data-disable-mobile="yes"] .lyor-word-inner,
	.lyor-slogan[data-disable-mobile="yes"] .lyor-line-inner {
		transform: none !important;
		opacity: 1 !important;
		filter: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lyor-slogan *,
	.lyor-slogan-reveal * {
		transition: none !important;
		animation: none !important;
	}

	.lyor-slogan .lyor-word-inner,
	.lyor-slogan .lyor-line-inner {
		transform: none !important;
		opacity: 1 !important;
		filter: none !important;
	}

	.lyor-slogan .lyor-slogan__meta,
	.lyor-slogan .lyor-slogan__actions {
		opacity: 1 !important;
		transform: none !important;
	}
}
