:root {
  color-scheme: light;
  --ink: #172839;
  --paper: #fffaf0;
  --border: #ddcfb6;
  --gold: #6b5029;
  --muted: #4f5660;
  font: 100%/1.6 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #ede5d6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
button, select { font: inherit; }
:focus-visible { outline: 3px solid #2c63a0; outline-offset: 4px; }
.book-bar, .book {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.book-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .65rem 1rem;
  padding-block: .8rem;
  font-weight: 650;
}
.download, .browse {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .5rem 1rem;
  border-radius: .35rem;
  font-weight: 650;
  text-decoration: none;
}
.download { background: var(--ink); color: #fff; }
.browse { background: #ead6ad; color: var(--ink); }
.download:hover, .browse:hover { text-decoration: underline; }
.book { padding-bottom: 2rem; }
.sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: .6rem;
  box-shadow: 0 .4rem 1.4rem #42321b14;
}
.cover {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  background: var(--ink);
  color: #fff8e8;
  overflow: hidden;
}
.cover-copy {
  padding: clamp(1.2rem, 5vw, 3.2rem);
  align-self: center;
}
.logo { display: block; width: 9rem; height: auto; margin-bottom: 1.1rem; }
.cover h1, .entry h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  font-weight: 650;
  line-height: .99;
  overflow-wrap: anywhere;
}
.subtitle {
  margin: .7rem 0;
  color: #ead6ad;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
}
#credit { margin: 1rem 0; font-size: .91rem; }
.cover-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 20rem;
  object-fit: contain;
}
.book-controls, .examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin-block: .8rem;
}
.book-controls {
  position: sticky;
  top: .25rem;
  z-index: 1;
  justify-content: space-between;
  padding: .7rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: .45rem;
}
.chapter-control, .turn-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.chapter-control { flex-wrap: wrap; flex: 1 1 17rem; }
.chapter-control label { font-weight: 700; }
.chapter-control select {
  min-height: 2.75rem;
  max-width: 100%;
  border: 1px solid #94866e;
  border-radius: .3rem;
  padding: .25rem .4rem;
  background: #fffdf6;
  color: var(--ink);
}
.turn-controls button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--ink);
  border-radius: .35rem;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.turn-controls button:disabled { opacity: .42; cursor: default; }
.page-count { min-width: 6rem; text-align: center; }
.examples { font-size: .92rem; }
.examples > span { font-weight: 700; }
.examples a { color: var(--gold); }
.examples a[aria-current="page"] { font-weight: 750; }
.entry { padding: clamp(1rem, 4vw, 2.5rem); }
.entry header { max-width: 52rem; margin-bottom: 1rem; }
.entry-chapter { margin: 0 0 .45rem; color: var(--gold); font-weight: 700; }
.entry h2 { font-size: clamp(1.8rem, 5vw, 3.4rem); }
.entry figure { margin: 1rem 0 1.3rem; }
.entry figure > img, .entry video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 38rem;
  border-radius: .35rem;
  object-fit: contain;
  background: #ece4d3;
}
.entry video { background: var(--ink); aspect-ratio: 16 / 9; }
.entry figcaption, .message { color: var(--muted); font-size: .92rem; }
.entry figcaption { margin-top: .45rem; }
.message:empty { display: none; }
.prompt {
  margin: 1rem 0 0;
  padding: 1rem;
  background: #f3ead8;
  border-inline-start: 3px solid #a17a41;
  border-radius: .25rem;
}
.prompt h3, .prompt h4 { margin: 0; }
.prompt p { margin: .45rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt summary { cursor: pointer; font-weight: 700; }
.prompt summary + div:not([hidden]) { margin-top: .6rem; }
@media (max-width: 44rem) {
  .cover { grid-template-columns: 1fr; }
  .cover-photo { min-height: 0; height: auto; aspect-ratio: 1586 / 992; }
  .book-controls { gap: .5rem; }
  .examples { gap: .4rem .7rem; }
}
