
.logo {
    display: inline-flex;
    align-items: center;
}

.logo__image {
    display: block;
    width: 169px;
    height: auto;
}

.header {
    --header-current: var(--header-height);
    --header-pointer-x: 50%;
    --header-trail-x: 50%;
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--color-bg);
    color: var(--color-text);
}

.header.header--fixed {
    --header-current: var(--header-height-compact);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

/* Маркер у верха страницы: когда он уходит за верх окна, js/header.js сжимает шапку (класс header--fixed) */
.header-sentinel {
    position: absolute;
    top: 24px;
    left: 0;
    width: 100%;
    height: 1px;
    pointer-events: none;
}

/* Линия у нижнего края шапки следует за курсором (позиции задаёт js/header.js) */
.header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background:
        radial-gradient(440px 2px at var(--header-trail-x) 50%, rgba(0, 178, 255, .45), rgba(0, 178, 255, 0) 75%),
        radial-gradient(240px 2px at var(--header-pointer-x) 50%, rgba(0, 178, 255, .95), rgba(0, 178, 255, 0) 72%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .42s ease;
}

.header--pointer::after {
    opacity: 1;
}

.header a,
.header a:hover,
.header a:focus {
    text-decoration: none;
}

.header__container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(calc(100% - 48px), var(--container));
    min-height: var(--header-current);
    margin-inline: auto;
    transition: min-height .2s ease;
}

.header__link,
.header__phone {
    position: relative;
    color: inherit;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.2;
    transition: color var(--transition);
}

/* Подчёркивание пункта проявляется по мере приближения курсора (--header-link-glow задаёт js/header.js) */
.header__link::after,
.header__phone::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -8px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--color-blue);
    opacity: var(--header-link-glow, 0);
    pointer-events: none;
    transform: scaleX(var(--header-link-glow, 0));
}

.header .header__link:hover,
.header .header__phone:hover,
.header .header__link:focus-visible,
.header .header__phone:focus-visible,
.header .header__link[aria-current=page] {
    color: var(--color-blue);
}

.header__phone {
    margin-left: 20px;
    white-space: nowrap;
}

.header__menu-button {
    display: none;
    width: 46px;
    height: 46px;
    padding: 11px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.header__menu-line {
    display: block;
    width: 100%;
    height: 2px;
    margin: 6px 0;
    background: var(--color-text);
    transition: transform var(--transition), opacity var(--transition);
}

/* Меню */

.site-nav {
    --site-nav-blue: var(--color-blue);
    --site-nav-inset: 32px;
}

.site-nav__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

.site-nav__caret {
    width: 10px;
    height: 7px;
    color: var(--color-muted);
    transition: transform var(--transition), color var(--transition);
}

.site-nav__trigger[aria-expanded=true] {
    color: var(--site-nav-blue);
}

/* Отдельным правилом: браузер без :has() (Firefox до 121) отбросил бы весь список селекторов */
.site-nav__item:has([aria-current=page]) > .site-nav__trigger {
    color: var(--site-nav-blue);
}

.site-nav__trigger[aria-expanded=true] .site-nav__caret {
    color: var(--site-nav-blue);
    transform: rotate(180deg);
}

.site-nav__trigger:focus-visible,
.site-nav__link:focus-visible,
.header__link:focus-visible,
.header__phone:focus-visible {
    outline: 2px solid var(--site-nav-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Панель раскрывающегося пункта: лист со ссылками */
.site-nav__sheet {
    color: var(--color-text);
}

.site-nav__links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    display: block;
    padding: 10px 0;
    color: var(--color-text);
    font-weight: 400;
    font-size: 20px;
    line-height: 26px;
    transition: color var(--transition);
}

.site-nav__link:hover,
.site-nav__link[aria-current=page] {
    color: var(--site-nav-blue);
}

/*
 * Десктоп: пункты в строку, панель под шапкой, раскрывается наведением и нажатием (правила — js/site-nav.js).
 * Панель позиционируется от контейнера шапки, left ставит js/site-nav.js (под своим пунктом); без скрипта — по правому
 * краю. Прозрачный отступ над листом панели — её часть: нажатие в нём панель не закрывает.
 */
@media (min-width: 1024px) {
    .site-nav {
        display: flex;
        align-self: stretch;
        align-items: stretch;
        gap: 40px;
    }

    .site-nav__list {
        display: flex;
        align-items: stretch;
        gap: 40px;
    }

    .site-nav__item {
        display: flex;
        align-items: center;
    }

    .site-nav__phone {
        align-self: center;
    }

    /* Стрелки у пунктов десктопа не нужны, раскрытие сообщает aria-expanded; в мобильном меню стрелка остаётся */
    .site-nav__caret {
        display: none;
    }

    .site-nav__panel {
        position: absolute;
        z-index: 30;
        top: 100%;
        right: 0;
        width: min(340px, 100%);
        padding-top: 8px;
        visibility: hidden;
        opacity: 0;
        transition: opacity .2s ease, visibility 0s linear .2s;
    }

    /*
     * «Мостик»: открытая панель продолжается вверх прозрачной полосой на свою ширину — от низа кнопок пунктов до низа
     * шапки. Он часть панели, поэтому курсор, идущий по диагонали от пункта к дальнему краю панели, не выходит
     * из своего пункта и не запускает закрытие.
     */
    .site-nav__panel::before {
        content: "";
        position: absolute;
        right: 0;
        bottom: 100%;
        left: 0;
        height: calc(var(--header-current) / 2 - 18px);
    }

    .site-nav__item--open > .site-nav__panel {
        visibility: visible;
        opacity: 1;
        transition: opacity .2s ease, visibility 0s;
    }

    .site-nav__sheet {
        max-height: calc(100vh - var(--header-current) - 24px);
        padding: 20px var(--site-nav-inset);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 4px;
        background: var(--color-bg);
        box-shadow: 0 24px 48px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .05);
    }
}

/* Узкий десктоп: промежутки шапки уже, чтобы пункты не подходили к логотипу */
@media (min-width: 1024px) and (max-width: 1200px) {
    .site-nav {
        gap: 22px;
    }

    .site-nav__list {
        gap: 32px;
    }

    .site-nav__phone {
        margin-left: 0;
    }
}

/* Мобильная версия: кнопка меню и полноэкранная панель, пункты с подменю раскрываются по нажатию */
@media (max-width: 1023.98px) {
    .header__menu-button {
        position: relative;
        z-index: 3;
        display: block;
    }

    .header__menu-button[aria-expanded=true] .header__menu-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .header__menu-button[aria-expanded=true] .header__menu-line:nth-child(2) {
        opacity: 0;
    }

    .header__menu-button[aria-expanded=true] .header__menu-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .site-nav {
        position: fixed;
        z-index: 2;
        top: var(--header-current);
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 28px;
        padding: 12px 32px 40px;
        overflow-y: auto;