/* Samidha: a North Indian janeu in saffron and fire.
   Hero (dawn; drag up from the havan kund to raise the flames, --f 0..1; the sky warms, the mantra writes
   itself line by line, the name glows) -> nimantran on saffron paper -> muhurat and countdown by firelight ->
   karyakram with a flame for each rite -> the family (darshanabhilashi) -> three ahutis and the reply -> footer. */

:root {
  --night: #1a0703;
  --night-2: #2c0d05;
  --bhagwa: #e8650a;
  --saffron: #ff8a00;
  --flame: #ffd23f;
  --ember: #ff4d00;
  --maroon: #7a1405;
  --maroon-deep: #4a0a02;
  --copper: #c9773a;
  --paper: #fff3dd;
  --paper-2: #fbe3b8;
  --ink: #3a1206;
  --ink-soft: #6e3b22;

  --f-display: "Eczar", Georgia, serif;
  --f-body: "Lora", Georgia, serif;
  --f-sa: "Tiro Devanagari Sanskrit", serif;
  --f-hi: "Tiro Devanagari Hindi", serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --col: min(100% - 32px, 560px);

  --fx-bg: var(--paper);
  --fx-music-bg: var(--maroon);
  --fx-music-ring: var(--saffron);
  --fx-music-ink: var(--flame);

  /* saffron paper, with a faint chakra of rays */
  --rays: repeating-conic-gradient(from 0deg at 50% 0%, rgba(232, 101, 10, .05) 0 4deg, transparent 4deg 12deg);
}

html { scroll-behavior: smooth; }
html.shut { overflow: hidden; }
body { background: var(--night); color: var(--ink); font: 400 18px/1.65 var(--f-body); }
a { color: inherit; }
[lang="sa"] { font-family: var(--f-sa); }
[lang="hi"] { font-family: var(--f-hi); }

/* =================================================================== HERO: the havan */
.hero {
  --f: 0;
  position: relative; min-height: 100svh; overflow: hidden; color: var(--paper);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; justify-items: center; text-align: center;
  padding: calc(env(safe-area-inset-top) + 22px) 16px calc(env(safe-area-inset-bottom) + 10px);
  background: radial-gradient(120% 70% at 50% 100%, #3a1206, var(--night) 60%, #0d0301);
}
.hero__sky {     /* dawn, warming with the fire */
  position: absolute; inset: 0; pointer-events: none; opacity: var(--f);
  background:
    radial-gradient(90% 55% at 50% 80%, rgba(255, 170, 40, .55), transparent 70%),
    radial-gradient(140% 80% at 50% 100%, #b8420a, #6e1a04 45%, #2c0d05 80%);
}
.hero > :not(.hero__sky) { position: relative; z-index: 1; }
.hero__to { font: 600 14px/1.4 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--flame); }
.hero__om { font-size: 20px; color: var(--saffron); opacity: calc(.45 + var(--f) * .55); }
.hero__local { margin-top: 2px; font-size: clamp(30px, 9vw, 44px); line-height: 1.3; color: var(--flame); text-shadow: 0 0 calc(var(--f) * 24px) rgba(255, 140, 0, .8); }
.hero__cer { font: 600 15px/1.4 var(--f-display); letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 243, 221, .8); }
.hero__name {
  margin: 6px 0 0; font: 700 clamp(30px, 9vw, 46px)/1.1 var(--f-display); overflow-wrap: anywhere;
  color: var(--paper); opacity: calc(.25 + var(--f) * .75); transition: text-shadow 1s;
}
.hero__of { display: block; font: italic 400 17px/1.4 var(--f-body); color: rgba(255, 243, 221, .75); }
.hero[data-phase="lit"] .hero__name { text-shadow: 0 0 28px rgba(255, 150, 20, .55); }

.verse { margin: 0; align-self: center; padding: 10px 0; display: grid; gap: 2px; }
.verse__line {
  font-size: clamp(21px, 6vw, 30px); line-height: 1.5; color: var(--flame);
  clip-path: inset(0 100% 0 0); opacity: 0;
  transition: clip-path 1.3s cubic-bezier(.4, 0, .2, 1) calc(var(--l) * .75s + .3s), opacity .4s ease calc(var(--l) * .75s + .3s);
  text-shadow: 0 0 18px rgba(255, 120, 0, .5);
}
.verse__en { margin-top: 10px; max-width: 30em; font: italic 400 16px/1.5 var(--f-body); color: rgba(255, 243, 221, .85); opacity: 0; transition: opacity 1s ease 3.6s; }
.hero[data-phase="lit"] .verse__line { clip-path: inset(0); opacity: 1; }
.hero[data-phase="lit"] .verse__en { opacity: 1; }
html:not(.js) .verse__line, html:not(.js) .verse__en { clip-path: none; opacity: 1; }

