/* ============================================
   BASE.CSS - Reset, Variables, Typography
   AlgoForge Production Build - Emerald Green Theme
============================================ */

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

/* CSS Variables */
:root {
    /* Background Colors */
    --bg-primary: #050507;
    --bg-secondary: #0a0a0d;
    --bg-card: #0d0d10;
    --bg-card-hover: #121216;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #8a8a95;
    --text-muted: #5a5a65;
    
    /* Primary Accent - Emerald Green (Trading Theme) */
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-dark: #059669;
    --accent-glow: rgba(16, 185, 129, 0.4);
    
    /* Border Colors */
    --border: #1a1a20;
    --border-light: #2a2a35;
    
    /* Trading Colors */
    --green: #10b981;
    --green-light: #34d399;
    --green-glow: rgba(16, 185, 129, 0.4);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --blue: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.4);
    --orange: #f59e0b;
    --orange-glow: rgba(245, 158, 11, 0.4);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.4);
    --teal: #14b8a6;
    --teal-glow: rgba(20, 184, 166, 0.4);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.3);
    
    /* Gradients - Green Theme */
    --gradient-1: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-accent: linear-gradient(135deg, #10b981 0%, #34d399 50%, #10b981 100%);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal: 1500;
    --z-tooltip: 2000;
}

/* Base HTML */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduced Motion */
@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;
    }
}

/* Focus Styles */
:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

/* Selection */
::selection {
    background: var(--accent);
    color: white;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.75rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

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

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

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: 120px 0;
    position: relative;
}

.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-md);
}

/* Section Labels */
.section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: var(--space-md);
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--space-xs);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.section-title {
    margin-bottom: var(--space-lg);
}

.section-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 550px;
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }
    
    .container {
        padding: 0 var(--space-md);
    }
}
