

:root {
  --paper: #f5f0e6;
  --paper-deep: #e9e1d2;
  --ink: #18201d;
  --muted: #68716b;
  --sage: #53665b;
  --sage-soft: #dce4dd;
  --gold: #b7904b;
  --line: rgba(24, 32, 29, 0.13);
  --surface: rgba(255, 253, 248, 0.72);
  --reader-scale: 1;
  --header-height: 72px;
  --rail-width: 284px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #131815;
  --paper-deep: #1b221e;
  --ink: #f3eee5;
  --muted: #aeb8b1;
  --sage: #9cb5a5;
  --sage-soft: #26342c;
  --gold: #d0a85d;
  --line: rgba(243, 238, 229, 0.13);
  --surface: rgba(24, 31, 27, 0.82);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 84% 8%, rgba(183, 144, 75, 0.1), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

button,
select,
input {
  color: inherit;
  font: inherit;
}

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

button {
  cursor: pointer;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
}

.brand-mark,
.wordmark-symbol,
.pagination-mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 64px;
  height: 64px;
  font-size: 1.3rem;
}

.progress-track {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 300ms ease;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.16rem;
  text-decoration: none;
}

.wordmark-symbol {
  width: 38px;
  height: 38px;
  font-size: 0.76rem;
}

.header-actions,
.reading-controls,
.rail-heading,
.search-panel header {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 8px;
}

.icon-button,
.text-button,
.reading-controls button {
  border: 0;
  background: transparent;
}

.icon-button {
  min-width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.15rem;
}

.icon-button:hover,
.text-button:hover,
.reading-controls button:hover {
  background: var(--sage-soft);
}

.text-button {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 650;
}

.library-rail {
  position: fixed;
  z-index: 40;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--rail-width);
  overflow-y: auto;
  padding: 28px 22px 36px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, var(--sage-soft));
}

.rail-heading {
  justify-content: space-between;
  margin-bottom: 25px;
}

