.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
html[data-theme="light"] .site-header {
    border-color: rgba(15,23,42,0.06);
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(232,190,97,0.18), rgba(53,199,129,0.18));
    border: 1px solid rgba(232,190,97,0.22);
    color: var(--gold);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.02;
}

.brand-ar {
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
}

.brand-en {
    color: var(--gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    direction: ltr;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 0;
}

.main-nav a {
    color: color-mix(in srgb, var(--text) 86%, transparent);
    font-size: 13px;
    font-weight: 700;
    transition: color .2s ease, opacity .2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.lang-switch:hover {
    color: var(--gold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-tagline {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    max-width: 220px;
    text-align: left;
    line-height: 1.35;
}

.theme-toggle,
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
}
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .lang-switch {
    border-color: rgba(15,23,42,0.08);
    background: rgba(15,23,42,0.02);
}

.theme-toggle {
    cursor: pointer;
}

.theme-icon {
    font-size: 14px;
    line-height: 1;
}

.lang-switch {
    padding: 0 12px;
    min-width: auto;
    font-weight: 800;
    font-size: 12px;
}

@media (max-width: 1120px) {
    .site-tagline {
        display: none;
    }
}

@media (max-width: 860px) {
    .header-inner {
        grid-template-columns: 1fr;
        gap: 9px;
        justify-items: stretch;
    }

    .brand,
    .header-actions {
        justify-content: center;
    }

    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
        gap: 13px;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 640px) {
    .site-header {
        position: static;
    }

    .header-inner {
        padding: 8px 0;
        gap: 7px;
    }

    .brand {
        justify-content: center;
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: 17px;
    }

    .brand-ar {
        font-size: 17px;
    }

    .brand-en {
        font-size: 10px;
    }

    .main-nav {
        gap: 11px;
        width: 100%;
        flex-wrap: nowrap;
    }

    .main-nav a {
        white-space: nowrap;
        font-size: 12px;
    }

    .header-actions {
        justify-content: center;
        gap: 6px;
    }

    .theme-toggle,
    .lang-switch {
        height: 32px;
        min-width: 32px;
    }

    .lang-switch {
        padding: 0 10px;
        font-size: 11px;
    }
}
