/* AbeUS glass: frosted surfaces over black, lit by soft steel-blue light.
   Shared by every AbeUS and ABE page. The ABE apps use the same values (README, "Glass"). */

:root {
  /* Light behind the glass. Without it, glass over pure black reads as flat grey. */
  --steel-1: 108, 130, 166; /* #6C82A6 */
  --steel-2: 84, 104, 140;  /* #54688C */
  --steel-3: 140, 156, 184; /* #8C9CB8 */
  /* The light the page actually uses. A brand page can set its own (Hypnosere uses warm light). */
  --glow-1: var(--steel-1);
  --glow-2: var(--steel-2);
  --glow-3: var(--steel-3);

  /* The glass itself */
  --glass-fill-top: rgba(255, 255, 255, 0.085);
  --glass-fill: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.16); /* 1px line along the top edge */
  --glass-blur: blur(24px) saturate(140%);
  --glass-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  /* Where blur isn't supported, or the visitor asks for less transparency */
  --glass-solid: #14171d;

  --glass-surface: linear-gradient(180deg, var(--glass-fill-top), var(--glass-fill));
  --glass-edge: inset 0 1px 0 var(--glass-highlight), inset 0 0 0 1px var(--glass-border);
}

/* Soft light, fixed behind the page so every glass surface has something under it.
   Gradients only (no filters), so scrolling stays cheap on phones. The fine grain stops the
   gradients from banding on black. */
.ambient::before,
.ambient::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
.ambient::before {
  background:
    radial-gradient(55% 45% at 10% -8%, rgba(var(--glow-1), 0.34), transparent 70%),
    radial-gradient(42% 52% at 104% 42%, rgba(var(--glow-2), 0.3), transparent 70%),
    radial-gradient(60% 42% at 30% 112%, rgba(var(--glow-3), 0.17), transparent 70%);
}
.ambient::after {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(var(--glow-1), 0.5); color: #fff; }