.eyebrow {
  margin: 0;
  color: var(--sage);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.book-group {
  margin: 0 0 24px;
}

.book-group h2 {
  margin: 0 10px 8px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-group button,
.book-group a {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  text-align: left;
  text-decoration: none;
}

.book-group button small,
.book-group a small {
  color: var(--muted);
  font-size: 0.68rem;
}

.book-group button:hover,
.book-group a:hover,
.book-group .active {
  background: var(--sage-soft);
}

.book-group .active {
  color: var(--sage);
  font-weight: 700;
}

.rail-note {
  margin-top: 36px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.rail-note span {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.rail-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.reader-main {
  min-height: 100vh;
  margin-left: var(--rail-width);
  padding-top: var(--header-height);
}

.reader-toolbar {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.breadcrumb i {
  color: var(--gold);
  font-style: normal;
}

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

.reading-controls {
  gap: 4px;
}

.reading-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.reading-controls select {
  height: 34px;
  min-width: 62px;
  padding: 0 24px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.reading-controls button {
  width: 36px;
  height: 34px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
}

.chapter {
  max-width: 780px;
  margin: 0 auto;
  padding: 76px 54px 48px;
}

.chapter-heading {
  margin-bottom: 42px;
}

.chapter-heading h1 {
  margin: 12px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 8vw, 5.4rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.gold-rule {
  width: 62px;
  height: 2px;
  background: var(--gold);
}

.overview {
  margin: 0 0 52px;
  padding: 26px 30px;
  border-left: 2px solid var(--gold);
  background: var(--surface);
}

.overview h2 {
  margin: 0 0 10px;
  color: var(--sage);
  font-size: 0.69rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.overview p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(1rem * var(--reader-scale));
  font-style: italic;
  line-height: 1.7;
}

.verses p {
  margin: 0 0 1.15em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(1.18rem * var(--reader-scale));
  line-height: 1.82;
}

.verse-number {
  position: relative;
  top: -0.08em;
  margin-right: 0.58em;
  color: var(--gold);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 0.58em;
  font-weight: 800;
  text-decoration: none;
}

.verse-number:target,
.verses p:target {
  background: color-mix(in srgb, var(--gold) 15%, transparent);
}

.chapter-pagination {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 54px 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
}

.chapter-pagination button,
.chapter-pagination a {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

.chapter-pagination button:last-child,
.chapter-pagination a:last-child {
  justify-self: end;
}

.chapter-pagination button:disabled {
  opacity: 0.25;
  cursor: default;
}

.chapter-pagination small {
  color: var(--muted);
  font-size: 0.72rem;
}

.pagination-mark {
  width: 42px;
  height: 42px;
  font-size: 0.7rem;
}

.search-layer,
.search-scrim,
.drawer-scrim {
  position: fixed;
  inset: 0;
}

.search-layer {
  z-index: 90;
  display: grid;
  place-items: start center;
  padding: 9vh 20px 20px;
}

.search-scrim,
.drawer-scrim {
  border: 0;
  background: rgba(9, 13, 11, 0.63);
  backdrop-filter: blur(5px);
}

.search-panel {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  max-height: 82vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.search-panel header {
  justify-content: space-between;
  padding: 20px 24px 8px;
}

.search-panel input {
  width: calc(100% - 48px);
  margin: 8px 24px 18px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.search-results {
  max-height: 58vh;
  overflow-y: auto;
  padding: 0 16px 20px;
}

.search-results button {
  width: 100%;
  padding: 14px 12px;
  display: grid;
  gap: 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.search-results button:hover {
  background: var(--sage-soft);
}

.search-results strong {
  color: var(--gold);
  font-size: 0.78rem;
}

.search-results span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  line-height: 1.5;
}

.empty-state {
  padding: 24px 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.mobile-only {
  display: none;
}

@media (max-width: 860px) {
  :root {
    --header-height: 64px;
  }

  .mobile-only {
    display: grid;
  }

  .site-header {
    padding: 0 14px;
  }

  .wordmark {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
  }

  .wordmark-symbol {
    display: none;
  }

  .header-actions .text-button {
    display: none;
  }

  .library-rail {
    z-index: 81;
    top: 0;
    width: min(330px, 88vw);
    padding-top: 24px;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.24);
  }

  .library-rail.is-open {
    transform: translateX(0);
  }

  .drawer-scrim {
    z-index: 80;
  }

  .reader-main {
    margin-left: 0;
  }

  .reader-toolbar {
    padding: 16px 20px;
  }

  .breadcrumb span,
  .breadcrumb i,
  .reading-controls label {
    display: none;
  }

  .chapter {
    padding: 54px 24px 38px;
  }

  .chapter-heading {
    margin-bottom: 32px;
  }

  .overview {
    margin-bottom: 38px;
    padding: 22px 22px;
  }

  .verses p {
    font-size: calc(1.12rem * var(--reader-scale));
    line-height: 1.75;
  }

  .chapter-pagination {
    padding: 28px 24px 70px;
  }

  .search-layer {
    padding: 0;
  }

  .search-panel {
    width: 100%;
    min-height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
  }

  .search-results {
    max-height: calc(100vh - 150px);
  }
}

@media (max-width: 430px) {
  .chapter-heading h1 {
    font-size: 3.25rem;
  }

  .chapter {
    padding-inline: 20px;
  }

  .overview {
    margin-inline: -4px;
  }

  .chapter-pagination {
    padding-inline: 20px;
  }
}

@media print {
  .site-header,
  .library-rail,
  .reader-toolbar,
  .chapter-pagination,
  .progress-track {
    display: none;
  }

  .reader-main {
    margin: 0;
    padding: 0;
  }

  .chapter {
    max-width: 100%;
    padding: 0;
  }
}

.home-body {
  background:
    radial-gradient(circle at 78% 12%, rgba(183, 144, 75, 0.18), transparent 25rem),
    var(--paper);
}

.home-main {
  padding-top: var(--header-height);
}

.hero {
  min-height: 78vh;
  padding: 11vh clamp(24px, 8vw, 120px) 80px;
  display: grid;
  align-content: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: min(48vw, 660px);
  aspect-ratio: 1;
  top: 6%;
  right: -12%;
  border: 1px solid var(--gold);
  border-radius: 50%;
  opacity: 0.46;
  pointer-events: none;
}

.hero h1 {
  max-width: 940px;
  margin: 20px 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 8.7vw, 8.6rem);
  font-weight: 400;
  letter-spacing: -0.067em;
  line-height: 0.87;
}

.hero h1 em {
  color: var(--sage);
  font-weight: 400;
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1.7;
}

.translation-callout {
  max-width: 650px;
  margin: 22px 0 0;
  padding-left: 18px;
  border-left: 2px solid var(--gold);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.6;
}

.translation-callout span {
  display: block;
  margin-bottom: 3px;
  color: var(--gold-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.translation-note {
  margin: 16px 18px 24px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.primary-action {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.primary-action:hover {
  background: var(--sage);
  border-color: var(--sage);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.continue-card {
  width: min(360px, 100%);
  margin-top: 36px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.continue-card .eyebrow {
  grid-column: 1 / -1;
}

.continue-card i {
  color: var(--gold);
  font-style: normal;
}

.library-section {
  padding: 100px clamp(24px, 8vw, 120px);
  background: var(--ink);
  color: var(--paper);
}

.library-section > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 54px;
}

.library-section h2,
.about-strip h2 {
  margin: 14px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(245, 240, 230, 0.16);
}

.book-card {
  min-height: 175px;
  padding: 24px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  border-right: 1px solid rgba(245, 240, 230, 0.16);
  border-bottom: 1px solid rgba(245, 240, 230, 0.16);
  color: var(--paper);
  text-decoration: none;
  transition: background 160ms ease;
}

.book-card:nth-child(3n) {
  border-right: 0;
}

.book-card:hover {
  background: rgba(245, 240, 230, 0.07);
}

.book-order {
  color: var(--gold);
  font-size: 0.68rem;
}

.book-card small,
.book-card p {
  color: #aab5ae;
  font-size: 0.7rem;
}

.book-card h3 {
  margin: 7px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.book-card p {
  margin: 0;
}

.book-card i {
  color: var(--gold);
  font-style: normal;
}

.about-strip {
  padding: 100px clamp(24px, 8vw, 120px);
  display: grid;
  grid-template-columns: 0.7fr 1.6fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-strip > div p {
  max-width: 620px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.75;
}

.about-strip dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.about-strip dl div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.about-strip dt {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.about-strip dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.site-footer {
  padding: 38px clamp(24px, 8vw, 120px);
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.site-footer .wordmark-symbol {
  width: 38px;
  height: 38px;
  font-size: 0.7rem;
}

.site-footer p {
  font-family: Georgia, "Times New Roman", serif;
}

.site-footer small {
  justify-self: end;
  max-width: 600px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: right;
}

.search-layer {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.search-layer.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.search-results a {
  padding: 14px 12px;
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.search-results a:hover {
  background: var(--sage-soft);
}

.search-results a strong {
  color: var(--gold);
  font-size: 0.78rem;
}

.search-results a span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  line-height: 1.5;
}

.drawer-scrim {
  z-index: 39;
  display: none;
}

.drawer-scrim.is-visible {
  display: block;
}

.not-found {
  min-height: 100vh;
  padding: 18vh 8vw;
}

.not-found h1 {
  max-width: 800px;
  margin: 16px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.05em;
}

.not-found p {
  margin-bottom: 30px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-card:nth-child(3n) {
    border-right: 1px solid rgba(245, 240, 230, 0.16);
  }

  .book-card:nth-child(2n) {
    border-right: 0;
  }

  .about-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .hero {
    min-height: 84vh;
    padding-top: 90px;
  }

  .hero h1 {
    font-size: clamp(3.6rem, 17vw, 5.4rem);
  }

  .library-section {
    padding-block: 74px;
  }

  .library-section > header {
    display: block;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .book-card,
  .book-card:nth-child(3n),
  .book-card:nth-child(2n) {
    border-right: 0;
  }

  .about-strip dl {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-footer {
    grid-template-columns: auto 1fr;
  }

  .site-footer small {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }
}
