/* Threads-style pull-to-refresh — HT stroke logo (htfl-pull-refresh.js) */

#htfl-pull-refresh-shade {
    position: fixed;
    inset: 0 0 auto 0;
    height: 140px;
    z-index: 99998;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
        ellipse 80% 100% at 50% 0%,
        rgba(102, 126, 234, calc(0.08 + var(--htfl-pull-progress, 0) * 0.2)) 0%,
        transparent 72%
    );
    transition: opacity 0.15s ease;
}

#htfl-pull-refresh-shade.is-active {
    opacity: 1;
}

#htfl-pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity 0.2s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

#htfl-pull-refresh-indicator.is-active {
    opacity: 1;
    transform: translate(-50%, var(--htfl-pull-offset, 0px));
}

.htfl-ptr-logo-wrap.htfl-ptr-flash-soft {
    animation: htfl-ptr-flash-soft 0.22s ease-out;
}

.htfl-ptr-logo-wrap.htfl-ptr-flash-strong {
    animation: htfl-ptr-flash-strong 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes htfl-ptr-flash-soft {
    0% { transform: scale(0.88); }
    55% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes htfl-ptr-flash-strong {
    0% { transform: scale(0.9) rotate(0deg); }
    25% { transform: scale(1.12) rotate(-3deg); }
    50% { transform: scale(1.08) rotate(3deg); }
    75% { transform: scale(1.1) rotate(-2deg); }
    100% { transform: scale(1.05) rotate(0deg); }
}

#htfl-pull-refresh-indicator.is-releasing {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.htfl-ptr-logo-wrap {
    width: 132px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(calc(0.78 + var(--htfl-pull-progress, 0) * 0.22));
    filter: drop-shadow(0 3px 14px rgba(102, 126, 234, 0.45));
    transition: filter 0.1s ease, transform 0.1s ease;
}

.htfl-ptr-logo-stack {
    position: relative;
    width: 132px;
    height: 70px;
    border-radius: 14px;
    background: radial-gradient(ellipse at 50% 45%, #12121a 0%, #050508 72%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

#htfl-pull-refresh-indicator.is-ready .htfl-ptr-logo-wrap {
    animation: htfl-ptr-shake 0.55s ease-in-out infinite;
    filter: drop-shadow(0 4px 18px rgba(255, 184, 0, 0.55));
}

#htfl-pull-refresh-indicator.is-busy .htfl-ptr-logo-wrap {
    animation: htfl-ptr-busy-pulse 0.65s ease-in-out infinite;
}

.htfl-ptr-logo {
    display: block;
    width: 132px;
    height: 70px;
    overflow: visible;
}

.htfl-ptr-logo-base {
    pointer-events: none;
}

.htfl-ptr-logo-tint {
    mix-blend-mode: color;
    pointer-events: none;
    opacity: 0;
}

@keyframes htfl-ptr-shake {
    0%,
    100% {
        transform: scale(calc(0.92 + var(--htfl-pull-progress, 1) * 0.08)) translate(0, 0) rotate(0deg);
    }
    20% {
        transform: scale(calc(0.94 + var(--htfl-pull-progress, 1) * 0.08)) translate(-1px, 0) rotate(-2deg);
    }
    40% {
        transform: scale(calc(0.96 + var(--htfl-pull-progress, 1) * 0.08)) translate(1px, -1px) rotate(2deg);
    }
    60% {
        transform: scale(calc(0.94 + var(--htfl-pull-progress, 1) * 0.08)) translate(-1px, 1px) rotate(-1.5deg);
    }
    80% {
        transform: scale(calc(0.95 + var(--htfl-pull-progress, 1) * 0.08)) translate(1px, 0) rotate(1.5deg);
    }
}

@keyframes htfl-ptr-busy-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.88;
    }
}

#htfl-pull-refresh-indicator.is-busy .htfl-ptr-logo-tint {
    animation: htfl-ptr-tint-cycle 1s ease-in-out infinite;
}

@keyframes htfl-ptr-tint-cycle {
    0% { opacity: 0.75; }
    50% { opacity: 0.95; }
    100% { opacity: 0.75; }
}

html.htfl-pull-refresh-dragging,
html.htfl-pull-refresh-dragging body {
    overscroll-behavior-y: none;
}

html.htfl-pull-refresh-dragging body {
    transition: transform 0.08s linear;
    transform: translateY(var(--htfl-body-offset, 0px));
}

html.htfl-pull-refresh-releasing body {
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateY(0);
}
