/* =============================================================================
   Trayecta EU · hero «Rayas claro» (vista previa /borrador-hero/rayas-claro/, 10/10/2026).
   Va DESPUÉS de tokens.css, epe.css, marca.css y europa.css. Ni un color, tamaño ni espaciado literal: todo sale de var(--...).
   Sin hex nuevos: usa los tokens de la identidad (crema, carbón, salvia, coral) y, como ellos, se oscurece solo con el
   ajuste del sistema. Idea de María: «fondo claro, que la imagen ocupe toda la pantalla como en aterrizaeu y que se vea de la familia».
   v2 (11/10, María): «son demasiadas rayas, vale solo con las de las profesiones» → una sola ruta por profesión, tierra toda del mismo gris,
   y el coral solo en esas rutas, las fichas que viajan a España y la diana de España (antigua variante B «tinta»).
   Los nombres de clase del dibujo llevan una «r» delante (rpais, rmarca): `.pais` y `.marca` ya existen en europa.css y epe.css.
   ========================================================================== */

.hc {
  --r-fondo: var(--c-fondo);
  --r-texto: var(--c-texto);
  --r-texto-suave: var(--c-texto-suave);
  --r-linea: var(--c-linea);
  --r-hoy: var(--c-marca-2);          /* coral: el único acento (líneas, dianas) */
  --r-hoy-texto: var(--c-foco);       /* coral oscuro: el mismo coral cuando hace de TEXTO (contraste ≥ 4,5:1) */
  --r-pronto: var(--c-marca-3);       /* salvia */
  --r-ficha: var(--c-texto);          /* círculo del pictograma: carbón sobre crema */
  --r-sobre-ficha: var(--c-fondo);

  /* Unidades del mapa por píxel de pantalla (k = 1000 / ancho del mapa en px); se ajusta por tamaño más abajo */
  --k: 2;
  --cometa: 3px;
  --op-hebra-hoy: 0.85;
  --op-hebra-pronto: 0.45;
  --op-pais-resto: 0.3;
  --op-pais-origen: 0.3;
  --op-pais-pronto: 0.3;
  --op-pais-hoy: 0.3;
  --op-relleno-resto: 0.1;
  --op-relleno-origen: 0.1;
  --op-relleno-pronto: 0.1;
  --op-relleno-hoy: 0.1;
  --op-brillo: 0.4;
  --op-brillo-medio: 0.14;
  --op-halo: 0.35;
  --hebra: 1.4px;
  --mapa-halo: 4px;
  --tam-rotulo: 0.75rem;
  --tam-rotulo-origen: 0.6875rem;
  --op-origen: 0.6;
  --icono-rayas: var(--e-5);
  --toque: 2.75rem;
  --entrada: 1300ms;
  --entrada-paso: 130ms;

  /* Cabecera (61 px en escritorio, medida): el hero es el resto de la pantalla */
  --hc-cab: 9rem;                     /* móvil: la cabecera ocupa 3 filas (se mide y se comprueba en la prueba) */
  --hc-h1: 1.75rem;
  --hc-ancho-mapa: 120cqw;
  --hc-izq: -4cqw;
}
@media (min-width: 48rem) { .hc { --k: 1.55; --tam-rotulo: var(--tam-xs); --tam-rotulo-origen: 0.75rem; } }
@media (min-width: 64rem) { .hc { --k: 1.15; } }
@media (min-width: 80rem) { .hc { --k: 0.95; } }
@media (min-width: 90rem) { .hc { --k: 0.85; } }
@media (min-width: 110rem) { .hc { --k: 0.65; } }
@media (min-width: 48rem) and (max-aspect-ratio: 1/1) { .hc { --k: 1.05; } }  /* tableta vertical: mapa de ~980 px */

/* ---------- Composición: el hero ocupa toda la pantalla bajo la cabecera ---------- */
.hc {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: size;
  height: calc(100vh - var(--hc-cab));
  height: calc(100svh - var(--hc-cab));
  min-height: 34rem;
  background: var(--r-fondo);
  color: var(--r-texto);
}
.hc .rayas { position: absolute; inset: 0; margin: 0; z-index: 0; }
.hc .rayas__lienzo {
  position: absolute;
  aspect-ratio: 1000 / 774.5;
  /* móvil: el mapa entero sube del borde de abajo, algo más ancho que la pantalla y centrado en el Atlántico */
  width: var(--hc-ancho-mapa);
  left: var(--hc-izq);
  bottom: 0;
}
.hc .rayas__base { display: block; width: 100%; height: auto; overflow: hidden; }
.hc .rayas__vivo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hc .rayas__vivo svg { overflow: visible; }
.hc .rayas__pausa { position: absolute; right: var(--margen-lateral); bottom: var(--e-8); z-index: 3; }

/* Velo de crema bajo el texto: lo que se lee nunca compite con las líneas */
.hc::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--r-fondo) 0%, var(--r-fondo) 43%, transparent 58%);
}

