/* White, devotional, print-like. One accent (sindoor), one fine gold rule. */
:root {
  --paper: #ffffff;
  --ink: #1f1a17;
  --muted: #6f655d;
  --rule: #e4dcd2;
  --sindoor: #b3261e;
  --gold: #b8923a;
  --lit: #fbeee0;
  --deva: "Tiro Devanagari Hindi", "Kohinoor Devanagari", "Noto Serif Devanagari", serif;
  --latin: "EB Garamond", Georgia, serif;
  --tamil: "Tiro Tamil", "Tamil Sangam MN", "Noto Serif Tamil", serif;
  --bangla: "Tiro Bangla", "Bangla Sangam MN", "Noto Serif Bengali", serif;
  --local: var(--deva);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 19px/1.6 var(--latin);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
html[lang="hi"] body { font-family: var(--deva); font-size: 18px; }
html[lang="ta"] { --local: var(--tamil); }
html[lang="bn"] { --local: var(--bangla); }
html[lang="ta"] body { font-family: var(--tamil); font-size: 17px; line-height: 1.75; }
html[lang="bn"] body { font-family: var(--bangla); font-size: 18px; line-height: 1.7; }
/* Text marked with its own language keeps its own script's font, whatever the page language. */
body [lang="hi"] { font-family: var(--deva); }
body [lang="en"] { font-family: var(--latin); }
body [lang="ta"] { font-family: var(--tamil); }
body [lang="bn"] { font-family: var(--bangla); }

main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }

.top {
  width: 100%; margin: 0; padding: 10px 8px 0;
  display: flex; justify-content: space-between; align-items: center;
}
.home { display: block; width: 46px; height: 46px; border-radius: 50%; padding: 2px; border: 1px solid var(--sindoor); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--gold); transition: transform .2s ease; }
.home:hover { transform: scale(1.06); }
.home { display: flex; align-items: center; justify-content: center; color: var(--sindoor); background: var(--paper); }
.home svg { width: 26px; height: 26px; }
.langs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; font-size: 15px; line-height: 1.3; }
.langs a, .langs span { padding: 4px 0; border-bottom: 1px solid transparent; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--sindoor); border-bottom-color: currentColor; }
.langs [aria-current] { color: var(--sindoor); border-bottom-color: var(--gold); }
.grid-note { text-align: center; font-size: 14px; color: var(--muted); max-width: 30em; margin: 12px auto 0; line-height: 1.6; }

.intro { text-align: center; margin: 8px 0 26px; }

/* Sri Rama, blessing – set in a temple arch */
.darshan { margin: 4px auto 18px; width: clamp(150px, 34vw, 210px); }
.arch {
  position: relative; padding: 5px; border: 1px solid var(--gold);
  border-radius: 50% 50% 4px 4px / 34% 34% 4px 4px; background: var(--paper);
}
.arch::before {
  content: ""; position: absolute; inset: -6px; border: 1px solid var(--sindoor);
  border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px; pointer-events: none;
}
.arch img {
  display: block; width: 100%; height: auto; aspect-ratio: 526 / 720; object-fit: cover; object-position: 50% 8%;
  border-radius: 50% 50% 2px 2px / 33% 33% 2px 2px;
}
.darshan figcaption { font-family: var(--deva); color: var(--sindoor); font-size: 15px; margin-top: 12px; letter-spacing: .04em; }
.invocation {
  font-family: var(--deva); color: var(--sindoor); font-size: 20px; letter-spacing: .06em; margin: 0 0 14px;
}
h1 {
  font-family: var(--latin); font-weight: 500; font-size: clamp(32px, 6.4vw, 46px);
  line-height: 1.1; margin: 0; letter-spacing: .01em;
}
html:not([lang="en"]) h1 { font-family: var(--local); font-weight: 400; }
.kodanda { display: block; width: 112px; height: 38px; margin: 14px auto 12px; color: var(--gold); }
.lotus-mark { display: block; width: 26px; height: 26px; margin: 0 auto 10px; color: var(--sindoor); }
.prompt { color: var(--muted); margin: 0 auto; max-width: 30em; font-size: 18px; }

