/* Vaaani — a house of language. Design tokens + components. */
:root {
  --paper: #f7f2e8;
  --paper-2: #efe7d7;
  --card: #fffdf8;
  --ink: #1f1a14;
  --ink-2: #4a4136;
  --ink-3: #776b5c;
  --rule: #ddd1bd;
  --accent: #a8381c;        /* sindoor */
  --accent-ink: #ffffff;
  --accent-soft: #f6e2d6;
  --teal: #135f6b;          /* the book's colour */
  --teal-soft: #dcecec;
  --gold: #a67c1e;
  --hl: #ffe9a8;
  --ok: #2f7a3e;
  --bad: #b3261e;
  --shadow: 0 1px 2px rgba(60,40,10,.06), 0 8px 24px rgba(60,40,10,.06);
  --serif: "EB Garamond", "Noto Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --deva: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", serif;
  --beng: "Noto Serif Bengali", "Noto Sans Bengali", serif;
  --measure: 68ch;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15120e; --paper-2: #1d1914; --card: #211c16;
    --ink: #f1e9dc; --ink-2: #d2c6b4; --ink-3: #a5978a; --rule: #3a3229;
    --accent: #e8744f; --accent-ink: #1a0e08; --accent-soft: #3a2018;
    --teal: #6fc1c9; --teal-soft: #173538; --gold: #d9b45a; --hl: #5a4a12;
    --ok: #6fcf86; --bad: #ff8a80; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15120e; --paper-2: #1d1914; --card: #211c16;
  --ink: #f1e9dc; --ink-2: #d2c6b4; --ink-3: #a5978a; --rule: #3a3229;
  --accent: #e8744f; --accent-ink: #1a0e08; --accent-soft: #3a2018;
  --teal: #6fc1c9; --teal-soft: #173538; --gold: #d9b45a; --hl: #5a4a12;
  --ok: #6fcf86; --bad: #ff8a80; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.6;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.deva, [lang="sa"], [lang="hi"] { font-family: var(--deva); }
[lang="bn"], .beng { font-family: var(--beng); }
.iast { font-style: italic; }
.sans { font-family: var(--sans); }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }

/* Layout */
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { margin-top: 2.2em; }
section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 80px 0; } }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* Type */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .45em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 500; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.lede { font-size: clamp(1.2rem, 2.2vw, 1.45rem); color: var(--ink-2); max-width: 60ch; }
blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--gold); color: var(--ink-2); font-style: italic; }
blockquote cite { display: block; font-style: normal; font-family: var(--sans); font-size: .8rem; color: var(--ink-3); margin-top: .5em; }
code, kbd { font-family: ui-monospace, "JetBrains Mono", monospace; font-size: .85em; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-deva { font-family: var(--deva); font-size: 1.7rem; line-height: 1; color: var(--accent); }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: .01em; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; font-family: var(--sans); font-size: .86rem; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav a.nav-shop { background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 8px 16px; margin-left: 4px; }
.nav a.nav-shop:hover, .nav a.nav-shop[aria-current="page"] { background: var(--ink); color: var(--paper); }
.theme-btn { flex: none; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
@media (max-width: 899px) {
  .head-row { flex-wrap: wrap; padding-top: 10px; min-height: 0; }
  .nav { order: 3; width: 100%; padding: 6px 0 8px; }
  .nav a:first-child { padding-left: 0; }
}

/* Hero */
.hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
@media (min-width: 900px) { .hero { padding: 96px 0 64px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.25fr 1fr; } }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-mark { font-family: var(--deva); font-size: clamp(6rem, 20vw, 13rem); line-height: .9; color: var(--accent); opacity: .92; text-align: center; }
.hero-mark small { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--ink-3); font-style: italic; margin-top: 12px; line-height: 1.4; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 600; font-size: .95rem; padding: 12px 20px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-teal { background: var(--teal); color: #fff; }
:root[data-theme="dark"] .btn-teal { color: #0b1d20; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-teal { color: #0b1d20; } }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: var(--card); }

/* Cards & grids */
.grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
a.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.wing-deva { font-family: var(--deva); font-size: 2.2rem; color: var(--accent); line-height: 1.1; }
.wing-name { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 12px; }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--ink-2); font-size: 1.05rem; margin-bottom: .6em; }
.tag { display: inline-block; font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.tag-soon { background: var(--paper-2); color: var(--ink-3); }
.card-links { font-family: var(--sans); font-size: .88rem; margin: 10px 0 0; padding: 0; list-style: none; }
.card-links li { margin: 4px 0; }

/* Page head */
.page-head { padding: 44px 0 20px; border-bottom: 1px solid var(--rule); }
.crumbs { font-family: var(--sans); font-size: .82rem; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-3); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--sans); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--paper-2); }
tr:last-child td { border-bottom: 0; }
td .rom { display: block; font-size: .86rem; color: var(--ink-3); font-style: italic; }

