/* Outer blue ring — the button itself */
#scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 54px;
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    background-color: #228FEB;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

#scroll-to-top.visible {
    opacity: 0.8;
    pointer-events: auto;
}

#scroll-to-top.visible:hover {
    opacity: 0.9;
}

/* Middle white ring */
#scroll-to-top::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: #ffffff;
}

/* Inner blue circle with shimmer sweep on hover */
#scroll-to-top::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: #228FEB;
    background-image: linear-gradient(
        105deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0) 70%
    );
    background-size: 300% 100%;
    background-position: 200% center;
    transition: background-position 550ms cubic-bezier(.19, 1, .22, 1);
}

#scroll-to-top.visible:hover::after {
    background-position: -100% center;
}

/* Icon sits above pseudo-elements */
#scroll-to-top svg {
    position: relative;
    z-index: 1;
    width: 30px;
    aspect-ratio: 1;
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
