/**
 * Design System
 *
 * Centralized design tokens and system for Portfolio V2
 * This file should be loaded first to ensure all variables are available
 */

/* ===================================
   COLOR PALETTE
   =================================== */
:root {
    /* Background Colors */
    --color-bg-primary: #000000;
    --color-bg-secondary: #0a0a0a;
    --color-surface-elevated: #1a1a1a;
    --color-surface-hover: #222222;

    /* Text Colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0e0e0;
    --color-text-tertiary: #d0d0d0;
    --color-text-muted: #a0a0a0;

    /* Accent Colors */
    --color-accent-purple: #764ba2;
    --color-accent-blue: #667eea;
    --color-accent-purple-light: #9575cd;
    --color-accent-blue-light: #8b9ff3;

    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-accent-blue) 0%, var(--color-accent-purple) 100%);
    --gradient-hero: linear-gradient(135deg, var(--color-accent-blue) 0%, var(--color-accent-purple) 100%);
    --gradient-accent: linear-gradient(90deg, var(--color-accent-blue), var(--color-accent-purple));
    --gradient-accent-reverse: linear-gradient(90deg, var(--color-accent-purple), var(--color-accent-blue));
    --gradient-bg-dark: linear-gradient(to bottom, #0a0a0a 0%, var(--color-bg-primary) 100%);
    --gradient-radial-glow: radial-gradient(circle at top right, rgba(102, 126, 234, 0.1), transparent 50%);
    --gradient-shimmer: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);

    /* Opacity Variations */
    --opacity-subtle: 0.02;
    --opacity-soft: 0.05;
    --opacity-medium: 0.1;
    --opacity-strong: 0.2;
    --opacity-intense: 0.3;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
:root {
    /* Font Families */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --font-family-heading: var(--font-family-base);
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Font Sizes - Type Scale */
    --font-size-xs: 0.75rem;        /* 12px */
    --font-size-sm: 0.875rem;       /* 14px */
    --font-size-base: 1rem;         /* 16px */
    --font-size-md: 1.125rem;       /* 18px */
    --font-size-lg: 1.25rem;        /* 20px */
    --font-size-xl: 1.5rem;         /* 24px */
    --font-size-2xl: 1.75rem;       /* 28px */
    --font-size-3xl: 2rem;          /* 32px */
    --font-size-4xl: 2.5rem;        /* 40px */
    --font-size-5xl: 3rem;          /* 48px */
    --font-size-6xl: 3.5rem;        /* 56px */
    --font-size-7xl: 4rem;          /* 64px */

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

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 1.8;

    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;
}

/* ===================================
   SPACING
   =================================== */
:root {
    --spacing-xs: 0.25rem;      /* 4px */
    --spacing-sm: 0.5rem;       /* 8px */
    --spacing-md: 1rem;         /* 16px */
    --spacing-lg: 1.5rem;       /* 24px */
    --spacing-xl: 2rem;         /* 32px */
    --spacing-2xl: 2.5rem;      /* 40px */
    --spacing-3xl: 3rem;        /* 48px */
    --spacing-4xl: 4rem;        /* 64px */
    --spacing-5xl: 6rem;        /* 96px */
    --spacing-6xl: 8rem;        /* 128px */

    /* Section Spacing */
    --section-padding-mobile: var(--spacing-3xl);
    --section-padding-tablet: var(--spacing-4xl);
    --section-padding-desktop: var(--spacing-5xl);
}

/* ===================================
   LAYOUT & SIZING
   =================================== */
:root {
    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;
    --container-2xl: 1400px;

    /* Breakpoints (for reference in media queries) */
    --breakpoint-xs: 480px;
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;

    /* Borders */
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 20px;
    --border-radius-full: 9999px;

    /* Border Width */
    --border-width-thin: 1px;
    --border-width-medium: 2px;
    --border-width-thick: 4px;

    /* Z-Index Scale */
    --z-index-dropdown: 100;
    --z-index-sticky: 200;
    --z-index-fixed: 300;
    --z-index-modal-backdrop: 400;
    --z-index-modal: 500;
    --z-index-popover: 600;
    --z-index-tooltip: 700;
}

/* ===================================
   BORDERS & SHADOWS
   =================================== */
:root {
    /* Borders */
    --border-subtle: 1px solid rgba(255, 255, 255, 0.05);
    --border-soft: 1px solid rgba(255, 255, 255, 0.1);
    --border-accent: 1px solid rgba(102, 126, 234, 0.3);
    --border-accent-strong: 1px solid rgba(102, 126, 234, 0.5);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 16px 0 rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 12px 24px 0 rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 24px 48px 0 rgba(0, 0, 0, 0.5);

    /* Accent Shadows (Glow Effects) */
    --shadow-glow-sm: 0 0 10px rgba(102, 126, 234, 0.2);
    --shadow-glow-md: 0 0 20px rgba(102, 126, 234, 0.3);
    --shadow-glow-lg: 0 0 40px rgba(118, 75, 162, 0.2);
    --shadow-accent: 0 0 20px rgba(102, 126, 234, 0.3), 0 0 40px rgba(118, 75, 162, 0.2);
    --shadow-accent-strong: 0 0 25px rgba(102, 126, 234, 0.4), 0 0 50px rgba(118, 75, 162, 0.3);
}

/* ===================================
   TRANSITIONS & ANIMATIONS
   =================================== */
:root {
    /* Timing Functions */
    --ease-linear: linear;
    --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);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Durations */
    --duration-instant: 100ms;
    --duration-fast: 200ms;
    --duration-normal: 300ms;
    --duration-slow: 400ms;
    --duration-slower: 500ms;

    /* Common Transitions */
    --transition-base: all var(--duration-normal) var(--ease-in-out);
    --transition-fast: all var(--duration-fast) var(--ease-in-out);
    --transition-slow: all var(--duration-slow) var(--ease-in-out);
    --transition-colors: background-color var(--duration-normal) var(--ease-in-out),
                         color var(--duration-normal) var(--ease-in-out),
                         border-color var(--duration-normal) var(--ease-in-out);
    --transition-transform: transform var(--duration-normal) var(--ease-smooth);
    --transition-opacity: opacity var(--duration-normal) var(--ease-in-out);
}

/* ===================================
   EFFECTS & UTILITIES
   =================================== */
:root {
    /* Backdrop Blur */
    --blur-sm: 4px;
    --blur-md: 10px;
    --blur-lg: 20px;
    --blur-xl: 40px;

    /* Navigation Specific */
    --nav-height: 80px;
    --nav-height-mobile: 64px;
}

/* ===================================
   FOCUS STATES (Accessibility)
   =================================== */
:root {
    --focus-ring-width: 2px;
    --focus-ring-offset: 2px;
    --focus-ring-color: var(--color-accent-blue);
    --focus-ring: var(--focus-ring-width) solid var(--focus-ring-color);
}

/* Global focus styles for accessibility */
:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ===================================
   KEYFRAME ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===================================
   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;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    :root {
        --color-bg-primary: #ffffff;
        --color-text-primary: #000000;
        --color-text-secondary: #333333;
        --color-text-tertiary: #666666;
    }

    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}
