/* ------------------------------------------------------------------
   Demo hero background
   ------------------------------------------------------------------
   The decorative layer is the supplied artwork (assets/demo-bg-image),
   re-encoded to webp — 1662x946, so it wants a 1.757:1 box. Two
   regimes, because the hero is only that wide-and-short on a large
   screen:

   lg and up   the section takes the artwork's own ratio as a
               min-height, so `cover` lands on an exact fit and nothing
               is cropped — dot grids, blob, plane and waves all in
               frame.

   below lg    the column stack makes the hero two to four times taller
               than the art. Painting the whole thing would either
               stretch it or repeat its waves up in the middle of the
               page, so two crops of the artwork are used instead: its
               top band (dots, blue blob, triangle, sphere) anchored to
               the top of the section and its bottom band (play badge,
               star, dot grids, waves) anchored to the bottom. A
               gradient sampled from the artwork's own middle fills the
               space between them, so neither join shows.

               The bottom crop is listed first so it paints in front:
               on a short hero the two bands meet, and the waves should
               win that overlap.
   ------------------------------------------------------------------ */

.demo-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* Sampled from the middle band of the artwork. */
    background-color: #E9EFFC;
    background-image:
        url("../assets/demo/bg-bottom.webp"),
        url("../assets/demo/bg-top.webp"),
        linear-gradient(100deg, #E4EBFC, #EFF3FD);
    /* On a phone the copy starts high and left, so the top crop is
       nudged up and out to keep the blue blob off the first line. */
    background-position: center bottom, -44px -30px, center;
    background-size: 118% auto, 118% auto, 100% 100%;
    background-repeat: no-repeat;
}

@media (min-width: 640px) {
    .demo-hero {
        /* Full width from here up, so every decoration stays in the
           corner the artwork put it in. */
        background-size: 100% auto, 100% auto, 100% 100%;
        background-position: center bottom, center top, center;
    }
}

@media (min-width: 1024px) {
    .demo-hero {
        /* The artwork's own ratio is 1662 / 946 (56.9vw). Deliberately
           shorter than that, and capped, so the hero doesn't sit on a
           band of empty sky between the copy and the waves. */
        min-height: min(50vw, 750px);
        background-image: url("../assets/demo/bg.webp");
        /* Anchored to the bottom, not the middle: the section is shorter
           than the artwork's ratio, and what `cover` trims should come
           off the sparse top rather than off the waves, which have to
           land on the section's bottom edge. */
        background-position: center bottom;
        background-size: cover;
    }
}

.demo-hero-content {
    position: relative;
    z-index: 10;
}


/* ------------------------------------------------------------------
   Demo hero -> More Demos: carrying the water out
   ------------------------------------------------------------------
   The hero paints the artwork's waves flush onto its own bottom edge,
   so the blue stopped dead on a ruled horizontal line with white under
   it. This band carries that water a little further instead of ending
   it, and no further than that -- one curve, kept shallow.

   The band's whole box is the artwork's front blue, so it starts flush
   against the hero's last row: no seam to hide, no negative margin, no
   overlap trick. A single white path then fills from its curve down to
   the foot of the band, so the blue leaves on a curve rather than on a
   cut. That white is doing the shaping here; it is not a spacer.

   The curve is one sine harmonic and nothing else -- a single dip and a
   single rise across the width. Anything more (a second harmonic, more
   layers, more height) starts reading as its own feature rather than as
   the hero finishing its sentence, which is not what this band is for.

   The blue is a horizontal gradient, not a flat colour, because the
   artwork's waves are graded left to right -- #567FFC to #71A0F7 along
   its bottom row, sampled off assets/demo/bg.webp so the join matches
   at both ends.
   ------------------------------------------------------------------ */

#more-demos {
    --demos-wave-h: 34px;
    position: relative;
    isolation: isolate;
    padding-top: calc(var(--demos-wave-h) + 4px);
}

@media (min-width: 768px) {
    #more-demos {
        --demos-wave-h: 62px;
        padding-top: calc(var(--demos-wave-h) + 8px);
    }
}

.demos-wave {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: var(--demos-wave-h);
    z-index: -1;
    pointer-events: none;
}

.demos-wave svg {
    display: block;
    width: 100%;
    height: 100%;
}
