/* ── Back to top ───────────────────────────────────────────────
   A quiet floating control for long-form pages, hidden until the
   reader has scrolled a meaningful distance (see back-to-top.js).
   Visibility is CSS-driven (opacity/visibility) so a hidden button
   is neither announced nor focusable - no aria-hidden bookkeeping
   needed in JS.
*/
.back-to-top {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: var(--z-back-to-top, 90);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    color: var(--color-interactive);
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-base), visibility var(--transition-base),
        box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.back-to-top:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--color-interactive);
    text-decoration: none;
}

@media (max-width: 640px) {
    .back-to-top {
        right: var(--space-4);
        bottom: var(--space-4);
    }
}
