/* =========================================================
   Dr. Bhimnath Jha — site styles
   Theme: deep maroon ground, white type, restrained gold
   accents drawn from Mithila painting.
   ========================================================= */

:root {
  --bg:        #3e070d;   /* deep maroon */
  --bg-deep:   #2c0408;   /* alternate sections */
  --bg-deeper: #1f0306;   /* footer */
  --bg-raise:  #540c14;   /* cards */
  --bg-raise-2:#65111a;

  --ink:       #ffffff;
  --ink-soft:  rgba(255,255,255,.82);
  --muted:     rgba(255,255,255,.60);
  --line:      rgba(255,255,255,.16);
  --line-strong: rgba(255,255,255,.28);

  --gold:      #d9a84e;
  --gold-soft: #ecc98a;
  --gold-deep: #b9862c;

  --serif: "EB Garamond", "Noto Serif Devanagari", Georgia, "Times New Roman", serif;
  --deva:  "Noto Serif Devanagari", "EB Garamond", serif;
  --tirh:  "Noto Sans Tirhuta", "Noto Serif Devanagari", serif;

  --wrap: 1140px;
  --narrow: 780px;
  --radius: 6px;
  --shadow: 0 24px 48px -24px rgba(0,0,0,.55);

  /* Kachni-style border band: sawtooth between double rules */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14'%3E%3Cpath d='M0 .75h24M0 13.25h24' stroke='%23d9a84e' stroke-width='1.2'/%3E%3Cpath d='M0 11.5L6 3l6 8.5z' fill='%23d9a84e'/%3E%3Cpath d='M12 11.5L18 3l6 8.5' fill='none' stroke='%23ffffff' stroke-opacity='.7' stroke-width='1'/%3E%3Ccircle cx='18' cy='8.6' r='1.2' fill='%23ffffff'/%3E%3C/svg%3E");

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 85% -10%, rgba(178,24,36,.38), transparent 62%),
    radial-gradient(900px 700px at -10% 40%, rgba(120,10,22,.45), transparent 62%),
    radial-gradient(800px 500px at 50% 110%, rgba(217,168,78,.06), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--bg-deeper); }

/* ---------- language toggle ---------- */
html[data-lang="en"]  [data-l="mai"],
html[data-lang="mai"] [data-l="en"] { display: none !important; }

:lang(mai) { font-family: var(--deva); }
p:lang(mai), :lang(mai) p { line-height: 1.9; }
html[data-lang="mai"] body { font-size: 1.0625rem; }

.tirh { font-family: var(--tirh); font-weight: 400; letter-spacing: .02em; }

/* ---------- basics ---------- */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-soft); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
cite { font-style: italic; }
cite:lang(mai), :lang(mai) cite { font-style: normal; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.2; margin: 0; color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: var(--narrow); }
.center { text-align: center; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--bg-deeper); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

.band { height: 14px; background: var(--band) repeat-x center / 24px 14px; opacity: .9; }

/* Placeholders the family still needs to fill in */
.todo {
  color: var(--gold-soft);
  font-style: italic;
  background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(217,168,78,.10) 6px 12px);
  border-bottom: 1px dashed var(--gold);
  padding: 0 .2em;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(31,3,6,.88);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: 0 8px 24px -12px rgba(0,0,0,.6); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 70px; }

.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.15; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-tirh { color: var(--gold); font-size: .95rem; }
.brand-name { font-size: 1.2rem; font-weight: 500; letter-spacing: .01em; }

.site-nav { display: flex; gap: 2px; flex-wrap: wrap; order: 2; }
.site-nav a {
  position: relative; color: var(--ink-soft); text-decoration: none;
  padding: 8px 11px; font-size: 1rem;
}
.site-nav a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }

.header-tools { display: flex; align-items: center; gap: 10px; order: 3; }

