@font-face {
  font-family: Inter;
  src: url("assets/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  src: url("assets/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-0303, U+0305-0307, U+0309-0328, U+032A-036F, U+1D00-1DBF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}

:root {
  color-scheme: light;
  --page: #f8f8f2;
  --paper: #fffef9;
  --intro: #edf1e7;
  --footer: #eaf0e6;
  --ink: #182d24;
  --muted: #546459;
  --brand: #18382e;
  --header-text: #f3f6ec;
  --accent: #2c5b45;
  --accent-hover: #214737;
  --accent-text: #f8fbf5;
  --annotation: #075f91;
  --line: #d5ded1;
  --search-line: #b9cab9;
  --selection: #d6e7ce;
  --focus: #397c5a;
  --stage-sage: #dce7d9;
  --stage-linen: #ebe9dc;
  --stage-cedar: #dfe9e3;
  --stage-line: #718b763d;
  --serif: "Baskervville", "Baskerville", "Palatino Linotype", Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  --arabic: "DecoType Naskh", "Geeza Pro", "Noto Naskh Arabic", serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #17241e;
  --paper: #1f3027;
  --intro: #20362b;
  --footer: #1a2b22;
  --ink: #f2f2e7;
  --muted: #b7c8b8;
  --brand: #10241b;
  --accent: #a8c9ad;
  --accent-hover: #c0dcc2;
  --accent-text: #142c20;
  --annotation: #a1d2ee;
  --line: #405648;
  --search-line: #607969;
  --selection: #385f48;
  --focus: #9ac7ab;
  --stage-sage: #304438;
  --stage-linen: #3c4235;
  --stage-cedar: #2e4239;
  --stage-line: #a1c7a441;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--search-line) var(--page);
}

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 400 1rem/1.55 var(--sans);
  background: var(--page);
  color: var(--ink);
  accent-color: var(--accent);
}

