/**
 * Keystone design tokens.
 *
 * ───────────────────────────────────────────────────────────────────────────
 * THIS IS THE ONLY FILE IN THE REPOSITORY THAT CONTAINS A HEX VALUE.
 * ───────────────────────────────────────────────────────────────────────────
 *
 * Not a guideline. If a raw color appears anywhere else, the design system has
 * stopped working — the discipline that makes tokens useful is never bypassing
 * them.
 *
 * WHY TOKENS
 *
 * Not "so we can rebrand later." That's speculative, and internal engineering
 * tools rarely carry corporate brand — this one may never be rebranded at all.
 *
 * The reason is that `--ks-state-blind` tells the next engineer what
 * striped-black MEANS without anyone explaining it. Semantic naming is why a
 * developer can add a view without guessing, and why six views stay coherent
 * across two teams. That's worth it even if no value ever changes.
 *
 * The rebrand path comes free: it's a values-only edit to this file.
 *
 * THE SEMANTIC SPECTRUM
 *
 * One grammar, reused across every view, dialed to each view's job:
 *
 *   good/governed  →  caution/transition  →  unknown/blind/blocked
 *   green          →  amber               →  striped-black
 *
 * Operations reads it as governed/transition/unknown. Risk reads it as
 * contained/detected/blind. The Console reads it as published/staged/blocked.
 * The Dictionary reads it as confidence tiers. Same spectrum, different nouns.
 *
 * STRIPED-BLACK IS LOAD-BEARING
 *
 * "Unknown" is not a styling choice here. In an IAM tool, "we had zero
 * privileged accounts in August" and "we could not see privileged accounts in
 * August" are very different statements, and the interface must never blur
 * them. Striped-black is how the second one looks. It carries into the
 * snapshot schema too — see ADR-0008.
 */

:root {
  /* ─── Surface ─────────────────────────────────────────────────────────── */

  --ks-surface-base: #10161c;
  --ks-surface-raised: #182029;
  --ks-surface-overlay: #202b36;
  --ks-surface-sunken: #0a0e12;

  /* ─── Ink ─────────────────────────────────────────────────────────────── */

  --ks-ink-primary: #e8edf2;
  --ks-ink-secondary: #9aa8b5;
  --ks-ink-tertiary: #5f6f7d;
  --ks-ink-inverse: #10161c;

  /* ─── Semantic state ──────────────────────────────────────────────────── */
  /* The spectrum. Do not add a fourth state without a very good reason —
     three is what makes it readable at a glance. */

  --ks-state-good: #3fb984;
  --ks-state-good-dim: #1f5c43;
  --ks-state-caution: #d99a35;
  --ks-state-caution-dim: #6b4c1c;
  --ks-state-danger: #d15a49;
  --ks-state-danger-dim: #6b2e26;

  /* Unknown / blind / blocked. Rendered as a stripe, never a flat fill —
     the texture is the signal. */
  --ks-state-blind: #2a3540;
  --ks-state-blind-stripe: #161d24;

  /* ─── Accent ──────────────────────────────────────────────────────────── */

  --ks-accent-primary: #4a9dd4;
  --ks-accent-secondary: #7a68b8;

  /* Dim accents — the soft-tint surface/border members of the accent family,
     the accent analogue of the state `-dim` tokens. A faint accent-tinted
     panel reads as "assurance / SSO" (primary) or "AI-assisted / modeled"
     (secondary) without competing with the semantic spectrum. */
  --ks-accent-primary-dim: #1f3d52;
  --ks-accent-secondary-dim: #332a52;

  /* ─── Line ────────────────────────────────────────────────────────────── */

  --ks-line-subtle: #202b36;
  --ks-line-default: #2d3a47;
  --ks-line-strong: #445261;

  /* ─── Type ────────────────────────────────────────────────────────────── */

  --ks-font-display: 'Space Grotesk', system-ui, sans-serif;
  --ks-font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --ks-font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --ks-text-xs: 0.75rem;
  --ks-text-sm: 0.875rem;
  --ks-text-base: 1rem;
  --ks-text-lg: 1.25rem;
  --ks-text-xl: 1.75rem;
  --ks-text-2xl: 2.5rem;

  --ks-weight-normal: 400;
  --ks-weight-medium: 500;
  --ks-weight-bold: 700;

  /* ─── Space ───────────────────────────────────────────────────────────── */

  --ks-space-1: 0.25rem;
  --ks-space-2: 0.5rem;
  --ks-space-3: 0.75rem;
  --ks-space-4: 1rem;
  --ks-space-6: 1.5rem;
  --ks-space-8: 2rem;
  --ks-space-12: 3rem;

  --ks-radius-sm: 3px;
  --ks-radius-md: 6px;
  --ks-radius-lg: 10px;
}

/**
 * The unknown state, as a utility. Apply where a value could not be read —
 * never where a value is genuinely zero.
 */
.ks-unknown {
  background-image: repeating-linear-gradient(
    45deg,
    var(--ks-state-blind) 0px,
    var(--ks-state-blind) 6px,
    var(--ks-state-blind-stripe) 6px,
    var(--ks-state-blind-stripe) 12px
  );
  color: var(--ks-ink-tertiary);
}

/* Quality floor. Not optional, not announced. */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--ks-accent-primary);
  outline-offset: 2px;
}
