/* hero.css — Bappa in one gold line, the names, and the marquee.
 *
 * Entrance (js/hero.js adds .is-in as the gate lifts, .is-drawing for the draw):
 *   the line art is uncovered bottom-up (lotus → crown) by a soft mask edge, then the
 *   name letters rise out of their line boxes one by one.
 * Afterwards a gold foil highlight rides the line art: .hero__foil is masked by the
 * art itself, and its spot child only ever moves by transform (compositor-only).
 */

.hero {
  position: relative;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top) + 30px) var(--pad) 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  contain: paint;
}

.hero__invocation {
  margin-bottom: 6px;
  font: 500 15px/1.3 var(--font-deva);
  letter-spacing: 0.04em;
  color: var(--gold);
}

.hero__kicker {
  margin-bottom: 18px;
}

/* ---- the line art ---------------------------------------------------------------- */
.hero__art {
  position: relative;
  height: min(40svh, 360px);
  aspect-ratio: 659 / 1100;
}

.hero__art img {
  width: 100%;
  height: 100%;
}

.hero.is-drawing .hero__art img {
  -webkit-mask-image: linear-gradient(to top, #000 42%, transparent 58%);
  mask-image: linear-gradient(to top, #000 42%, transparent 58%);
  -webkit-mask-size: 100% 300%;
  mask-size: 100% 300%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: art-draw 2200ms var(--ease-in-out) 150ms both;
}

@keyframes art-draw {
  from { -webkit-mask-position: 0 0%; mask-position: 0 0%; }
  to   { -webkit-mask-position: 0 100%; mask-position: 0 100%; }
}

.hero__foil {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: url("../assets/img/ganesha-line.webp") center / 100% 100% no-repeat;
  mask: url("../assets/img/ganesha-line.webp") center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 1200ms var(--ease-out);
  pointer-events: none;
}

.hero.is-drawn .hero__foil {
  opacity: 1;
}

/* on ivory paper a pale glint would wash the thin lines OUT; light catching foil reads
   as the gold turning richer and brighter, so the spot is a saturated amber-gold */
.hero__foil-spot {
  position: absolute;
  left: 0;
  top: 0;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #ffb81c 0%, rgba(245, 170, 30, 0.95) 32%, rgba(226, 150, 40, 0.5) 62%, rgba(226, 150, 40, 0) 100%);
}

/* ---- names -------------------------------------------------------------------------- */
.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0 0;
  font-weight: 400;
}

.hero__name {
  display: block;
  padding: 0.04em 0.1em 0.14em;
  overflow: clip;
  font: italic 400 clamp(58px, 17vw, 76px) / 0.98 var(--font-display);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em;
}

.hero__name .ch {
  display: inline-block;
}

.hero.is-in .hero__name .ch {
  animation: ch-rise 950ms var(--ease-out) backwards;
  animation-delay: calc(900ms + var(--i) * 45ms);
}

.hero__name + .hero__amp + .visually-hidden + .hero__name .ch {
  animation-delay: calc(1250ms + var(--i) * 45ms);
}

@keyframes ch-rise {
  from { transform: translateY(105%); }
  to   { transform: none; }
}

.hero__amp {
  margin: -6px 0 -8px;
  font: 400 44px/1 var(--font-display);
  color: var(--sindoor);
}

.hero__tagline {
  margin-top: 16px;
  font: 600 11px/1.4 var(--font-text);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero__date {
  margin-top: 8px;
  font: 500 15px/1.4 var(--font-text);
  letter-spacing: 0.08em;
}

.hero__sep {
  color: var(--sindoor);
}

.hero.is-in .hero__amp,
.hero.is-in .hero__tagline,
.hero.is-in .hero__date,
.hero.is-in .hero__invocation,
.hero.is-in .hero__kicker {
  animation: fade-up 900ms var(--ease-out) backwards;
}

.hero.is-in .hero__invocation { animation-delay: 100ms; }
.hero.is-in .hero__kicker { animation-delay: 250ms; }
.hero.is-in .hero__amp { animation-delay: 1150ms; }
.hero.is-in .hero__tagline { animation-delay: 1650ms; }
.hero.is-in .hero__date { animation-delay: 1800ms; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- marquee ------------------------------------------------------------------------ */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 16px 0;
  border-block: 1px solid var(--rule);
  background: var(--paper);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  padding-right: 30px;
  white-space: nowrap;
  font: italic 400 26px/1.1 var(--font-display);
}

.marquee__item[lang] {
  font: 500 23px/1.1 var(--font-deva);
}

.marquee__item::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sindoor);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}
