/* ============================================================
   japo.app — locked design tokens
   Colors: --ink, --ink-warm, --bone, --mist, --whisper,
           --gold, --gold-deep
   Type:   ui-serif + system-sans, no Google Fonts
   ============================================================ */

:root {
  --ink:        #0A0A14;
  --ink-warm:   #14101C;
  --bone:       #F4ECDC;
  --mist:       rgba(244, 236, 220, 0.6);
  --whisper:    rgba(244, 236, 220, 0.3);
  --gold:       #FFD089;
  --gold-deep:  #E89A3A;

  --serif: ui-serif, "New York", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --deva:  "Noto Serif Devanagari", system-ui, serif;
  --gurm:  "Noto Sans Gurmukhi", system-ui, sans-serif;

  --bg: var(--ink);

  /* Type scale */
  --hero:    clamp(48px, 8vw, 96px);
  --section: clamp(32px, 5vw, 56px);
  --body:    18px;
  --label:   12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: auto; } /* JS handles smooth scroll */

body {
  background: var(--bg);
  color: var(--bone);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Cinematic vignette over the whole stage (above canvas, below text) */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at center,
      transparent 35%,
      rgba(10, 10, 20, 0.35) 78%,
      rgba(10, 10, 20, 0.65) 100%);
}

/* Top chrome ------------------------------------------------- */

.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: normal;
}
.chrome > * { pointer-events: auto; }

/* 108-dot scroll progress (subliminal mala cue) */
.mala-progress {
  position: fixed;
  top: 14px;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 49;
  width: min(60vw, 540px);
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0.55;
}
.mala-progress .dot {
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--whisper);
  transition: background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.mala-progress .dot.on {
  background: var(--gold);
  transform: scale(1.4);
  box-shadow: 0 0 4px rgba(255, 208, 137, 0.6);
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.01em;
  color: var(--gold);
  text-decoration: none;
}

.controls {
  display: flex;
  gap: 18px;
  align-items: center;
}

.lang-toggle, .sound-toggle {
  background: transparent;
  border: none;
  color: var(--mist);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}
.lang-toggle:hover, .sound-toggle:hover { color: var(--bone); }
.lang-toggle span.active { color: var(--gold); }
.lang-toggle span { transition: color 0.3s ease; }
.lang-toggle .sep { color: var(--whisper); margin: 0 6px; }

.sound-toggle .ico {
  width: 14px; height: 14px;
  display: inline-block;
  position: relative;
}
.sound-toggle .ico::before,
.sound-toggle .ico::after {
  content: "";
  position: absolute;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.sound-toggle .ico::before { inset: 4px; }
.sound-toggle .ico::after  { inset: 0; }
.sound-toggle.is-on { color: var(--gold); }
.sound-toggle.is-on .ico::before,
.sound-toggle.is-on .ico::after { opacity: 1; }

/* WebGL canvas ----------------------------------------------- */

/* Bead canvas + loading overlay ------------------------------- */

#bead-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1) 0.3s;
}
#bead-canvas.is-ready { opacity: 1; }

#bead-loading {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("images/bead-fallback.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(40vw, 400px);
  opacity: 1;
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1) 0.3s;
}
#bead-loading.is-fading { opacity: 0; }

.reduced-motion #bead-canvas { display: none; }
.reduced-motion /* Beat sections ---------------------------------------------- */

main { position: relative; z-index: 10; }
.beat-inner { position: relative; z-index: 11; }
.beat-arrival .mantra,
.beat-arrival .tagline,
.beat-character .text,
.beat-mala .stanzas,
.beat-completion .pin,
.beat-materials .pin,
.beat-practice .blocks,
.beat-traditions .pin,
.beat-yantras .pin,
.beat-pricing > div,
footer .cols { position: relative; z-index: 12; }

.beat {
  position: relative;
  width: 100%;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
}

.beat-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

