/* ============================================================
   Шапка и подвал сайта.
   Отдельный файл, чтобы не затрагивать сгенерированный style.css.
   ============================================================ */

:root {
    --site-purple: #6a0dad;
    --site-purple-dark: #5a0b94;
    --site-lavender: #f3f0fb;
    --site-ink: #28292f;
    --site-muted: #6f6885;
    --site-footer-bg: #171326;
    --site-gutter: 100px;
}

@media (max-width: 1440px) {
    :root {
        --site-gutter: 50px;
    }
}

@media (max-width: 768px) {
    :root {
        --site-gutter: 20px;
    }
}

html {
    scroll-behavior: smooth;
}

/* Прижимаем подвал к низу на коротких страницах. */
body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.site-body {
    flex: 1 0 auto;
}

/* Отступ при переходах по якорям, чтобы заголовок не прятался под шапкой. */
#comments,
#comments-section,
#statistic,
#top {
    scroll-margin-top: 96px;
}

/* ---------------------------- Шапка ---------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid rgba(40, 41, 47, 0.08);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        #6a0dad 0%,
        #8f5fd4 35%,
        #a69fdb 65%,
        #ffd29a 100%
    );
    pointer-events: none;
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 30px rgba(30, 27, 46, 0.12);
}

.site-header__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 13px var(--site-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
}

.site-brand__logo {
    display: block;
    width: auto;
    height: 42px;
}

.site-brand__tagline {
    max-width: 190px;
    padding-left: 14px;
    border-left: 1px solid #e7e3f2;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--site-muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    color: #3b3748;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease,
        transform 0.18s ease, box-shadow 0.18s ease;
}

.site-nav__link:hover {
    background: var(--site-lavender);
    color: var(--site-purple-dark);
}

.site-nav__link.is-active {
    background: var(--site-lavender);
    color: var(--site-purple);
}

.site-nav__link--cta {
    margin-left: 6px;
    padding: 10px 18px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #7a1bc0 0%,
        var(--site-purple-dark) 100%
    );
    box-shadow: 0 8px 18px rgba(106, 13, 173, 0.24);
}

.site-nav__link--cta:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #8626cf 0%, #650da6 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(106, 13, 173, 0.3);
}

.site-nav__link--cta.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #7a1bc0 0%, var(--site-purple-dark) 100%);
    box-shadow: 0 8px 18px rgba(106, 13, 173, 0.24);
}

.site-header a:focus-visible,
.site-footer a:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 3px;
}

/* ---------------------------- Подвал ---------------------------- */

.site-footer {
    position: relative;
    margin-top: clamp(48px, 6vw, 84px);
    overflow: hidden;
    color: #cfc9e2;
    background: radial-gradient(
            900px 340px at 10% 0%,
            rgba(122, 27, 192, 0.34),
            transparent 65%
        ),
        radial-gradient(
            700px 280px at 92% 12%,
            rgba(166, 159, 219, 0.16),
            transparent 70%
        ),
        var(--site-footer-bg);
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6a0dad 0%, #a69fdb 50%, #ffd29a 100%);
    pointer-events: none;
}

.site-footer::after {
    content: "";
    position: absolute;
    right: -160px;
    bottom: -220px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(166, 159, 219, 0.18) 0%,
        rgba(166, 159, 219, 0) 68%
    );
    pointer-events: none;
}

.site-footer__inner {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(44px, 6vw, 72px) var(--site-gutter) 38px;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 48px;
}

.site-footer__logo-link {
    display: inline-block;
    text-decoration: none;
}

.site-footer__logo {
    display: block;
    width: auto;
    height: 38px;
    filter: brightness(0) invert(1);
    opacity: 0.94;
}

.site-footer__about {
    margin: 18px 0 22px;
    max-width: 390px;
    font-size: 14px;
    line-height: 1.7;
    color: #aaa3c2;
}

.site-footer__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease,
        transform 0.18s ease;
}

.site-footer__cta:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateX(2px);
}

.site-footer__col h3 {
    margin: 2px 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8f86b3;
}

.site-footer__col a {
    display: block;
    width: fit-content;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #d7d2e8;
    text-decoration: none;
    transition: color 0.16s ease, transform 0.16s ease;
}

.site-footer__col a:hover {
    color: #ffffff;
    transform: translateX(2px);
}

.site-footer__col p {
    margin: 0 0 12px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #a39cbd;
}

.site-footer__col .site-footer__note {
    margin-bottom: 0;
    color: #938cab;
}

.site-footer__bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer__bottom-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px var(--site-gutter) 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: #8b84a6;
}

.site-footer__up {
    font-size: 13px;
    font-weight: 600;
    color: #cfc9e2;
    text-decoration: none;
    transition: color 0.16s ease;
}

.site-footer__up:hover {
    color: #ffffff;
}

/* ---------------------------- Адаптив ---------------------------- */

@media (max-width: 1024px) {
    .site-brand__tagline {
        display: none;
    }

    .site-header__inner {
        padding: 12px var(--site-gutter);
    }

    .site-brand__logo {
        height: 38px;
    }

    .site-footer__inner {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: 36px;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .site-header__inner {
        flex-direction: column;
        gap: 8px;
        padding: 10px var(--site-gutter) 9px;
    }

    .site-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
    }

    .site-nav__link {
        padding: 8px 11px;
        font-size: 14px;
    }

    .site-nav__link--cta {
        margin-left: 2px;
        padding: 8px 14px;
    }

    #comments,
    #comments-section,
    #statistic,
    #top {
        scroll-margin-top: 120px;
    }
}

@media (max-width: 640px) {
    .site-footer {
        margin-top: 44px;
    }

    .site-footer__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
        padding: 40px 20px 28px;
    }

    .site-footer__brand {
        grid-column: auto;
    }

    .site-footer__about {
        max-width: none;
    }

    .site-footer__bottom-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px 24px;
    }
}
