/* Shloko — "The Gallery" design system.
   White-first and bold: a full-bleed colour-band hero, oversized contemporary
   type, and one accent that recolours per book (the shell stays white).
   Type: Bricolage Grotesque (display) · Literata (body) · Inter (UI).
   Includes a dark "reading room". */

:root {
  /* light */
  --bg: #ffffff; --surface: #ffffff; --surface-alt: #f4f4f6;
  --ink: #0c0c0d; --muted: #6b6e76; --line: #e7e8ec; --line-strong: #d9dbe0;
  --accent: #5b2be0;         /* brand primary (electric indigo) */
  --accent-contrast: #ffffff;
  --book: #5b2be0;           /* reading primary (indigo) */
  --accent2: #c6493a;        /* reading accent pop (clay vermilion) */
  --glass-hi: rgba(255,255,255,.6); /* liquid-glass top highlight */
  --lg-edge: rgba(255,255,255,.5);
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-body: 'Literata', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-deva: 'Noto Serif Devanagari', Georgia, serif;
  --measure: 42rem;
  --header-h: 3.5rem;   /* sticky offset under header.site (~57px at 16px root): the home curtain and gita's tab bar */
  /* Golden-ratio type scale — φ = 1.618. A quarter-step ladder (r = φ^¼ ≈ 1.1247)
     so every 4th step is exactly ×φ; base 1rem = 16px. */
  --fs-micro: 0.78rem;   /* ≈12.5  eyebrow, kickers, micro labels */
  --fs-small: 0.9rem;    /* ≈14.4  secondary text (section sub) */
  --fs-body:  1rem;      /*  16    body */
  --fs-lead:  1.125rem;  /*  18    hero lead / sub */
  --fs-h1-max: 4.236rem; /* ≈68  = base × φ³ (clamped) */
  /* the hero's one colour moment: indigo→plum→ink, with glass floating over it */
  --hero-grad:
    radial-gradient(900px 600px at 15% -5%, #6a3bf0 0%, transparent 55%),
    radial-gradient(800px 700px at 100% 10%, #c0405e 0%, transparent 50%),
    radial-gradient(700px 700px at 60% 110%, #e2893f 0%, transparent 45%),
    linear-gradient(160deg, #241152, #15092e 60%, #0c0620);
  /* fixed dark-indigo glass (same in both themes) and the light ink that sits on it */
  --glass-ink-bg: #1f1148;
  --on-glass: #f3f0ff;
  /* one motion curve: critically damped spring (damping 1, response .3s).
     --ease-spring is the cubic fallback unless linear() is supported (below). */
  --ease-spring-fb: cubic-bezier(.25,.8,.25,1);
  --ease-spring: var(--ease-spring-fb);
  color-scheme: light;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, .145, .387, .597, .748, .847, .910, .948, .970, .983, 1); }
}
/* per-book accents — the shell is white, the colour is the book */
.book-gita        { --accent: #5b2be0; --book: #5b2be0; }
.book-mahabharata { --accent: #b23a48; --book: #b23a48; }
.book-ramayana    { --accent: #2f7a4d; --book: #2f7a4d; }
.book-upanisads   { --accent: #1f7a8c; --book: #1f7a8c; }
.book-tao         { --accent: #2e8b74; --book: #2e8b74; }
.book-artofwar    { --accent: #d1472c; --book: #d1472c; }
.book-prince      { --accent: #b08528; --book: #b08528; }
.book-meditations { --accent: #4a5b7a; --book: #4a5b7a; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1012; --surface: #16171b; --surface-alt: #1c1d22;
    --ink: #ededee; --muted: #9a9ca3; --line: #2a2b31; --line-strong: #3a3b42;
    --accent-contrast: #140b09; --accent2: #e07a68; --glass-hi: rgba(255,255,255,.12); --lg-edge: rgba(255,255,255,.16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1012; --surface: #16171b; --surface-alt: #1c1d22;
  --ink: #ededee; --muted: #9a9ca3; --line: #2a2b31; --line-strong: #3a3b42;
  --accent-contrast: #140b09; --accent2: #e07a68; --glass-hi: rgba(255,255,255,.12); --lg-edge: rgba(255,255,255,.16);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; margin: 0; -webkit-font-smoothing: antialiased;
  overflow-x: clip; }   /* full-bleed art spans 100vw (scrollbar included): clip, never scroll. Not "hidden": that breaks position: sticky */
img { max-width: 100%; }
a { color: var(--accent); }

.wrap { max-width: 66rem; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left,0px)); padding-right: max(18px, env(safe-area-inset-right,0px)); }
.reading { max-width: var(--measure); margin-left: auto; margin-right: auto; }

/* ---- header ---- */
header.site { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 0.4rem; }
.wordmark small { font-family: var(--font-deva); font-weight: 600; font-size: 0.82rem; letter-spacing: 0; text-transform: none; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 0.7rem; }
.nav a { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 500; text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--accent); }
.icon-btn { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.35rem 0.85rem; cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- hero: Path B — liquid glass over a colour field ---- */
.hero { position: relative; overflow: hidden; background: var(--hero-grad); color: var(--on-glass); border-bottom: none;
  min-height: min(88vh, 820px); min-height: min(88svh, 820px); display: flex; align-items: center; padding-block: 0 env(safe-area-inset-bottom, 0px); }
.hero-in { position: relative; z-index: 1; width: 100%; padding-block: clamp(3.2rem, 9vw, 5.6rem); }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 6.4vw, var(--fs-h1-max)); line-height: 1.02; letter-spacing: -0.025em; color: var(--on-glass); margin: 0 0 1rem; max-width: 17ch; }
.hero .sub { font-size: var(--fs-lead); line-height: 1.55; color: rgba(243,240,255,.82); max-width: 50ch; margin: 0 0 1.8rem; }
.hero .eyebrow { color: color-mix(in srgb, #c7b6ff 50%, var(--on-glass)); }   /* lifted toward the hero ink: >= 4.5:1 where the indigo and crimson glows meet on small phones */
/* glass CTAs in rgb(243,240,255) — primary frosted-solid, ghost clear */
.hero .btn-primary { color: #2c1570; background: rgba(243,240,255,.9); border: 1px solid rgba(255,255,255,.75); -webkit-backdrop-filter: blur(8px) saturate(150%); backdrop-filter: url(#lgFilter) blur(7px) saturate(150%); box-shadow: inset 0 1px 1px #fff, inset 0 -8px 16px -12px rgba(120,100,200,.4), 0 14px 30px -12px rgba(0,0,0,.5); }
.hero .btn-ghost { color: var(--on-glass); background: rgba(243,240,255,.12); border: 1px solid rgba(243,240,255,.4); -webkit-backdrop-filter: blur(8px) saturate(160%); backdrop-filter: url(#lgFilter) blur(8px) saturate(160%); box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 12px 26px -14px rgba(0,0,0,.4); }
@media (hover: hover) { .hero .btn:hover { transform: translateY(-1px); filter: brightness(1.03); } }

.eyebrow { font-family: var(--font-ui); font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent); margin: 0 0 0.9rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
/* capsule action buttons: 48px pill, feedback on press (not on release), no hover lift on touch */
.btn { font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600; text-decoration: none; border-radius: 999px; min-height: 48px; padding: 0 1.5rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap; cursor: pointer; border: 1px solid transparent; transition: transform 100ms ease-out; }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } }
.btn:active, .hero .btn:active, .gw-panel .btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hero .btn:focus-visible, .gw-panel .btn:focus-visible { outline-color: var(--on-glass); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 760px) {
  .hero .cta-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .hero .cta-row .btn { width: 100%; padding-inline: 1rem; }
  /* short phones: the hero shrinks to its content and the ghost lands in the ember glow;
     a dark-ink tint (not a lighter fill) keeps its label >= 4.5:1 there */
  .hero .btn-ghost { background: color-mix(in srgb, var(--glass-ink-bg) 34%, transparent); }
}
/* the hero's primary CTA becomes "Continue · Chapter N, verse M →" when there is progress
   (progress.js). On desktop its width is reserved for the longest label, so the swap never
   moves the button beside it; on phones the buttons are already full width. */
.cta-l { white-space: nowrap; }
.btn[data-continue-cta] { font-variant-numeric: tabular-nums; }   /* equal-width digits: "18, verse 78" really is the widest label */
@media (min-width: 761px) {
  .hero .btn[data-continue-cta] { display: inline-grid; justify-items: center; }
  .hero .btn[data-continue-cta] > .cta-l,
  .hero .btn[data-continue-cta]::after { grid-area: 1 / 1; }
  .hero .btn[data-continue-cta]::after { content: "Continue · Chapter 18, verse 78 →"; visibility: hidden; white-space: nowrap; height: 0; overflow: hidden; }
}

/* ---- sections ---- */
section { padding-block: 1.6rem; }
.pad-top { padding-top: 2.4rem; }
h2.sec { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 3.6vw, 2.2rem); letter-spacing: -0.02em; margin: 0 0 0.3rem; }
.sec-sub { font-size: var(--fs-small); color: var(--muted); max-width: 64ch; margin: 0 0 1.3rem; }

/* ---- verse of the day — a full-viewport painting with the verse in one glass card.
   .votd stays inside body > .wrap (the Studio's section selectors depend on it); only
   the picture and its scrim break out to the viewport edges, so the card stays on the
   .wrap content edge. The picture is a real <picture> (lazy), not a CSS background. ---- */
.votd { padding-block: 0; }
.votd-frame { position: relative; display: flex; align-items: center; min-height: 100vh; min-height: 100svh;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.votd-art, .votd-frame::before { position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw; }
.votd-art { z-index: 0; display: block; background: var(--glass-ink-bg); }   /* dark until the painting arrives */
.votd-art { top: -1px; }   /* overlap the hero by 1px: no light hairline at fractional device scales (1.25x, 1.5x) */
.votd-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.votd-frame::before { content: ""; z-index: 1; pointer-events: none; background: linear-gradient(0deg, rgba(10,6,30,.62), rgba(10,6,30,0) 70%); }
.votd-card { width: min(100%, 38rem); margin: 0; border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.3rem, 3vw, 1.9rem); position: relative; z-index: 2; }
/* the painting's credit, on the darkest part of the scrim; one line per breakpoint (the painting changes at 760px) */
.votd-credit { position: absolute; left: 0; right: 0; bottom: 1rem; z-index: 2; margin: 0; font-family: var(--font-ui); font-size: var(--fs-micro); line-height: 1.45; letter-spacing: 0.01em; color: rgba(255,255,255,.82); }
.votd-credit .vc-m { display: none; }
.votd-k { font-family: var(--font-ui); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent); display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
/* "Another": a 36px capsule whose ::before extends the tap area to 44px */
.votd-shuffle { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 1.5rem; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; transition: transform 100ms ease-out; }
.votd-shuffle::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.votd-shuffle:active { transform: scale(.97); }
.votd-shuffle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .votd-shuffle:hover { color: var(--accent); border-color: var(--accent); } }
.votd-deva { font-family: var(--font-deva); font-size: clamp(1.3rem, 3.2vw, 1.7rem); line-height: 1.9; margin: 0 0 0.8rem; }
.votd-trans { font-family: var(--font-body); font-size: clamp(1.05rem, 2.3vw, 1.25rem); max-width: 54ch; margin: 0 0 0.6rem; }
.votd-ref { font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); }

/* ---- library grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.book { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .16s, box-shadow .2s, border-color .2s; }
a.book:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 16px 34px -20px rgba(0,0,0,.45); }
.cover { position: relative; aspect-ratio: 3/2; display: grid; place-items: center;
  background-image: linear-gradient(150deg, var(--ca, #333), var(--cb, #111)); }
.cover .glyph { font-family: var(--font-deva); font-size: 2.7rem; color: rgba(255,255,255,.96); z-index: 1; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.cover .glyph.latin { font-family: var(--font-display); font-weight: 600; }
.badge { position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2; font-family: var(--font-ui); font-size: 0.58rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; padding: 0.22rem 0.55rem; border-radius: 6px; }
.b-read { background: #fff; color: #111; }
.b-soon { background: rgba(0,0,0,.35); color: #fff; backdrop-filter: blur(2px); }
.book-body { padding: 0.9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.book-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.15; }
.book-deva { font-family: var(--font-deva); color: var(--muted); font-size: 0.9rem; }
.book-desc { font-size: 0.9rem; color: var(--muted); margin: 0.1rem 0 0; flex: 1; }
.book-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; font-family: var(--font-ui); font-size: 0.74rem; color: var(--muted); }
.book-foot .go { color: var(--accent); font-weight: 600; }

/* ---- library tabs ---- */
.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 1.3rem; }
.tabs button { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 500; color: var(--muted); background: transparent; border: none; padding: 0.45rem 1.1rem; cursor: pointer; }
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- reader ---- */
main { padding-block: 1.6rem 5rem; }
.crumb { font-family: var(--font-ui); font-size: 0.74rem; color: var(--muted); margin: 0.6rem 0 1.2rem; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb b { color: var(--ink); }
.chapter-art { position: relative; max-width: var(--measure); margin: 0 auto 0.7rem; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 40px -26px rgba(0,0,0,.55); }
.chapter-art img { display: block; width: 100%; height: auto; }
.art-cap { font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--muted); text-align: center; margin: 0 auto 1.8rem; }
.chapter-title { text-align: center; margin-bottom: 1.4rem; }
.chapter-title .deva { font-family: var(--font-deva); font-weight: 600; font-size: 1.6rem; margin: 0 0 0.2rem; }
.chapter-title h1 { font-family: var(--font-body); font-weight: 500; font-style: italic; font-size: 1.25rem; color: var(--muted); margin: 0; }
.chapter-note { background: var(--surface-alt); border-radius: 14px; padding: 0.9rem 1.1rem; font-size: 0.92rem; color: var(--ink); margin: 0 auto 1.6rem; }
.chapter-note b { color: var(--accent); font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.02em; text-transform: none; display: block; margin-bottom: 0.3rem; }

.verse { padding-top: 2.4rem; scroll-margin-top: 5rem; }
.verse + .verse { border-top: 1px solid var(--line); }
.verse-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.seal { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--accent-contrast); background: var(--accent); border-radius: 7px; padding: 0.18rem 0.55rem; }
.speaker { font-family: var(--font-ui); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.layer { margin: 1.3rem 0; }
.layer-label { font-family: var(--font-ui); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent); margin-bottom: 0.45rem; }
.deva-verse { font-family: var(--font-deva); font-weight: 500; font-size: clamp(1.35rem, 4.2vw, 1.7rem); line-height: 2.05; margin: 0; color: var(--ink); }
.translit { line-height: 2.2; margin: 0 0 0.3rem; }
.wchip { font-family: var(--font-ui); font-style: italic; font-size: 0.97rem; color: var(--muted); background: transparent; border: none; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 55%, transparent); padding: 0 0.04em 0.06em; margin: 0 0.1em; cursor: pointer; border-radius: 3px; }
.wchip:hover { color: var(--accent); border-bottom-color: var(--accent); }
.wchip[aria-expanded="true"] { color: var(--accent-contrast); background: var(--accent); border-bottom-color: transparent; }
.wchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { font-family: var(--font-ui); font-size: 0.68rem; color: var(--muted); opacity: .8; margin: 0; }
.readout { font-family: var(--font-ui); font-size: 0.94rem; background: var(--surface-alt); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 0.55rem 0.85rem; margin: 0.5rem 0 0; }
.readout .term { font-weight: 600; font-style: italic; color: var(--accent); margin-right: 0.5rem; }
.reveal-btn { font-family: var(--font-ui); font-size: 0.74rem; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.35rem 0.85rem; cursor: pointer; }
.reveal-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.reveal-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.meaning-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem,1fr)); gap: 0.4rem 1rem; margin-top: 0.8rem; }
.meaning-grid .m { font-size: 0.9rem; min-width: 0; }
.meaning-grid .m .t { font-family: var(--font-ui); font-style: italic; font-weight: 500; }
.meaning-grid .m .g { color: var(--muted); }
.trans-item { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 12px; padding: 0.85rem 1rem; }
.trans-item .tag { font-family: var(--font-ui); font-size: 0.58rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent); display: block; margin-bottom: 0.3rem; }
.trans-item p { margin: 0; font-size: 1.08rem; font-family: var(--font-body); }
.explain p { margin: 0; font-family: var(--font-body); }
.verse-flag { font-family: var(--font-ui); font-size: 0.82rem; color: var(--ink); background: var(--surface-alt); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 0.6rem 0.85rem; margin-top: 0.9rem; }

