.an-site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    transform: translateY(-110%);
    transition: transform 0.25s ease;
}

.an-site-header.is-visible {
    transform: translateY(0);
}

.an-site-header .moving-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    height: var(--an-header-height);
    padding-inline: 16px;
    background: var(--an-bar);
}

.an-site-header .title {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0 16px;
    color: var(--an-bar-ink);
    font-family: var(--an-font-display);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background var(--an-transition), color var(--an-transition);
}

.an-site-header .title:hover {
    color: var(--an-bar-ink);
    background: rgba(27, 24, 34, 0.1);
}

.an-site-header .logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.an-navigation .nav {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.an-site-header .an-navigation,
.an-site-header .an-navigation .nav,
.an-site-header .an-navigation .nav li {
    display: flex;
    align-items: stretch;
}

.an-site-header .an-navigation .nav a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--an-bar-ink);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--an-transition), background var(--an-transition);
}

.an-site-header .an-navigation .nav a:hover,
.an-site-header .an-navigation .nav-current a {
    color: var(--an-bar-ink);
    background: rgba(27, 24, 34, 0.1);
}

.site-index .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: var(--an-hero-height);
    padding-top: 24px;
    text-align: center;
    background-color: var(--an-surface);
    background-image: url("../img/hero-banner.jpg");
    background-position: center 42%;
    background-repeat: no-repeat;
    background-size: cover;
}

.site-index .hero-logo {
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
    object-fit: contain;
    user-select: none;
}

.site-index .hero-title {
    width: 100%;
    padding: 12px 16px;
    color: var(--an-bar-ink);
    background: var(--an-bar);
    font-family: var(--an-font-display);
    font-size: clamp(1.3rem, 4vw, 2.1rem);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    user-select: none;
}

.home-banner {
    margin: 24px 0 20px;
    text-align: center;
}

.home-banner .nav {
    justify-content: center;
    row-gap: 8px;
}

.home-banner .nav a {
    color: var(--an-secondary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-banner .nav a:hover,
.home-banner .nav-current a {
    color: var(--an-accent);
}

.home-banner .nav li + li::before {
    content: "|";
    margin: 0 12px;
    color: var(--an-text-faint);
}

.an-burger {
    display: none;
}

.an-mobile-menu,
.an-mobile-backdrop {
    display: none;
}

@media (hover: none) {
    .an-site-header .title:hover {
        background: transparent;
    }
}

@media (max-width: 980px) {
    .an-site-header {
        transform: none;
    }

    .site-index {
        padding-top: var(--an-header-height);
    }

    .site-index .hero {
        min-height: 56vw;
        padding-top: 0;
        background-position: center 38%;
    }

    .site-index .hero-logo {
        width: 132px;
        height: 132px;
        margin-bottom: 16px;
    }

    .site-index .hero-title {
        display: none;
    }

    .home-banner {
        display: none;
    }

    .site-index .feed-toolbar {
        margin-top: 24px;
    }

    .site-archive {
        padding-top: calc(var(--an-header-height) + 28px);
    }

    .an-site-header .moving-header {
        position: relative;
        z-index: 2;
        padding-inline: 4px 8px;
    }

    .an-site-header .an-navigation {
        display: none;
    }

    .an-site-header .title {
        min-width: 0;
        padding: 0 12px;
    }

    .an-site-header .title-text {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .an-burger {
        position: relative;
        display: block;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        margin: auto 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: var(--an-radius-sm);
        cursor: pointer;
    }

    .an-burger span {
        position: absolute;
        left: 12px;
        width: 20px;
        height: 2px;
        background: var(--an-bar-ink);
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
    }

    .an-burger span:nth-child(1) { top: 15px; }
    .an-burger span:nth-child(2) { top: 21px; }
    .an-burger span:nth-child(3) { top: 27px; }

    .an-site-header.is-menu-open .an-burger span:nth-child(1) {
        top: 21px;
        transform: rotate(45deg);
    }

    .an-site-header.is-menu-open .an-burger span:nth-child(2) {
        opacity: 0;
    }

    .an-site-header.is-menu-open .an-burger span:nth-child(3) {
        top: 21px;
        transform: rotate(-45deg);
    }

    .an-mobile-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 1;
        display: block;
        max-height: calc(100vh - var(--an-header-height));
        padding: 10px 10px 14px;
        overflow-y: auto;
        background: var(--an-surface);
        border: 1px solid var(--an-border);
        border-top: 0;
        border-radius: 0 0 18px 18px;
        box-shadow: 0 24px 48px rgba(8, 6, 12, 0.5);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.18s ease, transform 0.22s ease, visibility 0.22s ease;
    }

    .an-site-header.is-menu-open .an-mobile-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .an-mobile-nav .nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 0;
        padding: 4px;
        list-style: none;
    }

    .an-mobile-nav .nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 0 20px;
        color: var(--an-accent);
        background: transparent;
        border: 1px solid var(--an-accent-line);
        border-radius: 999px;
        font-family: var(--an-font-body);
        font-size: 13px;
        font-weight: 500;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        transition: color var(--an-transition), background var(--an-transition), border-color var(--an-transition);
    }

    .an-mobile-nav .nav a:hover,
    .an-mobile-nav .nav-current a {
        color: var(--an-accent-ink);
        background: var(--an-accent);
        border-color: var(--an-accent);
    }

    .an-site-header.is-menu-open .an-mobile-nav .nav li {
        animation: an-menu-item 0.26s ease backwards;
    }

    .an-site-header.is-menu-open .an-mobile-nav .nav li:nth-child(2) { animation-delay: 0.04s; }
    .an-site-header.is-menu-open .an-mobile-nav .nav li:nth-child(3) { animation-delay: 0.08s; }
    .an-site-header.is-menu-open .an-mobile-nav .nav li:nth-child(4) { animation-delay: 0.12s; }
    .an-site-header.is-menu-open .an-mobile-nav .nav li:nth-child(5) { animation-delay: 0.16s; }

    .an-mobile-menu .social-links {
        justify-content: flex-start;
        gap: 12px;
        margin: 12px 0 0;
        padding: 14px 14px 0;
        border-top: 1px solid var(--an-border);
    }

    .an-mobile-menu .social-link {
        width: 46px;
        height: 46px;
        background: var(--an-surface-2);
        border-color: transparent;
    }

    .an-mobile-menu .social-link svg {
        width: 20px;
        height: 20px;
    }

    .an-mobile-menu .social-link-youtube:hover { color: #ff4d4d; }
    .an-mobile-menu .social-link-vk:hover { color: #6aa8ff; }
    .an-mobile-menu .social-link-telegram:hover { color: #48b6ef; }

    .an-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 999;
        display: block;
        background: rgba(12, 10, 16, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .an-mobile-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .is-menu-locked,
    .is-menu-locked body {
        overflow: hidden;
    }
}

@media (max-width: 420px) {
    .an-site-header .title {
        gap: 8px;
        font-size: 13px;
        letter-spacing: 0.06em;
    }

    .an-site-header .logo {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 360px) {
    .an-site-header .title {
        font-size: 12px;
        letter-spacing: 0.04em;
    }
}
