/* =============================================================
 * Landing v0 — wordmark + tagline + features + footer-statement
 *
 * Capas z dentro de .trx-landing:
 *   -3  .trx-landing__bg              imagen <picture>
 *   -2  .trx-landing__bg::after       tinte cyan duo-tone sobre la imagen
 *   -1  .trx-landing__fx              canvas de partículas + líneas
 *   -1  .trx-landing::after           overlay con spotlight dinámico
 *    0  contenido                     wordmark / tagline / features / statement
 *
 * Spotlight de cursor:
 *   --mx / --my  porcentaje x/y del puntero dentro de la sección
 *                (actualizado por JS en landing-fx.js)
 *
 * Punto del wordmark anclado por variables:
 *   --trx-dot-size   diámetro relativo al wordmark
 *   --trx-dot-y      altura sobre baseline (positivo = más arriba)
 *   --trx-dot-x      separación con la "x"
 * ============================================================= */

.trx-landing {
	--mx: 50%;
	--my: 50%;
	position: relative;
	height: 100dvh;
	display: grid;
	grid-template-rows: auto auto;
	row-gap: clamp(var(--trx-space-7), 8vh, var(--trx-space-9));
	align-content: end;
	justify-items: center;
	/* SIN padding en el section — clave para que `inset:0` del bloque
	 * absoluto cubra el border box completo y el centro = viewport center.
	 * El espacio de respiro se aplica vía margin en los hijos.
	 * row-gap grande = empuja el grid de iconos hacia arriba (más cerca
	 * del centro óptico entre el tagline y el statement de abajo). */
	text-align: center;
	overflow: hidden;
	isolation: isolate;
	/* Fallback oscuro fijo: si la imagen hero aún no cargó, el texto claro
	 * (wordmark/tagline/statement) seguirá siendo legible. NO usar --trx-bg
	 * porque flipea a blanco en prefers-color-scheme: light. */
	background: oklch(14% 0.018 254);
}

/* Bloque centrado: el contenedor llena toda la sección con `inset: 0`
 * (border box = viewport completo) y centra sus hijos con flexbox.
 * Centro real al 50% horizontal y vertical del viewport. */
.trx-landing__content {
	position: absolute;
	inset: 0;
	z-index: 0;

	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--trx-space-4);
	padding-inline: var(--trx-space-5);

	pointer-events: none;
}
.trx-landing__content > * { pointer-events: auto; }

/* Grid (iconos) — margen lateral porque el section no tiene padding-inline */
.trx-landing__grid {
	margin-inline: var(--trx-space-5);
}

/* Bottom: separación del borde inferior del viewport */
.trx-landing__bottom {
	margin-inline: var(--trx-space-5);
	margin-bottom: var(--trx-space-7);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--trx-space-4);
}

/* MOBILE: flujo normal en columna, altura cerrada a 100dvh.
 * Tres bloques (content, grid, bottom) repartidos verticalmente para que
 * todo entre sin scroll en viewports de iPhone SE en adelante. */
@media (max-width: 900px) {
	.trx-landing {
		height: 100dvh;
		min-height: 100dvh;
		display: flex;
		flex-direction: column;
		align-items: center;
		row-gap: 0;
		padding:
			calc(var(--trx-nav-h) + var(--trx-space-4))
			var(--trx-space-5)
			var(--trx-space-5);
	}
	.trx-landing__content {
		position: static;
		inset: auto;
		width: 100%;
		padding-inline: 0;
		margin: 0;
		pointer-events: auto;
		flex: 0 0 auto;
		justify-content: center;
		gap: var(--trx-space-3);
	}
	.trx-landing__grid {
		margin-inline: 0;
		flex: 1 1 auto;
		align-content: center;
	}
	.trx-landing__bottom {
		margin: 0;
		flex: 0 0 auto;
		gap: var(--trx-space-3);
	}
}

