/* KRSS-2026-001 answer site: shared tokens and browser surfaces.
   Shape rule: entities are circles, panels 14px, controls 10px, tags are pills. */

@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/static/vendor/fonts/archivo-wdth.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/static/vendor/fonts/archivo-wdth-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/static/vendor/fonts/jetbrains-mono.woff2") format("woff2-variations");
}

:root {
  color-scheme: dark;

  /* Analysis field: ink navy, deepest to most raised */
  --ink-0: #060914;
  --ink-1: #0a0f1e;
  --ink-2: #10172d;
  --ink-3: #172039;
  --ink-4: #222d4b;
  --ink-5: #34425f;

  /* Text and established evidence */
  --mute: #8a97b2;
  --soft: #bcc6d8;
  --paper: #eef1f7;

  /* The one accent: focus, action, the solve flash, the investigator's own marks */
  --signal: #ff5a36;
  --signal-hi: #ff7a5c;
  --signal-ink: #170905;
  --signal-wash: rgba(255, 90, 54, 0.14);
  --signal-line: rgba(255, 90, 54, 0.55);

  --font-sans: "Archivo Variable", "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, Consolas, monospace;

  --r-panel: 14px;
  --r-control: 10px;

  --shadow-panel: none;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Layers, lowest first */
  --z-field: 0;
  --z-links: 1;
  --z-nodes: 2;
  --z-reticle: 3;
  --z-chrome: 10;
  --z-hud: 11;        /* over the dock, so the HUD's end-session popover is never hidden */
  --z-overlay: 20;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--ink-1);
  /* Static lattice for machines without WebGL; the canvas paints over it. */
  background-image: radial-gradient(circle at center, rgba(188, 198, 216, 0.12) 1px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--soft);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  font-kerning: normal;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  caret-color: var(--signal);
  scrollbar-color: var(--ink-5) transparent;
}

::selection { background: var(--signal-wash); color: var(--paper); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: var(--r-control); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--paper); text-underline-offset: 3px; text-decoration-color: var(--ink-5); }
a:hover { text-decoration-color: var(--signal); }

.icon { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ---------- the field and the chart layers (shared by stations and the TV) ---------- */

.field {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: var(--z-field); display: block; pointer-events: none;
}
.links, .link-labels, .nodes {
  position: fixed; inset: 0; z-index: var(--z-links); pointer-events: none;
}
.links { width: 100%; height: 100%; overflow: visible; }
.nodes { z-index: var(--z-nodes); }

.link {
  stroke: var(--paper); stroke-opacity: 0.42; stroke-width: 1.25; stroke-linecap: round;
  fill: none;
}
.link.is-hot { stroke: var(--signal); stroke-opacity: 0.95; stroke-width: 1.6; }
.link.is-known { stroke: var(--soft); stroke-opacity: 0.32; stroke-dasharray: 2 5; }

.link-label {
  position: absolute; left: 0; top: 0;
  padding: 2px 8px; border-radius: 99px;
  background: rgba(10, 15, 30, 0.86); border: 1px solid var(--ink-4);
  color: var(--soft); font-size: 11px; font-weight: 500; letter-spacing: 0.01em;
  white-space: nowrap; opacity: 0; will-change: transform;
}

/* A node is a disc plus a caption. Its size stays constant while the camera zooms. */
.node {
  position: absolute; left: 0; top: 0;
  display: grid; justify-items: center; gap: 6px;
  width: 0; height: 0; overflow: visible;
  pointer-events: auto; will-change: transform;
}
.node-disc {
  position: absolute; left: -24px; top: -24px;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink-2); border: 1.25px solid var(--ink-5);
  color: var(--paper);
  transition: border-color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), scale 0.25s var(--ease-out);
}
.node-disc .icon { width: 22px; height: 22px; }
.node-num { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--soft); }
.node-cap {
  position: absolute; top: 39px; left: 0; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 1px; text-align: center;
  width: max-content; max-width: 168px;
}
.node-label {
  color: var(--paper); font-size: 13px; font-weight: 600; line-height: 1.3;
  text-shadow: 0 1px 8px var(--ink-1), 0 0 2px var(--ink-1);
}
.node-label.mono { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.node-sub {
  color: var(--mute); font-size: 11px; font-weight: 500; font-stretch: 88%;
  letter-spacing: 0.04em; text-transform: uppercase;
  text-shadow: 0 1px 8px var(--ink-1);
}

.node--ghost .node-disc {
  background: rgba(16, 23, 45, 0.72);
  border-style: dashed; border-color: var(--ink-5);
}
.node--ghost .node-label { color: var(--soft); font-weight: 500; opacity: 0; transition: opacity 0.2s var(--ease-out); }
.node--ghost:hover .node-label,
.node--ghost:focus-visible .node-label,
.node--ghost.is-selected .node-label { opacity: 1; }

.node--locked .node-disc {
  width: 30px; height: 30px; left: -15px; top: -15px;
  background: rgba(10, 15, 30, 0.82); border: 1.25px dashed var(--ink-4); color: var(--mute);
}
.node-lock .icon { width: 13px; height: 13px; }
.node--locked .node-cap { display: none; }

.node--known .node-disc { background: var(--ink-3); border-color: var(--ink-5); }
.node--suspect .node-disc { width: 60px; height: 60px; left: -30px; top: -30px; border-color: var(--soft); }
.node--suspect .node-disc .icon { width: 28px; height: 28px; }
.node--suspect .node-cap { top: 45px; }

.node--solved .node-disc { background: var(--paper); border-color: var(--paper); color: var(--ink-1); }
.node--solved.is-fresh .node-disc { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }

.node:focus-visible { outline: none; }
.node:focus-visible .node-disc { outline: 2px solid var(--signal); outline-offset: 4px; }

@media (hover: hover) {
  .node:hover .node-disc { scale: 1.08; border-color: var(--soft); }
  .node--solved:hover .node-disc { border-color: var(--paper); }
}

.chart-compact .node-sub { display: none; }
.chart-compact .node-cap { max-width: 112px; }
.chart-compact .node-label { font-size: 11px; }
.chart-compact .node-label.mono { font-size: 10.5px; }

/* The suggested next lead breathes; nothing else on the chart loops. */
.node.is-next .node-disc::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid var(--signal-line);
  animation: next-breathe 2.6s var(--ease-out) infinite;
}
@keyframes next-breathe {
  0% { transform: scale(0.86); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

.float-chip {
  position: absolute; left: 0; top: 0; pointer-events: none;
  padding: 3px 10px; border-radius: 99px;
  background: var(--signal); color: var(--signal-ink);
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(2, 4, 12, 0.9);
}

.reticle {
  position: fixed; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  z-index: var(--z-reticle); pointer-events: none; opacity: 0; will-change: transform, opacity;
}
.reticle i {
  position: absolute; width: 13px; height: 13px; border: 0 solid var(--signal);
}
.reticle i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.reticle i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.reticle i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.reticle i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }

@media (prefers-reduced-motion: reduce) {
  .node.is-next .node-disc::after { animation: none; opacity: 1; transform: scale(1.12); }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
