:root {
  --reader-border: color-mix(in srgb, var(--gold, #b38a45) 28%, transparent);
}

.reader-main {
  min-height: 70vh;
}

.reader-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5.5rem, 10vw, 8.5rem) 0 clamp(3.5rem, 7vw, 5.5rem);
  background:
    radial-gradient(circle at 80% 16%, rgba(191, 151, 82, .22), transparent 29rem),
    linear-gradient(145deg, var(--wine, #5b1f2a), #2f1719);
  color: #fffaf1;
}

.reader-hero::after {
  content: "ॐ";
  position: absolute;
  right: clamp(1rem, 8vw, 8rem);
  bottom: -5rem;
  font-size: clamp(13rem, 30vw, 26rem);
  line-height: 1;
  color: rgba(255, 255, 255, .035);
  pointer-events: none;
}

.reader-hero .eyebrow,
.reader-hero .reference {
  color: #e8c986;
}

.reader-hero h1 {
  max-width: 920px;
  margin: .55rem 0 1rem;
  font-size: clamp(2.55rem, 6vw, 5.25rem);
  line-height: .98;
}

.reader-hero p {
  max-width: 760px;
  font-size: clamp(1.03rem, 2vw, 1.25rem);
  color: rgba(255, 250, 241, .84);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}

.breadcrumbs a {
  color: inherit;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.8rem;
}

.reader-section {
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
}

.reader-section.alt {
  background: var(--surface-soft, #f5efe4);
}

.reader-intro-grid,
.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.reader-prose {
  max-width: 780px;
}

.reader-prose h2,
.reader-prose h3 {
  margin-top: 0;
}

.reader-prose p {
  font-size: 1.06rem;
  line-height: 1.78;
}

.fact-panel,
.study-note,
.chapter-card,
.parva-card,
.character-card,
.principle-card {
  border: 1px solid var(--reader-border);
  background: var(--surface, #fffaf1);
  box-shadow: 0 18px 48px rgba(47, 23, 25, .07);
}

.fact-panel,
.study-note {
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: 1.4rem;
}

.fact-list {
  display: grid;
  gap: 1rem;
  margin: 1.2rem 0 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--reader-border);
}

.fact-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fact-list dt {
  font-weight: 750;
}

.fact-list dd {
  margin: 0;
  color: var(--text-soft, #655a55);
}

.reader-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}

.reader-heading > div {
  max-width: 720px;
}

.reader-heading h2 {
  margin: .35rem 0 0;
}

.reader-filter {
  min-width: min(100%, 310px);
}

.reader-filter input {
  width: 100%;
  padding: .95rem 1.05rem;
  border: 1px solid var(--reader-border);
  border-radius: 999px;
  background: var(--surface, #fffaf1);
  color: inherit;
  font: inherit;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

.chapter-card,
.parva-card {
  position: relative;
  padding: 1.4rem;
  border-radius: 1.25rem;
  transition: transform .2s ease, box-shadow .2s ease;
}

.chapter-card:hover,
.parva-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(47, 23, 25, .12);
}

.chapter-number,
.parva-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--wine, #5b1f2a);
  color: #fffaf1;
  font-weight: 800;
  font-size: .85rem;
}

.chapter-card h3,
.parva-card h3 {
  margin: 1rem 0 .3rem;
  font-size: 1.18rem;
}

.chapter-card .sanskrit-name,
.parva-card .sanskrit-name {
  margin: 0 0 .8rem;
  color: var(--gold-dark, #8e6a2e);
  font-weight: 650;
}

.chapter-card p:last-child,
.parva-card p:last-child {
  margin-bottom: 0;
  color: var(--text-soft, #655a55);
}

.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}

.theme-chips span {
  padding: .35rem .7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold, #b38a45) 13%, transparent);
  font-size: .78rem;
  font-weight: 700;
}

.principles-grid,
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.principle-card,
.character-card {
  padding: 1.4rem;
  border-radius: 1.25rem;
}

.principle-card h3,
.character-card h3 {
  margin-top: .2rem;
}

.character-card .role {
  color: var(--gold-dark, #8e6a2e);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.quote-panel {
  margin: 2rem 0;
  padding: 1.5rem 1.7rem;
  border-left: 4px solid var(--gold, #b38a45);
  border-radius: 0 1rem 1rem 0;
  background: color-mix(in srgb, var(--gold, #b38a45) 10%, var(--surface, #fffaf1));
}

.quote-panel blockquote {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.45;
}

.quote-panel p {
  margin: .8rem 0 0;
  color: var(--text-soft, #655a55);
}

.study-steps {
  display: grid;
  gap: .8rem;
  counter-reset: study-step;
  padding: 0;
  list-style: none;
}

.study-steps li {
  counter-increment: study-step;
  display: grid;
  grid-template-columns: 2.3rem 1fr;
  gap: .9rem;
  align-items: start;
}

.study-steps li::before {
  content: counter(study-step);
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--wine, #5b1f2a);
  color: white;
  font-weight: 800;
}

.notice {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--gold, #b38a45) 12%, transparent);
  border: 1px solid var(--reader-border);
}

.back-top {
  display: inline-flex;
  margin-top: 2rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .reader-intro-grid,
  .context-grid {
    grid-template-columns: 1fr;
  }

  .reader-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .reader-filter {
    min-width: 100%;
  }

  .fact-list div {
    grid-template-columns: 1fr;
    gap: .25rem;
  }
}