.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.lang-switch button {
  font: inherit; font-size: .88rem; line-height: 1;
  border: 0; background: transparent; color: var(--ink-soft);
  padding: 8px 13px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[lang="mai"] { font-family: var(--deva); font-size: .84rem; }
.lang-switch button[aria-pressed="true"] { background: var(--gold); color: var(--bg-deeper); font-weight: 600; }

.menu-btn { display: none; }

@media (max-width: 960px) {
  .header-row { flex-wrap: wrap; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: transparent; cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform .2s, background .2s; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; } .bars::after { top: 6px; }
  .menu-btn[aria-expanded="true"] .bars { background: transparent; }
  .menu-btn[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .bars::after  { transform: translateY(-6px) rotate(-45deg); }
  .js .site-nav { display: none; }
  .site-nav { order: 4; width: 100%; flex-direction: column; padding: 4px 0 14px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 4px; border-top: 1px solid var(--line); }
  .site-nav a::after { display: none; }
}

/* ---------- hero ---------- */
.hero { padding: 84px 0 96px; position: relative; overflow: hidden; }
.hero::after {               /* faint large Tirhuta watermark */
  content: "𑒦𑒲"; font-family: var(--tirh);
  position: absolute; right: -2%; bottom: -18%; font-size: min(42vw, 520px); line-height: 1;
  color: rgba(255,255,255,.035); pointer-events: none; z-index: 0;
}
.hero-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 64px; align-items: center; position: relative; z-index: 1; }

.hero-tirh { color: var(--gold); font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 8px; line-height: 1.3; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: -.012em; font-weight: 500; }
.hero h1 [lang="mai"] { font-weight: 600; letter-spacing: 0; }
.hero-alt { margin: 8px 0 0; color: var(--ink-soft); font-size: 1.3rem; }
.roles {
  margin: 22px 0 0; color: var(--gold); text-transform: uppercase;
  letter-spacing: .22em; font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; gap: 14px;
}
.roles::before { content: ""; width: 36px; height: 1px; background: var(--gold); }
.roles [lang="mai"] { text-transform: none; letter-spacing: .04em; font-size: 1rem; }
.lede { font-size: 1.32rem; margin: 22px 0 0; max-width: 33em; color: var(--ink-soft); }
html[data-lang="mai"] .lede { font-size: 1.15rem; }
.lede cite { color: var(--ink); }

.facts {
  display: grid; grid-template-columns: repeat(3, auto); gap: 12px 36px;
  margin: 32px 0 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  justify-content: start;
}
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.facts dt [lang="mai"] { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.facts dd { margin: 3px 0 0; font-size: 1.05rem; }

.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1rem; font-weight: 500;
  padding: 12px 22px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); color: var(--ink); background: transparent;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); background: rgba(255,255,255,.06); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--bg-deeper); }
.btn-primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--bg-deeper); transform: translateY(-1px); }
.btn.is-disabled { cursor: default; }
.btn.todo { color: var(--bg-deeper); border-bottom-style: solid; }

/* Arched portrait frame */
.portrait { margin: 0; justify-self: center; width: 100%; max-width: 390px; }
.portrait-frame {
  position: relative; aspect-ratio: 4 / 5;
  border-radius: 999px 999px 8px 8px / 46% 46% 8px 8px;
  padding: 12px; background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep));
  box-shadow: var(--shadow);
}
.portrait-frame::before {
  content: ""; position: absolute; inset: 6px;
  border-radius: inherit; border: 1px solid rgba(31,3,6,.55); pointer-events: none;
}
.portrait-frame > img,
.portrait-placeholder {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  border-radius: 999px 999px 4px 4px / 44% 44% 4px 4px;
}
.portrait-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(circle at 50% 36%, rgba(217,168,78,.22), transparent 58%), var(--bg-deep);
  color: var(--gold);
}
.portrait-placeholder .tirh { font-size: 6.5rem; line-height: 1; }
.portrait-placeholder small { color: var(--muted); font-size: .95rem; font-style: italic; }

@media (max-width: 880px) {
  .hero { padding: 40px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .portrait { order: -1; max-width: 270px; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .wrap { padding: 0 16px; }
  .facts { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.4rem; }
}

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-deep); }
.section-alt::before, .section-alt::after {
  content: ""; display: block; height: 14px; background: var(--band) repeat-x center / 24px 14px; opacity: .55;
}
.section-alt::before { margin: -96px 0 82px; }
.section-alt::after  { margin: 82px 0 -96px; }

.section-head { text-align: center; margin-bottom: 48px; }
.kicker { color: var(--gold); font-size: 1.15rem; margin: 0 0 6px; }
.section-head h2 { font-size: clamp(2rem, 3.8vw, 2.8rem); }
.divider { display: block; width: 64px; height: 36px; margin: 16px auto 0; color: var(--ink); }

