/* Motivo de fondo (§9.3): caminos que convergen en un punto de acento que late.
   SVG para las líneas y `offset-path` para los puntos viajeros, todo desde clases (la CSP no
   admite estilos en línea). Solo aparece en la portada, en pequeño en las pantallas de acceso
   y llegando al anillo de la cuenta atrás. Con `prefers-reduced-motion` las líneas se quedan y
   los puntos no se mueven ni laten. */

@keyframes viajar {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  84% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@keyframes pulso {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3.4); opacity: 0; }
}

.escena { pointer-events: none; }
.escena__lienzo {
  position: absolute;
  width: var(--ancho);
  height: var(--alto);
  transform: scale(var(--k, 1));
}
.escena__lineas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; fill: none; stroke-width: 1; }
.linea-fuerte { stroke: var(--linea-fuerte); }
.linea-tenue { stroke: var(--linea-tenue); }
.linea-linea { stroke: var(--linea); }

.punto { position: absolute; left: 0; top: 0; border-radius: 50%; offset-rotate: 0deg; opacity: 0; }

/* Centro: punto de acento con anillos que se expanden */
.centro { position: absolute; border-radius: 50%; }
.centro__nucleo { position: absolute; inset: 0; border-radius: 50%; background: var(--acento); }
.centro__anillo {
  position: absolute;
  inset: 0;
  border: 1px solid var(--acento);
  border-radius: 50%;
  animation: pulso 3.2s ease-out infinite;
}
.centro__anillo--2 { animation-delay: -1.6s; }

/* Escenas a sangre (portada, fondo de acceso y cuenta atrás de escritorio): cubren el contenedor.
   La posición (--x, --y) y la escala (--k) las fija motivo.js; los caminos nacen fuera de la
   pantalla (§9.8) porque el JS les antepone un tramo de entrada. Sin recorte del SVG: el tramo
   de entrada queda fuera y lo recorta el contenedor. */
.escena--portada-escritorio, .escena--portada-movil { position: absolute; inset: 0; overflow: hidden; }
.escena--portada-escritorio { --ancho: 1280px; --alto: 760px; display: none; }
.escena--portada-movil { --ancho: 390px; --alto: 844px; }
.escena--portada-escritorio .escena__lienzo,
.escena--portada-movil .escena__lienzo,
.escena--acceso-escritorio .escena__lienzo,
.escena--cuenta-escritorio .escena__lienzo {
  left: var(--x, 0);
  top: var(--y, 0);
  transform-origin: 0 0;
  transform: scale(var(--k, 1));
}
.escena--acceso-escritorio .escena__lineas,
.escena--cuenta-escritorio .escena__lineas,
.escena--portada-escritorio .escena__lineas,
.escena--portada-movil .escena__lineas { overflow: visible; }
@media (min-width: 800px) {
  .escena--portada-escritorio { display: block; }
  .escena--portada-movil { display: none; }
}

/* Acceso y cuenta atrás de móvil: ocupan el ancho de la columna y escalan con él */
.escena--acceso, .escena--cuenta { position: relative; width: 100%; height: calc(var(--alto) * var(--k, 1)); }
.escena--acceso { --ancho: 390px; --alto: 340px; }
.escena--cuenta { --ancho: 390px; --alto: 360px; }
.escena--acceso .escena__lienzo, .escena--cuenta .escena__lienzo {
  left: 50%;
  top: 0;
  overflow: hidden;
  transform-origin: 50% 0;
  transform: translateX(-50%) scale(var(--k, 1));
}
/* El motivo de acceso va detrás del contenido, arriba */
.escena--fondo { position: absolute; left: 0; right: 0; top: -52px; width: auto; z-index: 0; }

/* Desde 640 px el fondo de acceso es la escena de escritorio, a pantalla completa y detrás de todo;
   el motivo de móvil queda para < 640. */
.escena--acceso-escritorio { --ancho: 1280px; --alto: 800px; display: none; }
.escena--cuenta-escritorio { --ancho: 1280px; --alto: 800px; display: none; }
@media (min-width: 640px) {
  .escena--fondo.escena--acceso { display: none; }
  .escena--acceso-escritorio { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; }
  /* Cuenta atrás: llega al anillo desde los bordes de la pantalla. En tableta, a la altura de la
     página; en escritorio el contexto es fijo y la escena también. */
  .escena--cuenta-escritorio { display: block; position: absolute; inset: 0; z-index: -1; overflow: hidden; }
}
@media (min-width: 1024px) {
  .escena--cuenta-escritorio { position: fixed; }
}

/* Puntos viajeros (generados) */
/* GENERADO por la tabla de trayectorias de docs/disenos/eventos-ui (no editar a mano:
   las rutas `d` deben coincidir con motivo-datos.js; hay un test que lo comprueba). */

