/* =========================================================================
   03 · El problema (.s-problema)
   Lámina 03 (fragmentación: nodos en círculos oscuros, líneas punteadas con
   «×», «middleware humano» al centro) que se transforma en la escena Hub del
   video (violeta con grano, nodos de vidrio, Puente en tarjeta clara, líneas
   continuas con pulsos). El JS pasa a la bandeja:
     --m  0 → 1  mezcla de fase (caos → trabajan juntos)
     --k  0 → 1  cambio del centro (persona → isotipo)
   y a cada nodo --b (entrada) y --ping (pulso que sale).
   Sin JS o con reduced-motion queda el estado final (--m: 1, --k: 1).
   ========================================================================= */

.s-problema {
  --s-lila: #c9bde6;
  --s-node-bg: #1f1d1d;
}

/* ---------- Grilla ---------- */
.s-problema .s-problema__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

/* ---------- Copy ---------- */
.s-problema .s-problema__copy { display: grid; justify-items: start; }
.s-problema .s-problema__copy .eyebrow { margin: 0; }
.s-problema .s-problema__title { margin-top: 20px; max-width: 14ch; }
.s-problema .s-problema__lead { margin-top: 22px; max-width: 46ch; color: var(--muted); }
.s-problema .s-problema__accent { color: var(--s-lila); }

.s-problema .s-problema__checks {
  list-style: none;
  margin: 34px 0 0;
  padding: 26px 0 0;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  max-width: 46ch;
}
.s-problema .s-problema__checks li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.6s var(--ease);
}
.s-problema .s-problema__check {
  width: 20px; height: 20px;
  margin-top: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--muted);
  transition: background 0.6s var(--ease), color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.s-problema .s-problema__check svg {
  width: 11px; height: 11px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Fase «trabajan juntos»: los checks se encienden */
.s-problema.is-b .s-problema__checks li { color: var(--ink-2); }
.s-problema.is-b .s-problema__check { background: #fff; color: #0e0d0c; box-shadow: 0 0 0 4px rgba(201, 189, 230, 0.16); }
.s-problema.is-b .s-problema__checks li:nth-child(2) .s-problema__check { transition-delay: 0.18s; }
.s-problema.is-b .s-problema__checks li:nth-child(2) { transition-delay: 0.18s; }

/* ---------- Bandeja ---------- */
.s-problema .s-problema__visual { min-width: 0; container: s-problema / inline-size; }
.s-problema .s-problema__tray {
  --m: 1;
  --k: 1;
  padding: clamp(12px, 2vw, 24px);
  background:
    radial-gradient(60% 55% at 50% 50%, rgba(107, 95, 184, 0.16), rgba(107, 95, 184, 0) 70%),
    var(--bg-2);
  max-width: 640px;
  margin-left: auto;
}
.s-problema .s-problema__violet {
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: none;
  opacity: var(--m);
  pointer-events: none;
  /* Fondo de la escena Hub del video (Hub.tsx · BG): índigo profundo #1d1a5c con
     manchas lila arriba, celeste a la derecha y azul abajo, más grano.
     Más profundo que .tray--violeta para que los rótulos blancos pasen AA. */
  background:
    var(--noise),
    radial-gradient(44% 34% at 10% 0%, rgba(196, 172, 236, 0.5), rgba(196, 172, 236, 0) 70%),
    radial-gradient(40% 30% at 52% 4%, rgba(159, 142, 195, 0.26), rgba(159, 142, 195, 0) 70%),
    radial-gradient(36% 34% at 96% 22%, rgba(179, 225, 239, 0.2), rgba(179, 225, 239, 0) 70%),
    radial-gradient(80% 70% at 20% 80%, rgba(54, 48, 144, 0.95), rgba(54, 48, 144, 0) 72%),
    radial-gradient(70% 60% at 82% 100%, rgba(29, 26, 92, 0.95), rgba(29, 26, 92, 0) 70%),
    linear-gradient(170deg, #3a3290 0%, #2a2478 55%, #1d1a5c 100%);
  background-size: 200px 200px, auto, auto, auto, auto, auto, auto;
  background-blend-mode: overlay, normal, normal, normal, normal, normal, normal;
}
.s-problema .s-problema__halo {
  position: absolute;
  left: 50%; top: 50%;
  width: 70%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 189, 230, 0.4), rgba(159, 142, 195, 0.12) 45%, rgba(159, 142, 195, 0) 70%);
  opacity: calc(var(--m) * 0.85);
  pointer-events: none;
}
.s-problema .s-problema__ex {
  position: absolute;
  top: clamp(10px, 1.6vw, 18px);
  left: clamp(10px, 1.6vw, 18px);
  margin: 0;
  z-index: 4;
  height: 22px;
  font-size: 10px;
  background: rgba(14, 13, 12, 0.5);
}

/* ---------- Hub ---------- */
.s-problema .s-problema__hub {
  --r: 36.5;          /* radio de la órbita, en % del ancho (el JS lo lee) */
  --node: clamp(40px, 12.4%, 74px);
  --tile: 21%;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.s-problema .s-problema__svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
}
.s-problema .s-problema__ga { opacity: calc((1 - var(--m)) * var(--intro, 1)); }
.s-problema .s-problema__gb { opacity: var(--m); }
.s-problema .s-problema__link { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; stroke-dasharray: 3 6; stroke-linecap: round; }
.s-problema .s-problema__spoke-a { stroke: rgba(255, 255, 255, 0.26); stroke-width: 1; stroke-dasharray: 2 5; stroke-linecap: round; }
.s-problema .s-problema__x { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.1; stroke-linecap: round; }
.s-problema .s-problema__ring-a { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; stroke-dasharray: 1.5 7; stroke-linecap: round; }
.s-problema .s-problema__ring-b { fill: none; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.1; }
.s-problema .s-problema__ring-out { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.2; stroke-dasharray: 1.5 9; stroke-linecap: round; }
.s-problema .s-problema__spoke-b { stroke: rgba(255, 255, 255, 0.38); stroke-width: 1.1; stroke-linecap: round; }
.s-problema .s-problema__trail { stroke: rgba(201, 189, 230, 0.6); stroke-width: 2; stroke-linecap: round; }
.s-problema .s-problema__pglow { fill: rgba(214, 204, 245, 0.95); }
.s-problema .s-problema__phead { fill: #fff; }

/* Nodos */
.s-problema .s-problema__nodes { list-style: none; margin: 0; padding: 0; }
.s-problema .s-problema__node {
  --b: 1;
  --ping: 0;
  position: absolute;
  left: calc(50% + var(--ux) * var(--r) * 1%);
  top: calc(50% + var(--uy) * var(--r) * 1%);
  width: var(--node);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(calc(0.62 + 0.38 * var(--b)));
  opacity: var(--b);
  z-index: 2;
}
.s-problema .s-problema__dot {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: rgba(31, 29, 29, calc(0.97 - 0.82 * var(--m)));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 14px 30px -14px rgba(0, 0, 0, calc(0.7 - 0.4 * var(--m)));
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
/* Capa de vidrio de la escena del video (aparece con --m) */
.s-problema .s-problema__dot::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, calc(0.36 + 0.3 * var(--ping))),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  opacity: var(--m);
}
/* Brillo cuando sale un pulso */
.s-problema .s-problema__dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 22px 2px rgba(201, 189, 230, 0.7);
  opacity: calc(var(--ping) * var(--m));
}
.s-problema .s-problema__dot svg {
  position: relative; z-index: 1;
  width: 42%; height: 42%;
  fill: none; stroke: #fff; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.s-problema .s-problema__name {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(20, 18, 60, 0.6);
}
.s-problema .s-problema__node--up .s-problema__name { top: auto; bottom: calc(100% + 8px); }