.prose p { margin: 0 0 1.15em; color: var(--ink-soft); }
.prose cite, .prose em { color: var(--ink); }
.prose .drop { color: var(--ink); }
.prose .drop::first-letter {
  float: left; font-size: 3.6em; line-height: .88; padding: .06em .12em 0 0; color: var(--gold); font-weight: 500;
}
.prose:lang(mai) .drop::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; }

.verse {
  margin: 52px 0 0; padding: 34px 36px; text-align: center;
  background: var(--bg-raise); border-radius: var(--radius); position: relative;
}
.verse::before, .verse::after {
  content: ""; position: absolute; left: 18px; right: 18px; height: 14px;
  background: var(--band) repeat-x center / 24px 14px;
}
.verse::before { top: -7px; } .verse::after { bottom: -7px; }
.verse p { font-size: 1.4rem; margin: 0; }
.verse footer { margin-top: 12px; color: var(--muted); font-size: .95rem; }

.note { color: var(--ink-soft); margin-top: 40px; font-size: 1.05rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 100px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--gold), rgba(217,168,78,.15));
}
.timeline li { display: grid; grid-template-columns: 82px 1fr; gap: 0 46px; padding: 12px 0 20px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 94px; top: 19px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--bg-deep); border: 2px solid var(--gold);
}
.timeline li.highlight::before { background: var(--gold); box-shadow: 0 0 0 5px rgba(217,168,78,.18); }
.timeline .year { text-align: right; font-weight: 600; color: var(--gold); font-size: 1.15rem; padding-top: 2px; }
.timeline p { margin: 0; color: var(--ink-soft); }
.timeline li.highlight p { color: var(--ink); font-weight: 500; }

@media (max-width: 580px) {
  .timeline::before { left: 6px; }
  .timeline li { grid-template-columns: 1fr; padding-left: 34px; }
  .timeline li::before { left: 0; }
  .timeline .year { text-align: left; }
}

/* ---------- works ---------- */
.group-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .2em; color: var(--gold);
  margin: 56px 0 18px; display: flex; align-items: center; gap: 16px; font-weight: 600;
}
.group-title:first-of-type { margin-top: 0; }
.group-title [lang="mai"] { text-transform: none; letter-spacing: .02em; font-size: 1.05rem; font-weight: 500; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.book {
  background: var(--bg-raise); border-radius: var(--radius);
  padding: 26px 24px 22px; display: flex; flex-direction: column;
  border: 1px solid transparent; position: relative;
  transition: transform .2s, border-color .2s, background .2s;
}
.book::before {
  content: ""; position: absolute; left: 24px; top: 0; width: 34px; height: 3px; background: var(--gold);
}
.book:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--bg-raise-2); }
.book h4 { font-family: var(--deva); font-size: 1.5rem; font-weight: 600; }
.book .translit { margin: 2px 0 0; font-style: italic; color: var(--muted); }
.book .desc { margin: 14px 0 0; font-size: 1rem; color: var(--ink-soft); }
.book .meta { margin: auto 0 0; padding-top: 14px; font-size: .9rem; color: var(--muted); }
.book .desc + .meta { margin-top: 10px; }
.book .link { margin: 14px 0 0; font-size: .95rem; }
.book-award { background: linear-gradient(170deg, rgba(217,168,78,.20), transparent 55%), var(--bg-raise); border-color: rgba(217,168,78,.35); }
.badge {
  align-self: flex-start; margin: 0 0 12px; font-size: .74rem; letter-spacing: .06em;
  background: var(--gold); color: var(--bg-deeper); padding: 3px 11px; border-radius: 999px; font-weight: 600;
}

