:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }

.book-site {
  --reader-line: #8a91aa;
  --reading-size: 1.18rem;
  margin: 0;
  font-family: system-ui, sans-serif;
  overflow-x: visible;
}

.ca-top.book-site-header {
  position: relative;
  z-index: auto;
  padding-block: .6rem;
  gap: .5rem;
  background: var(--sky);
  border-bottom: 1px solid #d4deec;
}
.book-site-header .book-home { display: inline-flex; align-items: center; min-height: 44px; }
.book-site-header .book-home img { width: clamp(6.5rem, 28vw, 9.25rem); }
.book-site-header nav { gap: .4rem; }
.book-site-header nav .ca-top-call {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem .8rem;
}

.book-site main { width: min(100%, 46rem); margin-inline: auto; padding: clamp(1rem, 4vw, 2.8rem); }
.book-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: clamp(1rem, 4vw, 1.8rem);
  border-radius: clamp(1rem, 4vw, 1.65rem);
  background: var(--lilac);
}
.book-icon { grid-area: 1 / 2; width: clamp(2.6rem, 10vw, 4.75rem); height: auto; }
.book-heading > div { grid-area: 1 / 1; min-width: 0; }
.book-site main h1 {
  margin-block: .35rem .5rem;
  font-size: clamp(2rem, 5.6vw, 3.5rem);
  line-height: 1.02;
  text-wrap: initial;
}
.book-site main h2 {
  margin-bottom: .85rem;
  font-size: clamp(1.65rem, 3.6vw, 2.3rem);
  line-height: 1.12;
}
.book-site h2.text-chapter { margin-top: 1.6rem; }
.book-site h3 { margin: 0 0 .5rem; font: 600 1.15rem var(--font-display); }
.book-site main p { margin: 0 0 .85rem; }
.book-site main .byline { margin: 0; color: var(--soft); font-size: .875rem; font-weight: 650; }
.book-site #chapter-count { margin-bottom: .4rem; }
.book-site .book-heading + noscript p { margin-top: .8rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .65rem .85rem; margin-block: .9rem 1.2rem; }
.text-size, .actions, .chapter-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.text-size span { color: var(--soft); font-size: .875rem; font-weight: 650; }
.text-size button { min-width: 44px; padding-inline: .55rem; }
.prose { font: var(--reading-size)/1.65 Georgia, serif; scroll-margin-top: min(22vh, 145px); }
button {
  cursor: pointer;
  min-height: 44px;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--reader-line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 620;
  scroll-margin-block: .5rem;
}
button:hover, button[aria-pressed="true"] { background: var(--sky); }
button[aria-disabled="true"] { color: var(--soft); cursor: default; }
#next, #resume, #study-close, #turn-page { border-color: var(--ink); background: var(--ink); color: #fff; }
#next:hover, #resume:hover, #study-close:hover, #turn-page:hover { background: #3a4470; }
details { margin-block: 1rem; padding: .35rem .85rem .55rem; background: var(--sky); border-radius: 1rem; }
summary { min-height: 44px; padding-block: .65rem; cursor: pointer; font-weight: 650; }
details p:first-of-type { margin-top: .65rem; }
[role="status"]:not(:empty) { margin-top: .55rem; }
.chapter-nav, .study-tools, .study-screen { margin-top: 1.5rem; }
.study-tools { padding-block: 1rem; border-top: 1px solid var(--reader-line); }
#study-open { margin-top: .75rem; }
.book-site #ending { margin: 0; color: var(--soft); }
.word-chip { margin: -.2rem 0 .8rem; font-size: .875rem; }
.role-scene { margin-bottom: 1.25rem; }
.role-scene details { margin-bottom: .45rem; }
.phrase-actions { margin-top: .7rem; }
.transfer { margin-bottom: 1rem; }
.transfer label { display: block; margin-bottom: .35rem; font-weight: 650; }
.transfer input { display: block; width: min(100%, 26rem); min-height: 44px; margin-bottom: .65rem; padding: .5rem .65rem; border: 1px solid var(--reader-line); border-radius: .75rem; font: inherit; }
.book-transfer label { display: block; margin: .65rem 0 .25rem; font-weight: 650; }
.book-transfer input { max-width: 100%; font: inherit; }
.narration { margin-bottom: 1rem; }
.narration p { margin-bottom: .3rem; color: var(--soft); font-size: .875rem; font-weight: 650; }
.narration audio { display: block; width: 100%; max-width: 25rem; }

.opening-art { margin: .1rem 0 1.25rem; }
.art-frame { --flame-x: 78.5%; --flame-y: 60%; position: relative; isolation: isolate; overflow: hidden; border-radius: clamp(.8rem, 3vw, 1.4rem); }
#combs-art-frame { --flame-x: 7.8%; --flame-y: 44%; }
.art-frame img { display: block; width: 100%; height: auto; }
.opening-art figcaption { margin-top: .42rem; color: var(--soft); font-size: .8rem; }

@media (prefers-reduced-motion: no-preference) {
  .art-frame.lamp-glow::after {
    content: "";
    position: absolute;
    left: calc(var(--flame-x) - 4%);
    top: calc(var(--flame-y) - 8%);
    width: 8%;
    height: 16%;
    pointer-events: none;
    background: radial-gradient(ellipse, #ffe7ac 8%, #ffb46a 27%, transparent 70%);
    mix-blend-mode: screen;
    animation: lamplight 3.6s ease-in-out both;
  }
}

@keyframes lamplight {
  0%, 100% { opacity: 0; }
  29% { opacity: .24; }
  54% { opacity: .10; }
  76% { opacity: .19; }
}

.book-shelf { margin-block: 1.4rem; }
.book-card {
  display: grid;
  gap: 1rem;
  width: min(100%, 28rem);
  padding: 1rem;
  border: 1px solid #d4deec;
  border-radius: 1.35rem;
  background: var(--sky);
  text-decoration: none;
}
.book-card:hover .book-card-title { text-decoration: underline; }
.book-card img { display: block; width: 100%; height: auto; border-radius: .8rem; }
.book-card-title { display: block; font: 500 clamp(1.45rem, 4.5vw, 1.9rem)/1.12 var(--font-display); }
.book-card-meta { display: block; margin-top: .32rem; color: var(--soft); font-size: .875rem; }

.book-return { margin-top: 1.25rem; border-top: 1px solid #d4deec; }
.book-return a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
