/* scenes/sangeet-wedding.css -- js/motion/scenes/sangeet-wedding.js.
 * Sangeet ported from gauri-rachit's sangeet.css, wedding from sanjana-sayyam's wedding.css.
 * Every node styled here is created by the JS at runtime, inside its scene's .stage.
 * Plain rules = the resting state (= the PSD frame: sheets, glows, bulbs invisible). Dark /
 * "before the entrance" states are scoped under html.motion (or only exist while the JS runs
 * with 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 / mask). Both pills stay
 * visible (still) with reduced motion. */

/* =========================================================================== SANGEET */
/* overlay: inserted right after musician-1 (last art layer), same z -> below every text block */
.sg-fx,
.sg-layer { position: absolute; inset: 0; pointer-events: none; }
.sg-fx { z-index: 28; }
.sg-fx > div,
.sg-layer > div { position: absolute; pointer-events: none; user-select: none; }

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

/* copies of the lights above the sheet (exist only while dark / lighting) */
.sg-copy img { display: block; width: 100%; height: 100%; }
.sg-strand, .sg-stars, .sg-chand { opacity: 1; }
html.motion [data-scene="sangeet"].sg-dark .sg-strand { opacity: 0.15; }
html.motion [data-scene="sangeet"].sg-dark .sg-stars { opacity: 0.2; }
html.motion [data-scene="sangeet"].sg-dark .sg-chand { opacity: 0; }
/* ...while the light originals sit hidden underneath (the warm wash just turns low) */
html.motion [data-scene="sangeet"]:is(.sg-dark, .sg-busy) .ly:is([data-layer="string-lights-left"], [data-layer="string-lights-right"], [data-layer="star-hangings"]) { opacity: 0; }
html.motion [data-scene="sangeet"].sg-dark .ly[data-layer="glow"] { opacity: 0.35; }

/* hanging lanterns: pendulum wrapper (pivot = chain top) + candle halo inside it */
.sg-swing { position: absolute; inset: 0; transform-origin: 50% 0; }
.sg-swing > img { display: block; width: 100%; height: 100%; }
.sg-lamp {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.8;
  background: radial-gradient(circle closest-side,
    rgba(255, 240, 200, 0.85) 0%,
    rgba(255, 204, 128, 0.42) 32%,
    rgba(255, 170, 90, 0.12) 64%,
    rgba(255, 160, 80, 0) 100%);
}
html.motion [data-scene="sangeet"]:not(.sg-lit) .sg-lamp { opacity: 0; }

/* 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-flame {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 244, 214, 0.95) 0%,
    rgba(255, 200, 120, 0.55) 30%,
    rgba(255, 160, 80, 0.16) 62%,
    rgba(255, 150, 70, 0) 100%);
  opacity: 0;
}
html.motion [data-scene="sangeet"].sg-lit .sg-flame { opacity: 0.8; }   /* lit: flames burn (catch anims start from 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 on the plain wall above the musicians
 * (left/top set by the JS), clear of the text (ends y 1030) and of the tapestries. */
.sg-cta {
  position: absolute;
  z-index: 41;
  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(8, 12, 40, 0.74);
  color: #f6e2b2;
  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 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,
html:not(.motion) .sg-cta {
  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;
}
html:not(.motion) .sg-cta { transition: none; }
.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;
}
html.motion .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); }
}

/* =========================================================================== WEDDING */
/* ---------------------------------------------------------------- chandeliers */
.wd-swing { position: absolute; inset: 0; }
.wd-swing > img { display: block; width: 100%; height: 100%; }
.wd-glow {                                  /* warm bloom behind the crystals, faint at rest */
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  background: radial-gradient(circle closest-side, rgba(255, 236, 190, 0.75) 0%, rgba(255, 214, 150, 0.38) 34%, rgba(255, 200, 130, 0.12) 66%, rgba(255, 200, 130, 0) 100%);
}
.scene:not(.is-entered) .wd-glow { opacity: 0; }
.wd-glint, .wd-spark {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.wd-glint::before, .wd-glint::after, .wd-spark::before, .wd-spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 10%;
  margin: -5% 0 0 -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fffef6 0%, rgba(255, 246, 214, 0.85) 40%, rgba(255, 240, 200, 0) 100%);
}
.wd-glint::after, .wd-spark::after { transform: rotate(90deg); }
.wd-spark { background: radial-gradient(circle closest-side, rgba(255, 248, 220, 0.95) 0%, rgba(255, 214, 130, 0.55) 16%, rgba(255, 200, 110, 0) 42%); }
.wd-spark::before, .wd-spark::after { height: 14%; margin-top: -7%; }
.wd-spark::before, .wd-spark::after {
  background: radial-gradient(closest-side, #fffbe8 0%, rgba(255, 220, 130, 0.9) 38%, rgba(240, 190, 90, 0) 100%);
}

/* ---------------------------------------------------------------- candles, mirror */
.wd-halo {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.75;
  background: radial-gradient(circle closest-side, rgba(255, 238, 190, 0.9) 0%, rgba(255, 206, 120, 0.45) 36%, rgba(255, 180, 90, 0.12) 70%, rgba(255, 180, 90, 0) 100%);
}
.scene:not(.is-entered) .wd-halo { opacity: 0; }
.wd-sheen {                                  /* masked by the mirror layer's own alpha */
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.wd-sheen__band {
  position: absolute;
  left: 0;
  top: -10%;
  width: calc(90 * var(--u));
  height: 120%;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 250, 0) 0%, rgba(255, 252, 240, 0.42) 50%, rgba(255, 255, 250, 0) 100%);
}

