/* --- Performance & Flicker Fixes & SEO Optimizations --- */

/* Критичные стили для предотвращения мерцания */
.preload * {
  transition: none !important;
  animation: none !important;
  transform: none !important;
}

/* Оптимизация производительности и SEO */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  font-display: swap; /* Быстрая загрузка шрифтов для Core Web Vitals */
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* GPU ускорение для критичных элементов */
.header,
.hero,
section {
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
}

/* Ленивая загрузка изображений для улучшения LCP */
img {
  height: auto;
  max-width: 100%;
}

/* Улучшенная производительность анимаций для FID */
.timeline__item,
.projects__card,
.skills__item,
.services__card {
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
  contain: layout style paint;
}

/* Оптимизация отрисовки для CLS */
.hero__avatar-image,
.projects__image {
  transform: translateZ(0);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  aspect-ratio: 1/1; /* Предотвращение скачков макета */
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  /* Убираем любые transition при загрузке */
  opacity: 1;
  visibility: visible;
}

/* ПОЛНОЕ отключение transitions и анимаций при загрузке */
.preload,
.preload *,
.preload *::before,
.preload *::after {
  transition: none !important;
  animation: none !important;
  transform: none !important;
  will-change: auto !important;
  backface-visibility: visible !important;
}

/* Отключаем все hover эффекты при загрузке */
.preload *:hover {
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  scale: none !important;
}

/* Основные блоки - принудительная стабилизация */
section, .container, .timeline__item, .about, .projects, .skills, .services, .contact, .hero, .header {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: auto;
  opacity: 1;
  visibility: visible;
  /* Принудительно отключаем любые эффекты */
  filter: none;
  box-shadow: none;
}

/* Отключаем лишние эффекты на мобильных */
@media (max-width: 700px) {
  .timeline__item:hover, .hero__avatar:hover, section:hover {
    box-shadow: none !important;
    filter: none !important;
    transition: none !important;
    transform: none !important;
  }
  
  /* Убираем анимации на мобильных для производительности */
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}

/* Footer SEO text styling */
.footer__seo {
  font-size: 12px;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: 8px;
  line-height: 1.4;
}
:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;
  --color-primary-rgb: 33, 128, 141;
  --color-blue-500-rgb: 59, 130, 246;
  --color-indigo-500-rgb: 99, 102, 241;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(99, 102, 241, 0.08); /* Light indigo */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(139, 92, 246, 0.08); /* Light purple */
  --color-bg-5: rgba(6, 182, 212, 0.08); /* Light cyan */
  --color-bg-6: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-7: rgba(99, 102, 241, 0.08); /* Light indigo */
  --color-bg-8: rgba(139, 92, 246, 0.08); /* Light purple */

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Background colors for special blocks */
  --color-bg-info: rgba(var(--color-info-rgb), 0.1);
  --color-bg-warning: rgba(var(--color-warning-rgb), 0.1);
  --color-bg-primary: var(--color-surface);

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-72: 72px;
  --space-80: 80px;
  --space-96: 96px;
  --space-128: 128px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-gray-400-rgb: 119, 124, 124;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;
    --color-blue-500-rgb: 59, 130, 246;
    --color-indigo-500-rgb: 99, 102, 241;

      /* Background color tokens (Dark Mode) - Blue theme */
  --color-bg-1: rgba(29, 78, 216, 0.2); /* Deep blue */
  --color-bg-2: rgba(59, 130, 246, 0.15); /* Blue */
  --color-bg-3: rgba(37, 99, 235, 0.15); /* Indigo */
  --color-bg-4: rgba(67, 56, 202, 0.15); /* Violet */
  --color-bg-5: rgba(99, 102, 241, 0.15); /* Indigo */
  --color-bg-6: rgba(139, 92, 246, 0.15); /* Purple */
  --color-bg-7: rgba(168, 85, 247, 0.15); /* Purple */
  --color-bg-8: rgba(6, 182, 212, 0.15); /* Cyan */
    
    /* Semantic Color Tokens (Dark Mode) */
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-surface-hover: var(--color-charcoal-600);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-400);
    --color-primary-active: var(--color-teal-800);
    --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
    --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
    --color-border: rgba(var(--color-gray-400-rgb), 0.3);
    --color-error: var(--color-red-400);
    --color-success: var(--color-teal-300);
    --color-warning: var(--color-orange-400);
    --color-info: var(--color-gray-300);
    --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-teal-300-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-gray-300-rgb);
    --color-primary-rgb: 50, 184, 198;
  }
  
  /* Dark mode avatar styles for system preference */
  .hero__avatar {
    border-color: var(--color-border);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(50, 184, 198, 0.3);
  }
  
  .hero__avatar-image {
    filter: brightness(0.95) contrast(1.05);
  }
  
  /* Dark mode timeline achievements for system preference */
  .timeline__achievements {
    border-top-color: rgba(119, 124, 124, 0.3);
  }
  
  .timeline__achievements li::before {
    color: var(--color-teal-300);
  }
  
  /* Enhanced dark mode in blue tones */
  .hero::before {
    background: var(--color-bg-1);
    opacity: 0.4;
  }
  
  .about {
    background: var(--color-bg-3);
  }
  
  .projects {
    background: var(--color-bg-5);
  }
  
  .services {
    background: var(--color-bg-8);
  }
}

/* Light mode colors */
@media (prefers-color-scheme: light) {
  :root {
    /* RGB versions for opacity control (Light Mode) */
    --color-brown-600-rgb: 94, 82, 64;
    --color-teal-500-rgb: 33, 128, 141;
    --color-slate-900-rgb: 19, 52, 59;
    --color-blue-500-rgb: 59, 130, 246;
    --color-indigo-500-rgb: 99, 102, 241;
    
    /* Semantic Color Tokens (Light Mode) */
    --color-background: var(--color-cream-50);
    --color-surface: var(--color-cream-100);
    --color-text: var(--color-slate-900);
    --color-text-secondary: var(--color-slate-500);
    --color-primary: var(--color-teal-500);
    --color-primary-hover: var(--color-teal-600);
    --color-primary-active: var(--color-teal-700);
    --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
    --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
    --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
    --color-border: rgba(var(--color-brown-600-rgb), 0.2);
    --color-btn-primary-text: var(--color-cream-50);
    --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
    --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
    --color-error: var(--color-red-500);
    --color-success: var(--color-teal-500);
    --color-warning: var(--color-orange-500);
    --color-info: var(--color-slate-500);
    --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

    /* RGB versions for light mode */
    --color-success-rgb: var(--color-teal-500-rgb);
    --color-error-rgb: var(--color-red-500-rgb);
    --color-warning-rgb: var(--color-orange-500-rgb);
    --color-info-rgb: var(--color-slate-500-rgb);
    --color-primary-rgb: 33, 128, 141;
  }
  
  /* Light mode avatar styles for system preference */
  .hero__avatar {
    border-color: var(--color-border);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(33, 128, 141, 0.2);
  }
  
  .hero__avatar-image {
    filter: brightness(1.05) contrast(1.1);
  }
  
  /* Light mode timeline achievements for system preference */
  .timeline__achievements {
    border-top-color: rgba(94, 82, 64, 0.2);
  }
  
  .timeline__achievements li::before {
    color: var(--color-teal-500);
  }
  
  /* Enhanced light mode for system preference */
  .hero::before {
    background: var(--color-bg-1);
    opacity: 0.6;
  }
  
  .about {
    background: var(--color-bg-3);
  }
  
  .projects {
    background: var(--color-bg-5);
  }
  
  .services {
    background: var(--color-bg-8);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (dark mode) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;
  --color-blue-500-rgb: 59, 130, 246;
  --color-indigo-500-rgb: 99, 102, 241;

  /* Colorful background palette - Dark Mode - Blue theme */
  --color-bg-1: rgba(29, 78, 216, 0.2); /* Deep blue */
  --color-bg-2: rgba(59, 130, 246, 0.15); /* Blue */
  --color-bg-3: rgba(37, 99, 235, 0.15); /* Indigo */
  --color-bg-4: rgba(67, 56, 202, 0.15); /* Violet */
  --color-bg-5: rgba(99, 102, 241, 0.15); /* Indigo */
  --color-bg-6: rgba(139, 92, 246, 0.15); /* Purple */
  --color-bg-7: rgba(168, 85, 247, 0.15); /* Purple */
  --color-bg-8: rgba(6, 182, 212, 0.15); /* Cyan */
  
  /* Semantic Color Tokens (Dark Mode) */
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-primary-active: var(--color-teal-800);
  --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
  --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
  --color-border: rgba(var(--color-gray-400-rgb), 0.3);
  --color-error: var(--color-red-400);
  --color-success: var(--color-teal-300);
  --color-warning: var(--color-orange-400);
  --color-info: var(--color-gray-300);
  --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-gray-400-rgb), 0.15);
  --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
  --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-teal-300-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-gray-300-rgb);
  --color-primary-rgb: 50, 184, 198;
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-blue-500-rgb: 59, 130, 246;
  --color-indigo-500-rgb: 99, 102, 241;
  
  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-teal-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-500-rgb);
  --color-primary-rgb: 33, 128, 141;
}

