/* ============================================
   KevinTen Personal Website - Theme Variables
   Bento Grid Design System (ui-ux-pro-max)
   ============================================ */

:root {
  /* Primary Colors - Vercel Style */
  --color-primary: #2563EB;
  --color-primary-dark: #1D4ED8;
  --color-primary-light: #3B82F6;
  --color-secondary: #7C3AED;
  --color-secondary-dark: #5B21B6;
  --color-secondary-light: #8B5CF6;
  --color-accent: #2563EB;

  /* Background Colors - Professional Dark */
  --color-bg: #050508;
  --color-bg-secondary: #18181B;
  --color-bg-tertiary: #27272A;
  --color-bg-card: #18181B;

  /* Text Colors - High Contrast */
  --color-text: #FAFAFA;
  --color-text-secondary: #A1A1AA;
  --color-text-muted: #8B8B96;
  --color-text-subtle: #52525B;

  /* Border Colors */
  --color-border: #3F3F46;
  --color-border-light: #52525B;
  --color-border-glow: rgba(37, 99, 235, 0.3);

  /* Semantic Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* Language Colors - Enhanced */
  --color-java: #FBBF24;
  --color-go: #00ADD8;
  --color-python: #3776AB;
  --color-javascript: #F7DF1E;
  --color-typescript: #3178C6;

  /* Gradient Definitions - Professional Style */
  --gradient-hero: linear-gradient(135deg, #000000 0%, #0A0A0A 50%, #111111 100%);
  --gradient-card: linear-gradient(145deg, rgba(24, 24, 27, 0.9) 0%, rgba(15, 15, 17, 0.95) 100%);
  --gradient-primary: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --gradient-accent: linear-gradient(135deg, #0EA5E9 0%, #10B981 100%);
  --gradient-secondary: linear-gradient(135deg, #7B2FFF 0%, #FF6B35 100%);
  --gradient-neon: linear-gradient(135deg, #00D4FF 0%, #7B2FFF 50%, #FF006E 100%);
  --gradient-subtle: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  --gradient-cyber: linear-gradient(135deg, #00D4FF 0%, #7B2FFF 50%, #FF006E 100%);
  --glow-primary: 0 0 20px rgba(37, 99, 235, 0.4);

  /* Glassmorphism - Professional */
  --glass-bg: rgba(24, 24, 27, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);

  /* Semantic Alpha Colors - for card backgrounds, borders, hovers */
  --color-card-bg: rgba(30, 41, 59, 0.6);
  --color-card-bg-hover: rgba(30, 41, 59, 0.8);
  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  --color-primary-alpha-8: rgba(59, 130, 246, 0.08);
  --color-primary-alpha-10: rgba(59, 130, 246, 0.1);
  --color-primary-alpha-15: rgba(59, 130, 246, 0.15);
  --color-primary-alpha-20: rgba(59, 130, 246, 0.2);
  --color-primary-alpha-30: rgba(59, 130, 246, 0.3);
  --color-overlay-bg: rgba(0, 0, 0, 0.9);

  /* Dual accent system */
  --color-accent-indigo: #6366F1;
  --color-accent-indigo-light: #818CF8;
  --color-accent-indigo-alpha-8: rgba(99, 102, 241, 0.08);
  --color-accent-indigo-alpha-10: rgba(99, 102, 241, 0.10);
  --color-accent-indigo-alpha-15: rgba(99, 102, 241, 0.15);
  --color-accent-indigo-alpha-20: rgba(99, 102, 241, 0.20);
  --color-accent-cyan: #22D3EE;
  --color-accent-cyan-deep: #06B6D4;
  --color-accent-cyan-alpha-8: rgba(6, 182, 212, 0.08);
  --color-accent-cyan-alpha-10: rgba(6, 182, 212, 0.10);
  --color-accent-cyan-alpha-15: rgba(6, 182, 212, 0.15);

  --glass-blur: 12px;

  /* Typography */
  --font-heading: 'Sora', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: var(--font-body);
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
  --font-chinese: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* Bento Grid */
  --bento-grid-gap: 20px;
  --bento-card-radius: 20px;
  --bento-hover-scale: 1.02;
  --bento-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --bento-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --bento-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --bento-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Unified card system */
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(255, 255, 255, 0.12);
  --card-radius: 16px;
  --card-blur: 8px;
  --card-inner-glow: 0 0 0 0.5px rgba(255, 255, 255, 0.04);
  --card-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 0 0 0.5px rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.4);
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Font Weights */
  --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;
  
  /* Spacing Scale */
  --space-0: 0;
  --space-0_5: 0.125rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  
  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows — unified 3-level system */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  /* Transitions */
  --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);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  
  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Header Height */
  --header-height: 4rem;
  --header-height-mobile: 3.5rem;
}

/* ============================================
   Base Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

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

/* Focus visible styling */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* ============================================
   Utility Classes
   ============================================ */

/* Container */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: var(--container-2xl);
  }
}

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

/* Animation utilities */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.6), 0 0 40px rgba(37, 99, 235, 0.3); }
}

