/* ============================================================
   Soul in The Loop — hoja de estilos
   Tema oscuro minimalista. El color funciona como señal:
   azul = sistema · rojo = alma · dorado = consciencia (escaso).
   ============================================================ */

:root {
  /* Paleta oficial */
  --color-fondo: #020104;
  --color-azul: #60a5fa;
  --color-rojo: #e84568;
  --color-dorado: #d9c259;
  --color-texto: #f2eee6;
  --color-niebla: #bfbbc9;
  --color-niebla-2: #6f6b7a;
  --color-linea: rgba(242, 238, 230, 0.1);

  /* Tipografía */
  --fuente-display: "Space Grotesk", system-ui, sans-serif;
  --fuente-cuerpo: "Inter", system-ui, sans-serif;
  --fuente-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Ritmo */
  --ancho-max: 1100px;
  --espacio-seccion: clamp(6rem, 14vh, 10rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--color-fondo);
}

body {
  margin: 0;
  font-family: var(--fuente-cuerpo);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-texto);
  background: var(--color-fondo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Escena 3D de fondo ---------- */

#escena {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Viñeta fija: garantiza legibilidad del texto sobre la escena */
.vineta {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 35%, rgba(2, 1, 4, 0.65) 100%),
    linear-gradient(rgba(2, 1, 4, 0.38), rgba(2, 1, 4, 0.38));
}

/* Fallback sin WebGL: imagen estática de la red */
body.sin-webgl #escena { display: none; }
body.sin-webgl::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgba(96, 165, 250, 0.12), transparent 70%),
    var(--color-fondo) url("assets/og.jpg") center / cover no-repeat;
  opacity: 0.6;
}

/* ---------- Utilidades ---------- */

.salto-contenido {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--color-fondo);
  color: var(--color-dorado);
  font-family: var(--fuente-mono);
  font-size: 0.85rem;
}
.salto-contenido:focus {
  left: 1rem;
  top: 1rem;
}

/* El glifo hereda el color del texto a través de <use> */
svg use { fill: currentColor; }

:focus-visible {
  outline: 2px solid var(--color-dorado);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(217, 194, 89, 0.25);
  color: var(--color-texto);
}

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

.cabecera {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, background-color 0.4s ease;
}
.cabecera.con-fondo {
  background: rgba(2, 1, 4, 0.7);
  border-bottom-color: var(--color-linea);
  backdrop-filter: blur(12px);
}

.cabecera__marca {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-texto);
  text-decoration: none;
}
.cabecera__marca svg {
  width: 26px;
  height: 26px;
  color: var(--color-texto);
}
.cabecera__nombre {
  font-family: var(--fuente-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--color-niebla);
}

.cabecera nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.6rem);
}
.cabecera nav a {
  font-family: var(--fuente-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--color-niebla);
  text-decoration: none;
  transition: color 0.25s ease;
}
.cabecera nav a:hover { color: var(--color-texto); }
.cabecera nav a.nav-cta {
  color: var(--color-dorado);
  border: 1px solid rgba(217, 194, 89, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.cabecera nav a.nav-cta:hover {
  border-color: var(--color-dorado);
  background: rgba(217, 194, 89, 0.08);
}

@media (max-width: 720px) {
  .cabecera nav a:not(.nav-cta) { display: none; }
}

/* ---------- Estructura de secciones ---------- */

main {
  position: relative;
  z-index: 2;
  /* Halo oscuro bajo las letras: texto legible sobre la escena en todo momento */
  text-shadow: 0 1px 3px rgba(2, 1, 4, 0.85), 0 4px 26px rgba(2, 1, 4, 0.7);
}

.seccion {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--espacio-seccion) clamp(1.25rem, 5vw, 3rem);
}

.seccion__interior {
  width: 100%;
  max-width: var(--ancho-max);
  margin: 0 auto;
}

/* Etiqueta de fase (mono, con guiño al estado de la red) */
.fase {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--fuente-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-niebla-2);
  margin-bottom: 1.4rem;
}
.fase::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-azul);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}
.fase--roja::before { background: var(--color-rojo); box-shadow: 0 0 8px rgba(232, 69, 104, 0.6); }
.fase--dorada::before { background: var(--color-dorado); box-shadow: 0 0 8px rgba(217, 194, 89, 0.7); }

h1, h2, h3 {
  font-family: var(--fuente-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}
h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1rem; }

.texto-niebla { color: var(--color-niebla); }

