/* The Guna Journey: in the clouds.
   Palette follows chinmayayuvakendra.com: white, black and gold. The guna colours
   live only in the sprites, the intro and small result accents. */

:root {
  color-scheme: light;
  --ink: #0b0906;
  --ink-dim: #5f584a;
  --paper: #f3eee3;
  --gold: #c9a24a;
  --gold-bright: #e8c45a;
  --gold-ink: #7a5c12;
  --sheen: linear-gradient(100deg, #c99a44 0%, #f6d98a 25%, #fff6d8 38%, #e6bd60 52%, #fff1c2 72%, #d4a64e 100%);
  --panel: rgba(255, 252, 245, 0.8);
  --panel-rule: rgba(201, 162, 74, 0.38);

  --sattva: #8fbbde;
  --rajas: #d3141c;
  --tamas: #2a2830;

  --f-display: 'Syne', 'Arial Black', system-ui, sans-serif;
  --f-accent: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Playfair Display', Georgia, serif;
  --f-deva: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', serif;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --band: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  overflow: hidden;
  font: 400 1rem/1.55 var(--f-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(120% 70% at 50% -12%, #fffdf6 0%, #fbf2dc 38%, rgba(251, 242, 220, 0) 72%),
    linear-gradient(180deg, #fdf9f0 0%, #f6ead0 58%, #eedcb4 100%);
  background-color: #f6ead0;
}
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul { margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.intro :focus-visible { outline-color: var(--gold-bright); }

/* ---------- Sky ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.sun {
  position: fixed; z-index: 0; pointer-events: none;
  left: 50%; top: -22vmax; width: 70vmax; height: 50vmax; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 238, 190, 0.75), rgba(255, 238, 190, 0));
}
.mist {
  position: fixed; inset: auto 0 0; height: 12vh; z-index: 35; pointer-events: none;
  background: linear-gradient(rgba(255, 253, 247, 0), rgba(255, 253, 247, 0.7));
}
body.in-intro .mist { opacity: 0; }

/* ---------- Masthead ---------- */
.masthead {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 10px;
  pointer-events: none;
}
.brand { font: 700 0.68rem/1 var(--f-body); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-ink); transition: color 0.6s; }
body.in-intro .brand { color: rgba(255, 255, 255, 0.6); }
.progress {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font: 700 0.7rem/1 var(--f-body); letter-spacing: 0.18em; color: var(--gold-ink);
  background: rgba(255, 252, 245, 0.75); border: 1px solid var(--panel-rule);
  padding: 8px 14px; border-radius: 100px;
}
.progress b { color: var(--ink); }
.progress-bar { width: clamp(56px, 12vw, 140px); height: 3px; background: rgba(122, 92, 18, 0.18); border-radius: 3px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--gold-ink); transition: width 0.6s var(--ease-expo); }

/* ---------- Scenes ---------- */
#stage { position: fixed; inset: 0; z-index: 10; }
.scene {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center;
  padding: 72px var(--gutter) max(28px, env(safe-area-inset-bottom));
  opacity: 0; transition: opacity 0.55s var(--ease);
}
.scene.is-on { opacity: 1; }
body.band .scene.reserve { padding-top: calc(64px + var(--band)); }
.scene > * { margin-block: auto; }

.panel {
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-rule);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 44px);
  box-shadow: 0 30px 80px rgba(122, 92, 18, 0.14), 0 0 0 8px rgba(255, 252, 245, 0.25);
}
.eyebrow { font: 700 0.72rem/1.4 var(--f-body); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 12px; }
.h2 { font: 800 clamp(1.7rem, 4.4vw, 3rem)/0.95 var(--f-display); letter-spacing: -0.03em; text-transform: uppercase; margin-bottom: 22px; }
.h2:focus { outline: none; }

/* ---------- Buttons ---------- */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 0 32px; border: 0; border-radius: 100px; cursor: pointer;
  background: var(--sheen); background-size: 160% 100%; background-position: 0 0;
  color: var(--ink); font: 700 0.85rem/1 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(160, 120, 30, 0.28), inset 0 0 0 1px rgba(122, 92, 18, 0.25);
  transition: background-position 0.6s var(--ease), transform 0.2s var(--ease), filter 0.3s, opacity 0.3s;
  touch-action: manipulation;
}
.cta:hover { background-position: 100% 0; }
.cta:active { transform: scale(0.97); }
.cta[aria-disabled='true'] { filter: grayscale(0.7); opacity: 0.5; }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 100px; cursor: pointer;
  border: 1px solid rgba(11, 9, 6, 0.3); background: rgba(255, 252, 245, 0.6);
  font: 700 0.78rem/1 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase;
  transition: background-color 0.25s var(--ease); touch-action: manipulation;
}
.ghost:hover { background: rgba(255, 252, 245, 0.95); }
.ghost:disabled { opacity: 0.35; cursor: default; }

