:root {
  --paper: #f7f3ea;
  --paper-raised: #fcfaf5;
  --ink: #1f1d19;
  --muted: #746f65;
  --muted-2: #9a9489;
  --line: #ded7ca;
  --line-strong: #c9c0b1;
  --accent: #7a2f2f;
  --accent-soft: #eee0db;
  --accent-ink: #5b1f1f;
  --sidebar: #f1ebdf;
  --shadow: 0 16px 50px rgba(40, 31, 20, .08);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --verse-size: 1.08rem;
  --header-h: 72px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #191817;
  --paper-raised: #211f1d;
  --ink: #eee8dc;
  --muted: #b9b1a4;
  --muted-2: #8e877c;
  --line: #3a3733;
  --line-strong: #514c45;
  --accent: #d59085;
  --accent-soft: #3a2926;
  --accent-ink: #f0b3a8;
  --sidebar: #1e1c1a;
  --shadow: 0 18px 55px rgba(0, 0, 0, .22);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: var(--accent-soft);
}

.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;
  left: 1rem;
  top: .75rem;
  z-index: 1000;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  padding: .7rem 1rem;
  border-radius: .4rem;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1480px;
  margin: auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: max-content;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font: 600 1.25rem/1 var(--serif);
  color: var(--accent);
}

.brand-copy {
  display: grid;
  line-height: 1.08;
}

.brand-copy strong {
  font: 600 1rem/1.2 var(--serif);
  letter-spacing: .01em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .69rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.main-nav {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  padding: 9px 11px;
  border-radius: 7px;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink);
  background: var(--paper-raised);
}

.icon-button {
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
}

.theme-toggle:hover,
.icon-button:hover {
  background: var(--paper-raised);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  gap: 4px;
  align-content: center;
}

.nav-toggle span {
  width: 19px;
  height: 1px;
  background: currentColor;
  display: block;
}

