/* ==========================================================================
   FDT Design System · Colors + Type
   Frontier Defense Technology — colors, semantic vars, glow scale, spacing,
   radii, motion, and FDT-specific type classes. Token values mirror
   `static/fdt-tokens.json`. Dark-native, mono-accent, no drop shadows.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   FONTS — self-hosted Latin subsets served from /fonts/. The design brief
   mandates self-hosting (defense endpoints cannot assume external
   resolution). font-display: swap keeps text readable while the WOFF2
   payload fetches.
   --------------------------------------------------------------------------- */

@font-face { font-family: "Inter"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/inter-v20-latin-300.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/inter-v20-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/inter-v20-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-v20-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/inter-v20-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/inter-v20-latin-800.woff2") format("woff2"); }

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-v13-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-v13-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-v13-latin-700.woff2") format("woff2"); }

@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/jetbrains-mono-v24-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/jetbrains-mono-v24-latin-500.woff2") format("woff2"); }

/* ---------------------------------------------------------------------------
   TOKENS
   FDT named tokens are the source of truth. WebAwesome `--wa-*` aliases ride
   on top so wa-* components theme without per-component overrides.
   Convention: `--wa-*` = consumed by WebAwesome components.
                `--fdt-*` = FDT extensions (glow, classification, textures).
   --------------------------------------------------------------------------- */

:root,
.wa-dark {
  /* ===== COLOR — base ===== */
  --navy-900: #0A1220;   /* outer canvas */
  --navy-800: #0F1A2E;   /* elevated surfaces, panels, cards */
  --navy-700: #16243D;   /* input fields, secondary panels */
  --navy-600: #1E3050;   /* borders + dividers at rest */
  --divider:  #1F3352;   /* page + section dividers */

  --steel-500: #3A4A66;  /* hairlines, inactive indicators */
  --steel-400: #5A6D8A;  /* metadata only — NOT body text (3.3:1) */
  --steel-300: #8A9BB4;  /* body-text-safe muted (6.5:1) */

  --fog-200: #C5D1E2;    /* body text on dark */
  --fog-100: #E8EEF7;    /* primary headings */
  --white:   #FFFFFF;    /* critical emphasis only */

  /* ===== COLOR — accent (electric blue, mono-accent) ===== */
  --electric-700: #0D3A8A;
  --electric-600: #1456C7;  /* pressed */
  --electric-500: #1D6EF5;  /* PRIMARY — fills + large text only (4.1:1) */
  --electric-400: #4A8DFF;  /* AA body links (5.8:1) */
  --electric-300: #7BA9FF;  /* AAA emphasis (7.9:1), glow peak */

  /* ===== COLOR — semantic (APP-6D affiliation) ===== */
  --friendly:    #1D6EF5;   /* same hex as electric-500; meaning context-bound */
  --hostile:     #E0322C;   /* fills + large text only (4.2:1) */
  --hostile-400: #EE5050;   /* AA body text */
  --neutral:     #2FA85A;   /* success, friendly-neutral */
  --caution:     #F2B535;   /* warning, advisory, classification */
  --unknown:     #8A9BB4;

  /* ===== GLOW — the signature atmospheric element ===== */
  /* Soft, monochromatic, accent-hue only. Functional — never decorative.
     Replaces the entire shadow vocabulary. */
  --fdt-glow-xs: 0 0  8px  2px rgba(29, 110, 245, 0.20);  /* hover, focus */
  --fdt-glow-sm: 0 0 16px  2px rgba(29, 110, 245, 0.30);  /* active CTA, selected nav */
  --fdt-glow-md: 0 0 32px  4px rgba(29, 110, 245, 0.35);  /* acquire, hero CTA */
  --fdt-glow-lg: 0 0 64px  8px rgba(29, 110, 245, 0.40);  /* hero ambient */
  --fdt-glow-xl: 0 0 128px 16px rgba(123, 169, 255, 0.35);/* mission-start moments */

  --fdt-grid-overlay-opacity: 0.04;
  --fdt-radar-sweep-opacity:  0.25;

  --fdt-classification-controlled: var(--electric-500);
  --fdt-classification-sensitive:  var(--caution);

  /* ===== TYPE — families ===== */
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter Display", "Inter", -apple-system, sans-serif;
  --font-wordmark:"Barlow Condensed", "Oswald", "Arial Narrow", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ===== TYPE — weights ===== */
  --weight-normal:     400;
  --weight-medium:     500;
  --weight-action:     600;  /* buttons, interactive labels */
  --weight-heading:    700;
  --weight-emphasized: 800;  /* display */

  /* ===== TYPE — sizes ===== */
  --size-xs:  11px;  /* micro, eyebrow, captions */
  --size-s:   13px;  /* mono data */
  --size-m:   14px;  /* body */
  --size-l:   16px;  /* body L */
  --size-xl:  22px;  /* H2 */
  --size-2xl: 28px;  /* H1 */
  --size-3xl: 40px;  /* Display M */
  --size-4xl: 56px;  /* Display L */
  --size-5xl: 72px;  /* Display XL */

  /* ===== SPACING — 4px base ===== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ===== RADIUS — 8px ceiling, 4px is the operator UI default ===== */
  --radius-sm: 2px;  /* tags, data chips */
  --radius-md: 4px;  /* operator UI ceiling */
  --radius-lg: 8px;  /* marketing surfaces only, sparingly */

  /* ===== MOTION ===== */
  --duration-ui:    200ms;
  --duration-panel: 500ms;
  --duration-sweep: 2000ms;
  --easing-ui:      cubic-bezier(0.2, 0.8, 0.2, 1);
  --easing-linear:  linear;
  /* Alias used by the bundled UI-kit examples. Same curve as --easing-ui. */
  --ease-fdt:       var(--easing-ui);

  /* ===== BREAKPOINTS (custom property mirrors only) ===== */
  --fdt-breakpoint-sm: 640px;
  --fdt-breakpoint-md: 1024px;
  --fdt-breakpoint-lg: 1440px;
  --fdt-breakpoint-xl: 1920px;

  /* ============================================================
     WEBAWESOME ALIASES — wa-* components inherit FDT tokens
     Note: WebAwesome's neutral scale is INVERTED (100 = white).
     ============================================================ */

  /* Brand */
  --wa-color-brand-50: var(--electric-300);
  --wa-color-brand-40: var(--electric-400);
  --wa-color-brand-30: var(--electric-500);
  --wa-color-brand-20: var(--electric-600);
  --wa-color-brand-10: var(--electric-700);

  /* Neutral */
  --wa-color-neutral-0:   var(--navy-900);
  --wa-color-neutral-5:   var(--navy-800);
  --wa-color-neutral-10:  var(--navy-700);
  --wa-color-neutral-15:  var(--navy-600);
  --wa-color-neutral-25:  var(--steel-500);
  --wa-color-neutral-40:  var(--steel-400);
  --wa-color-neutral-60:  var(--steel-300);
  --wa-color-neutral-85:  var(--fog-200);
  --wa-color-neutral-95:  var(--fog-100);
  --wa-color-neutral-100: var(--white);

  /* Semantic */
  --wa-color-success-40: var(--neutral);
  --wa-color-warning-40: var(--caution);
  --wa-color-danger-40:  var(--hostile-400);
  --wa-color-danger-30:  var(--hostile);

  /* Surfaces (elevation-aware, dark) */
  --wa-color-surface-raised:  var(--navy-700);
  --wa-color-surface-default: var(--navy-800);
  --wa-color-surface-lowered: var(--navy-900);

  /* Text */
  --wa-color-text-normal:   var(--fog-100);
  --wa-color-text-quiet:    var(--fog-200);
  --wa-color-text-subtle:   var(--steel-300);
  --wa-color-text-disabled: var(--steel-400);
  --wa-color-text-link:     var(--electric-400);
  --wa-color-text-error:    var(--hostile-400);

  /* Focus (load-bearing two-layer ring) */
  --wa-focus-ring-color: var(--electric-500);
  --wa-focus-ring-width: 2px;
  --wa-focus-ring-offset: 2px;
  --wa-focus-ring: var(--wa-focus-ring-width) solid var(--wa-focus-ring-color);
  --fdt-focus-glow: var(--fdt-glow-sm);

  /* Type */
  --wa-font-family-body:     var(--font-body);
  --wa-font-family-heading:  var(--font-body);   /* heading face = Inter, NOT Barlow */
  --wa-font-family-code:     var(--font-mono);
  --wa-font-family-longform: var(--font-body);
  --wa-font-weight-normal:     var(--weight-normal);
  --wa-font-weight-action:     var(--weight-action);
  --wa-font-weight-heading:    var(--weight-heading);
  --wa-font-weight-emphasized: var(--weight-emphasized);
}

/* ---------------------------------------------------------------------------
   BASE — applies dark canvas, system font stack, render-quality defaults
   --------------------------------------------------------------------------- */

html, body {
  background: var(--navy-900);
  color: var(--fog-200);
  font-family: var(--font-body);
  font-size: var(--size-m);
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--electric-500); color: var(--white); }

