@font-face {
  font-family: MusicOriginal;
  src: url('/GloridaRegular-pgOKa.ttf') format('truetype');
  font-display: swap;
}

:root {
  --paper: #f9f8f4;
  --ink: #272727;
  --muted: #686868;
  --rule: #b9b9b5;
  --metal: #ddddda;
  --accent: #ff2d9a;
  --accent-soft: #ffe6f1;
  --book-width: 180px;
  --book-height: 270px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 28px;
  background-color: var(--paper);
  background-image: radial-gradient(#d5d4d0 0.7px, transparent 0.7px);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: MusicOriginal, Arial, sans-serif;
}

button, a, summary {
  touch-action: manipulation;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  padding: 12px;
  background: white;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.page-frame {
  max-width: 1420px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--rule);
  background: #f5f5f2e8;
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 30px;
  border: 1px solid #b8b8b6;
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(115deg, #eeeeec, #d2d2d0 50%, #eeeeec);
  box-shadow: inset 0 1px white;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 78px);
  font-weight: normal;
  line-height: 1.05;
  letter-spacing: -2px;
}

h1 span {
  color: var(--accent);
}

.subtitle {
  margin: 18px 0 0;
  color: #595959;
  font-size: 12px;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 19px 0 28px;
}

.site-nav a {
  padding: 7px 16px;
  border: 1px solid var(--rule);
  font-size: 11px;
  text-decoration: none;
}

.site-nav a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.shelf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-block: 1px solid var(--rule);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filters button {
  padding: 8px 13px;
  border: 1px solid transparent;
  background: transparent;
  color: #555;
  font-size: 11px;
}

.filters button:hover {
  border-color: var(--accent);
}

.filters button[aria-pressed='true'] {
  color: white;
  background: var(--accent);
}

#book-count {
  margin: 0;
  font-size: 10px;
  color: #666;
  letter-spacing: 1px;
}

.bookshelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 38px 30px;
  padding: 28px 0 42px;
}

.book-item {
  min-width: 0;
}

.book-trigger {
  list-style: none;
  cursor: pointer;
}

.book-trigger::-webkit-details-marker {
  display: none;
}

.book-number {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #c9c9c5;
  font-size: 9px;
  letter-spacing: .7px;
  color: #686868;
  text-transform: uppercase;
}

.book-number > span {
  color: var(--accent);
}

.book-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 330px;
  perspective: 1100px;
}

.book-stage::after {
  content: '';
  position: absolute;
  bottom: 22px;
  width: 150px;
  height: 12px;
  border-radius: 50%;
  background: #2224;
  filter: blur(7px);
  pointer-events: none;
}

.book-object {
  position: relative;
  display: block;
  width: var(--book-width);
  height: var(--book-height);
  transform-style: preserve-3d;
  transform: rotateY(-17deg) rotateX(3deg);
  transition: transform 450ms ease;
}

.book-back {
  position: absolute;
  inset: 0;
  border-radius: 2px 5px 5px 2px;
  background: #3c3c3c;
  transform: translateZ(-15px);
  box-shadow: 2px 5px 8px #0003;
}

.book-pages {
  position: absolute;
  inset: 3px -10px 3px 5px;
  border: 1px solid #b8b5ab;
  border-radius: 1px 3px 3px 1px;
  background: repeating-linear-gradient(90deg, #e2e0d6 0 1px, #faf8ed 1px 3px);
  transform: translateZ(-6px);
  box-shadow: 3px 2px 0 #4a4a4a;
}

.book-front {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid #0004;
  border-radius: 2px 4px 4px 2px;
  background: #424242;
  transform-origin: left center;
  transform: translateZ(1px);
  transform-style: preserve-3d;
  transition: transform 450ms ease;
  box-shadow: inset 0 0 0 1px #ffffff40, 2px 2px 4px #0003;
}

.book-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-binding {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0006, #ffffff22 3%, #0004 6%, transparent 10%, transparent 96%, #ffffff22);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .book-trigger:hover .book-object {
    transform: rotateY(-8deg) rotateX(0deg) translateY(-5px);
  }

  .book-trigger:hover .book-front {
    transform: translateZ(1px) rotateY(-20deg);
  }
}

.book-trigger:focus-visible .book-front {
  transform: translateZ(1px) rotateY(-20deg);
}