/* Centro: persona (fase A) y Puente en tarjeta clara (fase B) */
.s-problema .s-problema__tile,
.s-problema .s-problema__ripple {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--tile);
  aspect-ratio: 1;
  border-radius: 24%;
}
.s-problema .s-problema__tile {
  display: grid; place-items: center;
  z-index: 3;
}
.s-problema .s-problema__tile--human {
  background: #0f0e0e;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 calc(var(--tilering, 0) * 1px) rgba(201, 189, 230, 0.06),
    0 30px 60px -24px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(159, 142, 195, 0.18);
  opacity: calc(1 - var(--k));
  transform: translate(-50%, -50%) scale(calc((1 - 0.16 * var(--k)) * var(--tb, 1)));
  filter: blur(calc(var(--k) * 6px));
}
.s-problema .s-problema__tile--human svg {
  width: 38%; height: 38%;
  fill: none; stroke: #fff; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.s-problema .s-problema__tile--puente {
  --glow: 0;
  border-radius: 24%;
  background: #f4f2fa;
  box-shadow:
    0 30px 70px -20px rgba(8, 6, 36, 0.6),
    0 0 calc(30px + 50px * var(--glow)) rgba(201, 189, 230, calc(0.3 + 0.5 * var(--glow)));
  opacity: var(--k);
  transform: translate(-50%, -50%) scale(calc((0.84 + 0.16 * var(--k)) * (1 + 0.02 * var(--glow))));
  filter: blur(calc((1 - var(--k)) * 6px));
}
.s-problema .s-problema__tile--puente img { width: 44%; height: auto; }
.s-problema .s-problema__ripple {
  --ro: 0;
  --rs: 1;
  z-index: 2;
  box-shadow: inset 0 0 0 1.5px rgba(214, 204, 245, 0.95);
  opacity: var(--ro);
  transform: translate(-50%, -50%) scale(var(--rs));
}

