/* TrainPicker: estilo de toda la web.

   Dirección: «panel de salidas» con los colores del logo. Morado del logo para lo
   que se pulsa, morado noche para los paneles, verde de «plaza libre» y cifras
   como en un panel de horarios.
   Títulos en Bricolage Grotesque (servida desde este dominio, licencia OFL en
   fuentes/OFL.txt); el texto, en la fuente del sistema, que carga al instante.

   Reglas del proyecto: sin JavaScript (el menú móvil es un <details>), sin
   recursos de terceros y sin estilos en línea (la CSP solo admite este fichero).
   Mobile-first: lo básico es para el móvil y se amplía con min-width.
   Accesibilidad: WCAG 2.2 AA (docs/accesibilidad.md). */

@font-face {
  font-family: "Bricolage";
  src: url("fuentes/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* --- Sistema de diseño ------------------------------------------------------ */

:root {
  --papel: #f7f4f8;
  --superficie: #ffffff;
  --texto: #1d1622;
  --suave: #5a5161;
  --borde: #e6dfea;
  --enlace: #6b1f7a;
  --tinta: #22092b;          /* morado noche: panel, pie y llamada final */
  --tinta-2: #301039;
  --sobre-tinta: #f6ecf8;
  --sobre-tinta-suave: #d3c0da;
  --acento: #6b1f7a;         /* el morado del logo: botones y acentos */
  --acento-hover: #7f2b90;
  --sobre-acento: #ffffff;
  --acento-claro: #e5bdee;   /* acento sobre fondos oscuros: cifras, títulos */
  --libre: #13703c;
  --libre-brillo: #2fd17a;
  --no: #a23a2a;
  --foco: #6b1f7a;
  --sombra: 0 1px 2px rgb(34 9 43 / .06), 0 8px 24px rgb(34 9 43 / .08);
  --sombra-alta: 0 2px 4px rgb(34 9 43 / .08), 0 18px 40px rgb(34 9 43 / .16);
  --radio: 14px;
  --fuente-titulos: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente-texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --fuente-panel: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papel: #130b17;
    --superficie: #1d1323;
    --texto: #f0eaf3;
    --suave: #b9adc0;
    --borde: #35263e;
    --enlace: #dfb2ea;
    --tinta: #0b040e;
    --tinta-2: #26112e;
    --acento: #8a34a0;
    --acento-hover: #9b45b1;
    --libre: #46c98a;
    --no: #ff8f7e;
    --foco: #dfb2ea;
    --sombra: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3);
    --sombra-alta: 0 2px 4px rgb(0 0 0 / .4), 0 18px 40px rgb(0 0 0 / .45);
  }
}

/* --- Base ------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--texto);
  font: 1.0625rem/1.65 var(--fuente-texto);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--enlace); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code {
  font-family: var(--fuente-panel); font-size: .88em;
  background: color-mix(in srgb, var(--texto) 8%, transparent);
  padding: .1em .35em; border-radius: 5px;
}
h1, h2, h3 { font-family: var(--fuente-titulos); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: clamp(1.4rem, 1.2rem + .9vw, 1.85rem); font-weight: 750; margin: 2.5rem 0 .8rem; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 1.75rem 0 .5rem; }
p, li { text-wrap: pretty; }

.contenedor { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .contenedor { padding: 0 24px; } }

/* --- Accesibilidad ---------------------------------------------------------- */

:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; border-radius: 4px; }
.saltar {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: .6rem 1rem; border-radius: 8px;
  background: var(--superficie); color: var(--texto); font-weight: 700; box-shadow: var(--sombra-alta);
}
.saltar:focus { top: 10px; }
.visualmente-oculto {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Botones ---------------------------------------------------------------- */

.boton, .cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .7rem 1.4rem;
  border: 2px solid transparent;         /* visible en alto contraste de Windows */
  border-radius: 999px;
  background: var(--acento); color: var(--sobre-acento);
  font: 700 1rem/1.2 var(--fuente-texto); text-decoration: none;
  box-shadow: 0 1px 0 rgb(34 9 43 / .25), 0 6px 18px rgb(107 31 122 / .3);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.boton:hover, .cta:hover {
  background: var(--acento-hover); transform: translateY(-2px);
  box-shadow: 0 2px 0 rgb(34 9 43 / .25), 0 12px 26px rgb(107 31 122 / .4);
}
.boton:active { transform: translateY(0); }
.boton span[aria-hidden] { transition: transform .15s ease; }
.boton:hover span[aria-hidden] { transform: translateX(3px); }
.boton-grande { min-height: 56px; padding: .95rem 1.9rem; font-size: 1.125rem; }
.boton-barra { min-height: 40px; padding: .45rem 1rem; font-size: .95rem; white-space: nowrap; box-shadow: none; }
.boton-claro { background: var(--sobre-tinta); color: var(--tinta); box-shadow: none; }
.cta-final .boton, .caja-cta .boton { border-color: rgb(255 255 255 / .35); }
.boton-claro:hover { background: #fff; box-shadow: none; }

.enlace-secundario {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--texto); font-weight: 700; text-decoration: underline;
  text-decoration-color: var(--acento); text-decoration-thickness: 3px; text-underline-offset: .3em;
}
.enlace-flecha { margin: 1.75rem 0 0; font-weight: 700; }
.enlace-flecha a { display: inline-block; padding: .25rem 0; }

/* --- Cabecera --------------------------------------------------------------- */

header.sitio {
  position: sticky; top: 0; z-index: 50;
  /* Casi opaca y sin backdrop-filter: el desenfoque obligaba a repintar la
     cabecera en cada fotograma de scroll. */
  background: color-mix(in srgb, var(--papel) 96%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--borde) 70%, transparent);
}
.barra { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.marca {
  display: inline-flex; align-items: center; gap: .6rem; margin-right: auto;
  color: var(--texto); text-decoration: none;
  font: 800 1.2rem/1 var(--fuente-titulos); letter-spacing: -.02em;
}
.marca img { border-radius: 9px; }
.nav-escritorio { display: none; }
.nav-escritorio a, .menu-movil nav a {
  color: var(--texto); text-decoration: none; font-weight: 600;
}
.nav-escritorio a:hover, .menu-movil nav a:hover { color: var(--enlace); text-decoration: underline; }

/* Menú del móvil: <details> que despliega la navegación bajo la barra. */
.menu-movil summary {
  display: grid; padding: 0; place-items: center; width: 44px; height: 44px; margin-right: -6px;
  list-style: none; cursor: pointer; border-radius: 10px;
}
.menu-movil summary::-webkit-details-marker { display: none; }
.menu-icono, .menu-icono::before, .menu-icono::after {
  display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--texto);
  transition: transform .2s ease, opacity .2s ease;
}
.menu-icono { position: relative; }
.menu-icono::before, .menu-icono::after { content: ""; position: absolute; left: 0; }
.menu-icono::before { top: -7px; }
.menu-icono::after { top: 7px; }
.menu-movil[open] .menu-icono { background: transparent; }
.menu-movil[open] .menu-icono::before { transform: translateY(7px) rotate(45deg); }
.menu-movil[open] .menu-icono::after { transform: translateY(-7px) rotate(-45deg); }
.menu-movil nav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: grid; padding: .5rem 16px 1rem;
  background: var(--superficie); border-bottom: 1px solid var(--borde); box-shadow: var(--sombra-alta);
}
.menu-movil nav a { padding: .8rem 0; border-bottom: 1px solid var(--borde); font-size: 1.1rem; }
.menu-movil nav a:last-child { border-bottom: 0; }

@media (max-width: 380px) { .boton-barra { display: none; } }
@media (min-width: 860px) {
  .nav-escritorio { display: flex; gap: 1.6rem; }
  .nav-escritorio a { padding: .5rem 0; }
  .menu-movil { display: none; }
}

/* --- Portada: héroe --------------------------------------------------------- */

