/* scenes/lunch.css -- js/motion/scenes/lunch.js (curtains + fairy lights, gate / urn / pond /
   garland / tree life, tap-to-shower). Ported from sanjana-sayyam lunch.css + regards.css.
   Nothing here changes the resting PSD frame: armed rules are under html.motion, overlays
   exist only with motion (except the hint pill, which stays -- still -- in reduced motion). */

/* curtains hang from their outer top corner; garlands from their hook */
.scene--lunch [data-layer="curtain-left"] { transform-origin: 0 0; }
.scene--lunch [data-layer="curtain-right"] { transform-origin: 100% 0; }
.scene--lunch [data-layer="garland-left"],
.scene--lunch [data-layer="garland-left"] img { transform-origin: 10% 0; }
.scene--lunch [data-layer="garland-right"],
.scene--lunch [data-layer="garland-right"] img { transform-origin: 90% 0; }
.scene--lunch [data-layer="tree"] img { transform-origin: 84% 100%; }   /* the trunk's foot */

/* armed: hidden / gathered until the entrance (fill "backwards") takes over */
html.motion .scene--lunch:not(.is-entered) [data-layer="curtain-left"] { transform: scaleX(1.16) skewX(-1deg); }
html.motion .scene--lunch:not(.is-entered) [data-layer="curtain-right"] { transform: scaleX(1.16) skewX(1deg); }
html.motion .scene--lunch:not(.is-entered) .ly:is([data-layer="gate"], [data-layer="tree"], [data-layer="lawn"],
  [data-layer="urn"], [data-layer="lily-pond"], [data-layer="petal-trays"],
  [data-layer="garland-left"], [data-layer="garland-right"]) { opacity: 0; }

/* fairy lights: a warm glow over each baked light dot (inside the curtain wrapper) */
.ll-light {
  position: absolute;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  margin: calc(-22 * var(--u)) 0 0 calc(-22 * var(--u));
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle closest-side,
    rgba(255, 255, 252, 1) 0%, rgba(255, 249, 222, 0.95) 16%,
    rgba(255, 232, 168, 0.5) 40%, rgba(255, 226, 150, 0.16) 70%, rgba(255, 226, 150, 0) 100%);
  animation: ll-twinkle var(--d, 2.6s) ease-in-out var(--dl, 0s) infinite;
}
@keyframes ll-twinkle {
  0%, 100% { opacity: 0; }
  45% { opacity: var(--pk, 0.9); }
  60% { opacity: calc(var(--pk, 0.9) * 0.7); }
}

/* water: small nodes next to the urn (z 5) / the lily pond (z 4) */
.ll-spout, .ll-drop, .ll-glint, .ll-veil, .ll-ring, .ll-spark { position: absolute; pointer-events: none; }
.ll-drop, .ll-glint, .ll-veil, .ll-ring, .ll-spark { opacity: 0; }
.ll-spout {
  border-radius: 50% 50% 40% 40%;
  transform-origin: 50% 100%;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.9), rgba(236, 248, 255, 0.8) 55%, rgba(236, 248, 255, 0));
  box-shadow: 0 0 calc(3 * var(--u)) rgba(112, 160, 196, 0.6);
}
.ll-drop {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 255, 255, 1) 0%, rgba(236, 248, 255, 1) 40%, rgba(112, 170, 196, 0.85) 72%, rgba(112, 170, 196, 0) 100%);
}
.ll-glint {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0));
}
.ll-veil {
  border-radius: 999px;
  transform-origin: 50% 0%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 45%, rgba(196, 226, 246, 0.8) 70%, rgba(196, 226, 246, 0));
}
.ll-ring {
  border-radius: 50%;
  border: calc(1.6 * var(--u)) solid rgba(240, 252, 255, 0.75);
}
.ll-spark {
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.95) 50%, transparent 56%),
    linear-gradient(0deg, transparent 44%, rgba(255, 255, 255, 0.95) 50%, transparent 56%),
    radial-gradient(circle closest-side, rgba(255, 255, 255, 1) 0%, rgba(214, 238, 255, 0.6) 35%, rgba(214, 238, 255, 0) 100%);
}

/* blossom overlay: stage-sized, right after the garlands (z 16), below every text block (z 17+) */
.ll-fx {
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
  overflow: hidden;
}
.ll-blossom {
  position: absolute;
  height: auto;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* "Tap to shower flowers": a real button on the paper between the venue and the gate */
.ll-hint {
  position: absolute;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 30px;
  margin: 0;
  padding: 0.34em 1.05em 0.34em 0.7em;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(185, 120, 60, 0.6);
  border-radius: 999px;
  background: rgba(255, 251, 242, 0.9);
  box-shadow: 0 4px 14px rgba(110, 60, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #8a3b2a;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(12px, calc(36 * var(--u)), 16px);
  letter-spacing: 0.03em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 500ms ease, transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ll-hint::before { content: ""; position: absolute; inset: -8px -4px; }   /* >= 44 px tap target */
.ll-hint__icon { width: 1.25em; height: 1.25em; object-fit: contain; }
.ll-hint:active { transform: translate(-50%, -50%) scale(0.96); }
.ll-hint:focus-visible { outline: 2px solid #8a3b2a; outline-offset: 3px; }
/* motion: appears after the entrance, breathes until first use, then fades away
   (it stays focusable: keyboard focus brings it back) */
html.motion .scene--lunch:not(.ll-hint-on) .ll-hint { opacity: 0; transform: translate(-50%, -30%); pointer-events: none; }
html.motion .scene--lunch.ll-hint-on:not(.ll-used) .ll-hint::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(185, 120, 60, 0.7);
  pointer-events: none;
  animation: ll-ring 2.4s ease-out 0.4s infinite;
}
@keyframes ll-ring {
  0% { opacity: 0.9; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.12, 1.4); }
}
html.motion .scene--lunch.ll-used .ll-hint:not(:focus-visible) { opacity: 0; pointer-events: none; }

/* off screen: every CSS loop holds still (iOS budget) */
.scene--lunch.ll-away .ll-light,
.scene--lunch.ll-away .ll-hint::after { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .ll-light { display: none; }
  .ll-hint { transition: none; }
  .ll-hint::after { animation: none !important; }
}
