;(function () {
/* Bottom-of-screen ambience layer behind the BottomNav pill.
   The pill sits at bottom:28 (height 58), so the area "below the pill" is the
   28px home-indicator strip from y=0 to y=28.

   Layer recipe (back → front, all still beneath the pill since BottomNav has zIndex 50):
     L1 · Teal tint  — peak teal at the very bottom edge, fading up. Confined to
                       the 50px slot so the saturated teal lands directly under the
                       pill in the home-indicator gap.
     L2 · 10 stacked BlurViews of equal intensity, overlapping heights —
                       cumulative intensity rises smoothly toward the screen edge.
                       Single-layer intensity is small enough that no individual
                       step is perceptible (≈10% relative steps), so the blur ramp
                       reads as continuous instead of banded. */

/* Two strips:
   - TINT_STRIP: shorter (60px) — saturated teal sits in the home-indicator
     gap and softly fades up, anchored to the pill.
   - BLUR_STRIP: taller (108px) — blur extends well above the tint, giving
     the mask gradient more pixels to taper across so the previously-visible
     "line" at the top edge of the blur disappears. */
const TINT_STRIP = 60;
const BLUR_STRIP = 108;

const BottomFade = () => {
  return (
    <>
      {/* L1 · tint — confined to TINT_STRIP. */}
      <div
        style={{
          position: 'absolute',
          left: 0, right: 0, bottom: 0,
          height: `${TINT_STRIP}px`,
          zIndex: 5,
          pointerEvents: 'none',
          background: 'linear-gradient(180deg, rgba(0,175,171,0) 0%, rgba(0,175,171,0.14) 40%, rgba(0,175,171,0.31) 75%, rgba(0,175,171,0.43) 100%)',
        }}
      />
      {/* L2 · blur — taller strip with a softer mask gradient. The mask now
         goes opaque→transparent over the full BLUR_STRIP, so the top edge
         of the blur fades over ~108px instead of cutting off sharply. */}
      <div
        style={{
          position: 'absolute',
          left: 0, right: 0, bottom: 0,
          height: `${BLUR_STRIP}px`,
          zIndex: 6,
          pointerEvents: 'none',
          backdropFilter: 'blur(14px)',
          WebkitBackdropFilter: 'blur(14px)',
          /* Three-stop mask: full at bottom, half-strength near the tint top,
             zero at the very top. Spreads the falloff so no visible seam. */
          maskImage: 'linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0) 100%)',
          WebkitMaskImage: 'linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0) 100%)',
        }}
      />
    </>
  );
};

Object.assign(window, { BottomFade });
})();
