:root {
  --bg: #ece6dc;
  --bg-soft: #f6f1e8;
  --surface: rgba(255, 251, 245, 0.88);
  --surface-strong: #fcfaf6;
  --text: #2f2925;
  --muted: #766b63;
  --line: rgba(62, 49, 41, 0.12);
  --shadow-soft: 0 18px 40px rgba(61, 47, 37, 0.12);
  --shadow-book: 0 26px 36px rgba(43, 31, 23, 0.18);
  --cover-texture: url("images/p0392_m.jpg");
  --cover-cloth: #8a745f;
  --cover-cloth-deep: #5f4c3d;
  --cover-label: #efe3c8;
  --radius: 16px;
  --radius-sm: 10px;
  --content-width: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(180deg, #eeeadf 0%, var(--bg) 52%, #e3ddd2 100%);
}

body.modal-open {
  overflow: hidden;
}

body.preload .hero,
body.preload .exhibit__intro,
body.preload .book-card {
  opacity: 0;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  padding: 1rem 0 2.75rem;
  animation: pageFade 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__eyebrow,
.exhibit__label,
.modal__label {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.hero__copy {
  width: min(100%, 32rem);
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.hero__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid rgba(62, 49, 41, 0.14);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 251, 245, 0.58);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.hero__action--secondary {
  background: rgba(255, 248, 238, 0.42);
  box-shadow: none;
}

.exhibit {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.exhibit__actions {
  display: flex;
  justify-content: center;
  margin-top: -0.5rem;
}

.exhibit__intro {
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 248, 242, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  animation: pageRise 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both;
}

.exhibit__description {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.95;
}

.book-stage {
  position: relative;
  z-index: 0;
  min-height: 68vh;
  display: grid;
  place-items: center;
  padding: 5.4rem 1.5rem 2.9rem;
  overflow: hidden;
  border: 1px solid rgba(77, 55, 37, 0.18);
  border-radius: calc(var(--radius) + 8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 228, 0.2),
    inset 0 0 0 10px rgba(93, 63, 42, 0.08),
    0 22px 42px rgba(61, 44, 31, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 243, 224, 0.08), rgba(56, 34, 21, 0.1)),
    repeating-linear-gradient(
      90deg,
      rgba(118, 82, 54, 0.18) 0,
      rgba(118, 82, 54, 0.18) 2px,
      rgba(97, 64, 40, 0.04) 2px,
      rgba(97, 64, 40, 0.04) 18px
    ),
    linear-gradient(135deg, #6c4a33 0%, #845a3d 20%, #71472f 48%, #5d3b29 100%);
}

.book-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 240, 216, 0.12), transparent 18%),
    linear-gradient(0deg, rgba(38, 22, 14, 0.18), transparent 24%);
}

.book-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 1.2rem;
  right: 1.2rem;
  bottom: 1.35rem;
  height: 1.2rem;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(160, 117, 81, 0.55), rgba(79, 53, 36, 0.92)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 240, 220, 0.08) 0,
      rgba(255, 240, 220, 0.08) 14px,
      rgba(49, 28, 18, 0.08) 14px,
      rgba(49, 28, 18, 0.08) 34px
    );
  box-shadow:
    0 10px 18px rgba(34, 20, 14, 0.26),
    0 3px 0 rgba(255, 238, 217, 0.1) inset;
}

.book-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  width: min(100%, 980px);
}

.shelf-tag {
  position: absolute;
  top: 0.7rem;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(76%, 420px);
  min-width: 220px;
  padding: 0.72rem 1.25rem 0.8rem;
  border: 1px solid rgba(145, 118, 87, 0.28);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(253, 247, 231, 0.97), rgba(238, 226, 196, 0.95));
  box-shadow:
    0 12px 24px rgba(49, 32, 20, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.42) inset;
  transform: translateX(-50%);
}

.shelf-tag::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(128, 101, 72, 0.04) 0,
      rgba(128, 101, 72, 0.04) 2px,
      rgba(255, 255, 255, 0) 2px,
      rgba(255, 255, 255, 0) 9px
    );
  pointer-events: none;
}

.shelf-tag__text {
  position: relative;
  color: #574536;
  font-size: 0.92rem;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.book-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
  animation: bookSettle 1200ms cubic-bezier(0.17, 0.84, 0.32, 1) 220ms both;
}

