/* Nexus Demo — Nexus Deep Scan · technical HUD / voxel brain */

html:has(body[data-page="nexusdemo"]) {
  height: 100%;
}

@font-face {
  font-family: "Aeonik";
  src:
    local("Aeonik Regular"),
    local("Aeonik-Regular");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body[data-page="nexusdemo"] {
  --white: #fcfcfc;
  --black: #181818;
  --scan: #c6ed3a;
  --scan-mid: #6a9a2e;
  --scan-deep: #2a4a14;
  --orange: #e88850;
  --orange-hot: #f0a878;
  --orange-burnt: #a6482d;
  --cat-person: #f0c9a0;
  --cat-skill: #c6ed3a;
  --cat-workflow: #5fa83a;
  --cat-decision: #e88850;
  --cat-conversation: #c45a28;
  --cat-app: #8fb83a;
  --cat-hub: #e8ff6a;
  --border: rgba(252, 252, 252, 0.18);
  --text-muted: rgba(252, 252, 252, 0.42);
  --canvas-bg: #050505;

  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas-bg);
  color: var(--white);
  font-family: "Aeonik", system-ui, sans-serif;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

.nexusdemo-chrome {
  position: fixed;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  left: 48px;
  right: 48px;
  pointer-events: none;
  font-family: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(252, 252, 252, 0.7);
}

.nexusdemo-chrome--top {
  top: 48px;
}

.nexusdemo-chrome--bottom {
  bottom: 22px;
  color: var(--text-muted);
}

.nexusdemo-chrome__brand {
  color: var(--white);
  letter-spacing: 0.14em;
}

.nexusdemo-canvas-wrap {
  position: fixed;
  inset: 0;
  background: var(--canvas-bg);
  cursor: grab;
  overflow: hidden;
}

.nexusdemo-canvas-wrap.is-dragging {
  cursor: grabbing;
}

.nexusdemo-canvas-wrap.is-dragging .nexusdemo-mark:not(.is-dim),
.nexusdemo-canvas-wrap.is-inspect .nexusdemo-mark:not(.is-dim) {
  opacity: 1 !important;
  filter: none !important;
}

.nexusdemo-canvas-wrap.is-holding .nexusdemo-mark__box {
  background: color-mix(in srgb, var(--mark, #c6ed3a) 22%, rgba(5, 5, 5, 0.55));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--mark, #c6ed3a) 45%, transparent),
    0 0 18px color-mix(in srgb, var(--mark, #c6ed3a) 28%, transparent);
}

.nexusdemo-canvas-wrap.is-dragging:not(.is-holding) .nexusdemo-mark__box,
.nexusdemo-canvas-wrap.is-inspect .nexusdemo-mark__box {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--mark, var(--white)) 55%, transparent),
    0 0 22px color-mix(in srgb, var(--mark, var(--white)) 40%, transparent);
}

.nexusdemo-mark.is-shaded .nexusdemo-mark__label {
  opacity: 0.85;
}

.nexusdemo-canvas-wrap.is-dragging .nexusdemo-mark__frame,
.nexusdemo-canvas-wrap.is-inspect .nexusdemo-mark:hover .nexusdemo-mark__frame,
.nexusdemo-canvas-wrap.is-inspect .nexusdemo-mark.is-hot .nexusdemo-mark__frame {
  opacity: 1;
}

.nexusdemo-canvas-wrap.is-dragging .nexusdemo-mark__label,
.nexusdemo-canvas-wrap.is-inspect .nexusdemo-mark.is-hot .nexusdemo-mark__label {
  opacity: 1;
  color: var(--white);
}

.nexusdemo-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  transition: filter 0.25s ease;
}

.nexusdemo-canvas-wrap.is-dragging canvas,
.nexusdemo-canvas-wrap.is-inspect canvas {
  filter: brightness(0.72) contrast(1.08);
}

.nexusdemo-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes nexusdemo-blink {
  50% { opacity: 0.25; }
}

/* Projected node markers */
.nexusdemo-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  cursor: default;
  will-change: transform, opacity, filter;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
}

.nexusdemo-mark__box {
  position: relative;
  width: var(--size, 18px);
  height: var(--size, 18px);
  border: 1px solid var(--mark, rgba(252, 252, 252, 0.85));
  background: rgba(5, 5, 5, 0.35);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mark, #fcfcfc) 22%, transparent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nexusdemo-mark__core {
  position: absolute;
  inset: 50%;
  width: var(--core, 5px);
  height: var(--core, 5px);
  transform: translate(-50%, -50%);
  background: var(--mark, var(--white));
  box-shadow: 0 0 8px color-mix(in srgb, var(--mark, #fcfcfc) 50%, transparent);
}

.nexusdemo-mark__frame {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--mark, rgba(198, 237, 58, 0.55));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nexusdemo-mark__frame--outer {
  inset: -11px;
  border-color: color-mix(in srgb, var(--mark, #fcfcfc) 35%, transparent);
}

.nexusdemo-mark.is-focus .nexusdemo-mark__frame,
.nexusdemo-mark.is-hot .nexusdemo-mark__frame,
.nexusdemo-mark:hover .nexusdemo-mark__frame {
  opacity: 1;
}

.nexusdemo-mark.is-focus .nexusdemo-mark__box,
.nexusdemo-mark.is-hot .nexusdemo-mark__box,
.nexusdemo-mark:hover .nexusdemo-mark__box {
  border-color: var(--mark, var(--scan));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--mark, var(--scan)) 70%, transparent),
    0 0 28px color-mix(in srgb, var(--mark, var(--scan)) 55%, transparent);
}

.nexusdemo-mark.is-dim {
  opacity: 0.22 !important;
  filter: blur(0.6px);
  pointer-events: none;
}

.nexusdemo-mark.is-hot {
  z-index: 40 !important;
}

.nexusdemo-mark__label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--mark, #fcfcfc) 75%, #fcfcfc);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(5, 5, 5, 0.9);
}

.nexusdemo-mark.is-focus .nexusdemo-mark__label,
.nexusdemo-mark.is-hot .nexusdemo-mark__label,
.nexusdemo-mark:hover .nexusdemo-mark__label,
.nexusdemo-mark.is-label .nexusdemo-mark__label,
.nexusdemo-canvas-wrap.is-zoomed .nexusdemo-mark.is-primary:not(.is-dim) .nexusdemo-mark__label,
.nexusdemo-canvas-wrap.is-filtered .nexusdemo-mark.is-primary:not(.is-dim) .nexusdemo-mark__label {
  opacity: 1;
  color: var(--white);
}

.nexusdemo-canvas-wrap.is-filtered .nexusdemo-mark.is-cat .nexusdemo-mark__core {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 14px color-mix(in srgb, var(--mark) 70%, transparent);
}

.nexusdemo-canvas-wrap.is-filtered .nexusdemo-mark.is-cat .nexusdemo-mark__box {
  border-color: var(--mark);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--mark) 45%, transparent),
    0 0 20px color-mix(in srgb, var(--mark) 30%, transparent);
}