/* ============================================
   Professional Animations - Simplified
   ============================================ */

/* Keep only essential animations */

@keyframes skill-load {
  from { width: 0; }
  to { width: var(--skill-level); }
}

/* Professional Animation Classes */
.animate-fadeIn {
  animation: fadeIn var(--transition-slow) ease-out;
}

.animate-fadeInUp {
  animation: fadeInUp var(--transition-slow) ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft var(--transition-slow) ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient 3s ease infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ============================================
   Scroll-Triggered Animations
   ============================================ */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.from-left {
  transform: translateX(-30px);
}

.animate-on-scroll.from-left.is-visible {
  transform: translateX(0);
}

.animate-on-scroll.from-right {
  transform: translateX(30px);
}

.animate-on-scroll.from-right.is-visible {
  transform: translateX(0);
}

.animate-on-scroll.scale-in {
  transform: scale(0.95);
}

.animate-on-scroll.scale-in.is-visible {
  transform: scale(1);
}

/* Staggered animation delays — 60ms intervals */
.stagger-1 { transition-delay: 60ms; }
.stagger-2 { transition-delay: 120ms; }
.stagger-3 { transition-delay: 180ms; }
.stagger-4 { transition-delay: 240ms; }
.stagger-5 { transition-delay: 300ms; }

/* ============================================
   Light Theme Override
   ============================================ */

[data-theme="light"] {
  /* Primary Colors */
  --color-primary: #2563EB;
  --color-primary-dark: #1D4ED8;
  --color-primary-light: #3B82F6;
  --color-secondary: #7C3AED;
  --color-secondary-dark: #5B21B6;
  --color-secondary-light: #8B5CF6;
  --color-accent: #2563EB;

  /* Background Colors */
  --color-bg: #FAFAFA;
  --color-bg-secondary: #F4F4F5;
  --color-bg-tertiary: #E4E4E7;
  --color-bg-card: #FFFFFF;

  /* Text Colors */
  --color-text: #18181B;
  --color-text-secondary: #52525B;
  --color-text-muted: #71717A;
  --color-text-subtle: #A1A1AA;

  /* Border Colors */
  --color-border: #D4D4D8;
  --color-border-light: #E4E4E7;
  --color-border-glow: rgba(37, 99, 235, 0.3);

  /* Gradient Definitions */
  --gradient-hero: linear-gradient(135deg, #FAFAFA 0%, #F4F4F5 50%, #E4E4E7 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 244, 245, 0.95) 100%);
  --gradient-subtle: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

  /* Shadows - Lighter */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

  /* Bento Grid - Light */
  --bento-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --bento-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --bento-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --glow-primary: 0 0 20px rgba(37, 99, 235, 0.2);

  /* Semantic Alpha Colors */
  --color-card-bg: rgba(255, 255, 255, 0.8);
  --color-card-bg-hover: rgba(255, 255, 255, 0.95);
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border-hover: rgba(0, 0, 0, 0.12);
  --color-primary-alpha-8: rgba(37, 99, 235, 0.06);
  --color-primary-alpha-10: rgba(37, 99, 235, 0.08);
  --color-primary-alpha-15: rgba(37, 99, 235, 0.12);
  --color-primary-alpha-20: rgba(37, 99, 235, 0.15);
  --color-primary-alpha-30: rgba(37, 99, 235, 0.25);
  --color-overlay-bg: rgba(0, 0, 0, 0.7);

  /* Unified card system — light */
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(0, 0, 0, 0.06);
  --card-border-hover: rgba(0, 0, 0, 0.12);
  --card-inner-glow: none;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);
}

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