.acento-azul { color: var(--color-azul); }
.acento-rojo { color: var(--color-rojo); }
.acento-dorado { color: var(--color-dorado); }

/* Revelado al entrar en viewport: desenfoque y leve escala,
   en cascada dentro de los grupos (--retraso lo asigna main.js) */
.revelar {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  filter: blur(10px);
  transition:
    opacity 0.85s ease,
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.85s ease;
  transition-delay: var(--retraso, 0s);
}
.revelar.visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Hero (fase: semilla) ---------- */

.hero {
  text-align: center;
  justify-content: center;
}
.hero .seccion__interior {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo {
  width: clamp(84px, 12vw, 128px);
  height: auto;
  color: var(--color-texto);
  margin-bottom: 2.2rem;
  animation: latido-logo 9s ease-in-out infinite;
}
@keyframes latido-logo {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}
.hero h1 .fina { font-weight: 300; color: var(--color-niebla); }

.hero__claim {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--color-niebla);
  max-width: 34ch;
  margin: 0 auto 2.6rem;
  text-wrap: balance;
}

.boton-dorado {
  display: inline-block;
  font-family: var(--fuente-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dorado);
  text-decoration: none;
  border: 1px solid rgba(217, 194, 89, 0.45);
  border-radius: 999px;
  padding: 0.85rem 2.1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.boton-dorado:hover {
  border-color: var(--color-dorado);
  background: rgba(217, 194, 89, 0.09);
  box-shadow: 0 0 32px rgba(217, 194, 89, 0.18);
}

.hero__indicador {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--fuente-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-niebla-2);
  animation: flotar 2.6s ease-in-out infinite;
}
@keyframes flotar {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ---------- Manifiesto (fase: federación) ---------- */

.manifiesto .seccion__interior { max-width: 760px; }

.manifiesto__frase {
  font-family: var(--fuente-display);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  text-wrap: balance;
}

.manifiesto__cuerpo {
  color: var(--color-niebla);
  max-width: 56ch;
  font-size: 1.05rem;
}

/* ---------- Quién soy ---------- */

.panel {
  background: rgba(5, 3, 12, 0.74);
  border: 1px solid var(--color-linea);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.quien__cabecera {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: 3rem;
}
@media (max-width: 820px) {
  .quien__cabecera { grid-template-columns: 1fr; }
}

.retrato {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-linea);
}
.retrato img {
  display: block;
  width: 100%;
  height: auto;
}
.retrato::after {
  /* Luz dividida sutil sobre el retrato: azul / rojo */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(96, 165, 250, 0.1), transparent 45%, transparent 55%, rgba(232, 69, 104, 0.1));
  pointer-events: none;
}

.quien__texto p { color: var(--color-niebla); }
.quien__texto strong { color: var(--color-texto); font-weight: 600; }

.tray__glifo {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
}
/* Anula el fill genérico de `svg use` (pensado para el logo) */
.tray__glifo use { fill: none; }

/* La trayectoria como cronograma horizontal: dos hilos (tecnológico
   azul y espiritual rojo) trenzados en doble hélice que avanza de
   izquierda a derecha; los hitos tecnológicos cuelgan por arriba y los
   espirituales por abajo. La banda queda fijada (sticky) mientras el
   scroll vertical de la página la recorre en horizontal: main.js da
   altura a la pista (#helice-pista) y mapea el avance a scrollLeft.
   También dibuja los hilos en #helice-svg leyendo --tray-amp. */
.helice {
  --tray-amp: 30px;
  --tray-paso: 148px;
  --helice-alto: 246px;
  margin-bottom: 1.25rem;
}
.helice__fijo {
  position: sticky;
  top: var(--helice-top, 35vh); /* main.js la centra en el encuadre */
}
.helice__defs { position: absolute; }
.helice__viento {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.helice__viento::-webkit-scrollbar { display: none; }
/* Cuando la banda va guiada por el scroll de la página, el gesto
   horizontal directo se desactiva para que no luchen entre sí */
.helice--fijada .helice__viento { overflow-x: hidden; }
.helice__viento:focus-visible {
  outline: 1px solid var(--color-niebla-2);
  outline-offset: 6px;
}
.helice__crono {
  position: relative;
  width: max-content;
  min-width: 100%;
  height: var(--helice-alto);
}
#helice-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.helice__lista {
  list-style: none;
  margin: 0;
  padding: 0 3.5rem;
  height: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--tray-paso);
  justify-content: center;
}
/* Cada hito duerme atenuado y se enciende cuando su tramo de la banda
   entra en el encuadre (clase .vivo, la pone main.js con el scroll) */