.hc__dentro {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-start;
  padding-top: var(--e-6);
}
.hc__texto { max-width: 36rem; }
.hc__lema {
  margin: 0 0 var(--e-3);
  font-size: var(--tam-lema);
  font-weight: var(--peso-fuerte);
  letter-spacing: var(--tracking-lema);
  text-transform: uppercase;
  color: var(--c-lema);
}
.hc h1 {
  margin: 0 0 var(--e-4);
  font-size: var(--hc-h1);
  line-height: var(--interlineado-titulo);
  letter-spacing: var(--tracking-titulo);
  text-wrap: balance;
}
.hc__lede { margin: 0 0 var(--e-4); font-size: var(--tam-s); color: var(--r-texto-suave); max-width: 32rem; }
.hc__acciones { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-3); --relleno-boton: 0.7em 1.1em; }
@media (min-width: 48rem) { .hc__lede { font-size: var(--tam-m); margin-bottom: var(--e-5); } .hc__acciones { --relleno-boton: 0.95em 1.5em; } }

/* Escritorio y tableta: texto a la izquierda, el mapa a la derecha y a todo el alto, con el velo de lado */
@media (min-width: 48rem) { .hc { --hc-cab: 3.8125rem; --hc-h1: var(--tam-h1-portada); } }
/* Solo en pantallas más anchas que altas: en una tableta vertical el mapa entero queda debajo del texto, como en el móvil */
@media (min-width: 48rem) and (min-aspect-ratio: 1/1) {
  .hc { --hc-ancho-mapa: min(max(calc(100cqh * 1.45), 82cqw), calc(100cqh * 1.65)); --hc-izq: auto; }
  .hc .rayas__lienzo { left: auto; right: -2cqw; bottom: auto; top: 50%; transform: translateY(-46%); }
  .hc::before { background: linear-gradient(to right, var(--r-fondo) 0%, var(--r-fondo) max(calc(50cqw - 4rem), 28rem), transparent max(calc(50cqw + 16rem), 46rem)); }
  /* velo algo translúcido: las rutas se adivinan bajo el texto (se mide el contraste con ellas debajo) */
  @supports (background: color-mix(in srgb, red 50%, transparent)) {
    .hc::before { background: linear-gradient(to right, color-mix(in srgb, var(--r-fondo) 86%, transparent) 0%, color-mix(in srgb, var(--r-fondo) 86%, transparent) max(calc(50cqw - 4rem), 28rem), transparent max(calc(50cqw + 16rem), 46rem)); }
  }
  .hc__dentro { align-items: center; padding-top: 0; }
  .hc .rayas__pausa { bottom: var(--e-7); }
}

/* ---------- Países: contorno fino y un velo de tinta en la tierra ---------- */
.rpais { fill: var(--r-texto); fill-opacity: var(--op-relleno-resto); stroke: var(--r-texto); stroke-width: calc(var(--borde-fino) * var(--k) * 0.8); stroke-linejoin: round; stroke-opacity: var(--op-pais-resto); }
.rpais--origen { stroke-opacity: var(--op-pais-origen); fill: var(--r-texto); fill-opacity: var(--op-relleno-origen); }
/* v2: la tierra es toda del mismo gris; el color queda solo para las rutas de profesión y la diana de destino */
.rpais--pronto, .rpais--hoy { stroke: var(--r-texto); fill: var(--r-texto); }

/* ---------- Rayas ---------- */
.hebra, .cometa { fill: none; stroke-linecap: round; }
.hebra { stroke-width: calc(var(--hebra) * var(--k)); }
.hebra--hoy { stroke: var(--r-hoy); stroke-opacity: var(--op-hebra-hoy); }
.hebra--pronto { stroke: var(--r-pronto); stroke-opacity: var(--op-hebra-pronto); }
.cometa { stroke-width: calc(var(--cometa) * var(--k)); }
.cometa--hoy { stroke: var(--r-hoy); }
.cometa--pronto { stroke: var(--r-pronto); }

/* ---------- Marcas y rótulos ---------- */
.origen__aro { fill: var(--r-fondo); stroke: var(--r-texto); stroke-opacity: var(--op-origen); stroke-width: var(--borde-medio); }
.origen__centro { fill: var(--r-texto); }
.destino__aro { stroke-width: var(--grosor-diana); }
.destino__brillo { fill: url("#brillo-hoy"); }
.brillo-0 { stop-color: var(--r-hoy); stop-opacity: var(--op-brillo); }
.brillo-1 { stop-color: var(--r-hoy); stop-opacity: var(--op-brillo-medio); }
.brillo-2 { stop-color: var(--r-hoy); stop-opacity: 0; }
.destino--hoy .destino__aro { fill: var(--r-fondo); stroke: var(--r-hoy); }
.destino--hoy .destino__centro { fill: var(--r-hoy); }
.destino--pronto .destino__aro { fill: var(--r-fondo); stroke: var(--r-pronto); }
.rotulo {
  font-family: var(--fuente-texto);
  font-size: var(--tam-rotulo);
  font-weight: var(--peso-fuerte);
  fill: var(--r-texto);
  paint-order: stroke fill;
  stroke: var(--r-fondo);
  stroke-width: var(--mapa-halo);
  stroke-linejoin: round;
}
.rotulo--origen { font-size: var(--tam-rotulo-origen); font-weight: var(--peso-medio); fill: var(--r-texto-suave); }
.rotulo--hoy { fill: var(--r-hoy-texto); }
.rotulo--pronto { font-weight: var(--peso-medio); fill: var(--r-texto-suave); }