.heroe {
  position: relative; overflow: hidden;
  padding: 2.5rem 0 3.5rem;
  /* Fondo liso: el protagonista es el titular y el aviso del móvil. */
}
.heroe-rejilla { display: grid; gap: 3rem; align-items: center; }
.antetitulo {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1rem;
  font: 700 .8rem/1.2 var(--fuente-panel); letter-spacing: .08em; text-transform: uppercase;
  color: var(--suave);
}
.punto-libre {
  position: relative; width: .6rem; height: .6rem; border-radius: 50%; background: var(--libre-brillo);
}
.punto-libre::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--libre-brillo);
  opacity: 0; animation: latido 2s ease-out 3;      /* tres latidos y se para (WCAG 2.2.2) */
}
.heroe h1 {
  font-size: clamp(2.35rem, 1.2rem + 5vw, 4.6rem); line-height: 1.02; letter-spacing: -.035em;
  margin-bottom: 1.25rem; max-width: 14ch;
}
.resalte {
  color: var(--enlace);
  background: linear-gradient(transparent 64%, color-mix(in srgb, var(--acento) 20%, transparent) 64% 94%, transparent 94%) 0 0 / 100% 100% no-repeat;
  padding: 0 .08em;
  animation: subrayar .7s cubic-bezier(.6, 0, .2, 1) .55s both;   /* la promesa se subraya al cargar */
}
.heroe-sub { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: var(--suave); max-width: 36rem; margin: 0 0 2rem; }
.heroe-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.sellos { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.sellos li {
  padding: .3rem .75rem; border: 1px solid var(--borde); border-radius: 999px;
  background: var(--superficie); font-size: .9rem; font-weight: 600;
}
.sellos li::before { content: "✓ "; color: var(--libre); font-weight: 800; }

/* Entrada escalonada al cargar. */
.heroe-texto > * { animation: subir .6s cubic-bezier(.2, .7, .2, 1) both; }
.heroe-texto > :nth-child(2) { animation-delay: .08s; }
.heroe-texto > :nth-child(3) { animation-delay: .16s; }
.heroe-texto > :nth-child(4) { animation-delay: .24s; }
.heroe-texto > :nth-child(5) { animation-delay: .32s; }

/* El móvil con el aviso real del bot. */
.movil { margin: 0 auto; width: min(100%, 340px); }
.movil-pantalla {
  border: 10px solid var(--tinta); border-radius: 38px; overflow: hidden;
  background: #dfe7ef; box-shadow: var(--sombra-alta);
  /* Entra el móvil y, cuando llega el aviso (1,35 s), vibra como uno de verdad. */
  animation: entrar-movil .8s cubic-bezier(.2, .8, .2, 1) .1s both, vibrar .5s ease-in-out 1.35s;
}
.chat-barra {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem;
  background: #fff; color: #172130; border-bottom: 1px solid #d5dde6;
}
.chat-barra img { border-radius: 50%; }
.chat-barra p { margin: 0; display: grid; line-height: 1.2; font-size: .95rem; }
.chat-barra span { font-size: .8rem; color: #5b6676; }
.chat {
  display: grid; gap: .45rem; padding: 1rem .8rem 1.2rem; color: #172130; font-size: .9rem; line-height: 1.45;
  background: #dfe7ef;
}
.chat p { margin: 0; }
.chat-yo {
  justify-self: end; padding: .45rem .75rem; border-radius: 14px 14px 4px 14px;
  background: #d9f6c8; font-size: .85rem;
  animation: llegar .35s ease .8s both;                            /* 1. pulsas «Avisar» */
}
.chat-bot {
  display: grid; gap: .55rem; padding: .75rem .85rem; border-radius: 14px 14px 14px 4px;
  background: #fff; box-shadow: 0 1px 1px rgb(14 26 43 / .12);
  animation: llegar .5s cubic-bezier(.2, .9, .3, 1.2) 1.35s both;
}
.chat-boton {
  padding: .55rem; border-radius: 10px; text-align: center; font-weight: 700;
  background: rgb(255 255 255 / .75); color: #6b1f7a;
  animation: llegar .4s ease 1.75s both;
}
.chat-boton-principal { background: var(--acento); color: var(--sobre-acento); }
.movil figcaption { margin-top: .9rem; text-align: center; font-size: .85rem; color: var(--suave); }

@media (min-width: 960px) {
  .heroe { padding: 4.5rem 0 5.5rem; }
  .heroe-rejilla { grid-template-columns: 1.2fr .8fr; gap: 4rem; }
  .movil { transform: rotate(2.5deg); }
}

/* --- Panel de salidas ------------------------------------------------------- */

.panel {
  position: relative; margin: 0 0 1rem; padding: 1.25rem;
  background: var(--tinta); color: var(--sobre-tinta);
  border-radius: var(--radio); box-shadow: var(--sombra-alta);
  --foco: #f0d2f6;
}
.panel-titulo {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1rem;
  font: 700 .8rem/1 var(--fuente-panel); letter-spacing: .14em; text-transform: uppercase;
  color: var(--acento-claro);
}
.panel-titulo::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--libre-brillo); }
.panel-celdas {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  margin: 0; padding: 0; list-style: none;
  background: rgb(255 255 255 / .1); border-radius: 10px; overflow: hidden;
}
.panel-celdas li {
  display: grid; align-content: start; gap: .35rem; padding: 1rem;
  background: var(--tinta-2); color: var(--sobre-tinta-suave); font-size: .92rem; line-height: 1.4;
}
.panel-celdas strong {
  font: 700 clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem)/1 var(--fuente-panel); letter-spacing: -.02em;
  color: var(--acento-claro); font-variant-numeric: tabular-nums;
}
/* Con un número impar de cifras, la última ocupa la fila entera (sin celda vacía). */
.panel-celdas li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 760px) { .panel-celdas li:last-child:nth-child(odd) { grid-column: auto; } }
.panel-nota { margin: .9rem 0 0; font-size: .85rem; color: var(--sobre-tinta-suave); }
.panel-datos { margin-top: 1rem; }
.portada .panel { margin-top: -1.5rem; }
.portada .panel-datos { margin-top: 1rem; }
@media (min-width: 760px) {
  .panel { padding: 1.5rem 1.75rem; }
  .panel-celdas { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}

/* --- Secciones de la portada ------------------------------------------------ */

.seccion { padding: 4rem 0; }
.seccion-alterna { background: var(--superficie); border-block: 1px solid var(--borde); }
.titulo-seccion { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); margin: 0 0 2rem; max-width: 22ch; }
@media (min-width: 960px) { .seccion { padding: 5.5rem 0; } }