.book-card:hover,
.book-card:focus-visible {
  transform: translateY(-4px);
  filter: saturate(1.04);
}

.book-card:focus-visible {
  outline: 2px solid rgba(74, 58, 47, 0.5);
  outline-offset: 10px;
}

.book-card__shadow {
  position: absolute;
  width: 74%;
  height: 1.8rem;
  bottom: 2.2rem;
  border-radius: 50%;
  background: rgba(61, 47, 37, 0.18);
  filter: blur(14px);
}

.book-card__cover {
  position: relative;
  width: min(100%, 240px);
  aspect-ratio: 3 / 4.35;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: var(--shadow-book);
  background:
    var(--cover-texture) center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 6px,
      rgba(0, 0, 0, 0.02) 6px,
      rgba(0, 0, 0, 0.02) 12px
    ),
    linear-gradient(135deg, var(--cover-cloth), var(--cover-cloth-deep));
}

.book-card__caption {
  display: none;
}

.book-card__title-chip {
  position: absolute;
  left: 50%;
  top: 11%;
  z-index: 2;
  width: min(54vw, 180px);
  min-height: 2.6rem;
  padding: 0.55rem 0.9rem;
  transform: translateX(-50%);
  border: 1px solid rgba(92, 72, 55, 0.16);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(233, 220, 191, 0.96));
  box-shadow: 0 10px 20px rgba(62, 49, 41, 0.08);
  pointer-events: none;
}

.book-card__title-text {
  display: -webkit-box;
  overflow: hidden;
  color: #4e4035;
  font-size: 0.82rem;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-card__description-chip {
  position: absolute;
  left: 50%;
  bottom: 1.45rem;
  z-index: 2;
  width: min(66vw, 258px);
  min-height: 5.95rem;
  padding: 0.72rem 0.92rem;
  transform: translateX(-50%);
  border: 1px solid rgba(92, 72, 55, 0.14);
  border-radius: 4px;
  background: rgba(248, 242, 232, 0.92);
  box-shadow: 0 10px 20px rgba(62, 49, 41, 0.08);
  pointer-events: none;
}

.book-grid .book-card:nth-child(1) {
  transform: translateY(10px) rotate(-2deg);
}

.book-grid .book-card:nth-child(2) {
  transform: translateY(-6px);
}

.book-grid .book-card:nth-child(3) {
  transform: translateY(16px) rotate(2deg);
}

.book-stage--capture .book-card {
  opacity: 1 !important;
  animation: none !important;
  filter: none !important;
}

.book-stage--capture .book-card:nth-child(1) {
  transform: translateY(10px) rotate(-2deg) !important;
}

.book-stage--capture .book-card:nth-child(2) {
  transform: translateY(-6px) !important;
}

.book-stage--capture .book-card:nth-child(3) {
  transform: translateY(16px) rotate(2deg) !important;
}

.book-card__description-text {
  display: -webkit-box;
  overflow: hidden;
  color: #5f5349;
  font-size: 0.76rem;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.is-fallback {
  position: relative;
  overflow: hidden;
}

.is-fallback::after {
  content: "sample-book.jpg";
  position: absolute;
  inset: auto 1rem 1rem;
  color: rgba(255, 248, 240, 0.9);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(41, 31, 23, 0.38);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid rgba(70, 57, 48, 0.08);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: 0 30px 80px rgba(32, 23, 17, 0.2);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 240ms ease, transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.modal__panel:focus {
  outline: none;
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
}

.modal__content {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 1.6rem;
  align-items: start;
  margin-top: 1rem;
  perspective: 1800px;
}

.modal__book-stage {
  position: relative;
  padding: 1rem 1rem 1rem 0.5rem;
  min-height: 26rem;
  perspective: 1800px;
}

.modal__page-stack {
  position: absolute;
  inset: 1.2rem 1rem 1.2rem 1.35rem;
  border-radius: 8px 12px 12px 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(240, 234, 226, 0.98));
  box-shadow:
    inset 1px 0 0 rgba(106, 90, 73, 0.12),
    18px 14px 28px rgba(58, 45, 35, 0.12);
}

.modal__page-stack::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(131, 112, 92, 0.15), rgba(255, 255, 255, 0) 18%),
    repeating-linear-gradient(
      180deg,
      rgba(162, 144, 124, 0.1) 0,
      rgba(162, 144, 124, 0.1) 2px,
      rgba(255, 251, 246, 0.92) 2px,
      rgba(255, 251, 246, 0.92) 8px
    );
  opacity: 0.75;
}

