/*
 * NEXORA Design Tokens — Cycle 008 / task-002
 * -------------------------------------------------------------------------
 * Single source of truth for the authenticated Platform visual language.
 * Extracted and normalized from the approved landing page + product mockup
 * (apps/landpage-nexora/src/style.css) — NOT copied wholesale.
 *
 * Loaded FIRST (before every other stylesheet) so every downstream module
 * and every legacy view class resolves its colors/spacing/type from here.
 *
 * Retires the legacy teal control-plane accent: the primary brand accent is
 * now gold. Legacy variable names (--accent, --line, --muted, ...) are kept
 * as compatibility aliases mapped onto NEXORA tokens so existing views reskin
 * without per-file edits. Screens migrate off the aliases in later tasks.
 */

:root {
  /* ---- Surfaces (near-black canvas → elevated dark panels) ---- */
  --nx-bg: #050505;          /* app canvas */
  --nx-bg-2: #0c0c0c;        /* elevated (topbar / raised strips) */
  --nx-panel: #121212;       /* primary panel/card surface */
  --nx-panel-2: #161616;     /* nested / hover panel surface */

  /* ---- Borders ---- */
  --nx-border: #252525;      /* structural hairline */
  --nx-border-soft: rgba(255, 255, 255, 0.08);
  --nx-border-gold: rgba(255, 184, 0, 0.35);

  /* ---- Brand accent (gold) ---- */
  --nx-gold: #ffb800;
  --nx-gold-bright: #ffd54a;
  --nx-gold-dim: rgba(255, 184, 0, 0.15);
  --nx-on-gold: #050505;     /* text/icon on a gold fill */

  /* ---- Semantic status (subordinate to gold; used for security state) ---- */
  --nx-danger: #ff4c4c;
  --nx-danger-dim: rgba(255, 76, 76, 0.14);
  --nx-warn: #f4b740;
  --nx-warn-dim: rgba(244, 183, 64, 0.14);
  --nx-ok: #00e05a;          /* slightly tamed from landing's #00ff41 for UI legibility */
  --nx-ok-dim: rgba(0, 224, 90, 0.14);
  --nx-info: #4da3ff;
  --nx-info-dim: rgba(77, 163, 255, 0.14);

  /* ---- Text ---- */
  --nx-text: #f5f6f7;        /* primary body text (near-white, softened vs pure #fff) */
  --nx-text-strong: #ffffff; /* headings / emphasis */
  --nx-text-muted: #a0a0a0;  /* secondary */
  --nx-text-dim: #6b6b6b;    /* tertiary / disabled */

  /* ---- Typography families (loaded in typography.css / task-003) ---- */
  --nx-font-display: "Orbitron", "Space Grotesk", system-ui, sans-serif;
  --nx-font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nx-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;

  /* ---- Type scale ---- */
  --nx-fs-display: clamp(1.9rem, 3.2vw, 2.6rem);
  --nx-fs-h1: 1.6rem;
  --nx-fs-h2: 1.2rem;
  --nx-fs-h3: 1.02rem;
  --nx-fs-body: 0.95rem;
  --nx-fs-sm: 0.85rem;
  --nx-fs-label: 0.75rem;
  --nx-fs-micro: 0.68rem;

  /* ---- Spacing scale (4px base) ---- */
  --nx-space-1: 0.25rem;
  --nx-space-2: 0.5rem;
  --nx-space-3: 0.75rem;
  --nx-space-4: 1rem;
  --nx-space-5: 1.5rem;
  --nx-space-6: 2rem;
  --nx-space-7: 3rem;

  /* ---- Radius ---- */
  --nx-radius-sm: 4px;
  --nx-radius: 8px;
  --nx-radius-lg: 12px;
  --nx-radius-pill: 999px;

  /* ---- Elevation / effects (glow reserved for active/primary/high-value) ---- */
  --nx-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --nx-shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
  --nx-glow-gold: 0 0 0 1px var(--nx-border-gold), 0 0 18px rgba(255, 184, 0, 0.18);
  --nx-ring: 0 0 0 2px var(--nx-bg), 0 0 0 4px var(--nx-gold); /* keyboard focus */

  /* ---- Layout ---- */
  --nx-sidebar-w: 248px;
  --nx-sidebar-collapsed-w: 68px;
  --nx-topbar-h: 60px;
  --nx-workspace-max: 1200px;

  /* ---- Motion ---- */
  --nx-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nx-dur: 160ms;

  /* =====================================================================
   * Legacy compatibility aliases
   * Existing views/application.css reference these names. They now resolve
   * to NEXORA tokens so the whole app reskins gold/dark in one place.
   * New code should prefer the --nx-* tokens above.
   * ===================================================================== */
  --bg: var(--nx-bg);
  --bg-elevated: var(--nx-panel);      /* legacy panels/inputs read as NEXORA panels */
  --line: var(--nx-border);
  --text: var(--nx-text);
  --muted: var(--nx-text-muted);
  --accent: var(--nx-gold);            /* retires teal as the primary accent */
  --accent-dim: var(--nx-border-gold);
  --ink: var(--nx-text);               /* was undefined; used by .criticality-badge */
  --panel: var(--nx-panel);            /* was undefined; used by .criticality-badge */
}

/* Respect reduced-motion for token-driven transitions/effects. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --nx-dur: 0ms;
  }
}