/* La vía: pasos como estaciones de una línea. */
.via { counter-reset: parada; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.via li {
  counter-increment: parada; position: relative;
  padding: 0 0 2rem 4rem;
}
.via li::before {
  content: counter(parada);
  position: absolute; left: 0; top: 0; z-index: 1;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--tinta); color: var(--acento-claro); border: 3px solid var(--acento);
  font: 800 1.1rem/1 var(--fuente-panel);
}
.via li::after {
  content: ""; position: absolute; left: calc(1.375rem - 2px); top: 2.75rem; bottom: 0; width: 4px;
  /* Traviesas: línea discontinua como una vía. */
  background: repeating-linear-gradient(var(--borde) 0 8px, transparent 8px 14px);
}
.via li:last-child { padding-bottom: 0; }
.via li:last-child::after { display: none; }
.via h3 { margin: .4rem 0 .35rem; }
.via p { margin: 0; color: var(--suave); }
@media (min-width: 860px) {
  .via { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .via li { padding: 4rem 0 0; }
  .via li::after {
    left: 3.25rem; right: -2rem; top: calc(1.375rem - 2px); bottom: auto; width: auto; height: 4px;
    background: repeating-linear-gradient(90deg, var(--borde) 0 10px, transparent 10px 16px);
  }
  .via li:last-child::after { display: none; }
}

/* Funciones en rejilla «bento». */
.bento { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.bento li {
  padding: 1.5rem; border: 1px solid var(--borde); border-radius: var(--radio);
  background: var(--papel); transition: transform .2s ease, box-shadow .2s ease;
}
.bento li:hover { transform: translateY(-3px); box-shadow: var(--sombra); }
.bento h3 { margin: 1rem 0 .4rem; }
.bento p { margin: 0; color: var(--suave); }
.bento-grande {
  background: var(--tinta) !important; color: var(--sobre-tinta); border-color: transparent !important;
  --foco: #f0d2f6;
}
.bento-grande h3 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); color: #fff; }
.bento-grande p { color: var(--sobre-tinta-suave) !important; font-size: 1.05rem; }
.icono {
  width: 2.75rem; height: 2.75rem; padding: .55rem; border-radius: 12px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  background: color-mix(in srgb, var(--acento) 22%, transparent); color: var(--texto);
}
.bento-grande .icono { width: 3.5rem; height: 3.5rem; background: var(--acento-claro); color: var(--tinta); }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, 1fr); } .bento-grande { grid-column: 1 / -1; } }
@media (min-width: 960px) {
  .bento { grid-template-columns: 1.3fr 1fr 1fr; }
  .bento-grande { grid-column: 1; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; }
}

/* Lo que hace y lo que no. */
.dos-columnas { display: grid; gap: 1rem; }
@media (min-width: 720px) { .dos-columnas { grid-template-columns: 1fr 1fr; } }
.tarjeta {
  padding: 1.5rem; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie);
}
.tarjeta h3 { margin: 0 0 1rem; font-size: 1.5rem; }
.marcas { margin: 0; padding: 0; list-style: none; display: grid; gap: .8rem; }
.marcas li { position: relative; padding-left: 2rem; }
.marcas li::before {
  position: absolute; left: 0; top: .1em;
  display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  font-size: .8rem; font-weight: 800; color: #fff;
}
.tarjeta-si { border-top: 4px solid var(--libre); }
.tarjeta-si .marcas li::before { content: "✓"; background: var(--libre); }
.tarjeta-no { border-top: 4px solid var(--no); }
.tarjeta-no .marcas li::before { content: "✕"; background: var(--no); }
@media (prefers-color-scheme: dark) {
  .tarjeta-si .marcas li::before, .tarjeta-no .marcas li::before { color: #0b131e; }
}

/* Preguntas. */
.faq-rejilla { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .faq-rejilla { grid-template-columns: 1fr 1.6fr; gap: 3rem; align-items: start; } }

details:not(.menu-movil) {
  margin: 0 0 .75rem; border: 1px solid var(--borde); border-radius: 12px;
  background: var(--superficie); transition: box-shadow .2s ease;
}
details:not(.menu-movil)[open] { box-shadow: var(--sombra); }
details:not(.menu-movil) > summary {
  position: relative; display: block; padding: 1rem 3.25rem 1rem 1.15rem;
  list-style: none; cursor: pointer; font-weight: 700; line-height: 1.4;
}
summary::-webkit-details-marker { display: none; }
details:not(.menu-movil) > summary::after {
  content: "+"; position: absolute; right: 1rem; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: color-mix(in srgb, var(--acento) 30%, transparent);
  font: 700 1.2rem/1 var(--fuente-panel); transition: rotate .2s ease;
}
details:not(.menu-movil)[open] > summary::after { content: "−"; }
details:not(.menu-movil) > summary:hover { color: var(--enlace); }
details > div { padding: 0 1.15rem 1.1rem; color: var(--suave); }
details > div p:first-child { margin-top: 0; }
.seccion-alterna details { background: var(--papel); }

/* Guías. */
.guias { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .guias { grid-template-columns: repeat(3, 1fr); } }
.guias a {
  display: grid; gap: .6rem; height: 100%; padding: 1.4rem;
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie);
  color: var(--texto); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.guias a:hover { transform: translateY(-3px); box-shadow: var(--sombra); border-color: var(--acento); }
.guia-etiqueta { font: 700 .75rem/1 var(--fuente-panel); letter-spacing: .08em; text-transform: uppercase; color: var(--suave); }
.guia-titulo { font: 700 1.2rem/1.25 var(--fuente-titulos); letter-spacing: -.01em; }

/* Llamada final. */
.cta-final {
  padding: 4.5rem 0; text-align: center;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .035) 0 1px, transparent 1px 48px),
    radial-gradient(40rem 20rem at 50% 120%, rgb(176 82 199 / .45), transparent 70%),
    var(--tinta);
  color: var(--sobre-tinta);
  --foco: #f0d2f6;
}
.cta-final h2 { margin: 0 auto 1rem; max-width: 18ch; font-size: clamp(1.9rem, 1.2rem + 3vw, 3.2rem); color: #fff; }
.cta-final p { margin: 0 auto 2rem; max-width: 34rem; color: var(--sobre-tinta-suave); font-size: 1.125rem; }

/* --- Páginas de contenido (guías, legal, FAQ, rutas) ------------------------ */

main.lectura { max-width: 46rem; padding-top: 2.5rem; padding-bottom: 3rem; }
main.lectura h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); line-height: 1.08; letter-spacing: -.03em; }
main.lectura h2 { padding-top: .25rem; }
main.lectura > p, main.lectura article > p, main.lectura li { line-height: 1.7; }
.entradilla { font-size: clamp(1.1rem, 1rem + .4vw, 1.25rem); color: var(--suave); }
.fecha, .nota, .resumen { color: var(--suave); font-size: .92rem; }
.fecha { font: 600 .85rem/1.4 var(--fuente-panel); letter-spacing: .02em; }

