:root {
  --bg: #f7f3ee;
  --paper: #fffdf9;
  --ink: #241d18;
  --muted: #6c5d53;
  --line: #ddd3c8;
  --accent: #3d2f25;
  --shadow: 0 14px 40px rgba(25, 16, 10, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f3eee8 0%, #f9f6f1 100%);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  line-height: 1.72;
}

a {
  color: #3b3028;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

a:hover {
  color: #000;
}

.reading-frame {
  max-width: 880px;
  margin: 0 auto;
}

.cover-page {
  margin-bottom: 3rem;
}

.cover-card {
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow);
  border-radius: 26px;
  padding: 1.4rem;
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.cover-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.book-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cycle-mark,
.series-side {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.cycle-mark {
  margin: 0 0 0.9rem;
}

.cover-meta h1,
.title-page h1 {
  font-size: 3.2rem;
  line-height: 1.02;
  margin: 0;
}

.subtitle {
  font-size: 1.35rem;
  color: var(--muted);
  margin-top: 0.8rem;
}

.author {
  margin-top: 1.2rem;
  font-weight: 700;
}

.series-side {
  margin: 0.7rem 0 0;
}

.series-note {
  max-width: 30rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.front-matter {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 3rem;
}

.title-page,
.copyright-page,
.dedication-page,
.chapter-header,
.subchapter {
  background: var(--paper);
  border-radius: 20px;
  padding: 2rem 2rem 2.2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.title-page,
.dedication-page {
  text-align: center;
}

.copyright-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 10rem;
}

.copyright-page p {
  margin: 0.4rem 0;
}

.copyright-page a {
  display: inline-block;
}

.chapter {
  margin: 4rem 0 5rem;
}

.chapter-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  border-radius: 22px;
  margin-bottom: 2rem;
}

.chapter-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--muted);
}

.chapter-title {
  margin: 0.4rem 0 0;
  font-size: 2.7rem;
  line-height: 1.08;
}

.chapter-epigraph,
.section-epigraph {
  margin: 1rem auto 0;
  max-width: 42rem;
  font-style: italic;
  color: var(--muted);
}

.subchapter {
  margin: 1.25rem 0;
}

.subchapter-head {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 1.25rem;
}

.subchapter h3 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

.subchapter hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1rem 0 0;
}

.subchapter p {
  font-size: 1.06rem;
  margin: 0 0 1em;
  text-align: justify;
  hyphens: auto;
}

.subchapter p:last-child {
  margin-bottom: 0;
}

.ending {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 4rem 0 2rem;
  color: var(--muted);
}

.closing-note {
  margin: 0 auto 3rem;
  max-width: 37rem;
  text-align: center;
  color: var(--muted);
}

.closing-note p {
  margin: 0.7rem 0 0;
  font-size: 0.98rem;
  line-height: 1.68;
}

.closing-note p:first-child {
  margin-top: 0;
}

.closing-note a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}
