/* THE frosted glass of the apps (commons/css/glass.css, copied by ./sync.sh; inside's header recipe, shared by podcast
   and whatsupp 28/11/2026): a tint at an opacity, what is behind blurred and saturated, an optional hairline edge and a
   soft shadow. Without backdrop-filter (an older browser) the ground is nearly opaque, so text over it stays readable.
   Inside iOS WebKit, no absolutely positioned child of a filtered element is painted: lay a glass bar out in grid or
   flex.

   Markup: class="glass" on the bar, the header or the floating pill; where it sits and how it is shaped is the app's.

   Its look is the app's, through these properties (each with a fallback):
     --glass-tint         the ground's colour as an rgb TRIPLET, e.g. 246 246 246 (255 255 255: white)
     --glass-opacity      the ground's opacity (0.7)
     --glass-blur         how much of what is behind is blurred (14px)
     --glass-saturate     how much its colours are raised (140%)
     --glass-edge         the hairline's colour (transparent)
     --glass-edge-width   which sides have it, as border-width: 0 0 1px (bottom), 1px 0 0 (top), 1px (all) (0: none)
     --glass-shadow       a box-shadow (none)
     --glass-solid        the ground's opacity where nothing can be blurred (0.94)

   A top bar's ground (Serge, 29/11/2026): class="glass-fade" on the bar instead of "glass" — no ground at all, only
   what is behind blurred, and that blur reaches a little below the bar and fades out there, so the bar has no edge:
     --glass-fade-blur-top  the blur at the top of the screen, fading out fast going down (5px)
     --glass-fade-blur      the blur left lower down, so the bar's bottom stays sharp (3px)
     --glass-fade           how far below the bar the blur reaches, fading out over it (28px)
     --glass-fade-veil      the veil's colour: the page's own ground (default: --glass-tint's); transparent: no veil
   Not a straight ramp (Serge, 29/11/2026: « plus flou en haut, plus sharp en bas »): two layers behind the bar's
   content, the bar's ::after the light blur over the whole height, its ::before the strong one, whose mask eases out
   (strong at the top, little left by the middle). The bar is positioned (sticky, fixed) with a z-index, and uses neither
   pseudo-element itself. They have no child, so iOS WebKit paints them (above).
   Under iOS's own band (Serge, 01/12/2026, tried on podcast, version 42): in an installed app iOS lays a light blur
   under a pale veil over the top of the screen (--top-inset, below); a stronger, veil-less blur under it showed a line
   where iOS's ends. So the blur is soft at the top (5px) and the bar wears iOS's veil: its page's colour at 70 % at the
   top, gone at the bar's bottom — by eye, Apple publishes no values. */

/* THE top of a top bar (Serge, 01/12/2026): `--top-inset`, the room a bar at the top of the screen leaves above its
   content — padding-top: calc(<the bar's own> + var(--top-inset)), never env(safe-area-inset-top) alone. In Safari
   and on other systems it is the safe area (the status bar, the notch). In an app installed on an iPhone's Home Screen
   (js/home-screen.js marks it: `ios-home-screen` on <html>), iOS 26+ lays its own blurred band (Liquid Glass's
   « scroll edge effect ») over the top of the page, reaching below the status bar, and no page can turn it off
   (WebKit: no web API; measured by github.com/rexdotsh/ios-pwa-top-blur, about 105 points from the screen's top):
   the bar's content is lowered below it, by 24 points (CSS pixels are iOS points), found on Serge's iPhone — ONE
   number to change if iOS moves its band. Checked: without the bars' own blur the field was still blurred: the band
   is iOS's (podcast, 01/12/2026). */
:root { --top-inset: env(safe-area-inset-top, 0px); }
:root.ios-home-screen { --top-inset: calc(env(safe-area-inset-top, 0px) + 24px); }

.glass {
  background: rgb(var(--glass-tint, 255 255 255) / var(--glass-opacity, 0.7));
  -webkit-backdrop-filter: blur(var(--glass-blur, 14px)) saturate(var(--glass-saturate, 140%));
  backdrop-filter: blur(var(--glass-blur, 14px)) saturate(var(--glass-saturate, 140%));
  border: 0 solid var(--glass-edge, transparent); border-width: var(--glass-edge-width, 0);
  box-shadow: var(--glass-shadow, none);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgb(var(--glass-tint, 255 255 255) / var(--glass-solid, 0.94)); }
}

.glass-fade {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--glass-fade-veil, rgb(var(--glass-tint, 255 255 255))) 70%, transparent), transparent);
}
.glass-fade::before, .glass-fade::after {
  content: ""; position: absolute; inset: 0 0 calc(-1 * var(--glass-fade, 28px)); z-index: -1; pointer-events: none;
}
.glass-fade::after {
  -webkit-backdrop-filter: blur(var(--glass-fade-blur, 3px)); backdrop-filter: blur(var(--glass-fade-blur, 3px));
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - var(--glass-fade, 28px)), transparent);
  mask-image: linear-gradient(to bottom, black calc(100% - var(--glass-fade, 28px)), transparent);
}
.glass-fade::before {
  -webkit-backdrop-filter: blur(var(--glass-fade-blur-top, 5px)); backdrop-filter: blur(var(--glass-fade-blur-top, 5px));
  -webkit-mask-image: linear-gradient(to bottom, black, rgb(0 0 0 / 0.55) 20%, rgb(0 0 0 / 0.25) 40%, rgb(0 0 0 / 0.08) 60%, transparent 80%);
  mask-image: linear-gradient(to bottom, black, rgb(0 0 0 / 0.55) 20%, rgb(0 0 0 / 0.25) 40%, rgb(0 0 0 / 0.08) 60%, transparent 80%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-fade::after { background: rgb(var(--glass-tint, 255 255 255) / var(--glass-solid, 0.94)); }
}
