:root {
  --night: #102a27;
  --ivory: #fff4d8;
  --gold: #dec294;
  --ink: #203932;
  --paper: #f9f4e8;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, h1, h2, p, fieldset { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #dd9135; outline-offset: 5px; }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem max(6vw, calc((100vw - 67rem) / 2));
  color: var(--ivory);
  background: #0b201e;
  border-bottom: 1px solid #47615a;
}
.masthead a { padding-block: .35rem; }
.masthead nav { display: flex; gap: clamp(1rem, 4vw, 2rem); font-size: .82rem; }
.masthead nav a { text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; }
h1 span { display: inline-block; }
.brand { font: 600 1.55rem var(--serif); letter-spacing: .13em; text-decoration: none; }
.library {
  position: relative;
  isolation: isolate;
  color: var(--ivory);
  background: radial-gradient(ellipse at 72% 0%, #57503b, transparent 56%), linear-gradient(120deg, #153c36, #102724 65%, #0c1f1f);
  border-bottom: 5px double #a68c58;
}
.library::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto auto;
  width: min(47vw, 490px);
  aspect-ratio: 542 / 254;
  background: url("assets/lamp.webp") top right / contain no-repeat;
  mask-image: linear-gradient(to right, transparent, black 28%), linear-gradient(to top, transparent, black 32%);
  mask-composite: intersect;
}
.library-inner { max-width: 66rem; padding: 1.6rem 6vw 2rem; margin: auto; }
.eyebrow { font-size: .75rem; color: var(--gold); letter-spacing: .17em; }
h1, h2, .reading p, .download > p { font-family: var(--serif); }
h1 { margin: .3rem 0 .5rem; font-size: clamp(1.85rem, 7.7vw, 4.3rem); font-weight: 500; }
.instruction { font-size: .85rem; line-height: 1.5; }
.collection { padding: 0; border: 0; min-width: 0; }
.sr, .book-choice { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.books {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.6rem, 3vw, 1.4rem);
  align-items: end;
  padding: 1.25rem .6rem .4rem;
  margin-bottom: 1rem;
  border-bottom: .5rem solid #855838;
  box-shadow: 0 3px #4c3426, 0 8px 7px -4px #061714;
}
.books label { cursor: pointer; position: relative; }
.books img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px 4px 3px 2px;
  box-shadow: 3px 4px 7px #071b17;
  transition: transform .18s ease;
}
#book-train:checked ~ .books label[for="book-train"] img,
#book-stage:checked ~ .books label[for="book-stage"] img,
#book-blanket:checked ~ .books label[for="book-blanket"] img { transform: translateY(-.35rem); outline: 2px solid #ffe4a5; outline-offset: 2px; }
#book-train:focus-visible ~ .books label[for="book-train"] img,
#book-stage:focus-visible ~ .books label[for="book-stage"] img,
#book-blanket:focus-visible ~ .books label[for="book-blanket"] img { outline: 3px dashed white; outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { .books img { transition: none; } }
.reading { padding-inline: .2rem; }
.reading h2 { font-size: clamp(1.25rem, 3.8vw, 1.8rem); color: var(--gold); font-weight: 500; margin-bottom: .35rem; }
.reading p { font-size: clamp(.96rem, 2vw, 1.16rem); line-height: 1.75; }
.reading article { display: none; }
#book-train:checked ~ .reading #story-train,
#book-stage:checked ~ .reading #story-stage,
#book-blanket:checked ~ .reading #story-blanket { display: block; }
.download { margin-top: 1.2rem; }
.download > p { font-size: 1.05rem; }
.stores { margin-top: .65rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.stores img { display: block; width: auto; height: 48px; }
.stores small { color: var(--gold); font-size: .76rem; line-height: 1.6; }
.support, footer { width: min(88vw, 46rem); margin-inline: auto; }
.how {
  --rule: #b6a783;
  padding: clamp(2.4rem, 6vw, 5rem) max(4vw, calc((100vw - 64rem) / 2));
  border-bottom: 1px solid #c5ba9c;
}
.guide-heading { padding-inline: .5rem; margin: 0 auto 1.35rem; text-align: center; }
.guide-kicker { font-size: .77rem; letter-spacing: .14em; color: #5b6652; }
.guide-heading h2 { font-size: clamp(1.55rem, 4.5vw, 2.7rem); font-weight: 600; margin: .3rem 0 .55rem; }
.guide-heading > p:last-child { font-size: .94rem; line-height: 1.75; text-wrap: pretty; }
.guide-figure {
  margin: 0; padding: clamp(1.15rem, 3vw, 2.5rem) clamp(.65rem, 2.4vw, 2rem);
  background: radial-gradient(ellipse at 44% 48%, #fcf8ec, #eee7d5 85%);
  border-block: 1px solid #cec2a4; border-radius: .2rem;
}
.guide-plot {
  display: grid; grid-template-columns: minmax(0, .98fr) minmax(0, 1fr);
  align-items: center; gap: clamp(1.15rem, 4vw, 2.4rem);
}
.screen-shot { display: block; position: relative; color: var(--ink); text-decoration: none; cursor: zoom-in; }
.screen-shot img {
  display: block; width: 100%; height: auto; border: 1px solid #acaa94;
  border-radius: .6rem; box-shadow: 0 .55rem 1.15rem #34290b20;
}
.zoom-caption {
  position: absolute; top: 100%; inset-inline: 0; padding-top: .45rem;
  text-align: center; font-size: .75rem; text-decoration: underline; text-underline-offset: .2em;
}
.count { --at: 20%; }
.puzzle { --at: 29%; }
.history { --at: 50%; }
.entry { --at: 86%; }
.pin, .guide-note h3::before {
  display: inline-grid; place-items: center; border-radius: 50%; background: var(--night); color: var(--ivory);
  width: 1.2rem; height: 1.2rem; font: 600 .75rem/1 system-ui, sans-serif;
}
.pin { position: absolute; top: var(--at); right: 0; transform: translate(50%, -50%); outline: 2px solid var(--paper); }
.screen-notes { counter-reset: note; list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.guide-note { counter-increment: note; }
.guide-note h3 { display: flex; align-items: center; gap: .32rem; font: 600 clamp(.94rem, 2.7vw, 1.23rem)/1.4 var(--serif); margin: 0 0 .25rem; }
.guide-note h3::before { content: counter(note); flex: none; }
.guide-note p { font-size: clamp(.82rem, 2.6vw, .99rem); line-height: 1.65; }
.support h2 { font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 600; margin-bottom: 1rem; }
details p { line-height: 1.9; }
@media (max-width: 47.99rem) {
  .guide-figure { padding-bottom: 2.6rem; }
  .screen-shot { max-width: 13rem; justify-self: end; }
}
@media (min-width: 48rem) {
  .guide-plot { --shot: clamp(13rem, 24vw, 16rem); --gap: clamp(1.4rem, 3.8vw, 3.3rem); display: block; position: relative; margin-bottom: 2.2rem; }
  .screen-shot { width: var(--shot); margin: auto; }
  .pin.puzzle, .pin.entry { left: 0; right: auto; transform: translate(-50%, -50%); }
  .screen-notes { display: block; }
  .guide-note { position: absolute; top: var(--at); width: calc((100% - var(--shot)) / 2 - var(--gap)); transform: translateY(-.7rem); }
  .guide-note.count, .guide-note.history { left: calc(50% + var(--shot) / 2 + var(--gap)); }
  .guide-note.puzzle, .guide-note.entry { right: calc(50% + var(--shot) / 2 + var(--gap)); }
  .guide-note::after { content: ""; position: absolute; width: calc(var(--gap) - .65rem); top: .7rem; border-top: 1px solid #847956; }
  .guide-note.count::after, .guide-note.history::after { right: calc(100% + .15rem); }
  .guide-note.puzzle::after, .guide-note.entry::after { left: calc(100% + .15rem); }
  .guide-note h3::before { display: none; }
  .guide-note h3 { border-bottom: 1px solid var(--rule); padding-bottom: .35rem; margin-bottom: .35rem; }
}
.support { padding-block: 2.2rem; }
details { border-bottom: 1px solid #ccc3b0; }
summary { cursor: pointer; font-weight: 600; padding-block: 1.05rem; }
details p { padding: 0 0 1.15rem; }
footer { display: flex; gap: .8rem 1.3rem; flex-wrap: wrap; padding-block: 0 2rem; font-size: .85rem; }
@media (min-width: 46rem) {
  .library-inner { display: grid; grid-template-columns: 1fr 1.22fr; column-gap: clamp(2rem, 5vw, 5rem); align-items: center; padding: 4.5rem 2.5rem; }
  .intro { grid-area: 1 / 1; align-self: end; }
  h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
  .collection { grid-area: 1 / 2 / 3 / 3; }
  .download { grid-area: 2 / 1; align-self: start; margin-top: 1.8rem; }
  .reading { min-height: 11rem; }
}
@media (max-width: 23rem) and (max-height: 40rem) {
  .masthead { padding-block: .25rem; }
  .library-inner { padding-top: .8rem; }
  .books { padding-top: .75rem; margin-bottom: .6rem; }
  .reading p { line-height: 1.55; }
  .download { margin-top: .55rem; }
}