/* Callouts */
.note { border-left: 4px solid var(--teal); background: var(--teal-soft); padding: 16px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.4em 0; }
.note p:last-child { margin: 0; }
.note strong.lbl { font-family: var(--sans); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); display: block; margin-bottom: 4px; }
.sutra { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; margin: 1em 0; }
.sutra .deva { font-size: 1.45rem; color: var(--accent); }
.sutra .iast { display: block; color: var(--ink-2); }
.sutra .ref { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); }

/* Interactive: shared */
.tool { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); margin: 1.5em 0; }
@media (min-width: 720px) { .tool { padding: 28px; } }
.tool-title { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); font-weight: 700; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--sans); font-size: .9rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.result { font-family: var(--sans); font-size: .95rem; color: var(--ink-2); margin-top: 14px; min-height: 1.5em; }
.result .ok { color: var(--ok); font-weight: 600; }
.result .bad { color: var(--bad); font-weight: 600; }

/* Kāraka sentence */
.sentence { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.9; margin: 14px 0; }
.sentence .seg { border-radius: 6px; padding: 2px 3px; transition: background .2s ease, box-shadow .2s ease; }
.sentence button.seg { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; border-bottom: 2px dotted var(--rule); }
.sentence .seg.lit { background: var(--hl); box-shadow: 0 0 0 2px var(--gold) inset; }
.sentence .seg.right { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.sentence .seg.wrong { background: color-mix(in srgb, var(--bad) 20%, transparent); }
.sentence-sub { font-size: 1.3rem; margin: 4px 0; }
.qbtn small { opacity: .7; font-style: italic; margin-left: 4px; }

/* Śivasūtra grid */
.ss-grid { display: grid; gap: 8px; }
.ss-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
@media (max-width: 560px) { .ss-snd, .ss-it { min-width: 32px; height: 40px; font-size: 1.1rem; padding: 0 3px; } .ss-num { width: 14px; } }
.ss-num { font-family: var(--sans); font-size: .72rem; color: var(--ink-3); width: 22px; text-align: right; flex: none; }
.ss-snd, .ss-it { font-family: var(--deva); font-size: 1.3rem; min-width: 40px; height: 44px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; line-height: 1; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
.ss-snd small, .ss-it small { font-family: var(--serif); font-style: italic; font-size: .7rem; color: var(--ink-3); margin-top: 2px; }
.ss-it { border-style: dashed; color: var(--accent); background: transparent; }
.ss-snd.in { background: var(--hl); border-color: var(--gold); }
.ss-snd.start, .ss-it.end { outline: 3px solid var(--accent); outline-offset: 1px; }
.ss-snd:disabled, .ss-it:disabled { opacity: .35; cursor: not-allowed; }
.ss-out { margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--paper-2); }
.ss-out .name { font-size: 1.6rem; }
.ss-out .name .deva { color: var(--accent); }

/* Varga grid */
.varga { display: grid; grid-template-columns: auto repeat(5, minmax(0,1fr)); gap: 6px; font-size: 1rem; }
.varga .h { font-family: var(--sans); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); align-self: end; padding-bottom: 4px; text-align: center; }
.varga .rh { font-family: var(--sans); font-size: .78rem; color: var(--ink-2); align-self: center; padding-right: 6px; }
.varga .rh i { display: block; font-family: var(--serif); color: var(--ink-3); }
.varga .c { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; text-align: center; padding: 8px 2px; }
.varga .c .deva { font-size: 1.5rem; display: block; line-height: 1.2; }
.varga .c .beng { font-size: 1.05rem; display: block; color: var(--ink-3); }
.varga .c .iast { font-size: .85rem; color: var(--ink-2); }
@media (max-width: 560px) { .varga .rh i { display: none; } .varga .c .deva { font-size: 1.25rem; } }

