/*
 * Frosted ice glass behind overlays. Built by assets/js/yuni-frost.js.
 * The layer is never inside an overlay, so dialog text and surfaces are untouched.
 */
@property --frost-hole {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 34%;
}

.yuni-frost {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(214, 232, 246, 0.14);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
  transition: opacity 300ms ease;
  contain: strict;
}
.yuni-frost.is-on { opacity: 1; }
.yuni-frost.is-parked { visibility: hidden; }

.yuni-frost__ice {
  display: block;
  width: 100%;
  height: 100%;
  --frost-hole: 34%;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent var(--frost-hole), #000 calc(var(--frost-hole) + 38%));
  mask-image: radial-gradient(ellipse at center, transparent var(--frost-hole), #000 calc(var(--frost-hole) + 38%));
}
.yuni-frost.is-on .yuni-frost__ice { animation: yuni-frost-grow 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.yuni-frost__drop {
  position: absolute;
  top: -3%;
  left: var(--x, 20%);
  width: var(--s, 12px);
  height: calc(var(--s, 12px) * 1.28);
  border-radius: 50% 50% 54% 54% / 42% 42% 60% 60%;
  background:
    radial-gradient(circle at 32% 26%, #fff 0 9%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 50% 56%, rgba(190, 225, 245, 0.12) 38%, rgba(40, 86, 120, 0.34) 82%, rgba(255, 255, 255, 0.55) 100%);
  box-shadow: 0 2px 3px rgba(20, 44, 70, 0.22);
  opacity: 0;
  animation: none;
}
.yuni-frost__drop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 85%;
  width: 2px;
  height: calc(var(--s, 12px) * 4);
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
}
.yuni-frost.is-on .yuni-frost__drop {
  will-change: transform;
  animation: yuni-frost-slide var(--dur, 9s) linear var(--delay, 1s) infinite;
}

.yuni-frost.is-paused .yuni-frost__drop { animation-play-state: paused; }
.yuni-frost.is-still .yuni-frost__drop { display: none; }
.yuni-frost.is-still .yuni-frost__ice { animation: none; }

@keyframes yuni-frost-grow {
  from { --frost-hole: 92%; }
  to { --frost-hole: 34%; }
}
/* Real drops stall and then run. Each leg is a pure transform. */
@keyframes yuni-frost-slide {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  6% { opacity: 1; }
  22% { transform: translate3d(0, 14vh, 0); }
  38% { transform: translate3d(0, 15vh, 0); }
  62% { transform: translate3d(0, 52vh, 0); }
  72% { transform: translate3d(0, 54vh, 0); }
  94% { transform: translate3d(0, 104vh, 0); opacity: 0.9; }
  100% { transform: translate3d(0, 108vh, 0); opacity: 0; }
}
@keyframes yuni-frost-scrim {
  from { opacity: 0; }
  to { opacity: 1; }
}


@media (max-width: 600px) {
  .yuni-frost {
    -webkit-backdrop-filter: blur(7px) saturate(1.05);
    backdrop-filter: blur(7px) saturate(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .yuni-frost { transition-duration: 120ms; }
  .yuni-frost__ice,
  .yuni-frost.is-on .yuni-frost__ice { animation: none; }
  .yuni-frost__drop,
  .yuni-frost.is-on .yuni-frost__drop { display: none; animation: none; }
}
