/* ArxGate Dark Sovereign Design System — Core Tokens
 * Dual-theme institutional palette aligned with #04 AG Citadel Gate VI.
 */

:root {
  /* Core Surfaces (Obsidian Midnight -> Tiered Slate) */
  --arx-bg-ground: #0a1120;
  --arx-bg-shell: #070c17;
  --arx-bg-surface: #0f172a;
  --arx-bg-elevated: #141f35;
  --arx-bg-inset: #080e1c;
  --arx-bg-hover: #1a2844;
  --arx-bg-active: #203152;

  /* Hairline Seams & Control Borders */
  --arx-border-hairline: #1e2d47;
  --arx-border-control: #2c3f63;
  --arx-border-strong: #3b527d;

  /* Typography Ink Hierarchy (WCAG AA >= 4.5:1 on #0F172A / #0A1120) */
  --arx-text-primary: #f8fafc;
  --arx-text-secondary: #cbd5e1;
  --arx-text-muted: #94a3b8;
  --arx-text-subtle: #7c90ad;
  --arx-text-on-gold: #090d16;

  /* Sovereign Champagne Gold (Central Security Pillar & Primary Action Only) */
  --arx-gold: #d4af37;
  --arx-gold-hover: #e2bf4a;
  --arx-gold-active: #be9a28;
  --arx-gold-tint: rgba(212, 175, 55, 0.12);
  --arx-gold-border: rgba(212, 175, 55, 0.42);
  --arx-gold-spine: rgba(212, 175, 55, 0.24);

  /* Semantic State Colors (High-Contrast Dark Register) */
  --arx-emerald: #34d399;
  --arx-emerald-bg: rgba(16, 185, 129, 0.13);
  --arx-emerald-border: rgba(52, 211, 153, 0.36);

  --arx-amber: #fbbf24;
  --arx-amber-bg: rgba(245, 158, 11, 0.13);
  --arx-amber-border: rgba(251, 191, 36, 0.38);

  --arx-crimson: #f87171;
  --arx-crimson-solid: #dc2626;
  --arx-crimson-bg: rgba(239, 68, 68, 0.14);
  --arx-crimson-border: rgba(248, 113, 113, 0.45);

  --arx-sky: #60a5fa;
  --arx-sky-bg: rgba(59, 130, 246, 0.13);
  --arx-sky-border: rgba(96, 165, 250, 0.38);

  /* Placeholder Entity Token Palette (Structured Egress Inspector) */
  --arx-tok-hkid-fg: #fca5a5;
  --arx-tok-hkid-bg: rgba(239, 68, 68, 0.18);
  --arx-tok-hkid-bd: rgba(248, 113, 113, 0.45);

  --arx-tok-person-fg: #fcd34d;
  --arx-tok-person-bg: rgba(212, 175, 55, 0.18);
  --arx-tok-person-bd: rgba(212, 175, 55, 0.45);

  --arx-tok-corp-fg: #93c5fd;
  --arx-tok-corp-bg: rgba(59, 130, 246, 0.18);
  --arx-tok-corp-bd: rgba(96, 165, 250, 0.45);

  --arx-tok-contact-fg: #6ee7b7;
  --arx-tok-contact-bg: rgba(16, 185, 129, 0.16);
  --arx-tok-contact-bd: rgba(52, 211, 153, 0.42);

  /* Typography */
  --arx-font-sans: "IBM Plex Sans", "PingFang HK", "Noto Sans TC", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --arx-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Fixed Product UI Type Scale (14px body floor, >=11px functional floor) */
  --arx-text-xs: 12px;
  --arx-text-sm: 13px;
  --arx-text-base: 14px;
  --arx-text-md: 15px;
  --arx-text-lg: 16px;

  /* Spacing Rhythm (4px base) */
  --arx-sp-1: 4px;
  --arx-sp-2: 8px;
  --arx-sp-3: 12px;
  --arx-sp-4: 16px;
  --arx-sp-5: 20px;
  --arx-sp-6: 24px;

  /* Radii */
  --arx-radius-xs: 4px;
  --arx-radius-sm: 6px;
  --arx-radius-md: 8px;
  --arx-radius-lg: 12px;
  --arx-radius-pill: 999px;

  /* Elevation (Reserved Strictly for Floating Overlays, Never Flat Panels) */
  --arx-shadow-float: 0 12px 32px rgba(2, 6, 16, 0.55);
  --arx-shadow-modal: 0 24px 64px rgba(2, 6, 16, 0.72);

  /* Motion */
  --arx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --arx-dur-fast: 140ms;
  --arx-dur-base: 200ms;

  /* Layout Dimensions */
  --arx-topbar-h: 56px;
  --arx-spine-w: 58px;
}

/* Global Reset & Themed Browser Surfaces */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--arx-bg-ground);
  color: var(--arx-text-primary);
  font-family: var(--arx-font-sans);
  font-size: var(--arx-text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

::selection {
  background: rgba(212, 175, 55, 0.32);
  color: var(--arx-text-primary);
}

:focus-visible {
  outline: 2px solid var(--arx-gold);
  outline-offset: 2px;
}

input, textarea, select {
  caret-color: var(--arx-gold);
  font-family: inherit;
}

input[type="checkbox"] {
  accent-color: var(--arx-gold);
  cursor: pointer;
}

a {
  text-underline-offset: 3px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--arx-font-mono);
  font-variant-numeric: tabular-nums;
}

/* Subtle Themed Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--arx-border-control);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--arx-border-strong);
  border: 2px solid transparent;
  background-clip: content-box;
}

@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;
  }
}