/* The Shalaka: a printed table in a double sindoor frame with lotus corners. */
.board-wrap { position: relative; border: 1px solid var(--sindoor); padding: 4px; margin: 0 6px; }
.corner {
  position: absolute; width: 18px; height: 18px; color: var(--sindoor); background: var(--paper);
  padding: 1px;
}
.corner.tl { left: -10px; top: -10px; } .corner.tr { right: -10px; top: -10px; }
.corner.bl { left: -10px; bottom: -10px; } .corner.br { right: -10px; bottom: -10px; }
.board {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: repeat(15, minmax(0, 1fr));
  border: 1px solid var(--sindoor);
  font-family: var(--deva);
}
.cell {
  aspect-ratio: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: clamp(11px, 2.6vw, 20px); line-height: 1;
  color: var(--ink); background: var(--paper);
  border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  border-radius: 0; padding: 0; margin: 0; cursor: pointer;
  transition: background-color .45s ease, color .45s ease;
  overflow: hidden; white-space: nowrap;
}
.cell:nth-child(15n) { border-right: 0; }
.cell:nth-child(n+211) { border-bottom: 0; }
.cell:hover { background: var(--lit); }
.cell:focus-visible { outline: 2px solid var(--sindoor); outline-offset: -2px; }
.board.done .cell { cursor: default; }
.board.done .cell:hover { background: var(--paper); }
.cell.rest { color: #d6cdc3; }
.board.done .cell.lamp { background: #fdf1dc; color: var(--sindoor); }
.cell.origin, .board.done .cell.origin { background: var(--sindoor); color: #fff; transition-delay: 0ms; }
.cell { transition: background-color .35s ease, color .35s ease, text-shadow .35s ease; }
.cell.rest { color: #dcd4cb; }
.board.done .cell.lamp { background: #fdf0d6; color: var(--sindoor); text-shadow: 0 0 6px rgba(232,163,23,.55); }

/* The arrow's flight */
.current { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; transition: opacity .4s ease; }
.current path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.current .thread { stroke: var(--gold); stroke-width: 1.2; opacity: .85; }
.current.fade { opacity: 0; }
.forming {
  min-height: 1.6em; margin: 16px 0 0; text-align: center; font-family: var(--deva);
  font-size: clamp(18px, 4vw, 24px); color: var(--sindoor); letter-spacing: .02em; transition: opacity .4s ease;
}
.forming span { animation: surface .35s ease-out; display: inline-block; }
.forming.fade { opacity: 0; }

.answer { margin: 34px 0 10px; text-align: center; animation: appear .7s ease-out; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.verdict {
  margin: 0 0 18px; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
html:not([lang="en"]) .verdict { letter-spacing: .04em; font-size: 17px; }
.verdict b { font-weight: 500; color: var(--sindoor); }
.chaupai {
  margin: 0 auto; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--deva); font-size: clamp(21px, 4.8vw, 29px); line-height: 1.75; color: var(--ink);
}
.chaupai span { display: block; }
.chaupai .w { font-style: normal; display: inline-block; }
.chaupai .w.in { opacity: 0; animation: surface .6s ease-out forwards; }
@keyframes surface { from { opacity: 0; transform: translateY(5px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.source { color: var(--gold); font-size: 15px; margin: 12px 0 18px; letter-spacing: .04em; }
.meaning { font-size: 20px; font-style: italic; margin: 0 auto 12px; max-width: 30em; }
html:not([lang="en"]) .meaning { font-style: normal; font-size: 19px; }
.context { color: var(--muted); font-size: 17px; margin: 0 auto; max-width: 30em; }
.actions { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.actions button {
  font: inherit; font-size: 17px; cursor: pointer; background: none; border: 0; padding: 2px 0;
  color: var(--sindoor); border-bottom: 1px solid currentColor;
}
.actions .ghost { color: var(--muted); border-bottom-color: var(--rule); }
.actions button:hover { color: var(--ink); }

.about { margin: 40px auto 10px; max-width: 34em; color: var(--muted); font-size: 17px; border-top: 1px solid var(--rule); padding-top: 18px; }
.about summary { cursor: pointer; color: var(--ink); text-align: center; list-style: none; }
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: " +"; color: var(--gold); }
.about[open] summary::after { content: " –"; }
.about p { margin: 12px 0 0; }

.foot { text-align: center; padding: 28px 16px 34px; color: var(--muted); font-size: 15px; }
.foot span { display: block; }
.foot .foot-hi { font-family: var(--deva); font-size: 15px; margin-bottom: 2px; }
.foot .foot-local { font-family: var(--local); font-size: 14.5px; margin-bottom: 2px; }
a { color: var(--sindoor); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Quiet, crawlable sections below the Shalaka */
.sections { margin: 40px auto 0; max-width: 34em; border-top: 1px solid var(--rule); }
.sections details { border-bottom: 1px solid var(--rule); padding: 12px 0; color: var(--muted); font-size: 17px; }
.sections summary { cursor: pointer; list-style: none; text-align: center; }
.sections summary::-webkit-details-marker { display: none; }
.sections summary h2 { display: inline; font: inherit; font-size: 18px; color: var(--ink); }
.sections summary::after { content: " +"; color: var(--gold); }
.sections details[open] summary::after { content: " –"; }
.sections h3 { font-size: 17px; font-weight: 500; color: var(--ink); margin: 16px 0 4px; }
.sections p { margin: 8px 0; }
.sections ol { padding-left: 1.3em; margin: 12px 0 4px; }
.sections .nine li { margin: 6px 0; font-family: var(--deva); }
.sections .nine a { text-decoration: none; color: var(--ink); }
.sections .nine a:hover { color: var(--sindoor); }
.tone { font-family: var(--latin); font-size: 13px; letter-spacing: .08em; margin-left: 6px; }
.tone.good { color: #2e7d32; }
.tone.doubt, .tone.bad { color: #b3261e; }
html:not([lang="en"]) .tone { font-family: var(--local); letter-spacing: 0; }
.credit { font-size: 14px; }
#more { font-size: 17px; text-decoration: none; border-bottom: 1px solid var(--rule); color: var(--muted); }

/* Chaupai pages */
.cp { text-align: center; max-width: 34em; margin: 8px auto 0; }
.cp h1.chaupai { font-weight: 400; }
.cp h2 { font-size: 14px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 26px 0 6px; }
html:not([lang="en"]) .cp h2 { letter-spacing: .04em; font-size: 16px; }
.cp p { margin: 0 0 8px; }
.cp .tr { font-style: italic; color: var(--muted); font-size: 17px; }
.cp .tr .lbl { display: block; font-style: normal; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.cp .cta { margin-top: 30px; font-size: 19px; }
.pn { display: flex; justify-content: space-between; gap: 16px; margin: 34px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--deva); font-size: 15px; }
.pn a { text-decoration: none; color: var(--muted); }
.foot .lotus-mark { width: 22px; height: 22px; color: var(--gold); margin-bottom: 8px; }

/* Page border in the manner of a Gita Press page: double rules, राम along every side. */
:root { --inset: 10px; --band: 22px; }
@media (max-width: 600px) { :root { --inset: 6px; --band: 17px; } }
.page { padding: calc(var(--inset) + var(--band) + 4px); padding-top: calc(var(--inset) + var(--band)); display: flex; flex-direction: column; min-height: 100vh; }
.frame { position: fixed; inset: var(--inset); pointer-events: none; z-index: 10;
  border: 1.5px solid var(--sindoor); box-shadow: 0 0 0 calc(var(--inset) + 2px) var(--paper); }
.frame::after { content: ""; position: absolute; inset: calc(var(--band) - 1.5px); border: 1px solid var(--sindoor); }
.band {
  position: absolute; display: flex; justify-content: space-around; align-items: center; overflow: hidden;
  font-family: var(--deva); color: var(--sindoor); font-size: calc(var(--band) * .5); line-height: 1;
  background: #fffaf3;
}
.band.b-top, .band.b-bottom { left: var(--band); right: var(--band); height: calc(var(--band) - 1.5px); }
.band.b-top { top: 0; } .band.b-bottom { bottom: 0; }
.band.b-left, .band.b-right { top: var(--band); bottom: var(--band); width: calc(var(--band) - 1.5px); flex-direction: column; }
.band.b-left { left: 0; } .band.b-right { right: 0; }
.band.b-left span { writing-mode: vertical-rl; transform: rotate(180deg); }
.band.b-right span { writing-mode: vertical-rl; }
.fc { position: absolute; width: calc(var(--band) - 1.5px); height: calc(var(--band) - 1.5px); color: var(--sindoor); padding: 2px; background: #fffaf3; }
.fc.tl { top: 0; left: 0; } .fc.tr { top: 0; right: 0; } .fc.bl { bottom: 0; left: 0; } .fc.br { bottom: 0; right: 0; }

.outcome { font-weight: 600; color: var(--ink); }
html:not([lang="en"]) .outcome { font-weight: 700; }
.outcome.pos { color: #2e7d32; }
.outcome.neg { color: #b3261e; }
.current .bana { filter: drop-shadow(0 0 2px rgba(184,146,58,.7)); transition: opacity .3s; }
.current .bana .shaft { stroke: var(--sindoor); stroke-width: 1.8; }
.current .bana .head { fill: var(--sindoor); stroke: none; }
.current .bana .feather { stroke: var(--gold); stroke-width: 1.3; }

/* Credits and Kand illustrations */
.darshan figcaption span { display: block; }
.credit-line { display: block; margin-top: 4px; font-family: var(--latin); font-size: 12.5px; color: var(--muted); text-decoration: none; letter-spacing: .01em; }
html:not([lang="en"]) .credit-line { font-family: var(--local); }
.credit-line:hover { color: var(--sindoor); text-decoration: underline; }
.kand-art { margin: 22px auto 26px; max-width: 520px; }
.art-frame { border: 1px solid var(--sindoor); padding: 5px; outline: 1px solid var(--gold); outline-offset: 4px; background: var(--paper); }
.art-frame img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; }
.kand-art figcaption { margin-top: 14px; font-size: 16px; color: var(--ink); }
.kand-art .art-title { display: block; font-style: italic; }
html:not([lang="en"]) .kand-art .art-title { font-style: normal; }
.cp .reflection { text-align: left; max-width: 32em; margin: 0 auto; }
.cp .reflection p { margin: 0 0 12px; text-indent: 1.4em; }
.cp .reflection p:first-child { text-indent: 0; }

/* Goswami Tulsidas */
.poet { display: flex; gap: 22px; align-items: flex-start; max-width: 34em; margin: 40px auto 0; padding: 20px 0 4px; border-top: 1px solid var(--rule); }
.poet img { flex: none; width: 96px; height: 128px; object-fit: cover; border-radius: 48px 48px 3px 3px; border: 1px solid var(--gold); padding: 3px; background: var(--paper); }
.poet h2 { font-size: 20px; font-weight: 500; margin: 0 0 6px; }
html:not([lang="en"]) .poet h2 { font-weight: 400; }
.poet p { margin: 0 0 8px; font-size: 16.5px; color: var(--muted); }
.poet a { font-size: 16px; }
.poet .credit-line { font-size: 12px; margin-top: 2px; }
@media (max-width: 520px) { .poet { flex-direction: column; align-items: center; text-align: center; } }
.poet + .sections { margin-top: 20px; }
.board.done .cell.struck { animation: struck .9s ease-out; }
@keyframes struck { 0% { box-shadow: inset 0 0 0 0 rgba(179,38,30,0); } 30% { box-shadow: inset 0 0 0 2px var(--sindoor), 0 0 14px 3px rgba(232,163,23,.6); } 100% { box-shadow: inset 0 0 0 1px rgba(179,38,30,.4); } }
.answer .actions { justify-content: space-between; align-items: baseline; gap: 18px; }
.auto { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.auto button { font: inherit; background: none; border: 0; padding: 0; color: var(--sindoor); cursor: pointer; border-bottom: 1px solid currentColor; }

/* Breadcrumbs, chart page, footer links */
.crumbs { max-width: 34em; margin: 0 auto 4px; text-align: center; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--sindoor); }
.chart-link { text-align: center; margin-top: 14px; font-family: var(--latin); }
html:not([lang="en"]) .chart-link { font-family: var(--local); }
.chart-table { border-collapse: collapse; margin: 0 auto; border: 2px double var(--sindoor); font-family: var(--deva); width: 100%; max-width: 640px; table-layout: fixed; }
.chart-table caption { font-size: 15px; color: var(--sindoor); padding-bottom: 8px; }
.chart-table td { border: 1px solid var(--rule); text-align: center; aspect-ratio: 1; font-size: clamp(11px, 2.6vw, 19px); padding: 0; }
.chart-how { max-width: 34em; margin: 18px auto; color: var(--muted); font-size: 16px; }
.chart-nine { max-width: 34em; margin: 0 auto; }
.chart-nine li { margin: 6px 0; font-family: var(--deva); }
.chart-nine a { color: var(--ink); text-decoration: none; }
.print-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--sindoor); cursor: pointer; border-bottom: 1px solid currentColor; }
@media print {
  .frame, .top, .crumbs, .cta, .foot .lotus-mark, .intro .invocation { display: none !important; }
  .page { padding: 0 !important; }
  body { font-size: 12pt; }
  .chart-table td { font-size: 13pt; }
  @page { margin: 12mm; }
  h1 { font-size: 22pt; margin: 0; }
  .intro { margin: 0 0 6px; }
  .chart-how { margin: 10px auto; font-size: 10.5pt; }
  .chart-nine li { margin: 2px 0; font-size: 11pt; }
  .foot { padding: 8px 0 0; font-size: 9pt; }
  a { color: inherit; text-decoration: none; }
}
.prompt-top { color: var(--ink); font-size: clamp(18px, 4.4vw, 21px); margin: 0 auto 18px; max-width: 26em; line-height: 1.45; }
.prompt-top + .invocation { margin-top: 0; }
.cp .tr { margin-top: 24px; }