/* ---------------------------------------------------------------------------
   SEMANTIC TYPE — tag-level defaults map onto the type scale
   --------------------------------------------------------------------------- */

.fdt-display-xl,
h1.fdt-display {
  font-family: var(--font-display);
  font-weight: var(--weight-emphasized);
  font-size: var(--size-5xl);
  line-height: 76px;
  letter-spacing: -0.02em;
  color: var(--fog-100);
  text-wrap: balance;
}

.fdt-display-l {
  font-family: var(--font-display);
  font-weight: var(--weight-emphasized);
  font-size: var(--size-4xl);
  line-height: 60px;
  letter-spacing: -0.015em;
  color: var(--fog-100);
  text-wrap: balance;
}

.fdt-display-m {
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: var(--size-3xl);
  line-height: 44px;
  letter-spacing: -0.01em;
  color: var(--fog-100);
}

h1, .fdt-h1 {
  font-family: var(--font-body);
  font-weight: var(--weight-heading);
  font-size: var(--size-2xl);
  line-height: 36px;
  color: var(--fog-100);
  margin: 0;
}

h2, .fdt-h2 {
  font-family: var(--font-body);
  font-weight: var(--weight-action);
  font-size: var(--size-xl);
  line-height: 30px;
  color: var(--fog-100);
  margin: 0;
}

