/* AIDO — общий стиль основного сайта (aido2026.ru).
 *
 * Появился 25.09.2026, когда сайт стал многостраничным (Главная / Блог /
 * Контакты). До этого КАЖДАЯ страница несла свой <style>, и правка шапки
 * означала синхронную правку в трёх местах — при том что меню уже
 * разъехалось: в блоге ссылки вели на /#leadForm, которого на главной
 * больше нет.
 *
 * Файл лежит в корне и подключён как /style.css — пути к фоновым
 * картинкам записаны АБСОЛЮТНО (/bg.webp), чтобы одинаково работать и
 * из корня, и со страницы в подпапке.
 *
 * Стили блога (blog/blog.css) НЕ трогаем: у статей своя типографика.
 * Пересечение — только меню, и оно сознательно одинаковое.
 */

:root {
    --accent: #4ade80;
    --accent-soft: #86efac;
    --accent-dark: #22c55e;
    --card-bg: rgba(15, 23, 42, 0.25);
    --card-border: rgba(255, 255, 255, 0.18);
    --muted: #cbd5e1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background-color: #0b1320;
    position: relative;
    color: #ffffff;
    padding: 1.5rem 1.5rem 3rem;
}

/* ── Фоновое изображение ──────────────────────────────────────────────
 * Выбор файла сделан ЯВНЫМИ media-запросами, а не одним image-set.
 * Почему: image-set выбирает кандидата по плотности пикселей (DPR), а не
 * по ширине экрана. На десктопе с DPR=1 он взял бы «1x»-ветку, то есть
 * мобильный файл 960×640, и растянул его на 1920 — картинка выглядела бы
 * мыльной. Здесь ширина экрана решает первично, а DPR — только внутри
 * мобильной ветки.
 *
 * Условия совпадают с preload в <head> каждой страницы — иначе браузер
 * скачает оба файла (был замер: 214 КБ вместо 129 КБ).
 *   • ≤640px, 1x  → bg-mobile.webp (85 КБ)
 *   • ≤640px, 2x  → bg.webp        (129 КБ) — на retina нужен запас
 *   • >640px      → bg.webp        (129 КБ)
 *   • без WebP    → bg.jpg         (фолбэк первой строкой) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url('/bg.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    /* fixed-фон отключён на мобильных — iOS его игнорирует и дёргает скролл */
    background-attachment: scroll;
}
@media (max-width: 640px) {
    body::after { background-image: url('/bg-mobile.webp'); }
}
@media (max-width: 640px) and (min-resolution: 2dppx) {
    body::after { background-image: url('/bg.webp'); }
}
@media (min-width: 641px) {
    body::after {
        background-image: url('/bg.webp');
        /* На десктопе fixed можно: параллакс-эффект, скролл не дёргается */
        background-attachment: fixed;
    }
}
@media (prefers-reduced-data: reduce) {
    body::after { background-image: none; }
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(15, 23, 42, 0.05) 0%, rgba(10, 15, 30, 0.4) 100%);
    z-index: 1;
    pointer-events: none;
}

.wrap {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 0 auto;
}

/* ── Навигация ──
 * Классы .nav/.brand/.nav-links совпадают с blog.css НАМЕРЕННО: меню
 * должно выглядеть одинаково на всех страницах, включая статьи. */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.nav a.brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.nav-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* Текущий раздел. aria-current ставит разметка — стиль завязан на него,
 * а не на отдельный класс, чтобы состояние было доступным для скринридеров. */
.nav-links a[aria-current="page"] {
    color: #ffffff;
    border-bottom-color: var(--accent);
}

/* ── Карточки ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 3.5rem 2.5rem 3rem;
}
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.45rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}
h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
}
p.lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #f1f5f9;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    margin-bottom: 1.75rem;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}
p.sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ── Кнопки ── */
.actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-link {
    display: inline-block;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: var(--accent-soft);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.btn-link:hover {
    transform: translateY(-2px);
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.65);
}
.btn-link.ghost {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
}
.btn-link.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.45);
}

/* ── Плитки разделов ── */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.tile {
    display: block;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1.35rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.tile:hover {
    transform: translateY(-3px);
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(15, 23, 42, 0.5);
}
.tile-icon { font-size: 1.5rem; line-height: 1; display: block; margin-bottom: 0.7rem; }
.tile-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.4rem;
}
.tile:hover .tile-title { color: var(--accent-soft); }
.tile-desc {
    display: block;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted);
}

/* ── Форма ── */
.form-card { max-width: 560px; margin-left: auto; margin-right: auto; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #e2e8f0;
    margin-bottom: 0.4rem;
}
.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}
.form-group input::placeholder { color: rgba(255, 255, 255, 0.35); }
.form-group .error {
    color: #f87171;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}
.form-group.has-error input { border-color: #f87171; }
.form-group.has-error .error { display: block; }

.btn-submit {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #0b1320;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 0.5rem;
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.form-status {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    min-height: 1.5rem;
}
.form-status.success { color: var(--accent); }
.form-status.error { color: #f87171; }

/* Honeypot — скрыт от людей, но не через display:none:
 * часть ботов проверяет видимость, поэтому уводим за экран. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Согласие на обработку ПД */
.consent-group { margin-bottom: 1.25rem; }
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.7);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}
.consent-label input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    accent-color: var(--accent);
    cursor: pointer;
}
.consent-label a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.consent-label a:hover { color: var(--accent-soft); }
.consent-group.has-error .consent-label { color: #f87171; }

/* ── Каналы связи (страница «Контакты») ── */
.channels { display: grid; gap: 0.75rem; }
.channel {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}
.channel:hover { border-color: rgba(74, 222, 128, 0.5); background: rgba(15, 23, 42, 0.5); }
.channel-icon { font-size: 1.4rem; line-height: 1; flex: 0 0 auto; }
.channel-title { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.channel:hover .channel-title { color: var(--accent-soft); }
.channel-desc { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* ── Рекламный блок РСЯ ── */
.ad-feed {
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.35);
    margin-bottom: 2rem;
}
/* Пока реклама не отдана — блок скрыт, чтобы не было пустой рамки */
.ad-feed[hidden] { display: none !important; }
#yandex_rtb_R-A-20086187-1 { min-height: 180px; }
.ad-feed-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.85rem;
    text-align: center;
}

/* ── Подвал ── */
.site-foot {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.83rem;
    color: rgba(226, 232, 240, 0.55);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }

.location {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 1rem auto 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 640px) {
    body { padding: 1.25rem 1rem 2.5rem; }
    .hero { padding: 2.5rem 1.35rem 2.25rem; }
    .card { padding: 1.85rem 1.35rem; }
    .tiles { grid-template-columns: 1fr; }
}
