/* ── SYSTEM PANEL ── */
.system {
  width: calc(100% - 24px);
  margin: 8px 12px;
  border: 1px solid var(--border-med);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  z-index: 5;
  transition: border-color 0.2s;
}

.system:hover { border-color: var(--border-med); }

/* ══════════════════════════════════
   GLITCH EFFECT
   ══════════════════════════════════ */
@keyframes glitch-body {
  0%   { transform: translateX(0)    skewX(0deg);    filter: none; }
  8%   { transform: translateX(-5px) skewX(-2.5deg); filter: brightness(1.5) contrast(1.2); }
  16%  { transform: translateX(5px)  skewX(1.5deg);  filter: brightness(0.6) contrast(1.4); }
  24%  { transform: translateX(-3px) skewX(0deg);    filter: none; }
  40%  { transform: translateX(0)    skewX(0.8deg);  }
  58%  { transform: translateX(4px);                  filter: brightness(1.3); }
  72%  { transform: translateX(-2px);                 filter: none; }
  88%  { transform: translateX(1px);  }
  100% { transform: translateX(0)    skewX(0deg);    filter: none; }
}

@keyframes glitch-scan {
  0%   { clip-path: inset(0 0 100% 0);   opacity: 0; }
  12%  { clip-path: inset(12% 0 68% 0);  opacity: 1; background: rgba(232,226,208,0.09); }
  28%  { clip-path: inset(58% 0 28% 0);  background: rgba(232,226,208,0.06); }
  44%  { clip-path: inset(35% 0 52% 0);  background: rgba(232,226,208,0.08); }
  60%  { clip-path: inset(72% 0 12% 0);  background: rgba(232,226,208,0.05); }
  78%  { clip-path: inset(22% 0 70% 0);  background: rgba(232,226,208,0.07); }
  100% { clip-path: inset(0 0 100% 0);   opacity: 0; }
}

.system--glitch-active {
  animation: glitch-body 0.45s linear;
}

.system--glitch-active::after {
  content: '';
  position: absolute;
  inset: 0;
  animation: glitch-scan 0.45s step-end;
  pointer-events: none;
  z-index: 200;
}

/* ── STATUS BAR ── */
.system__bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(232, 226, 208, 0.02);
  gap: 0;
  overflow: hidden;
}

.system__label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--cream-dim);
  text-transform: uppercase;
  padding: 0 16px;
  white-space: nowrap;
}

.system__sep {
  display: block;
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

.system__icon {
  font-size: 14px;
  color: var(--cream-dim);
  padding: 0 14px;
  animation: icon-spin 8s linear infinite;
  display: inline-block;
}

@keyframes icon-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.system__checker {
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='2' height='2' fill='%239A9182'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%239A9182'/%3E%3C/svg%3E");
  background-size: 4px 4px;
  margin: 0 12px;
  flex-shrink: 0;
}

/* ── PANEL BODY ── */
.system__body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 260px;
}

.system__left {
  border-right: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  overflow: hidden;
}

#wireframe-canvas {
  width: 100%;
  height: 100%;
  display: block;
  flex: 1;
}

/* ── RIGHT CONTENT ── */
.system__right {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.system__sequence {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.5vw, 28px);
  color: var(--cream);
  letter-spacing: 2px;
  line-height: 1;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.system__arrows {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--cream-low);
  letter-spacing: 1px;
}

/* ── IDENTIDAD: foto + datos ── */
.system__identity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.system__photo-wrap {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-panel);
}

.system__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Tipografía de nombre/cargo/ciudad → Share Tech Mono (igual que tickers) */
.system__desc {
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.85;
  color: var(--cream-dim);
  letter-spacing: 1.5px;
  padding: 8px 10px;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  background: rgba(232, 226, 208, 0.02);
}

/* ── REDES SOCIALES ── */
.system__social-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.system__social {
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--cream-dim);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 4px 9px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.system__social:hover {
  color: var(--cream);
  border-color: var(--border-med);
  background: rgba(232, 226, 208, 0.05);
}

/* ── META + BOTÓN ── */
.system__meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-dim);
  align-items: center;
}

.system__meta-item {
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--cream-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 9px;
  background: rgba(232, 226, 208, 0.03);
}

/* ── RESPONSIVE (standalone) ── */
@media (max-width: 700px) {
  .system { width: calc(100% - 10px); margin: 6px 5px; }
  .system__body { grid-template-columns: 1fr; }
  .system__left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 140px;
  }
  .system__bar { flex-wrap: wrap; gap: 4px; }
}

/* ══════════════════════════════════
   SYSTEM FLOTANTE en el hero
   ══════════════════════════════════ */
.system--hero {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 380px;          /* ancho fijo tipo tarjeta de presentación */
  max-width: calc(100% - 40px);
  margin: 0;
  z-index: 20;
  background: rgba(10, 9, 7, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.system--hero .system__body {
  grid-template-columns: 110px 1fr;
  min-height: 0;
}

.system--hero .system__left {
  overflow: hidden;
}

.system--hero .system__right {
  padding: 10px;
  gap: 6px;
  justify-content: space-between;
}

.system--hero .system__sequence {
  font-size: clamp(10px, 1.2vw, 16px);
  padding-bottom: 6px;
}

/* Foto: proporción 3:4 retrato — llega hasta el área de redes sociales */
.system--hero .system__photo-wrap {
  width: 60px;
  height: 80px;          /* 3:4 coincide con canvas 120×160 */
  border-radius: 3px;
  align-self: flex-start;
  flex-shrink: 0;
}

.system--hero .system__desc {
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1.7;
  padding: 5px 8px;
}

/* Meta pegada al contenido, sin hueco vacío */
.system--hero .system__meta {
  margin-top: 0;
  padding-top: 6px;
}

.system--hero .system__meta-item {
  font-size: 7px;
  padding: 3px 6px;
}

.system--hero .system__social {
  font-size: 7px;
  padding: 3px 7px;
}

@media (max-width: 600px) {
  .system--hero {
    position: static;
    width: calc(100% - 10px);
    margin: 6px 5px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-panel);
  }
  .system--hero .system__body {
    grid-template-columns: 1fr;
  }
  .system--hero .system__left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