/* Light mode avatar styles */
[data-color-scheme="light"] .hero__avatar {
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(33, 128, 141, 0.2);
}

[data-color-scheme="light"] .hero__avatar-image {
  filter: brightness(1.05) contrast(1.1);
}

[data-color-scheme="light"] .timeline__achievements {
  border-top-color: rgba(94, 82, 64, 0.2);
}

[data-color-scheme="light"] .timeline__achievements li::before {
  color: var(--color-teal-500);
}

/* Enhanced light mode */
[data-color-scheme="light"] .hero::before {
  background: var(--color-bg-1);
  opacity: 0.6;
}

[data-color-scheme="light"] .about {
  background: var(--color-bg-3);
}

[data-color-scheme="light"] .projects {
  background: var(--color-bg-5);
}

[data-color-scheme="light"] .services {
  background: var(--color-bg-8);
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@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);
  }
}


.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* 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;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

/* Dark mode avatar border */
[data-color-scheme="dark"] .hero__avatar {
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(50, 184, 198, 0.3);
}

/* Dark mode timeline achievements */
[data-color-scheme="dark"] .timeline__achievements {
  border-top-color: rgba(119, 124, 124, 0.3);
}

[data-color-scheme="dark"] .timeline__achievements li::before {
  color: var(--color-teal-300);
}

/* Enhanced dark mode in blue tones for manual theme */
[data-color-scheme="dark"] .hero::before {
  background: var(--color-bg-1);
  opacity: 0.4;
}

[data-color-scheme="dark"] .about {
  background: var(--color-bg-3);
}

[data-color-scheme="dark"] .projects {
  background: var(--color-bg-5);
}

[data-color-scheme="dark"] .services {
  background: var(--color-bg-8);
}

/* Dark mode avatar image */
[data-color-scheme="dark"] .hero__avatar-image {
  filter: brightness(0.95) contrast(1.05);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */
/* Custom enhancements for theme switching */
:root {
  /* Transition variables for smooth theme changes */
  --theme-transition: all 0.2s var(--ease-standard);
}

/* Smooth transitions for theme changes - ТОЛЬКО для смены темы */
.preload * {
  transition: none !important;
}

/* Theme transitions включаются только после загрузки */
body:not(.preload) * {
  transition: background-color var(--theme-transition), 
              color var(--theme-transition), 
              border-color var(--theme-transition);
}

/* Отключаем лишние transitions которые могут вызвать мерцание */
body:not(.preload) .timeline__item,
body:not(.preload) section,
body:not(.preload) .container {
  transition: background-color var(--theme-transition), 
              color var(--theme-transition);
}

/* Theme change animation */
.theme-changing * {
  transition: background-color 0.1s ease, 
              color 0.1s ease, 
              border-color 0.1s ease !important;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(var(--color-background), 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: var(--theme-transition);
}

.header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) 0;
}

.header__left {
  display: flex;
  align-items: center;
  gap: var(--space-24);
}

.logo__text {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  position: relative;
}

.logo__text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* Специальная кнопка блога */
.blog-button {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  background: linear-gradient(135deg, var(--color-primary) 0%, #4CAF50 100%);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.2);
  position: relative;
  overflow: hidden;
}

.blog-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.blog-button:hover::before {
  left: 100%;
}

.blog-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.3);
  background: linear-gradient(135deg, #4CAF50 0%, var(--color-primary) 100%);
}

.blog-button:active {
  transform: translateY(0);
}

.blog-button__icon {
  font-size: 16px;
  animation: blogPulse 2s infinite;
}

.blog-button__text {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

@keyframes blogPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Темная тема для кнопки блога */
[data-theme="dark"] .blog-button {
  background: linear-gradient(135deg, var(--color-primary) 0%, #66BB6A 100%);
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

[data-theme="dark"] .blog-button:hover {
  background: linear-gradient(135deg, #66BB6A 0%, var(--color-primary) 100%);
  box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.4);
}

.blog-button-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* Темная тема для блоков кода в статьях */
[data-theme="dark"] .article__content pre {
  background: #0d1117;
  border: 1px solid #30363d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow-y: visible;
}

[data-theme="dark"] .article__content pre code {
  color: #f0f6fc;
  font-weight: 500;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] .article__content code {
  background: none;
  color: #58a6ff;
  border: none;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nav__list {
  display: flex;
  gap: var(--space-16);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  transition: var(--theme-transition);
  position: relative;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-base);
  text-decoration: none;
}

.nav__link:hover {
  color: var(--color-text);
  background: var(--color-secondary);
}

.nav__link.active {
  color: var(--color-primary);
  background: var(--color-secondary);
}

.theme-toggle {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-10);
  cursor: pointer;
  transition: var(--theme-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--color-secondary-hover);
  transform: scale(1.05);
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb, 33, 128, 141), 0.3);
}

/* Enhanced hover effect for dark theme */
[data-color-scheme="dark"] .theme-toggle:hover {
  box-shadow: 0 0 25px rgba(50, 184, 198, 0.4), 0 0 50px rgba(50, 184, 198, 0.1);
}

[data-color-scheme="dark"] .theme-toggle::before {
  background: linear-gradient(135deg, var(--color-teal-300), var(--color-teal-400));
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle__icon {
  font-size: var(--font-size-lg);
  transition: transform var(--duration-normal) var(--ease-standard);
  z-index: 2;
  position: relative;
}

/* Theme toggle glow effect */
.theme-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-standard);
  border-radius: var(--radius-full);
}

.theme-toggle:hover::before {
  opacity: 0.1;
}

/* Theme toggle focus states */
.theme-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb, 33, 128, 141), 0.1);
}

/* Theme toggle loading state */
.theme-toggle.loading {
  pointer-events: none;
  opacity: 0.7;
}

.theme-toggle.loading .theme-toggle__icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hero Section */
.hero {
  padding: 140px 0 80px;
  background: var(--color-background);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-1);
  opacity: 0.6;
  z-index: 0;
}

