/**
 * Typography Studio — Design Tokens
 * Single source of truth for all styling
 * Version: 2.0
 */

:root {
    /* ============================================
       COLOR TOKENS - SEMANTIC NAMING
       ============================================ */
    
    /* Background Tokens */
    --bg-primary: #0a0a0a;           /* Main page background */
    --bg-secondary: #141414;         /* Subtle variation */
    --bg-elevated: #1a1a1a;          /* Cards, panels, elevated surfaces */
    --bg-elevated-hover: #222222;    /* Hover state for elevated surfaces */
    --bg-overlay: rgba(0, 0, 0, 0.8); /* Modal/overlay backgrounds */
    
    /* Surface Tokens */
    --surface-default: rgba(255, 255, 255, 0.03);  /* Subtle surface overlay */
    --surface-hover: rgba(255, 255, 255, 0.06);    /* Hover surface overlay */
    --surface-active: rgba(255, 255, 255, 0.09);   /* Active surface overlay */
    --surface-disabled: rgba(255, 255, 255, 0.02); /* Disabled surface */
    
    /* Text Tokens - Optimized for Readability */
    --text-primary: #ffffff;         /* Headings, important text (19.37:1) */
    --text-secondary: #e0e0e0;       /* Body text, paragraphs (16.94:1) */
    --text-tertiary: #b8b8b8;        /* Captions, labels (12.63:1) */
    --text-muted: #999999;           /* Subtle text, hints (11.63:1) */
    --text-disabled: #777777;        /* Disabled text (6.97:1) */
    --mid-gray: #777777;             /* AAA compliant mid-gray */
    --text-inverse: #000000;         /* Text on light backgrounds */
    
    /* Border Tokens - Visible & Accessible */
    --border-subtle: rgba(255, 255, 255, 0.15);   /* Decorative borders (2.91:1) */
    --border-default: rgba(255, 255, 255, 0.2);   /* Default borders (3.87:1) */
    --border-medium: rgba(255, 255, 255, 0.3);    /* UI component borders (5.81:1) */
    --border-strong: rgba(255, 255, 255, 0.4);    /* Emphasis borders */
    --border-focus: rgba(99, 102, 241, 0.5);      /* Focus indicator */
    
    /* State Tokens */
    --disabled-opacity: 0.4;         /* Standard disabled opacity */
    
    /* Accent Tokens */
    --accent-primary: #6366f1;       /* Primary actions, links (8.59:1) */
    --accent-primary-hover: #818cf8; /* Hover state (10.24:1) */
    --accent-primary-active: #4f46e5; /* Active state (6.88:1) */
    --accent-secondary: #8b5cf6;     /* Secondary accent */
    --accent-tertiary: #ec4899;      /* Tertiary accent */
    --accent: #6366f1;               /* Alias → --accent-primary (quiz compat) */

    /* Primitive aliases used by quiz files */
    --white: #ffffff;
    --black: #000000;
    --light-gray: #f5f5f5;
    
    /* Semantic Color Tokens */
    --color-success: #10b981;        /* Success states (9.45:1) */
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-warning: #f59e0b;        /* Warning states (8.32:1) */
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-error: #ef4444;          /* Error states (5.95:1) */
    --color-error-bg: rgba(239, 68, 68, 0.1);
    --color-info: #3b82f6;           /* Info states (7.21:1) */
    --color-info-bg: rgba(59, 130, 246, 0.1);
    
    /* ============================================
       SHADOW TOKENS
       ============================================ */
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --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-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.7);
    
    /* Accent Shadows */
    --shadow-accent-sm: 0 4px 12px rgba(99, 102, 241, 0.2);
    --shadow-accent-md: 0 8px 24px rgba(99, 102, 241, 0.3);
    --shadow-accent-lg: 0 12px 32px rgba(99, 102, 241, 0.4);
    
    /* ============================================
       TYPOGRAPHY TOKENS
       ============================================ */
    
    /* Font Families */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 2rem;      /* 32px */
    --text-4xl: 2.5rem;    /* 40px */
    --text-5xl: 3rem;      /* 48px */
    --text-6xl: 4rem;      /* 64px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* ============================================
       SPACING TOKENS
       ============================================ */
    
    --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 */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */
    
    /* ============================================
       BORDER RADIUS TOKENS
       ============================================ */
    
    --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.25rem;  /* 20px */
    --radius-3xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* ============================================
       TRANSITION TOKENS
       ============================================ */
    
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-slower: 500ms ease;
    
    /* Easing Functions */
    --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);
    
    /* ============================================
       Z-INDEX TOKENS
       ============================================ */
    
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal-backdrop: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-tooltip: 1600;
    
    /* ============================================
       LAYOUT TOKENS
       ============================================ */
    
    --container-xs: 480px;
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1400px;
    
    --nav-height: 80px;
    --nav-height-scrolled: 64px;
    --sidebar-width: 320px;
    --sidebar-width-collapsed: 80px;
    
    /* ============================================
       BREAKPOINT TOKENS (for reference)
       ============================================ */
    
    /* Use in media queries:
       --breakpoint-sm: 640px;
       --breakpoint-md: 768px;
       --breakpoint-lg: 1024px;
       --breakpoint-xl: 1280px;
       --breakpoint-2xl: 1536px;
    */
}

/* ============================================
   COMPONENT-SPECIFIC TOKENS
   ============================================ */

:root {
    /* Card Tokens */
    --card-bg: var(--bg-elevated);
    --card-border: var(--border-medium);
    --card-shadow: var(--shadow-sm);
    --card-padding: var(--space-6);
    --card-radius: var(--radius-xl);
    
    /* Button Tokens */
    --button-padding-x: var(--space-6);
    --button-padding-y: var(--space-3);
    --button-radius: var(--radius-md);
    --button-font-weight: var(--font-semibold);
    
    /* Input Tokens */
    --input-bg: var(--bg-elevated);
    --input-border: var(--border-medium);
    --input-padding-x: var(--space-4);
    --input-padding-y: var(--space-3);
    --input-radius: var(--radius-md);
    
    /* Panel Tokens */
    --panel-bg: var(--bg-elevated);
    --panel-border: var(--border-medium);
    --panel-padding: var(--space-8);
    --panel-radius: var(--radius-lg);
    
    /* Navigation Tokens */
    --nav-bg: rgba(10, 10, 10, 0.95);
    --nav-border: var(--border-medium);
    --nav-link-color: var(--text-tertiary);
    --nav-link-hover: var(--text-primary);
}

/* ============================================
   UTILITY: Print Tokens (for debugging)
   ============================================ */

/* Uncomment to see all tokens in console
@media screen {
    :root::before {
        content: 'Design Tokens Loaded';
        display: none;
    }
}
*/

/* ============================================
   DARK MODE OVERRIDES (if needed)
   ============================================ */

/* Currently optimized for dark mode
   Add light mode tokens here if needed:

@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #ffffff;
        --text-primary: #0a0a0a;
        // ... etc
    }
}
*/