.modal__cover-wrap {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 0.8rem;
  border-radius: 8px 16px 16px 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.modal__cover {
  width: 100%;
  aspect-ratio: 3 / 4.35;
  object-fit: cover;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 6px,
      rgba(0, 0, 0, 0.02) 6px,
      rgba(0, 0, 0, 0.02) 12px
    ),
    linear-gradient(135deg, var(--cover-cloth), var(--cover-cloth-deep));
}

.modal__cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(44, 33, 25, 0.28), rgba(44, 33, 25, 0) 12%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.modal__cover-wrap::before {
  content: "";
  position: absolute;
  top: 12%;
  left: 50%;
  width: 42%;
  height: 14%;
  transform: translateX(-50%);
  border: 1px solid rgba(92, 72, 55, 0.16);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.94), rgba(233, 220, 191, 0.96));
  box-shadow: 0 6px 16px rgba(62, 49, 41, 0.08);
}

.modal__cover-wrap::before {
  z-index: 2;
}

.modal__title {
  margin: 0;
  font-size: clamp(1.5rem, 3.8vw, 2.3rem);
  font-weight: 500;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
}

.modal__author,
.modal__isbn {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.8;
  opacity: 0;
  transform: translateY(10px);
}

.modal__comment {
  margin: 1.5rem 0 0;
  line-height: 2;
  white-space: pre-wrap;
  opacity: 0;
  transform: translateY(10px);
}

.modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  align-self: start;
  border-radius: 999px;
  background: #4e4035;
  color: #fbf7f1;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(53, 40, 31, 0.18);
  opacity: 1;
  transform: none;
}

.modal__links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal__custom-link-group {
  display: grid;
  gap: 0.5rem;
  align-items: start;
  justify-items: start;
}

