/* scenes/cover-names.css -- js/motion/scenes/cover-names.js (the cover (Cover Slide.psd) and names (Names.psd) slides).
 * Armed (hidden-before-entrance) states live ONLY under html.motion and only on nodes
 * the module claimed, so reduced motion / no JS show the exact PSD frame.
 * Ported from gauri-rachit css/scenes/logo-names.css (monogram, hashtag, fountain, pool,
 * hint pill), isha-rishabh css/scenes/cover.css + css/fx/kit.css (couple hit box, pollen,
 * urn sparkles) and atishay-shivani css/scenes/logo-names.css (names: Ganesha aura, pen,
 * flourishes, meadow motes). Overlays are created by the JS: pointer-events:none unless
 * buttons, all small. */

/* ---------------------------------------------------------------- armed */
html.motion .scene--cover:not(.is-entered) .stage > .ly[data-motion="custom"],
html.motion .scene--names:not(.is-entered) .stage > .ly[data-motion="custom"],
html.motion .scene--names:not(.is-entered) .tb[data-motion="custom"] .tl {
  opacity: 0;
}

/* monogram scales / floats about its centre; Ganesha about his seat */
.scene--cover [data-layer="logo"],
.scene--cover [data-layer="logo"] img { transform-origin: 50% 50%; }
.scene--names [data-layer="ganesha"] { transform-origin: 50% 60%; }
.scene--names [data-layer="meadow"] img { transform-origin: 50% 100%; }
/* urns / pots split at the rim: the planted vessel copy sits exactly over the original */
.scene--cover .ly > img.cn-vessel { position: absolute; left: 0; top: 0; }

/* Handwriting wipe on a Rungkut line (geometry set in px by the JS). */
.cn-ink {
  -webkit-mask-image: var(--cn-mi);
  mask-image: var(--cn-mi);
  -webkit-mask-size: var(--cn-ms);
  mask-size: var(--cn-ms);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ---------------------------------------------------------------- shared fx */
.cn-spark, .cn-glow, .cn-halo, .cn-rays, .cn-ripple, .cn-diya, .cn-glint, .cn-fountain, .cn-hint,
.cn-pen, .cn-flourish, .cn-motes, .cn-meadow-motes, .cn-dots {
  position: absolute;
  pointer-events: none;
}
.cn-spark, .cn-glow, .cn-ripple, .cn-diya, .cn-glint, .cn-pen, .cn-flourish { opacity: 0; }

/* four-point gold sparkle with a soft glow (reads on the pale sky) */
.cn-spark::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 250, 232, 0.95) 0%, rgba(250, 222, 160, 0.45) 40%, rgba(240, 205, 140, 0) 100%);
}
.cn-spark svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  fill: #f3cf7a;
  stroke: rgba(176, 124, 44, 0.55);
  stroke-width: 0.6;
}

/* warm bloom behind the monogram */
.cn-glow {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 244, 222, 0.85) 0%, rgba(255, 228, 206, 0.5) 30%,
    rgba(250, 210, 196, 0.2) 58%, rgba(250, 210, 196, 0.06) 80%, rgba(250, 210, 196, 0) 100%);
}
.cn-glow.is-still, .cn-halo.is-still { opacity: 0.9; }

/* gold glint: a child of the monogram wrapper, masked to the monogram's own pixels */
.cn-foil {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: var(--cn-src);
  mask-image: var(--cn-src);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.cn-foil-band {
  position: absolute;
  inset: -20% -70%;
  opacity: 0;
  background: linear-gradient(112deg,
    rgba(255, 236, 170, 0) 38%, rgba(255, 222, 140, 0.9) 46%, rgba(255, 252, 236, 1) 50%,
    rgba(255, 222, 140, 0.9) 54%, rgba(255, 236, 170, 0) 62%);
}

/* ---------------------------------------------------------------- buttons */
.cn-crest-btn, .cn-tag, .cn-couple-btn, .cn-ganesha-btn {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.cn-crest-btn { z-index: 40; border-radius: 46% 46% 30% 30%; }
.cn-tag { z-index: 60; border-radius: calc(20 * var(--u)); cursor: copy; }
.cn-couple-btn { z-index: 40; border-radius: calc(40 * var(--u)); }
.cn-ganesha-btn { z-index: 60; min-width: 44px; min-height: 44px; border-radius: 999px; }
.cn-crest-btn:focus-visible, .cn-tag:focus-visible, .cn-couple-btn:focus-visible, .cn-ganesha-btn:focus-visible {
  outline: 3px solid #b04058;
  outline-offset: -4px;
}

.cn-toast {
  position: absolute;
  z-index: 61;
  left: 50%;
  top: 31.3%;                    /* reset by the JS onto the hashtag line itself */
  transform: translate(-50%, calc(-50% + 10 * var(--u)));
  padding: calc(14 * var(--u)) calc(30 * var(--u));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #8a2f4b;
  font: 600 max(13px, calc(32 * var(--u))) / 1 "Cormorant Garamond", Georgia, serif;
  white-space: nowrap;
  box-shadow: 0 calc(6 * var(--u)) calc(20 * var(--u)) rgba(60, 40, 50, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}
.cn-toast.is-on { opacity: 1; transform: translate(-50%, -50%); }

/* ---------------------------------------------------------------- hint pill */
/* gauri-rachit's fountain hint ("Tap the fountain"), from sanjana-sayyam's regards hint */
.cn-hint {
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 1.1em 0.55em;
  border-radius: 999px;
  border: 1px solid rgba(190, 150, 86, 0.55);
  background: rgba(255, 252, 246, 0.93);
  box-shadow: 0 calc(6 * var(--u)) calc(18 * var(--u)) rgba(80, 40, 50, 0.16);
  color: #8a2f4b;
  font: 600 max(calc(32 * var(--u)), 13px) / 1.15 "Cormorant Garamond", Georgia, serif;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cn-hint:not(.is-on) { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
.cn-hint.is-gone { opacity: 0; }
.cn-hint__dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, #fff6d8 0%, #f2b85a 55%, rgba(242, 184, 90, 0) 100%);
  box-shadow: 0 0 0.45em rgba(242, 184, 90, 0.8);
  animation: cn-breathe 1.8s ease-in-out infinite alternate;
}
@keyframes cn-breathe { from { transform: scale(0.8); opacity: 0.7; } to { transform: scale(1.15); opacity: 1; } }
.cn-away .cn-hint__dot { animation-play-state: paused; }

/* ---------------------------------------------------------------- cover: water + air */
.cn-fountain { left: 0; top: 0; }
/* a soft light glint drifting on the pool */
.cn-glint {
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 255, 246, 1) 0%, rgba(255, 252, 230, 0.9) 35%, rgba(255, 244, 210, 0.35) 65%, rgba(255, 240, 200, 0) 100%);
  box-shadow: 0 0 calc(6 * var(--u)) rgba(255, 248, 220, 0.5);
}
/* isha-rishabh sunlit pollen (the container is inert; each mote loops invisible -> invisible) */
.cn-mote {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle,
    rgba(255, 252, 236, 1) 0%, rgba(255, 240, 196, 0.6) 42%, rgba(255, 240, 196, 0) 72%);
}
/* isha-rishabh sparkleField: sun glints on the brass urns */
.cn-dots > i {
  position: absolute;
  border-radius: 50%;
  margin: calc(-12 * var(--u)) 0 0 calc(-12 * var(--u));
  background: radial-gradient(circle, rgba(255, 246, 214, 0.95) 0%, rgba(255, 247, 226, 0.35) 55%, transparent 100%);
  opacity: 0;
  animation: cn-twinkle 3600ms ease-in-out infinite;
}
@keyframes cn-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
}

