.site-footer {
    align-items: baseline;
    position: relative;
}

.site-footer > p,
.site-footer .footer-right p { margin: 0; }

.site-footer .footer-right {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 28px;
    margin-left: auto;
}

.site-footer .admin-access-link {
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    color: inherit;
    opacity: .62;
    transition: opacity .2s ease, border-color .2s ease;
}

.back-to-top {
    position: fixed;
    z-index: 900;
    right: clamp(24px, 5vw, 76px);
    bottom: 24px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(216, 187, 255, .72);
    border-radius: 50%;
    background: rgba(8, 20, 33, .9);
    color: #f5efe4;
    box-shadow: 0 0 0 1px rgba(136, 93, 255, .13), 0 0 16px rgba(136, 93, 255, .36);
    opacity: 0;
    transform: translateY(12px) scale(.92);
    pointer-events: none;
    cursor: pointer;
    font: 700 19px/1 var(--sans);
    transition: opacity .24s ease, transform .3s cubic-bezier(.2, .8, .25, 1),
                border-color .2s ease, box-shadow .25s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    border-color: #ead7ff;
    box-shadow: 0 0 0 2px rgba(216, 187, 255, .22), 0 0 24px rgba(159, 94, 255, .64);
    transform: translateY(-2px) scale(1.05);
}

.site-footer.footer-in-view .back-to-top {
    position: absolute;
    top: 0;
    right: clamp(24px, 5vw, 76px);
    bottom: auto;
    transform: translateY(-50%) scale(1);
}

.site-footer.footer-in-view .back-to-top:hover,
.site-footer.footer-in-view .back-to-top:focus-visible {
    transform: translateY(-50%) scale(1.05);
}

.site-footer .admin-access-link:hover,
.site-footer .admin-access-link:focus-visible {
    border-color: currentColor;
    opacity: 1;
}

@media (max-width: 760px) {
    .site-footer .footer-right {
        justify-content: flex-start;
        gap: 20px;
        margin: 8px 0 0;
    }
    .back-to-top { right: 24px; bottom: 18px; }
    .site-footer.footer-in-view .back-to-top { right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: none; }
}
