:root {
  --bg: #f7f1e6;
  --paper: #fffdf8;
  --paper-soft: #fff8ee;
  --ink: #2c2319;
  --ink-soft: #5f5140;
  --muted: #8b7a64;
  --line: #e5d7c2;
  --line-strong: #d6c3a7;
  --brand: #a1441a;
  --brand-deep: #7c2d12;
  --brand-soft: #fbeadb;
  --gold: #b7791f;
  --danger: #9f2d1a;
  --shadow-sm: 0 1px 2px rgba(72, 48, 24, .05), 0 10px 28px -20px rgba(72, 48, 24, .35);
  --shadow-md: 0 24px 70px -38px rgba(72, 48, 24, .5);
  --radius: 18px;
  --serif: 'Noto Serif Devanagari', 'Tiro Devanagari Hindi', 'Noto Serif', Georgia, serif;
  --sans: 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --header-h: 68px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  /* Non-zero scroll padding makes Chrome jump the page on each keystroke in the sticky search. */
  scroll-padding-top: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 50% -8%, #fbf3e6 0%, rgba(251, 243, 230, 0) 62%),
    linear-gradient(180deg, #f7f1e6 0%, #f6efe3 60%, #f4ecdf 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-view='reader'] .hero,
body[data-view='reader'] .browse,
body[data-view='notice'] .hero {
  display: none;
}

h1, h2, h3, p {
  overflow-wrap: break-word;
}

a {
  color: var(--brand);
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

::selection {
  background: #f2d2b2;
  color: #3a2512;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: .88em;
  padding: .1em .36em;
  border-radius: 5px;
  background: rgba(161, 68, 26, .08);
  color: #7a3413;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--brand-deep);
  color: #fff8ef;
  font-size: .85rem;
  transform: translateY(-200%);
  transition: transform .18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

#main {
  scroll-margin-top: var(--header-h);
}

.noscript {
  max-width: 720px;
  margin: 24px auto;
  padding: 14px 18px;
  border: 1px solid #f0c8bc;
  border-radius: 10px;
  background: #fbe9e3;
  color: #7a3413;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(214, 195, 167, .65);
  background: rgba(249, 243, 233, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1720px;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 8px 18px -10px rgba(124, 45, 18, .6);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .005em;
}

.brand-copy small {
  margin-top: 2px;
  font-size: .64rem;
  letter-spacing: .16em;
  color: var(--muted);
}

.header-search {
  display: none;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 440px;
  margin-left: auto;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}

body[data-view='reader'] .header-search,
body[data-view='notice'] .header-search {
  display: flex;
}

.header-search:focus-within {
  border-color: #c98a5c;
  box-shadow: 0 0 0 3px rgba(161, 68, 26, .08);
}

.header-search input {
  flex: 1;
  min-width: 0;
  padding: 7px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: .86rem;
}

.header-search input::placeholder {
  color: #a4937c;
}

.header-search button {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #a94a1c, #7c2d12);
  color: #fff8ef;
  cursor: pointer;
  transition: filter .18s ease;
}

.header-search button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.header-search button:disabled {
  opacity: .5;
  cursor: wait;
}

.header-search button svg {
  width: 17px;
  height: 17px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin-left: auto;
}

.header-search + .header-nav {
  margin-left: 0;
}

.header-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: .86rem;
  transition: background .18s ease, color .18s ease;
}

.header-link:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.header-link--quiet {
  color: var(--muted);
  font-size: .8rem;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 92px) 22px 44px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(161, 68, 26, .12);
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit--one {
  top: -260px;
  left: -190px;
  width: 540px;
  height: 540px;
}

.hero-orbit--two {
  right: -180px;
  bottom: -210px;
  width: 400px;
  height: 400px;
  border-color: rgba(183, 121, 31, .18);
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--brand);
  font-size: .76rem;
  letter-spacing: .17em;
}

.eyebrow-rule {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.eyebrow-rule:last-child {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 5.2vw, 3.85rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.012em;
}

.hero h1 em {
  font-style: normal;
  color: var(--brand);
  background: linear-gradient(transparent 68%, rgba(183, 121, 31, .2) 68%);
}

.hero-lede {
  max-width: 610px;
  margin: 0 auto 34px;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.search {
  max-width: 720px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.search-box:focus-within {
  border-color: #c98a5c;
  box-shadow: 0 0 0 4px rgba(161, 68, 26, .1), var(--shadow-md);
}

.search-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1rem;
  letter-spacing: .01em;
}

.search-box input::placeholder {
  color: #a4937c;
  font-size: .98rem;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 13px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #a94a1c, #7c2d12);
  color: #fff8ef;
  font-size: .94rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px -14px rgba(124, 45, 18, .8);
  transition: transform .16s ease, filter .16s ease;
}

.search-submit:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.search-submit:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.search-submit svg {
  width: 18px;
  height: 18px;
}

.search-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .81rem;
}

.search-error,
.boot-error {
  margin: 12px 0 0;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: .87rem;
  text-align: left;
}

.search-error {
  border: 1px solid #f0c8bc;
  background: #fbe9e3;
  color: var(--danger);
}

.boot-error {
  border: 1px solid #efd8ae;
  background: #fdf1dd;
  color: #7a3413;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.examples-label,
.recent-label {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .1em;
}

.examples button,
.recent-chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .72);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .8rem;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.examples button:hover {
  border-color: #caa982;
  background: var(--paper);
  color: var(--brand-deep);
}

.recent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.recent-chip {
  border-color: #ecd0b6;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.recent-chip:hover {
  border-color: #d9ae87;
  background: #f8dfc8;
}

.hero-stats {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: .79rem;
  letter-spacing: .03em;
}

.hero-hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 620px;
  margin: 30px auto 0;
  padding: 13px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 253, 248, .58);
  color: var(--ink-soft);
  font-size: .85rem;
  text-align: left;
}

.hero-hint p {
  margin: 0;
}

.hero-hint strong {
  color: var(--ink);
}

.hero-hint-mark {
  flex: none;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.15;
}

/* Browse */

.browse {
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px clamp(16px, 2vw, 30px) 76px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.section-head {
  max-width: 660px;
  margin-bottom: 24px;
}

.eyebrow--left {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.25;
}

.section-lede {
  margin: 0;
  color: var(--muted);
  font-size: .91rem;
}

.browse-list {
  display: grid;
  gap: 10px;
}

.canto {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .68);
  scroll-margin-top: calc(var(--header-h) + 16px);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.canto[open] {
  border-color: #dcc6aa;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.canto-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.canto-summary::-webkit-details-marker {
  display: none;
}

.canto-summary:hover {
  background: rgba(251, 234, 219, .45);
}

.canto-number {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid #e8d2b9;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 600;
}

.canto-label {
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.35;
}

.canto-name {
  font-family: var(--serif);
  font-size: 1.03rem;
  font-weight: 600;
}

.canto-meta {
  color: var(--muted);
  font-size: .73rem;
  letter-spacing: .02em;
}

.canto-chevron {
  width: 24px;
  color: var(--muted);
  font-size: 1.2rem;
  text-align: center;
  transition: transform .2s ease;
}

.canto[open] .canto-chevron {
  transform: rotate(180deg);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  padding: 14px 18px 20px 70px;
  border-top: 1px dashed var(--line);
}

.chapter-btn {
  position: relative;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .89rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

.chapter-btn:hover {
  border-color: #c78f61;
  background: var(--brand-soft);
  color: var(--brand-deep);
  transform: translateY(-1px);
}

.chapter-btn.is-missing {
  border-style: dashed;
  background: rgba(245, 238, 228, .55);
  color: #a08e78;
}

.chapter-btn.is-missing::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c07a4a;
}

/* Reader */

.reader {
  max-width: none;
  margin: 0 auto;
  padding: clamp(20px, 2.6vw, 34px) clamp(16px, 2vw, 30px) 56px;
}

body[data-view='reader'] .header-inner,
body[data-view='reader'] .footer-inner {
  max-width: none;
}

.reader-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.reader-heading {
  min-width: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .81rem;
}

.back-link:hover {
  color: var(--brand);
}

.kicker {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: .75rem;
  letter-spacing: .12em;
}

.reader h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.8vw, 2.55rem);
  font-weight: 600;
  line-height: 1.2;
  outline: none;
}

