.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 66px;
    padding: 0.72rem max(1rem, calc((100vw - 1180px) / 2));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

.brand-ball {
    position: relative;
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--accent-2);
    color: #14210e;
}

.brand-ball::before,
.brand-ball::after {
    position: absolute;
    top: -5px;
    width: 24px;
    height: 44px;
    border: 2px solid rgba(20, 33, 14, 0.42);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.brand-ball::before {
    left: -15px;
}

.brand-ball::after {
    right: -15px;
}

.brand-letter {
    position: relative;
    z-index: 1;
    font: inherit;
    font-weight: 900;
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.08;
}

.brand-title {
    font-weight: 900;
}

.brand-subtitle {
    max-width: min(64vw, 520px);
    margin-top: 0.22rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface);
}

.nav-links {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

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

.nav-links a {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text);
    font-weight: 750;
    text-decoration: none;
}

.nav-links a:hover {
    background: var(--surface-2);
}

@media (min-width: 760px) {
    .nav-toggle {
        display: none;
    }

    .nav-links {
        position: static;
        display: flex;
        flex-direction: row;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-links a {
        padding: 0.65rem 0.75rem;
    }

    .brand-subtitle {
        max-width: 560px;
        font-size: 0.76rem;
    }
}
