/* ============================================
   WebForge — Design Tokens / Custom Properties
   ============================================ */

:root {
    /* === Color Palette — Dark Theme (default) === */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #2d333b;

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-tertiary: #484f58;
    --text-inverse: #0d1117;

    /* Accent colors */
    --accent-blue: #58a6ff;
    --accent-cyan: #39d2c0;
    --accent-red: #ff6b6b;
    --accent-green: #3fb950;
    --accent-purple: #bc8cff;
    --accent-orange: #f0883e;
    --accent-yellow: #e3b341;

    /* UI colors */
    --border-color: #30363d;
    --border-color-light: #21262d;
    --divider: #30363d;

    /* Background grid */
    --grid-color: rgba(88, 166, 255, 0.04);
    --grid-size: 40px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(88, 166, 255, 0.15);
    --shadow-glow-cyan: 0 0 20px rgba(57, 210, 192, 0.15);

    /* Code / Syntax Highlighting */
    --code-bg: #0d1117;
    --code-border: #30363d;
    --code-keyword: #ff8f87;
    --code-string: #a5d6ff;
    --code-comment: #8b949e;
    --code-function: #d2a8ff;
    --code-number: #79c0ff;
    --code-tag: #7ee787;
    --code-attribute: #79c0ff;
    --code-operator: #ff7b72;
    --code-property: #79c0ff;
    --code-variable: #ffa657;
    --code-plain: #e6edf3;
    --code-line-number: #484f58;

    /* Typography */
    --font-heading: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-md: 1.125rem;   /* 18px */
    --font-size-lg: 1.25rem;    /* 20px */
    --font-size-xl: 1.5rem;     /* 24px */
    --font-size-2xl: 2rem;      /* 32px */
    --font-size-3xl: 2.5rem;    /* 40px */
    --font-size-4xl: 3rem;      /* 48px */
    --font-size-5xl: 3.5rem;    /* 56px */

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.2;
    --line-height-snug: 1.4;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;

    /* Spacing */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* Layout */
    --header-height: 60px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 0px;
    --content-max-width: 900px;
    --content-padding: var(--space-8);
    --page-padding: var(--space-6);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-theme: 300ms ease;

    /* Z-index layers */
    --z-grid: -1;
    --z-content: 1;
    --z-sidebar: 350;
    --z-header: 200;
    --z-overlay: 300;
    --z-drawer: 380;
    --z-modal: 400;
    --z-tooltip: 500;

    /* Breakpoints (for reference, used in media queries) */
    /* sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px */
}

/* Page load fade-in */
body {
    opacity: 0;
    animation: page-fade-in 200ms ease forwards;
}

@keyframes page-fade-in {
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body { animation: none; opacity: 1; }
}

/* ============================================
   Light Theme Override
   ============================================ */
[data-theme="light"] {
    /* Off-white / very light gray base — easy on the eyes */
    --bg-primary: #f0f2f5;
    --bg-secondary: #e4e8ec;
    --bg-tertiary: #d8dce2;
    --bg-elevated: #f6f8fa;

    /* Stronger text contrast for readability */
    --text-primary: #1a1e24;
    --text-secondary: #42474e;
    --text-muted: #768390;
    --text-inverse: #f0f2f5;

    --border-color: #c8ced6;
    --border-color-light: #d8dce2;
    --divider: #c8ced6;

    --grid-color: rgba(0, 0, 0, 0.04);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-glow-blue: 0 0 20px rgba(56, 132, 244, 0.12);
    --shadow-glow-cyan: 0 0 20px rgba(0, 180, 160, 0.12);

    /* Accent colors — slightly deeper for light bg contrast */
    --accent-blue: #2563eb;
    --accent-cyan: #00b4a0;
    --accent-green: #1a7f37;
    --accent-purple: #6f42c1;
    --accent-red: #cf222e;
    --accent-orange: #bc4c00;

    /* Code stays dark in both themes */
    --code-bg: #161b22;
    --code-border: #30363d;
}