.mobile-nav {
  position: fixed;
  z-index: 99;
  top: var(--header-h);
  left: 0;
  right: 0;
  padding: 14px 22px 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.mobile-nav a {
  display: block;
  padding: 12px 4px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--accent);
  font-size: .72rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.button {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 650;
  font-size: .9rem;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button.secondary {
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero {
  min-height: min(720px, calc(100vh - var(--header-h)));
  padding: 105px 24px 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 660px;
  height: 660px;
  border: 1px solid var(--line);
  border-radius: 50%;
  top: 38px;
  opacity: .65;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border: 1px solid var(--line);
  border-radius: 50%;
  top: 118px;
  opacity: .45;
  pointer-events: none;
}

.hero>* {
  position: relative;
  z-index: 1;
}

.hero-ornament {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 23px;
}

.hero h1 {
  margin: 0;
  max-width: 920px;
  font: 500 clamp(3.1rem, 8vw, 7.4rem)/.92 var(--serif);
  letter-spacing: -.05em;
}

.hero h1 em {
  font-weight: 400;
}

.hero-lead {
  max-width: 720px;
  margin: 34px auto 0;
  font: 400 clamp(1.06rem, 2vw, 1.35rem)/1.62 var(--serif);
  color: var(--muted);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats {
  margin: 65px 0 0;
  padding: 0;
  display: flex;
  gap: 50px;
}

.hero-stats div {
  min-width: 90px;
}

.hero-stats dt {
  font: 500 1.55rem/1 var(--serif);
}

.hero-stats dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.home-grid {
  padding: 76px 0;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
}

.feature-card {
  min-height: 250px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-raised);
}

.feature-card-large {
  grid-row: span 2;
  min-height: 516px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.feature-number {
  display: block;
  margin-bottom: auto;
  color: var(--muted-2);
  font: 500 .72rem/1 var(--sans);
  letter-spacing: .1em;
}

.feature-card h2 {
  margin: 18px 0 10px;
  font: 500 clamp(1.55rem, 3vw, 2.25rem)/1.08 var(--serif);
}

.feature-card p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.65;
}

.home-quote {
  padding: 54px 0 110px;
}

.sample-verse {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 36px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  position: relative;
}

.sample-verse span {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sample-verse p {
  margin: 10px 0 0;
  font: 400 clamp(1.2rem, 2.4vw, 1.8rem)/1.45 var(--serif);
}

.sample-verse small {
  position: absolute;
  right: 0;
  bottom: -28px;
  color: var(--muted);
}

/* Reader */
.reader-page {
  --content-max: 1120px;
}

.reading-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 110;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.reader-layout {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.reader-sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  overflow: hidden;
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  padding: 25px 22px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-head h2 {
  margin: 0;
  font: 500 1.55rem/1 var(--serif);
}

.sidebar-close {
  display: none;
  font-size: 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-raised);
  padding: 0 11px;
}

.search-box svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  flex: none;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  min-height: 42px;
  font-size: .85rem;
}

.sidebar-search {
  margin: 0 16px 14px;
}

.search-results {
  margin: 0 16px 10px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 8px;
  max-height: 40vh;
  overflow: auto;
}

.search-result-item {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result-item:last-child {
  border-bottom: 0;
}

.search-result-item:hover {
  background: var(--accent-soft);
}

.search-result-item strong {
  display: block;
  font-size: .78rem;
  margin-bottom: 3px;
}

.search-result-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font: 400 .82rem/1.4 var(--serif);
}

.toc {
  overflow: auto;
  padding: 4px 11px 24px 16px;
  scrollbar-width: thin;
}

.toc-cantar {
  padding: 11px 7px 5px;
  margin-top: 7px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.toc-block {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 7px;
  align-items: start;
  padding: 7px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: .78rem;
  line-height: 1.35;
}

.toc-block .num {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.toc-block:hover {
  background: color-mix(in srgb, var(--paper-raised) 70%, transparent);
  color: var(--ink);
}

.toc-block.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 13px 22px 16px;
}

.sidebar-footer a {
  color: var(--muted);
  font-size: .76rem;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--ink);
}

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

.reader-toolbar {
  min-height: 58px;
  position: sticky;
  top: var(--header-h);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 28px;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.toolbar-button,
.font-controls button,
.mode-switch button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 7px;
  padding: 0 11px;
  cursor: pointer;
  font-size: .76rem;
}

.toolbar-button:hover,
.font-controls button:hover,
.mode-switch button:hover {
  border-color: var(--line-strong);
}

.index-open {
  display: none;
}

.mode-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 9px;
}

.mode-switch button {
  border: 0;
  background: transparent;
  min-height: 30px;
}

.mode-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.toolbar-spacer {
  flex: 1;
}

.font-controls {
  display: flex;
  gap: 5px;
}

.global-search-panel {
  position: sticky;
  top: calc(var(--header-h) + 58px);
  z-index: 75;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.global-search-inner {
  max-width: var(--content-max);
  margin: auto;
  padding: 16px 28px 22px;
}

.search-box-large {
  padding-inline: 15px;
}

.search-box-large input {
  min-height: 48px;
  font-size: .96rem;
}

kbd {
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
  font: 500 .68rem/1 var(--sans);
  background: var(--paper);
}

.global-search-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  max-height: 48vh;
  overflow: auto;
}

.global-search-results:empty {
  display: none;
}

.global-search-results .search-result-item {
  border: 1px solid var(--line);
  border-radius: 7px;
}

.reader-status {
  max-width: var(--content-max);
  margin: 70px auto;
  padding: 0 28px;
  color: var(--muted);
  text-align: center;
}

.reader-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 30px 28px 110px;
}

.cantar-section {
  padding-top: 46px;
}

.cantar-heading {
  margin: 0 0 50px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-strong);
}

.cantar-kicker {
  color: var(--accent);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
}

.cantar-heading h1 {
  margin: 9px 0 0;
  font: 500 clamp(2.2rem, 5vw, 4.2rem)/1 var(--serif);
  letter-spacing: -.035em;
}

.block-section {
  scroll-margin-top: calc(var(--header-h) + 78px);
  margin: 0 0 72px;
}

.block-heading {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 26px;
}

