/* ═══════════════════════════════════════════════════
   BASE.CSS — Переменные, reset, типографика, утилиты
   Интеллект-Академия Наталии Кирсановой
   Брендбук v2, 2026
   ═══════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
    /* Цвета по визуальному паспорту */
    --color-primary: #156093;       /* Тёмно-синий — заголовки, навбар, футер */
    --color-accent: #EE751C;        /* Оранжевый — CTA-кнопки, единственный акцент */
    --color-accent-hover: #D4650F;  /* Hover CTA */
    --color-decor: #158E93;         /* Бирюзовый — ТОЛЬКО декор, не кнопки */
    --color-bg: #FFFFFF;            /* Основной фон */
    --color-bg-alt: #F7F8F9;       /* Чередующиеся секции */
    --color-text: #161616;          /* Основной текст */
    --color-text-secondary: #5A6465; /* Подписи (WCAG AA) */
    --color-border: #D4D8D9;       /* Рамки карточек */
    --color-primary-light: #E8F1F8; /* Фон акцентных секций */
    --color-error: #D94040;         /* Ошибки */
    --color-success: #2D8A4E;       /* Успех */

    /* Шрифты */
    --font-heading: 'Montserrat', -apple-system, sans-serif;
    --font-body: 'Lato', -apple-system, sans-serif;

    /* Отступы */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-section: clamp(3rem, 8vw, 6rem);

    /* Размеры */
    --container-max: 1200px;
    --text-max: 680px;

    /* Радиусы */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Тени */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Переходы */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* для sticky header */
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

ul, ol { list-style: none; }

/* ─── Типографика ─── */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--color-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    line-height: 1.3;
}

h4 {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 600;
    line-height: 1.35;
}

.text-lg {
    font-size: 1.125rem; /* 18px — лиды, подзаголовки */
}

.text-sm {
    font-size: 0.875rem; /* 14px — подписи */
    color: var(--color-text-secondary);
}

.text-caption {
    font-size: 0.75rem; /* 12px — копирайты */
    color: var(--color-text-secondary);
}

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

strong { font-weight: 700; }

/* ─── Утилиты ─── */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 9999;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* ─── Анимации (scroll reveal) ─── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger */
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html { scroll-behavior: auto; }
}
