/**
 * TYPOGRAPHY SYSTEM - NovaDeploy
 * Единая типографическая система на основе модульной шкалы
 * Коэффициент: 1.25 (мажорная терция)
 * Базовый размер: 16px
 * Дата создания: 04.03.2026
 */

/* ========================================
   CSS ПЕРЕМЕННЫЕ - ТИПОГРАФИКА
   ======================================== */

:root {
  /* Базовый размер для rem */
  --font-size-root: 16px;
  
  /* Семейства шрифтов с fallback */
  --font-primary: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Helvetica Neue", Arial, sans-serif;
  --font-secondary: "Montserrat", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Monaco", "Cascadia Code", "Courier New", monospace;
  
  /* Модульная шкала размеров (коэффициент 1.25) */
  --font-size-xs: 0.64rem;      /* 10.24px */
  --font-size-sm: 0.8rem;       /* 12.8px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-md: 1.25rem;      /* 20px */
  --font-size-lg: 1.563rem;     /* 25px */
  --font-size-xl: 1.953rem;     /* 31.25px */
  --font-size-2xl: 2.441rem;    /* 39px */
  --font-size-3xl: 3.052rem;    /* 48.83px */
  --font-size-4xl: 3.815rem;    /* 61px */
  
  /* Высота строки */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Насыщенность шрифта */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Отступы для вертикального ритма */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.25rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
}

/* ========================================
   БАЗОВАЯ ТИПОГРАФИКА
   ======================================== */

html {
  font-size: var(--font-size-root);
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-normal);
  color: #333;
}

/* 
  ВАЖНО: Для оптимальной загрузки шрифтов добавьте в @font-face:
  font-display: swap;
  
  Пример:
  @font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
*/

/* ========================================
   ЗАГОЛОВКИ
   ======================================== */

h1, .h1 {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-xl);
}

h2, .h2 {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-lg);
}

h3, .h3 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-md);
}

h4, .h4 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-sm);
}

h5, .h5 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--spacing-sm);
}

h6, .h6 {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--spacing-xs);
}

/* ========================================
   ПАРАГРАФЫ И ТЕКСТ
   ======================================== */

p {
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-relaxed);
}

/* Мелкий текст */
.text-sm {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

/* Крупный текст */
.text-lg {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

/* Lead текст (вводный абзац) */
.lead {
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  font-weight: var(--font-weight-light);
}

/* ========================================
   СПЕЦИФИЧНЫЕ КОМПОНЕНТЫ САЙТА
   ======================================== */

/* Меню */
.header-menu__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

/* Услуги */
.services-list__item-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
}

/* Цены */
.price {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
}

/* Баннеры */
.banners-big__title--xs {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
}

.banners-big__text-block--small {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-light);
}

/* Контент */
.content {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

/* Аккордеоны */
.head-accord {
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  margin: 0;
}

/* Styled блоки */
.styled-block {
  font-size: var(--font-size-xl);
}

/* Боковое меню */
.menu-side-column__item-link {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-bold);
}

/* Телефон */
.phones__phone-link.phones__phone-first {
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-md);
}

/* Превью индексных блоков */
.index-block__preview {
  font-size: var(--font-size-lg);
}

/* ========================================
   АДАПТИВНАЯ ТИПОГРАФИКА
   ======================================== */

/* Мобильные устройства */
@media (max-width: 768px) {
  :root {
    --font-size-root: 14px;
  }
  
  h1, .h1 {
    font-size: var(--font-size-2xl);
  }
  
  h2, .h2 {
    font-size: var(--font-size-xl);
  }
  
  .banners-big__title--xs {
    font-size: var(--font-size-2xl);
  }
}

/* Планшеты */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --font-size-root: 15px;
  }
}

/* Большие экраны */
@media (min-width: 1920px) {
  :root {
    --font-size-root: 18px;
  }
}

/* ========================================
   УТИЛИТЫ
   ======================================== */

/* Насыщенность шрифта */
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }

/* Высота строки */
.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }

/* Семейства шрифтов */
.font-primary { font-family: var(--font-primary); }
.font-secondary { font-family: var(--font-secondary); }
.font-mono { font-family: var(--font-mono); }

/* ========================================
   ОПТИМИЗАЦИЯ ПРОИЗВОДИТЕЛЬНОСТИ
   ======================================== */

/* Предотвращение FOIT (Flash of Invisible Text) */
.wf-loading body {
  visibility: hidden;
}

.wf-active body,
.wf-inactive body {
  visibility: visible;
}

/* Минимальный размер шрифта на мобильных (предотвращает авто-зум в iOS) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}
