/* ceremony mode: kalawa thread on the left, one step at a time, flowers collect in a brass thali */
.cer-top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) 12px; padding-left: var(--gutter); padding-right: var(--gutter-r);
  background: color-mix(in srgb, var(--night) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.cer-top .ttl { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.cer-top .ttl svg { width: 34px; height: 34px; color: var(--c, var(--gold)); flex: none; }
.cer-top h1 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.35rem; line-height: 1.2; color: var(--c, var(--gold)); }
.cer-top .sub { font-size: .82rem; color: var(--ink-2); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 700px) { .cer-top { position: static; } .cer-top .ttl { flex-basis: 100%; } }

.cer-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; max-width: 1180px; margin: 0 auto;
  padding-block: 34px 170px; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.rail { position: sticky; top: 92px; align-self: start; height: calc(100vh - 130px); max-height: 820px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.thread { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding-block: 2px; }
.thread::before, .thread::after { content: ""; position: absolute; left: 50%; top: 8px; width: 3px; margin-left: -1.5px; border-radius: 2px; }
.thread::before { bottom: 8px; background: repeating-linear-gradient(180deg, rgba(217,65,47,.35) 0 6px, rgba(233,177,59,.25) 6px 12px); }
.thread::after { height: calc((100% - 16px) * var(--p, 0)); background: repeating-linear-gradient(180deg, var(--kumkum) 0 6px, var(--gold) 6px 12px); box-shadow: 0 0 10px rgba(217,65,47,.6); transition: height 1s cubic-bezier(.3,.7,.3,1); }
.bead { position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(233,177,59,.45); background: var(--night); padding: 0; transition: all .4s; }
.bead.lit { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px var(--gold); }
.bead.now { width: 19px; height: 19px; border-color: var(--kumkum); box-shadow: 0 0 0 5px rgba(217,65,47,.22); }
.bead.lit.now { background: var(--gold); }
.bead.pop { animation: pop .7s ease; }
@keyframes pop { 40% { transform: scale(1.8); box-shadow: 0 0 30px var(--gold) } }
.rail-labels { display: flex; flex-direction: column; justify-content: space-between; font-size: .74rem; color: var(--muted); min-width: 0; }
.rail-labels button { all: unset; cursor: pointer; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.rail-labels button:hover { color: var(--ink); }
.rail-labels button.now { color: var(--ink); font-weight: 500; }
.rail-labels button.lit { color: var(--gold-soft); }
.rail-labels button:focus-visible { outline: 2px solid var(--gold); }
@media (max-width: 860px) {
  .cer-body { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 18px; }
  .rail { position: static; height: auto; grid-template-columns: minmax(0, 1fr); }
  .thread { flex-direction: row; height: 26px; padding-inline: 2px; }
  .thread::before, .thread::after { top: 50%; left: 8px; width: auto; height: 3px; margin: -1.5px 0 0; }
  .thread::before { right: 8px; bottom: auto; background: repeating-linear-gradient(90deg, rgba(217,65,47,.35) 0 6px, rgba(233,177,59,.25) 6px 12px); }
  .thread::after { width: calc((100% - 16px) * var(--p, 0)); height: 3px; background: repeating-linear-gradient(90deg, var(--kumkum) 0 6px, var(--gold) 6px 12px); transition: width 1s cubic-bezier(.3,.7,.3,1); }
  .bead { width: 9px; height: 9px; border-width: 1.5px; } .bead.now { width: 15px; height: 15px; }
  .rail-labels { display: none; }
}

.stage { min-width: 0; font-size: calc(1rem * var(--scale, 1)); }
.stage-in { transition: opacity .4s ease, transform .4s ease; }
.stage-in.out { opacity: 0; transform: translateY(16px); }
.phase-tag { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: .9em; }
.phase-tag b { color: var(--gold); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: .8em; }
.step-title { margin: 8px 0 2px; font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 5vw, 3.2em); line-height: 1.15; text-wrap: balance; }
.step-title .l-en { display: block; font-family: var(--f-body); font-size: .36em; font-weight: 300; margin-top: 6px; }
[data-lang="en"] .step-title .l-en { font-family: var(--f-display); font-size: 1em; font-weight: 400; margin: 0; color: var(--ink); }
.why { max-width: 64ch; margin: 18px 0 0; color: var(--ink-2); }
.why .l-hi { color: var(--ink); }
h3 { font-size: .78em; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 500; margin: 32px 0 12px; }
.acts { margin: 0; padding: 0; list-style: none; counter-reset: a; display: grid; gap: 12px; max-width: 66ch; }
.acts li { counter-increment: a; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.acts li::before { content: counter(a); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-size: .8rem; margin-top: 2px; }
.acts .l-en { display: block; font-size: .93em; }

.mantra { position: relative; margin: 16px 0; padding: 24px 26px; border-radius: 20px; border: 1px solid rgba(233,177,59,.28);
  background: radial-gradient(ellipse at 0% 0%, rgba(233,177,59,.11), transparent 60%), var(--night-2); }
.mantra .sa { font-family: var(--f-mantra); font-size: clamp(1.3rem, 2.6vw, 1.75em); line-height: 1.8; padding-right: 104px; }
.mantra .sa .ln { display: block; }
.mantra .sa .w { transition: color .25s, text-shadow .25s; }
.mantra .sa .w.said { color: var(--gold-soft); }
.mantra .sa .w.on { color: var(--gold); text-shadow: 0 0 18px rgba(233,177,59,.8); }
.mantra .tr { font-family: var(--f-mantra); font-style: italic; color: var(--muted); margin-top: 8px; white-space: pre-line; }
.mantra .mn { margin-top: 12px; max-width: 64ch; }
.mantra .mn .l-hi { color: var(--ink-2); }
.mantra .mn .l-en { display: block; font-size: .93em; }
.recite { position: absolute; top: 16px; right: 16px; display: inline-flex; gap: 6px; align-items: center; border: 1px solid rgba(233,177,59,.5); background: transparent; color: var(--gold); border-radius: 999px; padding: 5px 12px; font-size: .8rem; }
@media (max-width: 560px) { .mantra { padding: 20px 16px; } .mantra .sa { padding-right: 0; padding-top: 32px; } }
.note { margin-top: 22px; border: 1px dashed var(--line); border-radius: 14px; padding: 14px 18px; color: var(--ink-2); max-width: 66ch; }
.note .l-en { display: block; }

.do-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 36px; }
.done-btn { background: var(--kumkum); color: #fff; border: 0; border-radius: 999px; padding: 14px 26px; font-weight: 500; display: inline-flex; gap: 10px; align-items: center; transition: transform .2s, box-shadow .3s; }
.done-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--kumkum); }
.done-btn.is-done { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.navbtn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 12px 18px; }
.navbtn:hover { border-color: var(--gold); }
.navbtn:disabled { opacity: .35; cursor: default; }

/* about */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 24px; }
.fact { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--night-2); }
.fact dt { font-size: .75em; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.fact dd { margin: 0; }
.fact dd .l-en { display: block; font-size: .92em; }

/* samagri */
.samhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.samcount { color: var(--muted); font-size: .9em; font-variant-numeric: tabular-nums; }
.sam { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 22px; }
.sam label { display: flex; gap: 12px; align-items: flex-start; padding: 8px 2px; border-bottom: 1px solid var(--line); cursor: pointer; transition: opacity .3s; }
.sam label:has(input:checked) { opacity: .55; }
.sam input { margin-top: .35em; accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.sam .l-en { display: block; font-size: .88em; }
.sam .q { color: var(--gold-soft); font-size: .85em; }

/* tables */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .74em; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 500; background: var(--night-2); }
td.n { color: var(--muted); width: 2em; font-variant-numeric: tabular-nums; }
td .sa { font-family: var(--f-mantra); font-size: 1.08em; }
td .tr { color: var(--muted); font-style: italic; font-size: .88em; font-family: var(--f-mantra); }
td .l-en { display: block; font-size: .9em; }
tr.done td { opacity: .5; }
td input { accent-color: var(--gold); width: 18px; height: 18px; }

/* sankalp */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.form label { display: grid; gap: 4px; font-size: .88em; color: var(--ink-2); }
.form input, .form select { border: 1px solid var(--line); background: var(--night-2); border-radius: 10px; padding: 9px 11px; color: var(--ink); width: 100%; min-width: 0; }
.example { display: inline-block; font-size: .72rem; letter-spacing: 0; text-transform: none; background: rgba(233,177,59,.15); color: var(--gold-soft); border-radius: 999px; padding: 1px 10px; margin-left: 8px; }
.copy { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: .82em; }

/* japa */
.japa { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.bigbead { width: 170px; height: 170px; border-radius: 50%; border: 0; color: #fff; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #F2C26A, #8E3A12 70%); box-shadow: 0 14px 36px -12px rgba(233,177,59,.6), inset 0 -10px 20px rgba(0,0,0,.25); transition: transform .12s; }
.bigbead strong { font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.bigbead:active { transform: scale(.96); }
.japa-meta { display: grid; gap: 8px; color: var(--ink-2); }

/* katha and aarti */
.story p { max-width: 66ch; margin: 0 0 14px; }
.story p.l-en { color: var(--ink-2); }
.jai { font-family: var(--f-display); color: var(--gold); font-size: 1.5em; margin-top: 18px; }
.aarti { columns: 2 300px; column-gap: 30px; }
.aarti .v { break-inside: avoid; margin-bottom: 16px; }
.aarti .sa { font-family: var(--f-mantra); font-size: 1.22em; line-height: 1.7; white-space: pre-line; }
.aarti .tr { font-family: var(--f-mantra); font-style: italic; color: var(--muted); white-space: pre-line; font-size: .9em; }
.aarti-play { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 4px 0 18px; }
.aarti-thali { width: 86px; height: 86px; border: 0; border-radius: 50%; padding: 0; position: relative;
  background: radial-gradient(circle, #C99A3A 0 46%, #8E6A22 47% 50%, #E7C46B 51% 60%, #A07A2A 61% 64%, #F1D488 65% 100%); box-shadow: 0 10px 24px -10px rgba(0,0,0,.7); }
.aarti-thali::after { content: ""; position: absolute; left: 50%; top: 22%; width: 12px; height: 22px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  background: radial-gradient(circle at 50% 70%, #FFFBE6, #FFB42E 55%, #E2551B); box-shadow: 0 0 16px 4px rgba(255,180,46,.6); animation: flick 1.6s ease-in-out infinite; }
@keyframes flick { 50% { transform: scale(.92, 1.08) } }
.aarti-thali.spin { animation: circle 2.4s ease-in-out; }
@keyframes circle { 0% { transform: translate(0,0) } 25% { transform: translate(18px,-14px) } 50% { transform: translate(0,-28px) } 75% { transform: translate(-18px,-14px) } 100% { transform: translate(0,0) } }

/* lock */
.lock { margin-top: 22px; border: 1px dashed var(--gold); background: rgba(233,177,59,.08); border-radius: 16px; padding: 20px; display: grid; gap: 14px; justify-items: start; max-width: 66ch; }
.lock p { margin: 0; }
.unlock { display: inline-block; background: var(--gold); color: var(--on-gold); border-radius: 999px; padding: 11px 20px; font-weight: 500; text-decoration: none; }
.unlock.off { opacity: .6; }

/* thali and petals */
.thali { position: fixed; z-index: 25; right: max(22px, env(safe-area-inset-right, 0px)); bottom: calc(26px + env(safe-area-inset-bottom, 0px)); width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #C99A3A 0 46%, #8E6A22 47% 50%, #E7C46B 51% 60%, #A07A2A 61% 64%, #F1D488 65% 100%);
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.15); }
.thali .pile { position: absolute; inset: 22%; border-radius: 50%; }
.thali .pile i { position: absolute; width: 15px; height: 21px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; }
.thali-count { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); font-size: .72rem; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 860px) { .thali { width: 74px; height: 74px; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); } .thali .pile i { width: 10px; height: 14px; } }
.petal { position: fixed; z-index: 30; width: 22px; height: 30px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, #FFD36B, #F08A12 70%); box-shadow: 0 0 10px rgba(240,138,18,.6); }
.petal.lotus { background: radial-gradient(circle at 50% 30%, #FFD1DE, #E66A8E 70%); box-shadow: 0 0 10px rgba(230,106,142,.6); }

.loading { padding: 120px 20px; text-align: center; color: var(--ink-2); }
@media (max-width: 700px) {
  .cer-top .ttl { flex-wrap: nowrap; }
  .cer-top .ttl #home .l-en, .cer-top .ttl #home .l-hi { display: none !important; }
  .cer-top .ttl #home { padding: 5px 11px; }
  .cer-top h1 { font-size: 1.15rem; }
}
