/* ============================================================
   История села Троицкое — основные стили
   ============================================================
   Палитра «архивная»: тёплый песочный фон, тёмно-синий текст,
   кирпичный (терракотовый) акцент — цвет старых кирпичных
   зданий и чернил на документах.
   ============================================================ */

/* ---------- 1. Переменные и темы ---------- */
:root {
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    /* Светлая тема */
    --bg: #f6f1e8;            /* фон-песок */
    --bg-soft: #efe7d8;       /* мягче, для блоков */
    --surface: #fffdf8;       /* карточки */
    --surface-2: #f9f4ea;     /* чередование строк */
    --text: #2b2b33;          /* основной текст */
    --text-muted: #6b6558;    /* приглушённый */
    --heading: #1f2430;
    --accent: #b4472b;        /* кирпичный */
    --accent-hover: #96381f;
    --accent-soft: #f3ddd4;
    --link: #8c3a22;
    --border: #e3d8c5;
    --shadow: 0 1px 2px rgba(43, 43, 51, .06), 0 8px 24px rgba(43, 43, 51, .08);
    --shadow-hover: 0 2px 4px rgba(43, 43, 51, .08), 0 16px 40px rgba(43, 43, 51, .14);
    --radius: 14px;
    --radius-sm: 9px;
    --max-width: 1200px;
    --header-h: 68px;
    --max-gradient: linear-gradient(135deg, #7a5cf0 0%, #5b8def 50%, #35c0e8 100%);
}

[data-theme="dark"] {
    --bg: #16181d;
    --bg-soft: #1c1f26;
    --surface: #1f232b;
    --surface-2: #232832;
    --text: #e6e1d6;
    --text-muted: #a09a8c;
    --heading: #f3efe6;
    --accent: #e0674a;
    --accent-hover: #f07f60;
    --accent-soft: #3a2620;
    --link: #eb9276;
    --border: #333945;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .5);
}

/* ---------- 2. Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 80% -100px, var(--accent-soft), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s ease, color .3s ease;
}

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

h1, h2, h3, h4 {
    color: var(--heading);
    line-height: 1.25;
    margin: 0 0 .6em;
    font-weight: 700;
    letter-spacing: -.01em;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.18rem; }

p { margin: 0 0 1em; }

a { color: var(--link); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: .1em .4em;
    font-size: .88em;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 3. Шапка ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--header-h);
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--heading);
    text-decoration: none;
    margin-right: auto;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand__icon {
    font-size: 1.7rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text strong { font-size: 1.02rem; font-weight: 800; }
.brand__text small { color: var(--text-muted); font-size: .72rem; letter-spacing: .02em; }

/* Меню */
.main-nav__list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}
.main-nav__list a {
    display: block;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}
.main-nav__list a:hover {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}
.main-nav__list .is-active a {
    background: var(--accent);
    color: #fff;
}
.main-nav__list .is-active a:hover { background: var(--accent-hover); color: #fff; }

/* Бургер */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2.5px;
    border-radius: 2px;
    background: var(--text);
    transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Переключатель темы */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform .3s ease, background .2s ease;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.06); }
[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="dark"]  .theme-toggle__moon { display: none; }

/* ---------- 4. Раскладка: контент + сайдбар ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 56px;
    align-items: start;
}

.content { min-width: 0; }

/* ---------- 5. Карточки и типографика страниц ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(20px, 4vw, 34px);
    margin-bottom: 26px;
}

.page-head { margin-bottom: 22px; }
.page-head__eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 12px;
    border-radius: 99px;
    margin-bottom: 12px;
}
.page-head p.lead {
    font-size: 1.08rem;
    color: var(--text-muted);
    margin: 0;
}

.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }

/* Цитата из архивных документов */
.quote {
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px 20px;
    margin: 0 0 1.2em;
    font-style: italic;
    color: var(--text-muted);
}

/* Врезка-факт */
.fact {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 0 0 1.2em;
}
.fact__icon { font-size: 1.5rem; line-height: 1; }
.fact p { margin: 0; }
.fact strong { color: var(--heading); }

/* Источник */
.source {
    font-size: .85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    margin-top: 18px;
}
.source a { text-decoration: underline; }

/* Подсказка-заглушка */
.hint {
    background: var(--bg-soft);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    color: var(--text-muted);
    font-size: .93rem;
}
.hint--small { font-size: .85rem; padding: 12px 14px; margin: 0; }

/* Сообщение «фотографий пока нет» с призывом прислать снимки в МАКС */
.no-photos {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: var(--bg-soft);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: clamp(18px, 4vw, 28px);
}
.no-photos__icon { font-size: 2.4rem; line-height: 1; flex: none; }
.no-photos__text { min-width: 0; }
.no-photos__text h3 { margin-bottom: .4em; }
.no-photos__text p {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1em;
}
.no-photos .btn { margin-top: 2px; }

