/*
 * Festive theme for the home page (src/pages/index.html).
 * Decorations only: every piece sits in a .festive-decor layer that is absolutely
 * positioned, ignores the pointer and is hidden from screen readers. Remove this
 * stylesheet's <link> and the .festive-decor blocks to go back to the normal page.
 * Artwork: https://static.timelybills.app/public-site/festive-theme/festive<N>.webp
 */

.festive-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.festive-decor img {
    position: absolute;
    display: block;
    height: auto;
    max-width: none;
    user-select: none;
}

/* ---------- Hero ---------- */

/* Every top-corner piece (flags, bunting, hanging lanterns) is sized and placed
   in vw so they keep the same arrangement at any desktop width instead of the
   bunting growing into fixed-size lanterns. Tuned at a 1306px wide viewport. */

/* The fixed "Trusted by 1M+ users" top bar (shown from 768px up) covers the top
   of the hero, so the top-corner pieces start below it instead of behind it. */
.festive-hero {
    --festive-topbar: 0px;
}

@media (min-width: 768px) {
    .festive-hero {
        --festive-topbar: 49px;
    }
}

/* Red, orange and cream flags tucked into the very top corners. */
.festive-hero .festive-corner {
    top: calc(var(--festive-topbar) - 2.3vw);
    width: 17vw;
    z-index: 1;
}

.festive-hero .festive-corner-left {
    left: -1.5vw;
}

.festive-hero .festive-corner-right {
    right: -1.5vw;
}

/* Purple and orange bunting across the top corners, dipping below the header. */
.festive-hero .festive-bunting {
    top: calc(var(--festive-topbar) - 0.4vw);
    width: 34vw;
}

.festive-hero .festive-bunting-left {
    left: -1.5vw;
}

.festive-hero .festive-bunting-right {
    right: -1.5vw;
}

/* Hanging lanterns on strings from the bunting. */
.festive-hero .festive-kandil {
    transform-origin: 50% 0;
    animation: festive-sway 5s ease-in-out infinite;
}

.festive-hero .festive-kandil-left {
    top: calc(var(--festive-topbar) + 2.7vw);
    left: 7vw;
    width: 3.7vw;
}

.festive-hero .festive-kandil-right {
    top: calc(var(--festive-topbar) + 4.4vw);
    right: 7.5vw;
    width: 5.4vw;
    animation-delay: -2.5s;
}

/* Sky lanterns cut off at the sides: left beside the headline, right lower down. */
.festive-hero .festive-sky {
    width: 190px;
    animation: festive-float 7s ease-in-out infinite;
}

.festive-hero .festive-sky-left {
    top: 370px;
    left: -45px;
}

.festive-hero .festive-sky-right {
    top: 565px;
    right: -55px;
    animation-delay: -3.5s;
}

/* ---------- "Trusted by Millions" band ---------- */

.trusted-millions-sectioon {
    position: relative;
}

/* Small orange bunting tucked under a string of lights in each top corner. */
.festive-trusted .festive-small-bunting {
    top: 0;
    width: 21vw;
}

.festive-trusted .festive-small-bunting-left {
    left: 0;
}

.festive-trusted .festive-small-bunting-right {
    right: 0;
}

.festive-trusted .festive-lights {
    top: -6px;
    width: 19vw;
}

.festive-trusted .festive-lights-left {
    left: 0;
}

.festive-trusted .festive-lights-right {
    right: 0;
}

/* Floating sky lanterns: bottom-left and middle-right. */
.festive-trusted .festive-sky {
    animation: festive-float 7s ease-in-out infinite;
}

.festive-trusted .festive-sky-left {
    left: 5%;
    bottom: -10px;
    width: 110px;
}

.festive-trusted .festive-sky-right {
    right: 3%;
    top: 14%;
    width: 110px;
    animation-delay: -3.5s;
}

/* Twinkling four-point sparkles. */
.festive-sparkle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
    animation: festive-twinkle 3s ease-in-out infinite;
}

.festive-sparkle-1 {
    left: 15%;
    top: 59%;
}

.festive-sparkle-2 {
    left: 58.5%;
    top: 22%;
    width: 18px;
    height: 18px;
    animation-delay: -1.5s;
}

/* ---------- Motion ---------- */

@keyframes festive-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes festive-sway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes festive-twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
    .festive-decor img,
    .festive-sparkle {
        animation: none !important;
    }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 991px) {
    .festive-hero .festive-bunting {
        top: calc(var(--festive-topbar) - 30px);
        width: 48vw;
    }

    .festive-hero .festive-kandil {
        display: none;
    }

    .festive-hero .festive-sky {
        top: 300px;
        width: 80px;
    }

    .festive-hero .festive-sky-left {
        left: -24px;
    }

    .festive-hero .festive-sky-right {
        right: -24px;
    }

    .festive-trusted .festive-small-bunting {
        width: 30vw;
    }

    .festive-trusted .festive-lights {
        width: 27vw;
    }

    .festive-trusted .festive-sky-left {
        width: 60px;
    }

    .festive-trusted .festive-sky-right {
        width: 56px;
    }

    .festive-sparkle {
        width: 10px;
        height: 10px;
    }
}

/* On phones the band's background switches to a 401x257 image drawn with
   background-size: contain, so it is centred inside a taller section with white
   space above and below. Fit the decoration layer to that image so the bunting
   hangs from the banner's top edge and the lanterns stay inside it instead of
   floating in the white space or over the "Real Stories" heading. */
@media (max-width: 767px) {
    .festive-trusted {
        inset: auto 0;
        top: 50%;
        aspect-ratio: 401 / 257;
        transform: translateY(-50%);
    }

    .festive-trusted .festive-lights {
        top: -3px;
    }

    /* Small enough to fit under the subtitle text in the bottom-left corner. */
    .festive-trusted .festive-sky-left {
        bottom: 4px;
        width: 42px;
    }
}

@media (max-width: 575px) {
    .festive-hero .festive-sky {
        top: 260px;
        width: 60px;
    }
}
