/* Shankh: a Satyanarayan katha at home. Morning light on a fresh banana leaf; turmeric, kumkum, brass, ivory.
   Gate (hold to blow the shankh: it lifts, rings of sound spread, the diyas brighten; at full breath the bells
   ring and flowers fall; the gate becomes the hero) -> five adhyay, each a little scroll: the invitation,
   the order of the puja, the panchamrit (add its five things), the date and countdown, the way home + reply.
   --k (0..1) is the breath in the shankh. */

:root {
  --leaf: #2f7d2a;
  --leaf-hi: #5fae3e;
  --leaf-lo: #1d5a1a;
  --leaf-pale: #e9f3dc;
  --haldi: #f2b705;
  --kumkum: #c81e3a;
  --brass: #c8902c;
  --ivory: #fffbef;
  --paper: #fff8e6;
  --ink: #2a2010;
  --ink-soft: #5e4a2a;
  --wood: #6b4220;

  --f-deva: "Sahitya", "Kurale", serif;
  --f-display: "Kurale", Georgia, serif;
  --f-body: "Yantramanav", "Noto Sans Devanagari", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --fx-bg: var(--paper);
  --fx-music-bg: var(--leaf-lo);
  --fx-music-ring: var(--haldi);
  --fx-music-ink: #fff3c4;

  --veins: repeating-linear-gradient(100deg, transparent 0 22px, rgba(220, 255, 190, .12) 22px 23.5px);
}

html { scroll-behavior: smooth; }
html.shut, html.shut body { overflow: hidden; }
body {
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(255, 240, 180, .55), transparent 60%),
    repeating-linear-gradient(98deg, transparent 0 26px, rgba(47, 125, 42, .05) 26px 27px),
    var(--leaf-pale);
  color: var(--ink);
  font: 400 19px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--kumkum); outline-offset: 3px; }
main, .foot { position: relative; z-index: 1; }

/* =================================================================== GATE: the leaf */

