/* Unio Cinematic Scroll – frontend */

/* ---- Versión estática (sin JS, reduced-motion o editor sin init) ---- */
.ucs {
	position: relative;
	background: var(--ucs-bg, #000);
	color: #fff;
	isolation: isolate;
}

.ucs__sticky {
	position: relative;
	min-height: 100vh;
	overflow: hidden;
}

.ucs__poster,
.ucs__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	max-width: none;
	object-fit: cover;
}

.ucs__canvas {
	display: none;
}

.ucs__shade {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(var(--ucs-shade-rgb, 0, 0, 0), var(--ucs-shade, .35)) 0%, rgba(var(--ucs-shade-rgb, 0, 0, 0), calc(var(--ucs-shade, .35) * .4)) 60%, rgba(var(--ucs-shade-rgb, 0, 0, 0), 0) 100%);
	z-index: 1;
}

.ucs__scenes {
	position: relative;
	z-index: 2;
	display: grid;
	gap: 18vh;
	padding: 14vh 6vw;
}

.ucs__scene {
	max-width: 560px;
}

.ucs__scene--center,
.ucs__scene--bottom-center {
	margin-inline: auto;
	text-align: center;
}

.ucs__scene--right {
	margin-left: auto;
	text-align: right;
}

.ucs__title {
	margin: 0 0 .4em;
	color: inherit;
	font-size: clamp(2rem, 5vw, 4.25rem);
	line-height: 1.05;
	letter-spacing: -.02em;
}

.ucs__text {
	margin: 0 0 1.2em;
	color: inherit;
	font-size: clamp(1rem, 1.4vw, 1.25rem);
	line-height: 1.5;
	opacity: .9;
}

.ucs__button {
	display: inline-block;
	padding: .9em 1.6em;
	border: 1px solid #fff;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-weight: 600;
	text-decoration: none;
	transition: transform .2s ease, opacity .2s ease;
}

.ucs__button:hover,
.ucs__button:focus-visible {
	transform: translateY(-2px);
	opacity: .9;
}

.ucs__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	z-index: 3;
	background: rgba(255, 255, 255, .15);
	display: none;
}

.ucs__progress span {
	display: block;
	height: 100%;
	background: #fff;
	transform: scaleX(0);
	transform-origin: left center;
}

/* ---- Modo animado (JS activo) ---- */
.ucs--ready {
	height: var(--ucs-length, 300vh);
}

.ucs--ready .ucs__sticky {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100svh;
	min-height: 0;
}

.ucs--ready .ucs__canvas {
	display: block;
}

/* El póster se queda debajo como LCP hasta que el canvas pinta el primer frame. */
.ucs--painted .ucs__poster {
	visibility: hidden;
}

.ucs--ready .ucs__progress {
	display: block;
}

.ucs--ready .ucs__scenes {
	position: absolute;
	inset: 0;
	padding: 0;
	display: block;
}

.ucs--ready .ucs__scene {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	will-change: opacity, transform;
	--ucs-y: 24px;
}

.ucs--ready .ucs__scene.is-active {
	pointer-events: auto;
}

.ucs--ready .ucs__scene--left {
	left: 6%;
	top: 50%;
	transform: translateY(calc(-50% + var(--ucs-y)));
}

.ucs--ready .ucs__scene--right {
	right: 6%;
	top: 50%;
	margin: 0;
	transform: translateY(calc(-50% + var(--ucs-y)));
}

.ucs--ready .ucs__scene--center {
	left: 50%;
	top: 50%;
	width: min(90vw, 760px);
	max-width: none;
	margin: 0;
	transform: translate(-50%, calc(-50% + var(--ucs-y)));
}

.ucs--ready .ucs__scene--bottom-left {
	left: 6%;
	bottom: 10vh;
	transform: translateY(var(--ucs-y));
}

.ucs--ready .ucs__scene--bottom-center {
	left: 50%;
	bottom: 10vh;
	width: min(90vw, 760px);
	max-width: none;
	margin: 0;
	transform: translate(-50%, var(--ucs-y));
}

@media (max-width: 767px), (max-width: 1024px) and (orientation: portrait) {
	.ucs--ready .ucs__scene--left,
	.ucs--ready .ucs__scene--right,
	.ucs--ready .ucs__scene--center {
		left: 6%;
		right: 6%;
		top: auto;
		bottom: 9vh;
		width: auto;
		max-width: none;
		text-align: left;
		transform: translateY(var(--ucs-y));
	}

	.ucs--ready .ucs__scene--bottom-center {
		width: 88%;
	}

	.ucs__shade {
		background: linear-gradient(0deg, rgba(var(--ucs-shade-rgb, 0, 0, 0), var(--ucs-shade, .35)) 0%, rgba(var(--ucs-shade-rgb, 0, 0, 0), calc(var(--ucs-shade, .35) * .55)) 38%, rgba(var(--ucs-shade-rgb, 0, 0, 0), 0) 62%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ucs__button {
		transition: none;
	}
}