.loading, .errbox { text-align: center; color: var(--muted); padding: 3rem 1rem; font-family: var(--font-ui); }
.errbox { color: var(--accent); }

footer { border-top: 1px solid var(--line); margin-top: 2.5rem; }
footer .wrap { padding-block: 2rem 2.5rem; font-size: 0.86rem; color: var(--muted); }
footer b { color: var(--ink); }
footer p { margin: 0 0 0.6rem; max-width: 64ch; }

/* =====================================================================
   READING PAGE v2 — chapter navigator + two-column verses
   (these rules come last and intentionally refine the reader rules above)
   ===================================================================== */

/* ---- chapter navigator: a sticky rail of all 18 chapters ---- */
.chapter-rail { position: sticky; top: 0; z-index: 15; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin-bottom: 1.3rem; }
.rail-in { display: flex; align-items: center; gap: 0.9rem; padding-block: 0.5rem; }
.rail-label { flex: 0 0 auto; font-family: var(--font-ui); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.rail-track { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: thin; scroll-behavior: smooth; padding-bottom: 3px; -webkit-overflow-scrolling: touch; }
.rail-track::-webkit-scrollbar { height: 5px; }
.rail-track::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
.ch-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; font-family: var(--font-ui); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.3rem 0.7rem; background: var(--surface); color: var(--muted); transition: border-color .15s, color .15s, background .15s; }
.ch-pill b { font-weight: 600; font-size: 0.84rem; color: var(--ink); line-height: 1; }
.ch-pill em { font-style: normal; font-size: 0.74rem; white-space: nowrap; max-width: 0; overflow: hidden; opacity: 0; transition: max-width .22s ease, opacity .22s ease; }
.ch-pill:hover { border-color: var(--accent); color: var(--accent); }
.ch-pill:hover b { color: var(--accent); }
.ch-pill:hover em { max-width: 18ch; opacity: 1; }
.ch-pill.cur { background: var(--accent); border-color: var(--accent); }
.ch-pill.cur b, .ch-pill.cur em { color: var(--accent-contrast); }
.ch-pill.cur em { max-width: 26ch; opacity: 1; } /* room for the current chapter's full name ("Knowledge & Renunciation") */
.ch-pill.soon b { color: var(--muted); font-weight: 600; }
.ch-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- book-derived tokens (recolour per book automatically). Declared again on the
   book's <body> so they resolve against that book's --book. Not a bare
   [class*=book-]: that would also match .book-foot / .book-title. ---- */
