/**
 * LeanPivot Projects - Design Tokens
 * Unified design system foundation
 * Phase 0: Quick Wins
 */

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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Font families */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Inter', sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

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

    /* Font sizes */
    --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 */

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

/* ============================================
   COLOR PALETTE
   ============================================ */

:root {
    /* Primary palette - Deep Teal */
    --color-primary-base: #006d77;
    --color-primary-light: #83c5be;
    --color-primary-dark: #004d56;
    --color-primary-50: #e0f2f4;
    --color-primary-100: #b3dfe3;
    --color-primary-200: #83c5be;
    --color-primary-300: #52aba9;
    --color-primary-400: #2e9799;
    --color-primary-500: #006d77;
    --color-primary-600: #00636f;
    --color-primary-700: #005664;
    --color-primary-800: #004a5a;
    --color-primary-900: #003147;

    /* Accent palette - Soft Amber */
    --color-accent-base: #ffb703;
    --color-accent-light: #ffd60a;
    --color-accent-dark: #fb8500;
    --color-accent-50: #fff8e1;
    --color-accent-100: #ffecb3;
    --color-accent-200: #ffe082;
    --color-accent-300: #ffd54f;
    --color-accent-400: #ffca28;
    --color-accent-500: #ffb703;
    --color-accent-600: #ffa000;
    --color-accent-700: #fb8500;
    --color-accent-800: #f57c00;
    --color-accent-900: #e65100;

    /* Neutral palette - Cool Gray */
    --color-neutral-50: #ffffff;
    --color-neutral-100: #f8f9fa;
    --color-neutral-200: #e9ecef;
    --color-neutral-300: #dee2e6;
    --color-neutral-400: #ced4da;
    --color-neutral-500: #adb5bd;
    --color-neutral-600: #6c757d;
    --color-neutral-700: #495057;
    --color-neutral-800: #343a40;
    --color-neutral-900: #2b2d42;

    /* Semantic colors */
    --color-success: #06d6a0;
    --color-success-light: #4ade80;
    --color-success-dark: #059669;

    --color-warning: #ffb703;
    --color-warning-light: #fbbf24;
    --color-warning-dark: #f59e0b;

    --color-error: #ef476f;
    --color-error-light: #f87171;
    --color-error-dark: #dc2626;

    --color-info: #118ab2;
    --color-info-light: #3b82f6;
    --color-info-dark: #1e40af;

    /* Background colors */
    --color-bg-base: var(--color-neutral-50);
    --color-bg-subtle: var(--color-neutral-100);
    --color-bg-muted: var(--color-neutral-200);

    /* Text colors */
    --color-text-primary: var(--color-neutral-900);
    --color-text-secondary: var(--color-neutral-700);
    --color-text-muted: var(--color-neutral-600);
    --color-text-inverse: var(--color-neutral-50);

    /* Border colors */
    --color-border-base: var(--color-neutral-300);
    --color-border-muted: var(--color-neutral-200);
    --color-border-strong: var(--color-neutral-400);
}

/* ============================================
   SPACING SCALE
   ============================================ */

:root {
    --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 */
}

/* ============================================
   ELEVATION (SHADOWS)
   ============================================ */

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

    /* Interactive shadows */
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-active: 0 1px 2px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 3px rgba(0, 109, 119, 0.2);
}

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

:root {
    --radius-none: 0;
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-base: 0.375rem;
    /* 6px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
    --radius-full: 9999px;
}

/* ============================================
   TRANSITIONS
   ============================================ */

:root {
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --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 SCALE
   ============================================ */

:root {
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   BASE STYLES
   ============================================ */

html,
body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Spacing utilities */
.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-1 {
    margin-bottom: var(--space-1);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.px-2 {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}

.px-3 {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.px-6 {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.py-2 {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

.py-3 {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

.py-6 {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

/* Shadow utilities */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow-base);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-hover {
    box-shadow: var(--shadow-hover);
}

/* Interactive utilities */
.interactive {
    transition: all var(--transition-base);
    cursor: pointer;
}

.interactive:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.interactive:active {
    transform: translateY(0);
    box-shadow: var(--shadow-active);
}

/* Focus utilities */
.focus-visible:focus-visible {
    outline: 2px solid var(--color-primary-base);
    outline-offset: 2px;
    box-shadow: var(--shadow-focus);
}

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

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