/* Book */
.book-hero { display: grid; gap: 36px; align-items: start; }
@media (min-width: 900px) { .book-hero { grid-template-columns: 340px 1fr; } }
@media (max-width: 899px) { .cover { max-width: 240px !important; } }
.cover { border-radius: 6px 14px 14px 6px; box-shadow: 0 2px 4px rgba(0,0,0,.15), 0 24px 48px rgba(19,95,107,.25); transform: perspective(1200px) rotateY(-4deg); max-width: 340px; margin: 0 auto; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.facts li { font-family: var(--sans); font-size: .82rem; padding: 6px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.pages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 720px) { .pages { grid-template-columns: repeat(4, 1fr); } }
.pages figure { margin: 0; }
.pages img { border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); background: #fff; }
.pages figcaption { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); margin-top: 6px; }
.units { counter-reset: u; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .units { grid-template-columns: 1fr 1fr; } }
.units li { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.units b { font-family: var(--sans); font-size: .75rem; color: var(--teal); letter-spacing: .08em; text-transform: uppercase; display: block; }

/* Timeline */
.tl { list-style: none; padding: 0; margin: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--rule); }
.tl li { position: relative; padding: 0 0 28px 34px; }
.tl li::before { content: ""; position: absolute; left: 0; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--accent); }
.tl .when { font-family: var(--sans); font-size: .8rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.tl h3 { margin: 2px 0 4px; font-size: 1.25rem; }
.tl p { margin: 0; color: var(--ink-2); font-size: 1.05rem; }

/* Glossary */
.gl { display: grid; gap: 0; }
.gl dt { font-weight: 600; font-size: 1.2rem; padding-top: 16px; border-top: 1px solid var(--rule); }
.gl dt:first-child { border-top: 0; }
.gl dt .deva { color: var(--accent); font-weight: 400; margin-left: 8px; }
.gl dd { margin: 4px 0 14px; color: var(--ink-2); }
.gl-filter { width: 100%; max-width: 420px; font: inherit; font-size: 1rem; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); margin-bottom: 18px; }

