/* scenes/sangeet.css -- js/motion/scenes/sangeet.js ("tap to switch on the lights").
 *
 * Every node styled here is created by the JS at runtime. Plain rules = the LIT resting
 * state (= the PSD frame: the sheet, glows and bulbs are invisible, no copies exist).
 * The dark states (.sg-dark before the tap, .sg-busy while the lights come up) are scoped
 * under html.motion, so reduced motion / no JS always shows the exact PSD frame.
 * Coordinates are design px (1 px = var(--u)), set inline by the JS. Only opacity and
 * transform animate; the one stage-sized sheet is a flat colour (no filter / blend). */

/* z 24, inserted right after the couple: above all the art, below every text block (z 25+) */
.sg-fx,
.sg-layer { position: absolute; inset: 0; pointer-events: none; }
.sg-fx { z-index: 24; }
.sg-fx > div,
.sg-layer > div { position: absolute; pointer-events: none; user-select: none; }

/* the dark: a flat night-green sheet over the art */
.sg-fx > .sg-dim { inset: 0; background: #020b08; opacity: 0; }
html.motion [data-scene="sangeet"].sg-dark .sg-dim { opacity: 0.68; }

/* copies of the string lights / chandeliers above the sheet (exist only while dark) */
.sg-copy img { display: block; width: 100%; height: 100%; }
.sg-strand { opacity: 1; }
html.motion [data-scene="sangeet"].sg-dark .sg-strand { opacity: 0.15; }
.sg-chand { opacity: 1; }
html.motion [data-scene="sangeet"].sg-dark .sg-chand { opacity: 0; }
/* ...while their originals sit hidden underneath */
html.motion [data-scene="sangeet"]:is(.sg-dark, .sg-busy) .ly:is([data-layer="string-lights-left"], [data-layer="string-lights-right"]) { opacity: 0; }
html.motion [data-scene="sangeet"].sg-dark .ly[data-layer="sparkles"] { opacity: 0.2; }

/* warm glows: radial gradients on small nodes, invisible at rest */
.sg-glow {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 240, 205, 1) 0%,
    rgba(255, 226, 170, 0.7) 26%,
    rgba(255, 208, 145, 0.28) 56%,
    rgba(255, 205, 140, 0) 100%);
  opacity: 0;
}
.sg-lamp {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 236, 222, 0.95) 0%,
    rgba(255, 170, 160, 0.55) 26%,
    rgba(250, 130, 130, 0.18) 56%,
    rgba(250, 130, 130, 0) 100%);
  opacity: 0;
}
.sg-bulb {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 255, 250, 1) 0%,
    rgba(255, 242, 210, 0.75) 20%,
    rgba(255, 222, 165, 0.22) 52%,
    rgba(255, 222, 165, 0) 100%);
  opacity: 0;
}

/* four-point crystal glint */
.sg-spark { opacity: 0; }
.sg-spark::before,
.sg-spark::after {
  content: "";
  position: absolute;
  left: 0;
  top: 46%;
  width: 100%;
  height: 8%;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 50%, rgba(255, 255, 255, 0));
}
.sg-spark::after { transform: rotate(90deg); }
.sg-spark > i {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, #fff 0%, rgba(255, 248, 225, 0.6) 45%, rgba(255, 248, 225, 0) 100%);
}

/* "Tap to switch on the lights" -- a real button in the dark arch above the title,
 * clear of the text block and the couple (free band x 30-650, y 430-515). */
.sg-cta {
  position: absolute;
  left: calc(342 * var(--u));
  top: calc(462 * var(--u));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 30px;
  margin: 0;
  padding: 0.38em 1em 0.38em 0.7em;
  border: 1px solid rgba(246, 226, 178, 0.6);
  border-radius: 999px;
  background: rgba(6, 20, 16, 0.72);
  color: #f6e2b2;
  font-family: "Quattrocento", Georgia, serif;
  font-size: clamp(12px, calc(34 * 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 18px rgba(0, 0, 0, 0.4), 0 0 16px rgba(255, 214, 150, 0.16), inset 0 1px 0 rgba(255, 245, 225, 0.16);
  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;
}
.sg-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;
}
.sg-cta::before { content: ""; position: absolute; inset: -8px -4px; }   /* >= 44 px tap target */
.sg-cta:focus-visible { outline: 2px solid #f6e2b2; outline-offset: 3px; }
/* a little bulb that keeps trying to switch on */
.sg-cta__bulb {
  position: relative;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, #fff7df 0%, #f4cf7e 45%, rgba(244, 207, 126, 0) 100%);
}
.sg-cta__bulb > i {
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(255, 226, 160, 0.55) 0%, rgba(255, 226, 160, 0) 100%);
  opacity: 0;
}
.sg-cta.is-visible .sg-cta__bulb > i { animation: sg-bulb-try 2.4s ease-in-out 0.6s infinite; }
.sg-away .sg-cta__bulb > i { animation-play-state: paused; }
@keyframes sg-bulb-try {
  0%, 100% { opacity: 0; transform: scale(0.7); }
  12% { opacity: 1; transform: scale(1); }
  18% { opacity: 0.25; }
  26% { opacity: 0.9; transform: scale(1.05); }
  55% { opacity: 0; transform: scale(0.8); }
}

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