:root {
  color-scheme: dark;
  background: #132d25;
  color: #f8edd6;
  font-family: Inter, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 69% 39%, #2d5140 0, #132d25 62%);
}
a {
  color: inherit;
  text-underline-offset: 0.23em;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #f9d18a;
  outline-offset: 4px;
}
.shell {
  width: min(1350px, 92%);
  margin-inline: auto;
}
.site-header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-block: 1.35rem;
  font-size: 0.86rem;
}
.site-header {
  border-bottom: 1px solid #f8edd633;
}
.spread {
  display: grid;
  grid-template-columns: minmax(260px, 0.73fr) minmax(0, 1.7fr);
  gap: clamp(1.5rem, 4vw, 4.25rem);
  align-items: center;
  padding-block: clamp(2rem, 5vw, 5.5rem) 1.75rem;
}
.intro {
  min-width: 0;
}
.foil-star {
  width: 2rem;
  height: 2rem;
}
h1,
h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
}
h1 {
  font-size: clamp(3.25rem, 5.9vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.048em;
  margin: 0.65rem 0 1.2rem;
}
h1 em {
  color: #f3cc85;
}
.intro p {
  color: #eee0c5;
  margin: 0;
  font-size: 0.98rem;
  max-width: 32ch;
  line-height: 1.65;
}
.chapter-note {
  border-top: 1px solid #f3cc8555;
  margin-top: 1.6rem;
  padding-top: 1.15rem;
}
.chapter-note h2 {
  color: #f3cc85;
  font-size: 1.55rem;
  margin: 0 0 0.45rem;
}
.studio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.2rem;
  min-height: 44px;
  padding: 0.65rem 1rem;
  background: #f3cc85;
  border-radius: 6px;
  color: #18342a;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}
.studio-link:hover {
  background: #ffe2ab;
}
.book {
  position: relative;
  aspect-ratio: 3 / 2;
  border: 1px solid #c7965c;
  border-radius: 14px 14px 20px 20px;
  margin: 0;
  overflow: hidden;
  background: #172a21;
  isolation: isolate;
  box-shadow:
    0 7px 0 -3px #774236,
    0 11px 0 -5px #c99c73,
    0 25px 45px #08100dad;
}
.book-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform-origin: center left;
}
.book-image.turning {
  animation: turn-page 480ms cubic-bezier(0.23, 0.73, 0.31, 1) both;
}
@keyframes turn-page {
  from {
    opacity: 0.4;
    transform: perspective(1200px) rotateY(-13deg) scale(0.992);
  }
  to {
    opacity: 1;
    transform: perspective(1200px) rotateY(0);
  }
}
.book-snow {
  position: absolute;
  inset: -7% 0 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.8;
  animation: drift 9s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 4px #f9df9d);
}
.snow-paused .book-snow {
  animation-play-state: paused;
}
@keyframes drift {
  to {
    transform: translate(2%, 10%);
    opacity: 0.4;
  }
}
.chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  padding-block: 1rem 1.5rem;
}
.chapters button {
  display: grid;
  grid-template-columns: 63px 1fr;
  gap: 0.7rem;
  text-align: left;
  min-width: 0;
  align-items: center;
  background: #254638;
  border: 1px solid #f8edd644;
  border-radius: 8px;
  padding: 0.48rem;
  font-size: 0.88rem;
  font-weight: 650;
}
.chapters button:hover {
  background: #345545;
}
.chapters button[aria-pressed="true"] {
  border-color: #f3cc85;
  color: #f5d596;
}
.chapters img {
  width: 63px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}
footer {
  border-top: 1px solid #f8edd633;
  color: #eee0c5;
}
footer button {
  background: none;
  border: 1px solid #f8edd655;
  border-radius: 5px;
  padding: 0.55rem 0.75rem;
}
@media (max-width: 760px) {
  .spread {
    grid-template-columns: 1fr;
  }
  .chapter-note {
    margin-top: 1.2rem;
  }
  .book {
    border-radius: 8px;
  }
  .chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .book:not(.snow-playing) .book-snow {
    animation-play-state: paused;
  }
  .book-image.turning {
    animation: none;
  }
}