h3, .fdt-h3 {
  font-family: var(--font-body);
  font-weight: var(--weight-action);
  font-size: 18px;
  line-height: 26px;
  color: var(--fog-100);
  margin: 0;
}

p, .fdt-body {
  font-family: var(--font-body);
  font-weight: var(--weight-normal);
  font-size: var(--size-m);
  line-height: 22px;
  color: var(--fog-200);
  text-wrap: pretty;
}

.fdt-body-l {
  font-size: var(--size-l);
  line-height: 24px;
}

/* Wordmarks — Barlow Condensed, UC, wide-tracked. Identity + tactical labels. */
.fdt-wordmark,
.fdt-wordmark-xl,
.fdt-wordmark-l,
.fdt-wordmark-s {
  font-family: var(--font-wordmark);
  font-weight: var(--weight-heading);
  text-transform: uppercase;
  color: var(--fog-100);
}
.fdt-wordmark-xl { font-size: var(--size-4xl); line-height: 60px; letter-spacing: 0.01em; }
.fdt-wordmark-l  { font-size: 24px;            line-height: 28px; letter-spacing: 0.04em; }
.fdt-wordmark    { font-size: 16px;            line-height: 20px; letter-spacing: 0.06em; }
.fdt-wordmark-s  { font-size: 14px;            line-height: 18px; letter-spacing: 0.08em; }

/* Eyebrow — the house move sits above every Display heading. */
.fdt-eyebrow {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--size-xs);
  line-height: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--electric-500);
}

/* Micro — labels, captions, footer metadata. */
.fdt-micro {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--size-xs);
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel-300);
}

/* Mono / data — tabular figures, callsigns, coords. Ligatures DISABLED. */
code, pre, kbd, samp, .fdt-data, .fdt-data-l {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0, "calt" 0, "tnum" 1;
}
.fdt-data {
  font-weight: var(--weight-normal);
  font-size: var(--size-s);
  line-height: 18px;
  color: var(--fog-200);
}
.fdt-data-l {
  font-weight: var(--weight-medium);
  font-size: 15px;
  line-height: 22px;
  color: var(--fog-100);
}

/* Inter tabular for numeric runs in body type. */
.fdt-tnum { font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   FOCUS — two-layer focus ring is load-bearing. NEVER remove the border.
   --------------------------------------------------------------------------- */

:focus-visible {
  outline: var(--wa-focus-ring);
  outline-offset: var(--wa-focus-ring-offset);
  box-shadow: var(--fdt-focus-glow);
}
