/* =========================================================
   BACK TO TOP
   Global floating button (System A). Fixed to the bottom-right,
   hidden until the user scrolls down. Matches the footer social
   button styling for visual consistency.
========================================================= */
.back-to-top {
    position: fixed;
    right: var(--space-6);
    bottom: var(--space-6);
    z-index: 90;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border-primary);
    background: var(--surface-secondary);
    color: var(--text-secondary);
    font-size: var(--text-base);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast),
        visibility var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

/* Revealed once the page is scrolled (toggled in back-to-top.js). */
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    transform: translateY(-2px);
}

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