/* Bands */
.band { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band-teal { background: var(--teal); color: #fff; }
.band-teal h2, .band-teal p, .band-teal .eyebrow { color: #fff; }
:root[data-theme="dark"] .band-teal { background: #0f3b42; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band-teal { background: #0f3b42; } }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 44px 0 56px; font-family: var(--sans); font-size: .88rem; color: var(--ink-3); }
.foot-grid { display: grid; gap: 24px; }
@media (min-width: 800px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-foot h4 { font-family: var(--sans); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 6px 0; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.cite { font-family: var(--sans); font-size: .82rem; color: var(--ink-3); border-top: 1px dashed var(--rule); margin-top: 48px; padding-top: 14px; }

.reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* Shop */
.products { display: grid; gap: 22px; }
@media (min-width: 980px) { .products { grid-template-columns: repeat(3, 1fr); } }
.product { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.product-img { display: block; background: var(--paper-2); padding: 26px 26px 0; border-bottom: 1px solid var(--rule); }
.product-img img { max-height: 300px; width: auto; margin: 0 auto; border-radius: 4px 4px 0 0; box-shadow: 0 -2px 18px rgba(19,95,107,.18); }
.product-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.product h3 { margin: 10px 0 2px; font-size: 1.45rem; }
.product-ed { font-style: italic; color: var(--accent); margin: 0 0 6px; }
.product-meta { font-family: var(--sans); font-size: .8rem; color: var(--ink-3); margin: 0 0 12px; }
.ticks { list-style: none; padding: 0; margin: 0 0 14px; }
.ticks li { position: relative; padding-left: 24px; margin: 6px 0; font-size: 1rem; color: var(--ink-2); line-height: 1.4; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--teal); font-family: var(--sans); font-weight: 700; }
.product-buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--rule); }
.price { font-family: var(--sans); font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.price-ask { font-size: .9rem; font-weight: 600; color: var(--ink-3); }
.trust { display: grid; gap: 14px; }
@media (min-width: 720px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust div { font-family: var(--sans); font-size: .88rem; color: var(--ink-2); }
.trust b { display: block; font-size: .95rem; color: var(--ink); margin-bottom: 2px; }
.faq details { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.12rem; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }
.dl { display: flex; gap: 16px; align-items: center; }
.dl img { width: 96px; border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow); flex: none; }
.foot-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); }
.foot-legal a { color: var(--ink-3); }
.legal h2 { font-size: 1.4rem; margin-top: 1.8em; }

.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.head-shop { display: none; font-family: var(--sans); font-weight: 600; font-size: .86rem; background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: 8px 16px; border-radius: 999px; }
@media (max-width: 899px) { .head-shop { display: inline-block; } .nav a.nav-shop { display: none; } }

/* Languages */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.langbar { background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: .8rem; }
.langbar .wrap { display: flex; justify-content: flex-end; gap: 4px; padding-top: 5px; padding-bottom: 5px; }
.langbar a { color: color-mix(in srgb, var(--paper) 75%, transparent); text-decoration: none; padding: 2px 10px; border-radius: 999px; }
.langbar a[lang="bn"] { font-family: var(--beng); }
.langbar a[lang="hi"] { font-family: "Noto Serif Devanagari", var(--deva); }
.langbar a:hover { color: var(--paper); }
.langbar a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
html:lang(bn) body, html:lang(bn) h1, html:lang(bn) h2, html:lang(bn) h3 { font-family: "Noto Serif Bengali", var(--serif); }
html:lang(hi) body, html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3 { font-family: "Noto Serif Devanagari", var(--serif); }
html:lang(bn) body, html:lang(hi) body { font-size: 1.06rem; line-height: 1.8; }
html:lang(bn) h1, html:lang(hi) h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.3; font-weight: 600; }
html:lang(bn) h2, html:lang(hi) h2 { line-height: 1.35; font-weight: 600; }
html:lang(bn) h3, html:lang(hi) h3 { line-height: 1.4; }
html:lang(bn) .lede, html:lang(hi) .lede { font-size: clamp(1.08rem, 2vw, 1.25rem); }
html:lang(bn) .eyebrow, html:lang(hi) .eyebrow { letter-spacing: .04em; font-size: .85rem; }
html:lang(bn) .eyebrow { font-family: "Hind Siliguri", var(--sans); }
html:lang(hi) .eyebrow { font-family: "Hind", var(--sans); }
html:lang(bn) .btn, html:lang(bn) .nav, html:lang(bn) .tag { font-family: "Hind Siliguri", var(--sans); }
html:lang(hi) .btn, html:lang(hi) .nav, html:lang(hi) .tag { font-family: "Hind", var(--sans); }
html:lang(bn) [lang="en"], html:lang(hi) [lang="en"] { font-family: var(--serif); }

/* Videos */
.reels { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
@media (min-width: 720px) { .reels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .reels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.reel { margin: 0; }
.reel video, .vid video { width: 100%; height: auto; border-radius: 12px; background: #0f3b42; display: block; box-shadow: var(--shadow); }
.reel figcaption { font-family: var(--sans); font-size: .82rem; color: var(--ink-2); margin-top: 8px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; line-height: 1.4; }
.reel .r-n { font-weight: 700; color: var(--accent); grid-row: span 2; }
.reel .r-u { grid-column: 2; color: var(--ink-3); font-size: .74rem; }
.reel s { color: var(--ink-3); }
.r-x { color: var(--bad); } .r-ok { color: var(--ok); }
.vids { display: grid; gap: 24px; }
@media (min-width: 800px) { .vids { grid-template-columns: 1fr 1fr; } }
.vid { margin: 0; }
.vid video { max-height: 640px; width: auto; max-width: 100%; margin: 0 auto; }
.vid figcaption { margin-top: 10px; }
.vid h3 { margin: 0 0 4px; }
.vid p { margin: 0; color: var(--ink-2); font-size: 1rem; }
.film video { width: 100%; max-height: none; }

/* Compact players (v2) */
.vid video, .hero-vid video { width: 100%; max-width: 340px; max-height: 70vh; margin: 0 auto; }
.film video { max-width: 100%; max-height: none; }
.hero-vid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .hero-vid { grid-template-columns: 360px 1fr; } }
.hero-vid video { border-radius: 16px; box-shadow: var(--shadow); background: #0f3b42; display: block; }
.vids3 { display: grid; gap: 28px; }
@media (min-width: 720px) { .vids3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vids3 .vid figcaption { max-width: 340px; margin-left: auto; margin-right: auto; }
.film video { max-width: 760px; }
.film figcaption { max-width: 760px; margin-left: auto; margin-right: auto; }
.vid video, .hero-vid video { height: auto; aspect-ratio: 9 / 16; object-fit: contain; }
.film video { aspect-ratio: 16 / 9; }

/* Adaptive explainer player */
.player { margin: 0 auto; }
.player video { display: block; margin: 0 auto; border-radius: 16px; background: #0b4650; box-shadow: var(--shadow); height: auto; max-width: 100%; }
.player.wide video { aspect-ratio: 16 / 9; width: min(100%, calc((100vh - 170px) * 16 / 9)); }
.player.tall video { aspect-ratio: 9 / 16; width: min(100%, 420px, calc((100vh - 150px) * 9 / 16)); }
.player-meta { font-family: var(--sans); font-size: .85rem; color: var(--ink-3); text-align: center; margin: 12px 0 0; }
.chapters { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
@media (min-width: 760px) { .chapters { grid-template-columns: 1fr 1fr; column-gap: 28px; } }
.chapters button { all: unset; cursor: pointer; display: grid; grid-template-columns: 3.2em 1fr; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; box-sizing: border-box; }
.chapters button:hover, .chapters button:focus-visible { background: var(--paper-2); }
.chapters time { font-family: var(--sans); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.chapters b { display: block; color: var(--ink); }
.chapters span { color: var(--ink-3); font-size: .95rem; }
/* default (before JS): widescreen sizing */
.player:not(.tall) video { aspect-ratio: 16 / 9; width: min(100%, calc((100vh - 170px) * 16 / 9)); }
.crux h2 { text-align: center; }
.crux blockquote { margin-top: 1.6em; }

/* GEO: answer box + byline */
.answer { margin: 28px 0 0; background: var(--card); border: 1px solid var(--rule); border-left: 5px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; box-shadow: var(--shadow); max-width: 820px; }
.answer p { margin: 0; color: var(--ink); font-size: 1.12rem; line-height: 1.65; }
.answer .answer-lbl { font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.byline { font-family: var(--sans); font-size: .85rem; color: var(--ink-3); margin: -4px 0 14px; }
.byline a { color: var(--ink-2); }

/* Error pages: practice worksheet */
.practice-list { margin: 0 0 16px; padding-left: 1.4em; }
.practice-list li { margin: 0 0 12px; font-size: 1.15rem; }
.practice-list .blank { display: inline-block; min-width: 4.5em; border-bottom: 2px solid var(--ink-3); color: transparent; }
.practice-list details { margin-top: 4px; font-family: var(--sans); font-size: .88rem; }
.practice-list summary { cursor: pointer; color: var(--teal); }
.practice-list details p { margin: 4px 0 0; color: var(--ink-2); }

/* Print: a clean worksheet */
@media print {
  .langbar, .site-head, .site-foot, .hero-cta, .answer, .band, [data-print], .crumbs, .cite, .byline + .lede ~ * .card { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page-head { padding: 0 0 8pt; border: 0; }
  section { padding: 10pt 0; }
  .tool, .card, .table-wrap { box-shadow: none !important; border: 1px solid #999 !important; }
  .practice-list details { display: none; }
  .practice-list .blank { border-bottom-color: #000; }
  a { color: #000; text-decoration: none; }
  .grid-2 { grid-template-columns: 1fr 1fr !important; }
}

/* ───────── Cart ───────── */
.cart-btn { position: relative; flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.cart-btn:hover { background: var(--paper-2); }
.cart-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 .7rem/19px var(--sans); text-align: center; }
html.cart-open { overflow: hidden; }
dialog.cart { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(440px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--rule); background: var(--card); color: var(--ink); font-family: var(--sans); box-shadow: -12px 0 40px rgba(0,0,0,.18); display: none; flex-direction: column; }
dialog.cart[open] { display: flex; animation: cart-in .22s ease-out; }
dialog.cart::backdrop { background: rgba(20,14,8,.45); }
@keyframes cart-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.cart[open] { animation: none; } }
.cart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--rule); }
.cart-head h2 { margin: 0; font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; }
.cart-step { margin: 0 0 2px; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); min-height: 1em; }
.cart-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.cart-empty { display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; color: var(--ink-2); }
.cart-flash { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); font-weight: 600; font-size: .88rem; }
.cart-lines, .cart-ups, .cart-mini ul, .cart-how { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cart-line img { width: 56px; height: auto; border: 1px solid var(--rule); border-radius: 3px; }
.cart-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-name { color: var(--ink); font-weight: 600; text-decoration: none; font-size: .95rem; }
.cart-ed { font-size: .84rem; color: var(--ink-2); }
.cart-fmt { font-size: .76rem; color: var(--ink-3); }
.cart-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 999px; }
.qty button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink); font-size: 1.1rem; cursor: pointer; border-radius: 50%; }
.qty button:disabled { opacity: .35; cursor: default; }
.qty output { min-width: 22px; text-align: center; font-weight: 600; font-size: .9rem; }
.cart-rm, .cart-link { border: 0; background: none; color: var(--ink-3); text-decoration: underline; font: inherit; font-size: .82rem; cursor: pointer; padding: 4px 0; }
.cart-price { font-weight: 700; font-size: .95rem; white-space: nowrap; }
.cart-sub { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.cart-up { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px dashed var(--rule); border-radius: 10px; font-size: .86rem; }
.cart-up img { width: 40px; height: auto; border-radius: 2px; }
.cart-up small { color: var(--ink-3); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.cart-school { margin: 18px 0 0; font-size: .84rem; color: var(--ink-3); }
.cart-foot { border-top: 1px solid var(--rule); padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--card); display: grid; gap: 8px; }
.cart-sum { margin: 0 0 6px; display: grid; gap: 4px; font-size: .9rem; }
.cart-sum div { display: flex; justify-content: space-between; gap: 12px; }
.cart-sum dt { color: var(--ink-2); }
.cart-sum dd { margin: 0; text-align: right; }
.cart-total { font-weight: 700; font-size: 1.05rem; padding-top: 6px; border-top: 1px dashed var(--rule); margin-top: 2px; }
.cart-total dt { color: var(--ink); }
.cart-go { justify-content: center; width: 100%; font-size: 1rem; padding: 14px 20px; }
.cart-foot .cart-link { justify-self: center; }
.cart-form { display: grid; gap: 12px; align-content: start; }
.cart-field { display: grid; gap: 4px; font-size: .84rem; color: var(--ink-2); }
.cart-field input { font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 11px 12px; width: 100%; box-sizing: border-box; }
.cart-field input:focus, .cart-agree input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.cart-field input[aria-invalid] { border-color: var(--bad); }
.cart-agree { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--ink-2); }
.cart-agree input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.cart-agree input[aria-invalid] { outline: 2px solid var(--bad); }
.cart-err { margin: 0; min-height: 1.2em; color: var(--bad); font-size: .86rem; font-weight: 600; }
.cart-err:empty { min-height: 0; }
.cart-mini { background: var(--paper); border-radius: 10px; padding: 2px 14px 10px; }
.cart-mini .cart-sub { margin-top: 10px; }
.cart-mini li { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; padding: 3px 0; }
.cart-oid { margin: 0 0 14px; font-size: .95rem; color: var(--ink-2); }
.cart-oid b { color: var(--ink); font-family: ui-monospace, monospace; letter-spacing: .03em; }
.cart-how { counter-reset: s; display: grid; gap: 10px; margin-bottom: 16px; }
.cart-how li { counter-increment: s; position: relative; padding-left: 36px; font-size: .92rem; line-height: 1.45; }
.cart-how li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.cart-send { display: grid; gap: 8px; }
.cart-send .btn { justify-content: center; }
.cart-note { font-size: .8rem; color: var(--ink-3); margin: 12px 0; }
.cart-pre { white-space: pre-wrap; word-break: break-word; font: .8rem/1.5 ui-monospace, monospace; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 12px; color: var(--ink-2); margin: 0; }
:lang(bn) dialog.cart .cart-head h2 { font-family: var(--beng); }
:lang(hi) dialog.cart .cart-head h2 { font-family: "Noto Serif Devanagari", var(--deva); }
@media (max-width: 480px) { dialog.cart { width: 100vw; border-left: 0; } }
@media print { dialog.cart, .cart-btn { display: none !important; } }

/* ───────── Consent bar (GA4 Consent Mode) ───────── */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--card); border-top: 1px solid var(--rule); box-shadow: 0 -8px 24px rgba(0,0,0,.08); font-family: var(--sans); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.consent[hidden] { display: none; }
.consent-row { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; justify-content: space-between; }
.consent p { margin: 0; font-size: .86rem; color: var(--ink-2); flex: 1 1 320px; line-height: 1.45; }
.consent-btns { display: flex; gap: 8px; flex: none; }
html.has-consent-bar body { padding-bottom: 96px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--ink-3); text-decoration: underline; cursor: pointer; }
@media print { .consent { display: none !important; } }