.gate { position: relative; min-height: 100svh; overflow: hidden; background: radial-gradient(100% 70% at 50% 40%, #7a4c26, var(--wood) 60%, #3e2410); }
.leaf {
  position: absolute; left: -28%; right: -28%; top: 3%; bottom: 14%;
  border-radius: 50% 50% 46% 46% / 14% 14% 10% 10%;
  background:
    linear-gradient(90deg, transparent calc(50% - 4px), #b9d98a calc(50% - 2px), #e6f2c4 50%, #a9cf78 calc(50% + 2px), transparent calc(50% + 4px)),
    var(--veins),
    radial-gradient(70% 60% at 50% 45%, var(--leaf-hi), var(--leaf) 55%, var(--leaf-lo));
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45), inset 0 0 60px rgba(0, 40, 0, .35);
}
.leaf::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(80deg, transparent 0 22px, rgba(220, 255, 190, .1) 22px 23.5px); -webkit-mask: linear-gradient(90deg, #000 50%, transparent 50%); mask: linear-gradient(90deg, #000 50%, transparent 50%); }

.gate__in {
  position: relative; z-index: 2; min-height: 100svh; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(76px + env(safe-area-inset-bottom));
}
.gate__jai {
  font: 700 clamp(32px, 9.6vw, 52px)/1.3 var(--f-deva); color: #fff6d0;
  text-shadow: 0 2px 10px rgba(0, 40, 0, .6); opacity: calc(.55 + var(--k) * .45);
}
.gate[data-phase="blown"] .gate__jai { animation: glow 3s ease-in-out .3s infinite alternate; opacity: 1; }
@keyframes glow { from { text-shadow: 0 2px 10px rgba(0, 40, 0, .6), 0 0 10px rgba(255, 230, 140, .4); } to { text-shadow: 0 2px 10px rgba(0, 40, 0, .6), 0 0 30px rgba(255, 240, 170, .95); } }

.gate__puja { position: relative; width: min(96vw, 460px); aspect-ratio: 400 / 300; margin: auto 0; }
.puja { display: block; width: 100%; height: 100%; overflow: visible; }
.diya__flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1.2s ease-in-out infinite alternate; }
.diya:nth-child(even) .diya__flame { animation-delay: -.6s; }
@keyframes flick { from { transform: scale(.94, 1.04) skewX(2deg); } to { transform: scale(1.04, .95) skewX(-2deg); } }
.diya__glow { opacity: calc(.5 + var(--k) * .5); transform-box: fill-box; transform-origin: center; transform: scale(calc(1 + var(--k) * .6)); }

/* --- the shankh: lifts and turns towards you as you blow --- */
.conch {
  position: absolute; left: 50%; top: 46%; width: 48%; aspect-ratio: 220 / 130; margin: 0 0 0 -24%;
  transform: translateY(calc(var(--k) * -18%)) rotate(calc(var(--k) * -12deg)) scale(calc(1 + var(--k) * .22));
  filter: drop-shadow(0 calc(4px + var(--k) * 16px) calc(6px + var(--k) * 10px) rgba(0, 30, 0, .45));
  cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.shankh__svg { display: block; width: 100%; height: 100%; }
.gate[data-phase="blowing"] .shankh__svg { animation: tremble .09s linear infinite alternate; }
@keyframes tremble { to { transform: translate(.6px, -.4px); } }
.rings { position: absolute; right: -6%; top: 52%; width: 0; height: 0; pointer-events: none; }
.rings i {
  position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid rgba(255, 246, 208, .9); opacity: 0;
  -webkit-mask: linear-gradient(90deg, transparent 45%, #000 60%); mask: linear-gradient(90deg, transparent 45%, #000 60%);
}
.gate[data-phase="blowing"] .rings i, .gate[data-phase="blown"] .rings i { animation: ring 1.4s ease-out infinite; }
.rings i:nth-child(2) { animation-delay: .45s !important; }
.rings i:nth-child(3) { animation-delay: .9s !important; }
@keyframes ring { 0% { opacity: calc(.3 + var(--k) * .7); transform: scale(.4); } 100% { opacity: 0; transform: scale(calc(1.6 + var(--k) * 2)); } }

/* --- before: the ask --- */
.gate__ask {
  margin-top: auto; width: 100%; padding: 18px 16px 4px; border-radius: 22px;
  background: rgba(255, 251, 239, .94); box-shadow: 0 0 0 2px var(--haldi), 0 18px 40px -16px rgba(0, 0, 0, .6);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.gate__to { color: var(--kumkum); font-weight: 700; }
.gate__lead { color: var(--ink); line-height: 1.4; }
.gate__lead b { color: var(--leaf-lo); }
.blow {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 340px; min-height: 56px; margin-bottom: 12px;
  border-radius: 999px; cursor: pointer; border: 2px solid var(--leaf-lo); color: #fff; font: 700 17px/1 var(--f-body);
  background: var(--leaf); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
.blow__meter { position: absolute; inset: 0; z-index: 0; }
.blow__meter i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--k)); background: linear-gradient(90deg, var(--haldi), #ffd84a); }
.blow > span:not(.blow__meter) { position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.blow__busy { display: none; }
.gate[data-phase="blowing"] .blow__idle { display: none; }
.gate[data-phase="blowing"] .blow__busy { display: inline; }
.gate[data-phase="idle"] .conch { animation: invite 3s ease-in-out 1.2s infinite; }
@keyframes invite { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.gate[data-phase="blown"] .gate__ask { opacity: 0; transition: opacity .6s; }

.gate__skip {
  position: absolute; z-index: 5; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  min-width: 64px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: rgba(29, 90, 26, .55); border: 1px solid rgba(255, 246, 208, .4); color: #fff6d0; font: 700 14px/1 var(--f-body); letter-spacing: .06em;
}

/* --- after: the hero --- */
.hero { display: none; margin-top: auto; width: 100%; padding: 22px 16px 18px; border-radius: 22px; background: rgba(255, 251, 239, .96); box-shadow: 0 0 0 2px var(--haldi), 0 0 0 6px rgba(255, 251, 239, .4), 0 18px 40px -16px rgba(0, 0, 0, .6); }
.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 16px; } }
.hero__hi { font: 700 clamp(22px, 6.4vw, 28px)/1.3 var(--f-deva); color: var(--kumkum); }
.hero__title { margin: 0; font: 400 clamp(32px, 9.4vw, 46px)/1.1 var(--f-display); color: var(--leaf-lo); text-wrap: balance; }
.hero__by { margin-top: 6px; color: var(--ink-soft); }
.hero__by b { color: var(--ink); }
.hero__glance { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero__glance li { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 14px; background: var(--leaf-pale); border: 1px solid rgba(47, 125, 42, .3); line-height: 1.25; }
.hero__glance span { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.hero__glance b { font-size: 19px; color: var(--ink); }
.hero__glance .is-feast { background: var(--haldi); border-color: #c99400; }

html:not(.js) .gate { --k: 1 !important; }
html:not(.js) :is(.gate__ask, .gate__skip) { display: none; }
html:not(.js) .hero { display: block; }

/* =================================================================== THE FIVE ADHYAY */

.adhyay { max-width: 560px; margin: 0 auto; padding: 56px 16px 0; }
.patra {
  position: relative; padding: 40px 22px 34px; text-align: center; color: var(--ink);
  background: linear-gradient(90deg, rgba(160, 120, 60, .12), transparent 6%, transparent 94%, rgba(160, 120, 60, .12)), var(--paper);
  box-shadow: 0 20px 40px -24px rgba(42, 32, 16, .6);
}
.patra::before, .patra::after {       /* the scroll's two wooden rods */
  content: ""; position: absolute; left: -10px; right: -10px; height: 16px; border-radius: 8px;
  background: linear-gradient(180deg, #a8743a, var(--wood) 60%, #3e2410);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}
.patra::before { top: -8px; }
.patra::after { bottom: -8px; }
.adhyay__no { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.adhyay__no span { font: 700 17px/1 var(--f-deva); color: var(--kumkum); }
.adhyay__no b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--haldi); color: var(--ink); font: 700 20px/1 var(--f-deva); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--haldi); }
.patra__title { margin: 6px 0 0; font: 400 clamp(28px, 8vw, 38px)/1.15 var(--f-display); color: var(--leaf-lo); text-wrap: balance; }
.patra__kripa { margin-top: 8px; font-size: 16px; color: var(--ink-soft); }
.patra__msg { margin: 14px auto 0; max-width: 26em; }
.patra__hi { margin-top: 14px; font: 700 21px/1.4 var(--f-deva); color: var(--kumkum); }
.patra__sign { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(47, 125, 42, .3); }
.patra__names { font: 400 clamp(21px, 6vw, 26px)/1.3 var(--f-display); text-wrap: balance; }
.patra__family { margin-top: 2px; font-weight: 700; color: var(--leaf-lo); }
.patra__lead { margin-top: 8px; color: var(--ink-soft); }

/* --- adhyay 2: the order of the puja --- */
.vidhi { list-style: none; margin: 20px 0 0; padding: 0; text-align: left; }
.vidhi__item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-top: 1px dashed rgba(47, 125, 42, .35); }
.vidhi__leaf { width: 22px; height: 30px; margin-top: 4px; border-radius: 0 100% 0 100%; background: linear-gradient(135deg, var(--leaf-hi), var(--leaf-lo)); rotate: -45deg; }
.vidhi__item.is-feast .vidhi__leaf { background: linear-gradient(135deg, #ffd84a, var(--haldi)); }
.vidhi__time { font: 700 19px/1.2 var(--f-body); color: var(--kumkum); }
.vidhi__name { margin: 2px 0 0; font: 400 23px/1.25 var(--f-display); color: var(--ink); }
.vidhi__name span { display: block; font: 700 17px/1.3 var(--f-deva); color: var(--leaf-lo); }
.vidhi__date { font-size: 15px; color: var(--ink-soft); }
.vidhi__note { margin-top: 4px; }
.vidhi__where { font-size: 15px; color: var(--ink-soft); }
.vidhi__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vidhi__item.is-feast { background: linear-gradient(90deg, rgba(242, 183, 5, .18), transparent); }
.vachak { margin-top: 10px; padding-top: 16px; border-top: 2px solid var(--haldi); }
.vachak__line { line-height: 1.4; }
.vachak__line + .vachak__line { margin-top: 8px; }
.vachak__role { display: block; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.vachak__name { font: 400 22px/1.3 var(--f-display); color: var(--leaf-lo); }
.vachak__from { display: block; font-size: 15px; color: var(--ink-soft); }
.kbtn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid rgba(47, 125, 42, .5); font: 500 15px/1 var(--f-body); text-decoration: none; color: var(--leaf-lo); background: var(--ivory);
}
.kbtn--solid { background: var(--leaf); border-color: var(--leaf); color: #fff; font-weight: 700; }
.kbtn--big { min-height: 52px; padding: 0 26px; font-size: 17px; margin-top: 16px; }
.kbtn--leaf { background: linear-gradient(180deg, var(--leaf-hi), var(--leaf)); border-color: var(--leaf-lo); color: #fff; font-weight: 700; box-shadow: 0 10px 22px -10px rgba(29, 90, 26, .8); }

/* --- adhyay 3: panchamrit --- */
.amrit { position: relative; width: min(100%, 300px); margin: 18px auto 0; }
.amrit__bowl { display: block; width: 100%; height: auto; overflow: visible; }
.amrit__fill { fill: var(--amrit, #fbfaf4); transform-box: fill-box; transform-origin: 50% 100%; transform: translateY(calc((1 - var(--lvl, 0)) * 100%)); transition: transform .9s var(--ease), fill .9s; }
.amrit__tulsi { opacity: 0; transform: translateY(-30px); transition: opacity .6s, transform .8s cubic-bezier(.3, 1.6, .5, 1); }
.amrit.done .amrit__tulsi { opacity: 1; transform: none; }
.amrit.stir .amrit__swirl { animation: swirl 1s ease; }
@keyframes swirl { 0% { opacity: 0; transform: translateX(-20px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateX(20px); } }
.amrit__drop { position: absolute; left: 50%; top: -30px; width: 12px; height: 16px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--drop, #fff); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); opacity: 0; }
.amrit.pour .amrit__drop { animation: drop .6s ease-in; }
@keyframes drop { 0% { opacity: 1; transform: translateY(0); } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(70px); } }
.amrit__picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.ing {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px 0 8px; border-radius: 999px; cursor: pointer;
  background: var(--ivory); border: 1.5px solid rgba(200, 144, 44, .6); color: var(--ink); font: 500 16px/1 var(--f-body);
}
.ing i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 -3px 5px rgba(0, 0, 0, .15), 0 0 0 1px rgba(0, 0, 0, .12); }
.ing span { font-family: var(--f-deva); color: var(--ink-soft); }
.ing[disabled] { opacity: .45; cursor: default; text-decoration: line-through; text-decoration-color: var(--leaf); }
.amrit__done { margin-top: 16px; font: 400 20px/1.4 var(--f-display); color: var(--leaf-lo); }

/* --- adhyay 4: the date --- */
.tithi { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }
.tithi__day { font: 700 86px/1 var(--f-deva); color: var(--kumkum); }
.tithi__rest { display: flex; flex-direction: column; text-align: left; }
.tithi__rest b { font: 400 25px/1.2 var(--f-display); }
.tithi__rest span { color: var(--ink-soft); }
.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: 50% 50% 12px 12px / 30% 30% 12px 12px; background: var(--leaf); color: #e7f3d6; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.count b { font: 400 clamp(28px, 8vw, 38px)/1.15 var(--f-display); color: #fff6d0; letter-spacing: 0; }
.count__done { margin-top: 14px; font: 400 24px/1.3 var(--f-display); color: var(--leaf-lo); }

/* --- adhyay 5: the way home --- */
.ghar__name { margin-top: 12px; font: 400 26px/1.25 var(--f-display); color: var(--ink); }
.ghar__addr { margin: 4px auto 0; max-width: 22em; color: var(--ink-soft); }
.uttar { margin-top: 28px; padding-top: 22px; border-top: 2px solid var(--haldi); }
.uttar__jai { font: 700 clamp(30px, 9vw, 42px)/1.3 var(--f-deva); color: var(--kumkum); }
.uttar__ask { margin: 6px auto 0; max-width: 24em; }
.uttar__share { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 8px; font-size: 16px; color: var(--ink-soft); text-underline-offset: 4px; }

/* --- footer --- */
.foot { max-width: 560px; margin: 50px auto 0; padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); text-align: center; }
.foot__end { font: 700 20px/1.5 var(--f-deva); color: var(--kumkum); }
.foot__hosts { margin-top: 6px; color: var(--ink-soft); font-size: 16px; }
.foot__music, .foot__credit { margin-top: 10px; 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: 8px; color: var(--leaf-lo); font-size: 15px; }

@media (min-width: 900px) {
  .leaf { left: calc(50% - 420px); right: calc(50% - 420px); }
  .adhyay { padding-top: 72px; }
}
@media (max-height: 700px) { .gate__puja { width: min(80vw, 360px); } .gate__jai { font-size: 30px; } }

/* =================================================================== OG CARD */
.ogcard { background: radial-gradient(100% 90% at 30% 50%, #7a4c26, var(--wood) 60%, #3e2410); font-family: var(--f-body); color: var(--ink); --k: .3; }
.og__leaf { position: absolute; left: -120px; top: -40px; width: 780px; height: 710px; border-radius: 50%; background: linear-gradient(90deg, transparent calc(50% - 4px), #b9d98a calc(50% - 2px), #e6f2c4 50%, #a9cf78 calc(50% + 2px), transparent calc(50% + 4px)), var(--veins), radial-gradient(70% 60% at 50% 45%, var(--leaf-hi), var(--leaf) 55%, var(--leaf-lo)); }
.og__art { position: absolute; left: 20px; top: 110px; width: 520px; height: 390px; }
.og__art .conch { animation: none; }
.og__text { position: absolute; left: 560px; right: 40px; top: 50px; bottom: 50px; padding: 26px 36px; border-radius: 26px; background: var(--paper); box-shadow: 0 0 0 4px var(--haldi), 0 30px 60px rgba(0, 0, 0, .45); display: flex; flex-direction: column; justify-content: center; }
.og__jai { font: 700 48px/1.3 var(--f-deva); color: var(--kumkum); }
.og__title { font: 400 64px/1.05 var(--f-display); color: var(--leaf-lo); }
.og__hosts { margin-top: 12px; font: 700 36px/1.2 var(--f-body); color: var(--ink); }
.og__when { margin-top: 8px; font: 500 30px/1.3 var(--f-body); }
.og__feast { margin-top: 12px; align-self: flex-start; padding: 4px 20px; border-radius: 999px; background: var(--haldi); font: 700 27px/1.3 var(--f-body); }