.reader-meta {
  margin: 0;
  color: var(--muted);
  font-size: .83rem;
}

.reader-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.note {
  max-width: 660px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #ecdcc4;
  border-radius: 9px;
  background: #fdf7ec;
  color: var(--ink-soft);
  font-size: .81rem;
}

.note--accent {
  border-color: #edd0b5;
  background: var(--brand-soft);
  color: #733a17;
}

.reader-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, filter .16s ease;
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(255, 253, 248, .72);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  border-color: #c99b73;
  background: var(--paper);
  color: var(--brand-deep);
}

.btn--primary {
  border: 0;
  background: linear-gradient(135deg, #a94a1c, #7c2d12);
  color: #fff8ef;
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 19vw, 340px);
  gap: clamp(18px, 1.6vw, 26px);
  align-items: start;
}

.reader-main {
  min-width: 0;
}

.reader-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(249, 243, 233, .94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px -26px rgba(72, 48, 24, .55);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-nav {
  margin-right: auto;
}

.toolbar-zoom {
  margin-left: auto;
}

.toolbar-verse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid #dfc3a2;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: .78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
}

.toolbar-verse-kicker {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .08em;
}

.toolbar-verse.is-approx {
  border-style: dashed;
  border-color: #d8b47f;
  background: #fdf5e7;
}