ul.lista, ol.pasos { padding-left: 1.4rem; }
ul.lista li, ol.pasos li { margin-bottom: .55rem; }
ul.lista li::marker { color: var(--acento); }
ol.pasos { counter-reset: paso; list-style: none; padding-left: 0; }
ol.pasos li { counter-increment: paso; position: relative; padding-left: 2.6rem; margin-bottom: .9rem; }
ol.pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: .05em;
  display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--acento); color: #fff; font: 800 .9rem/1 var(--fuente-panel);
}
@media (prefers-color-scheme: dark) { ol.pasos li::before { background: var(--tinta-2); } }

.aviso {
  margin: 1.5rem 0; padding: 1rem 1.25rem; border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--acento) 12%, var(--superficie)); border-left: 4px solid var(--acento);
}

.volver { margin-top: 2.5rem; font-weight: 700; }
.migas ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; font-size: .9rem; color: var(--suave); }
.migas li + li::before { content: "›"; margin-right: .5rem; color: var(--suave); }
.migas a { display: inline-block; padding: .2rem 0; color: var(--suave); }
.migas [aria-current] { color: var(--texto); display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* --- Páginas anchas: índice de guías y preguntas ----------------------------- */

main.ancha { padding-top: 2.5rem; padding-bottom: 3rem; }
main.ancha > .caja-cta { max-width: 46rem; margin-left: auto; margin-right: auto; }

/* Índice de guías: cabecera, temas como atajos, la guía principal destacada y
   el resto en tarjetas agrupadas por tema. */
.indice-cabecera { max-width: 46rem; margin-bottom: 2rem; }
.indice-cabecera h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em; }
.temas { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.temas a {
  display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .9rem;
  border: 1px solid var(--borde); border-radius: 999px; background: var(--superficie);
  color: var(--texto); font-weight: 600; text-decoration: none; transition: border-color .2s ease, color .2s ease;
}
.temas a:hover { border-color: var(--acento); color: var(--enlace); }

.tarjeta-guia {
  display: flex; flex-direction: column; gap: .6rem; height: 100%; padding: 1.4rem;
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie);
  color: var(--texto); text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tarjeta-guia:hover { transform: translateY(-3px); box-shadow: var(--sombra); border-color: var(--acento); }
.tarjeta-guia-titulo { margin: 0; font-size: 1.2rem; line-height: 1.25; }
.tarjeta-guia p { margin: 0; color: var(--suave); font-size: .97rem; }
.tarjeta-guia-leer { margin-top: auto; padding-top: .4rem; color: var(--enlace); font-weight: 700; font-size: .95rem; }
.tarjeta-guia-leer::after { content: "→"; display: inline-block; margin-left: .35em; transition: translate .2s ease; }
.tarjeta-guia:hover .tarjeta-guia-leer::after { translate: 3px 0; }

.guia-destacada { margin: 0 0 3rem; }
.guia-destacada-etiqueta {
  margin: 0 0 .75rem; font: 700 .8rem/1.2 var(--fuente-panel); letter-spacing: .08em; text-transform: uppercase; color: var(--suave);
}
.guia-destacada .tarjeta-guia {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border: 0;
  background: radial-gradient(30rem 14rem at 100% 0, rgb(176 82 199 / .35), transparent 70%), var(--tinta);
  color: var(--sobre-tinta); --foco: #f0d2f6;
}
.guia-destacada .tarjeta-guia-titulo { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); color: #fff; max-width: 24ch; }
.guia-destacada .tarjeta-guia p { color: var(--sobre-tinta-suave); font-size: 1.1rem; max-width: 40rem; }
.guia-destacada .tarjeta-guia-leer { color: var(--acento-claro); }

.tema-blog { margin-bottom: 3rem; }
.tema-blog-cabecera { margin-bottom: 1.25rem; }
.tema-blog-cabecera h2 { margin: 0 0 .35rem; }
.tema-blog-cabecera p { margin: 0; color: var(--suave); }
.rejilla-guias { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .rejilla-guias { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .rejilla-guias { grid-template-columns: repeat(3, 1fr); } }

/* Preguntas: índice fijo a la izquierda y las preguntas agrupadas a la derecha. */
.faq-pagina { display: grid; gap: 2rem; }
.faq-lateral h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.2rem); line-height: 1.05; letter-spacing: -.03em; }
.faq-indice { margin: 1.5rem 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.faq-indice a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 44px;
  padding: .55rem .9rem; border: 1px solid var(--borde); border-radius: 10px; background: var(--superficie);
  color: var(--texto); font-weight: 600; text-decoration: none; transition: border-color .2s ease, color .2s ease;
}
.faq-indice a:hover { border-color: var(--acento); color: var(--enlace); }
.faq-indice span {
  min-width: 1.6rem; padding: .1rem .45rem; border-radius: 999px; text-align: center;
  background: color-mix(in srgb, var(--acento) 14%, transparent); font: 700 .8rem/1.4 var(--fuente-panel);
}
.faq-mas { color: var(--suave); font-size: .95rem; }
.faq-grupo { margin-bottom: 2.5rem; scroll-margin-top: 5.5rem; }
.faq-grupo h2 { margin: 0 0 1rem; }
@media (min-width: 900px) {
  .faq-pagina { grid-template-columns: minmax(16rem, 1fr) 2fr; gap: 4rem; align-items: start; }
  .faq-lateral { position: sticky; top: 6rem; }
}