/* B1 — Arrival */
.beat-arrival {
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.beat-arrival .mantra {
  font-family: var(--serif);
  font-size: clamp(56px, 9vw, 110px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--bone);
  margin: 0;
  margin-top: 56vh; /* below bead */
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition:
    opacity 1.8s cubic-bezier(.2,.7,.2,1) 0.5s,
    transform 1.8s cubic-bezier(.2,.7,.2,1) 0.5s;
}
.beat-arrival.is-visible .mantra { opacity: 1; transform: translateY(0) scale(1); }
.beat-arrival .mantra .dot { color: var(--gold); opacity: 0.7; margin: 0 0.18em; display: inline-block; vertical-align: middle; font-size: 0.7em; transform: translateY(-0.1em); }
.beat-arrival .tagline {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--mist);
  letter-spacing: 0.04em;
  margin-top: 24px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 1.8s cubic-bezier(.2,.7,.2,1) 1.1s,
    transform 1.8s cubic-bezier(.2,.7,.2,1) 1.1s;
}
.beat-arrival.is-visible .tagline { transform: translateY(0); }
.beat-arrival.is-visible .tagline { opacity: 1; }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 24px;
  background: var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: translateX(-50%) scaleY(0.6); }
  50%      { opacity: 0.9;  transform: translateX(-50%) scaleY(1); }
}

/* B2 — Character */
.beat-character {
  min-height: 100vh;
  justify-content: center;
}
.beat-character .beat-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.beat-character .text {
  max-width: 460px;
}
.beat-character h2 {
  font-family: var(--serif);
  font-size: var(--section);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  color: var(--bone);
  text-wrap: balance;
  white-space: pre-line;
}
.beat-character p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--mist);
  margin: 0;
  text-wrap: pretty;
}

/* B3 — Mala forms */
.beat-mala {
  min-height: 200vh;
  justify-content: flex-start;
  padding-top: 30vh;
}
.beat-mala .stanzas {
  display: flex;
  flex-direction: column;
  gap: 55vh;
  max-width: 420px;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.25;
  font-weight: 400;
  color: var(--bone);
  letter-spacing: -0.01em;
}
.beat-mala .stanza {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 1.2s cubic-bezier(.2,.7,.2,1),
    transform 1.2s cubic-bezier(.2,.7,.2,1);
  text-wrap: balance;
}
.beat-mala .stanza.is-on { opacity: 1; transform: translateY(0); }

#mala-ring {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#mala-ring.is-on { opacity: 1; }
#mala-ring svg { width: min(80vmin, 900px); height: min(80vmin, 900px); overflow: visible; }
#mala-ring circle.ghost {
  fill: var(--gold);
  opacity: 0;
  transition: opacity 0.35s ease, r 0.35s ease, filter 0.35s ease;
}

/* B4 — Completion ceremony */
.beat-completion {
  min-height: 250vh;
}
.beat-completion .pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.glyph-stage {
  position: relative;
  z-index: 5;
  width: min(50vmin, 520px);
  height: min(50vmin, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.glyph-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.glyph path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(255, 208, 137, 0.4));
}
.glyph .ghost { stroke: var(--whisper); }

.cycle-tradition {
  margin-top: 48px;
  background: transparent;
  border: none;
  color: var(--mist);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s ease;
}
.cycle-tradition::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--whisper);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.4s ease, background 0.4s ease;
}
.cycle-tradition:hover { color: var(--gold); }
.cycle-tradition:hover::after { transform: scaleX(1); background: var(--gold); }

/* B5 — Seven materials */
.beat-materials {
  min-height: 350vh;
}
.beat-materials .pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14vh;
}
.material-label {
  text-align: center;
  max-width: 720px;
}
.material-label .name {
  display: block;
  font-family: var(--sans);
  font-size: var(--label);
  letter-spacing: 0.28em;
  color: var(--mist);
  margin-bottom: 14px;
  font-weight: 500;
}
.material-label .name { transition: opacity 0.6s cubic-bezier(.2,.7,.2,1); }
.material-label .desc {
  display: block;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--bone);
  min-height: 2.5em;
  text-wrap: balance;
  transition: opacity 0.6s cubic-bezier(.2,.7,.2,1);
}
.material-label {
  transition: opacity 0.8s ease;
}