/* ---------- Magic text ---------- */
.magic { font: italic 400 clamp(1.2rem, 2.6vw, 1.85rem)/1.35 var(--f-serif); max-width: 36ch; text-align: center; text-wrap: balance; }
.magic.big { font: 800 clamp(1.8rem, 5vw, 3.4rem)/1 var(--f-display); font-style: normal; letter-spacing: -0.03em; text-transform: uppercase; max-width: 18ch; }
.magic .w { display: inline-block; opacity: 0; transform: translateY(0.3em); filter: blur(6px); }
.magic.on .w { animation: word-in 1s var(--ease-expo) forwards; animation-delay: calc(var(--i) * 60ms); }
@keyframes word-in {
  0% { opacity: 0; transform: translateY(0.3em); filter: blur(6px); color: var(--gold-bright); }
  55% { opacity: 1; filter: blur(0); color: var(--gold-ink); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* ---------- Intro ---------- */
.intro { z-index: 20; background: #050505; color: #fff; transition: opacity 0.9s var(--ease); }
.intro.is-on { opacity: 1; }
.intro.lift { opacity: 0; pointer-events: none; }
.intro-inner { display: flex; flex-direction: column; align-items: center; width: 100%; }
.fig-wrap { transition: opacity 0.8s var(--ease), transform 1s var(--ease-expo); }
.fig { height: min(46vh, 380px); width: auto; overflow: visible; }
.fig .outline { fill: none; stroke: var(--gold-bright); stroke-width: 1.6; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.intro.play .fig .outline { transition: stroke-dashoffset 1.2s var(--ease); stroke-dashoffset: 0; }
.fig .liq { transform: translateY(410px); transition: transform 1.1s var(--ease); }
.intro.play .liq { transform: none; }
.intro.play .liq-t { transition-delay: 0.8s; }
.intro.play .liq-r { transition-delay: 1.3s; }
.intro.play .liq-s { transition-delay: 1.8s; }
.intro.drain .liq { transform: translateY(410px); transition-delay: 0s; transition-duration: 0.9s; }
.intro.drain .fig-wrap { opacity: 0.25; transform: scale(0.96); transition-delay: 0.5s; }
.intro-lines { position: relative; width: min(760px, 100%); min-height: 5.6em; margin-top: clamp(18px, 4vh, 36px); text-align: center; }
.intro-line {
  position: absolute; inset: 0; font: italic 400 clamp(1.3rem, 3.2vw, 2.2rem)/1.3 var(--f-serif);
  opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.9s var(--ease-expo);
}
.intro-line.on { opacity: 1; transform: none; }
.w-s { color: #d6ecfa; } .w-r { color: #ff5a46; } .w-t { color: #a8a4c0; }
.skip-intro {
  position: absolute; right: var(--gutter); bottom: max(20px, env(safe-area-inset-bottom));
  min-height: 44px; padding: 0 18px; border-radius: 100px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3); background: transparent; color: rgba(255, 255, 255, 0.75);
  font: 700 0.7rem/1 var(--f-body); letter-spacing: 0.18em; text-transform: uppercase;
}
.orb { position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; opacity: 0; pointer-events: none; }
.orb.sattva { background: radial-gradient(circle at 35% 35%, #fff, #bfe0f4 60%, #7fb8dd); box-shadow: 0 0 34px 10px rgba(207, 232, 247, 0.75); }
.orb.rajas { background: radial-gradient(circle at 35% 35%, #ffb08a, #d3141c 60%, #7a0610); box-shadow: 0 0 34px 10px rgba(255, 90, 40, 0.6); }
.orb.tamas { background: radial-gradient(circle at 35% 35%, #8a8698, #2a2830 60%, #0e0d12); box-shadow: 0 0 34px 10px rgba(160, 155, 190, 0.55); }

/* ---------- Mirror ---------- */
.mirror-wrap { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2.6vh, 26px); width: min(760px, 100%); text-align: center; }
.mirror-frame {
  /* One size throughout: the sprites fly to the mirror once, so it must not move after they leave. */
  position: relative; width: min(28vh, 50vw, 250px); aspect-ratio: 3 / 4; padding: 12px; border-radius: 50%;
  background: var(--sheen); background-size: 200% 100%;
  box-shadow: 0 24px 60px rgba(122, 92, 18, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  opacity: 0; transform: scale(0.7) translateY(20px);
  transition: opacity 0.9s var(--ease), transform 1.3s var(--ease-expo);
}
.mirror-frame::before {
  content: ''; position: absolute; left: 50%; top: -16px; width: 26px; height: 26px;
  transform: translateX(-50%) rotate(45deg); background: var(--sheen); border-radius: 4px;
  box-shadow: 0 4px 10px rgba(122, 92, 18, 0.3);
}
.mirror.on .mirror-frame { opacity: 1; transform: none; }
.mirror-glass {
  position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(80% 60% at 50% 28%, #fffdf6, #eaf1f4 55%, #cad8e0);
  box-shadow: inset 0 0 40px rgba(60, 80, 100, 0.28);
}
.refl { position: absolute; width: 24%; opacity: 0; transform: scaleX(-1); transition: opacity 1.4s var(--ease); }
.refl-s { left: 8%; top: 30%; }
.refl-r { left: 35%; top: 18%; }
.refl-t { left: 62%; top: 34%; }
.mirror.reflect .refl { opacity: 0.8; animation: refl-bob 4s ease-in-out infinite; }
.mirror.reflect .refl-r { animation-delay: -1.3s; }
.mirror.reflect .refl-t { animation-delay: -2.6s; }
@keyframes refl-bob { 0%, 100% { transform: scaleX(-1) translateY(-3%); } 50% { transform: scaleX(-1) translateY(3%); } }
.glint { position: absolute; inset: -30%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.9) 50%, transparent 58%); transform: translateX(-80%); }
.mirror.glint-on .glint { animation: glint 1.8s var(--ease) forwards; }
@keyframes glint { to { transform: translateX(80%); } }
/* The invitation holds its space from the start, so nothing shifts when it appears. */
.invite { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 6px; visibility: hidden; opacity: 0; transition: opacity 0.8s var(--ease), visibility 0s 0.8s; }
.mirror.invited .invite { visibility: visible; opacity: 1; transition: opacity 0.8s var(--ease); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Instructions ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; align-items: start; }
.step-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.step-ic svg { width: 30px; height: 30px; }
.steps h3 { font: 800 1.02rem/1.15 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; margin: 3px 0 5px; }
.steps p { color: var(--ink-dim); }
.steps strong { color: var(--ink); }
.fine { font-size: 0.88rem; color: var(--ink-dim); margin-bottom: 22px; }

/* ---------- Questionnaire ---------- */
.quiz-card { transition: opacity 0.28s var(--ease), transform 0.4s var(--ease-expo); }
.quiz-card.leaving { opacity: 0; transform: translateY(-16px); }
.quiz-card.entering { opacity: 0; transform: translateY(16px); transition: none; }
.q-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; font: 700 0.7rem/1.4 var(--f-body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 10px; }
.q-meta b { color: var(--ink); }
.q-stem { font: 700 clamp(1.35rem, 3.2vw, 2.2rem)/1.12 var(--f-display); letter-spacing: -0.02em; margin-bottom: 16px; }
.q-stem:focus { outline: none; }
.amrit { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.drops { display: flex; gap: 7px; }
.dropi {
  width: 15px; height: 15px; border-radius: 50% 0 50% 50%; transform: rotate(-45deg);
  background: radial-gradient(circle at 30% 70%, #fff6d8, #e8c45a 45%, #a37b1c);
  box-shadow: 0 0 8px rgba(232, 196, 90, 0.65);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.dropi.used { opacity: 0.14; transform: rotate(-45deg) scale(0.7); box-shadow: none; }
.amrit-label { font: 600 0.92rem/1.3 var(--f-body); }
.amrit-label b { font: 400 1.5rem/1 var(--f-accent); color: var(--gold-ink); margin-right: 2px; }
.pots { list-style: none; padding: 0; display: grid; gap: 10px; }
.pot-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'pot text' 'pot scale'; gap: 10px 14px; align-items: center;
  padding: 10px 12px 10px 10px; border-radius: 20px;
  border: 1px solid rgba(11, 9, 6, 0.1); background: rgba(255, 255, 255, 0.55);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pot-row.has { border-color: rgba(201, 162, 74, 0.65); background: rgba(255, 248, 226, 0.9); }
.pot-btn { position: relative; width: 84px; height: 88px; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
.pot-btn svg { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 100%; }
.pot-btn .n {
  position: absolute; right: -6px; top: 0; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 15px;
  background: var(--ink); color: #fff; font: 400 1.05rem/30px var(--f-accent); text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 252, 245, 0.95); transition: background-color 0.3s;
}
.pot-row.has .n { background: var(--gold-ink); }
.pot-btn { grid-area: pot; }
.pot-text { grid-area: text; font-size: clamp(0.98rem, 1.4vw, 1.08rem); line-height: 1.42; user-select: none; }
/* How many drops: one tap on a number sets it. Filled numbers read as a gauge. */
.scale { grid-area: scale; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.tick {
  min-width: 0; min-height: 40px; padding: 0; border-radius: 10px; cursor: pointer; touch-action: manipulation;
  border: 1px solid rgba(11, 9, 6, 0.18); background: rgba(255, 255, 255, 0.8);
  font: 400 1.05rem/1 var(--f-accent); color: var(--ink);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s, color 0.2s;
}
.tick.on { background: #f1d27e; border-color: #c9a24a; }
.tick.sel { background: var(--ink); border-color: var(--ink); color: #fff; }
.tick.off { opacity: 0.35; }
.pot-liq { transition: transform 0.45s var(--ease); }
.wave-move { animation: wave 2.4s linear infinite; }
@keyframes wave { to { transform: translateX(50px); } }
.jump { animation: jump 0.45s var(--ease); }
@keyframes jump {
  0% { transform: none; } 30% { transform: translateY(-14px) scale(1.04, 0.96); }
  55% { transform: translateY(0) scale(0.96, 1.05); } 75% { transform: translateY(-3px); } 100% { transform: none; }
}
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.nav-msg { min-height: 1.5em; margin-top: 12px; font-size: 0.92rem; font-weight: 600; color: #8a1d10; }
.q-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ---------- Email ---------- */
.signup .panel { width: min(620px, 100%); }
.signup .lede { color: var(--ink-dim); font-size: 1.05rem; margin-bottom: 22px; }
.signup .fine { margin: 20px 0 0; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > span { font: 700 0.72rem/1.4 var(--f-body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-ink); }
.field i { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-dim); }
.field input {
  width: 100%; min-height: 54px; padding: 0 18px; border-radius: 16px;
  border: 1px solid var(--panel-rule); background: rgba(255, 255, 255, 0.9); color: var(--ink);
  font: 500 1.08rem/1.2 var(--f-body);
}
.field input:focus { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-color: var(--gold); }
.quiz.busy .pot-btn, .quiz.busy .tick { pointer-events: none; }
.flydrop {
  position: fixed; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none;
  border-radius: 50% 0 50% 50%; background: radial-gradient(circle at 30% 70%, #fff6d8, #e8c45a 45%, #a37b1c);
  box-shadow: 0 0 10px rgba(232, 196, 90, 0.8);
}
@media (max-width: 600px) {
  .pot-row { gap: 8px 10px; padding: 8px 8px 8px 6px; grid-template-areas: 'pot text' 'scale scale'; }
  .pot-btn { width: 62px; height: 66px; }
  .pot-btn .n { min-width: 26px; height: 26px; font-size: 0.95rem; line-height: 26px; right: -4px; }
  .scale { gap: 3px; }
  .tick { min-height: 38px; border-radius: 8px; font-size: 0.98rem; }
  .pot-text { font-size: 0.94rem; }
  .q-nav .cta, .q-nav .ghost { flex: 1 1 auto; }
}

/* ---------- Sprites ---------- */
#sprites, #fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#sprites { z-index: 40; }
#fx { z-index: 45; }
.sprite { position: absolute; left: 0; top: 0; width: var(--sw, 100px); height: calc(var(--sw, 100px) * 1.4); transform-origin: 50% 50%; will-change: transform; }
.sp-tilt, .sp-act, .sp-bob { width: 100%; height: 100%; }
.sp-tilt { perspective: 600px; }
.sp-bob { animation: bob 3.6s ease-in-out infinite; }
.sprite-rajas .sp-bob { animation-duration: 2.7s; animation-delay: -1s; }
.sprite-tamas .sp-bob { animation-duration: 4.8s; animation-delay: -2s; }
.sp-bob img { width: 100%; height: 100%; filter: drop-shadow(0 14px 14px rgba(90, 60, 10, 0.2)); -webkit-user-drag: none; user-select: none; }
body.in-intro .sp-bob img { filter: drop-shadow(0 0 18px rgba(255, 240, 200, 0.3)); }
body.in-intro .sprite-tamas .sp-bob img { filter: drop-shadow(0 0 2px rgba(220, 216, 240, 0.9)) drop-shadow(0 0 22px rgba(190, 185, 225, 0.55)); }
@keyframes bob { 0%, 100% { transform: translateY(-4%) rotate(-2deg); } 50% { transform: translateY(4%) rotate(2deg); } }
.sp-tag {
  position: absolute; left: 50%; top: 100%; margin-top: 4px; white-space: nowrap;
  transform: translateX(-50%) scale(calc(1 / var(--k, 1))); transform-origin: 50% 0;
  font: 700 0.72rem/1 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
  background: rgba(255, 252, 245, 0.92); border: 1px solid var(--panel-rule); padding: 7px 12px; border-radius: 100px;
  opacity: 0; transition: opacity 0.6s;
}
.sprite.tagged .sp-tag { opacity: 1; }
.sp-tag b { font: 400 0.95rem/1 var(--f-accent); letter-spacing: 0.04em; margin-left: 4px; }

.do-pop { animation: pop 0.75s var(--ease-expo); }
@keyframes pop { 0% { transform: scale(0); } 55% { transform: scale(1.18); } 100% { transform: none; } }
.do-gulp { animation: gulp 0.65s var(--ease); transform-origin: 50% 80%; }
@keyframes gulp {
  0% { transform: none; } 18% { transform: scale(1.12, 0.84) translateY(6%); } 38% { transform: scale(0.92, 1.1); }
  58% { transform: scale(1.08, 0.9) translateY(4%); } 80% { transform: scale(0.97, 1.04); } 100% { transform: none; }
}
.do-hop { animation: hop 0.65s var(--ease); transform-origin: 50% 100%; }
@keyframes hop { 0%, 100% { transform: none; } 35% { transform: translateY(-16%) scale(0.96, 1.05); } 70% { transform: translateY(0) scale(1.05, 0.95); } }
.do-spin { animation: spin 1s var(--ease); }
@keyframes spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.do-peek { animation: peek 1.8s var(--ease); }
@keyframes peek { 0%, 100% { transform: none; } 30%, 70% { transform: rotate(var(--lean, 8deg)) translateX(var(--nudge, 6%)); } }
.sprite-sattva .do-peek { --lean: 8deg; --nudge: 8%; }
.sprite-rajas .do-peek { --lean: -8deg; --nudge: -8%; }
.sprite-tamas .do-peek { --lean: -6deg; --nudge: -6%; }
.do-cheer { animation: cheer 1.1s var(--ease); transform-origin: 50% 100%; }
@keyframes cheer {
  0%, 100% { transform: none; } 20% { transform: translateY(-14%) rotate(-6deg); } 40% { transform: none; }
  60% { transform: translateY(-10%) rotate(6deg); } 80% { transform: none; }
}

/* ---------- Results: the scroll ---------- */
.scroll-wrap { width: min(700px, 100%); display: flex; flex-direction: column; }
.results.unroll .scroll-wrap { animation: float 7s ease-in-out 1.6s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.roller {
  position: relative; z-index: 2; height: 26px; margin: 0 8px; border-radius: 13px;
  background: linear-gradient(180deg, #6b4a1c 0%, #c9a24a 30%, #fff1c2 50%, #c9a24a 70%, #5e4116 100%);
  box-shadow: 0 8px 18px rgba(80, 55, 15, 0.3);
}
.roller::before, .roller::after {
  content: ''; position: absolute; top: 50%; width: 20px; height: 38px; margin-top: -19px; border-radius: 10px;
  background: linear-gradient(180deg, #8a6a1f, #f6d98a 45%, #e6bd60 60%, #7a5c12);
}
.roller::before { left: -14px; } .roller::after { right: -14px; }
.paper {
  margin: -13px 20px; position: relative; z-index: 1; overflow: hidden; max-height: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%),
    linear-gradient(90deg, #eadfc6 0%, #f7f1e3 8%, #faf5ea 50%, #f7f1e3 92%, #eadfc6 100%);
  box-shadow: inset 0 16px 18px -14px rgba(80, 55, 15, 0.4), inset 0 -16px 18px -14px rgba(80, 55, 15, 0.4);
  transition: max-height 1.6s var(--ease-expo);
}
.results.unroll .paper { max-height: calc(100svh - 160px - var(--band)); }
.paper-inner { max-height: calc(100svh - 160px - var(--band)); overflow-y: auto; padding: 40px clamp(20px, 5vw, 52px) 36px; scrollbar-color: var(--gold) transparent; }
.paper-inner:focus { outline: none; }
.r-title { font: italic 400 clamp(1.8rem, 4.4vw, 2.8rem)/1.08 var(--f-serif); margin-bottom: 14px; }
.r-title:focus { outline: none; }
.r-lede { font-size: 1.05rem; margin-bottom: 10px; }
.r-key { font-size: 0.9rem; color: var(--ink-dim); margin-bottom: 22px; }
.r-gunas { list-style: none; padding: 0; margin: 0 0 30px; border-top: 1px solid rgba(11, 9, 6, 0.14); }
.r-guna { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid rgba(11, 9, 6, 0.14); }
.r-name { font: 800 1.25rem/1.1 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; }
.r-name .deva { font: 400 0.9em/1 var(--f-deva); text-transform: none; color: var(--ink-dim); margin-left: 8px; }
.r-pct { font: 400 2.4rem/0.9 var(--f-accent); grid-row: span 2; align-self: center; }
.r-sub { color: var(--ink-dim); font-size: 0.92rem; }
.r-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(11, 9, 6, 0.08); overflow: hidden; margin-top: 8px; }
.r-bar i { display: block; height: 100%; border-radius: 3px; }
.r-guna.sattva .r-bar i { background: linear-gradient(90deg, #cfe6f7, #8fbbde); }
.r-guna.rajas .r-bar i { background: linear-gradient(90deg, #ff6a4a, #b80f18); }
.r-guna.tamas .r-bar i { background: linear-gradient(90deg, #6b6878, #16151b); }
.r-section { margin-bottom: 28px; }
.r-section h3 { font: 700 0.72rem/1.4 var(--f-body); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 10px; }
.r-list { margin: 0; padding-left: 20px; }
.r-list li { margin-bottom: 6px; }
.r-areas { list-style: none; padding: 0; margin: 0; }
.r-areas li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(11, 9, 6, 0.12); }
.r-areas b { font: 800 0.98rem/1.3 var(--f-display); text-transform: uppercase; }
.r-areas span { color: var(--ink-dim); font-size: 0.88rem; text-align: right; }
.r-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.r-practices { list-style: none; padding: 0; margin: 0; counter-reset: p; }
.r-practices li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(11, 9, 6, 0.12); counter-increment: p; }
.r-practices li::before { content: counter(p, decimal-leading-zero); font: 400 1.5rem/1 var(--f-accent); color: var(--gold-ink); }
.r-note { font: italic 400 1.1rem/1.45 var(--f-serif); margin: 26px 0 18px; }
.r-fine { font-size: 0.84rem; color: var(--ink-dim); margin-bottom: 24px; }
.r-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.r-link { font: 700 0.76rem/1 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); text-decoration: none; border-bottom: 1px solid rgba(122, 92, 18, 0.4); padding-bottom: 5px; }
.r-sign { text-align: center; font: 400 1.2rem/1 var(--f-deva); color: var(--gold-ink); margin-top: 26px; }
@media (max-width: 600px) {
  .r-cols { grid-template-columns: 1fr; }
  .paper { margin: -13px 12px; }
}

.noscript { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; background: #050505; color: #fff; }

/* ---------- Touch panel (panel.html: html.kiosk) ---------- */
.over { display: none; }
html.kiosk, html.kiosk body { -webkit-user-select: none; user-select: none; touch-action: pan-y; overscroll-behavior: none; -webkit-touch-callout: none; }
html.kiosk .brand { margin-right: auto; }
html.kiosk .progress { margin-left: 0; }
html.kiosk :is(body[data-scene='howto'], body[data-scene='quiz'], body[data-scene='signup'], body[data-scene='results']) .over {
  display: inline-flex; align-items: center; pointer-events: auto; cursor: pointer;
  min-height: 48px; padding: 0 22px; border-radius: 100px; border: 1px solid var(--panel-rule);
  background: rgba(255, 252, 245, 0.85); color: var(--gold-ink);
  font: 700 0.74rem/1 var(--f-body); letter-spacing: 0.18em; text-transform: uppercase; touch-action: manipulation;
}
/* No hover on a touch screen: a tapped button must not stay lit for the next visitor. */
html.kiosk .cta:hover { background-position: 0 0; }
html.kiosk .ghost:hover { background: rgba(255, 252, 245, 0.6); }
html.kiosk .cta { min-height: 64px; padding: 0 38px; font-size: 0.95rem; }
html.kiosk .ghost { min-height: 58px; }
html.kiosk .skip-intro { min-height: 54px; padding: 0 24px; }
html.kiosk .tick { min-height: 52px; font-size: 1.2rem; }
html.kiosk .pot-text { font-size: clamp(1.02rem, 1.5vw, 1.18rem); }
.k-veil {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(40, 30, 10, 0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.k-card {
  width: min(520px, 100%); padding: 36px 32px 30px; border-radius: 28px; text-align: center;
  background: #fffcf5; border: 1px solid var(--panel-rule); box-shadow: 0 30px 80px rgba(60, 40, 10, 0.3);
}
.k-title { font: 800 clamp(1.5rem, 3vw, 2rem)/1.05 var(--f-display); text-transform: uppercase; letter-spacing: -0.02em; margin-bottom: 12px; }
.k-body { color: var(--ink-dim); margin-bottom: 26px; font-size: 1.05rem; }
.k-count { font: 400 3rem/1 var(--f-accent); color: var(--gold-ink); margin-bottom: 20px; }
.k-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
html.kiosk .field input { min-height: 66px; font-size: 1.3rem; caret-color: transparent; cursor: pointer; }
html.kiosk .field input:focus { outline-width: 3px; }
html.kiosk body.kb-on .scene { padding-bottom: calc(var(--kbh, 0px) + 24px); }
.kb {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: grid; justify-items: center; gap: 10px;
  padding: 14px 16px max(18px, env(safe-area-inset-bottom, 0px));
  background: rgba(255, 252, 245, 0.97); border-top: 1px solid var(--panel-rule); box-shadow: 0 -24px 60px rgba(60, 40, 10, 0.18);
  animation: kb-in 0.35s var(--ease-expo);
}
.kb[hidden] { display: none; }
@keyframes kb-in { from { transform: translateY(40%); opacity: 0; } }
.kb-row { display: flex; gap: 10px; width: min(1240px, 100%); }
.key {
  flex: 1 1 0; min-width: 0; height: 66px; padding: 0 4px; border-radius: 14px; touch-action: manipulation;
  border: 1px solid var(--panel-rule); background: #fff; color: var(--ink);
  font: 600 1.4rem/1 var(--f-body); transition: background-color 0.12s, color 0.12s, transform 0.08s;
}
.key.down, .key.on { background: var(--gold-bright); color: var(--ink); }
.key.down { transform: translateY(2px); }
.key.wide { flex-grow: 1.7; font-size: 1.05rem; }
.key.sug { flex-grow: 1.5; font-size: 1.05rem; color: var(--gold-ink); }
.key.long { flex-grow: 2.5; }
.key.space { flex-grow: 4; font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.key.go { background: var(--sheen); font-size: 0.9rem; letter-spacing: 0.14em; text-transform: uppercase; }
.key.off { visibility: hidden; }

/* ---------- Reduced motion (and ?calm) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .magic .w { opacity: 1; transform: none; filter: none; }
}
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }
html.calm .magic .w { opacity: 1; transform: none; filter: none; }

/* ---------- Print: the reflection only ---------- */
@media print {
  body { overflow: visible; background: #fff; }
  #sky, .sun, .mist, .masthead, #sprites, #fx, .scene:not(.results), .roller, .r-actions { display: none !important; }
  #stage, .scene { position: static; overflow: visible; padding: 0; opacity: 1; }
  .paper, .paper-inner { max-height: none !important; overflow: visible; box-shadow: none; background: #fff; margin: 0; }
}
