/*
 * Watchtower — design tokens (dark, safety-critical).
 * Per AUDIO_VISUAL_SPEC.md §Activation theming, the top strip and
 * incident cards shift hue based on the current activation level.
 * Tokens here cover the foundation surfaces; module-specific tokens
 * (incident cards, board displays, comms tiles) layer on top.
 */
/*
 * Canonical token set ported from the design handoff
 * (FOP Portal/styles/watchtower.css). These are the names the
 * identity surfaces from src/wt-identity.jsx reference. They
 * coexist with the legacy --wt-* tokens used by the Pass 1
 * shell + foundation page; both sets stay valid simultaneously.
 */
:root {
  --bg-0: #05080d;
  --bg-1: #0a0e14;
  --bg-2: #0f141c;
  --bg-3: #151c26;
  --l-1:  #1b2430;
  --l-2:  #263141;
  --l-3:  #384357;
  --t-0:  #e6edf5;
  --t-1:  #b3bdcc;
  --t-2:  #7e8999;
  --t-3:  #525c6a;
  --acc:  #4dc8ff;
  --acc-d:#1a9cd8;
  --ok:   #39d98a;
  --info: #4dc8ff;
  --warn: #ffb020;
  --crit: #ff3b3b;
  --t1:   #4dc8ff;
  --t2:   #ffb020;
  --t3:   #ff3b3b;
  --brand:   #ffd23f;
  --brand-d: #c8a32e;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --act: var(--ok);
}
:root[data-activation="YELLOW"] { --act: var(--warn); }
:root[data-activation="ORANGE"] { --act: #ff7a1a; }
:root[data-activation="RED"]    { --act: var(--crit); }

:root {
  /* core palette */
  --wt-bg-0:   #02040a;   /* page */
  --wt-bg-1:   #05080d;   /* card */
  --wt-bg-2:   #0a1220;   /* elevated */
  --wt-bg-3:   #0e1a2c;   /* input fill */
  --wt-fg-0:   #e8eef7;   /* primary */
  --wt-fg-1:   #aab2c0;   /* secondary */
  --wt-fg-2:   #6e7689;   /* tertiary */
  --wt-line:   #1c2a3f;   /* divider */
  --wt-line-2: #294063;

  /* activation-driven accent (overridden via [data-activation]) */
  --wt-accent: #4a90c2;          /* GREEN cool blue-gray */
  --wt-accent-soft: #1a2b3f;
  --wt-accent-glow: rgba(74,144,194,0.18);

  --wt-amber:  #ffb84d;
  --wt-amber-soft: #2a1f0f;
  --wt-crit:   #e63946;          /* RED critical */
  --wt-crit-soft: #2a0d11;
  --wt-ok:     #5fb976;
  --wt-ok-soft:#0e1f15;

  /* type */
  --wt-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Mono", Menlo, monospace;
  --wt-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* spacing */
  --wt-r1: 4px; --wt-r2: 6px; --wt-r3: 10px; --wt-r4: 14px;
  --wt-shadow-card: 0 1px 0 rgba(255,255,255,0.04), 0 6px 18px rgba(0,0,0,0.45);
}

:root[data-activation="YELLOW"] {
  --wt-accent: #d4a93a;
  --wt-accent-soft: #2a230d;
  --wt-accent-glow: rgba(212,169,58,0.20);
}
:root[data-activation="ORANGE"] {
  --wt-accent: #e08e3a;
  --wt-accent-soft: #2a1c0d;
  --wt-accent-glow: rgba(224,142,58,0.24);
}
:root[data-activation="RED"] {
  --wt-accent: #e63946;
  --wt-accent-soft: #2a0d11;
  --wt-accent-glow: rgba(230,57,70,0.32);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(circle at 30% 0%, var(--wt-bg-2) 0%, var(--wt-bg-0) 70%);
  color: var(--wt-fg-0);
  font: 14px/1.45 var(--wt-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--wt-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
}

/* ---- boot splash (visible only until shell hydrates) ---- */
.wt-boot {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: auto auto auto;
  align-content: center; justify-items: center; gap: 14px;
  background: var(--wt-bg-0);
  z-index: 0;
}
.wt-boot-mark img { display: block; }
.wt-boot-line {
  font-family: var(--wt-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--wt-fg-1);
}
.wt-boot-sub {
  font-size: 11px; color: var(--wt-fg-2);
}

/* ---- generic primitives used by identity surfaces ---- */
.wt-card {
  background: var(--wt-bg-1);
  border: 1px solid var(--wt-line);
  border-radius: var(--wt-r4);
  box-shadow: var(--wt-shadow-card);
}

.wt-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 18px;
  border-radius: var(--wt-r2);
  border: 1px solid var(--wt-line-2);
  background: var(--wt-bg-2);
  color: var(--wt-fg-0);
  font: 600 13px/1 var(--wt-sans);
  letter-spacing: 0.02em;
  transition: background 120ms ease, border-color 120ms ease;
}
.wt-btn:hover:not(:disabled) { background: var(--wt-bg-3); border-color: var(--wt-accent); }
.wt-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.wt-btn.primary {
  background: var(--wt-accent);
  border-color: var(--wt-accent);
  color: var(--wt-bg-0);
}
.wt-btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.wt-btn.danger {
  background: var(--wt-crit);
  border-color: var(--wt-crit);
  color: white;
}

.wt-input, .wt-textarea, .wt-select {
  width: 100%;
  background: var(--wt-bg-3);
  border: 1px solid var(--wt-line-2);
  border-radius: var(--wt-r2);
  color: var(--wt-fg-0);
  padding: 10px 12px;
  font: 14px/1.4 var(--wt-sans);
}
.wt-input:focus, .wt-textarea:focus, .wt-select:focus {
  outline: none; border-color: var(--wt-accent);
  box-shadow: 0 0 0 3px var(--wt-accent-glow);
}

.wt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border: 1px solid var(--wt-line-2);
  border-radius: 999px;
  font: 600 11px/1 var(--wt-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--wt-fg-1);
  background: var(--wt-bg-2);
}
.wt-chip.activation {
  border-color: var(--wt-accent);
  color: var(--wt-accent);
  background: var(--wt-accent-soft);
}
.wt-chip.crit { border-color: var(--wt-crit); color: var(--wt-crit); background: var(--wt-crit-soft); }
.wt-chip.ok   { border-color: var(--wt-ok);   color: var(--wt-ok);   background: var(--wt-ok-soft);   }
.wt-chip.amber{ border-color: var(--wt-amber);color: var(--wt-amber);background: var(--wt-amber-soft); }

.wt-muted { color: var(--wt-fg-2); }
.wt-danger-text { color: var(--wt-crit); }
