:root {
  --paper: #e9ede4;
  --page: #f2f4ee;
  --ink: #1e3b32;
  --faded: #6d7f76;
  --gilt: #a8873a;
  --cloth: #16302a;
  --serif: "EB Garamond", Garamond, Georgia, serif;
}

* { box-sizing: border-box; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 19px; -webkit-font-smoothing: antialiased; font-variant-numeric: oldstyle-nums; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; }

.top { max-width: 1120px; margin: 0 auto; padding: 26px 24px 8px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 500; letter-spacing: .01em; text-decoration: none; font-variant: small-caps; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--gilt); stroke-width: 1.6; transform: translateY(4px); }
.top p { font-style: italic; color: var(--faded); }

/* The book, open on the table */

.spread {
  max-width: 1120px; margin: 28px auto 0; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--page); border-radius: 3px;
  box-shadow: 0 1px 0 #d5dbcf, 0 30px 60px -30px rgba(22, 48, 42, .45), inset 0 0 0 1px #dfe4d9;
}
.page { position: relative; padding: 56px clamp(28px, 4.5vw, 64px) 64px; min-height: 640px; }
.verso { background: linear-gradient(to left, rgba(30, 59, 50, .07), transparent 12%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.recto { background: linear-gradient(to right, rgba(30, 59, 50, .09), transparent 10%); }

.series { font-variant: small-caps; letter-spacing: .08em; color: var(--faded); font-size: 17px; }
h1 { font-weight: 400; font-size: clamp(38px, 4.4vw, 54px); line-height: 1.05; margin-top: 18px; text-wrap: balance; }
.author { font-style: italic; font-size: 21px; margin-top: 12px; }
.fleuron { color: var(--gilt); font-size: 26px; margin: 26px 0 22px; }

.cast-title { font-variant: small-caps; letter-spacing: .08em; color: var(--faded); font-size: 16px; }
.cast { list-style: none; padding: 0; margin-top: 10px; display: grid; gap: 10px; }
.cast li { display: flex; flex-direction: column; padding: 4px 16px; border-radius: 2px; transition: background-color .25s; }
.cast b { font-weight: 500; font-size: 20px; }
.cast span { font-style: italic; color: var(--faded); font-size: 16px; }
.cast li.speaking { background: rgba(168, 135, 58, .16); }

.play {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px;
  background: var(--cloth); color: #f2eddc; border: 1px solid var(--gilt); border-radius: 2px;
  padding: 12px 24px 12px 18px; font-size: 19px; letter-spacing: .02em; transition: background-color .15s;
}
.play:hover { background: var(--ink); }
.play svg { width: 18px; height: 18px; fill: var(--gilt); }
.icon-stop, .playing .icon-play { display: none; }
.playing .icon-stop { display: block; }
.length { font-style: italic; color: var(--faded); font-size: 16px; margin-top: 10px; min-height: 1.4em; }

.colophon { margin-top: auto; padding-top: 32px; font-size: 14.5px; font-style: italic; color: var(--faded); max-width: 34ch; }
.folio { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font-size: 15px; color: var(--faded); }

.running-head { text-align: center; font-variant: small-caps; letter-spacing: .1em; color: var(--faded); font-size: 15px; margin-bottom: 26px; }
.text { max-height: 560px; overflow-y: auto; padding-right: 6px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #cdd4c8 transparent; }
.text p { text-align: justify; hyphens: auto; line-height: 1.55; text-indent: 1.4em; }
.text p:first-child { text-indent: 0; }
.text p:first-child::first-letter { float: left; font-size: 3.7em; line-height: .8; color: var(--gilt); margin: .08em .08em 0 0; }
.part { border-radius: 2px; transition: background-color .25s; }
.part.now { background: rgba(168, 135, 58, .14); box-shadow: 0 0 0 3px rgba(168, 135, 58, .14); }
.playing .part:not(.now):not(.read) { color: var(--faded); }
.part.now .word { color: var(--faded); }
.part.now .word.said { color: var(--ink); }

.foot { max-width: 1120px; margin: 0 auto; padding: 22px 24px 40px; text-align: center; font-size: 15px; }
.foot a { color: var(--gilt); text-decoration: none; font-variant: small-caps; letter-spacing: .06em; font-size: 17px; }

@media (max-width: 820px) {
  .spread { grid-template-columns: 1fr; margin: 16px 12px 0; }
  .page { min-height: 0; padding: 40px 24px 56px; }
  .verso { background: none; border-bottom: 1px solid #dfe4d9; }
  .recto { background: none; }
  .colophon { margin-top: 24px; }
  .text { max-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  .text { scroll-behavior: auto; }
  .part, .cast li { transition: none; }
}
