/* venode console chrome v1.
 *
 * Operations-style site shell shared by every public page. Borrows
 * directly from the references that informed the Plenum mock-up:
 * PyroSim, ParaView, Smokeview, VS Code, AutoCAD.
 *
 * Three fixed strips wrap the page:
 *   1. Top toolbar (vn-topbar)      — file/breadcrumb meta strip.
 *   2. Left activity rail (vn-activity) — workspace navigation, VS Code style.
 *   3. Bottom status bar (vn-statusbar) — section, view, units, AS check.
 *
 * A coordinate triad floats over the lower-right corner. The page content
 * sits in the middle of these strips and keeps the existing typography.
 */

:root {
  --vn-act-w: 44px;
  --vn-tb-h: 32px;
  --vn-sb-h: 24px;
  --vn-console-bg: #0a0908;
  --vn-console-ink: #f6f4ef;
  --vn-console-muted: rgba(246, 244, 239, 0.62);
  --vn-console-faint: rgba(246, 244, 239, 0.32);
  --vn-console-hair: rgba(246, 244, 239, 0.10);
  --vn-console-strong: rgba(246, 244, 239, 0.18);
  --vn-console-accent: #8e2436;
  --vn-console-warm: #ffb37a;
  --vn-console-cool: #6a8ec8;
}

body.has-console {
  padding-left: var(--vn-act-w);
  padding-top: var(--vn-tb-h);
  padding-bottom: var(--vn-sb-h);
}

/* ── Top toolbar ──────────────────────────────────────────────── */
.vn-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vn-tb-h);
  z-index: 9050;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 14px 0 calc(var(--vn-act-w) + 14px);
  background: linear-gradient(180deg, #14110e 0%, #0c0a08 100%);
  border-bottom: 1px solid var(--vn-console-strong);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vn-console-muted);
}
.vn-topbar .vn-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--vn-console-ink);
  font-weight: 700;
  letter-spacing: 0.10em;
  font-size: 11px;
  text-decoration: none;
}
.vn-topbar .vn-brand::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--vn-console-accent);
  display: inline-block;
}
.vn-topbar .vn-crumb {
  color: var(--vn-console-muted);
  display: inline-flex;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.vn-topbar .vn-crumb b {
  color: var(--vn-console-ink);
  font-weight: 600;
}
.vn-topbar .vn-crumb .vn-crumb-sep {
  color: var(--vn-console-faint);
}
.vn-topbar .vn-meta {
  display: inline-flex;
  gap: 14px;
  color: var(--vn-console-muted);
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: 9px;
  justify-self: end;
}
.vn-topbar .vn-meta b {
  color: var(--vn-console-ink);
  font-weight: 600;
}
.vn-topbar .vn-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffb37a;
}
.vn-topbar .vn-rec::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vn-console-accent);
  animation: vn-rec-blink 1.6s steps(2) infinite;
}
@keyframes vn-rec-blink {
  0%, 60% { opacity: 1; }
  60.1%, 100% { opacity: 0.25; }
}

/* ── Left activity rail ──────────────────────────────────────── */
.vn-activity {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--vn-act-w);
  z-index: 9100;
  background: #07060599;
  backdrop-filter: blur(2px);
  border-right: 1px solid var(--vn-console-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--vn-tb-h) + 10px) 0 calc(var(--vn-sb-h) + 8px);
  gap: 2px;
}
.vn-activity .vn-act-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--vn-console-muted);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px solid transparent;
  position: relative;
  margin-top: 4px;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.vn-activity .vn-act-btn:hover {
  color: var(--vn-console-ink);
  border-color: var(--vn-console-strong);
}
.vn-activity .vn-act-btn:focus-visible {
  outline: none;
  border-color: var(--vn-console-accent);
  color: var(--vn-console-ink);
}
.vn-activity .vn-act-btn.is-active {
  color: var(--vn-console-ink);
  border-color: var(--vn-console-accent);
  background: rgba(142, 36, 54, 0.18);
}
.vn-activity .vn-act-btn.is-active::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--vn-console-accent);
}
.vn-activity .vn-act-sep {
  width: 24px;
  height: 1px;
  background: var(--vn-console-hair);
  margin: 8px 0;
}
.vn-activity .vn-act-fill { flex: 1; }
.vn-activity .vn-act-tag {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.20em;
  color: var(--vn-console-faint);
  margin-bottom: 6px;
}

/* ── Status bar ──────────────────────────────────────────────── */
.vn-statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--vn-sb-h);
  z-index: 9050;
  padding: 0 14px 0 calc(var(--vn-act-w) + 14px);
  background: rgba(7, 6, 5, 0.92);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--vn-console-strong);
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vn-console-faint);
  overflow: hidden;
  white-space: nowrap;
}
.vn-statusbar b { color: var(--vn-console-ink); font-weight: 600; }
.vn-statusbar .vn-status-pass {
  color: #ffd9a8;
  margin-left: auto;
}
.vn-statusbar .vn-status-pass::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #ffd9a8;
  margin-right: 6px;
  transform: translateY(-1px);
}

/* ── Coordinate triad ────────────────────────────────────────── */
.vn-triad {
  position: fixed;
  right: 12px;
  bottom: calc(var(--vn-sb-h) + 12px);
  width: 56px;
  height: 56px;
  z-index: 8000;
  opacity: 0.86;
  pointer-events: none;
}

/* ── Mobile fold ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  :root { --vn-act-w: 0px; }
  body.has-console {
    padding-left: 0;
    padding-top: calc(var(--vn-tb-h) + 38px);
  }
  .vn-topbar { padding-left: 14px; }
  .vn-topbar .vn-meta { display: none; }
  .vn-topbar .vn-crumb { font-size: 9px; letter-spacing: 0.14em; }
  .vn-activity {
    top: var(--vn-tb-h);
    bottom: auto;
    right: 0;
    width: auto;
    height: 38px;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--vn-console-strong);
    padding: 0 8px;
    overflow-x: auto;
    white-space: nowrap;
    gap: 4px;
  }
  .vn-activity::-webkit-scrollbar { display: none; }
  .vn-activity .vn-act-btn { margin: 0; width: 36px; height: 30px; flex-shrink: 0; }
  .vn-activity .vn-act-btn.is-active::after {
    left: 2px;
    right: 2px;
    top: auto;
    bottom: -1px;
    width: auto;
    height: 2px;
  }
  .vn-activity .vn-act-sep { width: 1px; height: 18px; margin: 0 6px; }
  .vn-activity .vn-act-fill { display: none; }
  .vn-activity .vn-act-tag { display: none; }
  .vn-statusbar { padding-left: 14px; font-size: 8px; letter-spacing: 0.10em; gap: 10px; }
  .vn-statusbar > span:nth-child(n+3):not(.vn-status-pass) { display: none; }
  .vn-statusbar .vn-status-pass::before { width: 5px; height: 5px; margin-right: 4px; }
  .vn-triad { display: none; }
}

/* Hide chrome under reduced motion is not required, but the rec-blink
   animation pauses politely. */
@media (prefers-reduced-motion: reduce) {
  .vn-topbar .vn-rec::before { animation: none; }
}