/* B6 — Practice */
.beat-practice {
  min-height: 200vh;
  justify-content: center;
  align-items: flex-end;
  padding-top: 20vh;
}
.beat-practice .blocks {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: 440px;
  width: 100%;
}
.practice-block {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1.2s cubic-bezier(.2,.7,.2,1),
    transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.practice-block.is-on { opacity: 1; transform: translateY(0); }
.practice-block .icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  color: var(--gold);
}
.practice-block .icon svg { width: 100%; height: 100%; }
.practice-block h3 {
  font-family: var(--sans);
  font-size: var(--label);
  letter-spacing: 0.28em;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 14px;
}
.practice-block .body {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--bone);
  margin: 0;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* B7 — Traditions */
.beat-traditions {
  min-height: 240vh;
}
.beat-traditions .pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.tradition-line {
  position: absolute;
  top: 18%;
  max-width: min(90vw, 720px);
  margin: 0 auto;
  left: 0; right: 0;
  max-width: 90vw;
  margin: 0 auto;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--bone);
  opacity: 0;
  padding: 0 24px;
  text-wrap: balance;
  will-change: opacity;
}
.tradition-line.final { color: var(--gold); }
.tradition-line .glyph-hint {
  display: block;
  margin-top: 24px;
  font-size: 28px;
  color: var(--gold);
  opacity: 0.55;
  font-family: var(--serif);
  letter-spacing: 0;
  line-height: 1;
}

/* B8 — Yantras */
.beat-yantras {
  min-height: 280vh;
}
.beat-yantras .pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 40px;
}
.yantra-stage {
  width: min(48vmin, 480px);
  height: min(48vmin, 480px);
  position: relative;
}
.yantra-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.8s ease;
  animation: breath 4s ease-in-out infinite;
}
.yantra-stage svg.is-on { opacity: 1; }
@keyframes breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.005); }
}
.yantra-stage svg [data-y] {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(255, 208, 137, 0.35));
}
.yantra-label {
  font-family: var(--sans);
  font-size: var(--label);
  letter-spacing: 0.28em;
  color: var(--mist);
  text-transform: uppercase;
}

/* B9 — Pricing */
.beat-pricing {
  min-height: 110vh;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 32px;
}
.beat-pricing .price {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--bone);
  text-wrap: balance;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s cubic-bezier(.2,.7,.2,1), transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.beat-pricing .price.is-on { opacity: 1; transform: translateY(0); }
.beat-pricing .subprice {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--mist);
  margin-top: 20px;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s cubic-bezier(.2,.7,.2,1) 0.35s, transform 1.2s cubic-bezier(.2,.7,.2,1) 0.35s;
}
.beat-pricing .subprice.is-on { opacity: 1; transform: translateY(0); }
.beat-pricing .cta {
  display: inline-block;
  margin-top: 56px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--gold);
  text-decoration: none;
  position: relative;
  padding: 8px 0;
  letter-spacing: -0.005em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s cubic-bezier(.2,.7,.2,1) 0.75s, transform 1.2s cubic-bezier(.2,.7,.2,1) 0.75s;
}
.beat-pricing .cta.is-on { opacity: 1; transform: translateY(0); }
.beat-pricing .cta::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  height: 1px;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.beat-pricing .cta:hover::after,
.beat-pricing .cta:active::after,
.beat-pricing .cta:focus-visible::after { transform: scaleX(1); }
.beat-pricing .arrow {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.beat-pricing .cta:hover .arrow { transform: translateX(6px); }

/* Footer */
footer {
  padding: 64px 32px 48px;
  position: relative;
  z-index: 3;
  background: var(--ink-warm);
}
footer .divider {
  height: 1px;
  width: 33%;
  background: var(--gold);
  opacity: 0.45;
  margin: 0 auto 40px;
}
footer .cols {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
footer .col-left .wordmark { font-size: 22px; display: block; margin-bottom: 8px; }
footer .col-left .ftag {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--mist);
}
footer .col-center {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
footer .col-center a {
  color: var(--mist);
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}
footer .col-center a:hover { color: var(--gold); }
footer .col-right {
  text-align: right;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--mist);
}

/* Tweaks panel ----------------------------------------------- */
#tweaks-panel {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 100;
  width: 280px;
  background: rgba(20, 16, 28, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 208, 137, 0.18);
  border-radius: 14px;
  padding: 20px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--bone);
  display: none;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
}
#tweaks-panel.is-open { display: block; }
#tweaks-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(244, 236, 220, 0.08);
}
#tweaks-panel h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--gold);
}
#tweaks-panel .close {
  background: transparent;
  border: none;
  color: var(--mist);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
