/* Back to top — floating action */

.scrollToHome.back-to-top {
    align-items: center;
    background: linear-gradient(145deg, #443297 0%, #5b44b8 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow:
        0 10px 24px rgba(68, 50, 151, 0.28),
        0 2px 6px rgba(16, 24, 40, 0.08);
    color: #fff;
    display: inline-flex;
    height: 3rem;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: calc(1rem + env(safe-area-inset-right, 0px));
    text-decoration: none;
    transform: translateY(12px) scale(0.92);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
    visibility: hidden;
    width: 3rem;
    z-index: 1050;
}

.scrollToHome.back-to-top.show {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    opacity: 1;
    pointer-events: auto;
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
    transform: translateY(0) scale(1);
    visibility: visible;
}

.scrollToHome.back-to-top:hover,
.scrollToHome.back-to-top:focus-visible {
    background: linear-gradient(145deg, #36287d 0%, #443297 100%);
    box-shadow:
        0 14px 28px rgba(68, 50, 151, 0.34),
        0 4px 10px rgba(16, 24, 40, 0.1);
    color: #fff;
    transform: translateY(-2px) scale(1);
}

.scrollToHome.back-to-top:focus-visible {
    outline: 2px solid rgba(68, 50, 151, 0.45);
    outline-offset: 3px;
}

.back-to-top__icon {
    align-items: center;
    display: inline-flex;
    font-size: 0.95rem;
    height: 100%;
    justify-content: center;
    width: 100%;
}

@media (min-width: 768px) {
    .scrollToHome.back-to-top {
        height: 3.25rem;
        width: 3.25rem;
    }

    .scrollToHome.back-to-top.show {
        bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
        right: calc(1.75rem + env(safe-area-inset-right, 0px));
    }

    .back-to-top__icon {
        font-size: 1rem;
    }
}

@media (min-width: 1200px) {
    .scrollToHome.back-to-top.show {
        bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
        right: calc(2rem + env(safe-area-inset-right, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .scrollToHome.back-to-top,
    .scrollToHome.back-to-top.show {
        transition: opacity 0.01ms ease, visibility 0.01ms ease;
        transform: none;
    }

    .scrollToHome.back-to-top:hover,
    .scrollToHome.back-to-top:focus-visible {
        transform: none;
    }
}