/* ---------- stats band ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 64px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats > div { padding: 26px 16px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: clamp(2.2rem, 4vw, 3rem); color: var(--gold); line-height: 1; font-weight: 500; font-variant-numeric: lining-nums; }
.stats dd { margin: 10px 0 0; color: var(--ink-soft); font-size: .98rem; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- bibliography ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; }
.filters button {
  font: inherit; font-size: .95rem; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 16px;
  transition: background .15s, color .15s, border-color .15s;
}
.filters button small { font-size: .78rem; color: var(--muted); margin-left: 4px; font-variant-numeric: lining-nums; }
.filters button:hover { color: var(--ink); border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--bg-deeper); }
.filters button[aria-pressed="true"] small { color: var(--bg-deep); }

.biblio { columns: 2; column-gap: 26px; }
.bib-group {
  background: var(--bg-raise); border-radius: var(--radius); padding: 26px 28px 18px;
  border-top: 3px solid var(--gold); break-inside: avoid; margin: 0 0 26px; display: block;
}
.bib-group[hidden] { display: none; }
.biblio.single { columns: 1; }
.biblio.single .bib { columns: 2; column-gap: 40px; }
.bib-group h4 { font-size: 1.3rem; margin-bottom: 10px; }
.bib-group h4 [lang="mai"] { font-size: 1.15rem; }
.bib { list-style: none; margin: 0; padding: 0; }
.bib li {
  display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: baseline;
  padding: 11px 0; border-top: 1px solid var(--line); break-inside: avoid;
}
.bib li:first-child { border-top: 0; }
.bib .by { color: var(--gold); font-weight: 600; font-size: .98rem; font-variant-numeric: lining-nums tabular-nums; }
.bib .bt { display: block; font-family: var(--deva); font-size: 1.12rem; color: var(--ink); line-height: 1.5; }
.bib .tr { display: block; font-style: italic; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.bib .bn { display: block; color: var(--ink-soft); font-size: .9rem; margin-top: 2px; line-height: 1.45; }
.bib li.star .bt::after { content: " ★"; color: var(--gold); font-size: .85em; }
.source-note { margin: 26px 0 0; color: var(--muted); font-size: .92rem; font-style: italic; text-align: center; }
.source-note [lang="mai"] { font-style: normal; }
@media (max-width: 860px) {
  .biblio { columns: 1; }
  .biblio.single .bib { columns: 1; }
  .bib-group { padding: 22px 18px 14px; }
}

/* ---------- honours ---------- */
.honours-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: start; }
.honours-layout .group-title { margin-top: 0; }
.honours { list-style: none; margin: 0; padding: 0; }
.honours li { display: grid; grid-template-columns: 74px 1fr; gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.honours li:last-child { border-bottom: 0; }
.h-year { font-size: 1.3rem; color: var(--gold); font-weight: 600; text-align: right; line-height: 1.3; font-variant-numeric: lining-nums; }
.honours h4 { font-size: 1.3rem; }
.honours p { margin: 4px 0 0; color: var(--ink-soft); font-size: 1.02rem; }
.honour-main h4 { font-size: 1.6rem; }
.honour-main .h-year { font-size: 1.9rem; line-height: 1.1; }

.service { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.service li { background: var(--bg-raise); border-radius: var(--radius); padding: 18px 22px; border-left: 3px solid var(--gold); }
.s-when { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 600; font-variant-numeric: lining-nums; }
.s-when [lang="mai"] { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.service h4 { font-size: 1.2rem; margin-top: 4px; }
.service p { margin: 4px 0 0; color: var(--ink-soft); font-size: 1rem; }

.tribute { margin: 72px auto 0; max-width: 820px; text-align: center; }
.tribute blockquote { margin: 0; position: relative; padding-top: 34px; }
.tribute blockquote::before {
  content: "“"; position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font-size: 5rem; line-height: 1; color: var(--gold); opacity: .8;
}
.tribute blockquote p { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.45; color: var(--ink); font-style: italic; }
.tribute .tribute-orig { font-family: var(--deva); font-style: normal; font-size: 1.12rem; color: var(--ink-soft); margin-top: 14px; }
html[data-lang="mai"] .tribute .tribute-orig { font-size: clamp(1.25rem, 2.4vw, 1.6rem); color: var(--ink); margin-top: 0; }
.tribute figcaption { margin-top: 18px; color: var(--muted); font-size: .95rem; }
.tribute figcaption::before { content: "— "; }

@media (max-width: 900px) { .honours-layout { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 480px) {
  .honours li { grid-template-columns: 1fr; gap: 4px; }
  .h-year { text-align: left; }
}

/* ---------- letters ---------- */
.section-intro { max-width: 640px; margin: 22px auto 0; color: var(--ink-soft); }
.letters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.letter {
  background: var(--bg-raise); border-radius: var(--radius);
  padding: 40px 40px 32px; position: relative; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.letter::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(217,168,78,.35); border-radius: 3px; pointer-events: none;
}
.letter-year { margin: 0; text-align: center; color: var(--gold); font-size: .85rem; letter-spacing: .2em; font-weight: 600; }
.letter-title { font-family: var(--deva); font-size: 1.45rem; text-align: center; color: var(--ink); margin: 6px 0 18px; line-height: 1.4; }
.letter .prose p { margin-bottom: .6em; }
.letter-meta { margin: auto 0 0; padding-top: 14px; text-align: center; color: var(--muted); font-size: .92rem; font-style: italic; }
.letter-meta [lang="mai"] { font-style: normal; }
@media (max-width: 760px) { .letters-grid { grid-template-columns: 1fr; } }
@media (max-width: 580px) { .letter { padding: 32px 24px 26px; } }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 820px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
.gallery figure { margin: 0; }
.gallery img, .ph-img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: var(--radius); }
.gallery img { box-shadow: var(--shadow); }
.ph-img { display: flex; align-items: center; justify-content: center; background: var(--bg-raise); border: 1px dashed var(--line-strong); }
.ph-img svg { width: 64px; height: 36px; color: var(--ink); opacity: .45; }
.gallery figcaption { font-size: .95rem; color: var(--ink-soft); margin-top: 10px; text-align: center; }

/* ---------- links ---------- */
.links { list-style: none; margin: 0; padding: 0; }
.links li { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.links li:last-child { border-bottom: 0; }
.links a, .link-label { font-size: 1.22rem; font-weight: 500; }
.links a { color: var(--ink); text-decoration: none; }
.links a:hover { color: var(--gold-soft); }
.links li > span:last-child { color: var(--muted); font-size: 1rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-deeper); color: var(--ink-soft); }
.site-footer .band { opacity: .6; }
.footer-inner { text-align: center; padding: 48px 24px 56px; }
.site-footer .divider { margin-top: 0; }
.footer-tirh { color: var(--gold); font-size: 1.7rem; margin: 12px 0 8px; }
.site-footer p { margin: 4px 0; }
.site-footer .small { font-size: .88rem; color: var(--muted); }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--bg-deeper); text-decoration: none; font-size: 1.2rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--bg-deeper); background: var(--gold-soft); }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .book, .btn, .to-top { transition: none; }
}

