/* ===========================================
   DESIGN TOKENS - Mendelbot 2026
   Modern aesthetic design system
   =========================================== */

:root {
    /* ===========================================
       COLOR SYSTEM - Transformative Teal
       =========================================== */

    /* Primary Brand Color - Teal Scale */
    --brand-primary-50: #f0fdfa;
    --brand-primary-100: #ccfbf1;
    --brand-primary-200: #99f6e4;
    --brand-primary-300: #5eead4;
    --brand-primary-400: #2dd4bf;
    --brand-primary-500: #14b8a6;  /* Base */
    --brand-primary-600: #0d9488;
    --brand-primary-700: #0f766e;
    --brand-primary-800: #115e59;
    --brand-primary-900: #134e4a;

    /* Semantic Colors */
    --color-success-50: #f0fdf4;
    --color-success-100: #dcfce7;
    --color-success-500: #10b981;
    --color-success-600: #059669;
    --color-success-700: #047857;

    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-500: #f59e0b;
    --color-warning-600: #d97706;
    --color-warning-700: #b45309;

    --color-error-50: #fef2f2;
    --color-error-100: #fee2e2;
    --color-error-500: #ef4444;
    --color-error-600: #dc2626;
    --color-error-700: #b91c1c;

    --color-info-50: #eff6ff;
    --color-info-100: #dbeafe;
    --color-info-500: #3b82f6;
    --color-info-600: #2563eb;
    --color-info-700: #1d4ed8;

    /* Neutral Palette - Warm Grays */
    --neutral-50: #fafaf9;
    --neutral-100: #f5f5f4;
    --neutral-200: #e7e5e4;
    --neutral-300: #d6d3d1;
    --neutral-400: #a8a29e;
    --neutral-500: #78716c;
    --neutral-600: #57534e;
    --neutral-700: #44403c;
    --neutral-800: #292524;
    --neutral-900: #1c1917;

    /* Light Mode Semantic Mappings */
    --background: #ffffff;
    --surface: #ffffff;
    --surface-elevated: var(--neutral-50);
    --primary: var(--brand-primary-500);
    --primary-hover: var(--brand-primary-600);
    --primary-active: var(--brand-primary-700);
    --primary-text: var(--brand-primary-700);  /* #0f766e — 6.36:1 on white, for text links */
    --text: var(--neutral-900);
    --text-muted: var(--neutral-600);
    --text-subtle: var(--neutral-600);  /* was neutral-500 (3.96:1), now 5.36:1 on white */
    --border: var(--neutral-200);
    --border-hover: var(--neutral-300);

    /* ===========================================
       TYPOGRAPHY SYSTEM
       =========================================== */

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

    /* Type Scale (1.250 - Major Third) */
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 1.875rem;   /* 30px */
    --font-size-4xl: 2.25rem;    /* 36px */

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;

    /* ===========================================
       SPACING SYSTEM (8px base)
       =========================================== */

    --space-0: 0;
    --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 */

    /* ===========================================
       ELEVATION SYSTEM (Shadows)
       =========================================== */

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Focus Shadow */
    --shadow-focus: 0 0 0 3px rgba(15, 118, 110, 0.3);  /* brand-primary-700 at 30% */

    /* ===========================================
       BORDER RADIUS SCALE
       =========================================== */

    --radius-none: 0;
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;  /* Pill shape */

    /* ===========================================
       TRANSITIONS & ANIMATIONS
       =========================================== */

    --transition-fast: 0.1s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ===========================================
       GLASSMORPHISM EFFECTS
       =========================================== */

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(10px);
}

/* ===========================================
   DARK MODE COLOR OVERRIDES
   =========================================== */

[data-theme="dark"] {
    /* Dark Mode Backgrounds */
    --background: #0a0a0a;           /* True black (OLED-friendly) */
    --surface: #1a1a1a;              /* Card backgrounds */
    --surface-elevated: #262626;     /* Elevated cards */

    /* Dark Mode Primary Colors */
    --primary: var(--brand-primary-400);  /* Lighter teal for contrast */
    --primary-hover: var(--brand-primary-300);
    --primary-active: var(--brand-primary-500);
    --primary-text: var(--brand-primary-300);  /* #5eead4 — 9.04:1 on #0a0a0a */

    /* Dark Mode Text */
    --text: var(--neutral-50);       /* Off-white */
    --text-muted: var(--neutral-400);
    --text-subtle: var(--neutral-400);  /* #a8a29e — 7.15:1 on #0a0a0a */

    /* Dark Mode Borders */
    --border: var(--neutral-800);
    --border-hover: var(--neutral-700);

    /* Dark Mode Shadows - Softer in dark mode */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5), 0 10px 10px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.7);

    /* Dark Mode Focus */
    --shadow-focus: 0 0 0 3px rgba(94, 234, 212, 0.3);  /* brand-primary-300 at 30% */

    /* Dark Mode Glassmorphism */
    --glass-bg: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* ===========================================
   TYPOGRAPHY FOUNDATIONS
   =========================================== */

/* Apply Inter font to body */
body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Heading Hierarchy */
h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

h5, h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

/* Small text */
small {
    font-size: var(--font-size-sm);
}

/* Code & Monospace */
code, pre, kbd, samp {
    font-family: var(--font-mono);
}

/* ===========================================
   ANIMATION KEYFRAMES
   =========================================== */

/* Fade in */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide up */
@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scale in */
@keyframes scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Utility Animation Classes */
.animate-fade-in {
    animation: fade-in var(--transition-base);
}

.animate-slide-up {
    animation: slide-up var(--transition-slow);
}

.animate-scale-in {
    animation: scale-in var(--transition-base);
}

/* ===========================================
   REDUCED MOTION SUPPORT
   =========================================== */

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