.tweak {
  margin-bottom: 16px;
}
.tweak:last-child { margin-bottom: 0; }
.tweak label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 8px;
}
.tweak .opts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tweak .opt {
  flex: 1 1 auto;
  background: transparent;
  border: 1px solid rgba(244, 236, 220, 0.15);
  color: var(--bone);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.tweak .opt:hover { border-color: var(--gold); color: var(--gold); }
.tweak .opt.is-on {
  background: rgba(255, 208, 137, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}
.tweak .swatches { display: flex; gap: 8px; }
.tweak .sw {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.tweak .sw:hover { transform: scale(1.1); }
.tweak .sw.is-on { border-color: var(--bone); }
.tweak .toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(244, 236, 220, 0.15);
  color: var(--bone);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}
.tweak .toggle .pill {
  width: 28px; height: 16px;
  border-radius: 10px;
  background: rgba(244, 236, 220, 0.15);
  position: relative;
  transition: background 0.25s ease;
}
.tweak .toggle .pill::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bone);
  transition: transform 0.25s ease;
}
.tweak .toggle.is-on .pill { background: var(--gold); }
.tweak .toggle.is-on .pill::after { transform: translateX(12px); background: var(--ink); }

/* A11y helpers ----------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Launch config — hide multi-faith surfaces when LAUNCH_MULTIFAITH=false */
html.multifaith-off .cycle-tradition { display: none !important; }
html.multifaith-off .lang-toggle [data-lang="pa"],
html.multifaith-off .lang-toggle .sep + .sep,
html.multifaith-off .lang-toggle .sep:last-of-type { display: none !important; }
html.multifaith-off .lang-toggle .sep ~ [data-lang="pa"] { display: none !important; }
html.multifaith-off .lang-toggle .sep:has(+ [data-lang="pa"]) { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* Devanagari / Gurmukhi text — switch font on whole document when locale active */
html.lang-hi { font-family: var(--deva); }
html.lang-pa { font-family: var(--gurm); }
html.lang-hi .mantra,
html.lang-pa .mantra,
html.lang-hi .beat-mala .stanza,
html.lang-pa .beat-mala .stanza,
html.lang-hi .tradition-line,
html.lang-pa .tradition-line,
html.lang-hi .beat-character h2,
html.lang-pa .beat-character h2,
html.lang-hi .beat-pricing .price,
html.lang-pa .beat-pricing .price,
html.lang-hi .beat-pricing .cta,
html.lang-pa .beat-pricing .cta,
html.lang-hi .article-prose h1,
html.lang-pa .article-prose h1 {
  font-family: var(--deva);
}
html.lang-pa .mantra,
html.lang-pa .beat-mala .stanza,
html.lang-pa .tradition-line,
html.lang-pa .beat-character h2,
html.lang-pa .beat-pricing .price,
html.lang-pa .beat-pricing .cta,
html.lang-pa .article-prose h1 {
  font-family: var(--gurm);
}
html.lang-hi .mantra,
html.lang-pa .mantra { letter-spacing: 0; }
html.lang-pa .mantra .dot { display: none; }

@media (max-width: 600px) { .mala-progress { display: none; } }
@media (max-width: 720px) {
  .chrome { padding: 16px 20px; }
  .beat { padding: 0 20px; }
  .beat-character .beat-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .beat-mala .stanzas { gap: 40vh; }
  footer .cols { grid-template-columns: 1fr; text-align: center; }
  footer .col-right { text-align: center; }
  #tweaks-panel {
    left: 12px; right: 12px; bottom: 12px; width: auto;
  }
}


/* Launch mode: only Sri Yantra is shown across the site. The other four
   yantras remain in the rendered DOM (for month-3 flip) but are hidden. */
html.multifaith-off .yantra-stage svg:not([data-yantra="sri"]):not([data-name="sri"]) { display: none !important; }
html.multifaith-off [data-yantra]:not([data-yantra="sri"]) .stage { opacity: 0.15; }
html.multifaith-off section[data-yantra]:not([data-yantra="sri"]) { display: none !important; }