/* ---------- Pictogramas: ficha de carbón con la línea de la profesión en crema y un aro del color de su destino ---------- */
.pict--hoy { color: var(--r-hoy); }
.pict--pronto { color: var(--r-pronto); }
.pict__fondo { fill: var(--r-ficha); stroke: currentColor; stroke-width: var(--borde-medio); }
.pict__halo { fill: url("#halo-hoy"); }
.pict--pronto .pict__halo { fill: url("#halo-pronto"); }
.halo-0, .halo-2 { stop-color: var(--r-texto); stop-opacity: 0; }
.halo-hoy-1 { stop-color: var(--r-hoy); stop-opacity: var(--op-halo); }
.halo-pronto-1 { stop-color: var(--r-pronto); stop-opacity: var(--op-halo); }
.pict__icono { color: var(--r-sobre-ficha); }
.pulso { fill: none; stroke-width: var(--borde-medio); opacity: 0; transform-box: fill-box; transform-origin: center; }
.pulso--hoy { stroke: var(--r-hoy); }
.pulso--pronto { stroke: var(--r-pronto); }
.pulso--origen { stroke: var(--r-texto); }

/* ---------- Pausa (WCAG 2.2.2) ---------- */
.rayas__pausa {
  display: grid;
  place-items: center;
  width: var(--toque);
  height: var(--toque);
  padding: 0;
  border: var(--borde-fino) solid var(--r-linea);
  border-radius: var(--radio-pastilla);
  background: var(--r-fondo);
  color: var(--r-texto);
  cursor: pointer;
  transition: background-color var(--transicion), transform var(--transicion);
}
.rayas__pausa[hidden] { display: none; }
.rayas__pausa:hover { background: var(--c-superficie-2); }
.rayas__pausa:active { transform: scale(var(--pulsar)); }
.rayas__pausa:focus-visible { outline: var(--grosor-foco) solid var(--c-foco); outline-offset: var(--borde-medio); }
.rayas__pausa-icono { width: var(--icono-rayas); height: var(--icono-rayas); }
.rayas__oculto { position: absolute; width: var(--borde-fino); height: var(--borde-fino); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Entrada: las líneas se dibujan; con movimiento reducido todo está ya dibujado ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hebra { animation: hebra-traza var(--entrada) var(--curva-entrada) backwards; }
  .rpais--origen, .rpais--pronto, .rpais--hoy { animation: rayas-aparece var(--entrada) var(--curva-entrada) backwards; }
  .rayas__origenes, .rayas__destinos, .rayas__viajeros { animation: rayas-aparece var(--entrada) var(--curva-entrada) backwards; }
  .rayas__origenes, .rayas__destinos { animation-delay: calc(var(--entrada-paso) * 3); }
  .rayas__viajeros { animation-delay: calc(var(--entrada-paso) * 8); }
  .hebra.e1 { animation-delay: calc(var(--entrada-paso) * 1); }
  .hebra.e2 { animation-delay: calc(var(--entrada-paso) * 2); }
  .hebra.e3 { animation-delay: calc(var(--entrada-paso) * 3); }
  .hebra.e4 { animation-delay: calc(var(--entrada-paso) * 4); }
  .hebra.e5 { animation-delay: calc(var(--entrada-paso) * 5); }
}
@keyframes hebra-traza { from { stroke-dasharray: 1 2; stroke-dashoffset: 1; } to { stroke-dasharray: 1 2; stroke-dashoffset: 0; } }
@keyframes rayas-aparece { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Colores forzados ---------- */
@media (forced-colors: active) {
  .rpais, .hebra, .cometa { stroke: GrayText; }
  .rpais--hoy, .hebra--hoy, .cometa--hoy, .destino--hoy .destino__aro, .pulso--hoy { stroke: Highlight; }
  .rpais--pronto, .rpais--origen, .hebra--pronto, .cometa--pronto, .destino--pronto .destino__aro, .origen__aro { stroke: CanvasText; }
  .rpais { fill: none; }
  .destino--hoy .destino__centro { fill: Highlight; }
  .destino__aro, .origen__aro, .pict__fondo { fill: Canvas; }
  .origen__centro { fill: CanvasText; }
  .rotulo { fill: CanvasText; stroke: Canvas; }
  .pict, .pict__icono { color: CanvasText; }
  .pict__fondo { stroke: CanvasText; }
  .destino__brillo, .pict__halo { display: none; }
  .hc::before { display: none; }
}
