/*
 * GEAM: fundamentos compartidos (fuentes, variables, base, botones).
 * Colores tomados del logo. Para cambiar la paleta o la escala, edite solo :root.
 *
 * Reglas de Safari 26 (iOS): nada de background-color con transición en html/body, y ningún
 * fixed/sticky de ancho completo arriba sin pointer-events:none o visibility:hidden. Así la
 * barra de estado muestra la página con su desenfoque nativo y sin bandas sólidas.
 */

/* Satoshi (Fontshare, licencia gratuita de uso comercial): texto, rótulos, botones y formularios. */
@font-face {
	font-family: "Satoshi";
	src: url("../fuentes/satoshi-400.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "Satoshi";
	src: url("../fuentes/satoshi-500.woff2") format("woff2");
	font-weight: 500;
	font-display: swap;
}
@font-face {
	font-family: "Satoshi";
	src: url("../fuentes/satoshi-700.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}

:root {
	--noche: #000136;
	--marino: #004a90;
	--rojo: #d20000;
	--cielo: #a2dbe6;
	--tinta: #12173a;
	--tinta-2: #565f7a;
	--linea: #e2e5ed;
	--niebla: #f3f5f9;
	--blanco: #fff;

	--fuente-texto: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--fuente-titulos: var(--fuente-texto);

	/* El titular de portada se limita también por alto, para que quepa en el primer pantallazo. */
	--t-hero: clamp(1.7rem, min(9.4vw, 13.4svh), 6rem);
	--t-cabecera: clamp(1.9rem, min(7vw, 11svh), 4.75rem);
	--t-1: clamp(2rem, 6vw, 4.5rem);
	--t-2: clamp(2rem, 4.9vw, 4rem);
	--t-3: clamp(1.45rem, 2.5vw, 2rem);
	--t-lead: clamp(1.0625rem, 1.35vw, 1.1875rem);
	--t-texto: 1.0625rem;
	--t-menor: .875rem;

	--ancho: 1520px;
	--ancho-bloque: min(100vw - 2 * var(--orilla), 1720px); /* Fotos y franjas: un poco más que el contenido. */
	--margen: clamp(16px, 4vw, 64px);
	--orilla: clamp(6px, .8vw, 12px);
	--seccion: clamp(80px, 11vw, 144px);
	--enc-alto: 80px;
	--curva: cubic-bezier(.16, 1, .3, 1);
	--dur: .9s;
	--radio: 14px;
	--radio-grande: clamp(24px, 2.4vw, 28px);

	/* Colores del contenido: cambian al llegar al pie (html.en-pie). */
	--c-titulo: var(--noche);
	--c-texto: var(--tinta);
	--c-suave: var(--tinta-2);
	--c-linea: var(--linea);
	--c-acento: var(--marino);
}
@media (max-width: 767px) { :root { --enc-alto: 68px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--blanco); scroll-padding-top: calc(var(--enc-alto) + 16px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* El color del lienzo cambia sin transición (Safari lo lee para rebote y barras); lo que se ve con transición es la capa ::before. */
body {
	position: relative;
	isolation: isolate;
	min-height: 100%;
	margin: 0;
	overflow-x: clip;
	background-color: var(--blanco);
	color: var(--c-texto);
	font: 400 var(--t-texto)/1.55 var(--fuente-texto);
	-webkit-font-smoothing: antialiased;
	font-synthesis: none;
	overflow-wrap: break-word;
}
body::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--blanco); pointer-events: none; transition: background-color var(--dur) var(--curva); }
html.en-pie, html.en-pie body { background-color: var(--noche); }
html.en-pie body::before { background-color: var(--noche); }
html.en-pie main {
	--c-titulo: #fff;
	--c-texto: #fff;
	--c-suave: rgb(255 255 255 / 68%);
	--c-linea: rgb(255 255 255 / 18%);
	--c-acento: var(--cielo);
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.pie :focus-visible, .pulso :focus-visible, .menu :focus-visible { outline-color: #fff; }
:focus-visible { outline: 2px solid var(--marino); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--noche); color: #fff; }

.saltar { position: fixed; left: 12px; top: -64px; z-index: 200; padding: 10px 18px; border-radius: 999px; background: var(--noche); color: #fff; text-decoration: none; font-weight: 500; transition: top .2s; }
.saltar:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

.contenedor { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; }
.lead { max-width: 46ch; color: var(--c-suave); font-size: var(--t-lead); line-height: 1.5; text-wrap: pretty; transition: color var(--dur) var(--curva); }
/* Rótulo corto sobre un título de sección: dice de qué trata lo que sigue. */
.rotulo { display: inline-flex; align-items: center; gap: 10px; color: var(--marino); font-size: .9375rem; font-weight: 500; letter-spacing: .01em; }
.rotulo::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--rojo); }
.seccion-titulo { color: var(--c-titulo); font-family: var(--fuente-titulos); font-size: var(--t-2); font-weight: 500; line-height: 1; letter-spacing: -.01em; text-wrap: balance; }

/* Titular que entra palabra por palabra, sin esperar a JavaScript. */
.titular { font-family: var(--fuente-titulos); font-weight: 500; letter-spacing: -.01em; text-wrap: balance; }
.titular__m { display: inline-block; overflow: hidden; vertical-align: top; padding: .15em .05em .18em; margin: -.15em -.05em -.18em; }
.titular__p { display: inline-block; animation: palabra-entra 1.15s var(--curva) both; animation-delay: calc(var(--i) * 55ms + 80ms); }
.titular .es-resalte { color: var(--c-acento); }
@keyframes palabra-entra { from { transform: translateY(125%); } }

/* Botón de píldora. Con .boton--bola, el círculo de la flecha se expande y llena el botón. */
.boton {
	--b-fondo: var(--noche);
	--b-texto: #fff;
	--b-bola: var(--marino);
	--b-bola-texto: #fff;
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 52px;
	padding: 0 26px;
	overflow: hidden;
	border: 0;
	border-radius: 999px;
	background: var(--b-fondo);
	color: var(--b-texto);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color .3s var(--curva), background-color .3s, transform .35s var(--curva);
	-webkit-tap-highlight-color: transparent;
}
.boton:active { transform: scale(.98); }
.boton:disabled { opacity: .55; cursor: wait; }
.boton--primario { --b-fondo: var(--noche); --b-texto: #fff; }
.boton--claro { --b-fondo: #fff; --b-texto: var(--noche); }
.boton--borde { --b-fondo: transparent; --b-texto: var(--noche); box-shadow: inset 0 0 0 1.5px var(--noche); }
.boton--ancho { width: 100%; }
@media (hover: hover) { .boton--primario:not(.boton--bola):hover { background: var(--marino); } }
@media (hover: hover) { .boton--borde:hover { background: var(--noche); color: #fff; } }
.boton--bola { justify-content: space-between; padding: 6px 6px 6px 24px; }
.boton__bola { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--b-bola-texto); transition: transform .45s var(--curva); }
.boton__bola::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: var(--b-bola); transition: transform .5s var(--curva); }
.boton__bola .flecha { position: relative; width: 20px; height: 20px; }
@media (hover: hover) {
	.boton--bola:hover { color: var(--b-bola-texto); }
	.boton--bola:hover .boton__bola::before { transform: scale(14); }
	.boton--bola:hover .boton__bola { transform: translateX(2px); }
}
html.en-pie main .boton--primario { --b-fondo: #fff; --b-texto: var(--noche); }

/* Enlace de texto con flecha. */
.enlace { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; font-weight: 500; text-decoration: none; }
.enlace > span { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; padding-bottom: 2px; transition: background-size .6s var(--curva); }
.enlace .flecha { flex: none; width: 20px; height: 20px; transition: transform .6s var(--curva); }
@media (hover: hover) {
	.enlace:hover > span { background-size: 0 1.5px; background-position: 100% 100%; }
	.enlace:hover .flecha { transform: translateX(6px); }
}

/* Lista de resultados del buscador de puntos (portada y calculadora). */
.busca { max-height: 280px; overflow-y: auto; background: #fff; border-radius: var(--radio); }
.busca__opcion { display: flex; flex-direction: column; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: none; color: var(--tinta); font: inherit; text-align: left; cursor: pointer; }
.busca__opcion[aria-selected="true"], .busca__opcion:hover { background: var(--niebla); }
.busca__nombre { font-weight: 600; }
.busca__nota { font-size: var(--t-menor); color: var(--tinta-2); }
.busca__vacio { margin: 0; padding: 14px; color: var(--tinta-2); font-size: var(--t-menor); }

/* Transición entre páginas, sin JavaScript. El encabezado y el chat se quedan quietos. */
@view-transition { navigation: auto; }
.enc { view-transition-name: geam-enc; }
.gm-chat { view-transition-name: geam-chat; }
::view-transition-old(root) { animation: vt-sale .35s var(--curva) both; }
::view-transition-new(root) { animation: vt-entra .55s var(--curva) .08s both; }
::view-transition-group(geam-enc), ::view-transition-group(geam-chat) { animation-duration: 0s; }
::view-transition-old(geam-enc), ::view-transition-new(geam-enc), ::view-transition-old(geam-chat), ::view-transition-new(geam-chat) { animation: none; }
@keyframes vt-sale { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-entra { from { opacity: 0; transform: translateY(24px); } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
	::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Marca de variación de los indicadores: flecha y cuánto subió o bajó. */
.variacion { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-size: .8125rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
.variacion--sube { color: #3f9d74; }
.variacion--baja { color: #d4706b; }
.variacion--igual { color: currentColor; opacity: .6; font-weight: 500; }
/* Sobre la franja oscura, los mismos tonos en versión más clara. */
[data-dato] .variacion--sube { color: #93dfb5; }
[data-dato] .variacion--baja { color: #f4a9a4; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Mientras llega el dato, el guion inicial no debe verse como una cifra grande. */
[data-dato]:not(:has([data-cifra])) { font-size: 1rem; opacity: .4; }
