.ribbon {
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    width: max-content;
    max-width: calc(100% - 24px);
}

.ribbon > * + * {
    border-left: 0;
}

.menu-links {
    display: flex;
    align-items: stretch;
}

.ribbon-home,
.menu-links > a,
.menu-links > span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.8rem;
    color: var(--paper);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.ribbon-home,
.menu-links > a,
.menu-toggle {
    transition: background-color 140ms ease, color 140ms ease;
}

.ribbon-home:hover,
.ribbon-home:focus-visible,
.menu-links > a:hover,
.menu-links > a:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
    background: var(--rust);
    color: var(--paper-light, #faf7ed) !important;
    outline: none;
}

.ribbon-home:focus-visible,
.menu-links > a:focus-visible,
.menu-toggle:focus-visible {
    box-shadow: inset 0 0 0 2px var(--paper-light, #faf7ed);
}

.ribbon-home .brand-dot {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--rust);
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.ribbon-home:hover .brand-dot,
.ribbon-home:focus-visible .brand-dot {
    color: var(--paper-light, #faf7ed);
}

.menu-links > * + * {
    border-left: 1px solid rgba(242, 237, 223, 0.35);
}

.menu-links > [aria-current="page"] {
    background: rgba(36, 40, 32, 0.56);
    color: rgba(242, 237, 223, 0.58);
    box-shadow: inset 0 -3px 0 rgba(36, 40, 32, 0.34);
    cursor: default;
}

.menu-links > a[aria-current="page"] {
    pointer-events: none;
}

.ribbon-home + .menu-toggle,
.ribbon-home + .menu-links {
    border-left: 1px solid rgba(242, 237, 223, 0.35);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--moss);
    color: var(--paper);
    cursor: pointer;
}

.hamburger {
    display: grid;
    gap: 4px;
    width: 16px;
    padding: 0 !important;
}

.hamburger i {
    display: block;
    width: 16px;
    height: 1px;
    background: currentColor;
    transform-origin: center;
    transition: transform 160ms ease, opacity 160ms ease;
}

.menu-open .hamburger i:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.menu-open .hamburger i:nth-child(2) {
    opacity: 0;
}

.menu-open .hamburger i:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 700px) {
    .ribbon {
        top: 6px;
        right: 6px;
        left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        width: auto;
        min-width: 46px;
        max-width: calc(100% - 12px);
        margin: 0;
        transform: none;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-links {
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        order: 3;
        border-top: 1px solid rgba(242, 237, 223, 0.35);
    }

    .menu-open .menu-links {
        display: flex;
    }

    .menu-links > a,
    .menu-links > span {
        justify-content: flex-start;
        min-height: 40px;
        padding-inline: 0.8rem;
    }

    .menu-links > * + * {
        border-top: 1px solid rgba(242, 237, 223, 0.35);
        border-left: 0;
    }

    .menu-links > [aria-current="page"] {
        box-shadow: inset 3px 0 0 rgba(36, 40, 32, 0.34);
    }

    .ribbon-home {
        min-height: 34px;
    }
}
