/* Shloka Scroll website. Colours and chapter pigments come from design/tokens.css (copied to /assets/tokens.css).
   No JavaScript, no external requests. The tap-a-word demo is CSS only (radio inputs + :has()). */

@font-face { font-family: "Tiro Devanagari Sanskrit"; src: url("/assets/fonts/tiro-sanskrit.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Tiro Devanagari Sanskrit"; src: url("/assets/fonts/tiro-sanskrit-italic.woff") format("woff"); font-style: italic; font-display: swap; }
@font-face { font-family: "Tiro Tamil"; src: url("/assets/fonts/tiro-tamil.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Tiro Telugu"; src: url("/assets/fonts/tiro-telugu.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-semibold.woff") format("woff"); font-weight: 600; font-display: swap; }
/* Devanagari Mukta for the Hindi pages: separate files, fetched only where Devanagari text appears in Mukta */
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-deva-regular.woff") format("woff"); font-weight: 400; font-display: swap; unicode-range: U+0900-097F, U+200C-200D, U+A8E0-A8FF; }
@font-face { font-family: "Mukta"; src: url("/assets/fonts/mukta-deva-semibold.woff") format("woff"); font-weight: 600; font-display: swap; unicode-range: U+0900-097F, U+200C-200D, U+A8E0-A8FF; }

:root {
  --serif: "Tiro Devanagari Sanskrit", "Iowan Old Style", Georgia, serif;
  --hindi: "Tiro Devanagari Sanskrit", serif;
  --tamil: "Tiro Tamil", serif;
  --telugu: "Tiro Telugu", serif;
  --sans: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --night: #0B0E24;
  --wrap: 1160px;
  --gut: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* reading surfaces (legal pages, scripts band) */
  --bg: var(--paper);
  --ink: var(--paper-ink);
  --muted: var(--paper-muted);
  --rule: var(--paper-rule);
  --link: var(--gold-label);
  --slip: #F4EBD3;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14182B; --ink: #ECE5D6; --muted: #A9A394; --rule: #2E3349; --link: #E3B34C; --slip: #1D2238; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; background: var(--bg); color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--paper); color: var(--paper-ink); padding: 8px 14px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
[lang="sa"] { font-family: var(--serif); }
[lang="hi"] { font-family: var(--hindi); }
.eyebrow { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 0 0 .9rem; }

/* gold dotted underline: the app's tappable-word mark */
.u, .u-gold { text-decoration: underline dotted var(--gold); text-decoration-thickness: 2px; text-underline-offset: .32em; text-decoration-skip-ink: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .55rem; min-height: 50px; padding: .7rem 1.4rem; border-radius: 999px;
  background: var(--cream); color: var(--paper-ink); font-weight: 600; text-decoration: none; transition: transform 100ms var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-quiet { display: inline-flex; align-items: center; min-height: 50px; padding: .7rem .4rem; color: var(--cream); font-weight: 600;
  text-decoration: underline dotted var(--gold); text-decoration-thickness: 2px; text-underline-offset: .35em; }

/* =================================================================== HOME */
.home { background: var(--night); color: var(--cream); }
.home-head { position: absolute; inset: 0 0 auto 0; z-index: 10; }
.bar { max-width: var(--wrap); margin: 0 auto; padding: 18px var(--gut); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
a.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; flex: none; }
a.brand .mini { width: 34px; height: 34px; border-radius: 8px; }
a.brand .wm { width: 150px; height: auto; }
.home-head nav { display: flex; gap: .4rem 1.4rem; font-weight: 600; font-size: .95rem; }
.home-head nav a { text-decoration: none; color: var(--cream); opacity: .85; padding: .4rem 0; }
.home-head nav a:hover { opacity: 1; }
.nav-soon { border: 1px solid rgba(244,238,226,.35); border-radius: 999px; padding: .35rem .9rem !important; opacity: 1 !important; }
@media (max-width: 560px) { .home-head nav a:not(.nav-soon) { display: none; } a.brand .wm { width: 128px; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-in { max-width: var(--wrap); margin: 0 auto; padding: 120px var(--gut) 88px; display: grid; gap: 56px; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: 1.04; letter-spacing: -.015em; margin: 0 0 1.4rem; }
.hero .u-gold { text-underline-offset: .2em; text-decoration-thickness: 3px; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--t2); max-width: 30rem; margin: 0 0 2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; }
@media (max-width: 900px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); padding-top: 104px; gap: 44px; justify-items: center; }
  .hero-copy { text-align: center; }
  .lede { margin-inline: auto; }
  .cta-row { justify-content: center; }
}

/* ---------- phone + live verse ---------- */
.phone-wrap { margin: 0; display: grid; justify-items: center; gap: 14px; }
.phone-wrap figcaption { font-size: .88rem; color: var(--t3); text-align: center; }
.phone { width: 320px; height: 664px; padding: 10px; border-radius: 52px; background: var(--phone-frame);
  box-shadow: 0 50px 90px -30px rgba(0,0,0,.75), inset 0 0 0 2px #2A2C36; }
.screen { position: relative; width: 300px; height: 644px; border-radius: 43px; overflow: hidden; font-family: var(--sans); }
.island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 96px; height: 28px; border-radius: 16px; background: #000; z-index: 3; }
.app-top { position: absolute; inset: 0 0 auto 0; padding: 50px 14px 0; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.seg { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px; font-size: 12.5px; font-weight: 500; }
.seg span { padding: 3px 11px; border-radius: 999px; color: rgba(244,238,226,.75); }
.seg .on { background: var(--cream); color: var(--paper-ink); font-size: 13.5px; }
.langpill { border: 1px solid rgba(244,238,226,.35); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
.app-card { position: absolute; inset: 0; padding: 104px 18px 20px; display: flex; flex-direction: column; }
.numeral { position: absolute; left: -12px; bottom: -64px; font-family: var(--serif); font-size: 260px; line-height: 1; opacity: .05; pointer-events: none; }
.app-meta { font-size: 12px; color: var(--t2); margin: 6px 0 168px; } /* fixed top: the label sits under the controls and the gap below holds a two-row bubble */ /* the gap holds line-1 gloss bubbles, so they never cover the chapter label */
.app-meta .ref { color: var(--gold); font-weight: 600; font-size: 14px; margin-right: 4px; }
.verse { border: 0; margin: 0; padding: 0; min-width: 0; font-size: 21px; line-height: 2.15; padding-right: 30px; }
.ln { display: block; white-space: nowrap; }
.danda { opacity: .6; }
.app-hint { font-size: 12px; color: var(--t3); margin: 6px 0 0; }
.app-more { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; margin: 14px 0 auto; background: rgba(255,255,255,.1); border-radius: 999px; padding: 5px 12px 5px 11px; font-size: 13px; font-weight: 500; }
.app-rail { position: absolute; right: 9px; bottom: 92px; display: grid; gap: 12px; }
.app-rail span { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.app-foot { display: grid; gap: 7px; font-size: 11.5px; color: var(--t2); }
.app-foot i { display: block; height: 3px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.app-foot b { display: block; width: 65%; height: 100%; background: var(--gold); }

/* each word: a label around a visually hidden radio */
.w { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wt { padding: 0 1px; border-radius: 5px; text-decoration: underline dotted var(--gold); text-decoration-thickness: 2px; text-underline-offset: 8px; text-decoration-skip-ink: none; transition: background-color 100ms var(--ease-out); }
.w:hover .wt { background: rgba(227,179,76,.12); }
.w:has(input:checked) .wt { background: rgba(227,179,76,.26); text-decoration-style: solid; }
.w:has(input:focus-visible) .wt { outline: 2px solid var(--gold); outline-offset: 2px; }

.gl { display: none; position: absolute; z-index: 6; bottom: calc(100% + 8px); /* clears the reph and upper matras, which rise above the line box */ white-space: normal; width: max-content; max-width: 262px;
  background: var(--paper); color: var(--paper-ink); border-radius: 14px; padding: 9px 12px 10px; line-height: 1.3; text-align: left;
  box-shadow: 0 14px 30px -8px rgba(0,0,0,.55); transform-origin: var(--ox, 50%) 100%; }
.gl::after { content: ""; position: absolute; bottom: -5px; left: var(--ax, 50%); width: 12px; height: 12px; margin-left: -6px; background: var(--paper); transform: rotate(45deg); border-radius: 2px; }
.w.c .gl { left: 50%; translate: -50% 0; }
.w.l .gl { left: -6px; --ax: 24px; --ox: 24px; }
.w.r .gl { right: -6px; --ax: calc(100% - 24px); --ox: calc(100% - 24px); }
.ln { position: relative; }
.w.x { position: static; }
.w.x .gl { left: -6px; max-width: 250px; }
.w.x1 .gl { --ax: 100px; --ox: 100px; }
.w.x2 .gl { --ax: 140px; --ox: 140px; }
.w:has(input:checked) .gl { display: block; animation: pop 160ms var(--ease-out); }
@media (hover: hover) {
  .w:hover .gl { display: block; animation: pop 160ms var(--ease-out); }
  .verse:has(.w:hover) .w:not(:hover) .gl { display: none; }
}
@keyframes pop { from { opacity: 0; scale: .96; } }
.gl-h { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-label); margin-bottom: 3px; }
.bws { display: flex; align-items: flex-start; gap: 2px 8px; flex-wrap: wrap; }
.bw { display: flex; gap: 8px; align-items: flex-start; }
.bw-in { display: grid; }
.bw-sa { font-size: 17px; line-height: 1.3; }
.bw-iast { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--paper-muted); }
.bw-g { font-family: var(--sans); font-size: 13.5px; font-weight: 600; line-height: 1.25; margin-top: 2px; max-width: 150px; }
.plus { color: var(--gold-deep); font-size: 16px; padding-top: 1px; }

/* ---------- three beats (each band is a chapter pigment, like cards in the feed) ---------- */
.beat { position: relative; overflow: hidden; }
.beat-num { position: absolute; right: -2vw; bottom: -.28em; font-family: var(--serif); font-size: clamp(260px, 42vw, 560px); line-height: 1; opacity: .06; pointer-events: none; user-select: none; }
.beat-in { position: relative; max-width: var(--wrap); margin: 0 auto; padding: clamp(72px, 11vw, 132px) var(--gut); display: grid; gap: 48px; align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.beat h2 { font-size: clamp(3rem, 8vw, 5.6rem); line-height: 1; letter-spacing: -.02em; margin: 0 0 1.2rem; }
.beat-copy p:not(.eyebrow) { font-size: 1.15rem; line-height: 1.65; color: var(--t2); max-width: 30rem; margin: 0; }
.beat-art { justify-self: center; width: 100%; max-width: 440px; }
@media (max-width: 860px) { .beat-in { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

/* Scroll: three feed cards */
.feed { display: grid; gap: 14px; justify-items: center; -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); padding: 26px 0; }
.fc { width: min(100%, 340px); border-radius: 22px; padding: 18px 20px 20px; display: grid; gap: 4px; box-shadow: 0 24px 50px -24px rgba(0,0,0,.7), inset 0 0 0 1px rgba(244,238,226,.1); opacity: .55; scale: .92; }
.fc.on { opacity: 1; scale: 1; }
.fc-ref { color: var(--gold); font-weight: 600; font-size: .9rem; }
.fc-sa { font-size: 1.45rem; line-height: 1.6; }
.fc-en { font-size: .95rem; color: var(--t2); }
.feed-hint { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: rgba(244,238,226,.75); margin-top: 6px; }

/* Tap: sandhi */
.sandhi { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 10px; }
.sd-word { font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1.5; text-decoration: underline dotted var(--gold); text-decoration-thickness: 3px; text-underline-offset: .28em; text-decoration-skip-ink: none; flex-basis: 100%; text-align: center; }
.sd-eq { font-family: var(--serif); font-size: 1.5rem; color: var(--gold); }
.sd-part { background: var(--paper); color: var(--paper-ink); border-radius: 16px; padding: 10px 13px 11px; display: grid; justify-items: center; box-shadow: 0 18px 36px -16px rgba(0,0,0,.6); }
.sd-part span { font-size: 1.45rem; line-height: 1.35; }
.sd-part em { font-style: normal; font-weight: 600; font-size: .95rem; }

/* Understand: meaning panel */
.meaning { display: grid; gap: 14px; justify-items: start; }
.m-pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 7px 16px 7px 15px; font-weight: 600; font-size: .95rem; }
.flip svg { transform: rotate(180deg); display: block; }
.m-panel { margin: 0; background: rgba(0,0,0,.22); border-radius: 20px; padding: 20px 22px; font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.5; }
.m-langs { margin: 0; display: flex; gap: 8px; }
.chip { border: 1px solid rgba(244,238,226,.3); border-radius: 999px; padding: 4px 14px; font-size: .95rem; }
.chip.on { background: var(--cream); color: var(--paper-ink); border-color: var(--cream); font-weight: 600; }
.chip[lang="hi"] { font-size: 1.05rem; }

/* ---------- scripts (paper band: light in light mode, ink in dark mode) ---------- */
.scripts { background: var(--bg); color: var(--ink); }
.scripts-in { max-width: var(--wrap); margin: 0 auto; padding: clamp(72px, 11vw, 132px) var(--gut); display: grid; gap: 48px; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; }
.scripts .eyebrow { color: var(--link); }
.scripts h2 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); line-height: 1.1; margin: 0 0 1.2rem; letter-spacing: -.01em; }
.scripts-copy p:not(.eyebrow) { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 28rem; }
.sr-list { list-style: none; margin: 0; padding: 0; }
.sr-row { display: grid; gap: 4px; padding: 22px 0; border-top: 2px dotted var(--rule); }
.sr-row:last-child { border-bottom: 2px dotted var(--rule); }
.sr-lab { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sr-nat { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .95rem; margin-left: .4rem; }
.sr-nat[lang="ta"] { font-family: var(--tamil); } .sr-nat[lang="te"] { font-family: var(--telugu); } .sr-nat[lang="deva"] { font-family: var(--serif); }
.sr-txt { font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.9; }
.sr-txt.s-iast { font-style: italic; font-size: clamp(1.2rem, 2.3vw, 1.6rem); }
.sr-txt.s-ta { font-family: var(--tamil); font-size: clamp(1.15rem, 2.3vw, 1.6rem); }
.sr-txt.s-te { font-family: var(--telugu); }
.sr-txt .u { text-decoration-color: var(--gold-deep); }
@media (prefers-color-scheme: dark) { .sr-txt .u { text-decoration-color: var(--gold); } }
@media (max-width: 860px) { .scripts-in { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* ---------- Hanuman Chalisa teaser ---------- */
.chalisa { text-align: center; }
.chalisa-in { max-width: 44rem; margin: 0 auto; padding: clamp(72px, 10vw, 120px) var(--gut); }
.chalisa h2 { font-size: clamp(2rem, 4.4vw, 3rem); margin: 0 0 1.6rem; }
.doha { font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.75; margin: 0 0 1.6rem; text-decoration: underline dotted var(--gold); text-decoration-thickness: 2px; text-underline-offset: .35em; text-decoration-skip-ink: none; }
.chalisa p:last-child { color: var(--t2); font-size: 1.1rem; margin: 0 auto; max-width: 34rem; }

/* ---------- coming soon ---------- */
.soon { text-align: center; }
.soon-in { max-width: 40rem; margin: 0 auto; padding: clamp(80px, 11vw, 132px) var(--gut); display: grid; justify-items: center; }
.soon-icon { width: 120px; height: 120px; border-radius: 27px; box-shadow: 0 24px 50px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(244,238,226,.15); margin-bottom: 1.8rem; }
.soon h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 .8rem; }
.soon-in > p:not(.fine) { color: var(--t2); font-size: 1.1rem; margin: 0 0 2rem; }
.store-slot { display: grid; gap: 2px; min-width: 240px; padding: 12px 22px; border-radius: 14px; border: 1px solid rgba(244,238,226,.28); margin-bottom: 1.4rem; }
.slot-k { font-weight: 600; font-size: 1.1rem; }
.slot-v { font-size: .85rem; color: var(--t3); }
.fine { font-size: .88rem; color: var(--t3); max-width: 26rem; margin: 1rem 0 0; }

/* ---------- footer (shared) ---------- */
.site-foot { background: var(--night); color: #CFC8B8; border-top: 2px dotted rgba(227,179,76,.35); }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gut) 44px; display: grid; gap: 32px 48px; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 5fr); font-size: .95rem; }
.foot-brand { display: grid; gap: 12px; justify-items: start; }
.foot-icon { width: 44px; height: 44px; border-radius: 10px; }
.foot-wm { width: 190px; }
.foot-line { font-family: var(--serif); font-size: 1.15rem; color: var(--cream); margin: 0; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-nav a { color: var(--cream); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline dotted var(--gold); text-decoration-thickness: 2px; }
.foot-meta p { margin: 0 0 .7rem; }
.foot-meta a { color: var(--cream); }
.copy { color: #8F8A80; }
@media (max-width: 760px) { .foot-in { grid-template-columns: minmax(0, 1fr); } }

/* =================================================================== DOCUMENT PAGES */
.doc-head { border-bottom: 1px solid var(--rule); }
.doc-head nav { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; justify-content: flex-end; font-size: .95rem; }
.doc-head nav a { color: var(--muted); text-decoration: none; padding: .3rem 0; }
.doc-head nav a:hover { color: var(--ink); }
.doc-head nav a[aria-current="page"] { color: var(--ink); text-decoration: underline dotted var(--gold-deep); text-decoration-thickness: 2px; text-underline-offset: .35em; }
@media (prefers-color-scheme: dark) { .doc-head nav a[aria-current="page"] { text-decoration-color: var(--gold); } }

.doc-main { max-width: var(--wrap); margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gut) 80px; display: grid; gap: 0 64px;
  grid-template-columns: minmax(0, 44rem); grid-template-areas: "title" "prose"; justify-content: center; }
.doc-main.has-toc { grid-template-columns: 15rem minmax(0, 44rem); grid-template-areas: "title title" "toc prose"; }
.doc-title { grid-area: title; margin-bottom: 2.4rem; }
.has-toc .doc-title { padding-left: calc(15rem + 64px); }
.doc-title .eyebrow { color: var(--link); }
.doc-title h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); line-height: 1.08; letter-spacing: -.015em; margin: 0; }
.toc { grid-area: toc; align-self: start; position: sticky; top: 24px; font-size: .9rem; }
.toc-h { font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px dotted var(--rule); }
.toc li a { display: block; padding: .3rem 0 .3rem 1rem; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li a:hover { color: var(--ink); }
.prose { grid-area: prose; min-width: 0; font-size: 1.075rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.45rem, 2.6vw, 1.75rem); line-height: 1.25; margin: 2.8rem 0 .8rem; scroll-margin-top: 20px; }
.prose h2::before { content: ""; display: block; width: 44px; border-top: 3px dotted var(--gold-deep); margin-bottom: .9rem; }
@media (prefers-color-scheme: dark) { .prose h2::before { border-top-color: var(--gold); } }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--gold-deep); }
.prose li > ul, .prose li > ol { margin: .35rem 0 .2rem; }
.prose li > p { margin: .45rem 0 0; }
.prose li li::marker { color: var(--muted); }
.prose a { color: var(--link); text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 2px dotted var(--rule); margin: 2.4rem 0; }
.prose blockquote { margin: 1.4rem 0; padding: 1rem 1.2rem; background: var(--slip); border-radius: 14px; border-left: 3px solid var(--gold-deep); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font-size: .88em; background: var(--slip); padding: .08em .35em; border-radius: 5px; overflow-wrap: anywhere; }
.prose .table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--rule); border-radius: 14px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.5; }
.prose th, .prose td { padding: .65rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--slip); font-weight: 600; font-size: .85rem; letter-spacing: .02em; }
/* Phones: each table row becomes a card. The first cell is the card title; the other cells carry their column name. */
@media (max-width: 600px) {
  .prose .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tr { border: 1px solid var(--rule); border-radius: 14px; padding: .25rem 1rem .5rem; margin-bottom: .8rem; }
  .prose td { border: 0; padding: .45rem 0; }
  .prose td + td { border-top: 1px dotted var(--rule); }
  .prose td:first-child { font-weight: 600; font-size: 1rem; padding-top: .6rem; }
  .prose td + td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
}
.prose .notice { background: var(--slip); border-radius: 14px; padding: .9rem 1.1rem; font-size: 1rem; border-left: 3px solid var(--gold-deep); margin-bottom: 1.6rem; }
.prose .draft { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: .15rem .75rem; margin-bottom: 1.6rem; }

@media (max-width: 960px) {
  .doc-main.has-toc { grid-template-columns: minmax(0, 44rem); grid-template-areas: "title" "toc" "prose"; }
  .has-toc .doc-title { padding-left: 0; }
  .toc { position: static; margin-bottom: 2.4rem; padding: 1rem 1.1rem; background: var(--slip); border-radius: 14px; }
  .toc ol { border-left: 0; columns: 2 12rem; column-gap: 1.4rem; }
  .toc li { break-inside: avoid; }
  .toc li a { padding: .25rem 0; }
}
@media (max-width: 560px) {
  .doc-head .bar { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .doc-head nav { justify-content: flex-start; }
}

/* ---------- Hindi pages ---------- */
@font-face { font-family: "Tiro Hi Pages"; src: url("/assets/fonts/tiro-hi-pages.woff") format("woff"); font-display: swap; }
html:lang(hi) { --serif: "Tiro Hi Pages", "Tiro Devanagari Sanskrit", serif; }
.doc-title .lang-switch { display: inline-block; margin-top: .9rem; font-size: .95rem; font-weight: 600; color: var(--link); text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: .3em; }
.doc-title .lang-switch[lang="hi"] { font-size: 1.05rem; }
:lang(hi) .prose { font-size: 1.12rem; line-height: 1.9; }
:lang(hi) .doc-title h1 { line-height: 1.3; letter-spacing: 0; }
:lang(hi) .prose h2 { line-height: 1.45; }
/* Never track Devanagari: letter-spacing breaks the headline and conjuncts. Uppercase is a no-op on it. */
:lang(hi) .eyebrow, :lang(hi) .toc-h, :lang(hi) .prose th, :lang(hi) .prose td + td::before { letter-spacing: 0; text-transform: none; }
:lang(hi) .eyebrow, :lang(hi) .toc-h { font-size: .9rem; }
:lang(hi) .prose td + td::before { font-size: .85rem; }
.prose .notice.review { border-left-color: #C2402F; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
