/* ═══════════════════════════════════════════════════════════════
   КОСМИЧЕСКИЙ ОРАКУЛ — шапка главной страницы v2.6.2 (headnav)
   Профессиональное меню: дропдауны на десктопе, бургер-панель
   с аккордеонами на мобильных. Пространство имён .oh-* —
   стили не задевают шапки внутренних страниц (.site-header).
   ═══════════════════════════════════════════════════════════════ */

.oh-head,
.oh-panel {
    --oh-h: 62px;          /* высота полосы шапки */
    --oh-line: rgba(94, 226, 240, 0.16);
    --oh-glass: rgba(13, 20, 36, 0.97);
}

/* ── Полоса шапки ─────────────────────────────────────────────── */

.oh-head {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 8, 14, 0.55);
    backdrop-filter: blur(16px) saturate(1.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
    border-bottom: 1px solid var(--oh-line);
    transition: background 0.3s, box-shadow 0.3s;
}

.oh-head.scrolled {
    background: rgba(5, 8, 14, 0.85);
    box-shadow: 0 12px 34px rgba(2, 6, 14, 0.55);
}

.oh-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--oh-h);
}

/* Логотип */
.oh-logo {
    display: inline-flex;
    align-items: center;
    color: var(--gold-soft);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-shadow: 0 0 18px rgba(94, 226, 240, 0.45);
    white-space: nowrap;
}

/* ── Десктоп-меню ─────────────────────────────────────────────── */

.oh-nav {
    margin-inline: auto;
    min-width: 0;
}

.oh-list {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
}

.oh-item { position: relative; }

.oh-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 13px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.oh-link:hover {
    color: var(--gold-soft);
    background: rgba(94, 226, 240, 0.08);
}

.oh-chev { flex: 0 0 auto; opacity: 0.7; transition: transform 0.25s; }

.oh-item.open > .oh-link { color: var(--gold-soft); background: rgba(94, 226, 240, 0.08); }
.oh-item.open > .oh-link .oh-chev { transform: rotate(180deg); }

/* Выпадающая панель */
.oh-drop {
    position: absolute;
    top: calc(100% + 8px);
    left: -12px;
    min-width: 264px;
    padding: 8px;
    border-radius: 14px;
    background: var(--oh-glass);
    border: 1px solid rgba(94, 226, 240, 0.22);
    box-shadow:
        0 24px 60px rgba(2, 5, 12, 0.65),
        inset 0 0 0 1px rgba(94, 226, 240, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 20;
}

/* хвостик-каретка */
.oh-drop::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 26px;
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
    background: var(--oh-glass);
    border-left: 1px solid rgba(94, 226, 240, 0.22);
    border-top: 1px solid rgba(94, 226, 240, 0.22);
}

/* открытие: наведение, клик (.open от JS) и клавиатура */
.oh-item.has-drop:hover .oh-drop,
.oh-item.has-drop.open .oh-drop,
.oh-item.has-drop:focus-within .oh-drop {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.oh-drop-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px 12px;
    border-radius: 9px;
    text-decoration: none;
    transition: background 0.18s;
}

.oh-drop-link b {
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.18s;
}

.oh-drop-link span {
    color: var(--muted);
    font-size: 12.5px;
}

.oh-drop-link:hover { background: rgba(94, 226, 240, 0.10); }
.oh-drop-link:hover b { color: var(--gold-soft); }

/* ── Правый блок: CTA, звук, бургер ───────────────────────────── */

.oh-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.oh-cta {
    padding: 8px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    color: #071018;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(94, 226, 240, 0.28);
    transition: transform 0.2s, box-shadow 0.2s;
}

.oh-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 26px rgba(94, 226, 240, 0.45);
}

/* Бургер — только ≤1000px */
.oh-burger {
    display: none;
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(94, 226, 240, 0.30);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.2s;
}

.oh-burger:hover { background: rgba(94, 226, 240, 0.12); }

.oh-b-line {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold-soft);
    transition: transform 0.25s, opacity 0.2s, top 0.25s;
}

.oh-b-line:nth-child(1) { top: 14px; }
.oh-b-line:nth-child(2) { top: 20px; }
.oh-b-line:nth-child(3) { top: 26px; }

.oh-burger.active .oh-b-line:nth-child(1) { top: 20px; transform: rotate(45deg); }
.oh-burger.active .oh-b-line:nth-child(2) { opacity: 0; }
.oh-burger.active .oh-b-line:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* ── Мобильная панель (вне шапки, fixed-оверлей) ──────────────── */

.oh-panel {
    position: fixed;
    inset: var(--oh-h) 0 0 0;
    z-index: 95;
    padding: 14px 5vw 30px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(4, 7, 13, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.28s, transform 0.28s, visibility 0.28s;
}

.oh-panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.oh-panel-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 520px;
    margin-inline: auto;
}

.oh-mlink {
    display: block;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(94, 226, 240, 0.12);
    background: rgba(17, 26, 45, 0.45);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s;
}

.oh-mlink:hover,
.oh-mlink:active {
    background: rgba(94, 226, 240, 0.10);
    border-color: rgba(94, 226, 240, 0.30);
}

/* Аккордеон-группа */
.oh-acc {
    border: 1px solid rgba(94, 226, 240, 0.12);
    border-radius: 12px;
    background: rgba(17, 26, 45, 0.45);
    overflow: hidden;
}

.oh-acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 13px 15px;
    border: 0;
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.oh-acc-head .oh-chev { color: var(--gold); opacity: 0.9; }
.oh-acc.open .oh-acc-head .oh-chev { transform: rotate(180deg); }

.oh-acc-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.oh-acc.open .oh-acc-body { grid-template-rows: 1fr; }

.oh-acc-in {
    overflow: hidden;
    min-height: 0;
}

.oh-mlink.sub {
    padding: 12px 15px 12px 28px;
    border: 0;
    border-top: 1px solid rgba(94, 226, 240, 0.08);
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
}

.oh-mlink.sub:hover,
.oh-mlink.sub:active {
    background: rgba(94, 226, 240, 0.08);
    color: var(--gold-soft);
}

.oh-panel-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    padding: 13px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    color: #071018;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(94, 226, 240, 0.25);
}

.oh-panel-cta:active { transform: translateY(1px); }

/* Блокировка прокрутки страницы при открытой панели */
body.oh-lock { overflow: hidden; }

/* Якоря не прячутся под sticky-шапкой (стиль грузится только на главной) */
main section[id] { scroll-margin-top: calc(var(--oh-h, 62px) + 10px); }

/* Фокус с клавиатуры */
.oh-head :focus-visible,
.oh-panel :focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 8px;
}

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

@media (max-width: 1000px) {
    .oh-nav { display: none; }
    .oh-burger { display: block; }
}

@media (min-width: 1001px) {
    .oh-panel { display: none; } /* страховка: панель не существует на десктопе */
}

@media (max-width: 620px) {
    .oh-head, .oh-panel { --oh-h: 56px; }

    .oh-bar { gap: 10px; }

    .oh-logo { font-size: 16.5px; }

    /* Кабинет в полосе не влезает — он крупной кнопкой в панели */
    .oh-bar .oh-cta { display: none; }

    .oh-actions { margin-left: auto; gap: 8px; }

    .oh-panel { padding: 12px 4vw 26px; }
}