.hero__content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-32);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__title {
  font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-4xl));
  margin-bottom: var(--space-20);
  color: var(--color-text);
  line-height: 1.2;
  font-weight: var(--font-weight-bold);
}

.hero__subtitle {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
  margin-bottom: var(--space-24);
  font-weight: var(--font-weight-semibold);
}

.hero__description {
  font-size: var(--font-size-lg);
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-32);
  max-width: 600px;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-20);
  margin-bottom: var(--space-32);
}

.metric {
  text-align: center;
  padding: var(--space-20);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
}

.metric:hover {
  transform: translateY(-5px);
  background: var(--color-bg-2);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.metric__value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-8);
}

.metric__label {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.hero__actions {
  display: flex;
  gap: var(--space-20);
  flex-wrap: wrap;
}

.hero__avatar {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: float 6s ease-in-out infinite;
  position: relative;
  border: 3px solid var(--color-border);
  overflow: hidden;
  max-width: 100%;
  max-height: 60vw;
  min-width: 120px;
  min-height: 120px;
  aspect-ratio: 1/1;
}

.hero__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
  transition: var(--theme-transition);
  filter: brightness(1) contrast(1);
  display: block;
}

.hero__avatar:hover .hero__avatar-image {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.1);
}

/* Photo loading state */
.hero__avatar-image:not([src]) {
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-btn-primary-text);
  font-size: 72px;
  font-weight: var(--font-weight-bold);
}

.hero__avatar-image:not([src])::after {
  content: 'СЮХ';
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

@media (max-width: 700px) {
  .hero__content {
    grid-template-columns: 1fr;
    gap: var(--space-20);
    text-align: center;
  }
  .hero__avatar {
    width: 140px;
    height: 140px;
    min-width: 90px;
    min-height: 90px;
    margin: 0 auto 24px auto;
  }
  .hero__avatar-image {
    width: 100%;
    height: 100%;
  }
}

/* Section common styles */
.section__title {
  font-size: var(--font-size-3xl);
  text-align: center;
  margin-bottom: var(--space-32);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  position: relative;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* About Section */
.about {
  padding: var(--space-32) 0;
  background: var(--color-bg-3);
}

.about__text p {
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-24);
}

.about__text p:first-child {
  color: var(--color-text);
}

.about__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-top: var(--space-32);
  padding: var(--space-24);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.detail {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.detail__label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  min-width: 120px;
}

.detail__value {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

/* Experience Timeline */
.experience {
  padding: var(--space-32) 0;
  background: var(--color-background);
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-32);
  padding-left: 80px;
}

.timeline__marker {
  position: absolute;
  left: 18px;
  top: 20px;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  border: 3px solid var(--color-background);
  box-shadow: 0 0 0 3px var(--color-primary);
}

.timeline__content {
  background: var(--color-surface);
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
}

.timeline__content:hover {
  transform: translateX(10px);
  background: var(--color-bg-4);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.timeline__period {
  font-size: var(--font-size-sm);
  color: var(--color-success);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-4);
}

.timeline__duration {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-12);
}

.timeline__title {
  font-size: var(--font-size-xl);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-8);
}

.timeline__company {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-4);
}

.timeline__location {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-16);
}

.timeline__description {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-16);
}

.timeline__achievements {
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid var(--color-border);
}

.timeline__achievements strong {
  color: var(--color-primary);
  display: block;
  margin-bottom: var(--space-12);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline__achievements ul {
  margin: 0;
  padding-left: var(--space-20);
  list-style: none;
}

.timeline__achievements li {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-8);
  position: relative;
  font-size: var(--font-size-sm);
}

.timeline__achievements li::before {
  content: '▸';
  color: var(--color-primary);
  font-weight: bold;
  position: absolute;
  left: -20px;
  top: 0;
}

/* Projects Section */
.projects {
  padding: var(--space-32) 0;
  background: var(--color-bg-5);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-24);
}

.project-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: var(--theme-transition);
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.project-card__header {
  padding: var(--space-24);
  border-bottom: 1px solid var(--color-border);
}

.project-card__title {
  font-size: var(--font-size-xl);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-12);
}

.project-card__meta {
  display: flex;
  gap: var(--space-16);
  align-items: center;
  flex-wrap: wrap;
}

.project-card__period {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.project-card__company {
  color: var(--color-success);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.project-card__content {
  padding: var(--space-24);
}

.project-card__description {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-20);
}

.project-card__technologies {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  margin-bottom: var(--space-20);
}

.tech-tag {
  background: var(--color-secondary);
  color: var(--color-primary);
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--color-border);
}

.project-card__impact {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  padding: var(--space-12);
  background: var(--color-bg-6);
  border-radius: var(--radius-base);
  border-left: 3px solid var(--color-success);
}

.project-card__impact strong {
  color: var(--color-text);
}

/* Skills Section */
.skills {
  padding: var(--space-32) 0;
  background: var(--color-background);
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-24);
}

