:root {
  color-scheme: light;
  --ink: #283e34;
  --moss: #456858;
  --rust: #a95139;
  --desk: #e9ebdf;
  --paper: #fff9eb;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100svh;
  background:
    url(grain.png),
    radial-gradient(ellipse at 43% 24%, #f5f3e8 2%, var(--desk) 65%, #dbe1d3);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid #a65634;
  outline-offset: 4px;
}
main {
  width: min(1240px, 90%);
  margin: auto;
  padding: 22px 0 26px;
}
.edition {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 13px;
  margin: 0 0 clamp(19px, 3vh, 32px);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  font-weight: 650;
  text-transform: uppercase;
  color: #576b5d;
  text-align: center;
}
.edition span {
  width: 34px;
  height: 1px;
  background: #9aaa94;
}
.book {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(480px, min(57vw, 73svh), 730px);
  border-radius: 7px 10px 12px 6px;
}
.book:before {
  content: "";
  position: absolute;
  inset: -3px -6px -9px;
  box-shadow:
    0 2px 1px #9c9278,
    0 4px 0 #faf1db,
    0 5px 1px #afa386,
    0 7px 0 #f5ead1,
    0 9px 1px #ad9f84,
    0 12px 0 2px #607868,
    0 14px 2px 2px #536855,
    4px 25px 24px -9px #45594361,
    7px 44px 55px -22px #4e604a61;
  background: #607967;
  border-radius: 10px 12px 8px 8px;
  z-index: -1;
}
.leaf {
  position: relative;
  min-width: 0;
}
.words {
  background:
    url(grain.png),
    linear-gradient(90deg, #fdf8e9, #fffbee 73%, #f5efde 96%, #d2c7ad);
  border-radius: 6px 0 0 5px;
  padding: clamp(31px, 4.2vw, 66px) clamp(34px, 4.5vw, 76px);
  display: flex;
  flex-direction: column;
}
.chapter-meta {
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  font-weight: 650;
  color: var(--rust);
}
.chapter-meta i {
  width: 24px;
  height: 2px;
  background: var(--rust);
  margin-right: 4px;
}
.chapter-meta b {
  font-weight: inherit;
}
.story {
  margin: auto 0;
  padding: 14px 0 24px;
}
.story h1 {
  font: normal clamp(3.45rem, 6.05vw, 6.5rem)/0.95 var(--serif);
  letter-spacing: -0.065em;
  margin: 0;
  max-width: 100%;
  text-wrap: balance;
}
.story h1 em {
  display: block;
  color: var(--rust);
  font-weight: 400;
  letter-spacing: -0.06em;
}
.rule {
  height: 1px;
  width: 40px;
  background: #bd977e;
  margin: clamp(14px, 1.8vw, 29px) 0;
}
.story p {
  font-size: clamp(1rem, 1.18vw, 1.24rem);
  line-height: 1.6;
  letter-spacing: -0.012em;
  max-width: 41ch;
  margin: 0;
  color: #415046;
}
.picture {
  background: radial-gradient(
    ellipse at 60% 43%,
    #fffbee,
    #fcf6e6 82%,
    #eee4ce
  );
  border-radius: 0 8px 9px 0;
  display: grid;
  align-items: center;
  overflow: hidden;
}
.picture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url(grain.png);
  pointer-events: none;
  opacity: 0.8;
}
.picture canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 5.5%;
  transform: translateX(-40%);
  background: linear-gradient(
    90deg,
    transparent,
    #8b785315 27%,
    #695a3d32 39%,
    #fff5dc60 43%,
    #a2937020 55%,
    transparent
  );
  pointer-events: none;
}
.ribbon {
  position: absolute;
  z-index: 0;
  bottom: -28px;
  right: 8%;
  background: #bc7357;
  width: 24px;
  height: 35px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.folio {
  position: absolute;
  bottom: 17px;
  font: italic 0.82rem var(--serif);
  color: #8a8674;
}
.left-folio {
  left: 8%;
}
.right-folio {
  right: 7%;
}
.controls {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 38px auto 0;
  width: 100%;
  padding: 0 2px;
}
.position {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #687a6b;
}
.position strong {
  font: normal 1.65rem var(--serif);
  color: var(--ink);
}
.position span {
  font-size: 0.75rem;
}
.actions {
  display: flex;
  gap: 9px;
  margin-left: auto;
  align-items: center;
}
.back,
.next {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 30px;
  height: 44px;
}
.back {
  width: 44px;
}
.back {
  border: 1px solid #788b794d;
  background: #f8f9f044;
}
.back:disabled {
  opacity: 0.38;
  cursor: default;
}
.next {
  gap: 16px;
  background: var(--ink);
  color: #fffdef;
  border: none;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 560;
}
.next:hover {
  background: #426650;
}
.chev {
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.prev {
  transform: rotate(-135deg);
}
.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (max-width: 850px) {
  main {
    width: 91%;
  }
  .words {
    padding: 32px 27px 40px;
  }
  .story h1 {
    font-size: clamp(2.9rem, 6.7vw, 4.4rem);
  }
  .story p {
    font-size: 1rem;
  }
  .controls {
    gap: 12px;
  }
}
@media (max-width: 650px) {
  .edition {
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    margin: 22px 0 16px;
  }
  .book {
    height: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .words {
    order: 2;
    padding: 18px 26px 32px;
    background: url(grain.png), linear-gradient(#f2e9d6, #fff9e9 12%);
    border-radius: 0 0 7px 7px;
  }
  .picture {
    order: 1;
    height: clamp(180px, 50vw, 280px);
    border-radius: 7px 7px 0 0;
  }
  .spine {
    display: none;
  }
  .story {
    padding: 12px 0 0;
    margin: 0;
  }
  .story h1 {
    font-size: clamp(2.65rem, 10vw, 3.7rem);
    line-height: 1;
  }
  .story h1 em {
    display: inline;
  }
  .rule {
    margin: 13px 0;
  }
  .story p {
    line-height: 1.45;
  }
  .left-folio {
    bottom: 8px;
    left: auto;
    right: 18px;
  }
  .right-folio {
    display: none;
  }
  .controls {
    margin-top: 29px;
    gap: 8px;
  }
  .position {
    gap: 4px;
  }
  .next {
    padding: 0 16px;
    gap: 10px;
  }
  .actions {
    gap: 6px;
  }
  .back {
    width: 38px;
  }
}
@media (max-width: 365px) {
  .story h1 {
    font-size: 2.45rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

body {
  display: flex;
  align-items: center;
}
.words {
  padding-bottom: clamp(34px, 4.3vw, 76px);
}
@media (max-width: 650px) {
  main {
    padding: 8px 0 20px;
  }
  .words {
    padding-bottom: 34px;
  }
}

/* The closed volume occupies one half of the spread, centred on the desk. */
.book {
  --binding: 50%;
}
.book.closed {
  transform: translateX(-25%);
}
.book.closed::before,
.book.cover-motion::before {
  left: calc(var(--binding) - 5px);
}
.book.closed .spine,
.book.cover-motion .spine,
.book.closed .words,
.book.cover-motion .words {
  visibility: hidden;
}
.book.closed .picture {
  visibility: hidden;
}
.cover {
  position: absolute;
  z-index: 3;
  inset: 0 0 0 var(--binding);
  display: grid;
  padding: clamp(17px, 2.8vw, 35px);
  border: 0;
  border-radius: 4px 10px 11px 4px;
  text-align: center;
  color: #ffefd0;
  overflow: hidden;
  background:
    url(grain.png),
    linear-gradient(
      90deg,
      #284e49 0%,
      #335e53 2.2%,
      #597d68 3.3%,
      #355d51 4.2%,
      #3c675a 9%,
      #507562 72%,
      #456955 100%
    );
  box-shadow:
    inset 1px 1px 2px #adc09b88,
    inset -2px -2px 4px #27463888;
  transform-origin: left center;
}
.cover[hidden] {
  display: none;
}
.cover-frame {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 8px;
  border: 1px solid #cdba865e;
  outline: 1px solid #c6b58b30;
  outline-offset: -5px;
  padding: clamp(18px, 2.4vw, 33px) 8px;
}
.cover-edition,
.open-label {
  font: 600 0.76rem var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.cover-edition {
  color: #e4d6ac;
}
.cover-title {
  font: normal clamp(4rem, 7.6vw, 7.6rem)/0.98 var(--serif);
  letter-spacing: -0.075em;
  text-shadow: 0 2px 0 #244b3e;
}
.cover-title em {
  display: block;
  color: #f4d594;
  font-weight: 400;
}
.open-label {
  padding: 9px 2px 6px;
  border-bottom: 1px solid #d6c597a6;
  letter-spacing: 0.16em;
  color: #fff3d8;
}
.cover-art {
  position: relative;
  isolation: isolate;
  width: clamp(170px, 64%, 340px);
  aspect-ratio: 2.05;
  display: block;
  border-radius: 55% 55% 7% 7% / 100% 100% 10% 10%;
  overflow: hidden;
  background: url(grain.png), linear-gradient(130deg, #c3d1b6, #fae8be);
  box-shadow:
    inset 0 3px 6px #19362e55,
    0 1px 1px #eedcae99;
}
.cover-art i {
  position: absolute;
  display: block;
}
.sun-cut {
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f4c982;
  right: 12%;
  top: 17%;
  box-shadow: 1px 3px 3px #7158353b;
}
.ridge-cut {
  inset: auto -10% -24%;
  height: 55%;
  border-radius: 46% 55% 0 0;
  background: url(grain.png), #9cad90;
  box-shadow:
    0 -1px 0 #e1e0ba,
    inset 1px 5px 8px #c3ce9b;
  transform: rotate(-10deg);
}
.ridge-cut.near {
  background: url(grain.png), #729781;
  bottom: -39%;
  height: 65%;
  transform: rotate(10deg);
  box-shadow:
    0 -1px 0 #bbd1ac,
    0 -4px 7px #5d735a38;
}
.flight-trail {
  left: 17%;
  top: 42%;
  width: 29%;
  height: 24%;
  border: 1.4px dashed #937951;
  border-radius: 55%;
  border-right-color: transparent;
  transform: rotate(-18deg);
}
.cover-plane {
  left: 42%;
  top: 18%;
  width: 35%;
  height: 36%;
  filter: drop-shadow(2px 5px 2px #67563d3d);
  transform: rotate(-12deg);
  transition: transform 0.65s ease;
}
.cover-plane:before,
.cover-plane:after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 8%, 100% 0, 25% 74%, 21% 51%);
  background: linear-gradient(
    154deg,
    #fffae6 44%,
    #bd9870 45%,
    #d1aa80 65%,
    #fbe4bb 66%
  );
}
.cover-plane:after {
  clip-path: polygon(22% 56%, 100% 0, 41% 89%);
  background: #f5c6a3;
}
.cover:hover .cover-plane {
  transform: translate(3px, -2px) rotate(-14deg);
}
.cover:focus-visible {
  outline-offset: 6px;
}
.controls[inert] {
  visibility: hidden;
}
.turn-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  perspective: 2200px;
  transform-style: preserve-3d;
}
.page-strip {
  position: absolute;
  top: 0;
  height: 100%;
  left: var(--binding);
  transform-style: preserve-3d;
  transform-origin: 0 50%;
  pointer-events: none;
}
.strip-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--paper);
}
.strip-face.verso {
  transform: rotateY(180deg);
}
.strip-face:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #58473114, #523b2726);
  opacity: var(--shade, 0);
  pointer-events: none;
}
.page-print {
  position: absolute;
  top: 0;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.page-print .leaf {
  height: 100%;
  width: 100%;
}
.page-print img.ink,
.retained-page img.ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.page-print .cover {
  inset: 0;
  visibility: visible;
}
.page-print .words,
.page-print .picture {
  visibility: visible !important;
}
.retained-page {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  pointer-events: none;
  z-index: 2;
}
.retained-page.right {
  left: 50%;
}
.retained-page .leaf {
  height: 100%;
}
.sheet-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    90deg,
    transparent 31%,
    #5d4e3330 48%,
    #4839252b 52%,
    transparent 73%
  );
  opacity: 0;
}
@media (max-width: 650px) {
  .book {
    --binding: 0%;
  }
  .book.closed {
    transform: none;
  }
  .book.closed::before,
  .book.cover-motion::before {
    left: -5px;
  }
  .cover {
    padding: 18px;
  }
  .cover-title {
    font-size: clamp(3.8rem, 17vw, 5.8rem);
  }
  .cover-art {
    width: min(65%, 245px);
  }
  .book.closed {
    min-height: clamp(420px, 68svh, 620px);
  }
  .page-print.stack {
    display: flex;
    flex-direction: column;
  }
  .page-print.stack .words {
    flex: 1;
    height: auto;
  }
  .page-print.stack .picture {
    flex: none;
    height: clamp(180px, 50vw, 280px);
  }
  .retained-page {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cover-plane {
    transition: none;
  }
  .cover:hover .cover-plane {
    transform: none;
  }
}
body {
  overflow-x: clip;
}
.mobile-underlay {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 650px) {
  .turn-layer {
    clip-path: inset(-8% -2% -8% -2%);
  }
}
.cover-motion .sheet-shadow {
  left: var(--binding);
  background: linear-gradient(90deg, #473e342b, transparent 64%);
}
@media (max-width: 650px) {
  .book.cover-motion .words {
    visibility: visible;
    flex: 1;
  }
}
