:root {
  color-scheme: light;
  --serif: "Cormorant Garamond", Georgia, serif;
  --copy: "PT Serif", Georgia, serif;
  --sans: "Inter", "Segoe UI", sans-serif;
  --text-page-title: clamp(2.25rem, 1.55rem + 3.2vw, 4.25rem);
  --text-section-title: clamp(1.6rem, 1.3rem + 1vw, 2.15rem);
  --text-body: 1.0625rem;
  --text-label: .9375rem;
  --text-caption: .875rem;
  --ink: #243d32;
  --line: #b5a989;
  background: #f6efdf;
  color: var(--ink);
  font: 500 100%/1.45 var(--sans);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  min-height: 100vh; min-height: 100svh; margin: 0;
  background: url("assets/grain.png"), radial-gradient(ellipse at 43% 4%, #fffbf0, #f6efdf 65%, #ede1c9);
}
h1, h2, p, ul { margin: 0; }
.library-head, .library { width: min(90%, 1450px); margin-inline: auto; }
.library-head {
  min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.library-mast { display: inline-flex; align-items: center; gap: 12px; font: 600 2.22rem/1 var(--serif); letter-spacing: -.045em; }
.library-mast img { width: 40px; height: 40px; }
.library-kind { font-size: .79rem; }
.library { padding-block: clamp(34px, 4.6vw, 75px) 60px; }
.shelf-heading {
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  gap: 14px 40px; padding-bottom: clamp(26px, 3.6vw, 58px);
}
.shelf-heading h1, .landing h2 {
  font: 600 var(--text-page-title)/1.05 var(--serif);
  letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere;
}
.shelf-heading em { color: #924629; font-weight: 600; }
.shelf-heading p { max-inline-size: 36ch; color: #525e4e; font: 400 var(--text-body)/1.55 var(--copy); }
.collection {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 182px), 1fr));
  gap: clamp(30px, 4vw, 65px) clamp(15px, 1.7vw, 30px); padding: 0; list-style: none;
}
.collection > li { min-width: 0; }
.book-choice {
  display: grid; grid-template-rows: auto auto 1fr; row-gap: 8px; align-items: start;
  color: inherit; text-decoration: none;
  --cloth: #234b3c; --letter: #f6e7bc; --foil: #c9ae75; --edge: #17362d; --spine: #102c2460;
}
.book-choice:focus-visible { outline-offset: 5px; border-radius: 3px; }
.jacket {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 0.705; align-self: stretch; isolation: isolate;
  container-type: inline-size; margin-inline-end: 3px; padding: 5.5% 5% 8% 9%;
  border-radius: 2px 5px 4px 2px; color: var(--letter); background-color: var(--cloth);
  background-image: url("assets/grain.png");
  box-shadow: inset 1px 0 0 #ffffff68, inset -1px 0 0 #0005, 2px 1px 0 #d8cbad, 3px 2px 0 #988568,
    4px 3px 0 var(--edge), 4px 7px 6px #3c2e1929, 7px 15px 19px -7px #3c2e194b;
}
.jacket::before {
  content: ""; position: absolute; inset: 0 auto 0 0; z-index: 2; width: 7.5%; pointer-events: none;
  background: linear-gradient(90deg, #0003, #fff2 17%, transparent 32%, var(--spine) 72%, #fff2 82%, transparent);
}
.jacket::after { content: ""; position: absolute; inset: 3.3% 3.3% 4.4% 7.1%; border: 1px solid var(--foil); opacity: .65; pointer-events: none; }
.cover-art {
  display: block; width: 100%; height: auto; aspect-ratio: 1.04; object-fit: cover;
  border: 1px solid var(--foil); object-position: center 46%;
}
.cover-title {
  flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center;
  font: 600 clamp(1.18rem, 2vw, 2.65rem)/.98 var(--serif); font-size: 14cqi;
  letter-spacing: -.04em; padding: .1em 2% 0; margin: 0; overflow-wrap: anywhere;
}
.cover-title span { display: block; }
.cover-title span + span { font-style: italic; }
.access-note {
  flex: none; align-self: flex-end; max-inline-size: 100%; margin-block-start: 2px; padding: 2px 6px;
  border-radius: 3px; color: #47331f; background: #f3dfb7;
  font: 500 .75rem/1.3 var(--sans); font-size: clamp(.75rem, .625rem + 1.6cqi, .875rem);
  text-align: end; overflow-wrap: anywhere;
}
.access-note.free-access { color: #253d2c; background: #dceacb; }
.reading-status {
  position: absolute; z-index: 3; inset-block-start: 8px; inset-inline-end: 0;
  max-inline-size: calc(100% - 20px); padding: 4px 8px;
  border-radius: 3px 0 0 3px; color: #4d311d; background: #f3dfb7;
  font: 600 .75rem/1.3 var(--sans); text-align: end; text-wrap: balance; overflow-wrap: anywhere;
}
.reading-status.reading-complete { color: #fff8e7; background: #264e38; }
.reading-status span { white-space: nowrap; }
.book-choice[data-id="post"] { --cloth: #f0d19a; --letter: #763c29; --foil: #a2653b; --edge: #945137; --spine: #92402b63; }
.book-choice[data-id="spark"] { --cloth: #283650; --letter: #ffdd91; --foil: #dcab66; --edge: #182743; --spine: #11192d99; }
.book-choice[data-id="spark"] .jacket::after { border-style: double; border-width: 3px; }
.book-choice[data-id="mitten"] { --cloth: #713844; --letter: #ffecd5; --foil: #e9b899; --edge: #542c36; --spine: #471d2f88; }
.book-choice[data-id="mitten"] .jacket::after { border-style: dashed; border-radius: 3px; }
.book-choice[data-id="bell"] { --cloth: #173844; --letter: #f4d8a3; --foil: #dbac73; --edge: #102d35; --spine: #96582d70; }
.book-choice[data-id="bell"] .cover-title { font-size: 10.5cqi; }
.book-choice[data-id="boot-garden"] { --cloth: #8c4c37; --letter: #fff0cf; --foil: #e5c18c; --edge: #653523; --spine: #65352390; }
.book-choice[data-id="wind-suitcase"] { --cloth: #44385d; --letter: #f9e1a6; --foil: #f3ce92; --edge: #37304e; --spine: #37304e90; }
.book-choice[data-id="caterpillar-lift"] { --cloth: #5a7055; --letter: #fff2d3; --foil: #ead399; --edge: #30483b; --spine: #30483b90; }
.book-choice[data-id="rustle-conductor"] { --cloth: #b08754; --letter: #2a1d16; --foil: #f4d597; --edge: #43392f; --spine: #43392f90; }
.book-choice[data-id="scent-map"] { --cloth: #563e5c; --letter: #f7dbac; --foil: #f2ce8c; --edge: #443249; --spine: #44324990; }
.book-choice[data-id="scent-map"] .cover-title { font-size: 10.6cqi; }
.book-choice[data-id="paper-sea-dragon"] { --cloth: #2f6674; --letter: #fff0d3; --foil: #ffdfab; --edge: #254555; --spine: #25455590; }
.book-choice[data-id="paper-sea-dragon"] .cover-title { font-size: 10.6cqi; }
.book-choice[data-id="blue-paint"] { --cloth: #c9a765; --letter: #4b3228; --foil: #f8d69f; --edge: #333f5d; --spine: #333f5d90; }
.book-choice[data-id="whale-echo"] { --cloth: #235b61; --letter: #ffe2a5; --foil: #f2d0a2; --edge: #183e42; --spine: #183e4290; }
.book-choice[data-id="button-workshop"] { --cloth: #6a4663; --letter: #ffead0; --foil: #f2d1a0; --edge: #483849; --spine: #48384990; }
.book-choice[data-id="button-workshop"] .cover-title { font-size: 10.6cqi; }
.book-choice[data-id="clock-minute"] { --cloth: #543a50; --letter: #ffddab; --foil: #f2ce9d; --edge: #453541; --spine: #45354190; }
.book-choice[data-id="clock-minute"] .cover-title { font-size: 10.6cqi; }
.book-choice[data-id="tram"] { --cloth: #e5d5ad; --letter: #922e21; --foil: #765434; --edge: #423d30; --spine: #47482c70; }
.book-choice[data-id="tram"] .cover-title { font: 500 10.5cqi/.98 var(--sans); letter-spacing: -.045em; text-transform: uppercase; }
.book-choice[data-id="tram"] .cover-title span + span { font-style: normal; }
.card-meta {
  display: flex; align-items: baseline; gap: 2px 10px; flex-wrap: wrap;
  margin-block-start: 8px; padding-block-start: 10px; border-block-start: 1px solid var(--line);
  color: #586046; font: 500 var(--text-caption)/1.45 var(--sans); overflow-wrap: anywhere;
}
.page-count { white-space: nowrap; color: #755b3d; font-variant-numeric: tabular-nums; }
.card-description {
  max-inline-size: 36ch; color: #394437;
  font: 400 var(--text-body)/1.55 var(--copy); text-wrap: pretty; overflow-wrap: anywhere;
}
@media (hover: hover) {
  .book-choice:hover .jacket::after { opacity: 1; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .jacket { transition: transform .2s ease; }
  .book-choice:hover .jacket, .book-choice:focus-visible .jacket { transform: translateY(-5px) rotate(-.5deg); }
}
@media (min-width: 1550px) { .library { padding-top: 75px; } }
@media (max-width: 1199px) and (min-width: 701px) {
  .collection { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 4%; }
}
@media (max-width: 700px) {
  .library-head, .library { width: calc(100% - 36px); }
  .library-head { min-height: 66px; }
  .library-mast { gap: 8px; font-size: 1.83rem; } .library-mast img { width: 31px; height: 31px; }
  .library-kind { font-size: .67rem; }
  .library { padding-block: 31px 42px; }
  .shelf-heading { display: block; padding-bottom: 24px; }
  .shelf-heading p { margin-block-start: 10px; }
  .collection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 27px 16px; }
}
@supports (grid-template-rows: subgrid) {
  .collection { row-gap: 8px; }
  .collection > li, .book-choice {
    display: grid; grid-row: span 3; grid-template-rows: subgrid;
  }
  .card-description { margin-block-end: clamp(16px, 2vw, 32px); }
}
@media (max-width: 355px) {
  .library-head, .library { width: calc(100% - 26px); }
  .collection { column-gap: 13px; }
}