.skill-category {
  background: var(--color-surface);
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.skill-category:hover {
  background: var(--color-bg-7);
  border-color: var(--color-primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.skill-category__title {
  font-size: var(--font-size-xl);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-8);
}

.skill-category__level {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: inline-block;
  margin-bottom: var(--space-20);
}

.skill-category__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.skill-tag {
  background: var(--color-secondary);
  color: var(--color-text);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
}

.skill-tag:hover {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

/* Services Section */
.services {
  padding: var(--space-32) 0;
  background: var(--color-bg-8);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: var(--space-24);
}

.service-card {
  background: var(--color-surface);
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.service-card:hover {
  transform: translateY(-8px);
  background: var(--color-bg-1);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.service-card__icon {
  font-size: 48px;
  margin-bottom: var(--space-16);
  display: block;
  transition: var(--theme-transition);
}

.service-card:hover .service-card__icon {
  transform: scale(1.1);
}

.service-card__title {
  font-size: var(--font-size-xl);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-12);
}

.service-card__description {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Contact Section */
.contact {
  padding: var(--space-32) 0;
  background: var(--color-background);
}

.contact__content {
  max-width: 800px;
  margin: 0 auto;
}

.contact__text h3 {
  font-size: var(--font-size-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-16);
  font-weight: var(--font-weight-semibold);
}

.contact__text p {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-24);
}

.contact__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-20);
}

.contact__item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: var(--color-surface);
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
}

.contact__item:hover {
  background: var(--color-bg-2);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Enhanced contact item interactions */
.contact__item[data-clickable="true"] {
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
}

.contact__item[data-clickable="true"]:hover {
  background: var(--color-bg-2);
  border-color: var(--color-primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.contact__item[data-clickable="true"]:active {
  transform: translateY(0) scale(0.98);
}

.contact__item-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.contact__item-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.contact__item-value {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.contact__item-value a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact__item-value a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.contact__item-icon svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

/* VK icon styles */
.vk-icon {
  width: 24px;
  height: 24px;
  background: #0077ff;
  color: #000000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  font-family: Arial, sans-serif;
  letter-spacing: -0.5px;
  text-shadow: 0 0 1px rgba(0,0,0,0.5);
}

/* Clickable icon links */
.contact__item-icon-link {
  text-decoration: none;
  transition: transform 0.2s ease;
}

.contact__item-icon-link:hover {
  transform: scale(1.1);
}

/* Clickable contact blocks */
.contact__item.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

/* ============================================
   Article Page Styles
   ============================================ */

/* Breadcrumbs */
.breadcrumbs {
  padding: var(--space-4) 0;
  background: var(--color-bg-2);
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-sm);
}

.breadcrumbs__item:not(:last-child)::after {
  content: '/';
  margin: 0 var(--space-2);
  color: var(--color-text-secondary);
}

.breadcrumbs__link {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.breadcrumbs__link:hover {
  color: var(--color-primary);
}

.breadcrumbs__item[aria-current="page"] {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

/* Breadcrumb Navigation */
.breadcrumb {
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.breadcrumb a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Article Layout */
.article {
  padding: var(--space-16) 0;
  max-width: 700px; /* Уменьшили ширину с 800px до 700px */
  margin: 0 auto;
  padding-left: var(--space-32); /* Увеличили отступы по бокам до 32px */
  padding-right: var(--space-32);
}

.article__header {
  margin-bottom: var(--space-12);
}

.article__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.article__date {
  font-weight: var(--font-weight-medium);
}

.article__read-time::before {
  content: '•';
  margin-right: var(--space-2);
}

.article__title {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-8);
}

.article__tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--color-primary), #667eea);
  color: var(--color-white);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article__tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.article__tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.article__tag:hover::before {
  left: 100%;
}

.article__image {
  margin-bottom: var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.article__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Article Content */
.article__content {
  line-height: 1.7;
  color: var(--color-text);
  padding: 0 var(--space-16); /* Увеличили внутренние отступы до 16px */
  max-width: 100%;
}

.article__content h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: var(--space-10) 0 var(--space-4) 0;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: var(--space-2);
}

.article__content h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: var(--space-8) 0 var(--space-3) 0;
  color: var(--color-text);
}

.article__content p {
  margin-bottom: var(--space-4);
  text-align: justify;
}

.article__content ul,
.article__content ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.article__content li {
  margin-bottom: var(--space-2);
}

.article__content code {
  background: var(--color-bg-secondary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.85em;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.article__content pre {
  background: var(--color-surface);
  padding: var(--space-20);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: visible;
  margin: var(--space-24) 0;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  white-space: pre;
  word-wrap: normal;
}

.article__content pre code {
  background: none;
  border: none;
  padding: 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
  color: var(--color-text);
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Кнопка копирования для блоков кода */
.code-copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  cursor: pointer;
  opacity: 0;
  transition: all var(--duration-fast) ease;
  font-size: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.code-copy-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: scale(1.05);
}

.article__content pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn.copied {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

/* Темная тема для кнопки копирования */
[data-theme="dark"] .code-copy-btn {
  background: #30363d;
  border-color: #30363d;
  color: #f0f6fc;
}

[data-theme="dark"] .code-copy-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.article__content a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--duration-fast) ease;
}

.article__content a:hover {
  color: var(--color-primary-dark);
}

.article__content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--space-4);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Специальные блоки в статьях */
.article__tldr {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-20);
  margin: var(--space-32) 0;
  font-size: var(--font-lg);
}

.article__note {
  background: var(--color-bg-info);
  border: 1px solid var(--color-info);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-md);
  padding: var(--space-16);
  margin: var(--space-24) 0;
}

.article__warning {
  background: var(--color-bg-warning);
  border: 1px solid var(--color-warning);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  padding: var(--space-16);
  margin: var(--space-24) 0;
}

.article__cta {
  background: var(--color-bg-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  margin: var(--space-32) 0;
  text-align: center;
}

.article__update {
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  margin-top: var(--space-32);
  text-align: center;
}

/* Таблица сравнения */
.table-responsive {
  overflow-x: auto;
  margin: var(--space-24) 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-12) var(--space-16);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
  background: var(--color-bg-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.comparison-table tr:hover {
  background: var(--color-bg-7);
}

.comparison-table td:first-child {
  font-weight: var(--font-weight-medium);
}

/* Article Loading */
.article__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-16) 0;
  color: var(--color-text-secondary);
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Article Footer */
.article__footer {
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 2px solid var(--color-border);
}

.article__author {
  margin-bottom: var(--space-8);
}

.article__author-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.article__author-bio {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.article__share h4 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.article__share-buttons {
  display: flex;
  gap: var(--space-3);
}

.article__share-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--duration-fast) ease;
}

.article__share-btn--telegram {
  background: #0088cc;
  color: white;
}

.article__share-btn--telegram:hover {
  background: #0077bb;
  transform: translateY(-2px);
}

.article__share-btn--vk {
  background: #0077ff;
  color: white;
}

.article__share-btn--vk:hover {
  background: #0066ee;
  transform: translateY(-2px);
}

/* Кнопки поделиться */
.share-buttons {
  display: flex;
  gap: var(--space-12);
  flex-wrap: wrap;
  margin-top: var(--space-16);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-20);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  min-width: 120px;
  justify-content: center;
}

.share-btn__icon {
  font-size: 1.2em;
}

.share-btn__text {
  white-space: nowrap;
}

.share-btn--telegram {
  background: linear-gradient(135deg, #0088cc, #229ed9);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.share-btn--telegram:hover {
  background: linear-gradient(135deg, #0077bb, #1e8cc8);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
}

.share-btn--vk {
  background: linear-gradient(135deg, #0077ff, #4c9aff);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 119, 255, 0.3);
}

.share-btn--vk:hover {
  background: linear-gradient(135deg, #0066ee, #3d8bff);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 119, 255, 0.4);
}

.share-btn--whatsapp {
  background: linear-gradient(135deg, #25d366, #4fda82);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.share-btn--whatsapp:hover {
  background: linear-gradient(135deg, #20c157, #45c970);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

/* Адаптивность для кнопок поделиться */
@media (max-width: 768px) {
  .share-buttons {
    flex-direction: column;
    gap: var(--space-8);
  }
  
  .share-btn {
    width: 100%;
    min-width: auto;
  }
}
.article-nav {
  padding: var(--space-8) 0;
  background: var(--color-bg-2);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-16);
}

.article-nav__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.article-nav__back {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-fast) ease;
}

.article-nav__back:hover {
  color: var(--color-primary-dark);
}

.article-nav__adjacent {
  display: flex;
  gap: var(--space-6);
}

.article-nav__next,
.article-nav__prev {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  max-width: 200px;
}

.article-nav__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}

.article-nav__title {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-fast) ease;
}

.article-nav__next:hover .article-nav__title,
.article-nav__prev:hover .article-nav__title {
  color: var(--color-primary-dark);
}

/* Mobile Adaptations */
@media (max-width: 768px) {
  .main {
    padding-top: 200px !important;
  }
  
  .breadcrumb {
    margin-bottom: var(--space-4);
    font-size: var(--font-size-xs);
  }
  
  .article {
    padding: var(--space-8) var(--space-4); /* Добавили горизонтальные отступы для мобильных */
  }

  .article__title {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
    line-height: 1.3;
  }

  .article__content {
    font-size: var(--font-size-sm);
    padding: 0; /* Убираем дублирование отступов */
    line-height: 1.8;
  }

  .article__content p {
    margin-bottom: var(--space-6);
    line-height: 1.8;
    padding: 0; /* Убираем лишние отступы */
  }

  .article__content ul,
  .article__content ol {
    padding-left: var(--space-8);
    margin: var(--space-6) var(--space-2);
  }

  .article__content li {
    margin-bottom: var(--space-3);
    line-height: 1.7;
    padding-right: var(--space-2);
  }

  .article__content h2 {
    padding: 0 var(--space-2);
    margin: var(--space-12) 0 var(--space-6) 0;
    line-height: 1.4;
  }

  .article__content h3 {
    padding: 0 var(--space-2);
    margin: var(--space-10) 0 var(--space-4) 0;
    line-height: 1.4;
  }

  .article__content pre {
    padding: var(--space-3);
    font-size: var(--font-size-xs);
    margin: var(--space-6) var(--space-2);
    overflow-y: visible;
    white-space: pre;
    word-wrap: normal;
  }

  /* Кнопка копирования в мобильной версии */
  .code-copy-btn {
    opacity: 1;
    top: var(--space-1);
    right: var(--space-1);
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .article-nav__content {
    flex-direction: column;
    align-items: stretch;
  }

  .article-nav__adjacent {
    flex-direction: column;
  }

  .article__share-buttons {
    flex-direction: column;
  }

  .breadcrumbs__list {
    font-size: var(--font-size-xs);
  }
}

/* ============================================
   Footer and other components
   ============================================ */

/* Footer */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-24) 0;
  text-align: center;
}

.footer__text p {
  color: var(--color-text-secondary);
  margin: 0;
}

.footer__note {
  margin-top: var(--space-8) !important;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero__metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .projects__grid {
    grid-template-columns: 1fr;
  }
  
  /* Ensure photo looks good on tablets */
  .hero__avatar {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .header__content {
    padding: var(--space-12) 0;
    flex-wrap: wrap;
    min-height: 80px;
  }
  
  .header__left {
    gap: var(--space-16);
    width: 100%;
    justify-content: space-between;
    order: 1;
  }
  
  .blog-button {
    padding: var(--space-6) var(--space-12);
    font-size: var(--font-size-xs);
    gap: var(--space-6);
  }
  
  .blog-button__icon {
    font-size: 14px;
  }
  
  .blog-button__text {
    font-size: var(--font-size-xs);
  }
  
  .nav__list {
    gap: var(--space-8);
    width: 100%;
    justify-content: center;
    order: 2;
    margin-top: var(--space-8);
  }
  
  .nav__link {
    padding: var(--space-6) var(--space-8);
    font-size: var(--font-size-sm);
  }
  
  .hero {
    padding: 103px 0 60px;
  }
  
  .hero__metrics {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
  
  .metric {
    padding: var(--space-16);
  }
  
  .hero__avatar {
    width: 200px;
    height: 200px;
  }
  
  .hero__avatar-image {
    border-radius: var(--radius-full);
  }
  
  .timeline {
    padding-left: var(--space-16);
  }
  
  .timeline::before {
    left: 20px;
  }
  
  .timeline__marker {
    left: 8px;
  }
  
  .timeline__item {
    padding-left: 60px;
  }
  
  .skills__grid,
  .services__grid {
    grid-template-columns: 1fr;
  }
  
  .contact__details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header__content {
    flex-direction: column;
    gap: var(--space-12);
    padding: var(--space-16) 0;
    min-height: 120px;
  }
  
  .header__left {
    width: 100%;
    justify-content: space-between;
  }
  
  .blog-button {
    padding: var(--space-4) var(--space-10);
    font-size: var(--font-size-xs);
    gap: var(--space-4);
  }
  
  .blog-button__icon {
    font-size: 12px;
  }
  
  .blog-button__text {
    font-size: var(--font-size-xs);
  }
  
  .nav__list {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-6);
    width: 100%;
  }
  
  .hero {
    padding: 113px 0 60px;
  }
  
  .hero__metrics {
    grid-template-columns: 1fr;
  }
  
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }
  
  .hero__avatar {
    width: 150px;
    height: 150px;
  }
  
  .hero__avatar-image {
    border-radius: var(--radius-full);
  }
  
  .timeline__item {
    padding-left: 50px;
  }
  
  .timeline__achievements ul {
    padding-left: var(--space-16);
  }
  
  .timeline__achievements li::before {
    left: -16px;
  }
  
  .projects__grid,
  .services__grid,
  .skills__grid,
  .blog__articles {
    grid-template-columns: 1fr;
  }

  /* Улучшенные стили для статей на малых экранах */
  .article__content {
    padding: 0 var(--space-6);
    line-height: 1.9;
  }

  .article__content p {
    margin-bottom: var(--space-8);
    line-height: 1.9;
    padding: 0 var(--space-4);
  }

  .article__content ul,
  .article__content ol {
    padding-left: var(--space-10);
    margin: var(--space-8) var(--space-4);
  }

  .article__content li {
    margin-bottom: var(--space-4);
    line-height: 1.8;
    padding-right: var(--space-4);
  }

  .article__content h2 {
    padding: 0 var(--space-4);
    margin: var(--space-16) 0 var(--space-8) 0;
  }

  .article__content h3 {
    padding: 0 var(--space-4);
    margin: var(--space-12) 0 var(--space-6) 0;
  }

  .article__content pre {
    margin: var(--space-8) var(--space-4);
    padding: var(--space-4);
    overflow-y: visible;
    white-space: pre;
    word-wrap: normal;
  }

  .article__content code {
    padding: var(--space-2) var(--space-3);
  }

  /* Кнопка копирования для экранов 480px */
  .code-copy-btn {
    opacity: 1;
    top: var(--space-1);
    right: var(--space-1);
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}

/* Дополнительные правила для очень узких экранов */
@media (max-width: 360px) {
  .hero {
    padding: 133px 0 40px;
  }
  
  .header__content {
    padding: var(--space-20) 0;
  }

  /* Максимальная читаемость для самых узких экранов */
  .article__content {
    padding: 0 var(--space-8);
    line-height: 2.0;
  }

  .article__content p {
    margin-bottom: var(--space-10);
    line-height: 2.0;
    padding: 0 var(--space-6);
  }

  .article__content ul,
  .article__content ol {
    padding-left: var(--space-12);
    margin: var(--space-10) var(--space-6);
  }

  .article__content li {
    margin-bottom: var(--space-6);
    line-height: 1.9;
    padding-right: var(--space-6);
  }

  .article__content h2 {
    padding: 0 var(--space-6);
    margin: var(--space-20) 0 var(--space-10) 0;
  }

  .article__content h3 {
    padding: 0 var(--space-6);
    margin: var(--space-16) 0 var(--space-8) 0;
  }

  .article__content pre {
    margin: var(--space-10) var(--space-6);
    padding: var(--space-6);
    font-size: var(--font-size-xs);
    overflow-y: visible;
    white-space: pre;
    word-wrap: normal;
  }

  .article__content code {
    padding: var(--space-3) var(--space-4);
  }

  /* Кнопка копирования для экранов 360px */
  .code-copy-btn {
    opacity: 1 !important;
    top: var(--space-2) !important;
    right: var(--space-2) !important;
    bottom: auto !important;
    left: auto !important;
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
}

/* --- Blog Styles --- */

.blog {
  padding: var(--space-32) 0;
  background: var(--color-background);
}

.blog__intro {
  text-align: center;
  margin-bottom: var(--space-32);
}

.blog__intro p {
  font-size: var(--font-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.blog__articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
  margin-bottom: var(--space-48);
}

.blog__loading {
  text-align: center;
  padding: var(--space-64);
  color: var(--color-text-secondary);
  font-size: var(--font-lg);
}

.blog__loading-icon {
  font-size: 3rem;
  margin-bottom: var(--space-20);
  animation: pulse 2s infinite;
}

.blog__loading h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-16);
  font-size: var(--font-xl);
}

.blog__loading p {
  margin-bottom: var(--space-16);
}

.blog__loading-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 400px;
  margin: 0 auto;
}

.blog__loading-tips li {
  text-align: left;
  padding: var(--space-8) var(--space-16);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
}

.blog__noscript {
  text-align: center;
  padding: var(--space-32);
  background: #fff3cd;
  border: 1px solid #ffecb5;
  border-radius: var(--radius-md);
  color: #856404;
}

.blog__noscript h3 {
  margin-bottom: var(--space-12);
  color: #856404;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.blog__empty {
  text-align: center;
  padding: var(--space-64);
  color: var(--color-text-secondary);
  font-size: var(--font-lg);
}

.blog__empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-20);
}

.blog__empty h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-16);
  font-size: var(--font-xl);
}