/* ---------- print ---------- */
@media print {
  :root { --ink: #000; --ink-soft: #222; --muted: #555; --gold: #7a2533; }
  .site-header, .cta, .lang-switch, .gallery, #contact, .to-top, .band, .hero::after { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .section, .section-alt { padding: 24px 0; background: #fff; }
  .section-alt::before, .section-alt::after { display: none; }
  .book, .letter, .verse { background: #fff; border: 1px solid #ccc; box-shadow: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Additions: verse, quotes, scholars, gallery, lightbox
   ========================================================= */

/* his own verse in the About section */
.verse .verse-text { font-family: var(--deva); font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.9; font-style: normal; color: var(--ink); }
.verse .verse-tr { margin-top: 16px; font-size: 1.08rem; font-style: italic; color: var(--ink-soft); line-height: 1.7; }

/* tributes */
#tributes .tribute { margin-top: 0; }
.tribute blockquote p[lang="hi"] { font-family: var(--deva); font-style: normal; }
.quotes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 64px; }
.quote { margin: 0; background: var(--bg-raise); border-radius: var(--radius); padding: 28px 30px 24px; position: relative; display: flex; flex-direction: column; }
.quote::before { content: "“"; position: absolute; top: 6px; left: 18px; font-size: 3.4rem; line-height: 1; color: var(--gold); opacity: .55; }
.quote blockquote { margin: 0; padding-top: 18px; flex: 1; }
.quote blockquote p { margin: 0; font-size: 1.12rem; line-height: 1.65; color: var(--ink); font-style: italic; }
.quote blockquote p:lang(mai), .quote blockquote p:lang(hi) { font-family: var(--deva); font-style: normal; font-size: 1.05rem; }
.quote .q-orig { margin-top: 12px !important; color: var(--ink-soft) !important; font-size: .98rem !important; }
html[data-lang="mai"] .quote .q-orig { margin-top: 0 !important; color: var(--ink) !important; font-size: 1.05rem !important; }
.quote .q-verse { line-height: 1.95 !important; }
.quote .q-gloss { margin-top: 12px !important; font-size: .98rem !important; color: var(--ink-soft) !important; }
.quote figcaption { margin-top: 16px; color: var(--gold); font-size: .92rem; }
.quote figcaption::before { content: "— "; }
.quote-verse { grid-column: 1 / -1; text-align: center; }
.quote-verse::before { left: 50%; transform: translateX(-50%); }
@media (max-width: 760px) { .quotes { grid-template-columns: 1fr; } .quote-verse { text-align: left; } .quote-verse::before { left: 18px; transform: none; } }

/* doctoral scholars list */
.scholars { margin-top: 10px; }
.scholars summary { cursor: pointer; color: var(--gold-soft); font-size: .95rem; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.scholars summary::-webkit-details-marker { display: none; }
.scholars summary::after { content: "▾"; font-size: .8em; transition: transform .2s; }
.scholars[open] summary::after { transform: rotate(180deg); }
.scholars ol { margin: 10px 0 0; padding-left: 1.4em; columns: 2; column-gap: 24px; font-size: .95rem; color: var(--ink-soft); }
.scholars li { break-inside: avoid; padding: 2px 0; }
.scholars li span { color: var(--muted); font-size: .85em; margin-left: 4px; font-variant-numeric: lining-nums; }
.scholars-note { margin: 8px 0 0 !important; font-size: .82rem !important; color: var(--muted) !important; font-style: italic; }
@media (max-width: 480px) { .scholars ol { columns: 1; } }

/* gallery */
.gfilters { justify-content: center; }
.g-item { margin: 0; }
.g-item[hidden] { display: none; }
.g-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.g-open img { aspect-ratio: 4 / 3; width: 100%; height: auto; object-fit: cover; border-radius: 0; box-shadow: none; transition: transform .4s ease, filter .3s; }
.g-item.tall .g-open img { object-position: 50% 22%; }
.g-open:hover img, .g-open:focus-visible img { transform: scale(1.04); filter: brightness(1.06); }
.g-open::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(217,168,78,.0); border-radius: var(--radius); transition: border-color .2s; pointer-events: none; }
.g-open:hover::after { border-color: rgba(217,168,78,.6); }
.gallery figcaption { font-size: .92rem; line-height: 1.45; padding: 0 6px; }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; color: var(--ink); }
.lightbox::backdrop { background: rgba(20,2,4,.92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: min(92vw, 1200px); text-align: center; }
.lightbox img { max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 4px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }
.lightbox figcaption { margin-top: 14px; color: var(--ink-soft); font-size: 1rem; }
.lb-close, .lb-prev, .lb-next {
  position: fixed; border: 0; cursor: pointer; color: var(--ink); background: rgba(255,255,255,.08);
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.8rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--gold); color: var(--bg-deeper); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; } }
@media print { .lightbox, .gfilters { display: none !important; } }
.quotes .quote:first-child { grid-column: 1 / -1; }
.g-item.tall .g-open img { object-position: 50% 8%; }

/* contact card */
.contact-intro { color: var(--ink-soft); max-width: 560px; margin: 0 auto; }
.contact-card {
  margin: 30px auto 0; max-width: 560px; padding: 30px 28px 32px;
  background: var(--bg-raise); border-radius: var(--radius); border-top: 3px solid var(--gold); box-shadow: var(--shadow);
}
.contact-name { margin: 0; font-size: 1.5rem; color: var(--ink); }
.contact-role { margin: 2px 0 0; color: var(--gold); font-size: .95rem; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.contact-actions .btn { font-variant-numeric: lining-nums; }
@media (max-width: 480px) { .contact-actions .btn { width: 100%; justify-content: center; } }
.contact-address { font-style: normal; margin: 18px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-soft); line-height: 1.6; }
.ca-label { display: block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.ca-label [lang="mai"] { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 900px; margin: 30px auto 0; align-items: stretch; }
.contact-grid .contact-card { margin: 0; max-width: none; display: flex; flex-direction: column; }
.contact-grid .contact-actions { margin-top: auto; padding-top: 22px; }
.contact-grid .contact-address { border-top: 0; padding-top: 0; margin-top: 14px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