:root, body[class*="book-"] {
  --src-field: color-mix(in srgb, var(--book) 8%, var(--bg));
  --seam: color-mix(in srgb, var(--book) 30%, var(--line));
  --accent-ink: color-mix(in srgb, var(--book) 68%, var(--ink));
  --muted-warm: color-mix(in srgb, var(--book) 16%, var(--muted));
  --accent2-ink: color-mix(in srgb, var(--accent2) 82%, var(--ink));
}

/* ---- the verse as a facing-page spread (one warm field + white, no boxes) ---- */
.verse-list { max-width: 52rem; margin: 0.4rem auto 0; }
.verse { padding-top: 2.2rem; scroll-margin-top: 6rem; }
.verse:first-child { padding-top: 0.8rem; }
.verse + .verse { border-top: 1px solid var(--line); }
.verse-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; padding: 0 0.2rem; }
.verse-ix { margin-left: auto; font-family: var(--font-ui); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.speaker-cref { font-family: var(--font-ui); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--accent2-ink); text-underline-offset: 3px; }
.speaker-cref:hover, .speaker-cref:focus-visible { color: var(--accent2-ink); outline: none; }

.spread { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; position: relative; border-radius: 10px; overflow: hidden; }
.side { min-width: 0; }
.side-src { padding: 1.15rem 1.7rem 1.2rem 1.4rem; background: var(--src-field); border-right: 1px solid var(--seam); position: relative; }
.side-src::before { content: ""; position: absolute; top: 0; right: -1px; width: 2px; height: 26px; background: var(--book); }
.side-mean { padding: 1.15rem 1.4rem 1.2rem 1.7rem; }
.kicker { font-family: var(--font-ui); font-size: 0.58rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; margin: 0 0 0.7rem; }
.side-src .kicker { color: var(--accent-ink); }
.side-mean .kicker { color: var(--accent2-ink); }
.deva-verse { font-family: var(--font-deva); font-weight: 500; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.9; margin: 0 0 1rem; color: var(--ink); }
.mini-k { font-family: var(--font-ui); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted-warm); margin: 0 0 0.3rem; }
.translit { font-family: var(--font-body); font-style: italic; color: var(--muted-warm); line-height: 1.95; font-size: 0.92rem; margin: 0 0 0.3rem; }
.wchip { font: inherit; color: inherit; background: none; border: none; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 55%, transparent); padding: 0 0.04em 0.05em; margin: 0 0.06em; cursor: pointer; border-radius: 3px; }
.wchip:hover { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
.wchip.on { color: #fff; background: var(--accent2); border-bottom-color: transparent; font-style: normal; }
.wchip:focus-visible { outline: 2px solid var(--book); outline-offset: 2px; }
.readout { font-family: var(--font-ui); font-size: 0.86rem; background: color-mix(in srgb, var(--book) 12%, var(--bg)); border-left: 3px solid var(--book); border-radius: 0 8px 8px 0; padding: 0.5rem 0.75rem; margin: 0.5rem 0 0; }
.readout .term { font-weight: 600; font-style: italic; color: var(--accent-ink); margin-right: 0.4rem; }
.reveal-btn { font-family: var(--font-ui); font-size: 0.7rem; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.28rem 0.75rem; cursor: pointer; margin-top: 0.9rem; }
.reveal-btn[aria-expanded="true"] { color: var(--accent-ink); border-color: var(--book); }
.reveal-btn:focus-visible { outline: 2px solid var(--book); outline-offset: 2px; }
.meaning-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.35rem 0.9rem; margin-top: 0.8rem; }
.meaning-grid .m { font-size: 0.82rem; min-width: 0; }
.meaning-grid .m .t { font-family: var(--font-ui); font-style: italic; font-weight: 500; }
.meaning-grid .m .g { color: var(--muted-warm); }
.translation { font-family: var(--font-body); font-size: 1.05rem; line-height: 1.62; color: var(--ink); margin: 0 0 1rem; }
.explain-k { font-family: var(--font-ui); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted-warm); margin: 0 0 0.25rem; }
.explain { font-family: var(--font-body); font-size: 0.92rem; line-height: 1.58; color: var(--muted-warm); margin: 0; }