.blog__empty p {
  margin-bottom: var(--space-24);
}

/* Карточка статьи */
.blog-card {
  background: var(--color-surface);
  padding: var(--space-24);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.blog-card:hover {
  background: var(--color-bg-7);
  border-color: var(--color-primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.blog-card__header {
  margin-bottom: var(--space-20);
}

.blog-card__title {
  font-size: var(--font-size-xl);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-12) 0;
  line-height: 1.3;
}

.blog-card__title-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-card__title-link:hover {
  color: var(--color-primary);
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
}

.blog-card__date {
  position: relative;
}

.blog-card__date::after {
  content: '•';
  margin-left: var(--space-16);
  color: var(--color-border);
}

.blog-card__content {
  margin-bottom: var(--space-24);
}

.blog-card__excerpt {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--space-16) 0;
}

.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-top: var(--space-16);
}

.blog-card__tag {
  display: inline-block;
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  font-weight: 500;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.blog-card__tag:hover {
  background: var(--color-primary);
  color: var(--color-bg-primary);
  border-color: var(--color-primary);
}

.blog-card__arrow {
  font-size: var(--font-sm);
  opacity: 0.7;
  transition: transform var(--duration-fast) ease;
}

.blog-card__title-link:hover .blog-card__arrow {
  transform: translateX(4px);
}

/* Стили для карточек-заглушек */
.blog-card--placeholder {
  opacity: 0.7;
  border-style: dashed;
}

.blog-card--placeholder .blog-card__title {
  color: var(--color-text-secondary);
}

.blog-card--placeholder .blog-card__arrow {
  animation: pulse 2s infinite;
}

/* Карточка-заглушка для будущих статей */
.blog-card--placeholder {
  opacity: 0.6;
  background: var(--color-bg-secondary);
  border-style: dashed;
  border-color: var(--color-border);
}

.blog-card--placeholder::before {
  background: var(--color-text-secondary);
}

.blog-card--placeholder:hover {
  transform: none;
  box-shadow: none;
  opacity: 0.8;
}

.blog-card--placeholder .blog-card__title {
  color: var(--color-text-secondary);
}

.blog-card--placeholder .blog-card__placeholder-text {
  cursor: default;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-card--placeholder .blog-card__tag {
  opacity: 0.7;
}

.blog-card__read-more:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(33, 140, 141, 0.3);
}

.blog-card__read-more:hover::before {
  left: 100%;
}

/* Пагинация */
.blog__pagination {
  display: flex;
  justify-content: center;
  margin-top: var(--space-64);
  margin-bottom: var(--space-48);
  padding: var(--space-32) 0;
}

.blog-pagination {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.blog-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  text-decoration: none;
  min-width: 44px;
  text-align: center;
  position: relative;
}

.blog-pagination__btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.blog-pagination__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-pagination__btn--active {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border-color: var(--color-primary);
}

.blog-pagination__btn--active:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-btn-primary-text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.blog-pagination__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Темная тема для пагинации */
[data-theme="dark"] .blog-pagination__btn {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

[data-theme="dark"] .blog-pagination__btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .blog-pagination__btn--active {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border-color: var(--color-primary);
}

[data-theme="dark"] .blog-pagination__btn--active:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

/* Модальное окно для полной статьи */
.blog-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.blog-modal--show {
  opacity: 1;
  visibility: visible;
}

.blog-modal--hide {
  opacity: 0;
  visibility: hidden;
}

.blog-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.blog-modal__content {
  position: relative;
  max-width: 800px;
  max-height: 90vh;
  margin: 5vh auto;
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
}

.blog-modal__close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--font-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.blog-modal__close:hover {
  background: var(--color-danger);
  color: var(--color-bg-primary);
  border-color: var(--color-danger);
}

/* Полная статья */
.blog-article {
  padding: var(--space-48);
  max-height: 85vh;
  overflow-y: auto;
}

.blog-article__header {
  margin-bottom: var(--space-32);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-24);
}

.blog-article__title {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-16) 0;
  line-height: 1.2;
}

