/* ============================================================
   CheesCoach Design System — Variables & Tokens
   Dark premium chess theme
   ============================================================ */

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

:root {
    /* === Backgrounds === */
    --bg-deepest: #060a13;
    --bg-primary: #0c1220;
    --bg-secondary: #141d2f;
    --bg-card: #182036;
    --bg-card-hover: #1e2a48;
    --bg-glass: rgba(18, 28, 50, 0.6);
    --bg-glass-hover: rgba(24, 36, 64, 0.7);

    /* === Accent — Chess Blue === */
    --accent: #4f8ff7;
    --accent-bright: #6ea8ff;
    --accent-dim: #2563eb;
    --accent-glow: rgba(79, 143, 247, 0.15);
    --accent-glow-strong: rgba(79, 143, 247, 0.3);

    /* === Gold — Chess Premium === */
    --gold: #d4a843;
    --gold-bright: #e8c46a;
    --gold-dim: #b8922e;
    --gold-glow: rgba(212, 168, 67, 0.15);
    --gold-glow-strong: rgba(212, 168, 67, 0.3);

    /* === Semantic === */
    --success: #34d399;
    --success-dim: #059669;
    --warning: #fbbf24;
    --warning-dim: #d97706;
    --error: #f87171;
    --error-dim: #dc2626;
    --info: #60a5fa;

    /* === Provider Accents === */
    --gemini-accent: #4285f4;
    --openai-accent: #10b981;
    --claude-accent: #f59e0b;
    --deepseek-accent: #818cf8;

    /* === Text === */
    --text-primary: #edf2f7;
    --text-secondary: #8b9dc3;
    --text-muted: #5a6d8a;
    --text-inverse: #0c1220;

    /* === Borders === */
    --border: rgba(79, 143, 247, 0.12);
    --border-hover: rgba(79, 143, 247, 0.25);
    --border-strong: rgba(79, 143, 247, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.06);

    /* === Chess Board === */
    --board-light: #f0d9b5;
    --board-dark: #b58863;
    --board-highlight: rgba(255, 255, 0, 0.4);
    --board-correct: rgba(52, 211, 153, 0.5);
    --board-incorrect: rgba(248, 113, 113, 0.5);

    /* === Spacing Scale (4px base) === */
    --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 */

    /* === Border Radius === */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* === Shadows === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 40px rgba(79, 143, 247, 0.15);
    --shadow-glow-gold: 0 0 40px rgba(212, 168, 67, 0.12);
    --shadow-glow-blue-strong: 0 0 60px rgba(79, 143, 247, 0.25);

    /* === Transitions === */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* === Z-Index Scale === */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-tooltip: 500;

    /* === Typography === */
    --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 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;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;

    --leading-tight: 1.15;
    --leading-snug: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* === Container === */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;
    --container-2xl: 1400px;
}

/* === Base Styles === */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

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

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

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

::selection {
    background: var(--accent-glow-strong);
    color: var(--text-primary);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

/* === Background Pattern — Chess Grid === */
.chess-pattern-bg {
    position: relative;
}

.chess-pattern-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(79, 143, 247, 0.02) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(79, 143, 247, 0.02) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(79, 143, 247, 0.02) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(79, 143, 247, 0.02) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
    pointer-events: none;
    z-index: 0;
}

/* === Gradient Backgrounds === */
.gradient-hero {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(79, 143, 247, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(212, 168, 67, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

.gradient-section {
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(79, 143, 247, 0.06) 0%, transparent 60%),
        var(--bg-primary);
}

/* === Responsive Typography === */
@media (max-width: 768px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    h4 { font-size: var(--text-lg); }
}

@media (max-width: 480px) {
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }
}