/* Practice page /yantras: only Sri Yantra section visible at launch */
html.multifaith-off section[data-yantra="khanda"],
html.multifaith-off section[data-yantra="cross"],
html.multifaith-off section[data-yantra="crescent"],
html.multifaith-off section[data-yantra="lotus"] { display: none !important; }


/* Premium film-grain overlay — subtle organic texture across the viewport.
   Uses an inline SVG noise pattern at very low opacity (2.5%). */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.020;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5' /%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) { .film-grain { display: none; } }


/* Subtle candle-flame flicker (Beat 6 Sankalp icon) */
@keyframes candle-flicker {
  0%, 100% { opacity: 1; transform: translateY(0) scaleY(1); }
  20%      { opacity: 0.92; transform: translateY(0.5px) scaleY(0.98); }
  40%      { opacity: 0.97; transform: translateY(-0.3px) scaleY(1.02); }
  65%      { opacity: 0.88; transform: translateY(0.4px) scaleY(0.96); }
  80%      { opacity: 0.95; transform: translateY(-0.2px) scaleY(1.01); }
}
.practice-block .icon svg path:nth-of-type(1):not([opacity]),
.practice-block .icon svg path:nth-of-type(2)[opacity] {
  transform-origin: 32px 32px;
  animation: candle-flicker 3.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .practice-block .icon svg path { animation: none !important; }
}

/* If user is already on a Punjabi page, surface the pa toggle so they
   can switch back to EN/HI — even when multifaith-off normally hides it. */
html.lang-pa.multifaith-off .lang-toggle [data-lang="pa"] { display: inline !important; }
html.lang-pa.multifaith-off .lang-toggle .sep:has(+ [data-lang="pa"]) { display: inline !important; }

/* Lang toggle keyboard focus */
.lang-toggle [data-lang]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* beat text scrim — soft backdrop-blur behind text in beats where the bead
   may visually overlap, so text always reads regardless of bead position. */