::selection { background: var(--selection); color: var(--ink); }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
a, button, input { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; }
input { caret-color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, .book-title { font-family: var(--serif); font-weight: 500; }
img { display: block; max-width: 100%; }

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

.wrap {
  width: min(100% - 2 * clamp(1.1rem, 4.4vw, 3.5rem), 73.75rem);
  margin-inline: auto;
}

.icon {
  flex: 0 0 auto;
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 3;
  padding: .65rem 1rem;
  border-radius: 6px;
  color: var(--accent-text);
  background: var(--accent);
}

.site-header {
  color: var(--header-text);
  background: var(--brand);
  border-bottom: 1px solid #527360;
}

.site-header :focus-visible { outline-color: #c1e4bd; }

.header-inner {
  min-height: 4.15rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font: 500 clamp(1.25rem, 2.4vw, 1.5rem)/1.1 var(--serif);
  letter-spacing: -.01em;
  text-decoration: none;
}

.header-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.header-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #d7e5d8;
  font-size: .86rem;
  font-weight: 500;
  text-decoration: none;
}

.header-nav a:hover, .header-nav .nav-current { color: #fffef6; }
.header-nav a:hover { text-decoration: underline; }

.theme-toggle {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #688a74;
  border-radius: 50%;
  color: inherit;
  background: transparent;
}

.theme-toggle:hover { background: #cde5ce1c; }
.icon-sun, [data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  background: var(--intro);
  border-bottom: 1px solid var(--line);
}

.intro::before, .intro::after {
  position: absolute;
  z-index: -1;
  content: "";
  width: clamp(9rem, 23vw, 22rem);
  aspect-ratio: 1;
  top: 1.1rem;
  inset-inline-start: max(-2.8rem, calc((100vw - 100rem) / 2));
  background: url("assets/einband-ornament.webp") center / contain no-repeat;
  opacity: .40;
  pointer-events: none;
}

.intro::after {
  inset-inline-start: auto;
  inset-inline-end: max(-2.8rem, calc((100vw - 100rem) / 2));
  transform: scaleX(-1);
}

.intro-inner { padding-block: 1.95rem 2.45rem; }

.bismillah {
  color: var(--accent);
  font-family: var(--arabic);
  font-size: clamp(1.55rem, 3.25vw, 2.3rem);
  line-height: 1.5;
}

.intro h1 {
  margin-block-start: .12em;
  font-size: clamp(2.72rem, 7.5vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -.038em;
  text-wrap: balance;
}

.intro-description {
  margin: .8rem auto 1.55rem;
  max-width: 37rem;
  color: var(--muted);
  font-size: clamp(.91rem, 2vw, 1.04rem);
  text-wrap: pretty;
}

.search {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: min(100%, 35rem);
  min-height: 3.55rem;
  margin-inline: auto;
  padding: .33rem .35rem .33rem .95rem;
  border: 1px solid var(--search-line);
  border-radius: .75rem;
  background: var(--paper);
  box-shadow: 0 4px 11px #182d240c;
  text-align: start;
}

.search:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.search-icon { color: var(--accent); }

.search input {
  width: 100%;
  min-width: 0;
  appearance: none;
  padding: .45rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.search input::placeholder { color: var(--muted); opacity: 1; }

.search button, .primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .5rem 1.05rem;
  border: 0;
  border-radius: .5rem;
  background: var(--accent);
  color: var(--accent-text);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.search button:hover, .primary-link:hover { background: var(--accent-hover); }

.catalog {
  padding-block: 2.15rem 3.55rem;
  scroll-margin-top: .5rem;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: .8rem 1.25rem;
  padding-bottom: .67rem;
  border-bottom: 1px solid var(--line);
}

.catalog-head h2,
.site-footer h2 {
  font-size: clamp(1.95rem, 4.15vw, 2.9rem);
  line-height: 1.13;
  letter-spacing: -.028em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.filters button {
  min-height: 44px;
  padding: .42rem .78rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.filters button:hover { background: var(--intro); color: var(--ink); }

.filters button[aria-pressed="true"] {
  border-color: var(--line);
  color: var(--accent);
  background: var(--intro);
}

.catalog-count {
  min-height: 1.25rem;
  margin: .65rem 0 .86rem;
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.9rem 1.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.collection-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.collection-grid .book-stage { height: clamp(13rem, 26vw, 18rem); }
.catalog-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .65rem; color: var(--accent); font-size: .87rem; }

.book-link {
  display: block;
  height: 100%;
  border-radius: .8rem;
  text-decoration: none;
}

.book-stage {
  --stage: var(--stage-sage);
  height: clamp(10.6rem, 19vw, 13.9rem);
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--stage);
}

.book-stage[data-tone="linen"] { --stage: var(--stage-linen); }
.book-stage[data-tone="cedar"] { --stage: var(--stage-cedar); }

.book-stage::before, .book-stage::after {
  position: absolute;
  z-index: -1;
  inset: 12% 18% -10%;
  border: 1px solid var(--stage-line);
  border-radius: 50% 50% 0 0 / 76% 76% 0 0;
  content: "";
}

.book-stage::after { inset: 17% 21% -10%; }

.book-cover {
  width: auto;
  height: 82%;
  max-width: 83%;
  object-fit: contain;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 3px 8px 16px #1828204d, 1px 2px 2px #18282038;
  transition: transform .24s ease, box-shadow .24s ease;
}

.book-link:hover .book-cover, .book-link:focus-visible .book-cover {
  transform: translateY(-4px);
  box-shadow: 5px 13px 22px #1828204d, 1px 3px 3px #18282038;
}

.book-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .6rem;
  padding: .88rem .2rem 0;
}

.book-series {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 650;
  line-height: 1.45;
}

.book-title {
  margin-block: .25rem .17rem;
  font-size: clamp(1.4rem, 2.75vw, 1.91rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: pretty;
}

.book-author, #autor, .reader-speaker {
  color: var(--muted);
  font-size: .78rem;
}

.book-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: .27rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.book-link:hover .book-arrow, .book-link:focus-visible .book-arrow {
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
}

.empty-state {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  color: var(--muted);
  background: var(--paper);
}

.text-button {
  margin-top: .5rem;
  padding: .5rem 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .2em;
}

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

.footer-inner {
  min-height: 5.5rem;
  padding-block: 1.55rem 1.8rem;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-footer h2 { font-size: 1.9rem; }
.site-footer p { max-width: 57ch; margin-top: .45rem; color: var(--muted); font-size: .86rem; }

.to-top, .breadcrumb a, .footer-link {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 44px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.to-top:hover, .breadcrumb a:hover, .footer-link:hover { text-decoration: underline; }

.details-page { padding-block: 1.15rem 3.75rem; }

.breadcrumb { margin-bottom: 1rem; }

.book-detail {
  display: grid;
  grid-template-columns: minmax(14rem, .77fr) minmax(0, 1.23fr);
  gap: clamp(1.5rem, 6vw, 5rem);
  align-items: center;
}

.detail-stage { height: clamp(15rem, 29vw, 23rem); }
.detail-cover { height: 80%; }

.detail-caption h1 {
  margin-block: .28rem .75rem;
  font-size: clamp(2.5rem, 5.7vw, 4.65rem);
  line-height: .99;
  letter-spacing: -.038em;
  text-wrap: balance;
}

#autor, .reader-speaker { font-size: .92rem; }
.detail-caption .book-series { font-size: .88rem; }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .72rem;
  margin: 1rem 0 1.35rem;
  color: var(--muted);
  font-size: .86rem;
}

.detail-meta span + span::before { content: "·"; margin-inline-end: .72rem; }

.reader-work {
  margin: 3.5rem auto 0;
  scroll-margin-top: 1rem;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(12.5rem, 16rem) minmax(0, 48rem);
  justify-content: center;
  align-items: start;
  gap: 1.45rem;
}

.reader-flow {
  min-width: 0;
  display: grid;
  gap: 1.05rem;
}

.reader-index, .reader-about {
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--paper);
}

.reader-index {
  position: sticky;
  top: 1rem;
  z-index: 2;
}

.reader-index summary, .reader-about summary {
  min-height: 44px;
  padding: .72rem .9rem;
  color: var(--accent);
  font-size: .87rem;
  font-weight: 650;
  cursor: pointer;
}

.reader-index summary span {
  float: right;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 500;
}

.reader-index nav {
  max-height: calc(100vh - 4.9rem);
  max-height: calc(100dvh - 4.9rem);
  padding: .3rem .43rem .65rem;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border-top: 1px solid var(--line);
}

.reader-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reader-index nav a {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  align-items: baseline;
  padding: .51rem .45rem;
  border-radius: .35rem;
  font-size: .8rem;
  text-decoration: none;
}

.reader-index nav a:hover {
  background: var(--intro);
  text-decoration: underline;
}

.reader-index nav a:focus-visible { outline-offset: -2px; }
.reader-index-number { color: var(--accent); font-variant-numeric: tabular-nums; }

.reader-index nav .reader-index-jump {
  display: block;
  margin-inline-start: 1.8rem;
  color: var(--accent);
  font-size: .74rem;
}

.reader-index nav .reader-index-end {
  display: block;
  margin-top: .4rem;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}

.reader-about-text {
  padding: .2rem 1rem .95rem;
  color: var(--muted);
  font-size: .87rem;
}

.reader-about-text h3, .reader-about-text p + p {
  margin-top: .7rem;
}

.reader-about-alkafi > summary {
  padding: 1rem clamp(1rem, 3vw, 1.75rem);
  font-size: 1rem;
}

.reader-about-alkafi[open] > summary {
  border-bottom: 1px solid var(--line);
}

.reader-about-alkafi .reader-about-text {
  display: grid;
  gap: 1rem;
  max-width: 68ch;
  margin-inline: auto;
  padding: 1.5rem clamp(1rem, 3vw, 1.75rem) 1.75rem;
  color: var(--ink);
  font: 400 1rem/1.75 var(--sans);
  overflow-wrap: anywhere;
}

.reader-about-alkafi .reader-about-text p {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
}

.reader-about-alkafi .reader-about-text h3 {
  margin: 1.25rem 0 0;
  color: var(--accent);
  font: 650 1.08rem/1.45 var(--sans);
  text-wrap: balance;
}

.reader-about-alkafi .reader-about-text h3:first-child { margin-top: 0; }

.reader-about-alkafi .edition-note-list {
  display: grid;
  gap: .65rem;
  margin: -.25rem 0 0;
  padding-inline-start: 1.3rem;
}

.reader-about-alkafi .edition-note-list li { padding-inline-start: .25rem; }
.reader-about-alkafi .edition-note-list li::marker { color: var(--accent); }

.reader-about-alkafi .reader-about-text p[lang="ar"] {
  font: 400 1.65rem/1.8 var(--arabic);
  color: var(--accent);
}

.reader-about-alkafi .edition-note-opening {
  display: grid;
  gap: .65rem;
  margin-top: .5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.reader-about-alkafi .edition-note-opening .reader-original { margin: 0; }
.reader-about-alkafi .edition-note-opening .reader-label { margin-bottom: .35rem; color: var(--muted); font-size: .8rem; }
.reader-about-alkafi .edition-note-opening > p { color: var(--muted); }

.reader-chapter-ar {
  font: 400 1.55rem/1.7 var(--arabic);
}

.reader-disclosure {
  padding-inline: .9rem;
  color: var(--muted);
  font-size: .82rem;
}

.reader {
  min-width: 0;
  padding: clamp(1.2rem, 4vw, 3.1rem);
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--paper);
}

.reader, .reader [id] { scroll-margin-top: 1rem; }
.reader :is(li, p, a):target { background: var(--intro); }

.reader-heading h3, .reader-backmatter h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: .25rem 0 .4rem;
  font-size: clamp(1.9rem, 4.4vw, 2.75rem);
  line-height: 1.13;
}

.chain {
  margin: 1.3rem 0;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--muted);
  background: var(--intro);
  font-size: .86rem;
}

.chain summary { color: var(--ink); font-weight: 600; cursor: pointer; }
.chain p { margin-top: .5rem; }

.reader-editorial {
  margin: 1.1rem 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  color: var(--muted);
  font-size: .88rem;
}

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

.reader-section-heading {
  margin: 1.55rem 0 .5rem;
  font-family: var(--serif);
  font-size: clamp(1.32rem, 3vw, 1.72rem);
  font-weight: 600;
  line-height: 1.22;
}

.reader-label {
  margin-bottom: .42rem;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 650;
}

.reader-original { margin-top: 1.35rem; }

.reader-original p[lang="ar"] {
  font: 400 clamp(1.43rem, 3.4vw, 1.85rem)/1.95 var(--arabic);
}

.reader-translation {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.reader-translation p:not(.reader-label) { font: 400 clamp(1.2rem, 2.5vw, 1.43rem)/1.64 var(--serif); }
.reader-original p[lang="ar"] + p, .reader-translation p:not(.reader-label) + p { margin-top: .53em; }

.reader-translation blockquote {
  margin: .7rem 0 0;
  padding-inline-start: .85rem;
  border-inline-start: 2px solid var(--line);
}

.parallel-term { color: var(--annotation); }

.reader-notes {
  margin: .9rem 0 0;
  padding: .75rem 0 0 1.55rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

.reader-notes li + li { margin-top: .3rem; }
.reader-notes a, .reader sup a, .reader-backmatter a { color: var(--accent); }
.reader sup { line-height: 0; }
.note-return { margin-inline-start: .22rem; }

.reader-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .88rem;
}

.reader-table th, .reader-table td {
  padding: .6rem .65rem;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  text-align: start;
  vertical-align: top;
}

.reader-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--intro);
}
.reader-table thead th:first-child { width: 3.05rem; }
.reader-table tbody th { color: var(--muted); font-variant-numeric: tabular-nums; }
.reader-table p[lang="ar"] { font: 400 clamp(1.22rem, 2.7vw, 1.62rem)/1.62 var(--arabic); text-align: right; }
.reader-table p[lang="ar"] + p { margin-top: .22rem; }

.reader-backmatter > p, .source-pages { margin-top: .72rem; }
.reader-backmatter { overflow-wrap: anywhere; }

.source-pages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10.5rem, 100%), 1fr));
  gap: .34rem 1rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .86rem;
}