.hero__fire { position: relative; width: min(100%, 360px); }
.kund { display: block; width: 100%; height: auto; max-height: 40svh; margin: 0 auto; overflow: visible; }
.hero .fire { transform-origin: 150px 192px; transform: scale(calc(.3 + var(--f) * .7), max(.09, var(--f))); }
.kund__glow { opacity: calc(.15 + var(--f) * .85); }
.ember { animation: glowEmber 1.6s ease-in-out infinite alternate; }
@keyframes glowEmber { from { opacity: .45; } to { opacity: 1; } }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.1s ease-in-out infinite alternate; }
.flame--2 { animation-duration: .8s; animation-delay: -.3s; }
.flame--3 { animation-duration: .6s; animation-delay: -.2s; }
@keyframes flicker { 0% { transform: scale(1, 1) skewX(0); } 35% { transform: scale(.96, 1.06) skewX(2deg); } 70% { transform: scale(1.03, .95) skewX(-2deg); } 100% { transform: scale(.98, 1.04) skewX(1deg); } }
.fire { filter: drop-shadow(0 0 12px rgba(255, 120, 0, .7)); }
.embers { position: absolute; left: 50%; top: 55%; width: 0; height: 0; pointer-events: none; }
.spark { position: absolute; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 6px 2px rgba(255, 120, 0, .8); }
.hero__light {
  position: absolute; inset: -20px -10px 0; border: 0; padding: 0; background: none; cursor: grab;
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.hero__light:focus-visible { outline: 2px dashed var(--saffron); outline-offset: -10px; border-radius: 24px; }
html:not(.shut) .hero__light, html:not(.shut) .hero__skip { display: none; }
.hero__hint { min-height: 52px; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; font: italic 400 18px/1.4 var(--f-body); }
.hero__hint > * { grid-area: 1 / 1; transition: opacity .4s; opacity: 0; pointer-events: none; }
.hero[data-phase="idle"] .hint--idle, .hero[data-phase="lighting"] .hint--busy { opacity: 1; }
.hero[data-phase="lit"] .hint--done { opacity: 1; pointer-events: auto; }
.hint--done {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 14px/1 var(--f-display); font-style: normal;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--flame);
}
.hint--done::after { content: ""; width: 9px; height: 9px; border-right: 2px solid; border-bottom: 2px solid; rotate: 45deg; translate: 0 -3px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 2px; } }
.hero.nudge .hint--idle { animation: nudge .5s ease; }
@keyframes nudge { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
.hero__skip {
  position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 12px); z-index: 3; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255, 210, 63, .45); background: rgba(26, 7, 3, .5); color: var(--paper);
  font: 600 13px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.hero__skip:focus-visible, .hint--done:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }

/* =================================================================== SECTIONS */
.sec { position: relative; padding: 68px 0; }
.sec > * { width: var(--col); margin-left: auto; margin-right: auto; }
.kicker { font: 600 13px/1.5 var(--f-display); letter-spacing: .16em; text-transform: uppercase; text-align: center; color: var(--bhagwa); }
.kicker [lang] { font-size: 18px; letter-spacing: 0; text-transform: none; }
.sec__title { margin: 6px auto 22px; font: 700 clamp(30px, 8.5vw, 42px)/1.15 var(--f-display); text-align: center; color: var(--maroon); }

.sec--nimantran, .sec--karyakram { background: var(--rays), linear-gradient(180deg, var(--paper), var(--paper-2)); }
.sec--nimantran { text-align: center; }
.msg { font: italic 400 20px/1.65 var(--f-body); }
.hosts { margin-top: 26px; padding: 22px 16px; border-radius: 4px; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(232, 101, 10, .35), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(232, 101, 10, .35); }
.hosts__role { font: 600 12px/1.6 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--bhagwa); }
.hosts__role [lang] { font-size: 16px; letter-spacing: 0; }
.hosts__names { font: 600 21px/1.45 var(--f-body); color: var(--maroon); margin-bottom: 12px; }
.hosts__names--elders { margin-bottom: 0; font-weight: 500; }

