/* ============================================================
   CheesCoach — Design tokens

   The palette is lifted from the app's own illustrations, which
   use two light sources over a near-black board: a lavender one
   for everything you LEARN (openings, courses) and a cold blue
   one for everything you CALCULATE (endgames, analysis). Gold
   appears only where the app says "Premium".

   Typefaces are the app's: Playfair Display, Lato, JetBrains
   Mono. Same three families on the phone and on the web.
   ============================================================ */

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

:root {
    /* === Backgrounds === */
    --bg-deepest: #05080F;
    --bg-primary: #080D1A;
    --bg-secondary: #0E1526;
    --bg-card: #141D33;
    --bg-card-hover: #1B2645;
    --bg-glass: rgba(14, 21, 38, 0.74);
    --bg-glass-hover: rgba(27, 38, 69, 0.84);

    /* === Lavender — what you LEARN === */
    --accent: #B9A6E8;
    --accent-bright: #D3C6F4;
    --accent-dim: #7C68B0;
    --accent-glow: rgba(185, 166, 232, 0.14);
    --accent-glow-strong: rgba(185, 166, 232, 0.28);

    /* === Ice blue — what you CALCULATE === */
    --ice: #9FC1EA;
    --ice-bright: #C4DAF6;
    --ice-dim: #5C82B4;
    --ice-glow: rgba(159, 193, 234, 0.13);

    /* === Gold — premium, and nothing else === */
    --gold: #E3B54C;
    --gold-bright: #F2D181;
    --gold-dim: #A87F22;
    --gold-glow: rgba(227, 181, 76, 0.14);
    --gold-glow-strong: rgba(227, 181, 76, 0.28);

    /* === Move classification — the app's own verdict colours === */
    --grade-best: #7FC785;
    --grade-good: #9FC1EA;
    --grade-inaccuracy: #D9B65A;
    --grade-mistake: #E8944A;
    --grade-blunder: #EF8C86;

    /* === Semantic === */
    --success: #7FC785;
    --success-dim: #436E2E;
    --warning: #D9B65A;
    --warning-dim: #8A6B1F;
    --error: #EF8C86;
    --error-dim: #A2342A;
    --info: #9FC1EA;

    /* === Provider accents === */
    --gemini-accent: #4285F4;
    --openai-accent: #10B981;
    --claude-accent: #D4A27F;
    --deepseek-accent: #818CF8;
    --qwen-accent: #A855F7;

    /* === Text === */
    --text-primary: #EDEFF6;
    --text-secondary: #A2AEC6;
    --text-muted: #78859E;
    --text-inverse: #080D1A;

    /* === Light band (mirrors the app's light surface) === */
    --paper: #F5F4F9;
    --paper-dim: #E7E6EF;
    --paper-text: #37393D;
    --paper-text-muted: #5A5E65;

    /* === Borders === */
    --border: rgba(185, 166, 232, 0.13);
    --border-hover: rgba(185, 166, 232, 0.26);
    --border-strong: rgba(185, 166, 232, 0.42);
    --border-subtle: rgba(255, 255, 255, 0.07);

    /* === Chess board (the app's default green) === */
    --board-light: #EDEED1;
    --board-dark: #7A9C58;
    --board-highlight: rgba(255, 255, 0, 0.42);
    --board-correct: rgba(127, 199, 133, 0.55);
    --board-incorrect: rgba(239, 140, 134, 0.55);

    /* === Spacing scale (4px base) === */
    --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;
    --space-20: 5rem;
    --space-24: 6rem;

    /* === Radius === */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    --radius-full: 9999px;

    /* === Shadows === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 26px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 14px 48px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 26px 80px rgba(0, 0, 0, 0.58);
    --shadow-glow-blue: 0 0 44px rgba(159, 193, 234, 0.16);
    --shadow-glow-gold: 0 0 44px rgba(227, 181, 76, 0.14);
    --shadow-glow-blue-strong: 0 0 70px rgba(185, 166, 232, 0.26);

    /* === 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 === */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-tooltip: 500;

    /* === Typography === */
    --font-display: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
    --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 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.08;
    --leading-snug: 1.28;
    --leading-normal: 1.65;
    --leading-relaxed: 1.8;

    /* === Containers === */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1180px;
    --container-2xl: 1340px;
}

/* === Base === */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;  /* 69px navbar + 15px of air */
}

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;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 14% 4%, rgba(185, 166, 232, 0.10), transparent 34rem),
        radial-gradient(circle at 86% 30%, rgba(159, 193, 234, 0.07), transparent 30rem);
}

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

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: 3px;
    border-radius: 4px;
}

.band-paper :focus-visible,
.gap-band :focus-visible { outline-color: var(--accent-dim); }

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

/* === Chess grid backdrop === */
.chess-pattern-bg { position: relative; }

.chess-pattern-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(185, 166, 232, 0.022) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(185, 166, 232, 0.022) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(185, 166, 232, 0.022) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(185, 166, 232, 0.022) 75%);
    background-size: 64px 64px;
    background-position: 0 0, 0 32px, 32px -32px, -32px 0px;
    pointer-events: none;
    z-index: 0;
}

/* === Gradient backgrounds === */
.gradient-hero {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(185, 166, 232, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 82% 22%, rgba(159, 193, 234, 0.08) 0%, transparent 50%),
        var(--bg-primary);
}

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

/* === Responsive type === */
@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); }
}

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