@font-face {
  font-family: Cormorant;
  src: url("./cormorant.037acd7ddde5bbf0.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif TC";
  src: url("./noto-serif-tc.eb62f6f0323db1d5.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
:root {
  --paper: #faf5e9;
  --ink: #26251f;
  --muted: #756e5e;
  --red: #c83e2d;
  --gold: #ecd092;
  --rule: #ded4bf;
  --serif: Cormorant, Georgia, serif;
  --chinese: "Noto Serif TC", "Songti TC", serif;
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 36px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) {
  overflow: hidden;
}
button,
input {
  font: inherit;
}
a {
  color: inherit;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button {
  border: 0;
  background: none;
}
button,
a {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.25;
  cursor: default;
}
a,
button {
  transition:
    color 0.25s,
    background 0.25s,
    transform 0.25s,
    opacity 0.25s;
}
a:hover,
button:hover:not(:disabled) {
  color: var(--red);
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
}
::selection {
  background: #e9c897;
  color: #28251e;
}
[hidden] {
  display: none !important;
}
.eyebrow {
  font:
    10px/1.5 system-ui,
    sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.attribution {
  text-align: center;
  font-size: 16px;
  color: var(--muted);
}
.attribution a {
  font-weight: 600;
}
.masthead {
  height: 94px;
  max-width: 1440px;
  margin: auto;
  padding: 0 6%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
  z-index: 1;
}
.wordmark {
  display: flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
  font: 18px var(--chinese);
  letter-spacing: 0.16em;
}
.wordmark img {
  object-fit: contain;
}
.text-button {
  font-size: 18px;
  min-height: 44px;
  justify-self: end;
}
.text-button span {
  margin-left: 16px;
  color: var(--red);
}
.cover {
  max-width: 1440px;
  margin: auto;
  text-align: center;
  padding: 42px 6% 0;
  position: relative;
}
.cover-chinese {
  font: 23px var(--chinese);
  color: var(--red);
  letter-spacing: 0.4em;
  margin: 0 0 20px;
}
.cover h1 {
  font-size: clamp(76px, 10.7vw, 160px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.95;
  margin: 0;
}
.cover-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  margin-bottom: 42px;
}
.cover-meta .eyebrow {
  min-width: 140px;
}
.cover-meta .eyebrow:first-child {
  text-align: right;
}
.cover-meta .eyebrow:last-child {
  text-align: left;
}
.small-seal {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--red);
  width: 31px;
  height: 35px;
  font: 21px var(--chinese);
  transform: rotate(-3deg);
  border-radius: 2px;
}

.begin {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  font-size: 21px;
  text-decoration: none;
  padding: 12px 0;
}
.begin span {
  color: var(--red);
  transition: transform 0.3s;
}
.begin:hover span {
  transform: translateY(4px);
}

.resume {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--red);
}

.book {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 28px;
}
.chapter {
  padding: 105px 0 90px;
  scroll-margin-top: 0;
}
.chapter-heading {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  column-gap: 64px;
  align-items: end;
  padding-bottom: 35px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.chapter-heading:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 38px;
  height: 3px;
  background: var(--red);
}
.chapter-heading h2 {
  font-size: 25px;
  font-weight: 400;
  margin: 0;
}
.chapter-heading h2 a {
  text-decoration: none;
  display: block;
}
.chapter-heading .chinese-heading {
  font: 20px var(--chinese);
  color: var(--red);
  letter-spacing: 0.15em;
}
.chapter-number {
  font: 10px system-ui;
  letter-spacing: 0.16em;
  color: var(--muted);
  position: absolute;
  right: 0;
  bottom: 40px;
}
.verse {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  column-gap: 64px;
  margin: 0;
  padding: 9px 0;
  align-items: baseline;
}
.verse .chinese {
  font: 400 clamp(23px, 2.1vw, 29px) / 1.8 var(--chinese);
  letter-spacing: 0.045em;
}
.verse .english {
  font-size: clamp(26px, 2.5vw, 33px);
  line-height: 1.42;
}
.verse {
  border-radius: 3px;
  transition: background 0.5s;
}
.verse:hover {
  background: #e9dfcb40;
}
.chapter-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  margin: 68px auto 0;
  color: var(--red);
}
.chapter-end:before,
.chapter-end:after {
  content: "";
  height: 1px;
  width: 36px;
  background: var(--rule);
}
.chapter-end span {
  width: 5px;
  height: 5px;
  background: var(--red);
  transform: rotate(45deg);
}
.colophon {
  text-align: center;
  padding: 50px 24px 180px;
  max-width: 780px;
  margin: auto;
}
.colophon img {
  object-fit: contain;
  opacity: 0.8;
}
.end-title {
  font-size: 48px;
  margin: 22px 0 10px;
}
.source-note {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 60px;
}
.source-links {
  font-size: 15px;
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--muted);
}
.reading-nav {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 328px;
  display: flex;
  align-items: center;
  border: 1px solid #d5c8b2;
  border-radius: 6px;
  background: #faf5e9ed;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 35px #42301915;
  z-index: 10;
  padding: 8px;
  overflow: hidden;
}
.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 27px;
  border-radius: 4px;
}
.icon-button:hover:not(:disabled) {
  background: #e8ddc770;
}
.icon-button:active:not(:disabled) {
  transform: scale(0.93);
}
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.chapter-control {
  position: relative;
  text-align: left;
  flex: 1;
  min-height: 46px;
  padding: 3px 26px 3px 13px;
}
#current-chapter {
  font-size: 18px;
}
.chapter-control svg {
  position: absolute;
  right: 8px;
  top: 18px;
  fill: none;
  stroke: currentColor;
  width: 13px;
}