.sec--muhurat { text-align: center; color: var(--paper); background: radial-gradient(80% 60% at 50% 100%, rgba(255, 120, 0, .45), transparent 70%), linear-gradient(180deg, var(--night-2), var(--night)); }
.sec--muhurat .kicker { color: var(--flame); }
.muhurat { margin-top: 10px; }
.muhurat__day { font: 600 15px/1.5 var(--f-display); letter-spacing: .2em; text-transform: uppercase; }
.muhurat__date { font: 600 24px/1.2 var(--f-display); }
.muhurat__date b { display: block; font-size: clamp(90px, 28vw, 130px); line-height: 1; color: var(--saffron); text-shadow: 0 0 30px rgba(255, 100, 0, .5); }
.muhurat__time { display: inline-block; margin-top: 12px; padding: 6px 22px; border: 1.5px solid var(--saffron); border-radius: 999px; font: 700 26px/1.2 var(--f-display); color: var(--flame); }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 30px; }
.count span { padding: 14px 2px 10px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, rgba(255, 138, 0, .2), rgba(255, 138, 0, .05)); box-shadow: inset 0 0 0 1px rgba(255, 138, 0, .45); font: 600 12px/1.3 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 243, 221, .85); }
.count b { font: 700 clamp(28px, 8.5vw, 40px)/1.1 var(--f-display); color: var(--flame); letter-spacing: 0; }
.count__done { margin-top: 16px; font: 700 26px/1.3 var(--f-display); color: var(--flame); }

.karya { list-style: none; padding: 0 0 0 34px; margin-top: 0; position: relative; }
.karya::before { content: ""; position: absolute; left: 12px; top: 10px; bottom: 30px; width: 2px; background: linear-gradient(var(--saffron), var(--maroon)); opacity: .6; }
.ev { position: relative; padding: 0 0 30px; }
.ev__flame {
  position: absolute; left: -34px; top: 2px; width: 26px; height: 34px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(60% 60% at 50% 70%, #fff6c8, var(--flame) 35%, var(--saffron) 65%, var(--ember));
  clip-path: path("M13 0C17 9 26 14 26 22a13 12 0 0 1-26 0C0 14 9 9 13 0Z");
  filter: drop-shadow(0 0 6px rgba(255, 120, 0, .6)); animation: tip 1.4s ease-in-out infinite alternate; transform-origin: 50% 100%;
}
@keyframes tip { to { transform: scale(.94, 1.08) skewX(3deg); } }
.ev__hi { font-size: 18px; color: var(--bhagwa); line-height: 1.3; }
.ev__name { margin: 0; font: 700 26px/1.2 var(--f-display); color: var(--maroon); }
.ev--main .ev__name { color: var(--bhagwa); }
.ev__when { font-weight: 600; font-size: 16px; }
.ev__where { font-size: 16px; color: var(--ink-soft); }
.ev__note { margin-top: 4px; font-style: italic; font-size: 16px; }
.ev__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--maroon);
  color: var(--maroon); text-decoration: none; font: 600 13px/1 var(--f-display); letter-spacing: .06em;
}
.btn--solid { background: var(--maroon); color: var(--flame); }
.btn:focus-visible, .reply:focus-visible, .up:focus-visible, .ahuti:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }

.sec--family { background: linear-gradient(160deg, var(--saffron), var(--bhagwa) 60%, #c4500a); color: #fff; }
.sec--family .kicker { color: var(--paper); }
.sec--family .sec__title { color: #fff; }
.fam { margin: 0; display: grid; gap: 10px; text-align: center; }
.fam div { padding: 14px 12px; border-radius: 6px; background: rgba(74, 10, 2, .22); }
.fam dt { font: 600 12px/1.6 var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: var(--paper-2); }
.fam dd { margin: 0; font: 600 20px/1.45 var(--f-body); }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }

/* ---------- ahuti ---------- */
.sec--ahuti { text-align: center; color: var(--paper); background: radial-gradient(90% 60% at 50% 55%, #3a1206, var(--night) 70%); }
.sec--ahuti .sec__title { color: var(--flame); }
.sec--ahuti .kicker { color: var(--saffron); }
.ahuti__ask { margin-top: -8px; font-style: italic; color: rgba(255, 243, 221, .85); }
.ahuti { --f: .55; position: relative; display: block; width: min(80%, 300px); margin: 18px auto 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ahuti .fire { transform-origin: 150px 192px; transform: scale(calc(.3 + var(--f) * .7), var(--f)); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.ahuti.flare { --f: 1; }
.ahuti .kund { max-height: none; }
.ahuti__count { display: block; min-height: 24px; font: 600 13px/1.6 var(--f-display); letter-spacing: .18em; text-transform: uppercase; color: var(--flame); }
.svaha { position: fixed; z-index: 80; pointer-events: none; font: 400 26px/1 var(--f-sa); color: var(--flame); text-shadow: 0 0 12px rgba(255, 120, 0, .9); }
.ahuti__done { margin-top: 8px; font: 600 20px/1.4 var(--f-display); color: var(--paper); }
.ahuti__done span { display: block; font: 400 34px/1.3 var(--f-sa); color: var(--flame); }
.reply {
  display: flex; width: fit-content; align-items: center; min-height: 54px; margin: 22px auto 0; padding: 0 28px; border-radius: 999px;
  background: linear-gradient(180deg, var(--saffron), var(--bhagwa)); color: #fff; text-decoration: none;
  font: 700 16px/1 var(--f-display); letter-spacing: .08em; box-shadow: 0 0 30px rgba(255, 120, 0, .45), 0 5px 0 var(--maroon);
}
.sec--ahuti > .reply { width: fit-content; }
.reply:active { translate: 0 3px; box-shadow: 0 2px 0 var(--maroon); }
.ahuti__who { margin-top: 12px; font-size: 15px; color: rgba(255, 243, 221, .75); }
.tag { margin-top: 14px; font: 700 22px/1.3 var(--f-display); color: var(--flame); }

/* =================================================================== FOOTER */
.foot { text-align: center; padding: 34px 16px max(92px, calc(env(safe-area-inset-bottom) + 92px)); background: #0d0301; color: var(--paper); border-top: 1px solid rgba(255, 138, 0, .3); }
.foot__local { font-size: 28px; color: var(--saffron); }
.foot__name { font: 700 34px/1.2 var(--f-display); }
.foot__date { font: 600 14px/1.6 var(--f-display); letter-spacing: .3em; color: var(--flame); }
.foot__cal { margin-top: 10px; font-size: 15px; }
.foot__cal a { display: inline-block; padding: 10px 2px; }
.foot__music, .foot__credit { margin-top: 6px; font-size: 13px; color: rgba(255, 243, 221, .65); }
.up { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; }

@media (max-height: 800px) and (max-width: 899px) {
  .hero { padding-top: calc(env(safe-area-inset-top) + 12px); }
  .hero__local { font-size: 28px; }
  .hero__name { font-size: 27px; }
  .hero__of { font-size: 15px; }
  .verse__line { font-size: 19px; line-height: 1.4; }
  .verse__en { margin-top: 6px; font-size: 14px; }
  .kund { max-height: 31svh; }
  .hero__hint { min-height: 44px; font-size: 16px; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 40px; padding-left: max(40px, 8vw); padding-right: max(40px, 8vw); }
  .hero__top { grid-column: 1 / -1; }
  .verse { grid-column: 1; grid-row: 2; justify-self: end; text-align: right; }
  .hero__fire { grid-column: 2; grid-row: 2; align-self: center; justify-self: start; }
  .hero__hint { grid-column: 1 / -1; }
  .karya { width: min(100% - 64px, 640px); }
}

/* =================================================================== LINK PREVIEW */
.ogcard { background: radial-gradient(70% 90% at 25% 90%, #b8420a, #6e1a04 45%, var(--night) 85%); color: var(--paper); }
.og__fire { position: absolute; left: 30px; bottom: -10px; width: 470px; }
.og__fire .kund { max-height: none; }
.og__fire .fire { transform-origin: 150px 192px; transform: scale(1.1, 1.25); }
.og__text { position: absolute; left: 500px; right: 50px; top: 40px; bottom: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.og__verse { font-size: 28px; line-height: 1.45; color: var(--flame); }
.og__local { margin-top: 10px; font-size: 54px; line-height: 1.3; color: var(--saffron); }
.og__cer { font: 600 30px/1.2 var(--f-display); }
.og__name { font: 700 92px/1.05 var(--f-display); color: #fff; text-shadow: 0 0 30px rgba(255, 140, 0, .6); }
.og__date { margin-top: 10px; font: 600 28px/1.3 var(--f-body); color: var(--flame); }
.og__venue { font-size: 21px; color: rgba(255, 243, 221, .85); }

/* keep the hint clear of the fixed music button (48px, bottom-right) */
.hero__hint { padding-inline: 64px; }
.hero__hint .hint--done { white-space: nowrap; }