.blog-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
}

.blog-article__author,
.blog-article__date,
.blog-article__read-time {
  position: relative;
}

.blog-article__author::after,
.blog-article__date::after {
  content: '•';
  margin-left: var(--space-16);
  color: var(--color-border);
}

.blog-article__content {
  line-height: 1.7;
  color: var(--color-text-primary);
}

.blog-article__content h1,
.blog-article__content h2,
.blog-article__content h3,
.blog-article__content h4 {
  margin: var(--space-32) 0 var(--space-16) 0;
  color: var(--color-text-primary);
}

.blog-article__content h1 {
  font-size: var(--font-2xl);
}

.blog-article__content h2 {
  font-size: var(--font-xl);
}

.blog-article__content h3 {
  font-size: var(--font-lg);
}

.blog-article__content p {
  margin: 0 0 var(--space-16) 0;
}

.blog-article__content ul,
.blog-article__content ol {
  margin: var(--space-16) 0;
  padding-left: var(--space-24);
}

.blog-article__content li {
  margin-bottom: var(--space-8);
}

.blog-article__content code {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.blog-article__content pre {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-20);
  margin: var(--space-20) 0;
  overflow-x: auto;
}

.blog-article__content pre code {
  background: none;
  color: var(--color-text-primary);
  padding: 0;
  border-radius: 0;
}

.blog-article__content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--space-20);
  margin: var(--space-20) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.blog-article__footer {
  margin-top: var(--space-40);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border);
}

.blog-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.blog-article__tag {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-bg-primary);
  padding: var(--space-6) var(--space-16);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
}

/* Инструкции для сервера */
.blog__server-instructions {
  text-align: center;
  padding: var(--space-64) var(--space-32);
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--color-border);
  margin: var(--space-32) 0;
}

.blog__server-icon {
  font-size: 4rem;
  margin-bottom: var(--space-20);
}

.blog__server-instructions h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-16);
  font-size: var(--font-xl);
}

.blog__server-instructions p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-24);
  font-size: var(--font-lg);
}

.blog__instructions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin: var(--space-24) 0;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.instruction-step {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: var(--color-bg-primary);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-sm);
  flex-shrink: 0;
}

.step-text code {
  background: var(--color-bg-primary);
  color: var(--color-primary);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.step-text kbd {
  background: var(--color-text-primary);
  color: var(--color-bg-primary);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  border: 1px solid var(--color-border);
}

.blog__demo-btn,
.blog__retry-btn {
  background: var(--color-primary);
  color: var(--color-bg-primary);
  border: none;
  padding: var(--space-16) var(--space-32);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: var(--space-24);
  font-size: var(--font-md);
}

.blog__demo-btn:hover,
.blog__retry-btn:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(33, 140, 141, 0.3);
}

/* Ошибки блога */
.blog__error {
  text-align: center;
  padding: var(--space-64) var(--space-32);
  background: #fee;
  border-radius: var(--radius-lg);
  border: 2px solid #fcc;
  margin: var(--space-32) 0;
}