@media (max-width: 560px) {
    .no-photos { flex-direction: column; gap: 12px; }
}

/* ---------- 5.5 Видеокарточки (встроенный плеер OK.ru) ---------- */
.videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 18px 0 6px;
}
.video-card {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.video-card__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.video-card__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-card figcaption {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 16px 14px;
    font-size: .92rem;
}
.video-card figcaption strong { color: var(--heading); }
.video-card figcaption a { font-size: .82rem; }

/* ---------- 6. Галерея ---------- */.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    margin: 18px 0 6px;
}
.gallery__item {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}
.gallery__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.gallery__open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--bg-soft);
    cursor: zoom-in;
    line-height: 0;
}
.gallery__open img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    background: var(--bg-soft);
    transition: transform .35s ease;
}
.gallery__open:hover img { transform: scale(1.03); }
.gallery__item figcaption {
    padding: 11px 14px 13px;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Лайтбокс-слайдер */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 14, 12, .92);
    backdrop-filter: blur(4px);
    animation: fadeIn .25s ease;
}
.lightbox[hidden] { display: none; }
.lightbox__figure {
    margin: 0;
    max-width: min(1000px, 94vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lightbox__img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    margin: 0 auto;
}
.lightbox__caption {
    color: #f0ebe0;
    text-align: center;
    font-size: .95rem;
    max-width: min(1000px, 90vw);
    margin: 0 auto;
    padding: 0 56px; /* место под стрелки */
}
.lightbox__close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .25); transform: rotate(90deg); }

/* Стрелки слайдера */
.lightbox__prev,
.lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 72px;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background .2s ease, transform .2s ease;
}
.lightbox__prev { left: 14px; }
.lightbox__next { right: 14px; }
.lightbox__prev:hover,
.lightbox__next:hover { background: rgba(255, 255, 255, .28); }
.lightbox__prev:active,
.lightbox__next:active { transform: translateY(-50%) scale(.92); }
/* Если фото одно — стрелки скрываем (класс ставит JS) */
.lightbox--single .lightbox__prev,
.lightbox--single .lightbox__next { display: none; }
.lightbox--single .lightbox__caption { padding: 0; }

/* Счётчик «2 / 5» */
.lightbox__counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    color: #f0ebe0;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
    user-select: none;
}

/* На большом экране фото показываем крупнее */
@media (min-width: 900px) {
    .lightbox__figure { max-width: min(1600px, 96vw); }
    .lightbox__img {
        max-height: 92vh;
        max-width: min(1600px, 94vw);
        /* сглаживание при увеличении старых архивных снимков */
        image-rendering: auto;
    }
    .lightbox__caption { max-width: min(1600px, 92vw); }
}

/* На телефоне стрелки меньше и ближе к краю */
@media (max-width: 560px) {
    .lightbox { padding: 12px; }
    .lightbox__prev,
    .lightbox__next {
        width: 40px;
        height: 58px;
        font-size: 1.9rem;
    }
    .lightbox__prev { left: 6px; }
    .lightbox__next { right: 6px; }
    .lightbox__caption { padding: 0 44px; font-size: .85rem; }
}

