/* reveal.css — type reveals + gradient type + misc layout hooks.
 *
 * HERO (on load): mantras + blessing lines cascade in as a pure fade (pukhraj-poorva's
 * client asked for no rise on the hero copy); the names settle out of a soft blur. Keyed
 * off html.hero-ready, which js/hero.js adds once the hero art has decoded (and an inline
 * <head> timer adds after 4s regardless — never-invisible).
 *
 * BODY (scroll, one-shot): js/reveal.js adds .tin to each text block as it rises into
 * view; blocks entering together get a --d batch stagger and each line trails the
 * previous by --ln-step. Hidden state is behind html.anim-ready (set only after the
 * observer exists), and arming is instant: the transition lives on the .tin state only.
 */
.tl { position: absolute; left: 0; width: 100%; pointer-events: none; }

/* gradient type (vertical for the script names/titles, horizontal DIVIDE sweep) */
/* background-IMAGE only: the `background` shorthand would reset background-clip:text */
.ln--g .gt--v { background-image: linear-gradient(180deg, var(--g1) 30%, var(--g2) 72%); }
/* horizontal sweep: the stops are sampled over the glyph extent, so the gradient spans
   the CONTENT box only; ink overhanging into the padding (script swashes) takes the
   line's median colour from background-color, which background-clip:text clips too */
.ln--g .gt--h {
  background-image: linear-gradient(90deg, var(--hg));
  background-color: var(--c);
  background-origin: content-box;   /* % size/position below = the content box */
  background-size: 100% 100%;
  background-position: 0 0;
  background-repeat: no-repeat;
}

/* calendar: embossed gold in the PSB -> gold gradient + soft emboss shadow */
.cal .ln {
  color: #f4dc9a;
  background: none;
  text-shadow: 0 0.035em 0 rgba(84, 22, 6, 0.75), 0 0 0.18em rgba(255, 214, 140, 0.28);
}
.cal .cal-head { color: #f5db94; }
.cal .cal-week { color: #f3d48d; }

/* ---- hero entrance ---------------------------------------------------------------- */
@keyframes rv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rv-name { from { opacity: 0; filter: blur(var(--name-blur)); } to { opacity: 1; filter: blur(0); } }
html.js:not(.hero-ready) [data-reveal="hero"] .ln,
html.js:not(.hero-ready) [data-reveal="name"] .ln { opacity: 0; }
html.js.hero-ready [data-reveal="hero"] .ln {
  animation: rv-fade var(--hero-text-dur) var(--reveal-ease) both;
  animation-delay: calc(var(--hero-delay) + var(--i) * 55ms);
}
html.js.hero-ready [data-block="mantras"] .ln { animation-delay: var(--hero-delay); }
html.js.hero-ready [data-reveal="name"] .ln {
  animation: rv-name 1600ms var(--reveal-ease) both;
  animation-delay: calc(var(--hero-delay) + 500ms);
}
html.js.hero-ready [data-block="name-bride"] .ln { animation-delay: calc(var(--hero-delay) + 1100ms); }

/* a single gold sheen travels across each name once it has settled (the gradient's own
   stops, slid sideways — no overlay element) */
@keyframes rv-sheen {
  from { background-position: 160% 0, 0 0; }
  to   { background-position: -60% 0, 0 0; }
}
.tb--name .gt--v {
  background-image:
    linear-gradient(100deg, transparent 40%, rgba(255, 249, 226, 0.85) 50%, transparent 60%),
    linear-gradient(180deg, var(--g1) 30%, var(--g2) 72%);
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 160% 0, 0 0;
}
html.js.hero-ready .tb--name .gt--v {
  animation: rv-sheen 1800ms cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: calc(var(--hero-delay) + 2300ms);
}
html.js.hero-ready [data-block="name-bride"] .gt--v { animation-delay: calc(var(--hero-delay) + 2700ms); }

/* ---- body blocks (one-shot cascade) ------------------------------------------------- */
html.js.anim-ready [data-reveal="text"]:not(.tin) .ln,
html.js.anim-ready [data-reveal="cal"]:not(.tin) .ln {
  opacity: 0;
  transform: translateY(var(--text-travel));
}
html.js.anim-ready [data-reveal="text"].tin .ln,
html.js.anim-ready [data-reveal="cal"].tin .ln {
  transition: opacity var(--reveal-dur) var(--reveal-ease), transform var(--reveal-dur) var(--reveal-ease);
  transition-delay: calc(var(--d, 0ms) + var(--i) * var(--ln-step));
}
/* script titles also settle out of a soft blur */
html.js.anim-ready .tb--title:not(.tin) .ln { filter: blur(var(--name-blur)); }
html.js.anim-ready .tb--title.tin .ln {
  transition: opacity 1100ms var(--reveal-ease), transform 1100ms var(--reveal-ease), filter 1100ms var(--reveal-ease);
}
/* calendar cells pop in row by row (build sets --i 0; js/reveal.js sets --ci per cell) */
html.js.anim-ready [data-reveal="cal"].tin .ln { transition-delay: calc(var(--d, 0ms) + var(--ci, 0) * 28ms); }

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] .ln, html.js .tb .ln { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .tb--name .gt--v { animation: none !important; }
}
@media print {
  [data-reveal] .ln { opacity: 1 !important; transform: none !important; filter: none !important; }
}
