/* ═══════════════════════════════════════════════════════════════
   OBSIDIAN v1.1 — Design System Foundation
   NovaTech Operations Intelligence Platform
   All values are canonical. No magic numbers anywhere else.
═══════════════════════════════════════════════════════════════ */

/* ── 1. Custom Properties (Token Definitions) ── */
:root {
  /* ── Backgrounds ── */
  --bg:             #09090b;
  --surface:        #111113;
  --surface-alt:    #18181b;

  /* ── Borders ── */
  --border:         #27272a;
  --border-active:  #3f3f46;

  /* ── Text Hierarchy ── */
  --text:           #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;
  --text-muted-sm:  #8a8a93;   /* WCAG AA for 9-10px text */

  /* ── Primary Accent (Cyan — systems/automation) ── */
  --accent:         #22d3ee;
  --accent-muted:   rgba(34, 211, 238, 0.10);
  --accent-glow:    rgba(34, 211, 238, 0.06);
  --accent-border:  rgba(34, 211, 238, 0.25);

  /* ── Secondary Accents (per-module, applied via data attributes) ── */
  --rose:           #fb7185;
  --rose-muted:     rgba(251, 113, 133, 0.10);
  --rose-border:    rgba(251, 113, 133, 0.25);
  --emerald:        #4ade80;
  --emerald-muted:  rgba(74, 222, 128, 0.10);
  --emerald-border: rgba(74, 222, 128, 0.25);
  --amber:          #fbbf24;
  --amber-muted:    rgba(251, 191, 36, 0.10);
  --amber-border:   rgba(251, 191, 36, 0.25);
  --violet:         #a78bfa;
  --violet-muted:   rgba(167, 139, 250, 0.10);

  /* ── Semantic ── */
  --success:        #4ade80;
  --success-muted:  rgba(74, 222, 128, 0.12);
  --warning:        #fbbf24;
  --warning-muted:  rgba(251, 191, 36, 0.12);
  --error:          #ef4444;
  --error-muted:    rgba(239, 68, 68, 0.12);
  --error-border:   rgba(239, 68, 68, 0.25);

  /* ── Typography ── */
  --font-sans:      "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono:      "JetBrains Mono", "SF Mono", "Fira Code", monospace;

  /* ── Type Scale ── */
  --text-xs:        9px;
  --text-sm:        11px;
  --text-base:      13px;
  --text-lg:        16px;
  --text-xl:        20px;
  --text-2xl:       24px;
  --text-3xl:       32px;
  --text-4xl:       40px;
  --text-hero:      48px;

  /* ── Spacing Scale ── */
  --space-1:        4px;
  --space-2:        8px;
  --space-3:        12px;
  --space-4:        16px;
  --space-5:        20px;
  --space-6:        24px;
  --space-8:        32px;
  --space-10:       40px;
  --space-12:       48px;

  /* ── Radii ── */
  --radius-sm:      4px;
  --radius-md:      6px;
  --radius-lg:      8px;
  --radius-xl:      12px;

  /* ── Shadows ── */
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow:    0 0 20px var(--accent-glow);

  /* ── Transitions ── */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast:  150ms;
  --duration-base:  250ms;
  --duration-slow:  400ms;

  /* ── Layout ── */
  --sidebar-width:  280px;
  --panel-width:    380px;
  --header-height:  60px;
  --command-strip-height: 52px;
  --nav-height:     44px;
}

/* ── 2. Base Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── 3. Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted-sm);
}

.metric-value {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── 4. Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ── 5. Focus & Selection ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent-muted);
  color: var(--text);
}

/* ── 6. Keyframes (all 13 required) ── */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50%       { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow); }
}

@keyframes flowParticle {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spinePulse {
  0%   { background: var(--accent-muted); }
  50%  { background: var(--accent); }
  100% { background: var(--accent-muted); }
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes tick {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-2px); }
}

@keyframes pulseBorder {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
