/* Shared public-site top bar. Keep public static pages on this single contract. */
.nav {
    position: sticky; top: 0; z-index: 100;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    height: 68px;
    padding: 0 clamp(1.5rem, 4vw, 3.5rem);
    border-bottom: 1px solid rgba(229, 231, 235, 0.78);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    transition: height 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.nav.nav--scrolled {
    height: 62px;
    border-bottom-color: rgba(190, 46, 203, 0.18);
    box-shadow: 0 12px 30px rgba(16, 11, 32, 0.06);
}
.nav__brand {
    grid-column: 1;
    grid-row: 1;
    display: inline-flex; align-items: center; justify-self: start;
    z-index: 1;
}
.nav__logo { height: 32px; width: auto; display: block; }
.nav__menu { display: contents; }
.nav__links {
    grid-column: 2;
    grid-row: 1;
    display: flex; align-items: center; justify-self: start;
    gap: clamp(1rem, 1.55vw, 1.55rem); list-style: none;
    margin-left: clamp(2.4rem, 4.8vw, 5rem);
}
.nav__link {
    position: relative;
    display: inline-flex; align-items: center;
    min-height: 34px;
    font-size: 0.82rem; font-weight: 620; color: var(--text);
    text-decoration: none; letter-spacing: 0;
    transition: color 0.2s;
}
button.nav__link {
    border: 0;
    padding: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}
.nav__link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    height: 2px;
    border-radius: 999px;
    background: var(--purple-inception);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
}
.nav__link:hover { color: var(--purple); }
.nav__link:hover::after,
.nav__index.nav__index--open .nav__index-label::after {
    transform: scaleX(1);
}
.nav__index.nav__index--open .nav__index-label { color: var(--purple); }
.nav__index { position: relative; }
.nav__index-trigger {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.nav__index-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 28px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-body);
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}
.nav__index-toggle::before {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
}
.nav__index-toggle:hover,
.nav__index-toggle:focus-visible,
.nav__index.nav__index--open .nav__index-toggle {
    background: rgba(190, 46, 203, 0.08);
    color: var(--purple);
}
.nav__index.nav__index--open .nav__index-toggle::before {
    transform: translateY(2px) rotate(225deg);
}
.nav__index-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 120;
    display: none;
    width: min(560px, calc(100vw - 48px));
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 72px rgba(15, 23, 42, 0.18);
}
.nav__index-panel::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}
.nav__index.nav__index--open .nav__index-panel { display: block; }
.nav__index-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    padding: 2px 4px 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
}
.nav__index-panel-head strong {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 760;
}
.nav__index-count {
    color: var(--text-light);
    font-size: 0.62rem;
    font-weight: 760;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}
.nav__index-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
.nav__index-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 68px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    box-shadow: inset 2px 0 0 transparent;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}
.nav__index-card:hover,
.nav__index-card:focus-visible {
    border-color: rgba(190, 46, 203, 0.42);
    box-shadow: 0 12px 28px rgba(122, 16, 170, 0.12);
    transform: translateY(-1px);
}
.nav__index-card--public:hover,
.nav__index-card--public:focus-visible {
    box-shadow: inset 2px 0 0 var(--purple-inception), 0 12px 28px rgba(122, 16, 170, 0.12);
}
.nav__index-card--public {
    border-color: rgba(122, 16, 170, 0.36);
    background: linear-gradient(180deg, rgba(250, 245, 255, 0.82), #fff 62%);
    box-shadow: inset 2px 0 0 var(--purple-inception);
}
.nav__index-card--institutional { background: #fbfcfe; }
.nav__index-number {
    color: var(--text-light);
    font-size: 0.64rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1;
}
.nav__index-card--public .nav__index-number { color: var(--purple); }
.nav__index-card strong {
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 760;
    line-height: 1.2;
}
.nav__index-card em {
    color: var(--purple);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 760;
    text-align: right;
    white-space: nowrap;
}
.nav__actions {
    grid-column: 3;
    grid-row: 1;
    display: flex; align-items: center; justify-self: end;
    gap: 0.75rem;
    z-index: 1;
}
.nav__btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-btn, 4px);
    font-size: 0.78rem; font-weight: 760; letter-spacing: 0.08em;
    text-transform: uppercase; text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.nav__btn--outline {
    min-width: 86px;
    color: var(--purple);
    border: 1px solid rgba(122, 16, 170, 0.42);
    background: rgba(255, 255, 255, 0.72);
}
.nav__btn--fill {
    min-width: 158px;
    color: #fff;
    border: 1px solid var(--purple-inception);
    background: var(--purple-inception);
    box-shadow: 0 8px 18px rgba(190, 46, 203, 0.18);
}
.nav__btn:hover { transform: translateY(-1px); }
.nav__btn--outline:hover {
    border-color: var(--purple-inception);
    color: var(--purple-inception);
    background: rgba(190, 46, 203, 0.04);
}
.nav__btn--fill:hover {
    background: var(--purple);
    border-color: var(--purple);
}
.nav__hamburger {
    grid-column: 2;
    grid-row: 1;
    display: none; justify-self: end;
    width: 42px; height: 42px;
    border: 1px solid rgba(16, 11, 32, 0.12);
    border-radius: var(--radius-btn, 4px);
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer; padding: 0;
}
.nav__hamburger span {
    display: block; width: 18px; height: 2px;
    background: var(--text); margin: 4px auto;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav.nav--open .nav__hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.nav--open .nav__hamburger span:nth-child(2) { opacity: 0; }
.nav.nav--open .nav__hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1040px) {
    .nav { grid-template-columns: 1fr auto; }
    .nav__menu {
        display: none;
        position: absolute;
        top: 68px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 1rem clamp(1.5rem, 4vw, 3.5rem) 1.25rem;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(229, 231, 235, 0.9);
        box-shadow: 0 18px 32px rgba(16, 11, 32, 0.08);
    }
    .nav.nav--scrolled .nav__menu { top: 62px; }
    .nav.nav--open .nav__menu { display: flex; }
    .nav__links {
        flex-direction: column; align-items: stretch; gap: 0;
        margin-left: 0;
    }
    .nav__links li { width: 100%; }
    .nav__link { display: flex; min-height: 44px; padding: 0; }
    .nav__link::after { transform-origin: left; }
    .nav__index-trigger {
        justify-content: space-between;
        width: 100%;
    }
    .nav__index-trigger .nav__link { flex: 1 1 auto; }
    .nav__index-toggle { width: 40px; height: 40px; }
    .nav__index-panel {
        position: static;
        width: 100%;
        margin-top: 4px;
        padding: 12px;
        box-shadow: none;
    }
    .nav__index-panel::before { content: none; }
    .nav__index-grid { grid-template-columns: 1fr; }
    .nav__index-card { min-height: 0; }
    .nav__actions {
        display: grid; grid-template-columns: 1fr 1fr;
        gap: 0.75rem; margin-top: 0.8rem;
    }
    .nav__btn { width: 100%; }
    .nav__hamburger { display: block; }
}

@media (max-width: 640px) {
    .nav__actions { grid-template-columns: 1fr; }
}
