.cb-navbar {
    /* Future themeable logo bars (inline SVG): --sc-logo-bar-1 … --sc-logo-bar-4 */
    --cb-navbar-height: 4.5rem;
    --cb-navbar-gap: 2rem;
    --cb-navbar-text: rgba(255, 255, 255, 0.92);
    --cb-navbar-muted: rgba(255, 255, 255, 0.55);
    --cb-navbar-accent: #b8ff72;
    --cb-navbar-panel-bg: #000;
    --cb-navbar-glass-border: rgba(255, 255, 255, 0.1);
    --cb-navbar-bar-pad-y: 0.75rem;
    --cb-navbar-bar-pad-x: 1.5rem;
    --cb-navbar-safe-top: env(safe-area-inset-top, 0px);
    --cb-navbar-safe-bottom: env(safe-area-inset-bottom, 0px);
    --cb-navbar-safe-left: env(safe-area-inset-left, 0px);
    --cb-navbar-safe-right: env(safe-area-inset-right, 0px);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    color: var(--cb-navbar-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cb-navbar.is-open {
    position: fixed;
    inset-inline: 0;
    top: 0;
    width: 100%;
}

.cb-navbar__surface {
    position: relative;
    z-index: 2;
    padding-top: var(--cb-navbar-safe-top);
    padding-left: var(--cb-navbar-safe-left);
    padding-right: var(--cb-navbar-safe-right);
    background: var(--cb-navbar-panel-bg);
    border-bottom: 1px solid var(--cb-navbar-glass-border);
}

.cb-navbar__inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--cb-navbar-gap);
    max-width: 1280px;
    min-height: var(--cb-navbar-height);
    margin: 0 auto;
    padding: var(--cb-navbar-bar-pad-y) var(--cb-navbar-bar-pad-x);
}

.cb-navbar__brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    align-self: center;
    max-width: min(40vw, 220px);
    text-decoration: none;
    position: relative;
    z-index: 3;
}

.cb-navbar__logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 2.75rem;
    object-fit: contain;
}

.cb-navbar__logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    color: var(--cb-navbar-muted);
    font-size: 0.875rem;
}

.cb-navbar__toggle {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 3rem;
    min-height: 100%;
    margin: calc(var(--cb-navbar-bar-pad-y) * -1) 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--cb-navbar-text);
    cursor: pointer;
    order: 2;
    position: relative;
    z-index: 3;
}

.cb-navbar__toggle:hover,
.cb-navbar__toggle:focus-visible {
    background: transparent;
    outline: none;
}

.cb-navbar__toggle:focus-visible {
    outline: 2px solid var(--cb-navbar-accent);
    outline-offset: 4px;
}

.cb-navbar.is-compact .cb-navbar__toggle {
    display: inline-flex;
}

.cb-navbar__toggle-icon {
    position: relative;
    display: block;
    width: 1.85rem;
    height: 0.28rem;
    background: currentColor;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.cb-navbar__toggle-icon::before,
.cb-navbar__toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 0.28rem;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s ease, top 0.2s ease;
}

.cb-navbar__toggle-icon::before {
    top: -0.78rem;
}

.cb-navbar__toggle-icon::after {
    top: 0.78rem;
}

.cb-navbar.is-open .cb-navbar__toggle-icon {
    background: transparent;
}

.cb-navbar.is-open .cb-navbar__toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.cb-navbar.is-open .cb-navbar__toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.cb-navbar__menu {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
}

.cb-navbar__menu-primary {
    display: contents;
}

.cb-navbar__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cb-navbar__item {
    flex: 0 0 auto;
}

.cb-navbar__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.375rem 0.125rem;
    color: var(--cb-navbar-text);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.cb-navbar__link:hover,
.cb-navbar__link:focus-visible {
    color: var(--cb-navbar-accent);
    outline: none;
}

.cb-navbar__link.is-active {
    color: var(--cb-navbar-accent);
}

.cb-navbar__legal {
    display: none;
}

/* Offscreen horizontal copy for compact-mode measurement (never toggles live layout). */
.cb-navbar__measure {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    z-index: -1;
}

.cb-navbar__measure-list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    width: max-content;
}

.cb-navbar__measure-item {
    flex: 0 0 auto;
}

.cb-navbar__measure-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.375rem 0.125rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Closed compact: no fixed fullscreen layer. */
.cb-navbar.is-compact:not(.is-open) .cb-navbar__menu {
    display: none;
}

.cb-navbar.is-compact.is-open .cb-navbar__menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    padding:
        calc(var(--cb-navbar-height) + var(--cb-navbar-safe-top))
        calc(var(--cb-navbar-bar-pad-x) + var(--cb-navbar-safe-right))
        calc(1.5rem + var(--cb-navbar-safe-bottom))
        calc(var(--cb-navbar-bar-pad-x) + var(--cb-navbar-safe-left));
    visibility: visible;
    opacity: 1;
    background: var(--cb-navbar-panel-bg);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.cb-navbar.is-compact .cb-navbar__menu-primary {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    width: 100%;
}

.cb-navbar.is-compact .cb-navbar__list {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 1280px;
    margin: 0;
    padding: 0;
}

.cb-navbar.is-compact .cb-navbar__link {
    width: auto;
    min-height: 2.75rem;
    padding: 0.5rem 0;
    border-radius: 0;
    font-size: 1.35rem;
    white-space: normal;
}

.cb-navbar.is-compact .cb-navbar__link:hover,
.cb-navbar.is-compact .cb-navbar__link:focus-visible {
    background: transparent;
    color: var(--cb-navbar-accent);
}

.cb-navbar.is-compact .cb-navbar__legal {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.25rem;
    width: 100%;
    max-width: 1280px;
    margin: 0;
    padding: 1rem 0 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cb-navbar__legal-link {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    color: var(--cb-navbar-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cb-navbar__legal-link:hover,
.cb-navbar__legal-link:focus-visible {
    color: #72ffff;
    outline: none;
}

html.cb-navbar-lock {
    overscroll-behavior: none;
}

html.cb-navbar-lock,
html.cb-navbar-lock body {
    overflow: hidden;
    touch-action: none;
}

@media (prefers-reduced-motion: reduce) {
    .cb-navbar.is-compact.is-open .cb-navbar__menu,
    .cb-navbar__toggle-icon,
    .cb-navbar__toggle-icon::before,
    .cb-navbar__toggle-icon::after,
    .cb-navbar__link,
    .cb-navbar__legal-link {
        transition: none;
    }
}
