/**
 * Home decor P1 — telarañas / araña (solo .cctva-home-spiderwebs-p1 en front page).
 */
.cctva-home-spiderwebs-p1 {
    --cctva-spiderweb-silver: rgba(168, 180, 196, 0.55);
    --cctva-spiderweb-spider: rgba(190, 198, 210, 0.75);
    --cctva-spiderweb-header-band: min(220px, 32vh);
    --cctva-spider-thread-min: clamp(26px, 4vh, 38px);
    --cctva-spider-thread-max: clamp(100px, 13vh, 132px);
    --cctva-spider-cycle: 9s;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cctva-spiderweb-header-band);
    z-index: 85;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

.cctva-home-spiderwebs-p1__dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cctva-spiderweb-header-band);
    opacity: 0.22;
    background-image: radial-gradient(circle, var(--cctva-spiderweb-dot, #e11d2e) 0.6px, transparent 0.7px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse 85% 55% at 50% 0%, #000 0%, transparent 72%);
    animation: cctva-spiderweb-dots-breathe 14s ease-in-out infinite;
}

.cctva-home-spiderwebs-p1__web {
    position: absolute;
    width: clamp(88px, 14vw, 168px);
    height: auto;
    color: var(--cctva-spiderweb-silver);
    opacity: 0.85;
}

.cctva-home-spiderwebs-p1__web--left {
    top: 0;
    left: 0;
    transform: translate(-6%, -4%);
}

.cctva-home-spiderwebs-p1__web--right {
    top: 0;
    right: 0;
    transform: scaleX(-1) translate(-6%, -4%);
}

.cctva-home-spiderwebs-p1__spider-rig {
    position: absolute;
    top: 0;
    right: clamp(72px, 11vw, 128px);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
    animation: cctva-spiderweb-rig-cycle var(--cctva-spider-cycle) ease-in-out infinite;
}

.cctva-home-spiderwebs-p1__thread {
    display: block;
    width: 1px;
    flex: 0 0 auto;
    height: var(--cctva-spider-thread-min);
    background: linear-gradient(
        to bottom,
        var(--cctva-spiderweb-silver) 0%,
        var(--cctva-spiderweb-silver) 72%,
        transparent 100%
    );
    animation: cctva-spiderweb-thread-cycle var(--cctva-spider-cycle) ease-in-out infinite;
}

.cctva-home-spiderwebs-p1__spider {
    width: clamp(18px, 2.4vw, 26px);
    height: auto;
    color: var(--cctva-spiderweb-spider);
    margin-top: -1px;
}

/* Ciclo ~9s: descenso (hilo) → pausa abajo → balanceo → ascenso */
@keyframes cctva-spiderweb-thread-cycle {
    0%,
    100% {
        height: var(--cctva-spider-thread-min);
    }
    28% {
        height: var(--cctva-spider-thread-max);
    }
    38% {
        height: var(--cctva-spider-thread-max);
    }
    68% {
        height: var(--cctva-spider-thread-max);
    }
    86% {
        height: var(--cctva-spider-thread-min);
    }
}

@keyframes cctva-spiderweb-rig-cycle {
    0%,
    26%,
    88%,
    100% {
        transform: rotate(0deg);
    }
    38% {
        transform: rotate(-2deg);
    }
    44% {
        transform: rotate(2.8deg);
    }
    50% {
        transform: rotate(-2.4deg);
    }
    56% {
        transform: rotate(2.2deg);
    }
    62% {
        transform: rotate(-1.2deg);
    }
    68% {
        transform: rotate(0deg);
    }
}

@keyframes cctva-spiderweb-dots-breathe {
    0%,
    100% {
        opacity: 0.16;
    }
    50% {
        opacity: 0.26;
    }
}

@media (max-width: 782px) {
    .cctva-home-spiderwebs-p1__web {
        width: clamp(72px, 22vw, 110px);
        opacity: 0.72;
    }

    .cctva-home-spiderwebs-p1 {
        --cctva-spider-thread-max: clamp(68px, 11vh, 92px);
    }

    .cctva-home-spiderwebs-p1__spider-rig {
        right: clamp(48px, 14vw, 88px);
    }

    .cctva-home-spiderwebs-p1__dots {
        background-size: 18px 18px;
        opacity: 0.18;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cctva-home-spiderwebs-p1__spider-rig,
    .cctva-home-spiderwebs-p1__thread,
    .cctva-home-spiderwebs-p1__dots {
        animation: none;
    }

    .cctva-home-spiderwebs-p1__thread {
        height: var(--cctva-spider-thread-min);
    }
}