.nexusdemo-canvas-wrap.is-filtered .nexusdemo-mark.is-cat .nexusdemo-mark__frame {
  opacity: 1;
  border-color: var(--mark);
}

.nexusdemo-canvas-wrap.is-zoomed .nexusdemo-mark:not(.is-dim) {
  opacity: 1 !important;
}

.nexusdemo-mark__signal {
  display: none;
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  pointer-events: none;
}

.nexusdemo-mark[data-signal] .nexusdemo-mark__signal {
  display: block;
}

/* Key nodes — solid corner pip (square language, not circles) */
.nexusdemo-mark[data-signal="key"] .nexusdemo-mark__signal {
  background: var(--mark, var(--scan));
  box-shadow: 0 0 8px color-mix(in srgb, var(--mark, var(--scan)) 55%, transparent);
}

/* Linked nodes — hollow corner bracket */
.nexusdemo-mark[data-signal="link"] .nexusdemo-mark__signal {
  background: transparent;
  border-top: 1.5px solid var(--mark, var(--scan));
  border-right: 1.5px solid var(--mark, var(--scan));
  width: 8px;
  height: 8px;
}

.nexusdemo-mark.is-focus .nexusdemo-mark__signal,
.nexusdemo-mark.is-hot .nexusdemo-mark__signal {
  transform: scale(1.15);
}

/* Knowledge-base volume labels */
.nexusdemo-kb {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform, opacity;
}

.nexusdemo-kb__tag {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--kb, #c6ed3a) 55%, transparent);
  background: rgba(5, 5, 5, 0.55);
  font-family: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--kb, #c6ed3a) 85%, #fcfcfc);
  white-space: nowrap;
}

.nexusdemo-kb[data-type="person"] { --kb: var(--cat-person); }
.nexusdemo-kb[data-type="skill"] { --kb: var(--cat-skill); }
.nexusdemo-kb[data-type="workflow"] { --kb: var(--cat-workflow); }
.nexusdemo-kb[data-type="decision"] { --kb: var(--cat-decision); }
.nexusdemo-kb[data-type="conversation"] { --kb: var(--cat-conversation); }
.nexusdemo-kb[data-type="app"] { --kb: var(--cat-app); }

.nexusdemo-kb.is-active,
.nexusdemo-kb.is-hold {
  opacity: 1;
}

.nexusdemo-kb.is-dim {
  opacity: 0.12;
}

.nexusdemo-canvas-wrap.is-filtered .nexusdemo-kb.is-active .nexusdemo-kb__tag {
  border-color: var(--kb);
  box-shadow: 0 0 16px color-mix(in srgb, var(--kb) 35%, transparent);
}