.toolbar-verse.is-approx .toolbar-verse-ref {
  color: var(--gold);
}

.toolbar-search {
  display: none;
  flex: 1 1 320px;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

html.is-fullscreen .toolbar-search {
  display: flex;
}

html.is-fullscreen .toolbar-search .header-search {
  flex: 1 1 auto;
  width: 100%;
  max-width: 560px;
  margin: 0;
  padding: 2px 2px 2px 14px;
  box-shadow: none;
}

html.is-fullscreen .toolbar-search .header-search input {
  padding: 5px 0;
}

html.is-fullscreen .toolbar-search .header-search button {
  width: 30px;
  height: 30px;
}

.btn--nav {
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .82rem;
}

.btn--nav:hover:not(:disabled) {
  border-color: #cca27b;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
  border-color: #cca27b;
  color: var(--brand-deep);
}

.icon-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.page-label {
  padding: 0 6px;
  color: var(--ink-soft);
  font-size: .79rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zoom-label {
  min-width: 40px;
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.chip-btn {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .75rem;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: #cca27b;
  color: var(--brand-deep);
}

.chip-btn--fs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip-btn--fs .fs-icon {
  width: 14px;
  height: 14px;
}

.chip-btn--fs .fs-icon--exit {
  display: none;
}

.chip-btn--fs[aria-pressed="true"] {
  border-color: #c99b73;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.chip-btn--fs[aria-pressed="true"] .fs-icon--enter {
  display: none;
}

.chip-btn--fs[aria-pressed="true"] .fs-icon--exit {
  display: block;
}

.linkish {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

.toolbar-back {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #a94a1c, #7c2d12);
  color: #fff8ef;
  font-size: .8rem;
  text-decoration: none;
  box-shadow: 0 14px 34px -16px rgba(44, 35, 25, .75);
}

.toolbar-back:hover {
  filter: brightness(1.08);
}

.pdf-stage {
  position: relative;
  min-height: min(72vh, 560px);
  padding: clamp(8px, .75vw, 12px);
  overflow-x: auto;
  overflow-y: clip;
  touch-action: pan-x pan-y;
  border: 1px solid #dcc8ac;
  border-radius: 14px;
  background: linear-gradient(180deg, #eee1d0 0%, #e8d9c3 48%, #e3d3bb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), var(--shadow-sm);
}

html.is-pinching .pdf-stage {
  overflow: hidden;
}

html.is-pinching .pdf-page-stack {
  transition: none;
}

.pdf-page-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, .8vw, 14px);
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
}

.pdf-page {
  position: relative;
  flex: none;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 20px 55px -20px rgba(60, 35, 10, .5);
  line-height: 0;
}

.pdf-page canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
}

.pdf-page .text-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  line-height: 1;
  text-align: initial;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
  transform-origin: 0 0;
  user-select: text;
  -webkit-user-select: text;
  forced-color-adjust: none;
}

.pdf-page .text-layer span,
.pdf-page .text-layer br {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}

.pdf-page .text-layer span.markedContent {
  top: 0;
  height: 0;
}

.pdf-page .text-layer ::selection {
  color: transparent;
  background: rgba(180, 83, 9, .38);
}

.pdf-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 14px;
  background: rgba(247, 241, 230, .86);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  color: var(--muted);
  font-size: .85rem;
}