.edition-status { margin-top: 1.1rem; color: var(--muted); font-size: .88rem; max-width: 42rem; }
.chapter-reader .reader-index nav a { display: block; }
.chapter-reader .reader-index nav a.numbered-section { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .3rem; }
.chapter-reader .reader-index a[aria-current] { background: var(--intro); color: var(--accent); font-weight: 650; }
#kapiteltext { display: grid; gap: 1.05rem; min-width: 0; }
.chapter-reader .reader-heading h4 { margin: 0 0 .8rem; font: 650 1.05rem/1.55 var(--sans); color: var(--accent); }
.chapter-reader .reader-section-heading { margin-top: .5rem; }
.chapter-reader .reader > p[lang="ar"] { font: 400 1.6rem/1.8 var(--arabic); }
.chapter-navigation { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .7rem 1.2rem; padding: .65rem 0; font-size: .85rem; }
.chapter-navigation a { color: var(--accent); padding: .5rem 0; }
.chapter-navigation [data-chapter-position] { color: var(--muted); font-variant-numeric: tabular-nums; }
.reader-table-scroll { max-width: 100%; overflow-x: auto; }
.reader-source-link { margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.reader-index ol.reader-index-subsections { margin: 0 0 .6rem 1.8rem; }
.reader-index .reader-index-subsections a { font-size: .74rem; color: var(--muted); }
.prose-reader .reader-heading h4 { font: 500 clamp(1.32rem, 3vw, 1.72rem)/1.3 var(--serif); color: var(--ink); margin: 0 0 .8rem; }
.reader-prose { font-size: .9rem; overflow-wrap: anywhere; }
.reader-prose p + p { margin-top: .75rem; }

@media (max-width: 899px) {
  .reader-layout { display: block; }
  .reader-index { top: .5rem; margin-bottom: .75rem; }
  .reader-index nav { max-height: min(48vh, 24rem); }
  .reader-index nav a { padding-block: .65rem; }
  .reader, .reader [id] { scroll-margin-top: 4.25rem; }
  .reader-table thead th { top: 3.375rem; }
}

@media (max-width: 760px) {
  .header-inner { gap: .8rem; }
  .header-nav { gap: .8rem; }
  .header-nav .about-link { display: none; }
  .catalog-head { align-items: start; flex-direction: column; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .books.collection-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .collection-grid .book-stage { height: 14rem; }
  .header-inner { justify-content: space-between; min-height: 3.7rem; }
  .header-nav { display: none; }
  .wordmark img { width: 32px; height: 32px; }
  .intro-inner { padding-block: 1.45rem 1.9rem; }
  .intro::before, .intro::after { top: .6rem; opacity: .32; }
  .intro h1 { font-size: clamp(2.25rem, 11vw, 2.95rem); }
  .intro-description { margin: .63rem auto 1.3rem; }
  .search { gap: .45rem; padding-left: .65rem; }
  .search input { font-size: 1rem; }
  .search button { padding-inline: .73rem; font-size: .8rem; }
  .catalog { padding-block: 1.65rem 2.65rem; }
  .filters { gap: .15rem; }
  .filters button { padding-inline: .55rem; font-size: .76rem; }
  .books { gap: 1.5rem .8rem; }
  .book-stage { height: clamp(8.5rem, 43vw, 11rem); }
  .book-caption { gap: .3rem; padding: .75rem 0 0; }
  .book-title { font-size: 1.41rem; }
  .book-series { font-size: .68rem; }
  .book-author { font-size: .7rem; }
  .book-arrow { width: 24px; height: 24px; }
  .book-arrow .icon { width: .95rem; height: .95rem; }
  .footer-inner { flex-direction: column; gap: .65rem; }
  .book-detail { grid-template-columns: 1fr; }
  .detail-stage { height: clamp(13rem, 66vw, 17rem); }
  .reader-work { margin-top: 2.2rem; }
  .reader-table { font-size: .79rem; }
  .reader-table th, .reader-table td { padding: .48rem .35rem; }
  .reader-table thead th:first-child { width: 2.05rem; }
}

@media (max-width: 345px) {
  .book-caption { display: block; }
  .book-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.reader-about-alkafi .edition-dedication { text-align: center; padding-block: .25rem 1.25rem; border-bottom: 1px solid var(--line); }
.reader-about-alkafi .edition-dedication p + p { margin-top: .25rem; }
.reader-about-alkafi .edition-dedication p:last-child { color: var(--muted); }