.block-number {
  color: var(--muted-2);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.block-heading h2 {
  margin: 0;
  max-width: 760px;
  font: 500 clamp(1.45rem, 2.8vw, 2.1rem)/1.18 var(--serif);
}

.block-range {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.speaker-label {
  margin: 24px 0 7px 88px;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.verse-row {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 8px 0;
  border-radius: 5px;
  scroll-margin-top: calc(var(--header-h) + 84px);
}

.verse-row:hover {
  background: color-mix(in srgb, var(--accent-soft) 26%, transparent);
}

.verse-row:target,
.verse-row.is-highlighted {
  background: var(--accent-soft);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.verse-num {
  justify-self: end;
  padding-top: .35em;
  color: var(--muted-2);
  text-decoration: none;
  font: 500 .7rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}

.verse-num:hover {
  color: var(--accent);
}

.verse-text {
  min-width: 0;
  margin: 0;
  font: 400 var(--verse-size)/1.58 var(--serif);
  letter-spacing: .002em;
}

.verse-text.medieval {
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
}

.verse-actions {
  position: absolute;
  right: 2px;
  top: -25px;
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 7px;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
  transition: opacity .15s, transform .15s;
}

.verse-row:hover .verse-actions,
.verse-row:focus-within .verse-actions {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.verse-actions button {
  border: 0;
  background: transparent;
  min-height: 28px;
  padding: 0 7px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  font-size: .67rem;
}

.verse-actions button:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.note-button.has-note {
  color: var(--accent);
  font-weight: 750;
}

.reader-content[data-mode="modern"] .verse-row {
  grid-template-columns: 72px minmax(0, 760px);
}

.reader-content[data-mode="modern"] .verse-text.medieval {
  display: none;
}

.reader-content[data-mode="medieval"] .verse-row {
  grid-template-columns: 72px minmax(0, 760px);
}

.reader-content[data-mode="medieval"] .verse-text.modern {
  display: none;
}

.reader-content[data-mode="modern"] .verse-row,
.reader-content[data-mode="medieval"] .verse-row {
  justify-content: start;
}

.reader-end {
  max-width: var(--content-max);
  margin: -40px auto 100px;
  padding: 45px 28px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.reader-end span {
  color: var(--accent);
}

.reader-end p {
  font: 400 1.45rem/1.5 var(--serif);
}

.reader-end a {
  color: var(--accent-ink);
}

.note-dialog {
  width: min(580px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-raised);
  color: var(--ink);
  padding: 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
}

.note-dialog::backdrop {
  background: rgba(20, 18, 16, .5);
  backdrop-filter: blur(3px);
}

.note-dialog h2 {
  margin: 4px 0 15px;
  font: 500 1.8rem/1.2 var(--serif);
}

.note-body {
  color: var(--muted);
  font: 400 1rem/1.65 var(--serif);
  white-space: pre-wrap;
}

.dialog-close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 200;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .78rem;
  box-shadow: var(--shadow);
}

/* Prose */
.prose-page,
.info-page,
.resources-page {
  padding-bottom: 100px;
}

.prose-hero {
  max-width: 860px;
  padding: 90px 0 65px;
}

.prose-hero.compact {
  padding-bottom: 45px;
}

.prose-hero h1 {
  margin: 0;
  font: 500 clamp(2.7rem, 6vw, 5.2rem)/.98 var(--serif);
  letter-spacing: -.04em;
}

.prose-deck {
  margin: 26px 0 0;
  max-width: 750px;
  color: var(--muted);
  font: 400 1.2rem/1.6 var(--serif);
}

.prose-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 720px);
  gap: 80px;
  align-items: start;
}

.prose-toc {
  position: sticky;
  top: calc(var(--header-h) + 35px);
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

.prose-toc span {
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.prose-toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  padding: 3px 0;
}

.prose-toc a:hover {
  color: var(--accent);
}

.prose-content section {
  scroll-margin-top: calc(var(--header-h) + 30px);
  margin-bottom: 70px;
}

.prose-content h2 {
  margin: 0 0 25px;
  font: 500 2.1rem/1.1 var(--serif);
}

.prose-content p,
.prose-content li {
  font: 400 1.05rem/1.83 var(--serif);
  color: color-mix(in srgb, var(--ink) 89%, var(--muted));
}

.prose-content blockquote {
  margin: 28px 0;
  padding: 0 0 0 22px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font: 400 1.12rem/1.72 var(--serif);
}

.prose-content.single-column {
  max-width: 750px;
}

.references {
  padding-left: 1.45rem;
}

.references li {
  padding-left: .45rem;
  margin-bottom: 14px;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.principles-grid article {
  min-height: 255px;
  padding: 30px;
  background: var(--paper-raised);
}

.principles-grid span {
  color: var(--muted-2);
  font-size: .7rem;
}

.principles-grid h2 {
  margin: 50px 0 10px;
  font: 500 1.35rem/1.2 var(--serif);
}

.principles-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.65;
}

.callout-section {
  margin-top: 60px;
  padding: 38px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  gap: 40px;
  align-items: end;
  justify-content: space-between;
}

.callout-section h2 {
  margin: 0 0 10px;
  font: 500 2rem/1.15 var(--serif);
}

.callout-section p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.download-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-raised);
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 28px;
  align-items: center;
}

.file-icon {
  width: 78px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--accent);
  font: 500 1.15rem/1 var(--serif);
}

.download-copy h2 {
  margin: 0;
  font: 500 1.65rem/1.15 var(--serif);
}

.download-copy>p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.file-meta {
  margin: 22px 0 0;
  display: flex;
  gap: 28px;
}

.file-meta div {
  display: grid;
  gap: 4px;
}

.file-meta dt {
  color: var(--muted-2);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.file-meta dd {
  margin: 0;
  font-size: .8rem;
}

.schema-section {
  margin-top: 70px;
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 60px;
  align-items: start;
}

.schema-section h2 {
  margin: 0;
  font: 500 2rem/1.15 var(--serif);
}

.schema-section p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: .78rem;
  line-height: 1.65;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: 38px 0 50px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.footer-inner strong {
  font: 500 1rem/1 var(--serif);
}

.footer-inner p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-size: .78rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

@media (max-width: 980px) {
  .main-nav {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .theme-toggle {
    margin-left: auto;
  }

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

  .feature-card-large {
    grid-row: auto;
    min-height: 330px;
  }

  .reader-layout {
    display: block;
  }

  .reader-sidebar {
    position: fixed;
    z-index: 130;
    top: 0;
    left: 0;
    width: min(360px, 90vw);
    height: 100vh;
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    transition: transform .22s ease;
  }

  .reader-sidebar.is-open {
    transform: none;
  }

  .sidebar-close {
    display: grid;
  }

  .index-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .prose-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .prose-toc {
    position: static;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 0 25px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .prose-toc span {
    flex-basis: 100%;
  }

  .principles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  :root {
    --header-h: 64px;
    --verse-size: 1.04rem;
  }

  .header-inner {
    padding: 0 16px;
  }

  .brand-copy small {
    display: none;
  }

  .page-shell {
    width: min(100% - 30px, 1180px);
  }

  .hero {
    padding: 72px 18px 70px;
    min-height: auto;
  }

  .hero::before {
    width: 430px;
    height: 430px;
    top: 16px;
  }

  .hero::after {
    width: 330px;
    height: 330px;
    top: 66px;
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .hero-stats {
    gap: 23px;
    margin-top: 48px;
  }

  .home-grid {
    padding: 48px 0;
  }

  .feature-card {
    min-height: 230px;
    padding: 25px;
  }

  .sample-verse {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .reader-toolbar {
    padding: 7px 12px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .reader-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-button,
  .font-controls button,
  .mode-switch button {
    white-space: nowrap;
  }

  .search-open {
    padding-inline: 9px;
  }

  .global-search-inner {
    padding: 12px;
  }

  .global-search-results {
    grid-template-columns: 1fr;
  }

  .reader-content {
    padding: 18px 15px 85px;
  }

  .cantar-section {
    padding-top: 28px;
  }

  .cantar-heading {
    margin-bottom: 36px;
  }

  .block-section {
    margin-bottom: 54px;
  }

  .block-heading {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 20px;
  }

  .speaker-label {
    margin: 23px 0 6px 0;
  }

  .verse-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0 12px;
  }

  .verse-num {
    grid-row: 1 / span 2;
  }

  .verse-text.medieval {
    grid-column: 2;
    margin-top: 4px;
    color: var(--muted);
    font-size: calc(var(--verse-size) * .93);
  }

  .reader-content[data-mode="modern"] .verse-row,
  .reader-content[data-mode="medieval"] .verse-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .verse-actions {
    position: static;
    grid-column: 2;
    margin-top: 4px;
    justify-self: start;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    background: transparent;
    border: 0;
    padding: 0;
  }

  .verse-actions button {
    padding-left: 0;
    padding-right: 10px;
    min-height: 24px;
  }

  .prose-hero {
    padding: 62px 0 42px;
  }

  .prose-hero h1 {
    font-size: clamp(2.5rem, 13vw, 4.2rem);
  }

  .prose-content p,
  .prose-content li {
    font-size: 1rem;
    line-height: 1.77;
  }

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

  .principles-grid article {
    min-height: 220px;
  }

  .callout-section {
    align-items: start;
    flex-direction: column;
  }

  .download-card {
    grid-template-columns: 1fr;
  }

  .file-icon {
    width: 64px;
    height: 74px;
  }

  .file-meta {
    gap: 18px;
    flex-wrap: wrap;
  }

  .schema-section {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .footer-inner {
    width: min(100% - 30px, 1180px);
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}