/* Rótulo bajo el centro */
.s-problema .s-problema__badge {
  position: absolute;
  left: 50%;
  top: calc(50% + 10.5% - 4px);
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  display: grid;
  justify-items: center;
}
.s-problema .s-problema__badge > span {
  grid-area: 1 / 1;
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.s-problema .s-problema__badge-a {
  background: rgba(14, 13, 12, 0.92);
  color: var(--s-lila);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: calc(1 - var(--m));
}
.s-problema .s-problema__badge-b {
  background: rgba(20, 17, 52, 0.78);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: var(--m);
  transform: translateY(calc((1 - var(--m)) * 4px));
}
.s-problema .s-problema__live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.2);
}

/* ---------- Mini avisos ---------- */
.s-problema .s-problema__toasts { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.s-problema .s-problema__toast {
  --t: 0;
  position: absolute;
  margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: rgba(24, 22, 34, 0.9);
  opacity: var(--t);
  transform: translateY(calc((1 - var(--t)) * 8px)) scale(calc(0.96 + 0.04 * var(--t)));
}
.s-problema .s-problema__alert {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--s-lila);
  box-shadow: 0 0 0 3px rgba(201, 189, 230, 0.2);
  flex: none;
}
/* Rótulo de la franja (solo mobile) */
.s-problema .s-problema__bandlabel { display: none; }

/* Repartidos por los huecos del hub (en % de la bandeja) */
.s-problema .s-problema__toast--1 { left: 24%; top: 26.5%; }
.s-problema .s-problema__toast--2 { right: 3%; top: 45.5%; }
.s-problema .s-problema__toast--3 { left: 3%; top: 49.5%; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .s-problema .s-problema__name { font-size: 10px; }
  .s-problema .s-problema__toast { font-size: 10.5px; height: 28px; }
}
@media (max-width: 860px) {
  .s-problema .s-problema__grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .s-problema .s-problema__title { max-width: 18ch; }
  .s-problema .s-problema__tray { margin: 0 auto; }
}
@media (max-width: 600px) {
  .s-problema .s-problema__checks li { font-size: 12.5px; }
}
/* Bandeja angosta (mobile y 1024): los avisos pasan a una franja bajo el hub para no tapar los nodos */
@container s-problema (max-width: 560px) {
  .s-problema .s-problema__hub { --r: 35.5; --node: clamp(38px, 12.6%, 60px); }
  .s-problema .s-problema__name { font-size: 9.5px; letter-spacing: 0.04em; }
  .s-problema .s-problema__node--up .s-problema__name { bottom: calc(100% + 6px); }
  .s-problema .s-problema__name { top: calc(100% + 6px); }
  .s-problema .s-problema__badge > span { font-size: 9.5px; letter-spacing: 0.1em; height: 22px; padding: 0 8px; }
  .s-problema .s-problema__toasts { position: relative; inset: auto; height: 104px; margin-top: 4px; }
  .s-problema .s-problema__toast { font-size: 10.5px; height: 28px; }
  .s-problema .s-problema__toast--1 { left: 2%; top: 0; }
  .s-problema .s-problema__toast--2 { right: 2%; left: auto; top: 36px; }
  .s-problema .s-problema__toast--3 { left: 2%; top: 72px; }
  /* «Ahora trabajan juntos» no cabe entre los nodos: baja a la franja */
  .s-problema .s-problema__badge-b { visibility: hidden; }
  .s-problema .s-problema__bandlabel {
    display: inline-flex; align-items: center; gap: 8px;
    position: absolute; left: 50%; top: 50%;
    margin: 0;
    height: 32px; padding: 0 14px;
    border-radius: var(--r-pill);
    background: rgba(20, 17, 52, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
    font-family: var(--font-mono);
    font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: #fff; white-space: nowrap;
    opacity: var(--m);
    transform: translate(-50%, calc(-50% + (1 - var(--m)) * 6px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .s-problema .s-problema__checks li,
  .s-problema .s-problema__check { transition: none; }
}
