/* static/css/fonts.css - Оптимизированная версия */

/* ===== БАЗОВЫЕ МЕТРИКИ ДЛЯ FALLBACK ===== */
@font-face {
    font-family: 'Inter-fallback';
    size-adjust: 107.64%;
    ascent-override: 90%;
    descent-override: 20%;
    line-gap-override: 0%;
    src: local('Arial'), local('Helvetica Neue'), local('Helvetica'), local('sans-serif');
}

/* ===== INTER FONT FAMILY - ТОЛЬКО ИСПОЛЬЗУЕМЫЕ ВЕСА ===== */

/* Inter Regular (400) - Основной текст */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: local('Inter Regular'), local('Inter-Regular'),
         url('../assets/fonts/inter-v19-cyrillic_latin-regular.woff2') format('woff2');
}

/* Inter SemiBold (600) - Заголовки и кнопки */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: block;
    src: local('Inter SemiBold'), local('Inter-SemiBold'),
         url('../assets/fonts/inter-v19-cyrillic_latin-600.woff2') format('woff2');
}

/* Inter Bold (700) - Важные элементы */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: block;
    src: local('Inter Bold'), local('Inter-Bold'),
         url('../assets/fonts/inter-v19-cyrillic_latin-700.woff2') format('woff2');
}

/* Inter ExtraBold (800) - Главные заголовки */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: block;
    src: local('Inter ExtraBold'), local('Inter-ExtraBold'),
         url('../assets/fonts/inter-v19-cyrillic_latin-800.woff2') format('woff2');
}


/* Inter Medium (500) - Некритический */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: block;
    src: local('Inter Medium'), local('Inter-Medium'),
         url('../assets/fonts/inter-v19-cyrillic_latin-500.woff2') format('woff2');
}


/* ===== ДОПОЛНИТЕЛЬНЫЕ ВЕСА (загружаются по требованию) ===== */

/* Inter Black (900) - Некритический */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: local('Inter Black'), local('Inter-Black'),
         url('../assets/fonts/inter-v19-cyrillic_latin-900.woff2') format('woff2');
}

/* ===== ГЛОБАЛЬНЫЕ НАСТРОЙКИ ТИПОГРАФИКИ ===== */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Inter-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    font-feature-settings: 'liga' 1, 'calt' 1, 'kern' 1;
    line-height: 1.5;
}

/* ===== ОПТИМИЗАЦИЯ ДЛЯ ЗАГОЛОВКОВ ===== */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Веса для разных уровней заголовков */
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }
h4, h5, h6 { font-weight: 600; }

/* ===== ЧИСЛОВЫЕ ЗНАЧЕНИЯ ===== */
.stat-value, 
.price-amount-classic, 
.lost-funds-amount,
.earning-showcase .amount,
.stat-number,
.float-card-title,
.dashboard-logo {
    font-feature-settings: 'liga' 1, 'calt' 1, 'kern' 1, 'tnum' 1, 'ss02' 1;
    font-variant-numeric: tabular-nums;
}

/* ===== ЭЛЕМЕНТЫ ИНТЕРФЕЙСА ===== */
.btn, 
button {
    font-weight: 600;
    font-feature-settings: 'liga' 1, 'calt' 1, 'kern' 1;
    text-rendering: geometricprecision;
}

/* Навигация и ссылки */
.nav-links a,
.menu-nav a {
    font-weight: 500;
}

/* Лейблы и мелкий текст */
.stat-label,
.feature-desc,
.loss-period {
    font-weight: 400;
}

/* ===== МОНОШИРИННЫЕ ШРИФТЫ ===== */
code, pre, kbd, samp {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-feature-settings: 'liga' 0, 'calt' 0;
}

/* ===== АДАПТИВНЫЕ НАСТРОЙКИ ===== */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* ===== РЕЖИМ ЭКОНОМИИ ТРАФИКА ===== */
@media (prefers-reduced-data: reduce) {
    @font-face {
        font-family: 'Inter';
        font-display: swap !important;
    }
}

/* ===== ПЕЧАТЬ ===== */
@media print {
    body {
        font-family: Georgia, 'Times New Roman', serif;
    }
}