
:root {
  --bg: #f7f3ec;
  --paper: #fffdf9;
  --text: #1c1917;
  --muted: #57534e;
  --accent: #6b3a1f;
  --accent-soft: #efe2d5;
  --border: #e7ddd0;
  --sidebar-w: 17.5rem;
  --header-h: 3.5rem;
  --max-text: 42rem;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
}
@font-face {
  font-family: "Noto Sans Deseret";
  src: url("../fonts/NotoSansDeseret-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  unicode-range: U+10400-1044F;
}
@font-face {
  font-family: "Gentium Plus";
  src: url("../fonts/GentiumPlus-Regular.woff2") format("woff2"),
       url("../fonts/GentiumPlus-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gentium Plus";
  src: url("../fonts/GentiumPlus-Bold.woff2") format("woff2"),
       url("../fonts/GentiumPlus-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gentium Plus";
  src: url("../fonts/GentiumPlus-Italic.woff2") format("woff2"),
       url("../fonts/GentiumPlus-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #4a2814; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: linear-gradient(160deg, #3d2314 0%, #6b3a1f 70%, #8a5230 100%);
  color: #fff8f0;
  box-shadow: var(--shadow);
}
.site-header a { color: #fff8f0; text-decoration: none; }
.site-header .brand {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .brand span { opacity: 0.85; font-weight: 400; }
.nav-toggle {
  display: none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
  font: inherit;
  cursor: pointer;
}
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h));
}
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: auto;
  background: var(--paper);
  border-right: 1px solid var(--border);
  padding: 1.1rem 0.9rem 2rem;
}
.sidebar h2 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-weight: 600;
}
.toc { list-style: none; margin: 0; padding: 0; }
.toc > li { margin: 0.15rem 0; }
.toc a {
  display: block;
  padding: 0.28rem 0.5rem;
  border-radius: 0.35rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
  font-family: system-ui, -apple-system, sans-serif;
}
.toc a:hover { background: var(--accent-soft); color: var(--accent); }
.toc a.active {
  background: var(--accent);
  color: #fff8f0;
}
.toc .sub {
  list-style: none;
  margin: 0.1rem 0 0.4rem;
  padding: 0 0 0 0.55rem;
  border-left: 2px solid var(--border);
}
.toc .sub a {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.18rem 0.45rem;
}
.toc .sub a:hover { color: var(--accent); }
.toc .sub a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.main {
  padding: 1.75rem 1.5rem 4rem;
}
.article {
  max-width: calc(var(--max-text) + 4rem);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem 2.5rem;
}
.article > header {
  border-bottom: 1px solid var(--border);
  margin: 0 0 1.5rem;
  padding: 0 0 1rem;
}
.article > header .eyebrow {
  margin: 0 0 0.35rem;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.article > header h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.25;
  color: var(--accent);
  font-weight: 650;
}
.content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
  color: var(--accent);
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
.content h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 1.12rem;
  color: #4a2814;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
.content h4.notes-h {
  margin: 1.25rem 0 0.4rem;
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
}
.content p.body { margin: 0.7rem 0; }
.deseret {
  font-family: "Noto Sans Deseret", "Segoe UI Symbol", "Noto Sans", sans-serif;
  font-size: 1.15em;
  letter-spacing: 0.03em;
}
.ipa {
  font-family: "Gentium Plus", "Doulos SIL", "Charis SIL", serif;
}
.b { font-weight: bold; }
.i { font-style: italic; }
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
}
table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.doc-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  vertical-align: top;
}
table.doc-table tr:nth-child(odd) td { background: #faf6f0; }
table.doc-table tr:nth-child(even) td { background: #fff; }
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
}
.pager a {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 45%;
  text-decoration: none;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.pager a:hover { border-color: var(--accent); background: var(--accent-soft); }
.pager a .dir {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.pager a.next { margin-left: auto; text-align: right; }
.home-hero {
  text-align: center;
  padding: 1rem 0 0.5rem;
}
.home-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: var(--accent);
  line-height: 1.25;
}
.home-hero .byline { margin: 0; color: var(--muted); }
.home-hero .rev {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}
.home-note {
  margin: 1.5rem 0;
  padding: 0.9rem 1rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 0.4rem 0.4rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.onpage-toc {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: #faf6f0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: system-ui, sans-serif;
}
.onpage-toc h2 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.onpage-toc ul { list-style: none; margin: 0; padding: 0; }
.onpage-toc li { margin: 0.2rem 0; }
.onpage-toc li.l3 { margin-left: 0.85rem; font-size: 0.92em; }
.onpage-toc a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}
.onpage-toc a:hover { color: var(--accent); }
.onpage-toc .num { color: var(--muted); margin-right: 0.25rem; }
.sep { color: var(--border); margin: 0 0.15rem; user-select: none; }
.toc-page { margin: 1.5rem 0 0; }
.toc-page h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  color: var(--accent);
}
.toc-page ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-page > ol > li {
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.toc-page > ol > li > a {
  font-size: 1.08rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--accent);
}
.toc-page .sec-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0 0 0 0.75rem;
  border-left: 2px solid var(--border);
}
.toc-page .sec-list li { margin: 0.25rem 0; }
.toc-page .sec-list a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}
.toc-page .sec-list a:hover { color: var(--accent); }
.toc-page .sec-list .num {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.85em;
  margin-right: 0.35rem;
}
.site-footer {
  max-width: calc(var(--max-text) + 4rem);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: system-ui, sans-serif;
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: min(20rem, 88vw);
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,0.25);
    z-index: 25;
  }
  .article { padding: 1.35rem 1.1rem 2rem; border-radius: 0; border-left: 0; border-right: 0; }
  .main { padding: 0 0 3rem; }
}
