/* The bookshelf lives beside the existing book, using the same chalk palette. */
body.shelved #cover, body:not(.shelved) #shelf { display: none; }
#shelf { max-width: 1200px; padding: 0 48px; margin: 0 auto; }
.shelf-top { display: flex; justify-content: space-between; align-items: center; min-height: 98px; border-bottom: 1px solid #ece8dc24; gap: 20px; }
.shelf-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 20px; font-weight: 600; letter-spacing: -.6px; }
.brand-mark { font: 36px/.8 var(--book); color: var(--task); }
.brand-dot { width: 5px; height: 5px; background: var(--task); border-radius: 50%; align-self: flex-end; margin-bottom: 7px; margin-left: -4px; }
.shelf-top-note { font: italic 16px var(--book); color: var(--dim); }
.shelf-intro { padding: 65px 0 47px; position: relative; }
.shelf-eyebrow { display: flex; align-items: center; gap: 9px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .19em; font-weight: 600; margin: 0 0 21px; }
.shelf-eyebrow span { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 12px #8fd6b035; }
#shelf-title { font: 400 clamp(52px, 6.4vw, 80px)/1.02 var(--book); letter-spacing: -.045em; margin: 0 0 23px; view-transition-name: none; }
#shelf-title em { color: var(--task); font-weight: 400; }
.shelf-intro > p:last-of-type { color: var(--dim); font-size: 17px; line-height: 1.65; margin: 0; }
.intro-doodle { position: absolute; width: 170px; right: 48px; top: 96px; color: var(--chalk); opacity: .3; rotate: -8deg; }
.doodle-line { stroke-dasharray: 1; animation: shelf-ink 1.6s ease-out .3s backwards; }
.collection-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid #ece8dc24; padding-bottom: 15px; }
.collection-heading h2 { margin: 0; font: 400 24px/1.2 var(--book); }
#shelf-count { font-size: 12px; color: var(--dim); }
.shelf-book { display: grid; grid-template-columns: 43% 1fr; gap: 56px; padding: 51px 0 56px; align-items: center; }
.shelf-book + .shelf-book { border-top: 1px solid #ece8dc24; }
.book-display { position: relative; display: flex; justify-content: center; padding: 10px 20px 31px; perspective: 1100px; }
.book-object { display: block; position: relative; width: 255px; height: 336px; flex-shrink: 0; text-decoration: none; transform-style: preserve-3d; transform: rotateY(-14deg) rotateZ(-3deg); transition: transform .55s var(--ease); }
.book-object:hover, .book-object:focus-visible { transform: rotateY(-24deg) rotateZ(-1deg) translateY(-7px); }
.book-object:focus-visible { outline-offset: 12px; }
.book-front { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 28px 25px 22px; border: 1px solid #8bb39770; border-left: 11px solid #244333; border-radius: 3px 7px 7px 3px; background: linear-gradient(100deg, #1c3329, #345644 50%, #2e4c3c); box-shadow: inset 3px 0 4px #0c241c70, inset -1px 0 2px #92b49330, 17px 20px 24px #09171060; transform: translateZ(12px); overflow: hidden; }
.book-front::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, #ffffe510 48%, transparent 60%); }
.book-pages { position: absolute; left: 8px; top: 3px; width: 100%; height: calc(100% - 6px); background: repeating-linear-gradient(0deg, #d0c9b4 0 1px, #e9e2ce 1px 3px); border-radius: 3px 8px 8px 3px; transform: translateZ(-9px); box-shadow: 14px 18px 25px #08110e70; }
.book-pages::after { content: ''; position: absolute; width: 20px; height: 100%; right: -1px; transform-origin: right center; transform: rotateY(90deg); background: repeating-linear-gradient(90deg, #cbc4ad 0 1px, #eee8d4 1px 3px); }
.book-series { color: #c6d7c7; font-size: 8px; font-weight: 600; letter-spacing: .19em; text-transform: uppercase; }
.book-cover-title { display: flex; flex-direction: column; margin-top: 22px; font: 400 31px/1.17 var(--book); letter-spacing: -.8px; color: #eeeade; }
.book-cover-title i { color: #f2c078; }
.book-picture { margin: 15px -11px 0; flex: 1; display: flex; align-items: center; }
.book-art { width: 100%; height: auto; overflow: visible; }
.book-curve { stroke-dasharray: 1; animation: shelf-ink 2s var(--ease) .5s backwards; }
.curve-point { animation: shelf-point 5s ease-in-out 2.5s infinite; }
.book-cover-bottom { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; color: #c6d7c7; padding-top: 8px; border-top: 1px solid #c6d7c74a; }
.shelf-plank { position: absolute; bottom: 14px; left: 0; right: 0; height: 10px; background: linear-gradient(#536052, #303e33); border-radius: 3px; border-top: 1px solid #9ea8925e; box-shadow: 0 16px 24px #07100c55; }
.shelf-plank::before { content: ''; position: absolute; bottom: 10px; left: 6%; right: 6%; height: 28px; background: radial-gradient(ellipse, #07100c6e, transparent 70%); }
.book-category { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--good); }
.category-mark { border: 1px solid #8fd6b040; width: 25px; height: 25px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; letter-spacing: 0; border-radius: 50%; }
.book-info h3 { margin: 0 0 14px; font: 400 clamp(29px, 3vw, 38px)/1.15 var(--book); letter-spacing: -.02em; text-wrap: balance; }
.book-title-link { text-decoration: none; }
.book-title-link:hover { color: var(--task); }
.book-description { color: var(--dim); font-size: 16px; line-height: 1.65; max-width: 28em; margin: 0 0 15px; }
.book-facts { color: #c0c9bb; font-size: 11px; margin: 0 0 23px; }
.book-features { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 6px; font-size: 13px; color: var(--chalk); }
.feature-tick { display: inline-block; color: var(--task); margin-right: 12px; }
.book-actions { display: flex; flex-wrap: wrap; gap: 15px 20px; align-items: center; }
.shelf-open { display: inline-flex; align-items: center; gap: 18px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid #ece8dc66; color: var(--chalk); font: 500 18px/1.3 var(--book); text-decoration: none; transition: color .25s, border-color .25s; }
.shelf-open:hover { color: var(--task); border-color: var(--task); }
.shelf-open span { font: 400 20px var(--ui); transition: transform .25s var(--ease); }
.shelf-open:hover span { transform: translateX(4px); }
.shelf-continue { font-size: 12px; color: var(--good); text-decoration: none; }
.shelf-continue:hover { text-decoration: underline; }
.shelf-progress { font-size: 11px; color: var(--dim); margin: -10px 0 16px; }
.shelf-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 27px; border-top: 1px solid #ece8dc24; color: var(--dim); font-size: 11px; }
.footer-star { display: inline-block; color: var(--task); margin-left: 12px; }
.back-shelf { color: var(--dim); font: 13px var(--ui); text-decoration: none; white-space: nowrap; }
.back-shelf:hover { color: var(--chalk); }
.cover-back { position: absolute; top: 24px; left: 24px; }
.contents-back { margin-left: 16px; }
@keyframes shelf-ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes shelf-point { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(19px, 9px); } }
@media (max-width: 850px) {
  #shelf { padding: 0 28px; }
  .shelf-book { gap: 32px; grid-template-columns: 42% 1fr; }
  .book-object { width: 224px; height: 302px; }
  .book-front { padding: 24px 20px 20px; }
  .book-cover-title { font-size: 27px; }
  .intro-doodle { right: 8px; }
}
@media (max-width: 600px) {
  #shelf { padding: 0 22px; }
  .shelf-top { min-height: 74px; }
  .shelf-top-note { display: none; }
  .shelf-intro { padding: 43px 0 36px; }
  #shelf-title { font-size: 59px; }
  .shelf-intro > p:last-of-type { font-size: 15px; }
  .intro-doodle { width: 104px; top: 101px; right: -8px; opacity: .16; }
  .collection-heading h2 { font-size: 21px; }
  #shelf-count { font-size: 10px; }
  .shelf-book { display: flex; flex-direction: column; gap: 30px; padding: 37px 0 40px; align-items: stretch; }
  .book-display { max-width: 350px; width: 100%; margin: 0 auto; }
  .book-object { width: 224px; height: 302px; }
  .book-info h3 { font-size: 31px; }
  .book-description { font-size: 15px; }
  .book-facts { font-size: 11px; }
  .book-features { margin-bottom: 22px; }
  .shelf-footer { flex-direction: column; gap: 9px; font-size: 10px; }
  .contents-back { margin-left: 0; font-size: 11px; }
  #contents .top { flex-wrap: wrap; gap: 8px 12px; }
  #contents .prog { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-object { transition: none; }
  .book-object:hover, .book-object:focus-visible { transform: rotateY(-14deg) rotateZ(-3deg); }
  .book-curve, .doodle-line, .curve-point { animation: none; }
}
