/*
 * Seasonal layer for the home page.
 * Rollback: remove data-seasonal-theme="halloween" from <body> in index.html.
 * This stylesheet remains inert without that attribute.
 */

body[data-seasonal-theme="halloween"] .hero {
    isolation: isolate;
    background-image:
        radial-gradient(circle at 77% 17%, rgba(237, 188, 79, 0.18), transparent 22%),
        linear-gradient(112deg, rgba(58, 27, 29, 0.18), rgba(17, 17, 17, 0.02) 62%),
        url('../assets/quinta-halloween.webp');
}

body[data-seasonal-theme="halloween"] .hero::before,
body[data-seasonal-theme="halloween"] .hero::after {
    content: '';
    position: absolute;
    z-index: 0;
    top: 0;
    width: 11.5rem;
    aspect-ratio: 1;
    opacity: 0.48;
    pointer-events: none;
    user-select: none;
    background:
        repeating-radial-gradient(circle at 0 0, transparent 0 1.35rem, rgba(255, 244, 212, 0.82) 1.42rem 1.5rem, transparent 1.58rem 2.15rem),
        repeating-conic-gradient(from 0deg at 0 0, rgba(255, 244, 212, 0.82) 0deg 0.8deg, transparent 1deg 30deg);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

body[data-seasonal-theme="halloween"] .hero::before {
    left: 0;
}

body[data-seasonal-theme="halloween"] .hero::after {
    right: 0;
    transform: scaleX(-1);
}

body[data-seasonal-theme="halloween"] .halloween-ornaments {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    user-select: none;
}

body[data-seasonal-theme="halloween"] .halloween-moon {
    position: absolute;
    top: clamp(1.5rem, 4vw, 2.6rem);
    right: clamp(1.8rem, 6vw, 5rem);
    width: 3rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #f5dc9e;
    box-shadow: 0 0.2rem 0.65rem rgba(45, 22, 21, 0.38);
}

body[data-seasonal-theme="halloween"] .halloween-moon::after {
    content: '';
    position: absolute;
    top: -0.18rem;
    right: -0.48rem;
    width: 2.9rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(78, 47, 42, 0.92);
}

body[data-seasonal-theme="halloween"] .halloween-bats {
    position: absolute;
    top: clamp(5rem, 10vw, 7.2rem);
    right: clamp(1.6rem, 4vw, 3.4rem);
    display: flex;
    align-items: flex-end;
    gap: 0.28rem;
    transform: rotate(-9deg);
}

body[data-seasonal-theme="halloween"] .halloween-bats span {
    display: block;
    width: 0.86rem;
    height: 0.54rem;
    background: rgba(48, 25, 27, 0.84);
    clip-path: polygon(0 45%, 22% 2%, 44% 38%, 50% 12%, 56% 38%, 78% 2%, 100% 45%, 75% 100%, 50% 66%, 25% 100%);
}

body[data-seasonal-theme="halloween"] .halloween-bats span:nth-child(1) {
    width: 0.58rem;
    transform: translateY(0.48rem) rotate(-17deg);
}

body[data-seasonal-theme="halloween"] .halloween-bats span:nth-child(2) {
    transform: translateY(0.1rem) rotate(-8deg);
}

body[data-seasonal-theme="halloween"] .halloween-bats span:nth-child(3) {
    width: 0.68rem;
    transform: translateY(0.62rem) rotate(12deg);
}

body[data-seasonal-theme="halloween"] .halloween-bats span:nth-child(4) {
    width: 0.48rem;
    transform: translateY(0.3rem) rotate(21deg);
}

body[data-seasonal-theme="halloween"] .halloween-calaverita {
    position: absolute;
    right: clamp(1rem, 4vw, 3rem);
    bottom: clamp(4.2rem, 8vw, 6.6rem);
    width: 3.15rem;
    aspect-ratio: 1;
    background: #693437;
    clip-path: polygon(50% 0, 71% 11%, 92% 30%, 100% 57%, 79% 86%, 50% 100%, 20% 86%, 0 57%, 8% 30%, 29% 11%);
    box-shadow: 0 0.25rem 0.8rem rgba(27, 14, 14, 0.3);
}

body[data-seasonal-theme="halloween"] .halloween-calaverita::before {
    content: '';
    position: absolute;
    inset: 0.48rem 0.72rem 0.45rem;
    border-radius: 46% 46% 36% 36%;
    background:
        radial-gradient(circle at 35% 38%, #693437 0 0.23rem, transparent 0.25rem),
        radial-gradient(circle at 65% 38%, #693437 0 0.23rem, transparent 0.25rem),
        linear-gradient(#693437, #693437) 50% 65% / 0.14rem 0.1rem no-repeat,
        linear-gradient(90deg, #693437 0 14%, transparent 14% 24%, #693437 24% 38%, transparent 38% 48%, #693437 48% 62%, transparent 62% 72%, #693437 72% 86%, transparent 86%) 50% 82% / 0.92rem 0.13rem no-repeat,
        #f7e5ae;
}

body[data-seasonal-theme="halloween"] .halloween-calaverita::after {
    content: '';
    position: absolute;
    inset: 0.23rem;
    border: 1px solid rgba(247, 229, 174, 0.48);
    clip-path: inherit;
}

body[data-seasonal-theme="halloween"] .halloween-fresno-sprig {
    position: absolute;
    bottom: clamp(4.4rem, 8vw, 6.8rem);
    left: clamp(1rem, 4vw, 2.8rem);
    width: 4.2rem;
    height: 2.8rem;
    border-bottom: 1px solid rgba(255, 230, 171, 0.85);
    transform: rotate(-28deg);
    transform-origin: left bottom;
}

body[data-seasonal-theme="halloween"] .halloween-fresno-sprig span {
    position: absolute;
    width: 0.86rem;
    height: 1.45rem;
    border: 1px solid rgba(255, 230, 171, 0.86);
    border-radius: 90% 0 90% 0;
    background: rgba(255, 230, 171, 0.22);
}

body[data-seasonal-theme="halloween"] .halloween-fresno-sprig span:nth-child(1) {
    bottom: -0.4rem;
    left: 1rem;
    transform: rotate(46deg);
}

body[data-seasonal-theme="halloween"] .halloween-fresno-sprig span:nth-child(2) {
    bottom: 0.32rem;
    left: 1.9rem;
    transform: rotate(-21deg);
}

body[data-seasonal-theme="halloween"] .halloween-fresno-sprig span:nth-child(3) {
    bottom: 0.06rem;
    left: 2.75rem;
    transform: rotate(54deg);
}

body[data-seasonal-theme="halloween"] .hero-text-block {
    z-index: 2;
}

body[data-seasonal-theme="halloween"] .hero-btn {
    z-index: 3;
    overflow: visible;
}

body[data-seasonal-theme="halloween"] .hero-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 0.35rem);
    left: calc(100% - 1.05rem);
    width: 1px;
    height: clamp(2.8rem, 7vw, 4.8rem);
    background: rgba(255, 245, 215, 0.86);
    pointer-events: none;
}

body[data-seasonal-theme="halloween"] .hero-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% - 0.9rem);
    left: calc(100% - 1.78rem);
    width: 1.62rem;
    height: 1.62rem;
    background:
        linear-gradient(35deg, transparent 44%, #251719 46% 53%, transparent 55%) 0.03rem 0.55rem / 0.82rem 0.48rem no-repeat,
        linear-gradient(-35deg, transparent 44%, #251719 46% 53%, transparent 55%) 0.77rem 0.55rem / 0.82rem 0.48rem no-repeat,
        linear-gradient(-35deg, transparent 44%, #251719 46% 53%, transparent 55%) 0.03rem 1.02rem / 0.82rem 0.48rem no-repeat,
        linear-gradient(35deg, transparent 44%, #251719 46% 53%, transparent 55%) 0.77rem 1.02rem / 0.82rem 0.48rem no-repeat,
        radial-gradient(ellipse at 50% 72%, #251719 0 24%, transparent 26%),
        radial-gradient(circle at 50% 35%, #251719 0 16%, transparent 18%);
    filter: drop-shadow(0 0 0.08rem rgba(255, 230, 171, 0.82));
    pointer-events: none;
}

@media (max-width: 768px) {
    body[data-seasonal-theme="halloween"] .hero::before {
        width: 6.7rem;
        opacity: 0.42;
    }

    body[data-seasonal-theme="halloween"] .hero::after,
    body[data-seasonal-theme="halloween"] .halloween-bats,
    body[data-seasonal-theme="halloween"] .halloween-calaverita,
    body[data-seasonal-theme="halloween"] .halloween-fresno-sprig {
        display: none;
    }

    body[data-seasonal-theme="halloween"] .halloween-moon {
        top: 1.25rem;
        right: 1.15rem;
        width: 2.05rem;
        opacity: 0.8;
    }

    body[data-seasonal-theme="halloween"] .hero-btn::before {
        left: calc(100% - 0.85rem);
        height: 2.35rem;
        bottom: calc(100% - 0.3rem);
    }

    body[data-seasonal-theme="halloween"] .hero-btn::after {
        bottom: calc(100% - 0.72rem);
        left: calc(100% - 1.45rem);
        transform: scale(0.82);
        transform-origin: bottom right;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-seasonal-theme="halloween"] .hero,
    body[data-seasonal-theme="halloween"] .hero * {
        scroll-behavior: auto;
    }
}