/* ---------------------------------------------------------------- names: Ganesha */
/* Ganesha's aura: rests faint after the entrance (the module animates in/out of these) */
.cn-halo {
  opacity: 0.42;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 238, 190, 0.95) 0%, rgba(250, 214, 140, 0.55) 34%,
    rgba(240, 196, 120, 0.18) 62%, rgba(240, 196, 120, 0) 100%);
}
.cn-rays {
  opacity: 0.38;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg,
    rgba(236, 196, 118, 0.55) 0deg 2.2deg, rgba(236, 196, 118, 0) 5deg 22.5deg);
  -webkit-mask-image: radial-gradient(circle closest-side, transparent 14%, #000 26%, rgba(0, 0, 0, 0.5) 46%, transparent 68%);
  mask-image: radial-gradient(circle closest-side, transparent 14%, #000 26%, rgba(0, 0, 0, 0.5) 46%, transparent 68%);
}
.cn-ripple {
  border-radius: 50%;
  border: calc(2.5 * var(--u)) solid rgba(214, 170, 92, 0.85);
  box-shadow: 0 0 calc(10 * var(--u)) rgba(240, 200, 130, 0.55), inset 0 0 calc(8 * var(--u)) rgba(240, 200, 130, 0.45);
}
.cn-diya {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 252, 230, 1) 0%, rgba(255, 210, 120, 0.95) 30%,
    rgba(240, 150, 60, 0.4) 62%, rgba(240, 150, 60, 0) 100%);
}

/* ---------------------------------------------------------------- names: text */
/* the nib of the pen: a warm point of light */
.cn-pen {
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(255, 253, 242, 1) 0%, rgba(255, 236, 190, 0.9) 26%,
    rgba(232, 186, 118, 0.38) 56%, rgba(232, 186, 118, 0) 100%);
}
.cn-flourish {
  transform-origin: 0% 50%;
  background: linear-gradient(90deg, rgba(176, 64, 88, 0.85), rgba(200, 160, 90, 0.6) 60%, rgba(200, 160, 90, 0));
}
.cn-flourish.is-left {
  transform-origin: 100% 50%;
  background: linear-gradient(270deg, rgba(176, 64, 88, 0.85), rgba(200, 160, 90, 0.6) 60%, rgba(200, 160, 90, 0));
}

/* pollen / light motes over the meadow */
.cn-meadow-motes { overflow: hidden; }
.cn-mmote {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle closest-side,
    rgba(255, 253, 236, 1) 0%, rgba(255, 240, 190, 0.7) 40%, rgba(255, 240, 190, 0) 100%);
}
.scene--names.cn-motes-on .cn-mmote { animation: cn-mote 9s ease-in-out infinite; }
.scene--names.cn-away .cn-mmote { animation-play-state: paused; }
@keyframes cn-mote {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  22%  { opacity: var(--o, 0.7); }
  50%  { transform: translate(calc(var(--dx) * 0.45 + 6px), calc(var(--dy) * 0.5)) scale(1); }
  78%  { opacity: var(--o, 0.7); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.7); }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cn-hint__dot { animation: none; }
  .cn-hint, .cn-toast { transition: none; }
  .cn-dots, .cn-motes, .cn-meadow-motes { display: none; }
}