.beat-character .text,
.beat-practice .blocks .practice-block,
.beat-mala .stanzas .stanza.is-on,
.beat-pricing > div,
.tradition-line {
  position: relative;
}
.beat-character .text::before,
.beat-practice .practice-block::before {
  content: "";
  position: absolute;
  inset: -32px -48px;
  z-index: -1;
  background: radial-gradient(ellipse at center,
    rgba(10, 10, 20, 0.55) 0%,
    rgba(10, 10, 20, 0.25) 60%,
    transparent 100%);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  border-radius: 24px;
  pointer-events: none;
}
.beat-pricing > div::before {
  content: "";
  position: absolute;
  inset: -60px -80px;
  z-index: -1;
  background: radial-gradient(ellipse at center,
    rgba(20, 16, 28, 0.65) 0%,
    rgba(20, 16, 28, 0.25) 70%,
    transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 32px;
  pointer-events: none;
}
.beat-mala .stanza {
  display: inline-block;
  padding: 8px 16px;
  margin-left: -16px;
  background: linear-gradient(90deg,
    rgba(10, 10, 20, 0.55) 0%,
    rgba(10, 10, 20, 0.35) 75%,
    transparent 100%);
}

/* Mobile: scrims shrink */
@media (max-width: 768px) {
  .beat-character .text::before,
  .beat-practice .practice-block::before { inset: -20px -24px; }
}


/* Mobile Beat 7: hide tradition glyph hint to avoid cramping */
@media (max-width: 600px) {
  .tradition-line .glyph-hint { display: none; }
}

/* Scroll cue: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; opacity: 0.55; }
}

/* Beat 5 material label mobile */
@media (max-width: 600px) {
  .material-label { padding: 0 24px; }
  .material-label .desc { font-size: 18px; min-height: 3.5em; }
}

/* Beat 1 mantra letter-by-letter reveal */
.mantra .mantra-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.beat-arrival.is-visible .mantra .mantra-char {
  opacity: 1;
  transform: translateY(0);
}

/* Beat transition shimmer — sweeps across viewport on entry into pinned beats */
.beat-shimmer {
  position: fixed;
  top: 50%;
  left: -10%;
  width: 120%;
  height: 1px;
  z-index: 8;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 208, 137, 0) 30%,
    rgba(255, 208, 137, 0.45) 50%,
    rgba(255, 208, 137, 0) 70%,
    transparent 100%);
  opacity: 0;
  transform: translateY(0) scaleX(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.beat-shimmer.is-firing {
  opacity: 1;
  transform: translateY(0) scaleX(1);
  animation: shimmer-sweep 1.2s cubic-bezier(.2,.7,.2,1);
}
@keyframes shimmer-sweep {
  0%   { transform: translateX(-30%) scaleX(0.5); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateX(30%) scaleX(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .beat-shimmer { display: none; } }

/* Yantra glow pulse on completion */
.yantra-stage svg.is-on.fully-drawn [data-y] {
  animation: yantra-glow-pulse 2.2s ease-out;
}
@keyframes yantra-glow-pulse {
  0%   { filter: drop-shadow(0 0 4px rgba(255, 208, 137, 0.35)); }
  40%  { filter: drop-shadow(0 0 12px rgba(255, 208, 137, 0.75)); }
  100% { filter: drop-shadow(0 0 4px rgba(255, 208, 137, 0.35)); }
}
@media (prefers-reduced-motion: reduce) {
  .yantra-stage svg.is-on.fully-drawn [data-y] { animation: none; }
}

/* Sunrise opener — Tweak-enabled prelude before Beat 1 */
html.sunrise-opener .beat-arrival { padding-top: 100vh; }
.sunrise-stage {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
html.sunrise-opener .sunrise-stage { opacity: 1; }

/* Horizon line — a thin gold streak that grows from center outward */
.sunrise-stage .horizon {
  position: absolute;
  top: 70%;
  left: 50%;
  width: 70vw;
  max-width: 900px;
  height: 1px;
  transform: translate(-50%, 0) scaleX(0);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 208, 137, 0) 20%,
    rgba(255, 208, 137, 0.8) 50%,
    rgba(255, 208, 137, 0) 80%,
    transparent 100%);
  transition: transform 2s cubic-bezier(.2, .7, .2, 1);
}
html.sunrise-opener .sunrise-stage .horizon {
  transform: translate(-50%, 0) scaleX(1);
}

/* Sunrise atmosphere glow */
.sunrise-stage .glow {
  position: absolute;
  inset: 30% 0 0 0;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(255, 175, 95, 0.25) 0%,
    rgba(255, 150, 90, 0.10) 35%,
    transparent 70%);
  opacity: 0;
  transition: opacity 1.6s ease 0.4s;
}
html.sunrise-opener .sunrise-stage .glow { opacity: 1; }

/* Once user scrolls past first 50vh, fade the sunrise stage */
html.sunrise-opener.past-sunrise .sunrise-stage {
  opacity: 0;
}

/* Text color tweak variants */
html[data-text-color="bone"]   { --bone: #F4ECDC; --mist: rgba(244, 236, 220, 0.6); }
html[data-text-color="warm"]   { --bone: #F8E8C8; --mist: rgba(248, 232, 200, 0.62); }
html[data-text-color="cool"]   { --bone: #E8ECF4; --mist: rgba(232, 236, 244, 0.62); }
html[data-text-color="ivory"]  { --bone: #FFF8E8; --mist: rgba(255, 248, 232, 0.65); }
html[data-text-color="gold"]   { --bone: #FFD089; --mist: rgba(255, 208, 137, 0.55); }

/* Ambient stars layer — subtle gold pinpoints scattered across viewport */
.stars-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
html.stars-on .stars-layer { opacity: 1; }
.stars-layer .star {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 208, 137, 0.5);
  animation: star-twinkle 4s ease-in-out infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.4); }
}
@media (prefers-reduced-motion: reduce) {
  .stars-layer .star { animation: none; opacity: 0.5; }
}

/* Tradition glyph hints — SVG (deity attributes / ayudhas) */
.tradition-line .glyph-hint.glyph-svg {
  display: inline-block;
  margin-top: 28px;
  width: 36px;
  height: 36px;
  color: var(--gold);
  opacity: 0.6;
}
.tradition-line .glyph-hint.glyph-svg svg {
  width: 100%; height: 100%;
}
@media (max-width: 600px) {
  .tradition-line .glyph-hint.glyph-svg { width: 28px; height: 28px; margin-top: 18px; }
}