/* ¿Por qué TrainPicker?: cuatro razones numeradas, lo que no hace y la
   comparación con las otras opciones (tarjetas y tabla a todo el ancho). */
.razones { counter-reset: razon; display: grid; gap: 2rem 3rem; margin: 0 0 3rem; padding: 0; list-style: none; }
@media (min-width: 760px) { .razones { grid-template-columns: repeat(2, 1fr); } }
.razones li { counter-increment: razon; position: relative; padding-top: 1.25rem; border-top: 2px solid var(--borde); }
.razones li::before {
  content: counter(razon, decimal-leading-zero);
  display: block; margin-bottom: .75rem;
  font: 700 2.4rem/1 var(--fuente-panel); letter-spacing: -.04em; color: var(--enlace);
}
.razones h2 { margin: 0 0 .5rem; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.razones p { margin: 0; color: var(--suave); font-size: 1.05rem; max-width: 34rem; }

.limites {
  display: grid; gap: 1.25rem; margin: 3rem 0; padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie);
}
.limites h2 { margin: 0 0 .35rem; }
.limites > div p { margin: 0; color: var(--suave); }
.limites .marcas li::before { content: "✕"; background: var(--no); }
@media (prefers-color-scheme: dark) { .limites .marcas li::before { color: #130b17; } }
@media (min-width: 860px) { .limites { grid-template-columns: 1fr 2fr; gap: 3rem; align-items: start; } }

.frente > h2 { margin: 0 0 .5rem; }
.frente-intro { margin: 0 0 1.25rem; color: var(--suave); }
.titulo-tabla { margin: 0 0 .75rem; font-size: 1.35rem; }
.opciones { display: grid; gap: 1rem; margin: 0 0 2.5rem; padding: 0; list-style: none; }
@media (min-width: 900px) { .opciones { grid-template-columns: repeat(3, 1fr); } }
.opcion {
  display: flex; flex-direction: column; gap: .25rem; padding: 1.5rem;
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie);
}
.opcion h3 { margin: 0 0 .25rem; font-size: 1.4rem; }
.opcion p { margin: .4rem 0 0; color: var(--suave); }
.opcion .opcion-veredicto { margin: 0 0 .4rem; color: var(--texto); font-weight: 700; font-size: 1.05rem; }
.opcion-destacada {
  border: 0; color: var(--sobre-tinta); --foco: #f0d2f6;
  background: radial-gradient(26rem 12rem at 100% 0, rgb(176 82 199 / .35), transparent 70%), var(--tinta);
}
.opcion-destacada h3 { color: #fff; }
.opcion-destacada p { color: var(--sobre-tinta-suave); }
.opcion-destacada .opcion-veredicto { color: var(--acento-claro); }
.opcion-destacada a { color: var(--acento-claro); }
main.ancha .panel { margin: 2rem 0; }

/* 404. */
.error-codigo { margin: 0; font: 700 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--fuente-panel); color: var(--enlace); letter-spacing: -.04em; }

/* Tablas. */
.tabla-envoltorio { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--borde); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--superficie); font-size: .97rem; }
th, td { text-align: left; vertical-align: top; padding: .75rem .9rem; border-bottom: 1px solid var(--borde); }
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
thead th { background: var(--tinta); color: var(--sobre-tinta); font-family: var(--fuente-titulos); }
tbody th { width: 38%; font-weight: 700; }
table.comparativa { min-width: 34rem; }
table.comparativa th { width: auto; }
table.comparativa td:last-child { background: color-mix(in srgb, var(--acento) 14%, transparent); font-weight: 600; }

