/* Colores tomados de los tokens de featured-projects/assets/styles.css */
:root { --k: #000; --w1: #e6e6e6; --w2: #c4c4c4; --g1: #8a8a8a; --g2: #2e2e2e; --o: #ff4d00; --nav-h: 2.5rem; }

* { box-sizing: border-box; }
html { background: var(--k); color: var(--w1); font-family: Geist, system-ui, sans-serif; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--o); color: #000; }
.label { font: 500 11px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .06em; color: var(--g1); margin: 0; }

.nav { position: fixed; inset: 0 0 auto; height: var(--nav-h); z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1rem; background: rgb(0 0 0 / .65); border-bottom: 1px solid var(--g2); font-size: 13px; }
.logo { font-weight: 600; }
.variants { display: flex; gap: 1.25rem; overflow-x: auto; white-space: nowrap; font: 500 11px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--w2); }
.variants a:hover, .variants a:focus-visible { color: #fff; }
.variants a[aria-current] { color: var(--o); }
.variants .lang { color: var(--g1); }

.stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#c.over { cursor: pointer; }
#hud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; } /* marcadores de coordenadas */
.hint { position: absolute; top: calc(var(--nav-h) + 1.25rem); left: 1rem; color: var(--o); transition: opacity .3s; }
.caption { position: absolute; left: 1rem; bottom: 1.25rem; max-width: 52ch; margin: 0; font-size: 13px; line-height: 1.45; color: var(--w2); transition: opacity .3s; }
.caption b { display: block; margin-bottom: .35rem; font: 500 11px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .06em; color: var(--o); }

/* Los 3 pasos: JS los coloca junto a su marcador. Borde naranja como los selectores del robot */
.parts { position: absolute; inset: 0; pointer-events: none; transition: opacity .3s; }
.part { position: absolute; top: 0; left: 0; pointer-events: auto; cursor: pointer; white-space: nowrap; text-align: left;
  font: 500 12px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase;
  color: var(--w1); background: rgb(0 0 0 / .6); border: 1px solid var(--o); padding: .6rem .75rem; transition: background-color .2s, color .2s; }
.part .n { color: var(--g1); margin-right: .2rem; transition: color .2s; }
/* al cargar, los botones se encienden en su sitio con un parpadeo de tubo, uno tras otro (solo opacidad) */
.parts.off .part { opacity: 0; visibility: hidden; } /* apagados desde el HTML hasta que llega la nube: ni se ven ni se pueden usar */
.parts.lit .part { animation: part-on .7s both; }
.parts.lit .part:nth-child(2) { animation-delay: .15s; }
.parts.lit .part:nth-child(3) { animation-delay: .3s; }
@keyframes part-on { 0% { opacity: 0; } 15% { opacity: .9; } 25% { opacity: .15; } 45% { opacity: 1; } 55% { opacity: .4; } 70%, 100% { opacity: 1; } }
.part:hover, .part.is-on, .part:focus-visible { color: #fff; background-color: rgb(255 77 0 / .16); }
.part:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.part:hover .n, .part.is-on .n, .part:focus-visible .n { color: var(--o); }
/* Pantalla estrecha: apilados abajo, sin líneas hasta el marcador */
.parts.stack { inset: auto 1rem 1rem; display: grid; gap: .5rem; pointer-events: auto; }
.parts.stack .part { position: static; transform: none !important; padding: .85rem; }
.stack ~ .caption { display: none; }
/* visibility solo se anima al ocultar: al cerrar el paso, los botones son visibles al instante y el suyo recibe el foco */
.focused .parts, .focused .hint, .focused .caption { opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }

/* Panel del paso, como una ventana: a la izquierda (abajo en móvil); a la derecha, el recorrido o la pieza con zoom */
.panel { position: fixed; z-index: 20; left: 1rem; bottom: 1.5rem; width: min(30rem, calc(100% - 2rem)); max-height: calc(100svh - 3rem); display: flex; flex-direction: column;
  background: rgb(0 0 0 / .86); box-shadow: inset 0 0 0 1px var(--g2); }
.panel:not(.on) { opacity: 0; }
.panel.on { animation: crt-on .35s cubic-bezier(.2, .7, .2, 1); } /* se enciende como un CRT */
@keyframes crt-on { 0% { opacity: 0; transform: scaleY(.01); } 40% { opacity: 1; transform: scaleY(.01); } 100% { transform: none; } }
.panel[hidden] { display: none; }
.panel .label { color: var(--o); }
.panel-bar { display: flex; align-items: center; height: 2.25rem; border-bottom: 1px solid var(--g2); }
.panel-bar .label { padding: 0 1rem; }
#panel-tag { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel .panel-st { display: flex; align-items: center; gap: .5rem; color: var(--w2); }
.panel-st::before { content: ""; width: 6px; height: 6px; background: var(--o); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.x { align-self: stretch; width: 2.75rem; display: grid; place-items: center; background: none; border: 0; box-shadow: inset 1px 0 0 var(--g2);
  color: var(--g1); font: 500 12px/1 "Geist Mono", ui-monospace, monospace; cursor: pointer; transition: background-color .2s, color .2s; }
.x:hover, .x:focus-visible { background: var(--o); color: #000; outline: none; }
.panel-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem 1.5rem 1.5rem; min-height: 0; overflow-y: auto; overscroll-behavior: contain; } /* en pantallas bajas, la barra con el ✕ sigue a la vista y el texto se desplaza */
.how { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--g2); }
.how li { display: grid; grid-template-columns: 2.25rem 6.5rem 1fr; gap: .5rem; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid var(--g2); font-size: 13px; line-height: 1.45; color: var(--w2); }
.how .n, .how .k { font: 500 11px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .06em; transition: color .2s; }
.how .n { color: var(--g1); }
.how .k { color: #fff; }
.how li.on .n, .how li.on .k { color: var(--o); }
.panel .srcs { font-size: 10.5px; line-height: 1.7; letter-spacing: .04em; text-transform: uppercase; color: var(--g1); }
.srcs b { font-weight: 500; color: var(--w2); }
.how:empty, .chips:empty, .srcs:empty { display: none; }
/* Entrada en vivo (paso 01): eventos de demo con la hora real */
.live { display: flex; flex-direction: column; gap: .5rem; }
.live[hidden] { display: none; }
.live-h { display: flex; justify-content: space-between; margin: 0; }
.panel .live-h .label + .label { color: var(--g1); }
.log { height: 8.6rem; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: .75rem .85rem;
  font: 400 11.5px/1.65 "Geist Mono", ui-monospace, monospace; color: var(--w2); box-shadow: inset 0 0 0 1px var(--g2); background: rgb(255 255 255 / .02); }
.log div { flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* flex: none: si no, con overflow las filas se encogen y se pisan */
.log .ts { color: var(--g1); }
.log .src { display: inline-block; width: 7ch; margin: 0 1ch 0 2ch; color: #fff; }
.log .ok { margin-left: 2ch; color: var(--o); }
.log .cur::after { content: ""; display: inline-block; width: .6em; height: 1.05em; vertical-align: -.2em; background: var(--o); animation: blink 1s steps(1) infinite; }
.panel h2 { margin: 0; font-size: 2.25rem; font-weight: 700; line-height: .95; letter-spacing: -.035em; text-transform: uppercase; }
.panel p:not(.label) { margin: 0; color: var(--w2); line-height: 1.5; }
.panel #panel-text { margin-top: -.5rem; font-size: 15px; }
/* cruces naranjas en las esquinas, como los bloques de la web */
.panel::before, .panel::after { content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none;
  background: linear-gradient(var(--o), var(--o)) center / 100% 1px no-repeat, linear-gradient(var(--o), var(--o)) center / 1px 100% no-repeat; }
.panel::before { top: -5px; left: -5px; }
.panel::after { bottom: -5px; right: -5px; }
.chips { display: flex; flex-wrap: wrap; gap: .375rem; list-style: none; margin: 0; padding: 0; }
.chips li { font: 500 11px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--w2); box-shadow: inset 0 0 0 1px var(--g2); padding: .45rem .55rem; }
.panel-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.panel-nav button { font: 500 12px/1 "Geist Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .04em;
  color: var(--w1); background: none; border: 1px solid var(--g2); padding: .7rem 1rem; cursor: pointer; transition: background-color .2s, border-color .2s; }
.panel-nav button:hover:not(:disabled) { background-color: rgb(255 77 0 / .16); border-color: var(--o); }
.panel-nav button:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.panel-nav button:disabled { opacity: .35; cursor: default; }
@media (max-width: 767px) { .panel { bottom: 1rem; } .panel-body { padding: 1.25rem; gap: .75rem; } }
/* Con el recorrido, la ventana se queda en un título con sus controles, encima del gráfico */
.panel.compacto { flex-direction: row; align-items: center; gap: .5rem; background: none; box-shadow: none; animation: none; }
.panel.compacto::before, .panel.compacto::after { display: none; }
.panel.compacto .panel-bar, .panel.compacto .panel-body { display: contents; }
.panel.compacto #panel-tag, .panel.compacto .panel-st, .panel.compacto .panel-body > :not(h2, .panel-nav) { display: none; }
.panel.compacto h2 { flex: 1; }
.panel.compacto .panel-nav { order: 1; margin: 0; }
.panel.compacto .x { order: 2; align-self: stretch; box-shadow: inset 0 0 0 1px var(--g2); }

/* Gráfico del paso (ruta.js en el 01 y el 03, agentes.js en el 02; piezas en trazo.js), debajo del título en lugar de la pieza. Estilo n8n.
   JS lo escala entero */
#c, #hud { transition: opacity .4s; }
.con-ruta #c, .con-ruta #hud { opacity: 0; }
.ruta { position: fixed; z-index: 15; pointer-events: none; font-family: "Geist Mono", ui-monospace, monospace; }
.ruta[hidden] { display: none; }
.ruta.on { animation: crt-on .4s cubic-bezier(.2, .7, .2, 1); }
.ruta-in { position: absolute; left: 0; top: 0; height: 560px; transform-origin: 0 0; }
/* sin fondo, grid ni capa CRT propios: se funde con la página, cuya capa CRT ya pasa por encima. Sube 26 px: las cajas de arriba empiezan en 35 */
.ruta-cv { position: absolute; left: 0; top: -26px; height: 590px; overflow: hidden; animation: ruta-fk 5s infinite; }
@keyframes ruta-fk { 0%, 47%, 49%, 73%, 75%, 100% { opacity: 1; } 48% { opacity: .84; } 74% { opacity: .93; } }
.ruta svg { position: absolute; left: 0; top: 0; }
/* conexiones al estilo n8n: continuas con un punteado que corre, discontinuas hacia agentes y herramientas; el rastro
   (.lit) marca por dónde va el caso */
.ruta .ed { fill: none; stroke: #2c2c2c; stroke-width: 2; }
.ruta .dd { fill: none; stroke: #3a3a3a; stroke-width: 1.5; stroke-dasharray: 5 5; }
.ruta .fl { fill: none; stroke: var(--w1); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 0 10; opacity: .35; animation: ruta-fl .5s linear infinite; }
@keyframes ruta-fl { to { stroke-dashoffset: -10; } }
.ruta .lit { fill: none; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.ruta .trk { fill: none; stroke: none; }
.ruta .pt { fill: #4a4a4a; }
/* nodos: el que trabaja respira el borde; hecho, borde naranja con su check; con aviso, su ! */
.ruta .bg { fill: #0a0a0a; stroke: #2a2a2a; stroke-width: 1.5; transition: stroke .2s; }
.ruta .run > .bg { animation: ruta-rb 1s ease-in-out infinite; }
@keyframes ruta-rb { 50% { stroke: var(--o); } }
.ruta .hl > .bg, .ruta .warn > .bg { stroke: var(--o); }
.ruta .ck, .ruta .wn { fill: none; stroke: var(--o); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .3s; }
.ruta .hl > .ck, .ruta .warn > .wn { opacity: 1; }
.ruta .bp { fill: none; stroke: var(--o); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ruta-bp .8s ease-out forwards; filter: url(#rglow); }
@keyframes ruta-bp { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.3); } }
.ruta .gr { fill: none; stroke: #3a3a3a; stroke-width: 1.5; stroke-dasharray: 14 6; }
.ruta .hl .gr, .ruta .run .gr { stroke: var(--o); }
.ruta .pins { fill: none; stroke: #3a3a3a; transition: stroke .2s; }
.ruta .hl > .pins, .ruta .run > .pins { stroke: var(--o); }
.ruta .rule { fill: none; stroke: #1d1d1d; }
.ruta .ico { fill: none; stroke: #bdbdbd; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.ruta .ico.on, .ruta .ico.oo { stroke: #fff; }
.ruta .ptr { fill: #fff; opacity: 0; filter: url(#rglow); transition: opacity .2s; }
/* textos encima del dibujo, en sus coordenadas */
.ruta .ov { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: 11px; line-height: 1; letter-spacing: .06em; color: var(--g1); transition: color .2s, text-shadow .2s, opacity .4s; }
.ruta .ov.l { transform: translateY(-50%); }
.ruta .ov.r { transform: translate(-100%, -50%); }
.ruta .ov.on { color: #fff; text-shadow: 0 0 10px rgb(255 255 255 / .85); }
.ruta .ov.lb { font-size: 12px; letter-spacing: .08em; color: var(--w1); }
.ruta .ov.lb b { font-weight: 500; color: var(--o); text-shadow: 0 0 8px var(--o); }
.ruta .ov.id { color: #555; }
.ruta .ov.row { font-size: 12px; text-transform: uppercase; color: var(--w1); }
.ruta .ov.row.res { color: var(--o); text-shadow: 0 0 8px var(--o); } /* el resultado */
.ruta .ov.sta { color: #4d4d4d; }
.ruta .ov.sta.run { color: var(--o); text-shadow: 0 0 8px var(--o); animation: blink .25s steps(1) infinite; }
.ruta .ov.sta.ok { color: #fff; text-shadow: 0 0 6px rgb(255 255 255 / .7); }
.ruta .dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px; background: var(--o); box-shadow: 0 0 8px var(--o); animation: blink 1s steps(1) infinite; }
/* el paquete que viaja: una caja negra con borde fino */
.ruta .pk { position: absolute; z-index: 3; transform: translate(-50%, -50%); padding: 4px 7px; font-size: 10px; line-height: 1; font-weight: 500; letter-spacing: .06em;
  color: #fff; background: #000; border: 1px solid #fff; opacity: 0; transition: opacity .2s; }
.ruta .pk.or { color: var(--o); border-color: var(--o); }
.ruta .pt.on { fill: var(--o); }
/* panel de aplicaciones (panel.js, paso 03): ventana con barra lateral de módulos, vista del módulo y pie de sincronía */
.ruta .ov.pn { transform: none; display: grid; grid-template-rows: 40px 1fr 30px; white-space: normal; line-height: 1.3; color: var(--w2);
  border: 1.5px solid #2a2a2a; border-radius: 8px; background: #050505; overflow: hidden; }
.pn-bar, .pn-foot { display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 11px; letter-spacing: .06em; color: var(--g1); white-space: nowrap; }
.pn-bar { border-bottom: 1px solid #1e1e1e; justify-content: space-between; }
.pn-bar .lb { color: var(--w1); }
.pn-bar .lb b { font-weight: 500; color: var(--o); }
.pn-foot { border-top: 1px solid #1e1e1e; font-size: 10px; }
.pn-foot .sp { flex: 1; }
.pn-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; }
.pn-side { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid #1e1e1e; font-size: 12px; }
.pn-ws { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px; border: 1px solid #1e1e1e; border-radius: 6px; color: var(--w1); }
.pn-ws i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--o); color: #000; font-style: normal; font-weight: 500; }
.pn-ws small { display: block; font-size: 10px; color: var(--g1); }
.pn-search { margin-bottom: 8px; padding: 7px 9px; border: 1px solid #1e1e1e; border-radius: 6px; font-size: 11px; color: #555; }
.pn-grp { margin: 9px 8px 3px; font-size: 10px; letter-spacing: .08em; color: #555; }
.pn-it { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; transition: background-color .25s, color .25s; }
.pn-it svg { position: static; flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pn-it.on { background: rgb(255 77 0 / .1); color: #fff; }
.pn-it.on::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 2px; background: var(--o); }
.pn-it .n { margin-left: auto; font-size: 10px; color: var(--o); opacity: 0; transition: opacity .3s; }
.pn-it .n.on { opacity: 1; }
.pn-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 18px 22px; overflow: hidden; }
.pn-mh { display: flex; align-items: center; justify-content: space-between; gap: 12px; white-space: nowrap; }
.pn-mh h3 { margin: 0; font: 500 20px/1 Geist, system-ui, sans-serif; letter-spacing: -.01em; color: #fff; }
.pn-mh h3 span { color: var(--g1); }
.pn-tabs { display: flex; gap: 18px; font-size: 11px; letter-spacing: .06em; color: var(--g1); }
.pn-tabs .on { color: #fff; box-shadow: 0 9px 0 -7px var(--o); }
.pn-view { animation: pn-in .35s ease-out; }
.pn-view table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pn-view th { padding: 0 10px 8px; border-bottom: 1px solid #1e1e1e; font-weight: 400; font-size: 10px; letter-spacing: .08em; text-align: left; color: #555; }
.pn-view td { padding: 11px 10px; border-bottom: 1px solid #141414; white-space: nowrap; }
.pn-view tr.nuevo td { color: #fff; background: rgb(255 77 0 / .08); animation: pn-in .5s ease-out; }
.pn-view tr.nuevo td:first-child { box-shadow: inset 2px 0 0 var(--o); }
.pn-view .via { margin-left: 8px; font-size: 10px; color: var(--o); }
.pn-view .tag { display: inline-block; padding: 3px 6px; border: 1px solid #333; border-radius: 4px; font-size: 10px; letter-spacing: .04em; color: var(--g1); }
.pn-view .tag.o { border-color: var(--o); color: var(--o); }
.pn-view .tag.w { border-color: #555; color: #fff; }
.pn-view .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.pn-view .kpi { padding: 14px; border: 1px solid #1e1e1e; border-radius: 6px; }
.pn-view .kpi small { display: block; margin-bottom: 10px; font-size: 10px; letter-spacing: .08em; color: var(--g1); }
.pn-view .kpi b { font: 500 26px/1 Geist, system-ui, sans-serif; color: #fff; }
.pn-view .kpi.up b { color: var(--o); }
.pn-view .feed { font-size: 11px; line-height: 24px; color: var(--g1); }
.pn-view .feed b { font-weight: 500; color: var(--o); }
.pn-view .kan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pn-view .col { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #1e1e1e; border-radius: 6px; }
.pn-view .col h4 { display: flex; justify-content: space-between; margin: 0 0 4px; font-weight: 400; font-size: 10px; letter-spacing: .08em; color: var(--g1); }
.pn-view .card { padding: 10px; border: 1px solid #222; border-radius: 6px; font-size: 12px; }
.pn-view .card small { display: block; margin-top: 6px; font-size: 10px; color: var(--g1); }
.pn-view .card.nuevo { border-color: var(--o); color: #fff; animation: pn-in .5s ease-out; }
@keyframes pn-in { from { opacity: 0; transform: translateY(-8px); } }
.pn-c .pn-body { grid-template-columns: 160px minmax(0, 1fr); }
.pn-c .pn-tabs span:not(.on), .pn-c .pn-search, .pn-c .pn-ws small, .pn-c .pn-view :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(4)) { display: none; }
.pn-c .pn-it { padding: 5px 8px; }
.ruta .ov.btn { padding: 5px 9px; border: 1px solid var(--o); color: var(--o); text-shadow: 0 0 8px var(--o); box-shadow: 0 0 12px rgb(255 77 0 / .55); opacity: 0; transition: opacity .2s, background-color .15s, color .15s; }
.ruta .ov.btn.show { opacity: 1; }
.ruta .ov.btn.press { background: var(--o); color: #000; text-shadow: none; box-shadow: 0 0 20px var(--o); }

/* ?embed: solo el gráfico, sin la página alrededor y con fondo transparente (lo pinta la home) */
.embed .nav, .embed .caption { display: none; }
.embed:not(.static) .hint { display: none; } /* la pista la pone la página en su cuadro */
html.embed { background: none; color-scheme: dark; }

/* Sin WebGL o con ?static: solo los 3 botones, centrados */
.static .stage { position: static; height: auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 6rem 1rem; }
.static #c, .static #hud, .static .caption { display: none; }
.static .hint { position: static; margin-bottom: 1.5rem; }
.static .parts { position: static; max-width: 28rem; display: grid; gap: .5rem; }
.static .part { position: static; font-size: 14px; padding: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .parts, .hint, .caption, .focused .parts, .focused .hint, .focused .caption, #c, #hud { transition: none; } .parts.lit .part { animation: none; }
  .ruta, .ruta *, .ruta *::after, .panel, .panel-st::before, .log .cur::after { animation: none !important; }
}
