/**
 * SECCIÓN 2 — HERO
 * Pantalla completa con vídeo controlado por scroll. El titular es el protagonista:
 * display en versales, peso ligero y gran escala. Copy mínimo, dos CTA.
 * La salida es cinematográfica: al completarse el scrub el hero se aleja y oscurece
 * mientras la sección siguiente pasa por encima.
 */

.zihouse-hero {
	position: relative;
	min-height: 100svh;
	background: var(--zihouse-near-black);
	color: var(--zihouse-ivory);
}

.zihouse-hero[data-scrub="on"] {
	height: 380svh;
	min-height: 0;
}

.zihouse-hero__viewport {
	position: relative;
	height: 100svh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	isolation: isolate;
	transform-origin: 50% 42%;
	will-change: transform, filter;
}

.zihouse-hero[data-scrub="on"] .zihouse-hero__viewport {
	position: sticky;
	top: 0;
}

/* Media -------------------------------------------------------------------- */

.zihouse-hero__media {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: var(--zihouse-near-black);
}

.zihouse-hero__video,
.zihouse-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* El hero ocupa la pantalla completa antes de hacer scroll, en todos los
   dispositivos. El vídeo es ultrapanorámico (2.33:1), así que en pantallas más
   altas que anchas `cover` recorta los lados: es el precio de llenar la pantalla.
   Para que el recorte quite lo mínimo, el encuadre se ancla al centro. */
.zihouse-hero,
html:not(.zihouse-hero-scrub) .zihouse-hero {
	height: 100svh !important;
	min-height: 100svh;
}

.zihouse-hero__viewport {
	height: 100svh;
	min-height: 100svh;
}

.zihouse-hero__video { object-position: 50% 50%; }

/* Velo: base para legibilidad + refuerzo lateral bajo el texto. */
.zihouse-hero__scrim {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(to top, oklch(12% 0.006 60 / 0.88) 0%, oklch(12% 0.006 60 / 0.35) 45%, oklch(12% 0.006 60 / 0.15) 100%),
		linear-gradient(to right, oklch(12% 0.006 60 / 0.6) 0%, transparent 62%);
}

/* Contenido ---------------------------------------------------------------- */

.zihouse-hero__content {
	width: 100%;
	max-width: var(--zihouse-container-max);
	margin-inline: auto;
	padding-inline: var(--zihouse-container-pad);
	padding-bottom: var(--zihouse-space-2xl);
	display: flex;
	flex-direction: column;
	gap: var(--zihouse-space-md);
	will-change: transform, opacity;
}

.zihouse-hero__eyebrow {
	margin: 0;
	font-family: var(--zihouse-font-body);
	font-size: var(--zihouse-text-xs);
	font-weight: 500;
	letter-spacing: var(--zihouse-tracking-wide);
	text-transform: uppercase;
	color: color-mix(in oklch, var(--zihouse-ivory) 78%, transparent);
	display: flex;
	align-items: center;
	gap: 0.75em;
}

.zihouse-hero__eyebrow::before {
	content: "";
	width: calc(var(--zihouse-u) * 2.5);
	height: 1px;
	background: currentColor;
	display: block;
}

/* El titular manda: versales, ligero, muy grande, medida corta. */
.zihouse-hero__title {
	margin: 0;
	font-family: var(--zihouse-font-display);
	font-weight: 400;
	font-size: var(--zihouse-text-hero);
	line-height: 0.98;
	letter-spacing: var(--zihouse-tracking-tight);
	text-transform: uppercase;
	color: var(--zihouse-ivory);
	max-width: 14ch;
	text-wrap: balance;
}

.zihouse-hero__title .zihouse-split-line {
	overflow: hidden;
	display: block;
	padding-bottom: 0.08em;
}

.zihouse-hero__lede {
	margin: 0;
	font-size: var(--zihouse-text-lg);
	font-weight: 300;
	line-height: 1.45;
	max-width: 34ch;
	color: color-mix(in oklch, var(--zihouse-ivory) 86%, transparent);
}

.zihouse-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--zihouse-space-sm);
	margin-top: var(--zihouse-space-2xs);
}

/* HUD inferior ------------------------------------------------------------- */

.zihouse-hero__hud {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--zihouse-space-sm);
	padding: var(--zihouse-space-sm) var(--zihouse-container-pad);
	font-size: var(--zihouse-text-xs);
	letter-spacing: 0.04em;
	color: color-mix(in oklch, var(--zihouse-ivory) 70%, transparent);
	border-top: 1px solid color-mix(in oklch, var(--zihouse-ivory) 18%, transparent);
}

.zihouse-hero__locality {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	text-transform: uppercase;
}

.zihouse-hero__progress {
	position: relative;
	flex: 0 1 14rem;
	height: 1px;
	background: color-mix(in oklch, var(--zihouse-ivory) 22%, transparent);
	overflow: hidden;
}

.zihouse-hero__progress i {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0%;
	background: var(--zihouse-ivory);
	display: block;
}

/* Tablet ------------------------------------------------------------------- */
@media (max-width: 63.999rem) {
	.zihouse-hero__title { max-width: 12ch; }
	.zihouse-hero__lede { max-width: 42ch; }
	.zihouse-hero__progress { display: none; }
}

/* Móvil: composición propia, no una reducción ------------------------------ */
@media (max-width: 40rem) {
	.zihouse-hero__content {
		padding-bottom: var(--zihouse-space-xl);
		gap: var(--zihouse-space-sm);
	}
	.zihouse-hero__title {
		max-width: 100%;
		line-height: 1.05;
		/* En móvil el titular iba a 44 px en versales y ocupaba media pantalla.
		   Aquí manda el ancho real del dispositivo, no la escala de escritorio. */
		font-size: clamp(1.75rem, 8vw, 2.5rem);
		letter-spacing: -0.01em;
	}
	.zihouse-hero__lede { font-size: var(--zihouse-text-base); }
	.zihouse-hero__actions > .zihouse-btn { flex: 1 1 100%; }
	.zihouse-hero__scrim {
		background: linear-gradient(to top, oklch(12% 0.006 60 / 0.92) 0%, oklch(12% 0.006 60 / 0.4) 55%, oklch(12% 0.006 60 / 0.2) 100%);
	}

	/* En móvil el hero también ocupa la pantalla entera. El vídeo llena con
	   `cover`: en vertical eso recorta los lados del 2.33:1, pero llenar la pantalla
	   manda. El velo inferior se refuerza para que el titular siga legible encima. */
	.zihouse-hero__video { object-fit: cover; }
}

/* La preferencia del sistema solo manda si no se ha forzado la experiencia
   completa desde ZIHOUSE Studio (o con ?zihouse-motion=full). */
@media (prefers-reduced-motion: reduce) and (max-width: 55.999rem) {
	html:not(.zihouse-hero-scrub) .zihouse-hero { height: auto !important; min-height: 100svh; }
}

@media (prefers-reduced-motion: reduce) {
	html:not(.zihouse-hero-scrub) .zihouse-hero__viewport { position: relative !important; transform: none !important; filter: none !important; }
}