.reading-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #dfd3bd80;
}
.reading-progress span {
  height: 100%;
  background: var(--red);
  display: block;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  padding: 15px;
  background: var(--paper);
  z-index: 100;
}
.skip-link:focus {
  top: 10px;
}
dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(740px, 85dvh);
  padding: 32px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 100px #1e191c40;
}
dialog[open] {
  animation: unfold 0.3s ease both;
}
dialog::backdrop {
  background: #28221966;
  backdrop-filter: blur(5px);
  animation: appear 0.3s;
}
.index-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.index-heading h2 {
  font-size: 42px;
  font-weight: 500;
  margin: 0 0 22px;
}
.index-heading .icon-button {
  align-self: flex-start;
}
.search-label {
  font: 11px system-ui;
  color: var(--muted);
}
#chapter-search {
  width: 100%;
  display: block;
  margin: 8px 0 17px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fffaf2;
  padding: 13px 15px;
  font-size: 20px;
  color: var(--ink);
}
.index-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 11px system-ui;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.index-meta span:first-child {
  font-family: var(--chinese);
}
.chapter-list {
  margin-top: 6px;
}
.index-link {
  display: grid;
  grid-template-columns: 35px 1fr 75px;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  padding: 16px 8px;
  border-bottom: 1px solid #ded4bf80;
  border-radius: 2px;
}
.index-link:hover,
.index-link[aria-current="true"] {
  background: #eee2cc70;
}
.index-link[aria-current="true"] {
  color: var(--red);
}
.index-number {
  font: 11px system-ui;
  color: var(--red);
}
.index-excerpt {
  font-size: 21px;
  line-height: 1.2;
}
.index-chinese {
  font: 12px var(--chinese);
  text-align: right;
  color: var(--muted);
}
.no-results {
  text-align: center;
  padding: 35px 0;
  font-size: 20px;
}
.no-script {
  text-align: center;
  padding: 20px;
}
@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (min-width: 1400px) {
  .book {
    max-width: 1070px;
  }
  .chapter-heading,
  .verse {
    grid-template-columns: 1fr 1.35fr;
    column-gap: 80px;
  }
}
@media (max-width: 700px) {
  :root {
    scroll-padding-top: 22px;
  }
  .attribution {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 15px;
    padding: 3px 0 14px;
  }
  .masthead {
    height: auto;
    min-height: 103px;
    padding: 14px 23px 0;
    grid-template-columns: 1fr 1fr;
  }

  .wordmark {
    font-size: 16px;
    gap: 9px;
  }
  .wordmark img {
    width: 35px;
    height: 35px;
  }
  .text-button {
    font-size: 17px;
  }
  .cover {
    padding: 32px 22px 0;
  }
  .cover-chinese {
    font-size: 20px;
    margin-bottom: 23px;
  }
  .cover h1 {
    font-size: clamp(60px, 13vw, 92px);
    letter-spacing: -0.05em;
  }
  .cover-meta {
    gap: 15px;
    margin-bottom: 31px;
  }
  .cover-meta .eyebrow {
    min-width: 0;
    font-size: 8px;
    letter-spacing: 0.14em;
  }
  .small-seal {
    width: 25px;
    height: 29px;
    font-size: 17px;
  }

  .begin {
    font-size: 20px;
  }

  .resume {
    font-size: 14px;
  }
  .book {
    padding: 0 27px;
  }
  .chapter {
    padding: 76px 0 45px;
  }
  .chapter-heading {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 22px;
  }
  .chapter-heading h2 {
    font-size: 24px;
    text-align: right;
  }
  .chapter-heading .chinese-heading {
    font-size: 19px;
    letter-spacing: 0.08em;
  }
  .chapter-number {
    display: none;
  }
  .verse {
    display: block;
    padding: 0 0 25px;
  }
  .verse .chinese {
    display: block;
    font-size: 25px;
    line-height: 1.65;
    letter-spacing: 0.025em;
    margin-bottom: 5px;
  }
  .verse .english {
    display: block;
    font-size: 28px;
    line-height: 1.34;
    color: #514a3e;
  }
  .chapter-end {
    margin-top: 30px;
  }
  .reading-nav {
    width: min(320px, calc(100% - 28px));
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .colophon {
    padding-bottom: 150px;
  }
  .end-title {
    font-size: 41px;
  }
  dialog {
    padding: 24px;
    max-height: 85dvh;
  }
  .index-heading h2 {
    font-size: 37px;
  }
  .index-link {
    grid-template-columns: 25px 1fr 64px;
    gap: 8px;
  }
  .index-excerpt {
    font-size: 19px;
  }
  .index-chinese {
    font-size: 11px;
  }
  .source-links {
    gap: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.chapter-heading h2:focus,
#book-title:focus {
  outline: none;
}
@media (max-width: 700px) {
  .reading-nav .icon-button {
    width: 40px;
    height: 44px;
  }
  .chapter-control {
    padding-left: 8px;
    padding-right: 20px;
  }
  #current-chapter {
    font-size: 17px;
    white-space: nowrap;
  }
}

/* A continuous, low-contrast drawing behind the entire reading surface. */
.margin-art {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}
@media (max-width: 700px) {
  .masthead .text-button {
    grid-column: 2;
    grid-row: 1;
  }
  .cover {
    padding-top: 29px;
  }
}
