:root {
  color-scheme:light;
  --ink:#292a21;
  --green:#153c32;
  --paper:#fff9ec;
  --rule:#d8cbb0;
  --accent:#8e6332;
  background:#e6e2d7;
  color:var(--ink);
  font: 1rem/1.55 system-ui,sans-serif;
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; }
a { color:var(--green); text-underline-offset:.18em; }
a:focus-visible { outline:3px solid #9c6023; outline-offset:4px; }
[hidden] { display:none !important; }
.skip { position:absolute; inset:.5rem auto auto .5rem; padding:.6rem; transform:translateY(-150%); background:white; z-index:1; }
.skip:focus { transform:none; }
.masthead {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:.4rem 1.5rem;
  padding:.9rem max(5vw,calc((100vw - 74rem)/2));
  background:var(--green);
  color:#fff8e9;
}
.masthead a { color:inherit; }
.masthead>a { font:600 1.38rem Georgia,serif; text-decoration:none; }
.masthead nav,footer { display:flex; flex-wrap:wrap; gap:1.25rem; }
main { padding:clamp(1.1rem,5vw,4rem) 4vw 1.2rem; }
.bound-book {
  width:min(74rem,100%);
  margin:0 auto;
  padding:clamp(.45rem,1.1vw,.9rem);
  background:#553121;
  border:1px solid #3e271d;
  border-radius:.6rem 1.2rem 1.2rem .6rem;
  box-shadow:0 19px 35px #34261039, inset 0 0 0 1px #d3a66f60;
}
.leaves { position:relative; perspective:1400px; }
.leaf {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr);
  border-radius:.3rem .65rem .65rem .3rem;
  background:var(--paper);
  background-image:linear-gradient(90deg,transparent 43%,#c3a97c2d 44%,#eadbc2 44.1%,#f7ecda 45%,transparent 47%);
  box-shadow:0 3px 0 #daceb2,0 6px 0 #bca98a,0 8px 0 #e9d8b3;
  overflow:hidden;
  margin:0 0 1rem;
}
.book-ready .leaf { margin:0; }
.leaf > * { margin:0; padding:clamp(1.15rem,4vw,3rem); min-width:0; }
.cover {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-height:30rem;
  color:#fff4db;
  background:linear-gradient(120deg,#214a3b 0%,#102d25 100%);
  border:1px solid #744f2d;
  box-shadow:inset 0 0 0 8px #17382e,inset 0 0 0 9px #c6a66c;
}
.cover-mark { color:#dfbd80; font-size:1.7rem; }
h1, h2 { font-family:Georgia,serif; line-height:1.05; text-wrap:balance; }
h1 { font-size:clamp(2.15rem,5.1vw,4.5rem); margin:.7rem 0; letter-spacing:-.045em; }
h2 { font-size:clamp(1.85rem,3.8vw,3rem); margin:0 0 .8rem; letter-spacing:-.035em; }
.cover p { color:#ecd5ad; margin:.5rem 0 0; }
.contents ol { padding-left:2.2rem; margin:0; }
.contents li { padding:.55rem 0; border-bottom:1px solid var(--rule); }
.contents li::marker { color:var(--accent); font:700 .88rem Georgia,serif; }
.contents li a, .chapter-links a { font:700 clamp(1.06rem,1.8vw,1.26rem)/1.35 Georgia,serif; }
.chapter-number { color:#79562b; font-weight:700; margin:0 0 .8rem; }
.chapter-intro img { display:block; margin-top:1.2rem; width:100%; height:auto; aspect-ratio:16/9; object-fit:cover; border-radius:.25rem; }
.chapter-links { list-style:none; }
.chapter-links li { padding:.7rem 0; border-bottom:1px solid var(--rule); }
.chapter-links li:first-child { padding-top:0; }
.chapter-links p { margin:.22rem 0 0; }
.book-controls {
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:.65rem;
  padding:.95rem .15rem .25rem;
  color:#fff1d8;
}
.book-controls a { color:inherit; }
.book-controls>a {
  justify-self:start;
  display:grid;
  place-items:center;
  min-height:44px;
  padding:.5rem .8rem;
  background:#fff4db;
  color:#292a21;
  border-radius:.25rem;
  font-weight:650;
}
.book-controls>a:last-child { justify-self:end; }
.book-controls a[aria-disabled="true"] { opacity:.55; text-decoration:none; }
.book-location { display:flex; flex-direction:column; align-items:center; font-size:.9rem; }
.book-location span { white-space:nowrap; }
footer { justify-content:center; padding:1.3rem 4vw 2rem; }
.turn-forward { transform-origin:left center; animation:page-forward .38s ease-out; }
.turn-back { transform-origin:left center; animation:page-back .38s ease-out; }
@keyframes page-forward { from { transform:rotateY(-18deg) translateX(.5rem); opacity:.65; } }
@keyframes page-back { from { transform:rotateY(13deg) translateX(-.5rem); opacity:.65; } }
@media (max-width:45rem) {
  .leaf { display:block; background-image:none; }
  .cover { min-height:12.25rem; }
  .chapter-links { padding-top:0; }
  .chapter-intro img { max-height:10rem; }
}
@media (prefers-reduced-motion:reduce) {
  .turn-forward,.turn-back { animation:none; }
}
@media (max-width:45rem) {
  .book-controls {
    position:sticky;
    bottom:0;
    z-index:2;
    padding:.6rem .2rem;
    background:#553121;
    box-shadow:0 -2px #553121;
  }
}

.leaves { overflow-x: clip; }
@media (max-width:26rem) {
  .book-controls {
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    gap:.3rem;
    font-size:.88rem;
  }
  .book-controls>a {
    max-inline-size:100%;
    padding-inline:.4rem;
    overflow-wrap:anywhere;
    text-align:center;
  }
  .book-location { font-size:inherit; }
}
