/*
 * Noekron design tokens — the single source of brand primitives for every
 * platform overlay (Dex, Gitea, Grafana, ...). Overlay stylesheets consume
 * these variables and must not redeclare raw hex values.
 *
 * Every ramp is mixed from one anchor towards the canvas, white or black, so each
 * step is a fixed distance from a named colour. Anchors are the design card's five
 * swatches; derive.py next to this file asserts the gates each ramp must clear.
 */

:root {
  /* Brand blue — the official mark fill (#2873C9), extended into a ramp.
     The anchor is a FILL: on the canvas it is 3.66:1 and fails AA as text,
     so text uses brand-400 and buttons fill with brand-600. */
  --nk-brand-100: #dfeaf7;
  --nk-brand-300: #c3d8f0;
  --nk-brand-400: #9ec0e7;
  --nk-brand-500: #2873c9;
  --nk-brand-600: #20589a;
  --nk-brand-700: #173e6b;
  --nk-brand-900: #122e4f;

  /* Navy — the environment the system sits inside. Anchored on the design's
     Secondary #0C1A2C, which is the canvas; 900 is darkest, 400 is a hover
     border. Monotonic in luminance, so no step inverts against its neighbour. */
  --nk-ink-900: #0c1a2c;
  --nk-ink-850: #132132;
  --nk-ink-800: #1b2738;
  --nk-ink-700: #293545;
  --nk-ink-600: #384251;
  --nk-ink-500: #4b5461;
  --nk-ink-400: #636a76;

  /* Tertiary — raised structure, depth layers, inactive controls. Anchored on
     the design's Tertiary #233B53; 800 is the step the theme raises surfaces to. */
  --nk-ter-900: #16293e;
  --nk-ter-800: #1c3147;
  --nk-ter-700: #233b53;
  --nk-ter-600: #374c62;
  --nk-ter-500: #4a5d71;
  --nk-ter-400: #657485;

  /* Fog — foreground ramp, derived from the design's Text #FEF9F9 along the
     navy axis. fog-700 is the floor and clears 4.5:1 on the canvas, the panel
     and the inset; ter-700 is the worst case at 3.71:1 (ter-800 is 4.27:1), so
     a muted label on a tertiary block needs fog-500. */
  --nk-fog-100: #fef9f9;
  --nk-fog-300: #d2d1d4;
  --nk-fog-500: #acadb3;
  --nk-fog-700: #8f929b;
  --nk-fog-900: #727882;

  /* Accent — attention, live pulses, interrupt states. Anchored on the design's
     Accent #E8587F. Error is a USE of the accent, not a separate hue, so the
     danger aliases resolve through this ramp rather than restating the hex. */
  --nk-accent-300: #f3a5ba;
  --nk-accent-400: #ef8aa5;
  --nk-accent-500: #ec7393;
  --nk-accent-600: #e8587f;
  --nk-accent-700: #b54563;
  --nk-accent-900: #411924;

  --nk-danger-500: var(--nk-accent-600);
  --nk-danger-900: var(--nk-accent-900);
  --nk-success-500: #34d399;
  --nk-success-900: #06301f;

  /* Semantic aliases (portal, DESIGN.md colors). The first six match the Dex
     theme's :root; the washes are alpha of a ramp step, on-primary the one literal. */
  --nk-canvas: var(--nk-ink-900);
  --nk-surface: var(--nk-ink-850);
  --nk-surface-raised: var(--nk-ter-800);
  --nk-surface-inset: var(--nk-ink-800);
  --nk-border: var(--nk-ink-600);
  --nk-border-strong: var(--nk-ink-500);
  --nk-accent-line: rgb(232 88 127 / 35%);
  --nk-accent-ring: rgb(232 88 127 / 18%);
  --nk-brand-wash-12: rgb(40 115 201 / 12%);
  --nk-brand-wash-18: rgb(40 115 201 / 18%);
  --nk-row-selected: rgb(18 46 79 / 55%);
  --nk-scrim: rgb(12 26 44 / 72%);
  --nk-danger-fill: var(--nk-accent-700);
  --nk-on-primary: #ffffff;

  --nk-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --nk-font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono",
    "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;

  /* Scale contrast is deliberate: micro labels sit far below the display size. */
  --nk-text-micro: 0.6875rem;
  --nk-text-sm: 0.8125rem;
  --nk-text-base: 0.9375rem;
  --nk-text-lg: 1.0625rem;
  --nk-text-display: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);

  --nk-weight-regular: 400;
  --nk-weight-medium: 500;
  --nk-weight-semibold: 600;
  --nk-weight-bold: 700;

  --nk-tracking-micro: 0.14em;
  --nk-tracking-tight: -0.015em;
  --nk-tracking-code: 0.22em;

  --nk-space-1: 0.25rem;
  --nk-space-2: 0.5rem;
  --nk-space-3: 0.75rem;
  --nk-space-4: 1rem;
  --nk-space-5: 1.5rem;
  --nk-space-6: 2rem;
  --nk-space-7: 3rem;
  --nk-space-8: 4rem;

  --nk-radius-sm: 6px;
  --nk-radius-md: 10px;
  --nk-radius-lg: 16px;
  --nk-radius-pill: 999px;

  --nk-shadow-panel: 0 1px 0 rgb(255 255 255 / 4%) inset,
    0 24px 64px -24px rgb(0 0 0 / 80%), 0 2px 8px rgb(0 0 0 / 40%);
  --nk-shadow-raise: 0 1px 2px rgb(0 0 0 / 50%);

  /* Focus ring. The ring is the cue, not the halo: brand-600 would vanish
     against a brand-600 fill, so the 1px step is brand-300 (10.3:1 on the
     panel). The halo is a secondary bloom and measures only ~1.5:1. */
  --nk-glow-primary: 0 0 0 1px var(--nk-brand-300),
    0 0 0 4px rgb(40 115 201 / 35%);

  --nk-duration-fast: 120ms;
  --nk-duration-normal: 220ms;
  --nk-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
