/* Modern Font System - Combo-Pro */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  /* Основные шрифты */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Размеры шрифтов */
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.25rem;   /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem;  /* 36px */
  --text-5xl: 3rem;     /* 48px */
  
  /* Межстрочные интервалы */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
}

/* Базовые стили для текста */
body {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

/* Классы шрифтов */
.font_txe {
  font-family: var(--font-secondary);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  text-transform: uppercase;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.font_tx_400 {
  font-family: var(--font-primary);
  font-weight: 500;
  line-height: var(--leading-normal);
  letter-spacing: 0.01em;
}

/* Специальные текстовые стили */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Заголовки с улучшенным переносом */
h1, .h1 {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: var(--text-5xl);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-wrap: balance;
  hyphens: auto;
}

h2, .h2 {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: var(--text-4xl);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-wrap: balance;
  hyphens: auto;
}

h3, .h3 {
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: var(--text-3xl);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

h4, .h4 {
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h5, .h5 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h6, .h6 {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Современные стили для текста с улучшенным переносом */
.lead-text {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  letter-spacing: 0.01em;
  color: var(--gray-600);
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-wrap: pretty;
  hyphens: auto;
}

.body-large {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--gray-700);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.body-base {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-600);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.body-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--gray-500);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Стили для акцентированного текста */
.text-emphasis {
  font-weight: 600;
  color: var(--primary);
}

/* Списки */
.list-modern {
  font-family: var(--font-primary);
  line-height: var(--leading-relaxed);
}

.list-modern li {
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.5rem;
  color: var(--gray-700);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.list-modern li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
  font-weight: bold;
  font-size: 1.2em;
}

/* Специальные стили для ГОСТ текста */
.company-section h2 {
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  line-height: 1.3;
}

.company-section .lead-text {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  word-break: normal;
}

/* Улучшения для длинных заголовков и стандартов */
.long-title {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  line-height: 1.3;
  text-align: center;
}

/* Адаптивные стили */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.25rem;
    --text-4xl: 1.875rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
    --text-xl: 1.125rem;
    --text-lg: 1rem;
  }
  
  h1, .h1 {
    font-size: var(--text-4xl);
    line-height: 1.2;
  }
  
  h2, .h2 {
    font-size: var(--text-3xl);
    line-height: 1.25;
  }
  
  h3, .h3 {
    font-size: var(--text-2xl);
    line-height: 1.3;
  }
  
  .lead-text {
    font-size: var(--text-lg);
    line-height: 1.6;
  }
  
  /* Особые настройки для мобильных устройств */
  .company-section h2 {
    font-size: var(--text-2xl);
    line-height: 1.4;
    text-align: center;
  }
}

@media (max-width: 576px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.375rem;
    --text-2xl: 1.125rem;
    --text-xl: 1rem;
  }
  
  h1, .h1 {
    font-size: var(--text-3xl);
    line-height: 1.3;
  }
  
  h2, .h2 {
    font-size: var(--text-2xl);
    line-height: 1.4;
  }
  
  /* Улучшение переноса на очень маленьких экранах */
  .company-section h2,
  .products-section h2,
  .products-section h3 {
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: manual;
  }
}

/* Улучшения для читабельности */
p {
  margin-bottom: 1rem;
  max-width: 100%;
  word-wrap: break-word;
}

strong {
  font-weight: 600;
  color: var(--gray-800);
}

em {
  font-style: italic;
  color: var(--gray-600);
}

/* Стили для ссылок в тексте */
a:not(.btn) {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

a:not(.btn):hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Блоки кода и технических терминов */
code {
  font-family: 'Courier New', monospace;
  background: var(--gray-100);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--danger);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Поддержка переноса длинных слов и цифр */
.company-section,
.products-section,
.documentation-section {
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}