#scroll-top {
    position: fixed;
    bottom: 55px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none; 
    background: rgba(10, 26, 36, 0.92);
    color: rgba(var(--c-cyan-rgb, 0, 173, 238), 0.7);
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 12px rgba(var(--c-cyan-rgb, 0, 173, 238), 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition:
        opacity 0.3s cubic-bezier(.16,1,.3,1),
        visibility 0s 0.3s,
        transform 0.3s cubic-bezier(.16,1,.3,1),
        color 0.2s,
        box-shadow 0.2s;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible; 
}

#scroll-progress-ring {
    position: absolute;
    inset: -1px; 
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    pointer-events: none;
    transform: rotate(-90deg); 
}

#scroll-progress-ring circle:first-child {
    fill: none;
    stroke: rgba(var(--c-cyan-rgb, 0, 173, 238), 0.12);
    stroke-width: 1.5;
}

#scroll-progress-arc {
    fill: none;
    stroke: rgba(var(--c-cyan-rgb, 0, 173, 238), 0.75);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 125.66; 
    transition: stroke-dashoffset 0.1s linear, stroke 0.2s;
}

.scroll-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    will-change: transform;
    position: relative;
    z-index: 1;
}

#scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.3s cubic-bezier(.16,1,.3,1),
        visibility 0s 0s,
        transform 0.3s cubic-bezier(.16,1,.3,1),
        color 0.2s,
        box-shadow 0.2s;
}

#scroll-top:hover {
    color: var(--c-cyan, #00adee);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.55),
        0 0 16px rgba(var(--c-cyan-rgb, 0, 173, 238), 0.2),
        inset 0 0 14px rgba(var(--c-cyan-rgb, 0, 173, 238), 0.1);
    transform: translateY(-2px) scale(1);
}

#scroll-top:hover #scroll-progress-arc {
    stroke: rgba(var(--c-cyan-rgb, 0, 173, 238), 1);
}

#scroll-top:hover .scroll-arrow {
    transform: translateY(-2px);
}

#scroll-top:active {
    transform: translateY(0) scale(0.95);
}

#scroll-top::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(var(--c-cyan-rgb, 0, 173, 238), 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    #scroll-top,
    .scroll-arrow,
    #scroll-progress-arc {
        transition: opacity 0.1s, visibility 0s;
    }
    #scroll-top:hover,
    #scroll-top:hover .scroll-arrow {
        transform: none;
    }
}
