:root {
  color-scheme: light;
  --paper: #f8f5ed;
  --ink: #213b33;
  --rule: #d2cdbd;
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0 max(20px, env(safe-area-inset-left)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-right)); }
.masthead, main { width: min(100%, 1260px); margin-inline: auto; }
.masthead { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); }
.library-brand { display: flex; align-items: center; color: inherit; text-decoration: none; font: 600 25px/1 Georgia, serif; letter-spacing: -.06em; }
.library-brand > span:first-child { color: #a77238; margin-right: 8px; font-size: 21px; }
.brand-period { color: #a77238; }
.library-guardian { margin-left: auto; color: var(--ink); font-size: 14px; text-underline-offset: 3px; }
.language select { background: transparent; color: #314741; border: 1px solid var(--rule); border-radius: 20px; padding: 8px 12px; min-height: 38px; font: inherit; font-size: 13px; cursor: pointer; }
.shelf-heading { padding: clamp(28px, 5vw, 64px) 0 clamp(22px, 3vw, 36px); }
h1, h2, .upcoming summary { font-family: 'Baskervville', Georgia, 'Times New Roman', serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(46px, 7vw, 78px); line-height: 1; letter-spacing: -.055em; }
.shelf-heading p { color: #506059; margin: 12px 0 0; line-height: 1.5; font-size: clamp(14px, 1.8vw, 17px); }
.book-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.8vw, 32px); }
.book-card { height: 100%; display: flex; flex-direction: column; text-decoration: none; border-radius: 5px 12px 12px 5px; position: relative; overflow: hidden; isolation: isolate; background: #20473e; color: #fffcf3; box-shadow: 0 7px 16px #292e3518, 1px 2px 4px #20282326; }
.book-card[data-book=cinderella] { background: #28374c; }
.book-card[data-book=sleeping-beauty] { background: #503654; }
.book-card[data-book=rapunzel] { background: #28585b; }
.book-card[data-book=little-mermaid] { background: #1c505e; }
.book-card[data-book=red-riding-hood] { background: #743f43; }
.book-card[data-book=peter-pan] { background: #334963; }
.cover { aspect-ratio: 1.76; overflow: hidden; position: relative; border-bottom: 2px solid #b59a62; }
.cover img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 55% 38%; transition: transform .35s ease; }
.book-card::after { content: ''; pointer-events: none; position: absolute; inset: 0 auto 0 0; width: 13px; background: linear-gradient(90deg,#0b1d284a,transparent 43%,#fff2 57%,#0719293b 69%,transparent); }
.book-panel { padding: clamp(18px, 2.6vw, 28px) clamp(22px, 3vw, 34px) 16px; flex: 1; display: flex; flex-direction: column; }
h2 { font-size: clamp(31px, 4.2vw, 47px); line-height: 1.08; letter-spacing: -.04em; margin: 0; }
.teaser { font-size: 15px; line-height: 1.5; color: #f4f0e5; margin: 8px 0 20px; }
.book-foot { margin-top: auto; border-top: 1px solid #fff4; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.open-book { font-weight: 650; display: inline-flex; align-items: center; gap: 9px; }
.open-book span { font-size: 20px; line-height: 1; color: #f1d5a3; }
.upcoming { margin: clamp(26px, 5vw, 50px) 0 0; border-block: 1px solid var(--rule); }
.upcoming summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 20px 3px; font-size: clamp(21px, 3vw, 30px); }
.upcoming summary::-webkit-details-marker { display: none; }
.upcoming-count { margin-left: auto; white-space: nowrap; font: 14px/1.3 'Instrument Sans', Arial, sans-serif; color: #4e6157; }
.chevron { width: 9px; height: 9px; border-bottom: 2px solid; border-right: 2px solid; transform: rotate(45deg); margin: 0 4px 4px; }
.upcoming[open] .chevron { transform: rotate(225deg); margin-top: 7px; }
.upcoming ol { margin: 0 0 24px; padding-left: 32px; columns: 2; column-gap: 36px; }
.upcoming li { padding: 8px 0 8px 4px; break-inside: avoid; line-height: 1.45; }
.upcoming li::marker { color: #736a57; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
:focus-visible { outline: 3px solid #9c5f24; outline-offset: 4px; }
@media (hover:hover) { .book-card:hover img { transform: scale(1.025); } .book-card:hover .open-book { text-decoration: underline; } }
@media (min-width: 1000px) {
  .book-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px); }
  .book-panel { padding: 18px clamp(16px, 1.8vw, 26px) 16px; }
  h2 { font-size: clamp(29px, 3vw, 40px); }
}
@media (max-width: 580px) {
  .masthead { min-height: 60px; gap: 8px; flex-wrap: wrap; padding-block: 8px; }
  .library-guardian { font-size: 12px; }
  .book-list { grid-template-columns: 1fr; gap: 20px; }
  .cover { aspect-ratio: 2.05; }
  .book-card[data-book=snow-white] .cover img,
  .book-card[data-book=rapunzel] .cover img { object-position: center 12%; }
  .book-panel { padding: 15px 20px 14px; }
  .teaser { margin: 5px 0 12px; }
  .upcoming ol { columns: 1; }
}
@media (min-width: 320px) and (max-width: 400px) {
  .shelf-masthead { flex-wrap: nowrap; }
  .shelf-masthead .library-brand { white-space: nowrap; font-size: clamp(18px, 5.4vw, 21px); }
  .shelf-masthead .library-brand > span:first-child { font-size: 16px; margin-right: 4px; }
  .shelf-masthead select { padding-inline: 6px; }
}
@media (prefers-reduced-motion:reduce) { .cover img { transition: none; } .book-card:hover img { transform: none; } }
