.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    padding-block: clamp(1.5rem, 4vw, 2.25rem);
    padding-inline: 0;
    border-top: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.45);
}

.site-footer__inner {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-footer__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
    width: 100%;
}

.site-footer__controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    margin-left: auto;
}

.site-footer__theme {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem 0.65rem;
}

.site-footer__theme-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.site-footer__theme .theme-switch__option {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    color: var(--muted);
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.site-footer__theme .theme-switch__option:hover {
    color: var(--text);
}

.site-footer__theme .theme-switch__option:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 0.3rem;
    padding-inline: 0.2rem;
}

.site-footer__theme .theme-switch__option.active {
    color: var(--text);
    font-weight: 600;
}

.site-footer__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    max-width: 100%;
}

.site-footer__logo img {
    display: block;
    width: auto;
    height: auto;
    max-height: 48px;
    max-width: min(200px, 100%);
    object-fit: contain;
    object-position: left center;
}

.site-footer__logo:hover img {
    opacity: 0.9;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem 1.25rem;
    margin-left: 0;
}

.site-footer__nav a {
    font-size: 0.9375rem;
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: 0.2rem 0;
    transition: color 150ms ease;
    white-space: nowrap;
}

.site-footer__nav a:hover {
    color: var(--text);
}

.site-footer__legal {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted-2);
    line-height: 1.5;
}

@media (max-width: 639px) {
    .site-footer__controls {
        align-items: flex-start;
        margin-left: 0;
        width: 100%;
    }

    .site-footer__theme {
        justify-content: flex-start;
    }

    .site-footer__nav {
        justify-content: flex-start;
        margin-left: 0;
        width: 100%;
    }
}