/* IMAGEN DE FONDO ---------------------------------------------- */
.trx-landing__bg {
	position: absolute;
	inset: 0;
	z-index: -3;
	display: block;
	overflow: hidden;
}
.trx-landing__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* CANVAS DE PARTÍCULAS ----------------------------------------- */
.trx-landing__fx {
	position: absolute;
	inset: 0;
	z-index: -1;          /* encima del overlay, debajo del content */
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
	opacity: 1;
}

/* OVERLAY con SPOTLIGHT dinámico (sigue al cursor) ------------- */
.trx-landing::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;          /* debajo del canvas → las partículas brillan limpias */
	pointer-events: none;
	background:
		/* Spotlight: aclara la zona del cursor con luz neutra. */
		radial-gradient(circle 360px at var(--mx) var(--my),
			oklch(95% 0 0 / 0.18) 0%,
			oklch(85% 0 0 / 0.08) 35%,
			transparent 70%),
		/* Oscurecedor neutro: bajada de luz hacia los bordes inferiores. */
		linear-gradient(180deg,
			oklch(14% 0.018 254 / 0.20) 0%,
			oklch(14% 0.018 254 / 0.40) 55%,
			oklch(14% 0.018 254 / 0.60) 100%);
}

/* Variante con cursor presente: spotlight más intenso. */
.trx-landing.has-pointer::after {
	background:
		radial-gradient(circle 380px at var(--mx) var(--my),
			oklch(98% 0 0 / 0.26) 0%,
			oklch(88% 0 0 / 0.12) 40%,
			transparent 72%),
		linear-gradient(180deg,
			oklch(14% 0.018 254 / 0.20) 0%,
			oklch(14% 0.018 254 / 0.40) 55%,
			oklch(14% 0.018 254 / 0.60) 100%);
}

/* WORDMARK ----------------------------------------------------- */
.trx-landing__mark {
	--trx-dot-size: 0.18em;
	--trx-dot-y:    0.14em;
	--trx-dot-x:    0.06em;

	position: relative;
	display: inline-block;
	font-family: 'Inter', system-ui, sans-serif;
	font-weight: 700;
	font-size: clamp(2.75rem, 11vw, 9rem);
	line-height: 1;
	letter-spacing: -0.04em;
	/* SIEMPRE claro: el wordmark vive sobre el hero oscuro y NO debe seguir
	 * el tema del SO. Usar la variable semántica --trx-text lo dejaba negro
	 * en prefers-color-scheme: light → ilegible sobre el overlay. */
	color: oklch(99% 0.003 252);
	user-select: none;
	margin: 0;
	padding-right: calc(var(--trx-dot-size) + var(--trx-dot-x) + 0.04em);
	text-shadow:
		0 2px 4px  oklch(14% 0.018 254 / 0.60),
		0 6px 32px oklch(14% 0.018 254 / 0.55);

	opacity: 0;
	transform: translateY(8px);
	animation: trx-fade-up 800ms var(--trx-ease) 200ms forwards;
}

.trx-landing__word { display: inline-block; line-height: 1; }

.trx-landing__dot {
	position: absolute;
	right: 0;
	bottom: calc(0.24em + var(--trx-dot-y) - (var(--trx-dot-size) / 2));
	width: var(--trx-dot-size);
	height: var(--trx-dot-size);
	border-radius: 50%;
	background: var(--trx-accent);
	box-shadow:
		0 0 0 0 oklch(72% 0.18 230 / 0.6),
		0 0 24px 0 oklch(72% 0.18 230 / 0.5);
	animation: trx-dot-breath 2.4s var(--trx-ease) infinite;
	transform-origin: center;
	will-change: transform, box-shadow;
}

.trx-landing__dot::before,
.trx-landing__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1px solid var(--trx-accent);
	opacity: 0;
	animation: trx-dot-pulse 2.4s var(--trx-ease) infinite;
}
.trx-landing__dot::after { animation-delay: 1.2s; }