.hito-tray {
  position: relative;
  opacity: 0.2;
  transition: opacity 0.9s ease;
}
.hito-tray.vivo { opacity: 1; }
.hito-tray span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--tray-paso) - 1.4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  color: var(--color-niebla);
  font-size: 0.84rem;
  line-height: 1.4;
  transition: color 0.35s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hito-tray--tec:not(.vivo) span { transform: translateX(-50%) translateY(-9px); }
.hito-tray--esp:not(.vivo) span { transform: translateX(-50%) translateY(9px); }
.hito-tray--tec span {
  bottom: calc(50% + var(--tray-amp) + 0.9rem);
  flex-direction: column-reverse; /* el glifo queda pegado a su nodo */
}
.hito-tray--esp span {
  top: calc(50% + var(--tray-amp) + 0.9rem);
}
.hito-tray .tray__glifo { width: 12px; height: 12px; opacity: 0.9; }
.hito-tray--tec .tray__glifo { color: var(--color-azul); }
.hito-tray--esp .tray__glifo { color: var(--color-rojo); }
.hito-tray::before {
  /* Anillo del nodo, sobre el extremo de su hilo */
  content: "";
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid;
  background: rgba(5, 3, 12, 0.95);
  transition: box-shadow 0.35s ease;
  z-index: 1;
}
.hito-tray::after {
  /* Chispa interior */
  content: "";
  position: absolute;
  left: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 1;
}
.hito-tray--tec::before,
.hito-tray--tec::after { top: calc(50% - var(--tray-amp)); }
.hito-tray--esp::before,
.hito-tray--esp::after { top: calc(50% + var(--tray-amp)); }
.hito-tray--tec::before {
  border-color: var(--color-azul);
  box-shadow: 0 0 9px rgba(96, 165, 250, 0.22);
}
.hito-tray--esp::before {
  border-color: var(--color-rojo);
  box-shadow: 0 0 9px rgba(232, 69, 104, 0.22);
}
.hito-tray--tec::after { background: var(--color-azul); }
.hito-tray--esp::after { background: var(--color-rojo); }
.hito-tray:hover span { color: var(--color-texto); }
.hito-tray--tec:hover::before { box-shadow: 0 0 14px rgba(96, 165, 250, 0.6); }
.hito-tray--esp:hover::before { box-shadow: 0 0 14px rgba(232, 69, 104, 0.6); }
/* La chispa de cada nodo late mientras el hito está despierto */
@keyframes chispa-late {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.75); }
}
.hito-tray.vivo::after { animation: chispa-late 2.6s ease-in-out infinite alternate; }


/* Los hilos de la hélice (paths que genera main.js). Son etéreos:
   trazos tenues que se suman en luz donde se cruzan (blend aditivo),
   con un velo ancho detrás y partículas que fluyen hacia el futuro */
#helice-svg path { fill: none; mix-blend-mode: screen; }
#helice-svg .hilo { stroke-width: 1.1; stroke-linecap: round; }
#helice-svg .hilo--tec { stroke: rgba(96, 165, 250, 0.55); }
#helice-svg .hilo--esp { stroke: rgba(232, 69, 104, 0.55); }
#helice-svg .halo {
  stroke-width: 8;
  stroke-linecap: round;
}
#helice-svg .halo--tec { stroke: rgba(96, 165, 250, 0.12); }
#helice-svg .halo--esp { stroke: rgba(232, 69, 104, 0.12); }
#helice-svg .flujo {
  /* Partículas de luz recorriendo el hilo: el tiempo pasa */
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 1 27;
}
#helice-svg .flujo--tec { stroke: rgba(170, 205, 252, 0.95); }
#helice-svg .flujo--esp { stroke: rgba(248, 150, 172, 0.95); }
#helice-svg .eje-tiempo {
  /* La línea del tiempo insinuada tras el trenzado */
  stroke: rgba(242, 238, 230, 0.1);
  stroke-width: 1;
  stroke-dasharray: 2 8;
}
#helice-svg .origen { fill: rgba(242, 238, 230, 0.9); }
/* Dibujado al entrar en viewport: los hilos se trazan de izquierda a
   derecha y después aparecen velos, flujo y punto de origen */
