/* =========================================================
   DEVELOPER SCROLLBAR
   Cyber / Code-Inspired Interface
========================================================= */

/* =========================
   Chrome / Edge / Safari
========================= */

::-webkit-scrollbar {
    width: 12px;
}

/* Track */

::-webkit-scrollbar-track {
    background:
        linear-gradient(
            180deg,
            #020617 0%,
            #06111f 45%,
            #08051b 100%
        );

    border-left: 1px solid rgba(34, 211, 238, 0.08);
}

/* Scroll Thumb */

::-webkit-scrollbar-thumb {

    border-radius: 999px;

    background:
        linear-gradient(
            180deg,
            #22d3ee 0%,
            #3b82f6 45%,
            #8b5cf6 100%
        );

    border: 3px solid #050816;

    box-shadow:
        0 0 8px rgba(34, 211, 238, 0.8),
        0 0 18px rgba(59, 130, 246, 0.5),
        0 0 30px rgba(139, 92, 246, 0.25);

    transition:
        background 0.3s ease,
        box-shadow 0.3s ease;
}

/* Hover */

::-webkit-scrollbar-thumb:hover {

    background:
        linear-gradient(
            180deg,
            #67e8f9 0%,
            #60a5fa 45%,
            #a78bfa 100%
        );

    box-shadow:
        0 0 10px rgba(34, 211, 238, 1),
        0 0 25px rgba(59, 130, 246, 0.85),
        0 0 45px rgba(139, 92, 246, 0.55);
}


/* =========================================================
   Firefox
========================================================= */

html {
    scrollbar-width: thin;

    scrollbar-color:
        #3b82f6
        #050816;
}


/* =========================================================
   Developer-style Scrollbar Accent
========================================================= */

html::before {
    content: "</>";

    position: fixed;

    right: 2px;
    top: 50%;

    transform: translateY(-50%);

    font-family:
        "Courier New",
        monospace;

    font-size: 7px;

    font-weight: 700;

    color: rgba(34, 211, 238, 0.35);

    writing-mode: vertical-rl;

    pointer-events: none;

    z-index: 999999;
}


/* =========================================================
   Scrollbar Glow Animation
========================================================= */

@keyframes developerScrollGlow {

    0% {
        filter:
            drop-shadow(
                0 0 4px
                rgba(34, 211, 238, 0.5)
            );
    }

    50% {
        filter:
            drop-shadow(
                0 0 12px
                rgba(59, 130, 246, 0.9)
            );
    }

    100% {
        filter:
            drop-shadow(
                0 0 4px
                rgba(139, 92, 246, 0.5)
            );
    }

}

::-webkit-scrollbar-thumb {
    animation:
        developerScrollGlow 3s ease-in-out infinite;
}

/* =========================================================
   DEVELOPER BACK TO TOP
   Scroll Progress + Neon Interface
========================================================= */

.scroll-progress-wrap {
    position: fixed;

    right: 28px;
    bottom: 28px;

    width: 64px;
    height: 64px;

    z-index: 9990;

    opacity: 0;
    visibility: hidden;

    transform: translateY(20px) scale(.85);

    transition:
        opacity .35s ease,
        visibility .35s ease,
        transform .35s cubic-bezier(.22,1,.36,1);
}

.scroll-progress-wrap.is-visible {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   BUTTON
========================================================= */

.back-to-top {

    position: relative;

    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    border: 1px solid rgba(34,211,238,.25);

    background:
        linear-gradient(
            145deg,
            rgba(8,18,38,.92),
            rgba(20,15,48,.92)
        );

    backdrop-filter: blur(18px);

    cursor: pointer;

    color: white;

    box-shadow:
        0 10px 35px rgba(0,0,0,.35),
        0 0 20px rgba(34,211,238,.08);

    transition:
        transform .3s ease,
        border-color .3s ease,
        box-shadow .3s ease;
}

.back-to-top:hover {

    transform:
        translateY(-5px)
        scale(1.06);

    border-color:
        rgba(34,211,238,.7);

    box-shadow:
        0 15px 40px rgba(0,0,0,.45),
        0 0 20px rgba(34,211,238,.35),
        0 0 45px rgba(99,102,241,.2);
}


/* =========================================================
   SVG RING
========================================================= */

.scroll-progress-ring {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    transform:
        rotate(-90deg);

    pointer-events: none;
}


/* Background Ring */

.scroll-progress-track {

    fill: none;

    stroke:
        rgba(255,255,255,.07);

    stroke-width: 4;
}


/* Active Ring */

.scroll-progress-circle {

    fill: none;

    stroke:
        url(#scrollGradient);

    stroke: url(#scrollGradient);

    stroke-width: 4;

    stroke-linecap: round;

    stroke-dasharray: 276.46;

    stroke-dashoffset: 276.46;

    transition:
        stroke-dashoffset .15s linear;

    filter:
        drop-shadow(
            0 0 5px
            rgba(34,211,238,.8)
        );
}


/* =========================================================
   CENTER CONTENT
========================================================= */

.scroll-progress-content {

    position: relative;

    z-index: 2;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    line-height: 1;
}


/* Percentage */

#scroll-percentage {

    font-family:
        "Courier New",
        monospace;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: -.3px;

    color: #67e8f9;

    transition:
        color .25s ease;
}


/* Arrow */

.scroll-arrow {

    margin-top: 4px;

    font-size: 15px;

    font-weight: 700;

    color: white;

    transition:
        transform .3s ease,
        color .3s ease;
}

.back-to-top:hover .scroll-arrow {

    transform:
        translateY(-2px);

    color:
        #67e8f9;
}


/* =========================================================
   TOP-OF-PAGE STATE
========================================================= */

.scroll-progress-wrap.is-top {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .scroll-progress-wrap {

        right: 18px;
        bottom: 18px;

        width: 56px;
        height: 56px;
    }

    .back-to-top {

        width: 56px;
        height: 56px;
    }

    #scroll-percentage {

        font-size: 9px;
    }

    .scroll-arrow {

        font-size: 13px;
    }
}