@keyframes trx-dot-breath {
	0%, 100% {
		transform: scale(1);
		box-shadow:
			0 0 0 0 oklch(72% 0.18 230 / 0.6),
			0 0 24px 0 oklch(72% 0.18 230 / 0.5);
	}
	50% {
		transform: scale(1.15);
		box-shadow:
			0 0 0 8px oklch(72% 0.18 230 / 0),
			0 0 48px 4px oklch(72% 0.18 230 / 0.7);
	}
}

@keyframes trx-dot-pulse {
	0%   { transform: scale(1);   opacity: 0.8; }
	100% { transform: scale(4.5); opacity: 0;   }
}

@keyframes trx-fade-up {
	to { opacity: 1; transform: translateY(0); }
}

/* TAGLINE (subtítulo principal) ------------------------------- */
.trx-landing__tagline {
	margin: 0;
	max-width: 30ch;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: clamp(1.25rem, 1.05rem + 0.85vw, 1.625rem);
	font-weight: 600;
	line-height: 1.28;
	letter-spacing: -0.01em;
	color: oklch(99% 0.003 252);
	text-wrap: pretty;
	text-shadow:
		0 2px 6px  oklch(14% 0.018 254 / 0.78),
		0 6px 28px oklch(14% 0.018 254 / 0.55);

	opacity: 0;
	transform: translateY(8px);
	animation: trx-fade-up 800ms var(--trx-ease) 520ms forwards;
}

/* FEATURES GRID (8 capacidades con iconos grandes) ------------ */
.trx-landing__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: 1280px;
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: clamp(0.75rem, 1.5vw, 1.5rem);
}

.trx-landing__grid-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.875rem;
	padding: var(--trx-space-3) 0.25rem;

	opacity: 0;
	transform: translateY(10px);
	animation: trx-fade-up 700ms var(--trx-ease) calc(900ms + var(--i, 0) * 75ms) forwards;
}

.trx-landing__grid-icon {
	display: grid;
	place-items: center;
	width: 120px;
	height: 120px;
	border-radius: var(--trx-radius-lg);
	background: oklch(14% 0.018 254 / 0.55);
	border: 1px solid oklch(72% 0.18 230 / 0.30);
	backdrop-filter: blur(12px) saturate(140%);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	color: var(--trx-accent);
	box-shadow:
		0 8px 28px oklch(0% 0 0 / 0.28),
		inset 0 1px 0 oklch(100% 0 0 / 0.06);
	transition:
		transform var(--trx-dur-base) var(--trx-ease-soft),
		border-color var(--trx-dur-base) var(--trx-ease-soft),
		box-shadow var(--trx-dur-base) var(--trx-ease-soft),
		color var(--trx-dur-base) var(--trx-ease-soft);
}
.trx-landing__grid-icon svg {
	width: 60px;
	height: 60px;
}

.trx-landing__grid-item:hover .trx-landing__grid-icon {
	transform: translateY(-4px);
	border-color: oklch(72% 0.18 230 / 0.65);
	box-shadow:
		0 14px 38px oklch(72% 0.18 230 / 0.32),
		inset 0 1px 0 oklch(100% 0 0 / 0.08);
	color: var(--trx-accent-2);
}

.trx-landing__grid-label {
	display: block;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: clamp(0.875rem, 0.82rem + 0.3vw, 1.0625rem);
	font-weight: 500;
	line-height: 1.25;
	color: oklch(96% 0.005 252);
	letter-spacing: 0.005em;
	text-shadow:
		0 2px 6px oklch(14% 0.018 254 / 0.7),
		0 0 16px oklch(14% 0.018 254 / 0.4);
}

