/* ===========================================================================
   STARK-HOLO 2050 · holo2050.css
   Lenguaje visual de los módulos 2050 (portada TITÁN, ÓRBITA, PULSO SÍSMICO,
   CLIMA ESPACIAL, OJOS DEL MUNDO, HOLO-AR). Base oscura Axiona #0a0e14 y neón
   #00f0c0, vidrio esmerilado, bordes generosos y datos en monoespaciada.
   Las pantallas del prisma siguen con core.css: allí lo oscuro es aire.
   =========================================================================== */

@font-face { font-family: 'Sora'; src: url(../fonts/Sora.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sora'; src: url(../fonts/Sora-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; src: url(../fonts/Inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url(../fonts/Inter-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; src: url(../fonts/JetBrainsMono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

/* Navegación entre páginas como si fuera una sola app (Chrome 126+, Safari 18.2+). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 260ms cubic-bezier(.4, 0, .2, 1) both stk-sale; }
::view-transition-new(root) { animation: 420ms cubic-bezier(.2, .8, .2, 1) both stk-entra; }
@keyframes stk-sale { to { opacity: 0; filter: blur(6px) brightness(1.6); transform: scale(1.03); } }
@keyframes stk-entra { from { opacity: 0; filter: blur(8px); transform: scale(.985); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

:root {
  color-scheme: dark;
  --fondo: #0a0e14;
  --abismo: #04070b;
  --neon: #00f0c0;
  --cian: #3fd0ff;
  --magenta: #ff3fd8;
  --ambar: #ffb547;
  --rojo: #ff4d6a;
  --violeta: #9b7bff;
  --tinta: #e8f6f3;
  --tinta-2: #9db3b0;
  --tinta-3: #5d7472;
  --vidrio: rgba(12, 18, 26, 0.58);
  --vidrio-2: rgba(16, 24, 34, 0.78);
  --borde: rgba(0, 240, 192, 0.18);
  --borde-2: rgba(0, 240, 192, 0.42);
  --brillo: 0 0 18px rgba(0, 240, 192, 0.35);
  --sombra: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --r: 22px;
  --r-sm: 14px;
  --titular: 'Sora', 'Inter', system-ui, sans-serif;
  --texto: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --barra-alto: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 800px at 70% -10%, rgba(0, 240, 192, 0.07), transparent 60%),
              radial-gradient(900px 700px at -10% 110%, rgba(63, 208, 255, 0.06), transparent 60%),
              var(--abismo);
  color: var(--tinta);
  font: 14px/1.55 var(--texto);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;
}
body.desplaza { overflow-y: auto; overflow-x: hidden; }
::selection { background: var(--neon); color: #00140f; }
a { color: var(--neon); }
button { font: inherit; }

/* ── lienzo 3D a pantalla completa ── */
.lienzo { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; }
.lienzo.arrastra { cursor: grab; }
.lienzo.arrastra:active { cursor: grabbing; }

/* ── paneles de vidrio ── */
.panel {
  background: var(--vidrio);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--borde);
  border-radius: var(--r);
  box-shadow: var(--sombra);
}
.panel.fino { border-radius: var(--r-sm); }

.etiqueta { font: 600 10px/1.2 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--neon); }
.etiqueta.tenue { color: var(--tinta-3); }
.dato { font: 700 28px/1.05 var(--titular); letter-spacing: -0.01em; color: #fff; font-variant-numeric: tabular-nums; }
.dato small { font: 500 12px var(--mono); color: var(--tinta-2); letter-spacing: 0.06em; margin-left: 4px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tenue { color: var(--tinta-2); }
.neon { color: var(--neon); }

/* ── botones ── */
.boton {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px; border: 1px solid var(--borde-2);
  font: 600 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--neon);
  background: rgba(0, 240, 192, 0.07); transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.boton:hover, .boton:focus-visible { background: rgba(0, 240, 192, 0.16); color: #fff; box-shadow: var(--brillo); }
.boton:active { transform: scale(0.97); }
.boton.lleno { background: linear-gradient(120deg, var(--neon), #6ff7ff); color: #00140f; border-color: transparent; box-shadow: 0 0 26px rgba(0, 240, 192, 0.45); }
.boton.lleno:hover { filter: brightness(1.1); color: #00140f; }
.boton.activo { background: rgba(0, 240, 192, 0.22); color: #fff; border-color: var(--neon); }
.boton.alerta { color: var(--ambar); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.08); }
.boton[disabled] { opacity: 0.35; pointer-events: none; }
.boton svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--borde);
  font: 600 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--tinta-2); background: rgba(4, 7, 11, 0.5); }
.chip .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--tinta-3); }
.chip.vivo { color: var(--neon); border-color: rgba(0, 240, 192, 0.4); }
.chip.vivo .punto { background: var(--neon); box-shadow: 0 0 10px var(--neon); animation: stk-latido 1.6s ease-in-out infinite; }
.chip.viejo { color: var(--ambar); border-color: rgba(255, 181, 71, 0.4); }
.chip.viejo .punto { background: var(--ambar); }
.chip.caido { color: var(--rojo); border-color: rgba(255, 77, 106, 0.4); }
.chip.caido .punto { background: var(--rojo); }
@keyframes stk-latido { 50% { opacity: 0.35; transform: scale(0.75); } }

/* ── listas de datos ── */
.lista { display: grid; gap: 2px; }
.fila { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer;
  transition: background 0.15s; }
.fila:hover, .fila.sel { background: rgba(0, 240, 192, 0.08); }
.fila .titulo { font-size: 12.5px; color: var(--tinta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .sub { font: 500 10.5px var(--mono); color: var(--tinta-3); letter-spacing: 0.04em; }

/* ── carga / arranque ── */
.arranque { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--abismo); transition: opacity 0.8s, visibility 0.8s; }
.arranque.fuera { opacity: 0; visibility: hidden; }
.arranque .anillo { width: 120px; height: 120px; border-radius: 50%; border: 1px solid rgba(0, 240, 192, 0.15); border-top-color: var(--neon);
  box-shadow: 0 0 40px rgba(0, 240, 192, 0.15) inset; animation: stk-giro 1.1s linear infinite; }
.arranque .texto { margin-top: 18px; text-align: center; font: 600 10px var(--mono); letter-spacing: 0.32em; color: var(--neon); }
@keyframes stk-giro { to { transform: rotate(1turn); } }

/* ── aviso flotante ── */
.stk-avisos { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9000;
  display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(560px, calc(100vw - 32px)); }
.stk-aviso { pointer-events: auto; padding: 11px 16px; border-radius: 14px; font: 500 12.5px/1.45 var(--texto); color: var(--tinta);
  background: rgba(8, 14, 20, 0.92); border: 1px solid var(--borde-2); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px); animation: stk-aviso 0.35s cubic-bezier(.2, .9, .3, 1.2) both; }
.stk-aviso.alerta { border-color: rgba(255, 181, 71, 0.6); }
.stk-aviso.error { border-color: rgba(255, 77, 106, 0.6); }
@keyframes stk-aviso { from { opacity: 0; transform: translateY(12px) scale(0.96); } }

/* ── hoja modal ── */
.hoja-fondo { position: fixed; inset: 0; z-index: 8000; background: rgba(2, 4, 7, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.hoja { width: min(520px, 100%); max-height: min(86vh, 760px); overflow: auto; padding: 22px; }
.hoja h3 { margin: 0 0 6px; font: 700 18px var(--titular); }
.hoja p { color: var(--tinta-2); margin: 0 0 12px; }

/* ── utilidades ── */
.oculto { display: none !important; }
.fila-botones { display: flex; flex-wrap: wrap; gap: 8px; }
.separador { height: 1px; background: linear-gradient(90deg, transparent, var(--borde), transparent); margin: 12px 0; }
.scroll-fino { scrollbar-width: thin; scrollbar-color: rgba(0, 240, 192, 0.3) transparent; }
.scroll-fino::-webkit-scrollbar { width: 6px; }
.scroll-fino::-webkit-scrollbar-thumb { background: rgba(0, 240, 192, 0.3); border-radius: 3px; }

/* Rejilla de puntos y viñeta: profundidad sin coste de GPU. */
.ambiente::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }

@media (max-width: 720px) {
  body { font-size: 13px; }
  .dato { font-size: 22px; }
}

/* ── paneles de módulo: lateral en escritorio, hoja inferior plegable en celular ── */
.lateral { position: fixed; z-index: 10; top: calc(var(--barra-alto) + 8px + env(safe-area-inset-top)); left: 14px;
  width: min(370px, calc(100vw - 28px)); max-height: calc(100dvh - var(--barra-alto) - 26px - env(safe-area-inset-top));
  overflow: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.lateral .asa { display: none; width: 46px; height: 5px; border-radius: 3px; background: var(--borde-2); margin: -4px auto 0; cursor: pointer; border: 0; padding: 0; }
.bloque { display: grid; gap: 8px; }
.bloque + .bloque { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.cifra { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tarjeta-info { position: fixed; right: 14px; top: calc(var(--barra-alto) + 8px + env(safe-area-inset-top)); z-index: 11;
  width: min(330px, calc(100vw - 28px)); padding: 16px; display: grid; gap: 10px; }
.tarjeta-info .cerrar { position: absolute; right: 10px; top: 10px; }
.rejilla-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.rejilla-datos div { display: grid; gap: 2px; }
.rejilla-datos b { font: 700 15px var(--titular); color: #fff; font-variant-numeric: tabular-nums; }
.etiqueta3d { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; transform: translate(-50%, -130%);
  font: 700 10px/1 var(--mono); letter-spacing: 0.14em; color: #fff; padding: 5px 8px; border-radius: 8px;
  background: rgba(4, 7, 11, 0.72); border: 1px solid var(--borde-2); white-space: nowrap; will-change: transform; }
.etiqueta3d::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 10px; background: var(--borde-2); }
.campo { all: unset; box-sizing: border-box; width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--borde);
  background: rgba(4, 7, 11, 0.55); font: 500 13px var(--texto); color: var(--tinta); }
.campo:focus { border-color: var(--neon); box-shadow: var(--brillo); }
.interruptores { display: flex; flex-wrap: wrap; gap: 6px; }
.interruptor { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1); font: 600 10.5px var(--mono); letter-spacing: 0.06em; color: var(--tinta-2); background: rgba(4, 7, 11, 0.45); }
.interruptor i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--neon)); box-shadow: 0 0 8px var(--c, var(--neon)); }
.interruptor b { color: #fff; font-weight: 700; }
.interruptor.apagado { opacity: 0.38; }
.interruptor.apagado i { box-shadow: none; }
@media (max-width: 720px) {
  .lateral { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 52dvh; border-radius: 24px 24px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)); transition: transform 0.35s cubic-bezier(.2, .8, .2, 1); }
  .lateral.plegada { transform: translateY(calc(100% - 92px)); }
  .lateral .asa { display: block; }
  .tarjeta-info { top: auto; bottom: calc(100px + env(safe-area-inset-bottom)); }
}