/* ---------- 7. Таймлайн (хронология) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(var(--accent), var(--border));
}
.timeline li { position: relative; padding: 0 0 22px 48px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline__dot {
    position: absolute;
    left: 7px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    border: 4px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline__year {
    display: inline-block;
    font-weight: 800;
    color: var(--accent);
    font-size: .95rem;
    letter-spacing: .02em;
}
.timeline__title { font-weight: 600; color: var(--heading); display: block; margin: 2px 0 3px; }
.timeline__text { color: var(--text-muted); font-size: .95rem; margin: 0; }
.timeline a.timeline__title:hover { color: var(--accent); text-decoration: none; }

/* ---------- 8. Таблицы ---------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .94rem;
    min-width: 460px;
}
table.data th, table.data td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
table.data thead th {
    background: var(--bg-soft);
    color: var(--heading);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    position: sticky;
    top: 0;
}
table.data tbody tr:nth-child(even) { background: var(--surface-2); }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Поиск по таблице */
.table-search {
    width: 100%;
    max-width: 340px;
    padding: 10px 15px;
    margin-bottom: 14px;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .93rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.table-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- 9. График-столбики (численность населения) ---------- */
.bars {
    display: flex;
    align-items: flex-end;
    gap: clamp(4px, 1.2vw, 12px);
    height: 220px;
    padding: 10px 6px 0;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.bars__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 6px;
    min-width: 0;
}
.bars__value {
    font-size: clamp(.6rem, 1.4vw, .78rem);
    font-weight: 700;
    color: var(--heading);
    white-space: nowrap;
}
.bars__bar {
    width: 100%;
    max-width: 46px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-hover));
    transform-origin: bottom;
    animation: growUp .8s cubic-bezier(.2,.8,.3,1) backwards;
}
.bars__year {
    font-size: clamp(.6rem, 1.4vw, .8rem);
    color: var(--text-muted);
    white-space: nowrap;
}
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- 10. Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border: 0;
    border-radius: 99px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px var(--accent-soft); }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn--max {
    background: var(--max-gradient);
    color: #fff;
    box-shadow: 0 8px 24px rgba(110, 110, 240, .35);
}
.btn--max:hover { color: #fff; box-shadow: 0 12px 32px rgba(110, 110, 240, .5); }
.btn--small { padding: 9px 18px; font-size: .88rem; }
.btn__icon { flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* Навигация «пред./след.» между страницами */
.pager {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 26px;
}
.pager a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 13px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 150px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.pager a:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.pager small { color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.pager strong { color: var(--heading); }

/* ---------- 11. Сайдбар ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 20px); }
.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}
.widget__label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.widget__title { font-size: 1.02rem; margin-bottom: 10px; }
.widget p { font-size: .9rem; color: var(--text-muted); margin-bottom: 12px; }

/* Партнёрский баннер */
.ad-block__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.ad-block__link:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.ad-block__icon {
    font-size: 2rem;
    line-height: 1;
    flex: none;
}
.ad-block__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad-block__title { color: var(--heading); font-size: .98rem; font-weight: 700; }
.ad-block__desc { font-size: .82rem; color: var(--text-muted); line-height: 1.45; }
.ad-block__site {
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: .01em;
}

/* Акцент по конкретному партнёру */
.ad-block--ads  .ad-block__link:hover { border-color: #d97706; }
.ad-block--ads  .ad-block__site { color: #d97706; }
.ad-block--gov  .ad-block__link:hover { border-color: #2563eb; }
.ad-block--gov  .ad-block__site { color: #2563eb; }
.ad-block--news .ad-block__link:hover { border-color: #16a34a; }
.ad-block--news .ad-block__site { color: #16a34a; }
[data-theme="dark"] .ad-block--ads  .ad-block__site { color: #fbbf24; }
[data-theme="dark"] .ad-block--gov  .ad-block__site { color: #60a5fa; }
[data-theme="dark"] .ad-block--news .ad-block__site { color: #4ade80; }

/* Список фактов */
.facts-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.facts-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}
.facts-list li:last-child { border-bottom: 0; }
.facts-list span { color: var(--text-muted); }
.facts-list strong { color: var(--heading); text-align: right; }

/* ---------- 12. Главная: герой-блок ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(180, 71, 43, .92), rgba(60, 34, 28, .92)),
        var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: clamp(34px, 6vw, 68px) clamp(22px, 5vw, 56px);
    color: #fdf6ec;
    margin-bottom: 30px;
}
.hero::after {
    content: '🕮';
    position: absolute;
    right: -20px;
    bottom: -45px;
    font-size: 15rem;
    opacity: .09;
    pointer-events: none;
    line-height: 1;
}
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero p { color: rgba(255, 246, 236, .9); max-width: 62ch; font-size: 1.08rem; }
.hero .btn--ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn--ghost:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Карточки-ссылки на разделы */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
    text-decoration: none;
}
.tile__icon { font-size: 1.7rem; }
.tile__title { font-weight: 700; color: var(--heading); }
.tile__desc { font-size: .86rem; color: var(--text-muted); line-height: 1.5; }

/* Крупные цифры */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}
.stat__num {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}
.stat__label { font-size: .84rem; color: var(--text-muted); }

/* ---------- 13. Футер ---------- */
.site-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 40px 0 22px;
    font-size: .92rem;
}

.footer-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 30px;
    margin-bottom: 34px;
}
.footer-cta h3 { margin-bottom: .35em; }
.footer-cta p { color: var(--text-muted); margin: 0; max-width: 62ch; }

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    margin-bottom: 26px;
}
.footer__col h4 { font-size: .95rem; margin-bottom: .7em; }
.footer__col p { color: var(--text-muted); font-size: .88rem; }
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 7px; color: var(--text-muted); font-size: .88rem; }

.footer__bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    color: var(--text-muted);
    font-size: .82rem;
    text-align: center;
}

/* ---------- 14. Анимации появления ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- 15. Адаптивность ---------- */
@media (max-width: 1024px) {
    .layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
}

@media (max-width: 880px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }

    /* Меню превращается в выдвижную панель */
    .nav-toggle { display: flex; order: 3; }
    .theme-toggle { order: 2; }
    .main-nav {
        order: 4;
        width: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav__list {
        flex-direction: column;
        padding: 10px 0 16px;
    }
    .main-nav__list a { padding: 12px 14px; font-size: 1rem; }
    .header__inner { row-gap: 0; }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .brand__text strong { font-size: .92rem; }
    .brand__text small { display: none; }
    .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .hero { padding: 30px 20px; }
    .footer-cta { padding: 22px 20px; }
    .btn { width: 100%; justify-content: center; }
    .footer-cta .btn { width: auto; }
}
