/* Ram Setu: a Sunderkand path. Dusk over the sea in sindoor saffron; below, a cream page with sindoor ink.
   Gate (tap to chant राम; each chant lays a stone of the setu; eleven complete it, the sun climbs, the gate
   becomes the hero) -> a line of the Chalisa -> the invitation -> four stones of facts -> samay saarni
   -> path mandali -> the date under sindoor + countdown -> venue -> reply -> footer. */

:root {
  --sindoor: #e8590c;
  --sindoor-hi: #ff8a2a;
  --sindoor-lo: #b8380a;
  --rust: #7a2a0c;
  --cream: #fff4e0;
  --cream-2: #f9e6c4;
  --paper: #fffaf0;
  --stone: #d9c9a3;
  --stone-lo: #9c8a63;
  --ink: #3b1a08;
  --ink-soft: #6e4326;
  --sea: #0e4d64;
  --gold: #e8b04a;

  --f-display: "Eczar", Georgia, serif;
  --f-body: "Martel Sans", "Noto Sans Devanagari", system-ui, sans-serif;
  --f-hand: "Kalam", "Eczar", cursive;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sky-h: 62svh;

  --fx-bg: var(--paper);
  --fx-music-bg: var(--sindoor-lo);
  --fx-music-ring: var(--gold);
  --fx-music-ink: #fff1d6;
}

html { scroll-behavior: smooth; }
html.shut, html.shut body { overflow: hidden; }
body {
  background:
    radial-gradient(circle at 20% 10%, rgba(232, 89, 12, .05), transparent 40%),
    repeating-linear-gradient(0deg, rgba(122, 42, 12, .025) 0 1px, transparent 1px 4px),
    var(--cream);
  color: var(--ink);
  font: 400 18px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--sindoor); outline-offset: 3px; }
main, .foot { position: relative; z-index: 1; }

.tag { font: 600 20px/1.3 var(--f-display); color: var(--sindoor); letter-spacing: .02em; }
.head { text-align: center; margin-bottom: 26px; }
.head__title { margin: 2px 0 0; font: 700 clamp(30px, 8.6vw, 44px)/1.12 var(--f-display); color: var(--ink); text-wrap: balance; }
.head__sub { margin: 10px auto 0; max-width: 28em; color: var(--ink-soft); }

/* =================================================================== GATE */

.gate { position: relative; min-height: 100svh; overflow: hidden; background: #062a38; display: flex; flex-direction: column; }
.gate__scene { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--sky-h) + 30px); overflow: hidden; }
.sea { display: block; width: 100%; height: 100%; overflow: visible; }

