/* ============================================================
   BASE.CSS — Design tokens, reset, and foundation
   Multi-Cloud Architecture Explorer
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  /* Background & surface */
  --bg-base:       #0f1419;
  --bg-surface:    #161d27;
  --bg-raised:     #1e2836;
  --bg-overlay:    #243040;
  --bg-hover:      #2a3a4e;

  /* Borders */
  --border-subtle:  rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong:  rgba(255,255,255,0.18);

  /* Text */
  --text-primary:   #e8edf2;
  --text-secondary: #8fa3b8;
  --text-muted:     #556a80;
  --text-inverse:   #0f1419;

  /* CSP Brand Colors */
  --color-aviatrix:  #00b4d8;
  --color-aws:       #ff9500;
  --color-azure:     #0078d4;
  --color-gcp:       #34a853;
  --color-firewall:  #e74c3c;
  --color-colo:      #9b59b6;
  --color-mtt:       #f1c40f;
  --color-edge:      #e056a0;
  --color-ngcn:      #7c5cfc;

  /* Semantic */
  --color-success: #27ae60;
  --color-warning: #f39c12;
  --color-error:   #e74c3c;
  --color-info:    #3498db;

  /* Tinted surfaces */
  --aws-surface:    rgba(255,149,0,0.08);
  --azure-surface:  rgba(0,120,212,0.08);
  --gcp-surface:    rgba(52,168,83,0.08);
  --avi-surface:    rgba(0,180,216,0.08);
  --colo-surface:   rgba(155,89,182,0.08);
  --mtt-surface:    rgba(241,196,15,0.08);
  --fw-surface:     rgba(231,76,60,0.08);
  --edge-surface:   rgba(224,86,160,0.08);
  --ngcn-surface:   rgba(124,92,252,0.08);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale (fluid) */
  --text-xs:   clamp(10px, 0.7vw, 11px);
  --text-sm:   clamp(12px, 0.85vw, 13px);
  --text-base: clamp(13px, 0.9vw, 14px);
  --text-md:   clamp(14px, 1vw, 16px);
  --text-lg:   clamp(16px, 1.2vw, 18px);
  --text-xl:   clamp(18px, 1.5vw, 22px);
  --text-2xl:  clamp(22px, 2vw, 28px);
  --text-3xl:  clamp(28px, 2.5vw, 36px);

  /* Spacing (4px base) */
  --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;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  /* Layout */
  --sidebar-w: 220px;
  --header-h:  52px;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-base:       #f8f9fb;
  --bg-surface:    #ffffff;
  --bg-raised:     #f0f2f5;
  --bg-overlay:    #e8ecf0;
  --bg-hover:      #dde3ea;
  --border-subtle:  rgba(0,0,0,0.08);
  --border-default: rgba(0,0,0,0.12);
  --border-strong:  rgba(0,0,0,0.20);
  --text-primary:   #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted:     #94a3b8;
  --text-inverse:   #f8f9fb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --aws-surface:    rgba(255,149,0,0.06);
  --azure-surface:  rgba(0,120,212,0.06);
  --gcp-surface:    rgba(52,168,83,0.06);
  --avi-surface:    rgba(0,180,216,0.06);
  --colo-surface:   rgba(155,89,182,0.06);
  --mtt-surface:    rgba(241,196,15,0.06);
  --fw-surface:     rgba(231,76,60,0.06);
  --edge-surface:   rgba(224,86,160,0.06);
  --ngcn-surface:   rgba(124,92,252,0.06);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  height: 100vh;
}

a { color: var(--color-aviatrix); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; }

img, svg { display: block; max-width: 100%; }

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ── Utility ───────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0,0,0,0);
  overflow: hidden;
  white-space: nowrap;
}

.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

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