/* scenes/lunch-carnival.css -- js/motion/scenes/lunch-carnival.js (lunch: lamps lowered + swing,
 * hanging lines unroll + swing, sofa settles, tap to shower flowers; carnival: lamps lowered +
 * breeze, awning billow, stall pop-up + valance flutter, tap to celebrate = confetti).
 * Ported from gauri-rachit css/scenes/lunch.css + carnival.css (themselves from sanjana-sayyam).
 *
 * Armed (hidden-before-entrance) states live ONLY under html.motion, on claimed nodes, and are
 * released by .is-entered (kit adds it in the same task the fill:"backwards" entrances start,
 * so nothing flashes). Reduced motion / no JS: the exact PSD frame + a still hint pill.
 * Coordinates are design px (1 px = var(--u)); only transform / opacity animate. */

/* ================================================================ lunch */
/* armed: lamps whose cord starts at the top edge sit above the stage; the rest are hidden */
html.motion .scene--lunch:not(.is-entered) .ly:is([data-layer="lamp-1"], [data-layer="lamp-2"]) {
  transform: translateY(-105%);
}
html.motion .scene--lunch:not(.is-entered) .ly:is([data-layer="lamp-3"], [data-layer="sofa"],
  [data-layer="garland-1"], [data-layer="garland-2"]) {
  opacity: 0;
}
/* hanging lines unroll from their hooks */
.scene--lunch .ly:is([data-layer="garland-1"], [data-layer="garland-2"]) { transform-origin: 50% 0; }

/* blossom overlay: stage-sized, right after garland-2 (z from JS), below every text block */
.ll-fx {
  position: absolute;
  inset: 0;
  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 under the venue */
.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; }
.scene--lunch.ll-away .ll-hint::after { animation-play-state: paused; }

/* ================================================================ carnival */
html.motion [data-scene="carnival"]:not(.is-entered) .ly:is([data-layer="lamp-2"], [data-layer="lamp-3"]) {
  transform: translateY(-105%);
}
html.motion [data-scene="carnival"]:not(.is-entered) .ly:is([data-layer="lamp-1"], [data-layer="lamp-4"],
  [data-layer="awning"], [data-layer="stall-left"], [data-layer="stall-right"], [data-layer="picnic-table"]) {
  opacity: 0;
}

/* the stall's front valance: a clip-path copy of the stall sprite, resting exactly on it */
.cv-valance { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* particle overlay: right after picnic-table (z from JS), below every text block */
.cv-fx { position: absolute; inset: 0; pointer-events: none; }
.cv-fx > div { position: absolute; pointer-events: none; user-select: none; }

.cv-conf { border-radius: 1.5px; opacity: 0; box-shadow: 0 0 0 0.5px rgba(150, 120, 70, 0.25); }
.cv-conf--dot { border-radius: 50%; }
.cv-conf--ribbon { border-radius: 3px; }

/* "Tap to celebrate": a real button in the open sky under the venue, clear of both stalls */
.cv-cta {
  position: absolute;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 30px;
  margin: 0;
  padding: 0.38em 1.05em 0.38em 0.75em;
  border: 1px solid rgba(150, 70, 80, 0.5);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.9);
  color: #a2394a;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(12px, calc(36 * var(--u)), 16px);
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(110, 60, 50, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%);
}
/* motion: hidden until 2.4 s after the entrance, gone after the first burst */
html.motion .cv-cta {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 6px));
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.6s;
}
html.motion .cv-cta.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}
.cv-cta::before { content: ""; position: absolute; inset: -8px -4px; }   /* >= 44 px tap target */
.cv-cta:focus-visible { outline: 2px solid #a2394a; outline-offset: 3px; }
/* three little confetti dots that keep popping */
.cv-cta__pop { position: relative; flex: none; width: 1.2em; height: 1.2em; }
.cv-cta__pop > i {
  position: absolute;
  width: 0.36em;
  height: 0.36em;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  margin: -0.18em 0 0 -0.18em;
}
.cv-cta__pop > i:nth-child(1) { background: #d97f95; margin: -0.42em 0 0 -0.4em; }
.cv-cta__pop > i:nth-child(2) { background: #6f9a78; margin: -0.3em 0 0 0.1em; }
.cv-cta__pop > i:nth-child(3) { background: #d4ae5f; margin: 0.1em 0 0 -0.15em; }
html.motion .cv-cta__pop > i { margin: -0.18em 0 0 -0.18em; }
.cv-cta.is-visible .cv-cta__pop > i { animation: cv-pop 2.2s cubic-bezier(0.2, 0.8, 0.3, 1) 0.6s infinite; }
.cv-cta.is-visible .cv-cta__pop > i:nth-child(1) { --dx: -0.42em; --dy: -0.4em; }
.cv-cta.is-visible .cv-cta__pop > i:nth-child(2) { --dx: 0.45em; --dy: -0.3em; animation-delay: 0.68s; }
.cv-cta.is-visible .cv-cta__pop > i:nth-child(3) { --dx: 0.05em; --dy: 0.45em; animation-delay: 0.76s; }
.cv-away .cv-cta__pop > i { animation-play-state: paused; }
@keyframes cv-pop {
  0% { transform: none; opacity: 1; }
  30% { transform: translate(var(--dx), var(--dy)) scale(0.9); opacity: 1; }
  55%, 100% { transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.2 + 0.2em)) scale(0.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ll-hint { transition: none; }
  .ll-hint::after { animation: none !important; }
  .cv-cta__pop > i { animation: none !important; }
}