.punto.pe-1 { width: 10px; height: 10px; background: #8EA0FF; offset-path: path('M 520 -20 C 700 60, 1180 40, 1200 300 C 1215 380, 1060 340, 900 380'); animation: viajar 20s linear infinite; }
.punto.pe-2 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 520 -20 C 700 60, 1180 40, 1200 300 C 1215 380, 1060 340, 900 380'); animation: viajar 20s linear -11s infinite; }
.punto.pe-3 { width: 10px; height: 10px; background: #F0C674; offset-path: path('M 1300 600 C 1150 700, 820 700, 760 560 C 720 470, 800 390, 900 380'); animation: viajar 17s linear -4s infinite; }
.punto.pe-4 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M -20 250 C 260 120, 420 520, 640 470 C 760 440, 800 300, 900 380'); animation: viajar 22s linear -9s infinite; }
.punto.pe-5 { width: 10px; height: 10px; background: #F4F1EA; offset-path: path('M 1300 720 C 1100 740, 1120 520, 1000 520 C 920 520, 960 430, 900 380'); animation: viajar 15s linear -6s infinite; }
.punto.pe-6 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 380 780 Q 700 600 900 380'); animation: viajar 11s linear -5s infinite; }
.punto.pe-7 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 860 -20 C 760 120, 760 260, 900 380'); animation: viajar 10s linear -7s infinite; }
.punto.pm-1 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 60 -20 C 150 30, 370 60, 360 200 C 355 270, 270 290, 195 270'); animation: viajar 14s linear infinite; }
.punto.pm-2 { width: 10px; height: 10px; background: #F0C674; offset-path: path('M 410 400 C 340 480, 110 470, 80 380 C 60 320, 130 270, 195 270'); animation: viajar 13s linear -5s infinite; }
.punto.pm-3 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M -20 150 C 60 110, 60 250, 110 230 C 150 215, 160 240, 195 270'); animation: viajar 9s linear -4s infinite; }
.punto.pm-4 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 20 500 Q 120 420 195 270'); animation: viajar 8s linear -6s infinite; }
.punto.pm-5 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 200 -20 C 150 60, 150 190, 195 270'); animation: viajar 8s linear -3s infinite; }
.punto.pm-6 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 410 250 C 340 240, 330 350, 270 340 C 230 335, 225 300, 195 270'); animation: viajar 10s linear -7s infinite; }
.punto.ac-1 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M -20 60 C 120 -10, 380 20, 380 100 C 380 140, 340 150, 310 140'); animation: viajar 12s linear infinite; }
.punto.ac-2 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M -20 250 L 310 140'); animation: viajar 8s linear -3s infinite; }
.punto.ac-3 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 60 330 C 140 330, 150 220, 220 220 C 270 220, 280 170, 310 140'); animation: viajar 10s linear -6s infinite; }
.punto.ac-4 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 410 300 C 400 240, 300 230, 290 190 C 285 165, 295 150, 310 140'); animation: viajar 9s linear -2s infinite; }
.punto.cu-1 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M -20 150 L 91 188'); animation: viajar 5s linear infinite; }
.punto.cu-2 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M -20 330 C 30 330, 20 240, 60 235 C 80 232, 82 205, 91 188'); animation: viajar 9s linear -2s infinite; }
.punto.cu-3 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 410 40 C 400 110, 340 120, 320 150 C 308 165, 302 176, 299 188'); animation: viajar 8s linear -3s infinite; }
.punto.cu-4 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 410 330 Q 330 290 299 188'); animation: viajar 7s linear -5s infinite; }
.punto.ae-1 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 560 -20 C 760 40, 1220 20, 1180 150 C 1160 200, 1080 200, 1040 180'); animation: viajar 14s linear 0s infinite; }
.punto.ae-2 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 1300 330 C 1220 300, 1120 260, 1040 180'); animation: viajar 12s linear -4s infinite; }
.punto.ae-3 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M -160 660 C 300 660, 640 420, 900 220 C 960 200, 1000 190, 1040 180'); animation: viajar 13s linear -7s infinite; }
.punto.ae-4 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 900 -20 C 920 70, 980 140, 1040 180'); animation: viajar 8s linear -2s infinite; }
.punto.ae-5 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 1300 120 L 1040 180'); animation: viajar 9s linear -5s infinite; }
.punto.ce-1 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M -160 250 C 60 250, 80 330, 140 340'); animation: viajar 6s linear 0s infinite; }
.punto.ce-2 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M -160 640 C 40 580, 70 420, 140 410'); animation: viajar 9s linear -3s infinite; }
.punto.ce-3 { width: 8px; height: 8px; background: #8EA0FF; offset-path: path('M 380 -160 C 400 120, 390 280, 330 340'); animation: viajar 8s linear -5s infinite; }
.punto.ce-4 { width: 8px; height: 8px; background: #F4F1EA; offset-path: path('M 300 960 Q 400 560 330 410'); animation: viajar 9s linear -2s infinite; }

/* Con movimiento reducido: las líneas se quedan, los puntos quedan quietos y sin latido */
@media (prefers-reduced-motion: reduce) {
  .punto { opacity: 1; offset-distance: 58%; }
  .centro__anillo { display: none; }
}
