:root {
  color-scheme: light;
  --bg: #eef2f1;
  --paper: #ffffff;
  --ink: #18201f;
  --muted: #5f6866;
  --line: #ccd6d2;
  --accent: #7c2d2d;
  --accent-strong: #5c1f1f;
  --blue: #245f73;
  --shadow: 0 18px 55px rgba(24, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(36, 95, 115, 0.09), transparent 30%, transparent 70%, rgba(124, 45, 45, 0.08)),
    var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
}

.locale-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.locale-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 760;
  text-decoration: none;
}

.locale-nav a:hover,
.locale-nav a.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent);
}

.reader-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 24px 0 18px;
}

.eyebrow,
.translation,
.chapter-meta,
footer {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 5.4rem;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 178px;
  min-height: 48px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.chapter-panel {
  min-height: 560px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.state-message {
  padding: 42px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
}

.error {
  color: var(--accent);
}

.chapter {
  padding: 62px;
}

.chapter-heading {
  max-width: 820px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.translation {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

h2 {
  overflow-wrap: anywhere;
  font-size: 3.7rem;
}

.chapter-meta {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.verses {
  max-width: 820px;
  padding: 12px 0 8px;
  font-size: 1.34rem;
  line-height: 1.72;
}

.verse {
  margin: 0;
}

.verse + .verse {
  margin-top: 0.72em;
}

.verse-number {
  display: inline-block;
  min-width: 1.7em;
  color: var(--accent);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68em;
  font-weight: 850;
  vertical-align: super;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] .reader-toolbar {
  direction: rtl;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding-top: 10px;
  }

  .topbar,
  .reader-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .locale-nav {
    justify-content: flex-start;
  }

  .primary-button {
    width: 100%;
  }

  .chapter-panel {
    min-height: 480px;
  }

  .chapter {
    padding: 28px;
  }

  h1 {
    font-size: 3.1rem;
  }

  h2 {
    font-size: 2.35rem;
  }

  .verses {
    font-size: 1.12rem;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.45rem;
  }

  h2 {
    font-size: 2rem;
  }
}