#helice-svg .trazable {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}
#helice-svg.dibujar .trazable { stroke-dashoffset: 0; }
#helice-svg .aparece {
  opacity: 0;
  transition: opacity 1.1s ease 1.6s;
}
#helice-svg.dibujar .aparece { opacity: 1; }
/* Respiración: velos y punto de origen laten muy despacio */
@keyframes helice-respira {
  from { opacity: 0.5; }
  to { opacity: 1; }
}
#helice-svg.dibujar .halo { animation: helice-respira 4.5s ease-in-out 3s infinite alternate; }
#helice-svg.dibujar .origen { animation: helice-respira 3.5s ease-in-out 2.4s infinite alternate; }
/* El flujo avanza siempre hacia delante; el eje del tiempo deriva lento */
@keyframes helice-fluye {
  to { stroke-dashoffset: -600; }
}
#helice-svg.dibujar .flujo { animation: helice-fluye 30s linear 2.7s infinite; }
#helice-svg.dibujar .eje-tiempo { animation: helice-fluye 90s linear infinite; }

@media (max-width: 680px) {
  .helice { --tray-amp: 26px; --tray-paso: 132px; --helice-alto: 252px; }
  .hito-tray span { font-size: 0.78rem; width: calc(var(--tray-paso) - 1rem); }
}

.quien__detalle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 820px) {
  .quien__detalle { grid-template-columns: 1fr; }
}
.quien__detalle article {
  padding: 1.5rem 1.6rem;
}
.quien__detalle h3 {
  font-family: var(--fuente-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-niebla-2);
  margin-bottom: 0.8rem;
}
.quien__detalle p {
  color: var(--color-niebla);
  font-size: 0.94rem;
  margin: 0;
}

/* ---------- Los ejes (fase: distribución) — anillo de 6 nodos ----------
   La sección es una pista alta; la escena queda pegada (sticky) mientras
   el scroll rota el anillo y activa cada eje en el lector. */

.seccion--ejes {
  display: block;
  min-height: 0;
  height: 560vh;
  padding: 0;
}

.ejes__escena {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(4.5rem, 10vh, 7rem) clamp(1.25rem, 5vw, 3rem) clamp(2rem, 6vh, 4rem);
}

.anillo-escena {
  display: grid;
  grid-template-columns: minmax(280px, 430px) 1fr;
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  margin-top: 1.5rem;
}

#aro {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  overflow: visible;
}
#aro .orbita { fill: none; stroke: rgba(242, 238, 230, 0.14); stroke-width: 1; }
#giro {
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
#aro .nodo {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
#aro .nodo circle {
  fill: rgba(5, 3, 12, 0.85);
  stroke: var(--color-niebla-2);
  stroke-width: 1;
  transition: stroke 0.4s ease, fill 0.4s ease, filter 0.4s ease;
}
#aro .nodo:hover circle { stroke: var(--color-dorado); }
#aro .nodo.activo circle {
  stroke: var(--color-dorado);
  fill: rgba(217, 194, 89, 0.14);
  filter: drop-shadow(0 0 9px rgba(217, 194, 89, 0.6));
}
/* Iconos de los ejes: van tras las reglas de hover/activo para que sus
   circle no hereden el fondo ni el brillo del disco del nodo */
#aro .nodo .icono path,
#aro .nodo .icono circle {
  fill: none;
  stroke: var(--color-niebla);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
  transition: stroke 0.4s ease, fill 0.4s ease;
}
#aro .nodo .icono .lleno {
  fill: var(--color-niebla);
  stroke: none;
}
#aro .nodo.activo .icono path,
#aro .nodo.activo .icono circle { stroke: var(--color-dorado); }
#aro .nodo.activo .icono .lleno {
  fill: var(--color-dorado);
  stroke: none;
}
#aro .centro-txt {
  font-family: var(--fuente-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  fill: var(--color-niebla-2);
  text-anchor: middle;
}

#lector { position: relative; min-height: 16em; }
#lector .paso {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
#lector .paso.activo {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.paso__num {
  display: block;
  font-family: var(--fuente-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-dorado);
  margin-bottom: 1rem;
}
#lector .paso h3 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin-bottom: 0.8rem;
}
#lector .paso p {
  color: var(--color-niebla);
  max-width: 30em;
  margin: 0;
}
#lector .cuenta {
  position: absolute;
  bottom: -2.6rem;
  left: 0;
  font-family: var(--fuente-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--color-niebla-2);
}