.nexusdemo-canvas-wrap.is-tour-wide .nexusdemo-mark__label,
.nexusdemo-canvas-wrap.is-tour-wide .nexusdemo-kb {
  opacity: 0 !important;
  visibility: hidden !important;
}

.nexusdemo-mark[data-type="person"] { --mark: var(--cat-person); }
.nexusdemo-mark[data-type="skill"] { --mark: var(--cat-skill); }
.nexusdemo-mark[data-type="workflow"] { --mark: var(--cat-workflow); }
.nexusdemo-mark[data-type="decision"] { --mark: var(--cat-decision); }
.nexusdemo-mark[data-type="conversation"] { --mark: var(--cat-conversation); }
.nexusdemo-mark[data-type="app"] { --mark: var(--cat-app); }
.nexusdemo-mark[data-type="hub"] { --mark: var(--cat-hub); }

.nexusdemo-mark[data-type="hub"] .nexusdemo-mark__box {
  width: 26px;
  height: 26px;
}

.nexusdemo-mark[data-type="hub"] .nexusdemo-mark__core {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 16px color-mix(in srgb, var(--cat-hub) 70%, transparent);
}

.nexusdemo-telemetry {
  position: absolute;
  top: 50%;
  right: 28px;
  bottom: auto;
  left: auto;
  transform: translateY(-50%);
  z-index: 5;
  box-sizing: border-box;
  width: 272px;
  min-width: 272px;
  max-width: 272px;
  padding: 12px 14px;
  border: 1px solid rgba(252, 252, 252, 0.16);
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(10px);
  font-family: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  color: var(--text-muted);
  pointer-events: auto;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
}

.nexusdemo-telemetry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(252, 252, 252, 0.1);
  min-height: 14px;
}

.nexusdemo-telemetry__mode {
  color: var(--scan);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.nexusdemo-telemetry__scope {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(252, 252, 252, 0.38);
  white-space: nowrap;
  flex-shrink: 0;
}

.nexusdemo-telemetry__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.nexusdemo-telemetry__item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: 0;
}

.nexusdemo-telemetry__item > span {
  white-space: nowrap;
}

.nexusdemo-telemetry__item b {
  color: var(--white);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.nexusdemo-telemetry__of {
  color: rgba(252, 252, 252, 0.35);
  font-size: 11px;
  font-weight: 400;
}

.nexusdemo-telemetry__path {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(252, 252, 252, 0.1);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: rgba(252, 252, 252, 0.55);
  text-transform: none;
  min-height: 2.9em;
  max-height: 2.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nexusdemo-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(252, 252, 252, 0.1);
}

.nexusdemo-legend__label {
  margin-bottom: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(252, 252, 252, 0.38);
}

.nexusdemo-legend__item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 5px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  pointer-events: auto;
  white-space: nowrap;
}

.nexusdemo-legend__item::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border: 1px solid currentColor;
  background: var(--swatch, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--swatch, transparent) 50%, transparent);
}

.nexusdemo-legend__item[data-filter="all"]::before {
  background: transparent;
  border-color: rgba(252, 252, 252, 0.35);
  box-shadow: none;
}
.nexusdemo-legend__item[data-filter="person"] { --swatch: var(--cat-person); }
.nexusdemo-legend__item[data-filter="skill"] { --swatch: var(--cat-skill); }
.nexusdemo-legend__item[data-filter="workflow"] { --swatch: var(--cat-workflow); }
.nexusdemo-legend__item[data-filter="decision"] { --swatch: var(--cat-decision); }
.nexusdemo-legend__item[data-filter="conversation"] { --swatch: var(--cat-conversation); }
.nexusdemo-legend__item[data-filter="app"] { --swatch: var(--cat-app); }

.nexusdemo-legend__item:hover,
.nexusdemo-legend__item.is-active {
  color: var(--white);
  border-color: rgba(252, 252, 252, 0.22);
  background: rgba(252, 252, 252, 0.04);
}

.nexusdemo-telemetry__action {
  appearance: none;
  margin-top: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(252, 252, 252, 0.14);
  background: var(--black);
  color: var(--white);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nexusdemo-telemetry__action:hover {
  border-color: rgba(252, 252, 252, 0.35);
  background: color-mix(in srgb, var(--black) 88%, var(--white));
}

.nexusdemo-telemetry__action:focus-visible {
  outline: 1px solid rgba(252, 252, 252, 0.45);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .nexusdemo-chrome {
    left: 16px;
    right: 16px;
  }

  .nexusdemo-chrome--top {
    top: 18px;
    font-size: 10px;
  }

  .nexusdemo-telemetry {
    top: auto;
    right: 12px;
    bottom: 72px;
    transform: none;
    width: 272px;
    min-width: 272px;
    max-width: 272px;
    padding: 10px 12px;
    max-height: 52vh;
  }

  .nexusdemo-mark__label {
    display: none;
  }
}
