.scroll-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-mono);
    font-size: 15px;
    background: var(--accent);
    color: var(--paper);
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-base);
}

.scroll-to-top:hover {
    background: var(--ink);
}

@keyframes reveal-scroll-to-top {
    from {
        opacity: 0;
        pointer-events: none;
    }

    to {
        opacity: 1;
        pointer-events: auto;
    }
}

@supports (animation-timeline: scroll()) {
    .scroll-to-top {
        display: flex;
        opacity: 0;
        pointer-events: none;
        animation-name: reveal-scroll-to-top;
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: scroll(root block);
        animation-range: 400px 560px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        animation-name: none;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 759px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
    }
}