.book-caption {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.book-title {
  font-size: 21px;
  line-height: 1.25;
}

.book-author {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.open-label {
  margin-top: 4px;
  font-size: 10px;
  color: var(--accent);
}

.book-item > .entry-content {
  padding: 18px;
  margin-top: 16px;
  border: 1px solid var(--rule);
  background: white;
}

.empty-message {
  padding: 30px 0;
}

.archive-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  font-size: 9px;
  letter-spacing: 1px;
}

.reader {
  width: min(960px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #888;
  background: #d4d4d0;
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 18px 60px #0006;
}

.reader::backdrop {
  background: #171717ba;
  backdrop-filter: blur(5px);
}

body:has(.reader[open]) {
  overflow: hidden;
}

.reader-toolbar, .reader-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 14px 20px;
  font-size: 10px;
  background: linear-gradient(#eeeeeb, #cececa);
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid #aaa;
}

.reader button {
  border: 1px solid #888;
  padding: 8px 12px;
  background: #f2f2ee;
  color: #333;
}

.reader button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.reader button:disabled {
  opacity: .4;
  cursor: default;
}

.open-book {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 530px;
  margin: 25px;
  border: 1px solid #9b998e;
  border-radius: 4px 7px 7px 4px;
  background: #faf8ef;
  box-shadow: 0 3px #e7e4d9, 0 4px #aaa79c, 0 6px #eeeade, 0 7px #aaa79c, 0 13px 18px #0003;
  perspective: 1500px;
}

.left-page, .right-page {
  position: relative;
  min-width: 0;
  padding: 32px 35px 48px;
}

.left-page {
  border-right: 1px solid #d1cdbf;
  background: linear-gradient(90deg, #f2f0e6, #fffdf5 12%, #fffdf5 85%, #d9d5c8 100%);
}

.right-page {
  background: linear-gradient(90deg, #dedace, #fffdf5 10%, #fffdf5 91%, #ede9de);
}

#reader-title {
  margin: 0 0 8px;
  font: normal 30px/1.2 MusicOriginal, Arial, sans-serif;
}

#reader-author {
  font: italic 14px/1.6 MusicOriginal, Arial, sans-serif;
  color: #777061;
}

#reader-entry {
  padding-top: 18px;
  overflow-wrap: anywhere;
}

.book-review {
  font: 16px/1.85 MusicOriginal, Arial, sans-serif;
  color: #464033;
}

.book-review p {
  margin: 0 0 18px;
}

.book-review b {
  font: normal 11px MusicOriginal, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.book-review img {
  max-width: 100%;
  height: auto;
}

.page-number {
  position: absolute;
  bottom: 18px;
  left: 0;
  width: 100%;
  text-align: center;
  font: 10px Georgia, serif;
  color: #8f887a;
}

@media (max-width: 1150px) {
  .bookshelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 850px) {
  body {
    padding: 16px;
  }

  .page-frame {
    padding: 20px;
  }

  .bookshelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-header {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  .page-frame {
    padding: 14px;
  }

  .archive-header {
    padding: 22px 16px;
  }

  h1 {
    font-size: 42px;
  }

  .bookshelf {
    gap: 28px 20px;
  }

  :root {
    --book-width: 120px;
    --book-height: 180px;
  }

  .book-stage {
    height: 235px;
  }

  .book-stage::after {
    width: 110px;
  }

  .book-title {
    font-size: 17px;
  }

  .book-number {
    font-size: 8px;
    letter-spacing: 0;
    flex-wrap: wrap;
    gap: 4px;
  }

  .reader {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }

  .open-book {
    display: block;
    min-height: 0;
    margin: 14px;
  }

  .left-page, .right-page {
    padding: 25px 24px 40px;
  }

  .left-page {
    border-right: 0;
    border-bottom: 1px solid #c8c3b5;
  }

  #reader-title {
    font-size: 26px;
  }

  #reader-entry {
    padding-top: 12px;
  }

  .reader-navigation, .reader-toolbar {
    padding: 12px;
  }
}

@media (max-width: 360px) {
  .bookshelf {
    grid-template-columns: 1fr;
  }

  :root {
    --book-width: 170px;
    --book-height: 255px;
  }

  .book-stage {
    height: 310px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .book-object, .book-front {
    transition: none;
  }

  .book-trigger:hover .book-object,
  .book-trigger:hover .book-front,
  .book-trigger:focus-visible .book-front {
    transform: none;
  }
}
