/* Desktop navigation keeps the existing layout. */
.nav-toggle {
    display: none;
}

@media (max-width: 768px) {
    header {
        padding: 1.25rem 1rem;
    }

    header h1 {
        font-size: 1.4rem;
        line-height: 1.4;
        letter-spacing: 0;
    }

    header p {
        font-size: 0.95rem;
    }

    /* Without JavaScript, links remain visible and scroll with the page. */
    nav {
        position: static;
    }

    nav.is-collapsible {
        position: sticky;
    }

    .is-collapsible .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 3.5rem;
        padding: 0 1rem;
        border: 0;
        background: transparent;
        color: white;
        font: inherit;
        font-weight: bold;
        cursor: pointer;
    }

    .nav-toggle:focus-visible {
        outline: 2px solid white;
        outline-offset: -4px;
    }

    .is-collapsible ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - 3.5rem);
        max-height: calc(100dvh - 3.5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        background-color: var(--secondary-color);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    }

    .is-collapsible .nav-toggle[aria-expanded="true"] + ul {
        display: flex;
    }

    section {
        scroll-margin-top: 4.5rem;
    }
}