.blog__error-icon {
  font-size: 3rem;
  margin-bottom: var(--space-16);
}

.blog__error h3 {
  color: #c33;
  margin-bottom: var(--space-16);
  font-size: var(--font-xl);
}

.blog__error p {
  color: #866;
  margin-bottom: var(--space-24);
}

/* Адаптивность блога */
@media (max-width: 768px) {
  .blog {
    padding: var(--space-64) 0;
  }
  
  .blog__articles {
    grid-template-columns: 1fr;
    gap: var(--space-20);
  }
  
  .blog-card {
    padding: var(--space-24);
  }
  
  .blog-card__title {
    font-size: var(--font-lg);
  }
  
  .blog__pagination {
    margin-top: var(--space-48);
    margin-bottom: var(--space-32);
    padding: var(--space-24) 0;
  }
  
  .blog-pagination {
    gap: var(--space-4);
  }
  
  .blog-pagination__btn {
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    min-width: 36px;
  }
  
  .blog-card__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
  }
  
  .blog-card__date::after {
    display: none;
  }
  
  .blog-modal__content {
    margin: 2vh var(--space-16);
    max-height: 96vh;
  }
  
  .blog-article {
    padding: var(--space-32) var(--space-24);
  }
  
  .blog-article__title {
    font-size: var(--font-xl);
  }
  
  .blog-article__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
  }
  
  .blog-article__author::after,
  .blog-article__date::after {
    display: none;
  }
  
  .blog-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Адаптивность для тегов статей */
@media (max-width: 768px) {
  .article__tags {
    gap: 6px;
  }
  
  .article__tag {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* Темная тема для тегов */
[data-theme="dark"] .article__tag {
  background: linear-gradient(135deg, #374151, #4f46e5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .article__tag:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Кнопка "Наверх" */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  backdrop-filter: blur(10px);
}

.scroll-to-top.visible {
  opacity: 0.7;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-color: rgba(var(--color-primary-rgb), 0.3);
}

.scroll-to-top::before {
  content: '↑';
  color: rgba(var(--color-text-secondary-rgb), 0.8);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: color 0.3s ease;
}

.scroll-to-top:hover::before {
  color: var(--color-primary);
}

/* Темная тема для кнопки "Наверх" */
[data-theme="dark"] .scroll-to-top {
  background: rgba(30, 30, 30, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .scroll-to-top:hover {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .scroll-to-top::before {
  color: rgba(156, 163, 175, 0.8);
}

[data-theme="dark"] .scroll-to-top:hover::before {
  color: #6366f1;
}

/* Адаптивность для кнопки "Наверх" */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  .scroll-to-top::before {
    font-size: 18px;
  }
}

/* --- Blog Page Styles --- */

/* Utility Classes */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Breadcrumb Navigation */
.breadcrumb {
  padding: var(--space-16) 0;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--font-sm);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__item:not(:last-child)::after {
  content: '→';
  margin-left: var(--space-8);
  color: var(--color-text-secondary);
  font-size: var(--font-xs);
}

.breadcrumb__link {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.breadcrumb__link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.breadcrumb__current {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Blog Hero Section */
.blog-hero {
  padding: var(--space-64) 0 var(--space-48) 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white; /* Белый цвет по умолчанию */
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Светлая тема - темный цвет текста */
[data-color-scheme="light"] .blog-hero {
  color: var(--color-text);
}

[data-theme="light"] .blog-hero {
  color: var(--color-text);
}

/* Темная тема - белый цвет текста (по умолчанию) */
[data-color-scheme="dark"] .blog-hero {
  color: white;
}

[data-theme="dark"] .blog-hero {
  color: white;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.blog-hero__content {
  position: relative;
  z-index: 1;
  padding-top: 110px; /* Отступ от фиксированного меню */
}

.blog-hero__title {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-16) 0;
  line-height: 1.2;
}

.blog-hero__icon {
  display: inline-block;
  margin-right: var(--space-12);
  font-size: 3.5rem;
  vertical-align: middle;
}

.blog-hero__subtitle {
  font-size: var(--font-xl);
  margin: 0 0 var(--space-32) 0;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.blog-hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-48);
  margin-top: var(--space-32);
}

.blog-hero__stat {
  text-align: center;
}

.blog-hero__stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  margin-bottom: var(--space-8);
}

.blog-hero__stat-label {
  font-size: var(--font-sm);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Blog Main Section */
.blog-main {
  padding: var(--space-64) 0 var(--space-96) 0;
  background: var(--color-background);
  /* Убираем дополнительный отступ, так как уже есть в hero */
}

/* Blog Categories */
.blog-categories {
  margin-bottom: var(--space-48);
  text-align: center;
}

.blog-categories__title {
  font-size: var(--font-xl);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-24) 0;
  font-weight: var(--font-weight-semibold);
}

.blog-categories__list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.blog-category-btn {
  padding: var(--space-12) var(--space-24);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) ease;
  text-decoration: none;
  display: inline-block;
}

.blog-category-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-category-btn--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.blog-category-btn--active:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

/* Blog Search */
.blog-search {
  margin: var(--space-48) 0;
  padding: var(--space-24) 0;
  display: flex;
  justify-content: center;
}

.blog-search__wrapper {
  position: relative;
  max-width: 500px;
  width: 100%;
}

.blog-search__input {
  width: 100%;
  padding: var(--space-16) var(--space-24);
  padding-right: var(--space-56);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--font-base);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: border-color var(--duration-normal) ease;
}

.blog-search__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(33, 140, 141, 0.1);
}

.blog-search__input::placeholder {
  color: var(--color-text-secondary);
}

.blog-search__btn {
  position: absolute;
  right: var(--space-8);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-base);
  transition: background-color var(--duration-normal) ease;
}

.blog-search__btn:hover {
  background: var(--color-primary-dark);
}

/* Newsletter Section */
.newsletter {
  padding: var(--space-64) 0;
  background: var(--color-bg-secondary);
  text-align: center;
}

.newsletter__content {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter__title {
  font-size: var(--font-2xl);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-16) 0;
  font-weight: var(--font-weight-semibold);
}

.newsletter__icon {
  display: inline-block;
  margin-right: var(--space-12);
  font-size: 2.5rem;
  vertical-align: middle;
}

.newsletter__subtitle {
  font-size: var(--font-lg);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-32) 0;
  line-height: 1.5;
}

.newsletter__form {
  margin-bottom: var(--space-24);
}

.newsletter__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-24);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  max-width: 400px;
  margin: 0 auto;
}

.newsletter__note-icon {
  font-size: var(--font-lg);
  flex-shrink: 0;
}

/* Blog page newsletter spacing */
.blog-page .newsletter {
  padding-top: var(--space-96);
}

/* Blog page main spacing */
.blog-page .main {
  margin-bottom: var(--space-128) !important;
  padding-bottom: var(--space-64);
}

/* Blog View All Button */
.blog__view-all {
  text-align: center;
  margin-top: var(--space-80);
}

.blog__view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-32);
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--font-base);
  transition: all var(--duration-normal) ease;
  border: 2px solid var(--color-primary);
}

.blog__view-all-btn:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(33, 140, 141, 0.3);
}

.blog__view-all-arrow {
  transition: transform var(--duration-normal) ease;
}

.blog__view-all-btn:hover .blog__view-all-arrow {
  transform: translateX(4px);
}

/* Blog Empty State */
.blog__empty {
  text-align: center;
  padding: var(--space-64);
  color: var(--color-text-secondary);
  grid-column: 1 / -1;
}

