/* ============================================================
   base.css — CSS-переменные, сброс стилей, типографика
   ============================================================ */

/* --- CSS-переменные (дизайн-система) --- */
:root {
    /* Цвета */
    --color-bg:          #0f0f13;
    --color-surface:     #1a1a24;
    --color-surface-2:   #22223a;
    --color-border:      rgba(102, 126, 234, 0.2);
    --color-border-hover: rgba(102, 126, 234, 0.5);

    /* Градиент (основной акцент — фиолетовый, цвет темы приложения) */
    --gradient-purple:   linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-purple-h: linear-gradient(135deg, #7b91f5 0%, #8a5bb8 100%);

    /* Текст */
    --text-primary:      #ffffff;
    --text-secondary:    rgba(255, 255, 255, 0.7);
    --text-muted:        rgba(255, 255, 255, 0.45);

    /* Акцентные цвета */
    --accent-purple:     #667eea;
    --accent-purple-2:   #764ba2;
    --accent-success:    #4caf7d;
    --accent-warning:    #f5a623;
    --accent-error:      #e05252;

    /* Скругления */
    --radius-sm:         8px;
    --radius-md:         12px;
    --radius-lg:         16px;
    --radius-xl:         24px;
    --radius-full:       9999px;

    /* Шрифт */
    --font-main:         'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:         'JetBrains Mono', 'Fira Code', monospace;

    /* Тени */
    --shadow-card:       0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow:       0 0 40px rgba(102, 126, 234, 0.2);

    /* Переходы */
    --transition-fast:   0.15s ease;
    --transition-base:   0.25s ease;
    --transition-slow:   0.4s ease;

    /* Ширина контейнера */
    --container-max:     1200px;
    --container-pad:     clamp(1rem, 5vw, 2rem);

    /* Высота шапки */
    --header-height:     70px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Типографика --- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    max-width: 65ch;
}

a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

img, svg {
    display: block;
    max-width: 16px;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* --- Утилиты --- */

/* Контейнер */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

/* Секция */
.section {
    padding-block: clamp(2rem, 4vw, 3.5rem);
}

.section-sm {
    padding-block: clamp(1.25rem, 2.5vw, 2rem);
}

/* Заголовок секции */
.section-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-purple);
    margin-bottom: 0.75rem;
}

.section-title {
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.125rem;
    margin-inline: auto;
}

/* Анимация появления при скролле */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Задержки анимации */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* Градиентный текст */
.text-gradient {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Скрытие для 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: 0;
}

/* Разделитель */
.divider {
    width: 60px;
    height: 3px;
    background: var(--gradient-purple);
    border-radius: var(--radius-full);
    margin-inline: auto;
    margin-top: 1.5rem;
}
