/* aarti.css — circle the thali around Bappa.
 *
 * The stage is a square; the murti portrait is a circular crop of the darshan still.
 * js/aarti.js owns the thali's transform (it rides a circle of radius --r) and paints
 * the light trail into a canvas the same size as the stage — the additive blend
 * happens inside the canvas (globalCompositeOperation), never as a CSS blend mode.
 */

.aarti__howto {
  max-width: 28ch;
  margin: 0 auto 26px;
  font: italic 500 19px/1.45 var(--font-poem);
  color: var(--ivory-dim);
}

.aarti__stage {
  --size: min(84vw, 360px);
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: 0 auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.aarti__murti {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  /* crop of darshan.jpg around the murti's face and torso (art 22-78% x, 14-56% y) */
  background: url("../assets/img/darshan.jpg") 50% 26.9% / 160.7% auto no-repeat;
  box-shadow:
    0 0 0 3px #7a4a14,
    0 0 0 5px var(--brass),
    0 0 0 7px #7a4a14,
    0 0 40px rgba(255, 170, 70, 0.28),
    0 18px 40px rgba(0, 0, 0, 0.5);
}

.aarti__glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, 0.55), rgba(255, 160, 60, 0.16) 55%, rgba(255, 150, 60, 0) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms var(--ease-out);
}

.aarti.is-done .aarti__glow {
  opacity: 1;
  animation: aarti-glow 3.6s var(--ease-soft) 900ms infinite alternate;
}

@keyframes aarti-glow {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}

.aarti__trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.aarti__guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  animation: aarti-guide 14s linear infinite;
}

.aarti__guide circle,
.aarti__guide path {
  fill: none;
  stroke: rgba(248, 227, 166, 0.42);
  stroke-width: 0.6;
  stroke-linecap: round;
}

.aarti__guide circle {
  stroke-dasharray: 0.1 2.4;
  stroke-width: 1;
}

.aarti.is-active .aarti__guide,
.aarti.is-done .aarti__guide {
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}

@keyframes aarti-guide {
  to { transform: rotate(360deg); }
}

.aarti__thali {
  position: absolute;
  left: 0;
  top: 0;
  width: 26%;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  z-index: 2;
}

.aarti__thali:active {
  cursor: grabbing;
}

.aarti__thali img {
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
}

.aarti__thali:focus-visible {
  border-radius: 50%;
}

/* extra living light on the thali's own flame (measured at 50%, 12%) */
.aarti__thali-glow {
  position: absolute;
  left: 50%;
  top: 11%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 130, 0.6), rgba(255, 150, 50, 0.16) 50%, rgba(255, 150, 50, 0) 100%);
  transform: translate(-50%, -50%);
  animation: flame-halo 1.9s var(--ease-soft) infinite alternate;
  pointer-events: none;
}

.aarti__progress {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 22px 0 6px;
}

.aarti__progress .diya {
  --diya-w: 48px;
  opacity: 0.55;
  transition: opacity 500ms var(--ease-out);
}

.aarti__progress .diya.is-lit {
  opacity: 1;
}

.aarti__status {
  min-height: 3em;
  max-width: 30ch;
  margin: 8px auto 14px;
  font: 500 18px/1.45 var(--font-poem);
  color: var(--haldi);
}

.aarti.is-done .aarti__auto {
  visibility: hidden;
}
