/* ============================================================
   base.css — Reset, variables, typography, global elements
   ============================================================ */

/* ─── CSS Variables / Design Tokens ────────────────────────── */
:root {
    /* Colors — neutral, professional palette */
    --color-bg: #fafafa;
    --color-bg-alt: #f4f4f5;
    --color-bg-card: #ffffff;
    --color-bg-sidebar: #18181b;
    --color-bg-header: #ffffff;

    --color-border: #e4e4e7;
    --color-border-light: #f0f0f2;
    --color-border-dark: #d4d4d8;

    --color-text: #18181b;
    --color-text-secondary: #52525b;
    --color-text-muted: #a1a1aa;
    --color-text-inverse: #fafafa;

    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-primary-text: #ffffff;

    --color-success: #16a34a;
    --color-success-light: #f0fdf4;
    --color-warning: #d97706;
    --color-warning-light: #fffbeb;
    --color-error: #dc2626;
    --color-error-light: #fef2f2;
    --color-info: #2563eb;
    --color-info-light: #eff6ff;

    /* Severity colors for heatmap */
    --color-severity-critical: #991b1b;
    --color-severity-high: #dc2626;
    --color-severity-medium: #d97706;
    --color-severity-low: #ca8a04;
    --color-severity-minimal: #65a30d;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Borders & Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    /* Layout */
    --header-height: 56px;
    --sidebar-width: 240px;
    --content-max-width: 1200px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

/* ─── 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);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--color-text);
}

h1 { font-size: var(--text-3xl); font-weight: var(--font-bold); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--color-primary-hover);
}

small { font-size: var(--text-sm); }
strong { font-weight: var(--font-semibold); }
code { font-family: var(--font-mono); font-size: 0.9em; }

/* ─── Lists ────────────────────────────────────────────────── */
ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-1); }

/* ─── Images ───────────────────────────────────────────────── */
img { max-width: 100%; height: auto; display: block; }

/* ─── Selection ────────────────────────────────────────────── */
::selection {
    background-color: var(--color-primary);
    color: var(--color-primary-text);
}
