body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(157, 101, 57, 0.12), transparent 32rem),
    #262722;
}

.reader-ui {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(29, 30, 27, 0.95);
  color: #f5efe4;
  font-family: Arial, Helvetica, sans-serif;
  backdrop-filter: blur(16px);
}

.reader-ui__title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.reader-ui__title strong {
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-ui__title span {
  color: #bfb6a8;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-ui__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.reader-ui button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  cursor: pointer;
  font: 600 11px/1 Arial, sans-serif;
  letter-spacing: 0.035em;
}

.reader-ui button:hover,
.reader-ui button[aria-pressed="true"] {
  border-color: #d6a06f;
  background: #9f6539;
}

.reader-ui__reading {
  display: none;
}

.book {
  display: flex;
  width: min-content;
  flex-direction: column;
  gap: 28px;
  margin: 34px auto 80px;
}

.spread {
  display: grid;
  width: calc(var(--page-width) * 2);
  grid-template-columns: repeat(2, var(--page-width));
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.34));
}

.spread--single {
  width: calc(var(--page-width) * 2);
}

.spread--single::before {
  content: "";
  display: block;
}

.page {
  outline: 1px solid rgba(0, 0, 0, 0.22);
}

.spread .page--verso {
  box-shadow: inset -18px 0 24px -27px rgba(0, 0, 0, 0.8);
}

.spread .page--recto {
  box-shadow: inset 18px 0 24px -27px rgba(0, 0, 0, 0.8);
}

.prototype-image::before {
  display: none;
  content: attr(data-scene);
  position: absolute;
  z-index: 2;
  top: 0.07in;
  left: 0.07in;
  padding: 3px 5px;
  border-radius: 2px;
  background: rgba(22, 29, 25, 0.76);
  color: white;
  font: 600 6px/1 Arial, sans-serif;
  letter-spacing: 0.05em;
}

.diagnostic .prototype-image::before {
  display: block;
}

.diagnostic .page {
  outline: 2px solid var(--trim);
}

.diagnostic .page::after {
  content: "ZONE SÛRE";
  position: absolute;
  z-index: 20;
  inset: 0.42in 0.38in 0.48in;
  border: 1px dashed var(--safe);
  color: var(--safe);
  font: 600 6px/1 Arial, sans-serif;
  letter-spacing: 0.09em;
  pointer-events: none;
  text-align: right;
}

.diagnostic .page--recto::before,
.diagnostic .page--verso::before {
  position: absolute;
  z-index: 21;
  top: 0;
  bottom: 0;
  width: 0.70in;
  content: "RELIURE";
  display: grid;
  place-items: center;
  background: rgba(159, 101, 57, 0.10);
  color: var(--ochre);
  font: 600 6px/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.diagnostic .page--recto::before {
  left: 0;
}

.diagnostic .page--verso::before {
  right: 0;
}

.diagnostic .diagnostic-label,
.diagnostic .diagnostic-only {
  display: block;
}

.diagnostic-label {
  position: absolute;
  z-index: 30;
  right: 0.08in;
  bottom: 0.08in;
  max-width: 2.7in;
  padding: 4px 6px;
  background: rgba(124, 37, 29, 0.88);
  color: white;
  font: 600 6px/1.25 Arial, sans-serif;
}

@media (max-width: 1150px) {
  .spread {
    width: 898.56px;
    grid-template-columns: repeat(2, 449.28px);
  }

  .spread--single {
    width: 898.56px;
  }

  .page {
    zoom: 0.78;
  }
}

@media (max-width: 980px) {
  .reader-ui {
    align-items: flex-start;
  }

  .reader-ui__title span {
    display: none;
  }

  .book {
    width: 100%;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
  }

  .spread,
  .spread--single {
    display: flex;
    width: var(--mobile-page-width, calc(100vw - 24px));
    flex-direction: column;
    align-items: center;
    gap: 20px;
    filter: none;
  }

  .spread--single::before {
    display: none;
  }

  .page {
    flex: 0 0 auto;
    zoom: var(--mobile-page-scale, 0.70);
  }

  .reader-ui__reading {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .reader-ui {
    position: sticky;
    flex-direction: column;
    gap: 7px;
    padding: 8px 10px;
  }

  .reader-ui__title,
  .reader-ui__actions {
    width: 100%;
  }

  .reader-ui__title {
    justify-content: center;
  }

  .reader-ui__actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .reader-ui__progress {
    width: 100%;
    min-width: 0;
    padding-bottom: 1px;
    text-align: center;
  }

  .reader-ui button {
    min-height: 38px;
    flex: 1 1 calc(50% - 6px);
    padding-inline: 8px;
  }
}

@media screen and (max-width: 980px) {
  html.reading-mode .book {
    width: 100%;
    max-width: 44rem;
    align-items: stretch;
    padding-inline: 12px;
  }

  html.reading-mode .spread,
  html.reading-mode .spread--single {
    width: 100%;
    align-items: stretch;
    gap: 16px;
  }

  html.reading-mode .page {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    zoom: 1;
    border-radius: 3px;
  }

  html.reading-mode .page--blank {
    display: none;
  }

  html.reading-mode .page__content,
  html.reading-mode .page--recto .page__content,
  html.reading-mode .page--verso .page__content,
  html.reading-mode .page--front .page__content,
  html.reading-mode .page--chapter .page__content {
    position: relative;
    inset: auto;
    padding: 24px 22px 30px;
  }

  html.reading-mode .page--front:not(.page--blank) .page__content {
    min-height: min(72vh, 34rem);
  }

  html.reading-mode .running-head {
    display: none;
  }

  html.reading-mode .folio {
    position: static;
    display: block;
    min-width: 0;
    padding: 0 22px 14px;
    font-size: 11px;
    text-align: right;
  }

  html.reading-mode .prose {
    font-size: 17px;
    line-height: 1.62;
    text-align: left;
    hyphens: none;
    -webkit-hyphens: none;
  }

  html.reading-mode .prose p + p {
    margin-top: 0.34em;
  }

  html.reading-mode .flow-quote {
    font-size: 16px;
  }

  html.reading-mode .flow-illustration,
  html.reading-mode .flow-illustration--small,
  html.reading-mode .flow-illustration--medium,
  html.reading-mode .flow-illustration--large {
    width: 100%;
    margin: 18px auto 20px;
  }
}
