/* Will it rain — same paper and ink as /weather. The answer is the only content. */

.top,
main,
.noscript {
  position: relative;
  z-index: 1;
}

.place {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.answer { margin-top: 0.95rem; }

.answer-text {
  max-width: 22em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.15rem, 4.8vw, 3.35rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.when { white-space: nowrap; }

/* Droplets only exist in the yes state. Density is the animation, not a label. */
.rain-field {
  --drop-opacity: 0.5;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.rain-field--light { --drop-opacity: 0.42; }
.rain-field--medium { --drop-opacity: 0.58; }
.rain-field--heavy { --drop-opacity: 0.75; }

.droplet {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  margin-left: -8px;
}

.droplet::before,
.droplet::after {
  content: "";
  position: absolute;
  left: 50%;
  animation-duration: var(--dur, 1.8s);
  animation-delay: var(--delay, 0s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.droplet::before {
  top: 0;
  width: 2px;
  height: calc(16px * var(--scale, 1));
  margin-left: -1px;
  border-radius: 40% 40% 45% 45%;
  background: var(--ink);
  opacity: 0;
  animation-name: droplet-fall;
}

.rain-field--heavy .droplet::before {
  width: 3px;
  margin-left: -1.5px;
}

.droplet::after {
  bottom: 1px;
  width: calc(22px * var(--scale, 1));
  height: calc(9px * var(--scale, 1));
  margin-left: calc(-11px * var(--scale, 1));
  border: 2px solid var(--ink);
  border-top-color: transparent;
  border-radius: 0 0 14px 14px;
  opacity: 0;
  transform-origin: center bottom;
  animation-name: droplet-splash;
}

@media (max-width: 720px) {
  .answer { margin-top: 0.85rem; }

  .answer-text { font-size: clamp(1.95rem, 8vw, 2.55rem); }
}

@media (prefers-reduced-motion: no-preference) {
  .answer.is-settling {
    animation: settle 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes droplet-fall {
  0% { transform: translateY(-18vh); opacity: 0; }
  8% { opacity: var(--drop-opacity, 0.5); }
  86% { opacity: var(--drop-opacity, 0.5); }
  100% {
    transform: translateY(calc(100dvh - (14px * var(--scale, 1))));
    opacity: 0;
  }
}

@keyframes droplet-splash {
  0%, 68% { opacity: 0; transform: scaleX(0.2) scaleY(0.45); }
  76% { opacity: 0.9; transform: scaleX(0.75) scaleY(1); }
  88% { opacity: 0.75; transform: scaleX(1.2) scaleY(0.85); }
  100% { opacity: 0; transform: scaleX(1.75) scaleY(0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .rain-field { display: none; }
}