.pdf-loading p {
  margin: 0;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(161, 68, 26, .16);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pdf-error {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border-radius: 14px;
  background: rgba(247, 241, 230, .96);
  text-align: center;
}

.pdf-error-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
}

.pdf-error p {
  max-width: 430px;
  margin: 0;
  color: var(--ink-soft);
  font-size: .85rem;
}

.pdf-error .btn {
  margin-top: 8px;
}

.verse-marker {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 2;
  height: 0;
  pointer-events: none;
}

.verse-marker::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  border-top: 2px dashed rgba(161, 68, 26, .75);
  box-shadow: 0 0 0 1px rgba(255, 253, 248, .5);
}

.verse-marker-tag {
  position: absolute;
  top: 0;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a94a1c, #7c2d12);
  color: #fff8ef;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .03em;
  white-space: nowrap;
  transform: translateY(-50%);
  box-shadow: 0 4px 12px -6px rgba(124, 45, 18, .8);
}

.verse-marker.is-approx::before {
  display: none;
}

.verse-marker.is-approx .verse-marker-tag {
  top: 10px;
  right: 50%;
  background: #8a6a45;
  transform: translate(50%, 0);
}

.reader-hint {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: .77rem;
}

.reader-hint strong {
  color: var(--ink-soft);
  font-weight: 500;
}

/* Aside */

.reader-aside {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aside-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .8);
}

.aside-card--ref {
  border-color: #e6d3ba;
  background: linear-gradient(180deg, #fffaf2, #fff6e9);
}

.aside-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .69rem;
  letter-spacing: .12em;
}

.aside-ref {
  margin: 0 0 4px;
  color: var(--brand-deep);
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.25;
}

.aside-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: .79rem;
}

.aside-extra {
  margin: 8px 0 0;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fdf5e7;
  color: var(--gold);
  font-size: .73rem;
}

.aside-link {
  display: inline-block;
  margin-top: 14px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(161, 68, 26, .3);
  font-size: .79rem;
}

.aside-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.aside-count {
  margin: 0;
  color: var(--muted);
  font-size: .71rem;
}

.verse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 5px;
  max-height: 236px;
  padding: 4px 2px 6px;
  overflow: auto;
  scrollbar-width: thin;
}

.verse-btn {
  position: relative;
  height: 34px;
  padding: 0 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.verse-btn:hover {
  border-color: #c99b73;
  background: var(--brand-soft);
}

.verse-btn.is-current {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff8ef;
  font-weight: 600;
}

.verse-btn.is-approx::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.verse-btn.is-current.is-approx::after {
  background: #ffe9b8;
}

.aside-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .69rem;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

/* Notice */

.notice {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) 22px 24px;
}

.notice-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.notice-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--brand));
}

.notice-mark {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.notice h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.25;
  outline: none;
}

