.site-header {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 4vw;
    background: linear-gradient(
        180deg,
        rgba(0, 7, 12, 0.96),
        rgba(0, 7, 12, 0.74)
    );
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-size: clamp(18px, 2vw, 24px);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    color: #00131b;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(10px, 1.5vw, 22px);
    flex-wrap: nowrap;
}

.nav-node,
.dropdown-node {
    position: relative;
}

.nav-node > a,
.dropdown-node > a {
    display: flex;
    gap: 7px;
    align-items: center;
    font-weight: 800;
    padding: 13px 8px;
    border-radius: 12px;
    transition: 0.25s ease;
}

.dropdown-node > a {
    justify-content: space-between;
    padding: 13px 14px;
}

.drop-icon,
.fly-icon {
    font-size: 13px;
    color: var(--aqua);
    transition: transform 0.25s ease;
}

/* Dropdown boxes */
.dropdown-panel,
.flyout-panel {
    position: absolute;
    display: none;
    min-width: 260px;
    background: #020812;
    border: 1px solid var(--line);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
    padding: 12px;
}

.dropdown-panel {
    top: 100%;
    left: 0;
    border-radius: 0 0 18px 18px;
}

.dropdown-panel.open-left {
    right: 0;
    left: auto;
}

.flyout-panel {
    top: 0;
    left: 100%;
    border-radius: 18px;
}

.flyout-panel.open-left {
    left: auto;
    right: 100%;
}

.flyout-panel a {
    display: block;
    padding: 13px 14px;
    border-radius: 12px;
    font-weight: 800;
}

.nav-node > a:hover,
.dropdown-node > a:hover,
.flyout-panel a:hover {
    color: var(--aqua);
    background: rgba(255, 255, 255, 0.06);
}

/* Desktop open states */
.nav-node:hover > .dropdown-panel,
.dropdown-node:hover > .flyout-panel,
.nav-node.open > .dropdown-panel,
.dropdown-node.open > .flyout-panel {
    display: block;
}

/* Arrow moves up when submenu opens */
.nav-node:hover > a .drop-icon,
.nav-node.open > a .drop-icon {
    transform: rotate(180deg);
}

.dropdown-node:hover > a .fly-icon,
.dropdown-node.open > a .fly-icon {
    transform: rotate(180deg);
}

.mobile-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Tablet and mobile */
@media (max-width: 1120px) {
    .site-header {
        min-height: 78px;
        padding: 0 24px;
    }

    .mobile-toggle {
        display: grid;
        place-items: center;
    }

    .main-nav {
        position: fixed;
        top: 78px;
        left: 16px;
        right: 16px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        background: #020812;
        border: 1px solid var(--line);
        border-radius: 24px;
        padding: 18px;
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    }

    .main-nav.open {
        display: flex;
    }

    .nav-node > a,
    .dropdown-node > a {
        justify-content: space-between;
        width: 100%;
        padding: 14px;
    }

    .dropdown-panel,
    .flyout-panel,
    .dropdown-panel.open-left,
    .flyout-panel.open-left {
        position: static;
        min-width: 0;
        box-shadow: none;
        border-radius: 16px;
        margin: 6px 0 10px 12px;
        background: rgba(255, 255, 255, 0.045);
        border-color: rgba(145, 231, 255, 0.12);
        padding: 8px;
    }

    .nav-node:not(.open) > .dropdown-panel,
    .dropdown-node:not(.open) > .flyout-panel {
        display: none;
    }

    .nav-node.open > .dropdown-panel,
    .dropdown-node.open > .flyout-panel {
        display: block;
    }

    .nav-node:hover > .dropdown-panel,
    .dropdown-node:hover > .flyout-panel {
        display: none;
    }

    .nav-node.open:hover > .dropdown-panel,
    .dropdown-node.open:hover > .flyout-panel {
        display: block;
    }

    .dropdown-node .fly-icon {
        transform: rotate(90deg);
    }

    .dropdown-node.open > a .fly-icon {
        transform: rotate(-90deg);
    }
}

/* Small mobile */
@media (max-width: 520px) {
    .site-header {
        padding: 0 16px;
        min-height: 72px;
    }

    .main-nav {
        top: 72px;
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 88px);
        border-radius: 18px;
        padding: 14px;
    }

    .brand span:last-child {
        max-width: 145px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
    }

    .mobile-toggle {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .brand span:last-child {
        max-width: 105px;
    }

    .site-header {
        padding: 0 12px;
    }
}