.sun { transition: transform 2.4s var(--ease), filter 2.4s; }
.gate[data-phase="whole"] .sun, .sea--laid .sun { transform: translateY(-46px); filter: brightness(1.15); }
.waves path { animation: drift 7s linear infinite; }
.waves path:nth-child(2) { animation-duration: 9s; animation-direction: reverse; }
.waves path:nth-child(3) { animation-duration: 11s; }
@keyframes drift { to { transform: translateX(48px); } }
.dhwaja__cloth { transform-box: fill-box; transform-origin: 0 30%; animation: flap 2s ease-in-out infinite alternate; }
@keyframes flap { from { transform: skewY(-6deg) scaleX(.94); } to { transform: skewY(5deg) scaleX(1.05); } }
.dhwaja__ram { font: 700 9px var(--f-hand); fill: #fff6e0; }

/* the stones: a ripple marks each place; the next one pulses; a chant drops the stone in and it floats */
.slot__ripple { opacity: .35; transform-box: fill-box; transform-origin: center; }
.slot.next .slot__ripple { animation: ripple 1.6s ease-out infinite; opacity: .9; }
@keyframes ripple { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.slot.laid .slot__ripple { display: none; }
.stone { opacity: 0; transform: translateY(-150px) rotate(-20deg); }
.slot.laid .stone, .sea--laid .stone { opacity: 1; transform: none; animation: drop .8s cubic-bezier(.5, 0, .4, 1.4) both; }
.sea--laid .stone { animation: none; }
@keyframes drop {
  0% { opacity: 0; transform: translateY(-150px) rotate(-20deg); }
  20% { opacity: 1; }
  70% { transform: translateY(6px) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}
.stone__bob { animation: bob 3.2s ease-in-out infinite alternate; }
.slot:nth-child(odd) .stone__bob { animation-delay: -1.6s; }
@keyframes bob { from { transform: translateY(-1.5px); } to { transform: translateY(1.5px); } }
.stone__ram { font: 700 10.5px var(--f-hand); fill: #c2410c; }
.setu__glow { stroke-dasharray: 340; stroke-dashoffset: 340; opacity: 0; filter: drop-shadow(0 0 4px #ffd27a); }
.gate[data-phase="whole"] .setu__glow, .sea--laid .setu__glow { opacity: .85; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) .3s, opacity .4s .3s; }
.splash { position: absolute; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #d9f3f6; pointer-events: none; z-index: 3; }

.gate__jai {
  position: absolute; z-index: 2; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top)); text-align: center;
  font: 700 clamp(42px, 13vw, 72px)/1.2 var(--f-display); color: #fff1d6;
  opacity: calc(.4 + var(--n) * .055); text-shadow: 0 2px 4px rgba(90, 29, 10, .5), 0 2px 24px rgba(90, 29, 10, .7);
}
.gate[data-phase="whole"] .gate__jai { opacity: 1; animation: glow 3s ease-in-out .4s infinite alternate; }
@keyframes glow { from { text-shadow: 0 2px 4px rgba(90, 29, 10, .5), 0 0 12px rgba(255, 210, 122, .5); } to { text-shadow: 0 0 30px rgba(255, 230, 170, .95), 0 0 60px rgba(255, 140, 40, .5); } }

/* --- the panel below the sea --- */
.gate__panel {
  position: relative; z-index: 2; margin-top: var(--sky-h); flex: 1; min-height: calc(100svh - var(--sky-h));
  padding: 26px 16px calc(76px + env(safe-area-inset-bottom)); text-align: center;
  background: var(--cream); border-radius: 28px 28px 0 0;
  box-shadow: 0 -2px 0 var(--sindoor), 0 -6px 0 var(--gold), 0 -20px 40px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gate__ask { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gate__to { color: var(--sindoor); font-weight: 600; }
.gate__lead { max-width: 24em; color: var(--ink); line-height: 1.45; }
.gate__lead b { color: var(--sindoor-lo); }
.chant {
  position: relative; width: 92px; height: 92px; border-radius: 50%; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 40% 30%, var(--sindoor-hi), var(--sindoor) 55%, var(--sindoor-lo));
  border: 3px solid var(--gold); box-shadow: 0 10px 24px -8px rgba(122, 42, 12, .7), inset 0 2px 0 rgba(255, 230, 190, .5);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chant__ram { font: 700 34px/1 var(--f-hand); color: #fff6e0; display: block; margin-top: 6px; }
.chant::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--sindoor); opacity: 0; }
.chant.pulse::after { animation: halo .7s ease-out; }
.chant.pulse { animation: press .3s ease; }
@keyframes halo { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes press { 50% { transform: scale(.93); } }
.gate[data-phase="idle"] .chant { animation: beckon 2.6s ease-in-out 1s infinite; }
@keyframes beckon { 0%, 100% { box-shadow: 0 10px 24px -8px rgba(122, 42, 12, .7), 0 0 0 0 rgba(232, 89, 12, .4); } 50% { box-shadow: 0 10px 24px -8px rgba(122, 42, 12, .7), 0 0 0 16px rgba(232, 89, 12, 0); } }
.chant__hint { font-size: 15px; color: var(--ink-soft); }
.chant__count { display: none; }
.gate:not([data-phase="idle"]) .chant__idle { display: none; }
.gate:not([data-phase="idle"]) .chant__count { display: inline; }
.chant__count b { color: var(--sindoor); font-size: 1.2em; }
.gate[data-phase="whole"] .gate__ask { opacity: .4; pointer-events: none; transition: opacity .5s; }

.gate__skip {
  position: absolute; z-index: 5; right: 12px; top: calc(var(--sky-h) - 56px);
  min-width: 64px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: rgba(6, 42, 56, .5); border: 1px solid rgba(255, 241, 214, .35); color: #fff1d6; font: 600 14px/1 var(--f-body); letter-spacing: .06em;
}

.hero { display: none; }
.gate.open :is(.gate__ask, .gate__skip) { display: none; }
.gate.open .hero { display: block; animation: rise 1s var(--ease) both; }
.gate.instant .hero { animation: none; }
@keyframes rise { from { opacity: 0; translate: 0 14px; } }
.hero__hi { font: 600 clamp(22px, 6.4vw, 30px)/1.3 var(--f-display); color: var(--sindoor); }
.hero__title { margin: 0; font: 700 clamp(36px, 10.6vw, 56px)/1.05 var(--f-display); color: var(--ink); text-wrap: balance; }
.hero__by { margin-top: 8px; color: var(--ink-soft); }
.hero__by b { color: var(--sindoor-lo); }
.hero__when { margin-top: 8px; font-weight: 600; }
.hero__when b { color: var(--sindoor); }
.hero__down { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; }
.hero__down::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--sindoor); border-bottom: 2px solid var(--sindoor); rotate: 45deg; translate: 0 -3px; }

html:not(.js) .gate { --n: 11; }
html:not(.js) .stone { opacity: 1; transform: none; }
html:not(.js) :is(.gate__ask, .gate__skip) { display: none; }
html:not(.js) .hero { display: block; }

/* =================================================================== SECTIONS */

.sec { max-width: 560px; margin: 0 auto; padding: 64px 16px 0; }

/* --- the Chalisa --- */
.verse { margin: 0; text-align: center; }
.verse blockquote { margin: 0; font: 600 clamp(24px, 7vw, 32px)/1.6 var(--f-display); color: var(--sindoor-lo); }
.verse blockquote p + p { margin-top: 2px; }
.verse figcaption { margin: 14px auto 0; max-width: 26em; font-size: 16px; font-style: italic; color: var(--ink-soft); }
.verse cite { display: block; margin-top: 6px; font-style: normal; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--sindoor); }

/* --- the invitation --- */
.patra__card {
  position: relative; padding: 30px 22px 28px; text-align: center; background: var(--paper);
  border: 2px solid var(--sindoor); outline: 1.5px solid var(--gold); outline-offset: -9px; border-radius: 4px;
  box-shadow: 0 24px 50px -28px rgba(122, 42, 12, .6);
}
.patra__card::before, .patra__card::after { content: ""; position: absolute; left: 50%; width: 46px; height: 46px; margin-left: -23px; background: var(--paper); border: 2px solid var(--sindoor); rotate: 45deg; }
.patra__card::before { top: -24px; }
.patra__card::after { bottom: -24px; }
.patra__kripa { margin-top: 8px; font-size: 16px; color: var(--ink-soft); }
.patra__msg { margin: 14px auto 0; max-width: 26em; font-size: 19px; }
.patra__hi { margin-top: 14px; font: 600 21px/1.4 var(--f-display); color: var(--sindoor); }
.patra__sign { margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(232, 89, 12, .45); }
.patra__from { font-size: 15px; color: var(--ink-soft); }
.patra__names { font: 700 clamp(20px, 6vw, 25px)/1.3 var(--f-display); text-wrap: balance; }
.patra__family { margin-top: 2px; font-weight: 700; color: var(--sindoor-lo); }

/* --- facts on stones --- */
.shila__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rock {
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 118px; padding: 18px 12px;
  background: radial-gradient(circle at 35% 25%, #f6ecd4, var(--stone) 60%, var(--stone-lo));
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; rotate: var(--r);
  box-shadow: inset -6px -8px 14px rgba(80, 60, 30, .25), 0 12px 20px -12px rgba(59, 26, 8, .6);
}
.rock:nth-child(even) { border-radius: 56% 44% 52% 48% / 44% 56% 46% 54%; }
.rock__k { font-size: 13px; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.rock__v { margin-top: 4px; font: 700 23px/1.15 var(--f-display); color: var(--sindoor-lo); }
.rock__v--sm { font-size: 19px; }
.rock--feast { background: radial-gradient(circle at 35% 25%, var(--sindoor-hi), var(--sindoor) 60%, var(--sindoor-lo)); }
.rock--feast .rock__k { color: #fff1d6; }
.rock--feast .rock__v { color: #fff; }

/* --- samay saarni --- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid rgba(59, 26, 8, .2); }
.row__time b { display: block; font: 700 22px/1.1 var(--f-display); color: var(--sindoor); }
.row__time span { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.row__name { margin: 0; font: 700 22px/1.2 var(--f-display); }
.row__hi { font: 600 18px/1.3 var(--f-display); color: var(--sindoor-lo); }
.row__date { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.row__note { margin-top: 6px; }
.row__where { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.row__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row--feast { background: linear-gradient(90deg, rgba(232, 89, 12, .12), transparent); }
.lnk { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid rgba(232, 89, 12, .5); font: 600 14px/1 var(--f-body); text-decoration: none; color: var(--ink); }
.lnk--solid { background: var(--sindoor); border-color: var(--sindoor); color: #fff; }

/* --- mandali --- */
.reader { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: var(--paper); border: 1.5px solid rgba(232, 89, 12, .35); }
.reader + .reader { margin-top: 12px; }
.reader__gada { flex: none; width: 54px; height: 72px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(180deg, var(--sindoor), var(--sindoor-lo)); }
.reader__gada svg { width: 30px; height: 62px; }
.reader__name { margin: 0; font: 700 21px/1.25 var(--f-display); }
.reader__role { color: var(--sindoor-lo); font-size: 16px; font-weight: 600; }
.reader__from { color: var(--ink-soft); font-size: 15px; }

/* --- tithi: the scratch --- */
.tithi .scratch { max-width: 360px; margin: 0 auto; border-radius: 18px; color: var(--ink); --fx-bg: var(--cream); }
.sd { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 150px; padding: 18px; border-radius: 18px; background: var(--paper); border: 2px dashed rgba(232, 89, 12, .5); }
.sd__day { font: 700 84px/1 var(--f-display); color: var(--sindoor); }
.sd__meta { display: flex; flex-direction: column; text-align: left; }
.sd__meta b { font: 700 24px/1.2 var(--f-display); }
.sd__meta span { color: var(--ink-soft); font-size: 16px; }
.scratch__hint { margin-top: 18px; text-align: center; font-size: 15px; color: var(--ink-soft); }
.tithi.revealed .scratch__hint { visibility: hidden; }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.count span { display: flex; flex-direction: column; align-items: center; padding: 12px 2px 8px; border-radius: 14px; background: var(--paper); border: 1.5px solid rgba(232, 89, 12, .35); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.count b { font: 700 clamp(28px, 8vw, 38px)/1.1 var(--f-display); color: var(--sindoor-lo); letter-spacing: 0; }
.count__done { margin-top: 16px; text-align: center; font: 700 24px/1.3 var(--f-display); color: var(--sindoor); }

/* --- venue --- */
.sthan__card { text-align: center; padding: 30px 20px; border-radius: 20px; color: #fff4e0; background: linear-gradient(180deg, var(--sea), #062a38); box-shadow: 0 20px 40px -20px rgba(6, 42, 56, .8); }
.sthan__card .tag { color: var(--sindoor-hi); }
.sthan__card .head__title { color: #fff4e0; }
.sthan__addr { margin: 8px auto 20px; max-width: 22em; color: #d7ecef; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border-radius: 999px; font: 700 17px/1 var(--f-body); text-decoration: none; }
.btn--sindoor { background: linear-gradient(180deg, var(--sindoor-hi), var(--sindoor)); color: #fff; border: 2px solid var(--gold); box-shadow: 0 12px 26px -12px rgba(122, 42, 12, .8); }

/* --- reply --- */
.reply { text-align: center; }
.reply__jai { font: 700 clamp(38px, 11vw, 56px)/1.2 var(--f-display); color: var(--sindoor); }
.reply .btn { margin-top: 22px; }
.reply__share { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 10px; color: var(--ink-soft); font-size: 16px; text-underline-offset: 4px; }

/* --- footer --- */
.foot { max-width: 560px; margin: 60px auto 0; padding: 28px 16px calc(84px + env(safe-area-inset-bottom)); text-align: center; border-top: 2px solid var(--sindoor); }
.foot__jai { font: 700 28px/1.3 var(--f-display); color: var(--sindoor); }
.foot__hosts { font: 700 21px/1.3 var(--f-display); }
.foot__date { color: var(--ink-soft); font-size: 16px; }
.foot__music, .foot__credit { margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
.foot__music + .foot__credit { margin-top: 4px; }
.foot__up { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; color: var(--sindoor-lo); font-size: 15px; }

@media (min-width: 900px) {
  :root { --sky-h: 64svh; }
  .gate__panel { max-width: 640px; width: 100%; margin-left: auto; margin-right: auto; }
  .sec { padding-top: 88px; }
}
@media (max-height: 700px) { :root { --sky-h: 56svh; } .chant { width: 76px; height: 76px; } .chant__ram { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) {
  .slot.laid .stone { opacity: 1; transform: none; }
}

/* =================================================================== OG CARD */
.ogcard { background: linear-gradient(180deg, #c2410c, #062a38 70%); font-family: var(--f-body); color: var(--ink); }
.og__scene { position: absolute; left: 380px; right: -40px; top: 0; bottom: 0; }
.og__scene .sea { width: 100%; height: 100%; }
.og__text {
  position: absolute; left: 44px; top: 44px; bottom: 44px; width: 560px; z-index: 2; padding: 30px 40px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--cream); border-radius: 32px; box-shadow: 0 0 0 4px var(--sindoor), 0 0 0 9px var(--gold), 0 30px 60px rgba(0, 0, 0, .5);
}
.og__jai { font: 700 64px/1.15 var(--f-display); color: var(--sindoor); }
.og__title { font: 700 70px/1.02 var(--f-display); color: var(--ink); }
.og__hosts { margin-top: 12px; font: 700 36px/1.2 var(--f-body); color: var(--sindoor-lo); }
.og__when { margin-top: 10px; font: 600 31px/1.3 var(--f-body); color: var(--ink); }
.og__feast { margin-top: 12px; align-self: flex-start; padding: 4px 22px; border-radius: 999px; background: var(--sindoor); color: #fff; font: 700 27px/1.3 var(--f-body); }