/* defined-term marking + interpretive-fork marker */
.cref { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--accent2-ink); text-underline-offset: 3px; }
.cref:hover, .cref:focus-visible { color: var(--accent2-ink); background: color-mix(in srgb, var(--accent2) 12%, transparent); border-radius: 3px; outline: none; }
.fork { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--accent2-ink); }
.fork sup { color: var(--accent2-ink); font-weight: 600; padding-left: 1px; }

.about-note { font-family: var(--font-ui); font-size: 0.76rem; color: var(--muted); text-align: center; margin: 0 auto 1.8rem; }
.about-lnk { font: inherit; color: var(--accent-ink); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }

/* ---- character modal (singleton) ---- */
.scrim { position: fixed; inset: 0; background: rgba(10,6,4,.55); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.scrim.open { display: flex; }
.cmodal { position: relative; background: var(--bg); border: 1px solid var(--seam); border-radius: 18px; max-width: 30rem; width: 100%; padding: 1.4rem 1.5rem 1.6rem; box-shadow: 0 24px 60px -24px rgba(40,20,0,.45); animation: cpop .16s ease-out; }
@keyframes cpop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.m-close { position: absolute; top: calc(.7rem - 5px); right: calc(.8rem - 5px); width: 44px; height: 44px; border-radius: 10px; border: none; background: transparent; color: var(--muted-warm); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.m-close:hover { color: var(--accent-ink); }
.m-head { display: flex; gap: 1rem; align-items: center; }
.portrait { width: 58px; height: 58px; border-radius: 12px; background: var(--src-field); display: grid; place-items: center; font-family: var(--font-deva); font-size: 1.7rem; color: var(--book); flex: 0 0 auto; }
.m-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin: 0; line-height: 1.1; }
.m-deva { font-family: var(--font-deva); font-size: 0.95rem; color: var(--muted-warm); margin: .1rem 0 0; }
.role-chip { display: inline-block; font-family: var(--font-ui); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent-ink); background: color-mix(in srgb, var(--book) 12%, var(--bg)); padding: .2rem .5rem; border-radius: 6px; margin-top: .35rem; }
.m-rule { width: 28px; height: 2px; background: var(--book); margin: 1rem 0; }
.m-sec { margin: 0 0 .8rem; }
.m-k { font-family: var(--font-ui); font-size: 0.54rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted-warm); margin: 0 0 .2rem; }
.m-sec p { margin: 0; font-family: var(--font-body); font-size: 0.96rem; line-height: 1.56; }
.m-meta { font-family: var(--font-ui); font-size: 0.74rem; color: var(--muted-warm); border-top: 1px solid var(--line); padding-top: .7rem; margin: .2rem 0 0; }
@media (max-width: 560px) {
  .scrim { align-items: flex-end; padding: 0; }
  .cmodal { max-width: none; border-radius: 18px 18px 0 0; animation: csheet .22s var(--ease-spring); }
  @keyframes csheet { from { transform: translateY(100%); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .cmodal { animation: none; } }

/* ---- fork / about popover ---- */
.popover { position: absolute; z-index: 70; max-width: 22rem; background: var(--bg); border: 1px solid var(--seam); border-radius: 12px; box-shadow: 0 18px 44px -20px rgba(40,20,0,.5); padding: .85rem 1rem; display: none; }
.popover.open { display: block; }
.popover .pk { font-family: var(--font-ui); font-size: 0.54rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent-ink); margin: 0 0 .3rem; }
.popover p:last-child { margin: 0; font-family: var(--font-body); font-size: 0.92rem; line-height: 1.55; }

/* ---- prev / next chapter controls ---- */
.ch-nav { display: flex; justify-content: space-between; gap: 1rem; max-width: 52rem; margin: 3rem auto 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.ch-nav-btn { flex: 1 1 0; display: flex; flex-direction: column; gap: 0.22rem; text-decoration: none; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.8rem 1.05rem; color: var(--ink); transition: border-color .15s, transform .15s; }
.ch-nav-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.ch-nav-btn.next { text-align: right; align-items: flex-end; }
.ch-nav-btn.disabled { visibility: hidden; }
.ch-nav .dir { font-family: var(--font-ui); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--accent); }
.ch-nav .lbl { font-family: var(--font-body); font-size: 0.98rem; }

/* ---- placeholder page for chapters not yet live ---- */
.coming { text-align: center; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 18px; padding: clamp(2rem, 6vw, 3.4rem); margin-top: 1rem; }
.coming-deva { font-family: var(--font-deva); font-size: clamp(1.6rem, 5vw, 2.3rem); color: var(--accent); margin: 0 0 0.6rem; }
.coming-k { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--muted); margin: 0 0 1.1rem; }
.coming-msg { max-width: 46ch; margin: 0 auto 1.7rem; color: var(--ink); }

@media (max-width: 760px) {
  .spread { grid-template-columns: 1fr; border-radius: 10px; }
  .side-src { border-right: none; padding: 1.1rem 1.2rem; }
  .side-src::before { display: none; }
  .side-src .kicker::after { content: ""; display: block; width: 26px; height: 2px; background: var(--book); margin-top: 0.4rem; }
  .side-mean { padding: 1.1rem 1.2rem; }
  .ch-pill em { display: none; }
  .ch-nav { flex-direction: column; }
  .ch-nav-btn.next { text-align: left; align-items: flex-start; }
}

/* ---- Read ⇄ Study mode toggle (shared by plain.html and read.html) ---- */
.pmode-wrap { display: block; width: 100%; text-align: center; margin: 0.2rem 0 1.5rem; }
.pmode { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pmode a { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 600; text-decoration: none; color: var(--muted); padding: 0.4rem 1rem; display: inline-flex; align-items: center; cursor: pointer; transition: color .14s, background .14s; }
.pmode a:not(.on):hover { color: var(--accent-ink); }
.pmode a.on { background: var(--accent); color: var(--accent-contrast); cursor: default; }
.pmode a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }   /* inset: .pmode clips its overflow */
@media (pointer: coarse) { .pmode a { min-height: 44px; } }

