/* ------------------------------------------------------------ mobile nav -- */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    margin-left: auto;
    background: none;
    border: 1px solid var(--day-rule);
    /* A disc, like every other control. The rounded square was the first
       rigid thing a phone reader met. */
    border-radius: 999px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    margin-inline: auto;
    background: var(--day-ink);
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    padding: 0 var(--gutter);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    background: var(--day-surface);
    border-bottom: 1px solid var(--day-rule);
    transition: max-height 0.3s var(--ease), padding 0.3s var(--ease),
        visibility 0s linear 0.3s;
}

.mobile-nav.active {
    max-height: 70vh;
    padding-block: 0.75rem 1.25rem;
    overflow-y: auto;
    visibility: visible;
    transition-delay: 0s;
}

.mobile-nav-link {
    padding: 0.85rem 0;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--day-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--day-rule-soft);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* The collapsed box learned the night in round 3; the open drawer never did,
   so tapping the menu at the bottom of the page dropped a near-white sheet
   over the moss. */
.site-header.is-night + .mobile-nav {
    background: var(--night-surface);
    border-bottom-color: var(--night-rule);
}

.site-header.is-night + .mobile-nav .mobile-nav-link {
    color: var(--night-ink);
    border-bottom-color: var(--night-rule);
}