/* Responsive: 8 → 4 → 2 columnas */
@media (max-width: 1280px) {
	.trx-landing__grid-icon { width: 104px; height: 104px; }
	.trx-landing__grid-icon svg { width: 52px; height: 52px; }
}
@media (max-width: 1099px) {
	.trx-landing__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		max-width: 720px;
	}
	.trx-landing__grid-icon { width: 112px; height: 112px; }
	.trx-landing__grid-icon svg { width: 56px; height: 56px; }
}
@media (max-width: 900px) {
	/* En mobile mantenemos 4 columnas y achicamos el icon-tile para que
	 * 2 filas entren sin forzar scroll dentro del 100dvh. */
	.trx-landing__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		max-width: 520px;
		gap: 0.625rem;
	}
	.trx-landing__grid-item { gap: 0.5rem; padding: 0; }
	.trx-landing__grid-icon { width: 72px; height: 72px; border-radius: var(--trx-radius-md); }
	.trx-landing__grid-icon svg { width: 34px; height: 34px; }
	.trx-landing__grid-label {
		font-size: 0.75rem;
		line-height: 1.2;
	}
}
@media (max-width: 480px) {
	/* Phones (iPhone SE / 12-15 / Android común): 2 columnas con icon-tile
	 * compacto + label en horizontal. Permite labels largos sin truncar. */
	.trx-landing__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-width: 360px;
		gap: 0.75rem 1.25rem;
	}
	.trx-landing__grid-item {
		flex-direction: row;
		justify-content: flex-start;
		gap: 0.75rem;
		padding: 0;
	}
	.trx-landing__grid-icon { width: 48px; height: 48px; border-radius: var(--trx-radius-sm); }
	.trx-landing__grid-icon svg { width: 24px; height: 24px; }
	.trx-landing__grid-label {
		font-size: 0.875rem;
		text-align: left;
	}
}

/* STATEMENT (frase de cierre, sobre el indicador de scroll) --- */
.trx-landing__statement {
	margin: 0;
	max-width: 42ch;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: clamp(1rem, 0.92rem + 0.35vw, 1.1875rem);
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: -0.005em;
	color: oklch(99% 0.003 252);
	text-wrap: pretty;
	text-shadow:
		0 2px 8px  oklch(14% 0.018 254 / 0.8),
		0 0 24px   oklch(14% 0.018 254 / 0.55);

	opacity: 0;
	transform: translateY(8px);
	animation: trx-fade-up 800ms var(--trx-ease) 1500ms forwards;
}

/* SCROLL INDICATOR — puramente visual (no interactivo) -------- */
.trx-landing__scroll {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-top: var(--trx-space-3);
	border-radius: 50%;
	background: oklch(14% 0.018 254 / 0.45);
	border: 1px solid oklch(100% 0 0 / 0.28);
	color: oklch(99% 0.003 252);
	backdrop-filter: blur(8px) saturate(140%);
	-webkit-backdrop-filter: blur(8px) saturate(140%);
	box-shadow: 0 4px 18px oklch(0% 0 0 / 0.3);
	pointer-events: none;

	opacity: 0;
	animation: trx-fade-up 800ms var(--trx-ease) 1750ms forwards;
}
.trx-landing__scroll svg {
	width: 22px;
	height: 22px;
	animation: trx-scroll-bounce 2.2s var(--trx-ease) infinite;
}

@keyframes trx-scroll-bounce {
	0%, 100%   { transform: translateY(-2px); opacity: 0.85; }
	50%        { transform: translateY(5px);  opacity: 1;    }
}

/* REDUCED MOTION ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.trx-landing__dot,
	.trx-landing__dot::before,
	.trx-landing__dot::after,
	.trx-landing__scroll svg {
		animation: none;
	}
	.trx-landing__mark,
	.trx-landing__tagline,
	.trx-landing__statement,
	.trx-landing__scroll,
	.trx-landing__grid-item {
		opacity: 1;
		transform: none;
		animation: none;
	}
	.trx-landing__grid-item:hover .trx-landing__grid-icon {
		transform: none;
	}
}