/* ---- plain English read-through (plain.html) ---- */
.plain-body { max-width: 39rem; margin: 0 auto; }
.pabout { font-family: var(--font-ui); font-size: var(--fs-small); color: var(--muted); text-align: left; max-width: 39rem; margin: 0 auto 2.4rem; line-height: 1.6; }
.pspk { font-family: var(--font-ui); font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--accent-ink); margin: 2.1rem 0 0.55rem; }
.pspk:first-child { margin-top: 0; }
.pread { font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.75; color: var(--ink); margin: 0 0 1.4rem; padding-left: 1.9rem; position: relative; }
.pv { color: inherit; text-decoration: none; cursor: pointer; border-radius: 5px; padding: 0.04em 0.06em; transition: background .14s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.pv:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.pv:focus-visible { background: color-mix(in srgb, var(--accent) 15%, transparent); outline: 2px solid var(--accent); outline-offset: 1px; }
.pvn { position: absolute; left: 0; top: 0.3em; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; color: var(--muted); transition: color .14s; }
.pv:hover .pvn, .pv:focus-visible .pvn { color: var(--accent-ink); }
.pend { text-align: center; font-family: var(--font-body); font-style: italic; color: var(--muted); max-width: 46ch; margin: 2.6rem auto 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.pend a { font-style: normal; font-family: var(--font-ui); font-size: 0.86rem; font-weight: 600; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.pend a:hover { text-decoration: underline; }

/* ---- verse-landing flash when arriving from a plain-read deep link ---- */
.verse { scroll-margin-top: 130px; }
@keyframes vflash { 0% { background: color-mix(in srgb, var(--accent) 20%, transparent); } 100% { background: transparent; } }
.verse.vflash { animation: vflash 2.2s ease-out; border-radius: 14px; }
.pv.vflash { animation: vflash 2.2s ease-out; }
@media (prefers-reduced-motion: reduce) { .verse.vflash, .pv.vflash { animation: none; } }

/* ---- floating mode switch: always reachable, returns to the same verse ---- */
.mode-switch { position: fixed; left: 50%; bottom: 18px; z-index: 50; transform: translateX(-50%) translateY(14px); display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; text-decoration: none; color: var(--accent-contrast); background: var(--accent); border: 1px solid color-mix(in srgb, var(--accent-contrast) 14%, var(--accent)); border-radius: 10px; padding: 0.55rem 1.15rem; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.mode-switch.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.mode-switch:hover { filter: brightness(1.06); }
.mode-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .mode-switch { transition: opacity .2s ease; } }

/* ===== Liquid glass =====
   Genuine translucency + a bright specular rim + a soft lift. Shows strongest
   over imagery (the Gita painting, the chapter art); a clean frosted surface
   over plain paper. */
.lg {
  background: color-mix(in srgb, var(--surface) 32%, transparent);
  -webkit-backdrop-filter: blur(11px) saturate(180%) brightness(1.05); backdrop-filter: blur(11px) saturate(180%) brightness(1.05);
  border: 1px solid var(--lg-edge);
  box-shadow: inset 0 1px 1px var(--glass-hi), inset 0 -10px 20px -14px var(--lg-edge), 0 14px 34px -12px rgba(20,16,50,.3);
}
.lg-dark {
  background: rgba(20,16,40,.22);
  -webkit-backdrop-filter: blur(13px) saturate(170%); backdrop-filter: blur(13px) saturate(170%);
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), inset 0 0 26px rgba(255,255,255,.06), 0 18px 44px -14px rgba(0,0,0,.5);
}
.btn-primary {
  background: color-mix(in srgb, var(--accent) 74%, transparent);
  -webkit-backdrop-filter: blur(8px) saturate(160%); backdrop-filter: blur(8px) saturate(160%);
  border: 1px solid color-mix(in srgb, #fff 40%, transparent); color: #fff;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -6px 14px -10px rgba(255,255,255,.28), 0 12px 26px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-ghost {
  background: color-mix(in srgb, var(--surface) 34%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.05); backdrop-filter: blur(10px) saturate(180%) brightness(1.05);
  border: 1px solid var(--lg-edge);
  box-shadow: inset 0 1px 1px var(--glass-hi), 0 10px 24px -14px rgba(20,16,40,.28);
}
.votd-card {
  background: color-mix(in srgb, var(--surface-alt) 55%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(170%); backdrop-filter: blur(12px) saturate(170%);
  border: 1px solid var(--lg-edge);
  box-shadow: inset 0 1px 1px var(--glass-hi), 0 16px 40px -24px rgba(20,16,40,.3);
}
.trans-item, .chapter-note { box-shadow: inset 0 1px 1px var(--glass-hi); }
a.book { box-shadow: inset 0 1px 1px var(--glass-hi); }
a.book:hover { box-shadow: inset 0 1px 1px var(--glass-hi), 0 16px 34px -20px rgba(0,0,0,.42); }
.chapter-rail {
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--lg-edge);
}
.pmode {
  background: color-mix(in srgb, var(--surface) 36%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(180%); backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid var(--lg-edge);
  box-shadow: inset 0 1px 1px var(--glass-hi), 0 8px 22px -14px rgba(20,16,40,.3);
}
.mode-switch {
  color: var(--on-glass); /* the glass is fixed dark indigo in both themes; --accent-contrast is near-black in dark */
  background: color-mix(in srgb, var(--glass-ink-bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(170%); backdrop-filter: blur(12px) saturate(170%);
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 14px 32px -10px rgba(0,0,0,.5);
}
.side-src {
  background: color-mix(in srgb, var(--book) 16%, color-mix(in srgb, var(--surface) 42%, transparent));
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
  box-shadow: inset 0 1px 1px var(--glass-hi);
}


/* Real refraction — warp the backdrop through the glass (Chromium). Safari/iOS
   keep the -webkit blur fallback declared on each element above. */
.lg, .btn-ghost, .votd-card, .chapter-rail, .pmode, .mode-switch, .side-src {
  backdrop-filter: url(#lgFilter) blur(3px) saturate(180%);
}

/* =====================================================================
   Homepage glass over colour / imagery (final — wins over the generic
   refraction override above). Hero glass is scoped under .hero inline.
   ===================================================================== */

/* Verse-of-the-day: frosted indigo glass refracting the painting behind it */
.votd-frame .votd-card {
  background: rgba(26,18,64,.44);   /* >= .42 so text holds 4.5:1 over the paler passages of the painting */
  border: 1px solid rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);   /* the largest glass on the site: no displacement filter */
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), inset 0 -18px 32px -26px rgba(255,255,255,.15), 0 18px 44px -22px rgba(0,0,0,.45);
  color: #fff;
}
.votd-frame .votd-k { color: rgba(255,255,255,.92); }
.votd-frame .votd-deva { color: #fff; text-shadow: 0 1px 10px rgba(10,6,30,.4); }
.votd-frame .votd-trans { color: rgba(255,255,255,.96); }
.votd-frame .votd-ref { color: rgba(255,255,255,.72); }
.votd-frame .votd-shuffle {
  color: #fff; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.34);
  -webkit-backdrop-filter: none; backdrop-filter: none;   /* already on the card glass: no second blur */
}
@media (hover: hover) { .votd-frame .votd-shuffle:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.5); color: #fff; } }
.votd-frame .votd-shuffle:focus-visible { outline-color: #fff; }

/* Library covers: a glass tile — specular glare + rim light over the colour */
.cover .glyph { position: relative; z-index: 2; }
.cover .badge, .badge { z-index: 3; }
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.36) 0%, rgba(255,255,255,.08) 22%, rgba(255,255,255,0) 46%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 0 0 1px rgba(255,255,255,.12), inset 0 -26px 42px -26px rgba(0,0,0,.4);
}
a.book:hover .cover::after { background: linear-gradient(135deg, rgba(255,255,255,.46) 0%, rgba(255,255,255,.1) 24%, rgba(255,255,255,0) 50%); }

/* verse card: on phones the card sits full width at the foot of the painting */
@media (max-width: 760px) {
  .votd-frame { align-items: flex-end; padding: 6rem 0 calc(3.5rem + env(safe-area-inset-bottom, 0px)); }
  .votd-credit { bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); color: #fff; }   /* full white: the white cows and cranes sit under it */
  .votd-credit .vc-d { display: none; }
  .votd-credit .vc-m { display: inline; }
  .votd-art img { object-position: 45% 50%; }
  .votd-frame .votd-card { width: 100%; }
}

/* =====================================================================
   Chapter masthead — a distinct image per chapter with the Devanāgarī
   label + title riding on it in liquid glass (apple-motion: translucent
   layer over image, bright top edge, vibrant high-contrast text).
   ===================================================================== */
.chapter-hero { position: relative; max-width: var(--measure); margin: 0 auto 0.7rem;
  border-radius: 22px; overflow: hidden; display: flex; align-items: flex-end;
  min-height: clamp(220px, 34vw, 360px); padding: clamp(14px, 3vw, 26px);
  background: linear-gradient(0deg, rgba(14,9,38,.58), rgba(14,9,38,.14) 55%, rgba(14,9,38,.04)), var(--art, linear-gradient(135deg, var(--book), #1a1030));
  background-size: cover; background-position: center 32%;
  box-shadow: 0 26px 64px -32px rgba(20,12,50,.55); }
.chapter-cap { width: min(100%, 30rem); border-radius: 16px; padding: 0.9rem 1.25rem 1.05rem;
  background: rgba(20,14,48,.24); border: 1px solid rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: url(#lgFilter) blur(14px) saturate(150%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), inset 0 -16px 30px -24px rgba(255,255,255,.15), 0 16px 40px -22px rgba(0,0,0,.5); }
.chapter-cap .deva { font-family: var(--font-deva); font-weight: 600; font-size: clamp(1.2rem, 3vw, 1.55rem); line-height: 1.3; color: #fff; margin: 0 0 0.15rem; text-shadow: 0 1px 10px rgba(10,6,30,.4); }
.chapter-cap h1 { font-family: var(--font-body); font-weight: 500; font-style: italic; font-size: clamp(1.02rem, 2.2vw, 1.2rem); line-height: 1.35; color: rgba(255,255,255,.92); margin: 0; }
@media (max-width: 760px) { .chapter-hero { min-height: 200px; } .chapter-cap { width: 100%; } }

/* =====================================================================
   Gītā page hero (gita.html): the painting edge to edge, one glass panel
   with the title and the two ways in. The panel stays in the .wrap flow
   (so it sits on the content edge); only the picture and scrim break out.
   ===================================================================== */
.gw-hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(420px, 62vh, 640px); min-height: clamp(420px, 62svh, 640px); margin: 0.4rem 0 0; padding: 2rem 0; }
.gw-art, .gw-hero::before { position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw; }
.gw-art { z-index: 0; display: block; background: var(--glass-ink-bg); }
.gw-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
@media (min-width: 1024px) {   /* the 2:1-and-wider band: keep the riders' heads in frame */
  .gw-art img { object-position: 50% 0%; }
}
.gw-hero::before { content: ""; z-index: 1; pointer-events: none; background: linear-gradient(0deg, rgba(10,6,30,.6), rgba(10,6,30,0) 75%); }
.gw-panel { position: relative; z-index: 2; width: min(34rem, 100%); padding: 1.3rem 1.5rem 1.4rem; border-radius: 24px; color: #fff;
  background: rgba(20,14,48,.42); border: 1px solid rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 18px 44px -22px rgba(0,0,0,.5); }
.gw-panel .deva { font-family: var(--font-deva); font-weight: 600; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.35; margin: 0 0 0.15rem; }
.gw-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 4.5vw, 2.5rem); line-height: 1.08; letter-spacing: -0.02em; color: #fff; margin: 0 0 1rem; }
.gw-btns { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* solid-ish pills on the panel: no second backdrop blur stacked on the glass */
.gw-panel .btn-primary { color: #2c1570; background: rgba(243,240,255,.92); border-color: rgba(255,255,255,.75); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 1px 1px #fff, 0 10px 24px -14px rgba(0,0,0,.5); }
.gw-panel .btn-ghost { color: var(--on-glass); background: rgba(243,240,255,.14); border-color: rgba(243,240,255,.45); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 1px 1px rgba(255,255,255,.5); }
.gw-credit { font-family: var(--font-ui); font-size: var(--fs-micro); letter-spacing: 0.01em; line-height: 1.45; color: var(--muted); margin: 0.6rem 0 0; }
.gw-sub { font-family: var(--font-body); font-style: italic; font-size: 1.1rem; line-height: 1.5; color: var(--muted-warm); max-width: 46ch; margin: 1.2rem 0 0.8rem; }
.gw-desc { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin: 0 0 1.6rem; }
.gw-desc-k { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); margin: 0; }
.gw-desc-d { font-family: var(--font-body); font-size: 0.95rem; line-height: 1.55; color: var(--muted-warm); margin: 0.2rem 0 0; }
@media (max-width: 760px) {
  .gw-hero { min-height: max(clamp(420px, 62vh, 640px), 64vh); min-height: max(clamp(420px, 62svh, 640px), 64svh); padding: 1.25rem 0 calc(18px + env(safe-area-inset-bottom, 0px)); }
  .gw-art img { object-position: 30% 50%; }
  .gw-panel { width: 100%; padding: 1.1rem 1.2rem 1.2rem; }
  .gw-btns { flex-direction: column; gap: 8px; }
  .gw-btns .btn { width: 100%; padding-inline: 1rem; }
  .gw-sub { font-size: 1rem; }
  .gw-desc { grid-template-columns: 1fr; gap: 1rem; }
}

/* =====================================================================
   Home: the hero is a curtain the rest of the page slides over. No
   scroll-jacking: the hero is simply sticky and everything after it is
   opaque and above it. Only when the hero fits the viewport (otherwise
   its buttons could end up under the curtain) and motion is welcome.
   ===================================================================== */
.hero ~ .wrap { padding-bottom: 2.5rem; }   /* the footer's top margin moves inside the opaque layer */
.hero ~ footer { margin-top: 0; }
@media (min-height: 700px) and (prefers-reduced-motion: no-preference) {
  .hero { position: sticky; top: var(--header-h); z-index: 0; }   /* just under the header's height, so no seam shows */
  .hero ~ .wrap, .hero ~ footer { position: relative; z-index: 1; background: var(--bg); }
  .hero ~ .wrap::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw; z-index: -1; background: var(--bg); }   /* opaque gutters */
  .hero:has(:focus-visible) { position: relative; }   /* keyboard focus moving back into the hero: un-stick it so it scrolls into view, never under the curtain */
}

/* =====================================================================
   Reading progress, Phase 1 (on device only). Built by assets/progress.js.
   Two marks, one meaning each: a 2px accent bar = "your place"; a thin
   stroke tick = "complete". Nothing else gets a mark. No new colours.
   ===================================================================== */
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.pprog[hidden], .pprog-note[hidden], .pend-prog[hidden], .yr [hidden] { display: none !important; }

/* ---- chapter rail marks ---- */
.ch-pill { position: relative; }
.ch-pill .ch-tick { width: .75rem; height: .75rem; flex: none; margin-left: -.12rem; color: var(--accent); }
.ch-pill.cur .ch-tick { color: var(--accent-contrast); }
.ch-pill.part::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 2px; border-radius: 1px; pointer-events: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 0 / clamp(12%, calc(var(--p, 0) * 100%), 88%) 100% no-repeat, var(--line); }
.ch-pill.cur.part::after {
  background: linear-gradient(var(--accent-contrast), var(--accent-contrast)) 0 0 / clamp(12%, calc(var(--p, 0) * 100%), 88%) 100% no-repeat,
              color-mix(in srgb, var(--accent-contrast) 30%, transparent); }
.ch-pill.soon::after { content: none; }
.ch-pill.soon .ch-tick { display: none; }
@media (pointer: coarse) {
  .rail-track { padding-block: 10px 13px; margin-block: -10px -13px; gap: .5rem; }
  .ch-pill::before { content: ""; position: absolute; inset: -9.5px -.25rem; }
}

/* ---- progress line + first-run note (inside .pmode-wrap, never on the masthead) ---- */
.pprog { margin: .6rem auto 0; max-width: 42ch; font-family: var(--font-ui); font-size: var(--fs-micro); font-weight: 500; line-height: 1.45; letter-spacing: .01em; color: var(--muted-warm); font-variant-numeric: tabular-nums; text-wrap: balance; }
.sep { margin-inline: .35em .1em; color: var(--muted); } /* every separator is followed by a breaking space: .35em each side */
.pprog .seg, .pprog-note .seg, .yr-sum .seg { white-space: nowrap; }
.pprog .ch-tick { width: .75rem; height: .75rem; margin-right: .35em; vertical-align: -1px; color: var(--accent); }
.pprog-note { margin: .2rem auto 0; font: 400 var(--fs-micro)/1.4 var(--font-ui); letter-spacing: .015em; color: var(--muted); }
.tlink { font: inherit; font-weight: 600; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.tlink:hover { text-decoration-color: currentColor; }
.tlink:active { opacity: .6; }
.tlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tlink.quiet { color: var(--muted); font-weight: 500; }
/* coarse pointers: a >=44px hit area in a ::before, so the focus outline still hugs the text */
.tlink { position: relative; }
@media (pointer: coarse) { .tlink::before { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: max(44px, 100%); transform: translateY(-50%); } }
/* progress slot under the mode toggle: reserved height so states swap in place
   (desktop: count line + note; phone: one more line for wrapping). JS only ever grows it. */
.pprog-slot { display: flow-root; min-height: calc(.8rem + 2.85 * var(--fs-micro)); }
@media (max-width: 760px) { .pprog-slot { min-height: calc(.8rem + 4.25 * var(--fs-micro)); } }
.pprog-slot.is-quiet { min-height: calc(.6rem + 1.45 * var(--fs-micro)); }
/* chapter pages: keep the footer's last line clear of the floating mode switch */
body:has(> .mode-switch) footer .wrap { padding-bottom: calc(18px + 2.4rem + 1.5rem + env(safe-area-inset-bottom, 0px)); }
.yr-foot { margin-top: .4rem; }

/* ---- end-of-chapter row (before .ch-nav / .pend) ---- */
.pend-prog { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .3rem .65rem; max-width: 46ch; min-height: 2.75rem; margin: 3rem auto 0;
  font: var(--fs-small)/1.5 var(--font-ui); color: var(--muted-warm); font-variant-numeric: tabular-nums; text-align: center; }
.pend-prog .ch-tick { width: .8rem; height: .8rem; color: var(--accent); }
.pend-prog .done { color: var(--ink); }
.pend-prog + .ch-nav, .pend-prog + .pend { margin-top: 1.25rem; }

/* ---- gita.html compact line, under the hero picture ---- */
.continue-line { position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin: 0 0 .5rem; padding-left: .8rem;
  font: 500 .86rem var(--font-ui); color: var(--ink); text-decoration: none; }
.continue-line::before { content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 1.05em; transform: translateY(-50%); border-radius: 2px; background: var(--accent); }
.continue-line .mode { color: var(--muted-warm); }
.continue-line .arr { color: var(--accent-ink); font-weight: 600; }
.continue-line:hover .main { text-decoration: underline; text-underline-offset: 3px; }
.continue-line:active { opacity: .7; }
.continue-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- library card foot: text only, no bar ---- */
.book-foot { font-variant-numeric: tabular-nums; }
.book-foot .ch-tick { width: .7rem; height: .7rem; margin-right: .3rem; vertical-align: -1px; color: var(--accent); }

/* ---- "Your reading" dialog: reuses .scrim/.cmodal via modifiers ---- */
.scrim.yr-scrim { display: flex; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity 200ms linear, visibility 0s linear 320ms; } /* closing: input passes straight through */
.scrim.yr-scrim.open { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity 200ms linear, visibility 0s; }
.cmodal.yr { animation: none; opacity: 0; transform: scale(.97);
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); max-height: min(88dvh, 40rem); overflow-y: auto; overscroll-behavior: contain;
  transition: opacity 200ms ease-out, transform 320ms var(--ease-spring); }
.scrim.yr-scrim.open .cmodal.yr { opacity: 1; transform: none; }
.cmodal.yr:focus { outline: none; }
.yr .yr-title { margin: 0 2.75rem 0 0; }
.yr-sum { margin: 0; font-family: var(--font-body); font-size: 1.05rem; line-height: 1.4; color: var(--ink); font-variant-numeric: tabular-nums; }
.yr-last { margin: .25rem 0 0; font: .82rem/1.4 var(--font-ui); color: var(--muted-warm); font-variant-numeric: tabular-nums; }
.yr-p { margin: .9rem 0 0; font-family: var(--font-body); font-size: .92rem; line-height: 1.58; color: var(--muted-warm); }
.yr-msgs .yr-p:first-child { margin-top: 0; }
.yr-sum:not([hidden]) ~ .yr-msgs .yr-p:first-child { margin-top: .9rem; }
.yr-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); font: 500 .92rem/1.3 var(--font-ui); color: var(--ink); }
.yr-note { margin: .35rem 0 0; font: .76rem/1.45 var(--font-ui); color: var(--muted); }
.yr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.1rem; }
.yr-done { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; min-height: 44px; font: .86rem/1.4 var(--font-ui); color: var(--ink); }
/* helper (armed) and status share one fixed-height slot: arming never moves Clear */
.yr-slot { min-height: calc(.86rem * 1.5); margin-top: .5rem; }
@media (max-width: 560px) { .yr-slot { min-height: calc(2 * 1.4 * var(--fs-micro)); } }
.yr-slot .yr-help { margin: 0; text-align: left; }
.yr-status { margin: 0; font: .86rem/1.5 var(--font-ui); color: var(--ink); }
.yr .yr-close { top: .45rem; right: .5rem; width: 44px; height: 44px; }
.yr-switch { position: relative; flex: none; width: 2.75rem; height: 1.625rem; border-radius: 999px; border: 0; padding: 0; background: var(--muted); cursor: pointer; }
.yr-switch::before { content: ""; position: absolute; inset: -9px 0; }
.yr-switch::after { content: ""; position: absolute; top: .1875rem; left: .1875rem; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.28); transition: transform 150ms var(--ease-spring); }
.yr-switch[aria-checked="true"] { background: var(--accent); }
.yr-switch[aria-checked="true"]::after { transform: translateX(1.125rem); }
.yr-switch:active { filter: brightness(.92); }
.yr-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yr-btn { min-height: 44px; padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 .86rem var(--font-ui); cursor: pointer; }
.yr-btn:active { background: var(--surface-alt); }
.yr-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yr-btn.clear { color: var(--accent2-ink); border-color: color-mix(in srgb, var(--accent2) 40%, var(--line-strong)); }
.yr-btn.clear[data-armed] { background: color-mix(in srgb, var(--accent2) 10%, var(--bg)); border-color: var(--accent2-ink); }
@media (max-width: 560px) {
  .cmodal.yr { opacity: 1; transform: translateY(100%); }
  .scrim.yr-scrim.open .cmodal.yr { transform: none; }
}
@media (max-width: 400px) { .yr-actions { grid-template-columns: 1fr; } }   /* "Download my reading" needs ~400px to sit on one line beside Clear */
@media (max-width: 560px) { .yr-done .seg .sep { display: none; } }   /* the row wraps on phone: Undo starts its own line, no leading dot */
/* phone rail: fade the clipped edges so a half-hidden pill never leaves a lone tick */
@media (max-width: 760px) {
  .rail-track { padding-inline: 14px; scroll-padding-inline: 14px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
}

/* ---- tick fade on completion only (opacity; kept under reduced motion) ---- */
@keyframes tickin { from { opacity: 0; } }
.ch-tick.tick-in { animation: tickin 160ms var(--ease-spring) both; }

/* ---- landing on a verse: it takes focus; no wash over the verse text ---- */
.verse[tabindex="-1"]:focus { outline: none; }
.pv.landed:focus-visible { background: transparent; }

/* =====================================================================
   Accessibility fallbacks. These MUST stay at the very end of the file:
   they override the glass blocks above (incl. the url(#lgFilter) rule).
   Studio note: theme.css loads later, so a founder override of
   .mode-switch's background still wins over these.
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html, .rail-track { scroll-behavior: auto; }
  .verse.vflash .spread::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; }   /* above .side-src's glass; .spread is position: relative */
  .pread:has(> .pv.vflash)::before { content: ""; position: absolute; left: -.75rem; top: .3em; bottom: .3em; width: 2px; border-radius: 2px; background: var(--accent); }
  .pv.vflash:focus-visible { background: transparent; }
  .cmodal.yr, .scrim.yr-scrim.open .cmodal.yr { transform: none; transition: opacity 200ms linear; }
  .cmodal.yr { opacity: 0; }
  .scrim.yr-scrim.open .cmodal.yr { opacity: 1; }
  .yr-switch::after { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .chapter-rail { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--line); }
  .pmode { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line-strong); }
  .mode-switch { background: var(--glass-ink-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .scrim.yr-scrim { background: rgba(10,6,4,.72); -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* the other glass surfaces: a solid version of the same tint, no blur */
  .chapter-cap { background: rgba(20,14,48,.82); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .votd-frame .votd-card { background: rgba(26,18,64,.86); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .votd-frame .votd-shuffle { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero .btn-primary { background: var(--on-glass); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero .btn-ghost { background: rgba(243,240,255,.2); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .side-src { background: color-mix(in srgb, var(--book) 16%, var(--surface)); -webkit-backdrop-filter: none; backdrop-filter: none; }
  header.site { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .scrim { background: rgba(10,6,4,.72); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .b-soon { background: rgba(0,0,0,.62); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lg { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lg-dark { background: rgba(20,16,40,.86); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .btn-primary { background: var(--accent); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .btn-ghost { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .votd-card { background: var(--surface-alt); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .gw-panel { background: rgba(20,14,48,.86); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .chapter-rail { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--muted); }
  .ch-pill { border-color: var(--muted); }
  .ch-pill.part::after { height: 3px; bottom: 1px;
    background: linear-gradient(var(--accent-ink), var(--accent-ink)) 0 0 / clamp(12%, calc(var(--p, 0) * 100%), 88%) 100% no-repeat,
                linear-gradient(var(--muted), var(--muted)) 0 100% / 100% 1px no-repeat; }
  .ch-pill.cur.part::after {
    background: linear-gradient(var(--accent-contrast), var(--accent-contrast)) 0 0 / clamp(12%, calc(var(--p, 0) * 100%), 88%) 100% no-repeat,
                linear-gradient(var(--accent-contrast), var(--accent-contrast)) 0 100% / 100% 1px no-repeat; }
  .ch-tick path { stroke-width: 2.2; }
  .pmode { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--muted); }
  .mode-switch { background: var(--glass-ink-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--on-glass); }
  .pprog, .pprog-note, .pend-prog, .continue-line .mode { color: var(--ink); }
  .yr-btn, .cmodal.yr { border-color: var(--muted); }
  .scrim.yr-scrim { background: rgba(10,6,4,.8); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .tlink { text-decoration-color: currentColor; }
  /* the other glass surfaces: near-solid with a defined edge (this is the rule that reaches Safari) */
  .chapter-cap { background: rgba(20,14,48,.82); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: rgba(255,255,255,.7); }
  .votd-frame .votd-card { background: rgba(26,18,64,.86); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: rgba(255,255,255,.7); }
  .votd-frame .votd-shuffle { -webkit-backdrop-filter: none; backdrop-filter: none; border-color: rgba(255,255,255,.7); }
  .hero .btn-primary { background: var(--on-glass); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero .btn-ghost { background: rgba(243,240,255,.2); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--on-glass); }
  .side-src { background: color-mix(in srgb, var(--book) 16%, var(--surface)); -webkit-backdrop-filter: none; backdrop-filter: none; }
  header.site { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--muted); }
  .scrim { background: rgba(10,6,4,.8); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .b-soon { background: rgba(0,0,0,.72); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lg { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--muted); }
  .lg-dark { background: rgba(20,16,40,.86); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .btn-primary { background: var(--accent); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .btn-ghost { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--muted); }
  .votd-card { background: var(--surface-alt); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--muted); }
  .gw-panel { background: rgba(20,14,48,.86); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: rgba(255,255,255,.7); }
  .gw-panel .btn-ghost, .votd-frame .votd-shuffle { border-color: rgba(255,255,255,.7); }
}
@media (prefers-reduced-transparency: reduce) and (max-width: 760px), (prefers-contrast: more) and (max-width: 760px) {
  .hero .btn-ghost { background: color-mix(in srgb, var(--glass-ink-bg) 60%, transparent); }   /* the phone ghost sits in the ember glow: keep its dark tint, solid */
}
@media (forced-colors: active) {
  .gw-panel, .votd-frame .votd-card { background: Canvas; color: CanvasText; border: 1px solid CanvasText; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .votd-credit, .gw-panel h1, .gw-panel .deva, .votd-frame .votd-k, .votd-frame .votd-deva, .votd-frame .votd-trans, .votd-frame .votd-ref { color: CanvasText; text-shadow: none; }
  .gw-hero::before, .votd-frame::before { display: none; }
  .btn, .votd-shuffle { border: 1px solid ButtonText; }
  .ch-pill.part::after, .ch-pill.cur.part::after { forced-color-adjust: none;
    background: linear-gradient(CanvasText, CanvasText) 0 0 / clamp(12%, calc(var(--p, 0) * 100%), 88%) 100% no-repeat, GrayText; }
  .continue-line::before, .pread:has(> .pv.vflash)::before, .verse.vflash .spread::after { forced-color-adjust: none; background: Highlight; }
}
