/* Bitflow · Live wallpaper and liquid glass
   wallpaper.js paints the moving bit stream behind every page; liquid-glass.js bends it at the rims of the glass
   panes (Chromium) and lights controls from the point of touch. */
html { --wall-dim: 0; --lx: -.52; --ly: -.85; }
html:is([data-wallpaper-kind=live], [data-wallpaper-kind=photo]) body::before { content: none; }
.wallpaper { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict; background: var(--bg); }
.wallpaper-stage { position: absolute; inset: 0; }
.wallpaper-canvas, .wallpaper-photo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.1s cubic-bezier(.16,1,.3,1); }
.wallpaper[data-kind=live] .wallpaper-canvas, .wallpaper[data-kind=photo] .wallpaper-photo { opacity: 1; }
.wallpaper-photo { background: center / cover no-repeat; }
/* The veil keeps text legible over the brightest part of the stream, and fades the picture toward the reading area. */
.wallpaper-veil { position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 40%, #050a1c33, #050a1c00 70%), linear-gradient(180deg, #050a1c00 55%, #050a1c59); }
:root[data-theme="light"] .wallpaper-veil { background: radial-gradient(90% 70% at 50% 40%, #ffffff2e, #ffffff00 70%), linear-gradient(180deg, #ffffff00 55%, #eef3fb66); }
.lg-filters { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* Panes over the moving picture refract at their rim where the browser can. */
:root {
  --page-rim: inset calc(var(--lx) * -1.4px) calc(var(--ly) * -1.4px) 0 -.4px #ffffff59, inset calc(var(--lx) * 1.2px) calc(var(--ly) * 1.2px) 0 -.4px #ffffff1f, inset 0 0 0 1px #ffffff0d;
}
:root[data-theme="light"] { --page-rim: inset calc(var(--lx) * -1.4px) calc(var(--ly) * -1.4px) 0 -.4px #fff, inset calc(var(--lx) * 1.2px) calc(var(--ly) * 1.2px) 0 -.4px #ffffffb8, inset 0 0 0 1px #ffffff80; }
html:is([data-wallpaper-kind=live], [data-wallpaper-kind=photo]) .auth-mark { -webkit-backdrop-filter: blur(5px) saturate(1.8); backdrop-filter: blur(5px) var(--lg-refract,) saturate(1.8); box-shadow: var(--page-rim), 0 1px 2px #0000004d, 0 22px 50px -20px #000000b3; }
html:is([data-wallpaper-kind=live], [data-wallpaper-kind=photo]) .workspace .glass { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: blur(26px) var(--lg-refract,) saturate(1.6); }
.auth-card *, .workspace .glass * { --lg-refract: initial; }

/* Touch light (liquid-glass.js): a soft bloom from the point of contact. */
lg-glow { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; contain: strict; mix-blend-mode: soft-light; }
lg-glow::before { content: ''; position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2); border-radius: 50%; background: radial-gradient(closest-side, #ffffffe6, transparent); opacity: 0; transform: scale(.15); animation: lg-glow-in .5s cubic-bezier(.16,1,.3,1) forwards; }
lg-glow.out::before { animation: lg-glow-out .55s ease forwards; }
.button.primary lg-glow, .auth-primary lg-glow { mix-blend-mode: overlay; }
@keyframes lg-glow-in { to { opacity: .6; transform: scale(1); } }
@keyframes lg-glow-out { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { lg-glow { display: none; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) { .wallpaper { display: none; } html body::before { content: ""; } }