/* Llamada final de las páginas de contenido. */
.caja-cta {
  margin: 3rem 0 0; padding: 1.75rem; border-radius: var(--radio);
  background: radial-gradient(30rem 12rem at 100% 0, rgb(176 82 199 / .4), transparent 70%), var(--tinta);
  color: var(--sobre-tinta-suave);
  --foco: #f0d2f6;
}
.caja-cta p { margin: 0 0 1.25rem; }
.caja-cta .caja-cta-titulo { margin-bottom: .5rem; font: 800 1.6rem/1.15 var(--fuente-titulos); color: #fff; letter-spacing: -.02em; }

/* Recuadro de cifras dentro de un artículo. */
main.lectura .panel { margin: 2rem 0; }

/* --- Pie -------------------------------------------------------------------- */

footer.sitio {
  margin-top: 0; padding: 3.5rem 0 1.5rem;
  background: var(--tinta); color: var(--sobre-tinta-suave); font-size: .95rem;
  --foco: #f0d2f6;
}
footer.sitio { border-top: 4px solid var(--acento); }
.pie-rejilla { display: grid; gap: 2rem; }
@media (min-width: 640px) { .pie-rejilla { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .pie-rejilla { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 3rem; } }
.pie-marca .marca { color: #fff; margin-bottom: 1rem; }
.pie-marca p { margin: 0 0 1.25rem; max-width: 22rem; }
footer.sitio h2 {
  margin: 0 0 .9rem; font: 700 .8rem/1 var(--fuente-panel); letter-spacing: .12em; text-transform: uppercase; color: var(--acento-claro);
}
footer.sitio ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .15rem; }
footer.sitio nav a { display: inline-block; padding: .3rem 0; color: var(--sobre-tinta); text-decoration: none; }
footer.sitio nav a:hover { color: #fff; text-decoration: underline; }
.pie-final {
  display: grid; gap: .5rem; margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / .12); font-size: .88rem;
}
.pie-final p { margin: 0; }
@media (min-width: 760px) { .pie-final { grid-template-columns: 1fr auto; gap: 2rem; } }

/* --- Movimiento ------------------------------------------------------------- */
/* Motion design solo con CSS. Cada animación cuenta algo:
   - Al cargar: el texto entra escalonado, «Te aviso» se subraya y el móvil
     reproduce el aviso real (pulsas Avisar, llega el mensaje, vibra, salen los
     botones).
   - Al hacer scroll (animation-timeline; si el navegador no lo soporta, todo se
     ve igual, sin animar): las cifras caen como las paletas de un panel de
     estación, la vía se dibuja y se encienden sus paradas, las secciones
     aparecen, la cabecera gana sombra y en las páginas de lectura una barra
     marca el progreso.
   - Al abrir una pregunta, la respuesta se despliega.
   Se usa `translate`/`scale` en los fotogramas para no pisar los `transform`
   del hover. Todo se apaga con prefers-reduced-motion (al final). Nada se
   repite en bucle (WCAG 2.2.2). */

@keyframes subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes llegar { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes latido { from { opacity: .6; scale: 1; } to { opacity: 0; scale: 3.2; } }
@keyframes subrayar { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
@keyframes entrar-movil { from { opacity: 0; translate: 0 40px; rotate: -4deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes vibrar {
  0%, 100% { translate: 0 0; }
  15%, 55% { translate: -3px 0; }
  35%, 75% { translate: 3px 0; }
}
/* La opacidad llega al máximo al principio (20 %) y lo que sigue es solo el
   desplazamiento: un texto que asoma por el borde inferior ya se lee con su
   contraste completo. */
@keyframes aparecer {
  from { opacity: 0; translate: 0 18px; animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  20% { opacity: 1; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes paleta {
  from { opacity: 0; transform: perspective(500px) rotateX(-95deg); }
  20% { opacity: 1; }
  60% { opacity: 1; transform: perspective(500px) rotateX(18deg); }
  80% { transform: perspective(500px) rotateX(-6deg); }
  to { opacity: 1; transform: none; }
}
@keyframes trazar-x { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes trazar-y { from { scale: 1 0; } to { scale: 1 1; } }
@keyframes encender { from { scale: .5; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes con-sombra { from { opacity: 0; } to { opacity: 1; } }
@keyframes progreso { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes desplegar { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }

/* El menú del móvil baja en vez de aparecer de golpe. */
.menu-movil[open] nav { animation: desplegar .2s ease both; }

/* Preguntas: la respuesta se despliega (navegadores con ::details-content). */
@supports selector(::details-content) {
  :root { interpolate-size: allow-keywords; }
  details:not(.menu-movil)::details-content {
    height: 0; overflow: clip;
    transition: height .3s ease, content-visibility .3s allow-discrete;
  }
  details:not(.menu-movil)[open]::details-content { height: auto; }
}
details:not(.menu-movil) > summary::after { transition: rotate .25s ease; }
details:not(.menu-movil)[open] > summary::after { rotate: 180deg; }

@supports (animation-timeline: view()) {
  /* La cabecera gana sombra en cuanto la página se mueve. */
  header.sitio::after {
    content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none;
    background: linear-gradient(rgb(34 9 43 / .08), transparent);
    animation: con-sombra linear both; animation-timeline: scroll(root); animation-range: 0 120px;
  }

  /* Barra de progreso de lectura en guías, legales y rutas. */
  body:has(main.lectura)::before {
    content: ""; position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: 3px;
    background: var(--acento); transform-origin: 0 50%;
    scale: 0 1;   /* vacía si la página no tiene scroll (la línea de tiempo no se activa) */
    animation: progreso linear both; animation-timeline: scroll(root);
  }

  /* Las secciones aparecen al llegar a ellas; los hermanos, escalonados. */
  .titulo-seccion, .seccion .antetitulo, .seccion .enlace-flecha,
  .bento li, .tarjeta, .faq-lista details, .guias li, .rejilla-guias li, .faq-grupo, .guia-destacada, .opcion, .limites,
  .cta-final h2, .cta-final p, .cta-final .boton, .caja-cta {
    animation: aparecer linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
  .bento li:nth-child(2), .guias li:nth-child(2), .tarjeta + .tarjeta, .faq-lista details:nth-child(2), .opcion:nth-child(2) { animation-range: entry 10% entry 100%; }
  .bento li:nth-child(3), .guias li:nth-child(3), .faq-lista details:nth-child(3), .opcion:nth-child(3) { animation-range: entry 20% entry 100%; }
  .bento li:nth-child(4), .faq-lista details:nth-child(4) { animation-range: entry 30% entry 100%; }
  .bento li:nth-child(5) { animation-range: entry 40% entry 100%; }

  /* Panel de salidas: cada cifra cae como una paleta, una detrás de otra. */
  .panel-celdas { view-timeline-name: --panel; }
  .panel-celdas strong {
    transform-origin: 50% 0;
    animation: paleta linear both; animation-timeline: --panel;
    animation-range: entry 10% entry 70%;
  }
  .panel-celdas li:nth-child(2) strong { animation-range: entry 25% entry 80%; }
  .panel-celdas li:nth-child(3) strong { animation-range: entry 40% entry 90%; }
  .panel-celdas li:nth-child(4) strong { animation-range: entry 55% entry 100%; }

  /* La vía se dibuja y cada parada se enciende cuando la línea llega a ella.
     Repartida en medio scroll de pantalla (~500 px): con rangos más cortos el
     recorrido entero pasaba en un golpe de rueda. */
  .via li { view-timeline-name: --parada; }
  .via li::before { animation: encender linear both; animation-timeline: --parada; animation-range: entry 60% cover 25%; }
  .via li::after {
    transform-origin: 50% 0;
    animation: trazar-y linear both; animation-timeline: --parada; animation-range: cover 22% cover 48%;
  }
  .via li > * { animation: aparecer linear both; animation-timeline: --parada; animation-range: entry 50% cover 30%; }
  @media (min-width: 860px) {
    /* En horizontal, la línea se traza de izquierda a derecha mientras la sección
       cruza la pantalla (del 12 % al 64 % de su recorrido, siempre visible). */
    .via { view-timeline-name: --via; }
    .via li::before, .via li::after, .via li > * { animation-timeline: --via; }
    .via li::after { transform-origin: 0 50%; animation-name: trazar-x; }
    .via li:nth-child(1)::before, .via li:nth-child(1) > * { animation-range: cover 12% cover 20%; }
    .via li:nth-child(1)::after { animation-range: cover 18% cover 29%; }
    .via li:nth-child(2)::before, .via li:nth-child(2) > * { animation-range: cover 27% cover 35%; }
    .via li:nth-child(2)::after { animation-range: cover 33% cover 44%; }
    .via li:nth-child(3)::before, .via li:nth-child(3) > * { animation-range: cover 42% cover 50%; }
    .via li:nth-child(3)::after { animation-range: cover 48% cover 58%; }
    .via li:nth-child(4)::before, .via li:nth-child(4) > * { animation-range: cover 56% cover 64%; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
