/* ==========================================================================
   DESIGN SYSTEM TOKENS — "Security Console" theme
   Dark-first; light theme via [data-theme="light"]
   ========================================================================== */

:root {
    /* Color Palette (dark default) */
    --color-bg: #070b11;
    --color-bg-alt: #0b1119;
    --color-surface: #0f1620;
    --color-surface-2: #141d2a;
    --color-text: #e6edf3;
    --color-text-light: #8b9bb0;
    --color-text-faint: #5b6b80;
    --color-primary: #2ee6a8;          /* signal teal */
    --color-primary-dark: #1fc48d;
    --color-primary-soft: rgba(46, 230, 168, 0.12);
    --color-accent: #4cc9f0;           /* scan cyan */
    --color-accent-soft: rgba(76, 201, 240, 0.12);
    --color-danger: #ff6b6b;
    --color-danger-soft: rgba(255, 107, 107, 0.12);
    --color-warn: #f5a524;
    --color-border: #1c2633;
    --color-border-strong: #2a3748;
    --color-on-primary: #04130d;
    --color-header-bg: rgba(7, 11, 17, 0.8);
    --grid-line: rgba(76, 201, 240, 0.05);
    --glow: 0 0 0 1px rgba(46, 230, 168, 0.25), 0 8px 40px -8px rgba(46, 230, 168, 0.35);

    /* Terminal (always dark, both themes) */
    --term-bg: #0a0f16;
    --term-bar: #121a25;
    --term-border: #223042;
    --term-text: #e6edf3;
    --term-muted: #7d8ca0;
    --term-green: #56d364;
    --term-blue: #79c0ff;
    --term-orange: #f0883e;
    --term-red: #ff7b72;

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Font Sizes */
    --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;
    --text-5xl: 3rem;

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

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.6);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

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

    color-scheme: dark;
}

:root[data-theme="light"] {
    --color-bg: #f6f8fb;
    --color-bg-alt: #eef2f7;
    --color-surface: #ffffff;
    --color-surface-2: #f3f6fa;
    --color-text: #0d1622;
    --color-text-light: #4a5a6e;
    --color-text-faint: #7a8899;
    --color-primary: #0a9b6e;
    --color-primary-dark: #077d58;
    --color-primary-soft: rgba(10, 155, 110, 0.1);
    --color-accent: #0a7fb0;
    --color-accent-soft: rgba(10, 127, 176, 0.1);
    --color-danger: #d43d3d;
    --color-danger-soft: rgba(212, 61, 61, 0.1);
    --color-warn: #b7740a;
    --color-border: #dde4ec;
    --color-border-strong: #c6d0dc;
    --color-on-primary: #ffffff;
    --color-header-bg: rgba(246, 248, 251, 0.85);
    --grid-line: rgba(10, 127, 176, 0.06);
    --glow: 0 0 0 1px rgba(10, 155, 110, 0.25), 0 8px 30px -10px rgba(10, 155, 110, 0.3);
    --shadow-sm: 0 1px 2px 0 rgba(13, 22, 34, 0.06);
    --shadow-md: 0 6px 16px -4px rgba(13, 22, 34, 0.1);
    --shadow-lg: 0 20px 40px -12px rgba(13, 22, 34, 0.18);
    color-scheme: light;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h2 {
    font-size: clamp(1.875rem, 3.5vw, 2.5rem);
    font-weight: 700;
}

h3 {
    font-size: var(--text-xl);
}

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

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

a:hover {
    color: var(--color-accent);
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
