main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.site-header {
    min-height: 92px;
    padding: 12px clamp(24px, 4vw, 56px);
    border-bottom: 5px solid var(--ctc-color-brand-red);
    background-color: var(--ctc-color-brand-yellow);
    color: var(--ctc-color-brand-red);
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
}

.brand-link {
    color: inherit;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-name {
    display: block;
    font-family: var(--ctc-font-display);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
}

.brand-link:focus-visible,
.nav-link:focus-visible,
.nav-menu-toggle:focus-visible,
.close-menu:focus-visible,
.nav-logout-button:focus-visible {
    outline: 3px solid #0055ff;
    outline-offset: 4px;
}

.primary-nav {
    min-width: 0;
    display: flex;
    align-items: center;
}

.nav-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    box-sizing: border-box;
}

.nav-link,
.nav-logout-button {
    min-height: 52px;
    padding: 14px 18px;
    border: 2px solid transparent;
    border-radius: var(--ctc-radius-small);
    background: transparent;
    color: var(--ctc-color-brand-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    font-family: var(--ctc-font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.nav-link.is-active {
    border-color: transparent;
    background: transparent;
    color: #111;
    box-shadow: none;
    font-weight: 900;
    transform: none;
}

.nav-link.is-active::after {
    content: "";
    height: 4px;
    position: absolute;
    right: 16px;
    bottom: 3px;
    left: 16px;
    border-radius: 3px;
    background: #111;
}

.nav-link:not(.is-active):not(.nav-cta):hover {
    border-color: #111;
    background: var(--ctc-color-brand-red);
    color: var(--ctc-color-white);
    box-shadow: 3px 3px 0 #111;
    transform: translate(-1px, -1px);
}

.nav-cta,
.nav-cta.is-active {
    border-color: #111;
    background: var(--ctc-color-brand-red);
    color: var(--ctc-color-white);
    box-shadow: 3px 3px 0 #111;
    font-weight: 900;
}

.nav-cta.is-active::after {
    content: none;
}

.nav-cta:hover,
.nav-cta.is-active:hover {
    border-color: #111;
    background: #a90000;
    color: var(--ctc-color-white);
    box-shadow: 4px 4px 0 #111;
    transform: translate(-1px, -1px);
}

.nav-logout-form {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-logout-button {
    border-color: var(--ctc-color-brand-red);
    appearance: none;
    -webkit-appearance: none;
}

.nav-logout-button:hover {
    border-color: #111;
    background: var(--ctc-color-brand-red);
    color: var(--ctc-color-white);
    box-shadow: 3px 3px 0 #111;
    transform: translate(-1px, -1px);
}

.nav-menu-toggle,
.close-menu {
    display: none;
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

footer {
    margin-top: auto;
    padding: 20px;
    background-color: #222;
    color: #ccc;
    font-size: .8em;
    text-align: center;
}

@media (max-width: 1180px) and (min-width: 861px) {
    .site-header {
        padding-inline: 24px;
        gap: 20px;
    }

    .brand-name {
        font-size: 2.15rem;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-link,
    .nav-logout-button {
        min-height: 48px;
        padding: 12px 11px;
        font-size: .9rem;
    }
}

@media (max-width: 860px) {
    .site-header {
        min-height: 78px;
        padding: 12px 20px;
        gap: 20px;
    }

    .brand-name {
        font-size: 2rem;
    }

    .nav-menu-toggle {
        width: 48px;
        height: 48px;
        padding: 8px;
        border: 2px solid currentColor;
        border-radius: 6px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
    }

    .nav-menu-toggle span {
        width: 100%;
        height: 3px;
        border-radius: 2px;
        background-color: currentColor;
    }

    .nav-links {
        width: min(100%, 420px);
        height: 100dvh;
        padding: 18px 20px 32px;
        position: fixed;
        inset: 0 0 0 auto;
        background-color: var(--ctc-color-brand-yellow);
        box-shadow: -8px 0 24px rgba(0, 0, 0, .25);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        overflow-y: auto;
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .25s ease, visibility .25s ease;
        z-index: 1100;
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
    }

    .close-menu-container {
        padding-bottom: 10px;
        border-bottom: 2px solid rgba(204, 0, 0, .2);
        display: flex;
        justify-content: flex-end;
    }

    .close-menu {
        width: 48px;
        height: 48px;
        color: var(--ctc-color-brand-red);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        font-weight: 700;
        line-height: 1;
    }

    .nav-links > li,
    .nav-logout-form,
    .nav-link,
    .nav-logout-button {
        width: 100%;
    }

    .nav-link,
    .nav-logout-button {
        min-height: 56px;
        padding: 15px 18px;
        font-size: 1.2rem;
    }

    .nav-link.is-active::after {
        width: 4px;
        height: auto;
        top: 10px;
        right: auto;
        bottom: 10px;
        left: 2px;
    }

    .nav-cta.is-active::after {
        content: none;
    }

    .nav-menu-open {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-links,
    .nav-link,
    .nav-logout-button {
        transition: none;
    }
}
