:root {
  color-scheme: light;
  --ink: #15213c;
  --night: #101932;
  --muted: #525a6b;
  --cream: #faf6ed;
  --paper: #fffaf0;
  --gold: #f5d48b;
  --line: #dfd7c8;
  --display: Georgia, 'Times New Roman', serif;
  --body: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--cream); }
body { margin: 0; color: var(--ink); font: 500 1rem/1.6 var(--body); }
a { color: inherit; }
a, button, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #916726; outline-offset: 4px; }
.hero :focus-visible, .site-header :focus-visible { outline-color: var(--gold); }
img { display: block; max-width: 100%; height: auto; }
button, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - 3rem, 75rem); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: .75rem; left: 1rem; z-index: 4; padding: .65rem 1rem;
  color: var(--night); background: var(--gold); transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.site-header { background: var(--night); color: #fff5df; border-bottom: 1px solid #e8d9b82d; }
.nav { min-height: 4.5rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: .72rem; text-decoration: none; font-size: 1.08rem; font-weight: 730; }
.brand img { width: 2.5rem; height: 2.5rem; border-radius: .55rem; }
.nav nav a { padding: .65rem .15rem; text-decoration: none; font-weight: 650; }
.nav nav a:hover, .nav nav a[aria-current] { text-decoration: underline; text-underline-offset: .4em; }
h1, h2, .cover-title { font-family: var(--display); font-weight: 500; line-height: 1.04; letter-spacing: -.045em; }
.eyebrow {
  font-size: .83rem; text-transform: uppercase; letter-spacing: .14em;
  color: #6c4e21; font-weight: 750; margin: 0 0 .65rem;
}
.hero {
  color: #fff5df; overflow: hidden;
  background: radial-gradient(ellipse at 68% 20%, #242b52 0, transparent 64%), var(--night);
}
.hero-inner { min-height: 31.5rem; padding-block: 3.5rem; display: grid; grid-template-columns: 1fr 1.02fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); }
.hero h1 { margin: 0; font-size: clamp(3.25rem, 6.2vw, 6.1rem); }
.hero .eyebrow { color: var(--gold); }
.hero-copy > p:not(.eyebrow) { color: #dedfee; max-width: 33rem; margin-block: 1.35rem 1.6rem; font-size: clamp(1rem, 1.5vw, 1.16rem); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.4rem; }
.button {
  min-height: 2.9rem; display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1.3rem; border: 1px solid transparent; border-radius: 999px;
  font-weight: 740; line-height: 1.2; text-align: center; text-decoration: none;
}
.button-gold { background: var(--gold); color: var(--night); }
.button-gold:hover { background: #ffe3a3; }
.button-night { background: var(--night); color: #fff5df; }
.button-night:hover { background: #293658; }
.button-outline { color: var(--ink); background: transparent; border-color: #bfb5a5; }
.button-outline:hover:enabled { background: #f6ebd6; border-color: #9f9079; }
.button:disabled { opacity: .66; cursor: default; }
.hero-link { color: #fff0cd; text-underline-offset: .29em; font-size: .98rem; font-weight: 650; }
.hero-picture { margin: 0; position: relative; padding: .55rem; border: 1px solid #f5d48b77; border-radius: 14rem 14rem 1.4rem 1.4rem; }
.hero-picture img { width: 100%; aspect-ratio: 1.23; object-fit: cover; object-position: 50% 62%; border-radius: inherit; }
.hero-picture figcaption {
  position: absolute; right: .85rem; bottom: .85rem; padding: .28rem .65rem;
  border-radius: .4rem; background: #101932eb; color: #fff4db; font-size: .79rem;
}
.shelf { padding-block: clamp(2rem, 6vw, 4.25rem); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem 2rem; margin-bottom: 1.9rem; }
.section-heading h2 { margin: 0; font-size: clamp(2.25rem, 4vw, 3.6rem); }
.section-heading > p { margin: 0 0 .15rem; color: var(--muted); }
.book-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1.05rem; }
.book-grid li { min-width: 0; }
.book-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none;
  border: 1px solid var(--line); background: var(--paper); border-radius: .9rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 .55rem 1.5rem #30241824; }
.cover-frame { display: block; padding: .9rem .9rem 0; }
.cover-frame img { width: 100%; height: auto; aspect-ratio: .707; object-fit: cover; border-radius: .42rem; background: #282d45; }
.book-card-copy { display: flex; flex: 1; flex-direction: column; gap: .45rem; padding: .9rem; line-height: 1.45; }
.book-card-copy strong { font: 600 clamp(1.07rem, 1.6vw, 1.4rem)/1.13 var(--display); }
.book-card-copy > span:not(.card-cta) { color: var(--muted); font-size: .94rem; }
.card-cta { margin-top: auto; padding-top: .35rem; color: #6c4e21; font-size: .92rem; font-weight: 750; }
.book-card:hover .card-cta { text-decoration: underline; text-underline-offset: .3em; }
.catalog-intro { padding-block: 3.45rem 2.8rem; background: #f3e9d7; border-bottom: 1px solid var(--line); }
.catalog-intro h1 { margin: 0; font-size: clamp(3rem, 6vw, 5rem); }
.catalog-intro p:not(.eyebrow) { margin: .85rem 0 0; max-width: 40rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 4rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .9rem; color: var(--muted); }
.footer-inner :first-child { color: var(--ink); font-weight: 750; }
.reader { max-width: 68rem; padding-block: 1.8rem 2.6rem; }
.reader-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem 1.5rem; padding: 0 .2rem .85rem; }
.reader-heading h1 { text-align: right; font-size: clamp(1.55rem, 3.4vw, 2.45rem); margin: 0; }
.text-link { color: #514323; font-weight: 720; text-underline-offset: .25em; }
.reading-page {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center;
  border-radius: 1rem; overflow: hidden; background: var(--paper); border: 1px solid var(--line);
  min-height: 24rem; scroll-margin-top: 1rem; touch-action: pan-y;
}
.reading-page figure { margin: 0; height: 100%; display: grid; place-items: center; background: #171f39; }
.reading-page figure img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.reading-page.is-cover figure { padding: 1.35rem; }
.reading-page.is-cover figure img { width: auto; height: auto; max-height: min(65vh,35rem); border-radius: .35rem; }
.page-copy { padding: clamp(1.35rem, 3.1vw, 3rem); font-size: clamp(1.1rem, 2vw, 1.29rem); line-height: 1.63; }
.page-copy > p { margin: 0; }
.page-copy > p + p { margin-top: .85em; }
.page-copy .cover-title { font-size: clamp(2.35rem, 4.4vw, 4.05rem); margin-block: .2em .28em; }
.page-copy .page-credit { font-size: .9em; color: #665a45; }
.page-copy .button { margin-top: 1.15rem; font-size: 1rem; }
.page-copy em { font-weight: 680; }
.story-end { color: #6c4e21; font-style: italic; }
.reader-controls {
  position: sticky; bottom: 0; z-index: 2; margin-top: .85rem; padding: .6rem .85rem .72rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: .85rem;
  box-shadow: 0 -.3rem 1rem #2b284711;
}
.reader-controls progress { display: block; width: 100%; height: .35rem; border: 0; border-radius: 1rem; overflow: hidden; background: #e9dfcc; accent-color: #9a6726; }
.reader-controls progress::-webkit-progress-bar { background: #e9dfcc; }
.reader-controls progress::-webkit-progress-value { background: #9a6726; }
.reader-controls progress::-moz-progress-bar { background: #9a6726; }
.reader-buttons { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; margin-top: .58rem; }
.reader-buttons > :first-child { justify-self: start; }
.reader-buttons > :last-child { justify-self: end; }
.jump-control { position: relative; }
.jump-control::after {
  content: ''; position: absolute; right: .8rem; top: 46%;
  width: .4rem; height: .4rem; border-right: 1.5px solid; border-bottom: 1.5px solid;
  transform: rotate(45deg); pointer-events: none;
}
.jump-control select {
  appearance: none; border: 1px solid var(--line); background: transparent; border-radius: .52rem;
  color: var(--ink); min-height: 2.85rem; min-width: 5.3rem; padding: 0 1.48rem 0 .7rem; cursor: pointer;
  font-size: .93rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.not-found { padding-block: 4rem; }
.not-found h1 { font-size: clamp(2.5rem, 8vw, 4rem); }
@media (max-width: 63rem) {
  .hero-inner { min-height: auto; gap: 2rem; }
  .book-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 46rem) {
  .shell { width: min(100% - 2rem, 75rem); }
  .nav { min-height: 3.8rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.6rem; padding-block: 2.1rem; }
  .hero h1 { font-size: clamp(3rem, 12vw, 4.45rem); }
  .hero-picture { width: min(100%, 33rem); justify-self: center; }
  .hero-picture img { aspect-ratio: 1.36; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: .65rem; }
  .book-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
  .book-card-copy, .cover-frame { padding-inline: .65rem; }
  .book-card-copy { padding-block: .7rem; }
  .catalog-intro { padding-block: 2.4rem 1.8rem; }
  .reader { padding-block: 1.05rem 1.6rem; }
  .reader-heading { align-items: center; }
  .text-link { font-size: .9rem; }
  .reading-page { grid-template-columns: 1fr; }
  .reading-page figure { height: auto; }
  .reading-page figure img { height: auto; }
  .reading-page.is-cover figure { padding: 1rem; }
  .reading-page.is-cover figure img { max-height: 24rem; }
  .page-copy { font-size: 1.12rem; }
  .reader-controls { padding-inline: .5rem; }
  .reader-buttons { gap: .35rem; }
  .reader-buttons .button { padding-inline: .67rem; font-size: .85rem; }
}
@media (max-width: 23rem) {
  .shell { width: calc(100% - 1.3rem); }
  .hero-picture figcaption { font-size: .7rem; }
  .footer-inner { font-size: .8rem; }
  .jump-control select { min-width: 4.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
