/* ————————————————————————————————
   shower.css — reasons I love you, falling from the sky
   a tap on empty night births a small gold star; it falls
   like a quiet comet while the reason fades in beside it.
   ———————————————————————————————— */

.shower-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 6; /* over the scene, under the corner controls */
}

/* ——— the star: a 4px gold ember with a soft glow ——— */

.shower-star {
  position: absolute;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px; /* center on the tap point */
  border-radius: 50%;
  background: var(--gold-soft, #F2E3B8);
  box-shadow:
    0 0 6px 1.5px rgba(231, 201, 130, 0.85),
    0 0 20px 5px rgba(231, 201, 130, 0.25);
  opacity: 0;
  animation: showerFall 2.5s cubic-bezier(0.34, 0.04, 0.64, 1) forwards;
  will-change: transform, opacity;
}

/* the tail — a short gradient thread pointing back up the path */
.shower-star::after {
  content: "";
  position: absolute;
  left: calc(50% - 0.75px);
  bottom: 50%;
  width: 1.5px;
  height: 46px;
  border-radius: 1px;
  transform-origin: bottom center;
  transform: rotate(var(--trail-rot, 0deg));
  background: linear-gradient(
    to top,
    rgba(242, 227, 184, 0.9),
    rgba(231, 201, 130, 0.35) 42%,
    rgba(231, 201, 130, 0) 100%
  );
}

@keyframes showerFall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  7%   { opacity: 1; }
  72%  { opacity: 0.9; }
  100% { transform: translate3d(var(--dx, 0px), var(--dy, 240px), 0) rotate(var(--sway, 0deg)); opacity: 0; }
}

/* reduced motion: no descent — just a still glint that breathes once */
.shower-star.is-still {
  animation: showerGlint 2.4s ease-in-out forwards;
}
.shower-star.is-still::after { content: none; }

@keyframes showerGlint {
  0%   { opacity: 0; transform: scale(0.6); }
  22%  { opacity: 1; transform: scale(1); }
  74%  { opacity: 1; }
  100% { opacity: 0; transform: scale(0.85); }
}

/* ——— the reason ——— */

.shower-reason {
  position: absolute;
  max-width: min(32ch, 76vw);
  font-family: var(--font-display, "Cormorant Garamond", "Georgia", serif);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--moon, #F6F1E4);
  text-shadow:
    0 0 14px rgba(231, 201, 130, 0.5),
    0 1px 3px rgba(1, 1, 2, 0.65);
  opacity: 0;
  animation: showerReason 4.4s ease forwards;
}

@keyframes showerReason {
  0%   { opacity: 0; transform: translateY(7px); }
  10%  { opacity: 1; transform: translateY(0); }
  84%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* ——— the one-time hint, low on the sky ——— */

.shower-hint {
  position: fixed;
  left: 50%;
  bottom: 12vh; /* clear of the story-line drifting under the clock */
  transform: translateX(-50%);
  font-family: var(--font-display, "Cormorant Garamond", "Georgia", serif);
  font-style: italic;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--gold, #E7C982);
  text-shadow: 0 0 12px rgba(231, 201, 130, 0.35);
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
  z-index: 6;
}

.shower-hint.visible {
  opacity: 0.8;
  /* the pulse waits 1s so the transition finishes the fade-in first */
  animation: showerHintPulse 2.8s ease-in-out 1s infinite;
}

@keyframes showerHintPulse {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .shower-hint.visible { animation: none; }
}
