/* Public landing page and the password sign-in form. */
#app > :where(.min-h-screen:has(> header nav):has(> main > .text-center):has(> footer), .min-h-screen:has(> .pointer-events-none):has(.card-glass form)) {
  --contour-paper: #f5faf9;
  --contour-line: rgba(20, 133, 133, .24);
  --contour-eastern: rgba(64, 108, 160, .23);
  --contour-mist: rgba(119, 219, 196, .36);
  --contour-sky: rgba(171, 197, 239, .44);
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background: radial-gradient(ellipse at 0% 55%, var(--contour-mist), transparent 48%),
              radial-gradient(ellipse at 100% 43%, var(--contour-sky), transparent 50%),
              var(--contour-paper);
}

/* AuthLayout has its own background layers below the form. */
#app > .min-h-screen:has(> .pointer-events-none):has(.card-glass form) > .absolute.inset-0 {
  display: none;
}
#app > :where(.min-h-screen:has(> header nav):has(> main > .text-center):has(> footer), .min-h-screen:has(> .pointer-events-none):has(.card-glass form)) {
  &::before, &::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    inset: 0;
    background-repeat: no-repeat;
    transform-origin: center;
  }
  &::before {
    background-image: repeating-radial-gradient(ellipse 43% 69% at -15% 9%,
      transparent 0 11px, var(--contour-line) 11.4px 12.2px, transparent 12.8px 18px);
    mask-image: radial-gradient(ellipse 50% 68% at 2% 68%, black 5%, #000b 50%, transparent 100%);
    animation: kaning-tide-west 17s ease-in-out infinite alternate;
  }
  &::after {
    background-image: repeating-radial-gradient(ellipse 37% 67% at 112% 97%,
      transparent 0 12px, var(--contour-eastern) 12.5px 13.4px, transparent 14px 20px);
    mask-image: radial-gradient(ellipse 43% 65% at 99% 33%, black 6%, #0009 54%, transparent 100%);
    animation: kaning-tide-east 21s ease-in-out -7s infinite alternate;
  }
}
.dark #app > .min-h-screen {
  --contour-paper: #101820;
  --contour-line: rgba(103, 215, 193, .30);
  --contour-eastern: rgba(151, 186, 244, .26);
  --contour-mist: rgba(22, 101, 94, .38);
  --contour-sky: rgba(37, 64, 107, .48);
}
@keyframes kaning-tide-west {
  from { transform: scale(1.07) translate(-1.8%, -1%); }
  to   { transform: scale(1.13) translate(2%, 2.6%); }
}
@keyframes kaning-tide-east {
  from { transform: scale(1.07) translate(1.8%, -2.5%); }
  to   { transform: scale(1.14) translate(-1.8%, 2%); }
}
@media (max-width: 680px) {
  #app > :where(.min-h-screen:has(> header nav):has(> main > .text-center):has(> footer), .min-h-screen:has(> .pointer-events-none):has(.card-glass form))::after { animation: none; }
}
@media (prefers-reduced-motion: reduce), print {
  #app > .min-h-screen::before, #app > .min-h-screen::after {
    animation: none !important;
    transform: none;
  }
}
