@font-face {
  font-family: Allura;
  src: url("assets/allura-latin.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
:root { --ink: #382f24; --muted-ink: #66553e; }
.paper-ground {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 16% 12%, #f4ecd8, transparent 57%),
    radial-gradient(ellipse at 76% 38%, #d4d3b9, transparent 54%),
    linear-gradient(115deg, #e9d7af, #efe3c7 56%, #dac49e);
}
.paper-wash { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.paper-wash:not(.live) {
  background: radial-gradient(ellipse at 75% 60%, #9fae9d88, transparent 48%),
    radial-gradient(ellipse at 31% 38%, #fff3d688, transparent 48%);
  animation: paper-light 36s ease-in-out infinite alternate;
}
@keyframes paper-light { from { opacity: .18; } to { opacity: .86; } }
.motion-off .paper-wash:not(.live) { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .paper-wash:not(.live) { animation: none; opacity: .4; } }
.paper-ground::before, .paper-ground::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.paper-ground::before {
  z-index: 1;
  background-image: url("assets/paper-grain.svg");
  background-size: 216px;
  mix-blend-mode: multiply;
  opacity: .20;
}
.paper-ground::after {
  z-index: 2;
  background: linear-gradient(90deg, #765f3638, transparent 2.4%, #fff4c91c 5%, transparent 8% 94%, #84653b21 98%, #6d532b38);
  box-shadow: inset 0 0 54px #96733320;
}
.shelf-page {
  margin: 0;
  color: var(--ink);
  font: 16px Georgia, "Times New Roman", serif;
  color-scheme: light;
  background: #e9dfc5;
}
.shelf-page *, .shelf-page *::before, .shelf-page *::after { box-sizing: border-box; }
.library {
  --margin: clamp(19px, 3.8vw, 68px);
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 30px);
  margin: 15px;
  padding: clamp(22px, 4.5vh, 46px) var(--margin) max(90px, 12vh);
  border: 1px solid #806b4460;
  outline: 1px solid #806b442c;
  outline-offset: -5px;
}
.library::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/celestial-plate.svg") no-repeat right -140px bottom -165px / clamp(360px, 42vw, 680px);
  opacity: .28;
}
.shelf-header, .book-signature, .collection-rule { display: flex; align-items: center; }
.shelf-header { justify-content: space-between; gap: 12px; }
.book-signature { gap: 14px; }
.book-signature img { width: 43px; height: 50px; }
.shelf-header h1 { font-size: clamp(23px, 2.15vw, 32px); font-weight: 400; letter-spacing: -.045em; line-height: 1.15; margin: 0; }
.shelf-header h1 em { font-weight: 400; color: #6c5238; }
.shelf-header p { font: 12px/1.5 Georgia, serif; color: var(--muted-ink); margin: 4px 0 0; }
#shelf-motion {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 5px 10px; border: 1px solid #856e4f68; border-radius: 3px;
  color: #534631; background: #f7efd520; font: 11px/1.3 Georgia, serif; cursor: pointer;
}
#shelf-motion[hidden] { display: none; }
#shelf-motion:disabled { cursor: default; }
.motion-icon { width: 7px; height: 8px; border-inline: 2px solid currentColor; }
#shelf-motion[aria-pressed="true"] .motion-icon { width: 0; height: 0; border: 4px solid transparent; border-left: 6px solid currentColor; border-right: 0; }
.collection { margin-top: clamp(38px, 8vh, 92px); }
.collection-rule { gap: 14px; color: #67563e; }
.collection-rule h2, .collection-rule > span:last-child {
  margin: 0; font: 600 10px/1.4 Arial, sans-serif; letter-spacing: .17em; text-transform: uppercase;
}
.collection-rule > span:last-child { letter-spacing: .04em; font: italic 13px Georgia, serif; text-transform: none; }
.collection-rule .rule { height: 3px; flex: 1; border-top: 1px solid #7b694d77; border-bottom: 1px solid #7b694d30; }
.shelf-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 23px 3px 14px; scrollbar-color: #90764ead #e1d1af; scrollbar-width: thin; }
.shelf-row {
  --gap: 7px;
  --cover-scale: .122;
  --card-width: calc(660px * var(--cover-scale));
  --card-height: calc(var(--card-width) * 1.4);
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: start;
  gap: var(--gap);
  min-width: 995px;
  padding-top: 8px;
}
.shelf-row + .shelf-row { margin-top: 32px; }
.shelf-item { position: relative; min-width: 0; text-align: center; }
.exhibit { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; }
.exhibit:focus-visible, #shelf-motion:focus-visible, .shelf-scroll:focus-visible { outline: 2px solid #694522; outline-offset: 1px; border-radius: 4px; }
.cover {
  width: var(--card-width); height: var(--card-height);
  position: relative; text-align: left;
  border-radius: 4px; box-shadow: 1px 2px 0 #78654b, 2px 5px 8px #51402650;
  animation: museum-turn 14s ease-in-out infinite;
}
@keyframes museum-turn {
  0%, 100% {
    --pointer-x: 23%;
    transform: perspective(460px) translateY(1px) rotateY(-15deg);
    box-shadow: 1px 2px 0 #796751, 4px 5px 7px #513d2942;
  }
  50% {
    --pointer-x: 76%;
    transform: perspective(460px) translateY(-2px) rotateY(17deg);
    box-shadow: -1px 2px 0 #796751, -3px 8px 10px #513d2938;
  }
}
.shelf-item:nth-child(3n + 2) .cover { animation-delay: -4s; }
.shelf-item:nth-child(3n) .cover { animation-delay: -8s; }
.exhibit:is(:hover, :focus-visible) .cover { animation-play-state: paused; }
.cover-frame {
  position: absolute; top: 0; left: 0; width: 660px; height: 924px; padding: 13px;
  border-radius: 26px; background: linear-gradient(118deg,#ac9464,#ead8a8 38%,#b49a66 70%,#dfc998);
  transform-origin: top left; transform: scale(var(--cover-scale));
}
.cover .card-header { padding: 8px 18px; }
.cover .basic-badge { font-size: 21px; }
.cover .card-year { font-size: 20px; }
.cover .author-photo { width: 70px; height: 70px; }
.cover .card-art { height: 235px; }
.cover .card-art figcaption, .cover .art-sparkles { display: none; }
.cover .card-body { padding: 0 16px 7px; }
.cover .story-label { font-size: 12px; padding: 9px 0 7px; }
.cover .story-label span:last-child { display: none; }
.cover .card-signature { padding: 8px 18px 12px; }
.cover .card-signature h3 { font-size: 63px; }
.cover .signature-details > span { font-size: 24px; }
.cover .signature-details small { font-size: 14px; }
@media (min-width: 1230px) { .shelf-row { --cover-scale: .145; } }
@media (min-width: 1450px) { .shelf-row { --cover-scale: .16; } }
@media (min-width: 1650px) { .shelf-row { --cover-scale: .178; } }
.motion-off .cover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .cover { animation: none; } }
@media (max-width: 600px) {
  .library { margin: 7px; min-height: calc(100svh - 14px); --margin: 13px; }
  .book-signature { gap: 8px; }
  .book-signature img { width: 32px; height: 38px; }
  .shelf-header h1 { font-size: 23px; }
  .shelf-header p { font-size: 11px; }
  #shelf-motion { padding: 5px 7px; font-size: 10px; gap: 5px; }
  .library::before { background-position: right -165px bottom -94px; }
}
@media screen {
  .canvas { background: #e7d9b9; }
  .canvas > .paper-ground { z-index: -1; }
  .canvas::after { display: none; }
  .canvas-tools :is(.interaction-note, .keyboard-note) { color: #483b2a; text-shadow: none; }
}
@media print { .paper-ground, #shelf-motion { display: none !important; } .cover { animation: none; } }
