/* Bring the navigation into the same colourful, rounded world as the page. */
body .topbar { justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.topbar .brand { flex-shrink: 0; }
.topbar .topnav {
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
.topbar .topnav a {
    --nav-fill: #eee5f9;
    --nav-edge: #d4bee9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 11px 20px;
    border: 2px solid transparent;
    border-radius: 18px 22px 18px 18px;
    background: var(--nav-fill);
    color: #39205f;
    box-shadow: 0 4px 0 var(--nav-edge);
    font-family: "Baloo 2", "Nunito", sans-serif;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}
.topbar .topnav a:nth-child(4n + 2) { --nav-fill: #bdebf4; --nav-edge: #8dceda; }
.topbar .topnav a:nth-child(4n + 3) { --nav-fill: #e1efb7; --nav-edge: #bacf86; }
.topbar .topnav a:nth-child(4n) { --nav-fill: #fff0ad; --nav-edge: #e3cf79; }
.topbar .topnav a::after { content: none; }
.topbar .topnav a:hover,
.topbar .topnav a:focus-visible {
    background: var(--nav-fill);
    color: #39205f;
    box-shadow: 0 6px 0 var(--nav-edge);
    transform: translateY(-2px);
}
.topbar .topnav a.is-active {
    border-color: #6533bc;
    background: var(--nav-fill);
    color: #39205f;
    box-shadow: 0 4px 0 var(--nav-edge);
}
@media (min-width: 761px) and (max-width: 980px) {
    .topbar .topnav { gap: 8px; }
    .topbar .topnav a { padding: 10px 12px; font-size: 1rem; }
}
@media (max-width: 760px) {
    body .topbar { flex-direction: column; align-items: stretch; gap: 18px; }
    .topbar .brand { align-self: center; }
    .topbar .topnav { display: grid; width: 100%; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; }
    .topbar .topnav a { width: auto; padding: 10px; font-size: 1rem; }
    .topbar .topnav:has(a:nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .topbar .topnav,
    .topbar .topnav:has(a:nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar .topnav a { min-height: 54px; }
    .topbar .topnav a:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    .topbar .topnav a { transition: none; }
    .topbar .topnav a:hover,
    .topbar .topnav a:focus-visible { transform: none; }
}

.topbar .topnav a:focus-visible { outline: 3px solid #6533bc; outline-offset: 5px; }
@media (min-width: 761px) {
    .topbar .topnav { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
}