.modal__custom-url {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal__link:hover,
.modal__link:focus-visible {
  background: #3f332a;
}

.modal__link--subtle {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(62, 49, 41, 0.14);
}

.modal__link--subtle:hover,
.modal__link--subtle:focus-visible {
  background: rgba(250, 245, 238, 0.94);
}

.modal__panel--share {
  width: min(100%, 860px);
}

.share-sheet {
  display: grid;
  gap: 1rem;
  justify-items: center;
  margin-top: 1rem;
  text-align: center;
}

.share-sheet__copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.share-sheet__preview-wrap {
  display: grid;
  place-items: center;
  width: min(100%, 760px);
  min-width: 320px;
  min-height: 420px;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.share-sheet__preview {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  box-shadow: 0 18px 36px rgba(40, 28, 20, 0.14);
}

.share-sheet__url {
  margin: 0;
  color: var(--muted);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.share-sheet__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.site-signature {
  margin-top: 2.2rem;
  text-align: center;
}

.site-signature__link {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-signature__link:hover,
.site-signature__link:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.editor {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(251, 248, 242, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.editor__label {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.editor__title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.6;
}

.editor__description {
  width: min(100%, 42rem);
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.9;
}

.editor__form {
  margin-top: 1.5rem;
}

.editor__switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.editor__switcher--inline {
  grid-column: 1 / -1;
  margin-top: -0.1rem;
}

.editor__switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(62, 49, 41, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  cursor: pointer;
}

.editor__switch-button.is-active {
  background: #4e4035;
  color: #fbf7f1;
  box-shadow: 0 14px 28px rgba(53, 40, 31, 0.12);
}

.editor__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.editor__field {
  display: grid;
  gap: 0.45rem;
}

.editor__field--wide {
  grid-column: 1 / -1;
}

.editor__field-label {
  font-size: 0.92rem;
  color: var(--text);
}

.editor__field input,
.editor__field textarea,
.editor__field select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(62, 49, 41, 0.14);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  line-height: 1.7;
}

.editor__field textarea {
  resize: vertical;
  min-height: 6rem;
}

.editor__field input:focus,
.editor__field textarea:focus,
.editor__field select:focus {
  outline: 2px solid rgba(83, 66, 54, 0.18);
  border-color: rgba(83, 66, 54, 0.24);
}

.editor__field input:disabled,
.editor__field textarea:disabled,
.editor__field select:disabled {
  color: rgba(47, 41, 37, 0.5);
  background: rgba(240, 234, 226, 0.7);
  cursor: not-allowed;
}

.editor__help {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.editor__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0;
  border: 0;
  margin: 0;
}

.editor__check {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text);
  line-height: 1.5;
  white-space: nowrap;
}

.editor__field--hidden,
.editor__check--hidden {
  display: none;
}

.editor__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  border: 0;
  margin: 0;
}

.editor__chips {
  grid-column: 1 / 2;
}

.editor__chips[hidden] {
  display: none !important;
}

.cover-chip {
  position: relative;
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  width: 4.8rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease;
}

.cover-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cover-chip__swatch {
  display: block;
  width: 3.2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 251, 245, 0.85);
  box-shadow: 0 10px 18px rgba(53, 40, 31, 0.14);
  background:
    url("images/p0392_m.jpg") center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 6px,
      rgba(0, 0, 0, 0.02) 6px,
      rgba(0, 0, 0, 0.02) 12px
    ),
    linear-gradient(135deg, #8a745f, #5f4c3d);
}

.cover-chip__swatch--cloth-green {
  background:
    url("images/p0420_m.jpg") center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 6px,
      rgba(0, 0, 0, 0.02) 6px,
      rgba(0, 0, 0, 0.02) 12px
    ),
    linear-gradient(135deg, #6f7f62, #45523c);
}

.cover-chip__swatch--paper-ivory {
  background:
    url("images/p0429_m.jpg") center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      180deg,
      rgba(168, 152, 129, 0.08) 0,
      rgba(168, 152, 129, 0.08) 2px,
      rgba(255, 251, 245, 0.92) 2px,
      rgba(255, 251, 245, 0.92) 9px
    ),
    linear-gradient(135deg, #d8cfbd, #b3a893);
}

.cover-chip__swatch--paper-gray {
  background:
    url("images/p0438_m.jpg") center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      180deg,
      rgba(124, 120, 113, 0.08) 0,
      rgba(124, 120, 113, 0.08) 2px,
      rgba(244, 241, 237, 0.88) 2px,
      rgba(244, 241, 237, 0.88) 9px
    ),
    linear-gradient(135deg, #b8b4ad, #888177);
}

.cover-chip__swatch--leather-navy {
  background:
    url("images/p0445_m.jpg") center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 10px,
      rgba(0, 0, 0, 0.03) 10px,
      rgba(0, 0, 0, 0.03) 18px
    ),
    linear-gradient(135deg, #445565, #293745);
}

.cover-chip__label {
  color: var(--text);
  font-size: 0.73rem;
  line-height: 1.35;
  text-align: center;
}

.cover-chip:has(input:checked) {
  transform: translateY(-1px);
}

.cover-chip:has(input:checked) .cover-chip__swatch {
  border-color: rgba(78, 64, 53, 0.7);
  box-shadow:
    0 0 0 4px rgba(78, 64, 53, 0.12),
    0 12px 22px rgba(53, 40, 31, 0.16);
}

.cover-chip:has(input:checked) .cover-chip__label {
  color: #4e4035;
}

.cover-chip:has(input:focus-visible) {
  outline: 2px solid rgba(83, 66, 54, 0.18);
  outline-offset: 2px;
}

.editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.editor__inline {
  display: grid;
  grid-template-columns: fit-content(20ch) auto;
  gap: 0.6rem;
  justify-content: start;
}

#book-isbn {
  width: min(100%, 20ch);
}

#book-label {
  width: min(100%, 22em);
}

#book-comment {
  width: min(100%, 19em);
}