.blog__empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-20);
  opacity: 0.5;
}

.blog__empty h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-16);
  font-size: var(--font-xl);
}

.blog__empty p {
  margin: 0;
  font-size: var(--font-base);
}

/* Pagination Styles */
.blog-pagination__btn--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.blog-pagination__btn--active:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
  transform: translateY(-2px);
}

/* Dark Theme Adjustments */
[data-theme="dark"] .blog-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: var(--color-text);
}

[data-theme="dark"] .blog-category-btn {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .blog-category-btn:hover {
  background: var(--color-bg-hover);
}

[data-theme="dark"] .blog-search__input {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

[data-theme="dark"] .newsletter {
  background: var(--color-bg-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-hero__title {
    font-size: 2rem;
  }
  
  .blog-hero__icon {
    font-size: 2.5rem;
  }
  
  .blog-hero__subtitle {
    font-size: var(--font-lg);
  }
  
  .blog-hero__stats {
    gap: var(--space-32);
  }
  
  .blog-hero__stat-number {
    font-size: 2rem;
  }
  
  .blog-categories__list {
    gap: var(--space-8);
  }
  
  .blog-category-btn {
    padding: var(--space-8) var(--space-16);
    font-size: var(--font-xs);
  }
  
  .blog-search__wrapper {
    max-width: none;
    margin: 0 var(--space-16);
  }
  
  .newsletter__title {
    font-size: var(--font-xl);
  }
  
  .newsletter__icon {
    font-size: 2rem;
  }
  
  /* Footer centering for mobile in blog page */
  .footer__content {
    justify-content: center;
    text-align: center;
  }
  
  .footer__section {
    max-width: 300px;
    margin: 0 auto var(--space-32) auto;
  }
}

/* Blog Page Navigation Styles */
.nav__list--center {
  justify-content: center;
}

.nav__brand .nav__logo-text {
  font-size: 1.5rem;
}

/* Horizontal Footer Links */
.footer__links--horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  justify-content: center;
}

.footer__links--horizontal li {
  margin: 0;
}

/* Horizontal Footer Content */
.footer__content--horizontal {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-32);
  text-align: center;
}

.footer__content--horizontal .footer__section {
  flex: 1;
  min-width: 200px;
}

.footer__content--horizontal .footer__links--horizontal {
  justify-content: center;
}

@media (max-width: 768px) {
  .footer__content--horizontal {
    flex-direction: column;
    gap: var(--space-24);
    text-align: center;
  }
  
  .footer__content--horizontal .footer__section {
    min-width: auto;
  }
}

/* Blog page nav styling to match main page height */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) 0;
}

.nav__brand,
.nav__menu,
.nav__actions {
  display: flex;
  align-items: center;
}

.nav__brand .nav__logo {
  text-decoration: none;
  color: var(--color-text-primary);
}

@media (max-width: 480px) {
  .blog-hero {
    padding: var(--space-48) 0 var(--space-32) 0;
  }
  
  .blog-hero__stats {
    flex-direction: column;
    gap: var(--space-24);
  }
  
  .blog-hero__stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-16);
  }
  
  .blog-hero__stat-number {
    font-size: 1.5rem;
    margin-bottom: 0;
  }
  
  .blog-categories__list {
    flex-direction: column;
    align-items: center;
  }
  
  .blog-category-btn {
    min-width: 150px;
  }
  
  .blog__articles {
    grid-template-columns: 1fr;
  }
}

/* --- 404 Error Page Styles --- */
.error-404 {
  padding: var(--space-64) 0;
  text-align: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-404__content {
  max-width: 600px;
  margin: 0 auto;
}

.error-404__icon {
  font-size: 6rem;
  margin-bottom: var(--space-24);
  opacity: 0.7;
}

.error-404__title {
  font-size: var(--font-2xl);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-20) 0;
  font-weight: var(--font-weight-semibold);
}

.error-404__description {
  font-size: var(--font-lg);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-40) 0;
  line-height: 1.6;
}

.error-404__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-16);
  margin-bottom: var(--space-48);
}

.error-404__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-14) var(--space-24);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--font-base);
  transition: all var(--duration-normal) ease;
  border: 2px solid transparent;
}

.error-404__btn--primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.error-404__btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 140, 141, 0.3);
}

.error-404__btn--secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.error-404__btn--secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.error-404__btn-icon {
  font-size: var(--font-sm);
}

.error-404__suggestions {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.error-404__suggestions-title {
  font-size: var(--font-lg);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-16) 0;
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.error-404__suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-404__suggestions-list li {
  margin-bottom: var(--space-12);
}

.error-404__suggestion-link {
  display: block;
  padding: var(--space-12) var(--space-16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: all var(--duration-normal) ease;
  position: relative;
}

.error-404__suggestion-link:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateX(4px);
}

.error-404__suggestion-link::after {
  content: '→';
  position: absolute;
  right: var(--space-16);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.error-404__suggestion-link:hover::after {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .error-404__icon {
    font-size: 4rem;
  }
  
  .error-404__title {
    font-size: var(--font-xl);
  }
  
  .error-404__description {
    font-size: var(--font-base);
  }
  
  .error-404__actions {
    flex-direction: column;
    align-items: center;
  }
  
  .error-404__btn {
    width: 200px;
    justify-content: center;
  }
}

/* Мобильная адаптация для страниц статей блога */
@media (max-width: 768px) {
  /* Уменьшаем высоту меню в статьях */
  .blog-page .header {
    height: 160px;
  }

  .blog-page .header .header__content {
    padding: 0.5rem 0;
  }

  /* Увеличиваем отступ сверху для контента статей */
  .blog-page .main {
    padding-top: 160px !important;
  }

  /* Стили для хлебных крошек */
  .blog-page .breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    padding-top: 0.5rem;
  }

  /* Стили для заголовка статьи */
  .blog-page .article__title {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    line-height: 1.3;
    margin-top: 0.5rem;
  }

  /* Дополнительные отступы для мета-информации */
  .blog-page .article__meta {
    margin-bottom: 1.5rem;
  }

  .blog-page .article__tags {
    margin-bottom: 2rem;
  }

  /* Адаптация логотипа и навигации в заголовке */
  .blog-page .header__left {
    gap: 0.5rem;
  }

  .blog-page .logo__text {
    font-size: 1.2rem;
  }

  .blog-page .blog-button__text {
    font-size: 0.9rem;
  }

  .blog-page .nav__link {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  left: var(--space-16);
  right: var(--space-16);
  bottom: var(--space-16);
  z-index: 2147483000;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(0);
  transition: transform var(--duration-normal) var(--ease-standard), opacity var(--duration-normal) var(--ease-standard);
  pointer-events: auto;
  /* Safe area for iOS */
  bottom: calc(var(--space-16) + env(safe-area-inset-bottom));
}

.cookie-banner--hide {
  opacity: 0;
  transform: translateY(10px);
}

.cookie-banner__content {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-12) var(--space-16);
}

.cookie-banner__text {
  flex: 1 1 auto;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--color-text);
}

.cookie-banner__buttons {
  display: inline-flex;
  gap: var(--space-8);
  flex-wrap: nowrap;
}

@media (max-width: 640px) {
  .cookie-banner__content {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-12);
  }
  .cookie-banner__buttons {
    display: flex;
    width: 100%;
  }
  .cookie-banner__buttons .btn {
    width: 100%;
  }
}

/* Ensure viewport-fixed positioning is not broken by body transforms */
.cookie-consent-open body {
  transform: none !important;
}
