/* Design Tokens - Unified Design System */
/* Created for Yusuke Hashimoto's Research Portfolio */

:root {
  /* ===== Core Brand Colors ===== */
  --brand-primary: #1a252f;          /* Deep Navy - Main brand color */
  --brand-primary-light: #2c3e50;    /* Lighter Navy */
  --brand-primary-lighter: #34495e;  /* Light Navy */
  --brand-primary-dark: #0f171f;     /* Darker Navy */
  
  --brand-secondary: #4a5f7a;        /* Blue Gray - Secondary brand */
  --brand-secondary-light: #5d6d7e;  /* Lighter Blue Gray */
  --brand-secondary-lighter: #7f8c8d;/* Lightest Blue Gray */
  
  --brand-accent-1: #3498db;         /* Research Blue */
  --brand-accent-2: #2ecc71;         /* Success Green */
  --brand-accent-3: #e67e22;         /* Innovation Orange */
  --brand-accent-4: #9b59b6;         /* DX Purple */
  
  /* ===== Semantic Colors ===== */
  --color-background: #ffffff;
  --color-surface: #f8f9fa;
  --color-surface-elevated: #ffffff;
  --color-border: #dee2e6;
  --color-border-light: #e9ecef;
  --color-border-dark: #ced4da;
  
  --color-text-primary: #212529;
  --color-text-secondary: #495057;
  --color-text-muted: #6c757d;
  --color-text-light: #adb5bd;
  --color-text-inverse: #ffffff;
  
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-info: #17a2b8;
  
  /* ===== Typography Scale ===== */
  --font-family-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-family-body: 'Georgia', 'Times New Roman', serif;
  --font-family-mono: 'SF Mono', Monaco, 'Courier New', monospace;
  
  /* Fluid Typography with clamp() */
  --font-size-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 2vw, 1rem);
  --font-size-base: clamp(1rem, 2.5vw, 1.125rem);
  --font-size-md: clamp(1.125rem, 3vw, 1.25rem);
  --font-size-lg: clamp(1.25rem, 3.5vw, 1.5rem);
  --font-size-xl: clamp(1.5rem, 4vw, 1.875rem);
  --font-size-2xl: clamp(1.875rem, 5vw, 2.25rem);
  --font-size-3xl: clamp(2.25rem, 6vw, 3rem);
  --font-size-4xl: clamp(3rem, 8vw, 3.75rem);
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* ===== Spacing System (8px base) ===== */
  --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 */
  
  /* ===== Layout ===== */
  --container-max-width: 1280px;
  --container-narrow: 960px;
  --container-reading: 720px;
  --container-wide: 1440px;
  
  --header-height: 4rem;
  --header-height-mobile: 3.5rem;
  --nav-height: 3rem;
  --footer-min-height: 12rem;
  
  /* ===== Borders & Radius ===== */
  --border-width: 1px;
  --border-width-thick: 2px;
  --border-width-heavy: 4px;
  
  --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;
  
  /* ===== Shadows (Elevation System) ===== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 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);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  
  /* ===== Transitions ===== */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-slower: 500ms ease;
  
  --transition-timing-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-timing-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --transition-timing-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --transition-timing-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ===== Z-Index Scale ===== */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-notification: 800;
  --z-maximum: 9999;
  
  /* ===== Breakpoints ===== */
  --breakpoint-xs: 0;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* ===== Grid System ===== */
  --grid-columns: 12;
  --grid-gap: var(--space-4);
  --grid-gap-sm: var(--space-2);
  --grid-gap-lg: var(--space-6);
  --grid-gap-xl: var(--space-8);
}

/* ===== Dark Theme Overrides ===== */
[data-theme="dark"] {
  --color-background: #0d1117;
  --color-surface: #161b22;
  --color-surface-elevated: #1c2128;
  --color-border: #30363d;
  --color-border-light: #21262d;
  --color-border-dark: #484f58;
  
  --color-text-primary: #f0f6fc;
  --color-text-secondary: #c9d1d9;
  --color-text-muted: #8b949e;
  --color-text-light: #6e7681;
  --color-text-inverse: #0d1117;
  
  /* Adjusted shadows for dark theme */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ===== Responsive Utilities ===== */
@media (min-width: 640px) {
  :root {
    --grid-gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  :root {
    --grid-gap: var(--space-8);
  }
}

/* ===== Motion Preferences ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
    --transition-slower: 0ms;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
    --color-text-muted: #495057;
    --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 0 0 2px rgba(0, 0, 0, 0.1);
  }
}