.editor__mini-button {
  min-width: 4.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(62, 49, 41, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
}

.editor__mini-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.editor__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(62, 49, 41, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
}

.editor__button--primary {
  background: #4e4035;
  color: #fbf7f1;
  box-shadow: 0 14px 28px rgba(53, 40, 31, 0.18);
}

.editor__status {
  min-height: 1.6rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.search-results {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.15rem;
}

.search-results__item {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(62, 49, 41, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-results__title {
  font-size: 0.95rem;
  line-height: 1.5;
}

.search-results__meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.modal.is-open .modal__cover-wrap {
  animation: coverOpen 920ms cubic-bezier(0.18, 0.86, 0.24, 1) 70ms both;
}

.modal.is-open .modal__title {
  animation: detailFade 480ms ease 420ms both;
}

.book-card[data-cover-theme="cloth-green"] {
  --cover-texture: url("images/p0420_m.jpg");
  --cover-cloth: #6f7f62;
  --cover-cloth-deep: #45523c;
}

.book-card[data-cover-theme="paper-ivory"] {
  --cover-texture: url("images/p0429_m.jpg");
  --cover-cloth: #d8cfbd;
  --cover-cloth-deep: #b3a893;
}

.book-card[data-cover-theme="paper-gray"] {
  --cover-texture: url("images/p0438_m.jpg");
  --cover-cloth: #b8b4ad;
  --cover-cloth-deep: #888177;
}

.book-card[data-cover-theme="leather-navy"] {
  --cover-texture: url("images/p0445_m.jpg");
  --cover-cloth: #445565;
  --cover-cloth-deep: #293745;
}

.modal__book-stage[data-cover-theme="cloth-green"] {
  --cover-texture: url("images/p0420_m.jpg");
  --cover-cloth: #6f7f62;
  --cover-cloth-deep: #45523c;
}

.modal__book-stage[data-cover-theme="paper-ivory"] {
  --cover-texture: url("images/p0429_m.jpg");
  --cover-cloth: #d8cfbd;
  --cover-cloth-deep: #b3a893;
}

.modal__book-stage[data-cover-theme="paper-gray"] {
  --cover-texture: url("images/p0438_m.jpg");
  --cover-cloth: #b8b4ad;
  --cover-cloth-deep: #888177;
}

.modal__book-stage[data-cover-theme="leather-navy"] {
  --cover-texture: url("images/p0445_m.jpg");
  --cover-cloth: #445565;
  --cover-cloth-deep: #293745;
}

.modal__cover-wrap {
  background:
    var(--cover-texture) center / cover,
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 6px,
      rgba(0, 0, 0, 0.02) 6px,
      rgba(0, 0, 0, 0.02) 12px
    ),
    linear-gradient(135deg, var(--cover-cloth), var(--cover-cloth-deep));
}

.modal__cover {
  background: transparent;
}

.modal.is-open .modal__author,
.modal.is-open .modal__isbn {
  animation: detailFade 480ms ease 500ms both;
}

.modal.is-open .modal__comment {
  animation: detailFade 560ms ease 580ms both;
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageRise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bookSettle {
  from {
    opacity: 0;
    transform: translateY(32px) rotateX(14deg) scale(0.96);
    filter: blur(4px);
  }
  65% {
    opacity: 1;
    transform: translateY(-4px) rotateX(0deg) scale(1.01);
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes coverOpen {
  from {
    transform: rotateY(0deg);
    box-shadow: var(--shadow-soft);
  }
  55% {
    transform: rotateY(-105deg);
    box-shadow: 24px 20px 36px rgba(39, 28, 20, 0.16);
  }
  to {
    transform: rotateY(-98deg);
    box-shadow: 18px 18px 28px rgba(39, 28, 20, 0.12);
  }
}

@keyframes detailFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  body.preload .hero,
  body.preload .exhibit__intro,
  body.preload .book-card {
    opacity: 1;
  }

  .modal__title,
  .modal__author,
  .modal__isbn,
  .modal__comment,
  .modal__link {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 1.25rem), var(--content-width));
    padding-top: 2rem;
  }

  .hero {
    padding-bottom: 2rem;
  }

  .exhibit__intro,
  .modal__panel {
    padding: 1rem;
  }

  .book-stage {
    min-height: auto;
    padding-top: 4.75rem;
  }

  .shelf-tag {
    top: 0.55rem;
    left: 50%;
    max-width: calc(100% - 1.7rem);
    min-width: 0;
    padding: 0.68rem 0.9rem 0.74rem;
  }

  .book-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: min(100%, 320px);
  }

  .book-grid .book-card:nth-child(1),
  .book-grid .book-card:nth-child(2),
  .book-grid .book-card:nth-child(3) {
    transform: none;
  }

  .modal__content {
    grid-template-columns: 1fr;
  }

  .editor {
    margin-top: 2rem;
    padding: 1rem;
  }

  .editor__grid {
    grid-template-columns: 1fr;
  }

  .editor__chips {
    grid-column: 1 / -1;
  }

  .cover-chip {
    width: 4.25rem;
  }

  .modal__book-stage {
    min-height: 0;
    max-width: 320px;
    padding-right: 0;
  }

  .modal__page-stack {
    inset: 1.2rem 0.2rem 1.2rem 1rem;
  }
}