/* ---------------------------------------------------------------- the blessing */
.wd-bless { position: absolute; inset: 0; z-index: 46; pointer-events: none; }   /* above every art layer (max z 38) */
.wd-petal { position: absolute; opacity: 0; pointer-events: none; }
.wd-petal img { display: block; width: 100%; height: 100%; }
.wd-cglow {                                  /* behind the couple: same z, earlier in paint order */
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle closest-side, rgba(255, 244, 214, 0.95) 0%, rgba(255, 220, 150, 0.62) 32%, rgba(250, 190, 110, 0.22) 64%, rgba(250, 186, 110, 0) 100%);
}
.wd-cglow.is-on { opacity: 0.75; }          /* reduced motion: a still answer to the tap */

/* "Tap to shower blessings" -- night-toned pill with the gesture in miniature
 * (sanjana-sayyam, from suryanshu-rajvi wedding-finale). */
.wd-pill {
  position: absolute;
  z-index: 50;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: calc(16 * var(--u));
  margin: 0;
  padding: calc(15 * var(--u)) calc(40 * var(--u)) calc(15 * var(--u)) calc(22 * var(--u));
  border: 0;
  border-radius: 999px;
  background: rgba(14, 24, 60, 0.78);
  box-shadow: inset 0 0 0 calc(2.6 * var(--u)) rgba(232, 210, 162, 0.62), 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(3, 8, 28, 0.5);
  color: #fbf4e4;
  font: 600 clamp(12px, calc(36 * var(--u)), 16px)/1.2 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(14 * var(--u)));
  transition: opacity 450ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 600ms;
}
.wd-pill::before {                           /* >= 44 px tap target round a ~30 px pill */
  content: "";
  position: absolute;
  inset: -9px -6px;
  border-radius: 999px;
}
.wd-pill::after {                            /* a slow gold breath round the rim */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 calc(30 * var(--u)) rgba(240, 206, 140, 0.55);
  opacity: 0;
}
html.motion .wd-pill.is-on {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 450ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
  animation: wd-pill-float 2.6s ease-in-out 0.7s infinite;
}
html.motion .wd-pill.is-on::after { animation: wd-pill-breath 2.6s ease-in-out 0.7s infinite; }
/* used once: out of sight, still reachable by keyboard */
html.motion .wd-pill.is-used { visibility: visible; transition: opacity 450ms ease, transform 600ms ease; }
/* reduced motion: the pill stays, still (no float, no rings); the caption takes its place
 * for a moment after a tap */
html:not(.motion) .wd-pill { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition: none; }
.wd-pill:focus-visible { opacity: 1; outline: 2px solid #f1d9a4; outline-offset: 4px; }
.wd-pill:active { scale: 0.96; }
.wd-pill__t { position: relative; }
@keyframes wd-pill-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(-8 * var(--u))); } }
@keyframes wd-pill-breath { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }

/* the tap gesture: a resting ring, two rings breaking outward, a beating core */
.wd-tap {
  position: relative;
  flex: none;
  width: calc(56 * var(--u));
  height: calc(56 * var(--u));
}
.wd-tap::before {
  content: "";
  position: absolute;
  inset: 16%;
  border: calc(3 * var(--u)) solid currentColor;
  border-radius: 50%;
  opacity: 0.4;
}
.wd-tap > span {
  position: absolute;
  inset: 0;
  border: calc(3.5 * var(--u)) solid currentColor;
  border-radius: 50%;
  opacity: 0;
}
html.motion .wd-pill.is-on .wd-tap > span { animation: wd-ring-out 2.2s cubic-bezier(0.33, 1, 0.68, 1) infinite; }
html.motion .wd-pill.is-on .wd-tap > span + span { animation-delay: 300ms; }
.wd-tap > i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  margin: -17% 0 0 -17%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fffdf7 0%, #fbf4e4 52%, rgba(201, 163, 92, 0.6) 100%);
  box-shadow: 0 0 calc(10 * var(--u)) rgba(255, 246, 220, 0.75);
}
html.motion .wd-pill.is-on .wd-tap > i { animation: wd-core-beat 2.2s cubic-bezier(0.33, 1, 0.68, 1) infinite; }
@keyframes wd-ring-out {
  0% { opacity: 0; transform: scale(0.3); }
  6% { opacity: 1; }
  32%, 100% { opacity: 0; transform: scale(1.16); }
}
@keyframes wd-core-beat {
  0% { transform: scale(1); }
  4% { transform: scale(1.26); }
  11% { transform: scale(1); }
  18% { transform: scale(1.22); }
  26%, 100% { transform: scale(1); }
}

/* status line: announced to screen readers; shown as a caption only with reduced motion */
.wd-status {
  position: absolute;
  z-index: 50;
  translate: -50% -50%;
  padding: calc(14 * var(--u)) calc(34 * var(--u));
  border-radius: 999px;
  background: rgba(14, 24, 60, 0.78);
  box-shadow: inset 0 0 0 calc(2.6 * var(--u)) rgba(232, 210, 162, 0.62);
  color: #fbf4e4;
  font: 600 clamp(12px, calc(36 * var(--u)), 16px)/1.2 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
html:not(.motion) .wd-status.is-on { opacity: 1; }
html:not(.motion) .stage:has(.wd-status.is-on) .wd-pill { opacity: 0; }