/* Móvil: misma escena fijada, pero apilada — anillo arriba, lector debajo */
@media (max-width: 899px) {
  .ejes__escena {
    padding: clamp(3.5rem, 9vh, 5rem) clamp(1.25rem, 5vw, 3rem) clamp(1rem, 4vh, 2rem);
  }
  .seccion--ejes .seccion__interior > .texto-niebla { display: none; }
  .anillo-escena {
    grid-template-columns: 1fr;
    gap: clamp(1.2rem, 4vh, 2rem);
    justify-items: center;
    margin-top: 0.5rem;
  }
  #aro { max-width: min(210px, 55vw); }
  #lector { width: 100%; min-height: 17em; }
  #lector .cuenta {
    bottom: auto;
    top: -1.7rem;
    left: auto;
    right: 0;
  }
}

/* Pantallas muy bajas (móvil apaisado): sin escena fijada, ejes en lista */
@media (max-width: 899px) and (max-height: 520px) {
  .seccion--ejes { height: auto; }
  .seccion--ejes .seccion__interior > .texto-niebla { display: block; }
  .ejes__escena {
    position: static;
    min-height: 0;
    padding: var(--espacio-seccion) clamp(1.25rem, 5vw, 3rem);
  }
  #lector { min-height: 0; }
  #lector .paso {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    padding: 1.4rem 0;
    border-top: 1px solid var(--color-linea);
  }
  #lector .cuenta { display: none; }
}

/* ---------- El camino del alma ---------- */

.hito {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

#capa-viaje {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2; /* sobre la viñeta; main llega después en el DOM y pinta encima */
  pointer-events: none;
}
#camino-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: visible;
}
#camino {
  fill: none;
  stroke: var(--color-niebla-2);
  stroke-opacity: 0.35;
  stroke-width: 1;
}

#alma {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#alma .nucleo {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--color-dorado) 55%, #a08a2e);
  box-shadow: 0 0 18px 4px rgba(217, 194, 89, 0.55);
  animation: latido-alma 6s ease-in-out infinite;
}
@keyframes latido-alma {
  0%, 100% { transform: scale(0.85); }
  50% { transform: scale(1.12); }
}
#alma .anillo {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
#alma .a1 { left: -15px; top: -15px; width: 30px; height: 30px; border: 1px solid var(--color-dorado); }
#alma .a2 { left: -22px; top: -22px; width: 44px; height: 44px; border: 1px solid rgba(96, 165, 250, 0.6); }
#alma .a3 { left: -29px; top: -29px; width: 58px; height: 58px; border: 1px solid rgba(232, 69, 104, 0.55); }
#alma.c1 .a1, #alma.c2 .a1, #alma.c3 .a1 { opacity: 0.9; transform: scale(1); }
#alma.c2 .a2, #alma.c3 .a2 { opacity: 0.75; transform: scale(1); }
#alma.c3 .a3 { opacity: 0.6; transform: scale(1); }
#alma .aviso {
  position: absolute;
  left: 20px;
  top: -8px;
  font-family: var(--fuente-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--color-dorado);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: 0.6s ease;
}
#alma .aviso.ver { opacity: 1; transform: none; }

/* ---------- Servicios ---------- */

.servicios__grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
@media (max-width: 940px) { .servicios__grid { grid-template-columns: 1fr; } }

.servicio {
  padding: 2rem 1.9rem;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--serv-borde);
  background: radial-gradient(120% 80% at 50% 0%, var(--serv-tinte), transparent 55%), rgba(5, 3, 12, 0.74);
  /* Se repiten las transiciones de .revelar para poder añadir las de hover
     sin romper la entrada */
  transition:
    opacity 0.85s ease,
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.85s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease;
  transition-delay: var(--retraso, 0s);
}
.servicio:hover {
  border-color: var(--serv-borde);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  transition-delay: 0s;
}
.servicio--charla {
  --serv-color: var(--color-dorado);
  --serv-halo: rgba(217, 194, 89, 0.55);
  --serv-borde: rgba(217, 194, 89, 0.4);
  --serv-tinte: rgba(217, 194, 89, 0.07);
  border-color: rgba(217, 194, 89, 0.3);
  border-top-color: var(--serv-borde);
}
.servicio--taller {
  --serv-color: var(--color-azul);
  --serv-halo: rgba(96, 165, 250, 0.55);
  --serv-borde: rgba(96, 165, 250, 0.4);
  --serv-tinte: rgba(96, 165, 250, 0.07);
}
.servicio--mentoria {
  --serv-color: var(--color-rojo);
  --serv-halo: rgba(232, 69, 104, 0.55);
  --serv-borde: rgba(232, 69, 104, 0.4);
  --serv-tinte: rgba(232, 69, 104, 0.07);
}

