/* header.css — шапка: прозрачная на hero, solid на остальных страницах */

:root {
    --header-height: 80px;
    --header-transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* ── Базовая шапка ── */
header.site-header {
    background: var(--color-header-bg);
    color: var(--on-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 2px 24px rgba(20, 64, 73, 0.24);
    transition: var(--header-transition);
}

/* На главной первый слайд (hero) — шапка встроена в hero, поэтому
   при data-slide="hero" + is-home-presentation шапка прозрачная */
html.is-home-presentation header.site-header {
    position: fixed;
    width: 100%;
    background: rgba(0, 30, 36, 0.0);
    box-shadow: none;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    transition: var(--header-transition);
}

/* Когда скроллимся за hero — добавляем JS-класс .is-scrolled */
html.is-home-presentation header.site-header.is-scrolled {
    background: rgba(20, 64, 73, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 2px 28px rgba(0, 0, 0, 0.28);
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

/* На обычных страницах (не главная) — всегда фирменный фон */
html:not(.is-home-presentation) header.site-header {
    background: var(--color-header-bg);
    box-shadow: 0 2px 24px rgba(20, 64, 73, 0.24);
}

/* ── Внутренняя раскладка ── */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 40px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
}

/* ── Логотип ── */
.logo-slot {
    flex-shrink: 0;
    width: 186px;
    height: 42px;
    aspect-ratio: 461 / 104;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.2s ease;
}
.logo-slot:hover { opacity: 0.88; }

.logo-slot__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}
.logo-slot__placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px dashed rgba(255, 255, 255, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.80);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 2px;
}

/* ── Навигация Desktop — СВЕРХУ СПРАВА ── */
nav.main-nav {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-left: auto;
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 500;
}
nav.main-nav a {
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.2s ease, opacity 0.2s ease;
    padding: 6px 0;
    position: relative;
    text-decoration: none;
    line-height: 1;
}

/* Подчёркивание-акцент при hover/active */
nav.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-teal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
nav.main-nav a:hover,
nav.main-nav a.is-active {
    color: #ffffff;
}
nav.main-nav a:hover::after,
nav.main-nav a.is-active::after {
    transform: scaleX(1);
}
nav.main-nav a:focus-visible {
    outline: 3px solid var(--brand-blue);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ── Бургер (≤768px) ── */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--on-dark);
    border-radius: 3px;
    transition: background-color 0.2s ease;
    margin-left: auto;
}
.burger:hover { background: rgba(255,255,255,0.10); }
.burger:focus-visible {
    outline: 3px solid var(--brand-blue);
    outline-offset: 2px;
}
.burger span {
    width: 22px;
    height: 2px;
    background: var(--on-dark);
    display: block;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0.5); }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Мобильная панель ── */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-header-bg);
    color: var(--on-dark);
    z-index: 99;
    padding: 40px 28px 48px;
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
    overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.mobile-nav nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: var(--font-head);
    font-size: 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}
.mobile-nav a {
    color: rgba(255, 255, 255, 0.82);
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.18s ease, padding-left 0.18s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.mobile-nav a::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-teal);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.mobile-nav a:hover,
.mobile-nav a.is-active {
    color: #ffffff;
    padding-left: 8px;
}
.mobile-nav a:hover::before,
.mobile-nav a.is-active::before {
    opacity: 1;
}

/* Технический лейбл внизу мобильной панели */
.mobile-nav__footer {
    margin-top: 48px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.28);
    text-transform: uppercase;
}

/* ── Адаптивность ── */
@media (max-width: 1024px) {
    .header-inner { padding: 0 28px; gap: 24px; }
    nav.main-nav { gap: 24px; font-size: 12px; }
}

@media (max-width: 768px) {
    :root { --header-height: 68px; }
    .header-inner { padding: 0 20px; }
    .logo-slot { width: 158px; height: 36px; }

    nav.main-nav { display: none; }
    .burger { display: flex; }
    .mobile-nav { display: block; }
}

@media (max-width: 480px) {
    :root { --header-height: 60px; }
    .logo-slot { width: 138px; height: 32px; }
    .logo-slot__placeholder { font-size: 8px; }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
    header.site-header,
    nav.main-nav a::after,
    .mobile-nav { transition: none !important; }
}
