/* ============================================================
   demo.corvus.sep2026 — panel de cámaras
   Misma familia visual que las webs de Gaia Lab: grafito, teal Gaia
   y rojo "pulso"; EB Garamond (marca) y Courier Prime (rótulos).
   El panel es siempre oscuro: es un muro de vídeo.
   ============================================================ */

:root {
  --graphite: #17191c;
  --graphite-2: #1f2226;
  --graphite-line: #2e3237;
  --on-dark: #eceeea;
  --on-dark-2: #a6ada9;
  --teal-on-dark: #3ebca9;
  --red: #e0262d;
  --font-display: "EB Garamond", Garamond, "Times New Roman", Times, serif;
  --font-mono: "Courier Prime", "Courier New", Courier, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --topbar-h: 58px;
  --gap: 6px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #0d0e10;
  color: var(--on-dark);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a:focus-visible,
.cam:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: -3px;
}

code { font-family: var(--font-mono); }

/* ---------- barra superior ---------- */

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: var(--topbar-h);
  padding: 0.3rem clamp(12px, 2vw, 24px);
  background: var(--graphite);
  border-bottom: 1px solid var(--graphite-line);
}

.brand { display: flex; align-items: center; gap: 0.8rem; margin-inline-end: auto; }

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.brand-globe { display: block; width: 40px; height: 40px; transition: rotate 1.6s var(--ease), filter 0.4s ease; }

.brand-globe img { display: block; width: 100%; height: 100%; }

.brand:hover .brand-globe { rotate: 1turn; filter: drop-shadow(0 0 7px rgba(62, 188, 169, 0.65)); }

.brand-name { display: flex; flex-direction: column; gap: 0.15rem; }

.brand-word { font-weight: 700; font-size: 1.5rem; line-height: 1; white-space: nowrap; }

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-2);
  white-space: nowrap;
}

.status,
.clock {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-2);
  white-space: nowrap;
}

.status::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-inline-end: 0.6em;
  border-radius: 50%;
  background: var(--graphite-line);
}

.status.is-live { color: var(--on-dark); }

.status.is-live::before { background: var(--red); animation: blink 1.6s ease-in-out infinite; }

.status:empty { display: none; }

.clock { color: var(--teal-on-dark); font-variant-numeric: tabular-nums; }

@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- muro de cámaras ---------- */

.wall {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr));
  gap: var(--gap);
  padding: var(--gap);
}

.cam {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--graphite);
  border: 1px solid var(--graphite-line);
  cursor: zoom-in;
  transition: border-color 0.25s ease;
}

.cam:hover { border-color: var(--teal-on-dark); }

.cam-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 34px;
  padding-inline: 0.7rem;
  border-bottom: 1px solid var(--graphite-line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cam-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid var(--graphite-line);
  color: var(--on-dark-2);
  font-weight: 700;
}

.cam-name {
  margin: 0 auto 0 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  font-weight: 700;
  color: var(--on-dark);
}

.cam-state { flex: none; color: var(--on-dark-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.cam-state::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-inline-end: 0.55em;
  border-radius: 50%;
  background: var(--on-dark-2);
}

.cam-state[data-state="live"] { color: var(--teal-on-dark); }
.cam-state[data-state="live"]::before { background: var(--teal-on-dark); }
.cam-state[data-state="off"] { color: var(--red); }
.cam-state[data-state="off"]::before { background: var(--red); }
.cam-state[data-state="wait"]::before { animation: blink 1s ease-in-out infinite; }

.cam-view { position: relative; flex: 1; min-height: 0; background: #000; }

.cam-view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Sin señal: la línea de pulso, plana */
.cam-off {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.6rem;
  padding-inline: 12%;
  background: radial-gradient(ellipse at 50% 60%, #24282c 0%, #17191c 60%, #101113 100%);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 0.4s ease;
}

.cam-off .pulse { display: block; width: 100%; height: 40px; }

.cam-off span { color: var(--on-dark-2); }

.cam.is-live .cam-off { opacity: 0; pointer-events: none; }

/* Cámara en grande */
.wall.has-focus { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }

.wall.has-focus .cam:not(.is-focus) { display: none; }

.cam.is-focus { cursor: zoom-out; }

.cam.is-focus .cam-head { height: 40px; font-size: 0.82rem; }

.empty,
.nojs {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  margin: 2rem;
  max-width: 50ch;
  text-align: center;
  font-size: 1.25rem;
  color: var(--on-dark-2);
}

/* ---------- puntero de presentación ----------
   Con la tecla P (o Mayús + clic en el logo de la cabecera, o añadiendo ?puntero a la
   dirección) el logo se convierte en el puntero: un punto rojo exacto y, siguiéndolo,
   el disco con el logo, que gira al moverse y emite un pulso al hacer clic.
   Otra pulsación de P lo quita. Solo con ratón; ver main.js. */

html.has-pointer,
html.has-pointer * { cursor: none !important; }

.pointer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pointer.is-on { opacity: 1; }

.pointer-dot,
.pointer-ring,
.pointer-disc {
  position: absolute;
  border-radius: 50%;
  will-change: translate;
}

.pointer-dot {
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 12px rgba(224, 38, 45, 0.65);
}

.pointer-ring {
  left: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--red);
  opacity: 0;
}

.pointer.is-click .pointer-ring { animation: pointer-ping 0.55s ease-out; }

@keyframes pointer-ping {
  from { opacity: 0.95; scale: 0.35; }
  to { opacity: 0; scale: 2.4; }
}

.pointer-disc {
  left: 12px;
  top: 12px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(23, 25, 28, 0.92);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45), 0 8px 22px rgba(0, 0, 0, 0.35);
  transition: scale 0.2s var(--ease);
}

.pointer-disc img { display: block; width: 38px; height: 38px; }

.pointer.is-over .pointer-disc { scale: 1.18; box-shadow: 0 0 0 2px var(--teal-on-dark), 0 8px 22px rgba(0, 0, 0, 0.35); }

@media (prefers-reduced-motion: reduce) {
  .pointer.is-click .pointer-ring { animation: none; }
}

/* ---------- pantallas estrechas: una columna con desplazamiento ---------- */

@media (max-width: 699px) {
  body { overflow: auto; }
  .wall { grid-template-rows: none; grid-auto-rows: auto; }
  .cam-view { flex: none; aspect-ratio: 16 / 9; }
  .status { display: none; }
  .wall.has-focus { grid-template-rows: none; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-globe { transition: none; }
  .status.is-live::before, .cam-state[data-state="wait"]::before { animation: none; }
}