/* Diagrama del formato: quién emite, quién recibe, cómo circula */
.servicio__figura {
  display: block;
  width: auto;
  height: 46px;
  margin-bottom: 1.4rem;
  color: var(--serv-color);
  overflow: visible;
  transition: filter 0.4s ease;
}
.servicio__figura .nodo {
  fill: rgba(5, 3, 12, 0.6);
  stroke: currentColor;
  stroke-width: 1.3;
}
.servicio__figura .nodo--lleno { fill: currentColor; }
.servicio__figura .trazo {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.45;
}
.servicio:hover .servicio__figura {
  filter: drop-shadow(0 0 8px var(--serv-halo));
}

.servicio__tipo {
  font-family: var(--fuente-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--serv-color);
  margin-bottom: 1.1rem;
}
.servicio h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 0.7rem;
}
.servicio p {
  color: var(--color-niebla);
  font-size: 0.95rem;
}
.servicio ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--color-niebla);
  font-size: 0.93rem;
}
.servicio ul li {
  padding: 0.38rem 0 0.38rem 1.1rem;
  position: relative;
}
.servicio ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-azul);
  opacity: 0.7;
}
.servicio ul li:nth-child(even)::before { background: var(--color-rojo); }

.chip-fecha {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  font-family: var(--fuente-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--color-dorado);
  border: 1px solid rgba(217, 194, 89, 0.4);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  margin-top: auto;
}
.chip-fecha::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-dorado);
  animation: pulso-chip 2.4s ease-in-out infinite;
}
@keyframes pulso-chip {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ---------- Contacto (fase: emergencia + bucle) ---------- */

.contacto {
  text-align: center;
  justify-content: center;
}
.contacto .seccion__interior {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contacto h2 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  margin-bottom: 1.2rem;
}
.contacto h2 em {
  font-style: normal;
  color: var(--color-dorado);
}

.contacto__texto {
  color: var(--color-niebla);
  max-width: 44ch;
  margin: 0 auto 2.6rem;
}

.contacto__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
  align-items: center;
}

.enlace-web {
  font-family: var(--fuente-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-niebla);
  text-decoration: none;
  border-bottom: 1px solid var(--color-linea);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.enlace-web:hover {
  color: var(--color-texto);
  border-color: var(--color-niebla);
}

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

.pie {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 2.4rem;
  border-top: 1px solid var(--color-linea);
  font-family: var(--fuente-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--color-niebla-2);
}
.pie a { color: var(--color-niebla); text-decoration: none; }
.pie a:hover { color: var(--color-texto); }
.pie svg { width: 18px; height: 18px; color: var(--color-niebla-2); }

/* ---------- Móvil: sin blur pesado ---------- */

@media (max-width: 720px) {
  .panel, .ejes__grid, .cabecera.con-fondo { backdrop-filter: none; }
  .panel, .ejes__grid { background: rgba(4, 2, 9, 0.9); }
  .servicio { background: radial-gradient(120% 80% at 50% 0%, var(--serv-tinte), transparent 55%), rgba(4, 2, 9, 0.9); }
  .cabecera.con-fondo { background: rgba(2, 1, 4, 0.92); }
}

/* ---------- prefers-reduced-motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .revelar {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  #helice-svg .trazable {
    stroke-dashoffset: 0;
    transition: none;
  }
  #helice-svg .aparece {
    opacity: 1;
    transition: none;
  }
  #helice-svg.dibujar .halo,
  #helice-svg.dibujar .origen,
  #helice-svg.dibujar .flujo,
  #helice-svg.dibujar .eje-tiempo,
  .hito-tray.vivo::after { animation: none; }
  .hito-tray { opacity: 1; transition: none; }
  .hito-tray--tec:not(.vivo) span,
  .hito-tray--esp:not(.vivo) span { transform: translateX(-50%); }
  .hero__logo,
  .hero__indicador,
  .chip-fecha::before {
    animation: none;
  }
  /* Sin movimiento: el camino desaparece y los ejes se leen en lista */
  #capa-viaje { display: none; }
  .seccion--ejes { height: auto; }
  .seccion--ejes .seccion__interior > .texto-niebla { display: block; }
  .ejes__escena { position: static; min-height: 0; }
  #lector { min-height: 0; }
  #lector .paso {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    padding: 1.4rem 0;
    border-top: 1px solid var(--color-linea);
  }
  #lector .cuenta { display: none; }
}