.notice-body {
  max-width: 630px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: .94rem;
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.notice-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.notice-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: .83rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Footer */

.site-footer {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  background: rgba(241, 231, 217, .58);
}

.footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px clamp(16px, 2vw, 30px) 40px;
  color: var(--muted);
  font-size: .77rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.footer-brand {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: .95rem;
}

.footer-brand span {
  color: var(--muted);
  font-size: .8rem;
}

.footer-stats {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.footer-stats strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.footer-note {
  max-width: 850px;
  margin: 0 0 6px;
  line-height: 1.7;
}

.footer-note--quiet {
  color: #9a8b78;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: #2c2319;
  color: #fff8ef;
  font-size: .83rem;
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Fullscreen reader */

html.is-fullscreen .site-header,
html.is-fullscreen .reader-head,
html.is-fullscreen .reader-aside,
html.is-fullscreen .reader-hint,
html.is-fullscreen .site-footer {
  display: none;
}

html.is-fullscreen .reader {
  max-width: none;
  padding: 0;
}

html.is-fullscreen .reader-layout {
  display: block;
}

html.is-fullscreen .reader-toolbar {
  top: 0;
  margin-bottom: 0;
  padding: 8px 14px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(249, 243, 233, .97);
}

html.is-fullscreen .pdf-stage {
  min-height: 100vh;
  padding: 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html.is-fullscreen .pdf-page-stack {
  gap: 12px;
}

html.is-fullscreen .pdf-loading,
html.is-fullscreen .pdf-error {
  border-radius: 0;
}

html.is-fullscreen .toolbar-back {
  right: 16px;
  bottom: 16px;
}

/* Responsive */

@media (min-width: 1280px) {
  .browse-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 1040px) {
  .reader-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .reader-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .verse-grid {
    max-height: 200px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 9px 16px;
  }

  .header-nav {
    margin-left: auto;
  }

  .header-search {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
    margin: 0;
  }

  .hero {
    padding-top: 44px;
  }

  .reader-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .reader-actions {
    width: 100%;
  }

  .reader-toolbar {
    gap: 8px;
    padding: 8px;
  }

  .toolbar-nav {
    margin-right: 0;
  }

  .toolbar-pages {
    margin-left: auto;
  }

  .toolbar-zoom {
    margin-left: 0;
  }

  .toolbar-search {
    order: 3;
    flex: 1 0 100%;
  }

  .toolbar-verse-kicker {
    display: none;
  }

  html.is-fullscreen .toolbar-search .header-search {
    max-width: none;
  }

  .reader-aside {
    grid-template-columns: 1fr;
  }

  .chapter-grid {
    padding-left: 62px;
  }
}

@media (max-width: 640px) {
  .brand-copy small {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .header-link {
    padding: 7px 9px;
    font-size: .81rem;
  }

  .header-link--quiet {
    display: none;
  }

  .hero {
    padding: 34px 16px 32px;
  }

  .hero h1 {
    font-size: clamp(1.95rem, 9.6vw, 2.5rem);
  }

  .hero-lede {
    font-size: .94rem;
    margin-bottom: 26px;
  }

  .eyebrow {
    font-size: .68rem;
    letter-spacing: .13em;
  }

  .search-box {
    padding: 6px 6px 6px 14px;
    border-radius: 16px;
  }

  .search-icon {
    display: none;
  }

  .search-box input {
    font-size: 1rem;
    padding: 11px 0;
  }

  .search-submit {
    padding: 11px 14px;
    border-radius: 11px;
    font-size: .86rem;
  }

  .search-submit svg {
    display: none;
  }

  .hero-hint {
    margin-top: 24px;
    padding: 12px 14px;
  }

  .browse {
    padding: 26px 16px 60px;
  }

  .canto-summary {
    gap: 10px;
    padding: 12px 14px;
  }

  .canto-number {
    width: 34px;
    height: 34px;
    font-size: .98rem;
  }

  .canto-name {
    font-size: .98rem;
  }

  .chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 6px;
    padding: 12px 14px 16px;
  }

  .chapter-btn {
    height: 42px;
  }

  .reader {
    padding: 20px 14px 48px;
  }

  .reader h2 {
    font-size: 1.75rem;
  }

  .reader-actions .btn {
    flex: 1;
  }

  .reader-toolbar {
    border-radius: 12px;
  }

  .pdf-stage {
    min-height: 420px;
    padding: 8px;
    border-radius: 12px;
  }

  .pdf-loading,
  .pdf-error {
    border-radius: 12px;
  }

  .reader-hint {
    font-size: .73rem;
  }

  .notice {
    padding: 28px 14px 20px;
  }

  .notice-card {
    border-radius: 18px;
  }

  .footer-inner {
    padding: 24px 16px 34px;
  }

  .footer-top {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 400px) {
  .search-submit {
    padding: 11px 12px;
  }

  .chip-btn--fs .fs-label {
    display: none;
  }

  .toolbar-pages .page-label {
    padding: 0 2px;
    font-size: .74rem;
  }

  .toolbar-verse {
    padding: 4px 7px;
    font-size: .74rem;
  }

  .toolbar-zoom .zoom-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
