:root {
  color-scheme: light;
  --ink: #202020;
  --muted: #6b6258;
  --rule: #d8d1c8;
  --paper: #fbfaf7;
  --accent: #6d1f18;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}
main, header, nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem;
}
header {
  padding-top: 2.5rem;
  border-bottom: 1px solid var(--rule);
}
h1, h2 {
  font-weight: 500;
  line-height: 1.15;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); margin: 0; }
h2 { font-size: 1.55rem; margin-top: 2rem; }
.subtitle, .meta { color: var(--muted); }
.meta { font-size: 0.95rem; }
.toc {
  columns: 3 12rem;
  column-gap: 2rem;
  padding-left: 1.2rem;
}
.toc li { break-inside: avoid; margin: 0.15rem 0; }
a { color: var(--accent); text-decoration-thickness: 0.06em; text-underline-offset: 0.14em; }
.navline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 1rem 0 2rem;
  padding: 0.7rem 0;
  font-size: 0.95rem;
}
article {
  font-size: 1.13rem;
}
article p { margin: 0 0 0.85rem; }
article h2 {
  border-top: 1px solid var(--rule);
  font-size: 1.35rem;
  margin: 1.65rem 0 0.8rem;
  padding-top: 1rem;
}
blockquote {
  margin: 1rem 0 1rem 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  font-style: italic;
}
.smallcaps { font-variant: small-caps; letter-spacing: 0.02em; }
.synopsis p { margin-left: var(--indent, 0); }
footer {
  max-width: 860px;
  margin: 2rem auto 0;
  padding: 1.25rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}

.continuous-text .smallcaps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0;
}


html { scroll-behavior: smooth; }
.reader-header { max-width: 1180px; }
main.reading-layout {
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 860px);
  gap: 2rem;
  align-items: start;
}
.reader-column { min-width: 0; }
.section-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 2rem);
  min-height: 22rem;
  padding: 0.25rem 1rem 0.5rem 0;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}
.sidebar-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.sidebar-current {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
}
.sidebar-position {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.sidebar-progress {
  flex: 0 0 3px;
  margin: 0.75rem 0;
  overflow: hidden;
  background: var(--rule);
}
.sidebar-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}
.sidebar-actions {
  max-width: none;
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}
.section-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.1rem;
  min-height: 0;
  margin: 0;
  padding: 0 0.35rem 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--rule) transparent;
  scrollbar-width: thin;
}
.section-list a {
  display: block;
  min-width: 0;
  padding: 0.24rem 0.2rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.section-list a:hover,
.section-list a:focus-visible {
  color: var(--accent);
  background: #f2eee8;
}
.section-list a[aria-current="location"] {
  border-left-color: var(--accent);
  color: var(--ink);
  background: #eee8e0;
  font-weight: 600;
}
.continuous-text h2 { scroll-margin-top: 1rem; }

@media (max-width: 900px) {
  main.reading-layout {
    display: block;
    max-width: 860px;
    padding-top: 0;
  }
  .section-sidebar {
    top: 0;
    z-index: 10;
    height: auto;
    min-height: 0;
    margin: 0 -1.25rem 1.25rem;
    padding: 0.65rem 1.25rem 0.45rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
  .sidebar-status { justify-content: flex-start; }
  .sidebar-progress { margin: 0.5rem 0; }
  .sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .section-list {
    display: flex;
    gap: 0.2rem;
    padding: 0 0 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .section-list li { flex: 0 0 auto; }
  .section-list a {
    min-width: 2.75rem;
    padding: 0.3rem 0.35rem;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .section-list a[aria-current="location"] {
    border-bottom-color: var(--accent);
  }
  .continuous-text h2 { scroll-margin-top: 8.5rem; }
}

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