.book-object-host {
  position: relative;
  width: min(100%, 480px);
  height: clamp(590px, 78svh, 740px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 20px;
  background: var(--object-paper, #f5efe3);
  box-shadow: 0 34px 90px -54px rgba(0, 0, 0, .42), 0 8px 32px -26px rgba(0, 0, 0, .22);
  isolation: isolate;
}

.uncovered-book-object {
  --object-ink: #201c16;
  --object-line: rgba(32, 28, 22, .14);
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--object-paper, #f5efe3);
  color: var(--object-ink);
  font-family: var(--object-font, Spectral, Georgia, serif);
  outline: none;
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
}

.uncovered-book-object:focus-visible {
  box-shadow: inset 0 0 0 2px #111;
}

.ubo-pages {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ubo-page {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  transform-style: flat;
  backface-visibility: visible;
  background: var(--object-paper, #f5efe3);
  color: var(--object-ink);
  will-change: auto;
}

.ubo-page.is-resting-page {
  z-index: 1;
  visibility: visible;
  pointer-events: auto;
}

.ubo-reading-page {
  padding: 7% 9% var(--object-controls-reserve, 94px);
  font-size: clamp(16.5px, 4.45vw, 18.5px);
}

.ubo-reading-page.ubo-image-page {
  padding: 0 0 var(--object-controls-reserve, 94px);
  background: #fff;
}

.ubo-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.ubo-preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ubo-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  background: linear-gradient(90deg, rgba(45, 37, 27, .05), rgba(45, 37, 27, 0) 22%, rgba(45, 37, 27, .42) 100%);
  opacity: var(--page-shade, 0);
  pointer-events: none;
}

.ubo-turn-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
  perspective: 1800px;
  transform-style: flat;
}

.ubo-turn-layer > .ubo-turn-sheet {
  z-index: 1;
  visibility: visible;
  pointer-events: none;
  transform: rotateY(var(--page-angle, 0deg));
  transform-origin: left center;
  transform-style: flat;
  backface-visibility: hidden;
  will-change: transform;
  box-shadow: -22px 0 26px -20px rgb(0 0 0 / var(--page-shadow, 0));
}

.ubo-cover-page {
  padding: 0;
  background: var(--object-paper, #f5efe3);
}

.ubo-cover-surface {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--object-paper, #f5efe3);
}

.ubo-cover-stage {
  position: absolute;
  inset: 0;
  padding: 0;
}

.ubo-cover-art {
  --cover-curl: clamp(96px, 28vw, 112px);
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}

.ubo-cover-art img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: fill;
  border-radius: 0;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--cover-curl)),
    calc(100% - var(--cover-curl)) 100%,
    0 100%
  );
}

.ubo-cover-window {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: var(--cover-curl);
  height: var(--cover-curl);
  overflow: hidden;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  background: var(--object-paper, #f5efe3);
  pointer-events: none;
}

.ubo-cover-underpage {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--object-paper, #f5efe3);
  color: var(--object-ink);
  font-family: var(--object-font, Spectral, Georgia, serif);
  font-size: clamp(16.5px, 4.45vw, 18.5px);
  text-align: initial;
}

.ubo-cover-fold {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: var(--cover-curl);
  height: var(--cover-curl);
  clip-path: polygon(0 100%, 100% 0, 100% 19%, 19% 100%);
  background: linear-gradient(135deg, rgba(255, 255, 255, .96) 0 47%, rgba(222, 216, 204, .95) 68%, rgba(247, 244, 237, .98) 100%);
  filter: drop-shadow(-5px -4px 5px rgba(31, 25, 18, .2));
  pointer-events: none;
}

.ubo-cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(116deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 31%, rgba(0, 0, 0, .055) 78%, rgba(255, 255, 255, .12));
  mix-blend-mode: soft-light;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--cover-curl)),
    calc(100% - var(--cover-curl)) 100%,
    0 100%
  );
  pointer-events: none;
}

.ubo-page-top {
  margin-bottom: 5.5%;
  text-align: center;
}

.ubo-page-top span {
  display: inline-block;
  width: 34px;
  height: 1px;
  vertical-align: middle;
  background: var(--object-accent, #8a8478);
}

.ubo-prose {
  margin-top: 5%;
  color: var(--object-ink);
  letter-spacing: -.008em;
}

.ubo-page-top + .ubo-prose {
  margin-top: 0;
}

.ubo-prose p {
  margin: 0;
  text-indent: 0;
}

.ubo-prose p + p {
  margin-top: .12em;
  text-indent: 1.05em;
}

.ubo-prose p.ubo-cont {
  text-indent: 0;
}

.ubo-prose p.ubo-fresh {
  text-indent: 1.05em;
}

.ubo-format-correspondence .ubo-prose {
  letter-spacing: 0;
}

.ubo-format-correspondence .ubo-prose p,
.ubo-format-correspondence .ubo-prose p + p,
.ubo-format-correspondence .ubo-prose p.ubo-fresh {
  text-indent: 0;
}

.ubo-format-correspondence .ubo-prose .ubo-correspondence-date,
.ubo-format-correspondence .ubo-prose .ubo-document-heading {
  margin-bottom: 1.15em;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .73em;
  font-weight: 500;
  letter-spacing: .075em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ubo-format-correspondence .ubo-prose .ubo-correspondence-date {
  text-align: right;
}

.ubo-format-correspondence .ubo-prose .ubo-correspondence-salutation {
  margin-bottom: 1.05em;
}

.ubo-format-correspondence .ubo-prose .ubo-correspondence-signoff {
  margin-top: 1.05em;
  margin-bottom: .4em;
}

.ubo-format-correspondence .ubo-prose .ubo-correspondence-detail {
  margin-top: .25em;
  color: color-mix(in srgb, var(--object-ink, #151515) 76%, transparent);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .72em;
  line-height: 1.45;
}

.ubo-dropcap.dropped {
  float: left;
  padding: .07em .1em 0 0;
  color: var(--object-accent, var(--object-ink));
  font-family: var(--object-font, Spectral, Georgia, serif);
  font-size: 3.1em;
  font-weight: 500;
  line-height: .82;
}

.ubo-dropcap.raised {
  padding-right: .04em;
  color: var(--object-accent, var(--object-ink));
  font-family: var(--object-font, Spectral, Georgia, serif);
  font-size: 1.85em;
  font-weight: 500;
  line-height: 1;
}

.ubo-leadin {
  font-variant: small-caps;
  font-feature-settings: "smcp" 1;
  letter-spacing: .04em;
}

.ubo-controls {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 64px;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.uncovered-book-object:not(.at-prose) .ubo-controls,
.uncovered-book-object.controls-suppressed .ubo-controls {
  opacity: 0;
  visibility: hidden;
}

.ubo-controls button {
  pointer-events: auto;
}

.ubo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--object-ink);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.ubo-icon:active {
  transform: scale(.88);
  background: rgba(0, 0, 0, .05);
}

.ubo-icon svg {
  width: 24px;
  height: 24px;
}

.ubo-icon.is-saved svg,
.ubo-reveal-secondary button.is-saved svg {
  fill: currentColor;
}

.ubo-reveal-button {
  padding: 11px 34px;
  border: 0;
  border-radius: 999px;
  background: var(--object-ink);
  color: #fff;
  font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.ubo-reveal-button:active {
  transform: scale(.96);
  opacity: .92;
}

.ubo-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 7;
  height: 2px;
  pointer-events: none;
}

.ubo-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--object-accent, #746d61);
  opacity: .58;
  transition: width 420ms cubic-bezier(.22, 1, .36, 1);
}

.ubo-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ubo-reveal-page {
  display: flex;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 34px 24px 22px;
  background: radial-gradient(125% 80% at 50% 28%, #fff 0%, #fafafa 58%, #f1f1ef 100%);
  color: #111;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-overflow-scrolling: touch;
}

.ubo-reveal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #777;
  cursor: pointer;
}

.ubo-reveal-close:active {
  background: rgba(0, 0, 0, .05);
}

.ubo-reveal-close svg {
  width: 20px;
  height: 20px;
}

.ubo-reveal-inner {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 100%;
  margin: 0;
}

.ubo-reveal-book,
.ubo-reveal-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ubo-reveal-cover {
  line-height: 0;
}

.ubo-reveal-cover img {
  width: auto;
  height: min(36svh, 284px);
  max-width: 62vw;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 22px 60px -14px rgba(0, 0, 0, .36), 0 0 0 1px rgba(0, 0, 0, .06);
}

.ubo-reveal-book h3 {
  margin: 14px 0 0;
  font-family: Spectral, Georgia, serif;
  font-size: clamp(21px, 5.5vw, 24px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.16;
  text-align: center;
}

.ubo-reveal-credit {
  margin: 7px 0 0;
  color: #777;
  font-size: 10.5px;
  letter-spacing: .16em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.ubo-reveal-credit span {
  padding-inline: .3em;
}

.ubo-reveal-synopsis {
  max-width: 29em;
  margin: 8px 0 0;
  color: #777;
  font-size: 12.5px;
  line-height: 1.42;
  text-align: center;
}

.ubo-reaction {
  width: 100%;
}

.ubo-reaction > p {
  margin: 0 0 7px;
  color: #777;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
}

.ubo-reaction > div {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ubo-reaction button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 41px;
  padding: 0;
  border: 1px solid #d9d9d7;
  border-radius: 999px;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.ubo-reaction button svg {
  width: 20px;
  height: 20px;
}

.ubo-reaction button.is-negative svg {
  transform: rotate(180deg);
}

.ubo-reaction button.is-selected {
  border-color: #111;
  background: #111;
  color: #fff;
}

.ubo-reaction > span {
  display: block;
  min-height: 0;
  margin-top: 6px;
  color: #555;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
}

.ubo-reaction > span:empty {
  display: none;
}

.ubo-bookshop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 340px;
  min-height: 46px;
  margin-top: 9px;
  padding: 0 18px;
  border: 1px solid #111;
  border-radius: 11px;
  background: #111;
  color: #fff;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  text-decoration: none;
}

.ubo-bookshop svg {
  width: 16px;
  height: 16px;
}

.ubo-reveal-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, .8fr) minmax(0, .8fr);
  gap: 8px;
  width: min(100%, 340px);
  margin-top: 8px;
}

.ubo-reveal-secondary button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 7px;
  border: 1px solid #d9d9d7;
  border-radius: 11px;
  background: transparent;
  color: #111;
  font: 500 12.5px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.ubo-reveal-secondary svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

@media (max-width: 540px) {
  .book-object-host {
    width: 100%;
    height: clamp(590px, 78svh, 700px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .ubo-cover-stage {
    padding: 0;
  }
}

@media (max-height: 720px) {
  .book-object-host {
    height: 590px;
  }

  .ubo-reveal-page {
    padding-top: 30px;
  }

  .ubo-reveal-cover img {
    height: min(30svh, 206px);
  }

  .ubo-reveal-book h3 {
    margin-top: 10px;
    font-size: 20px;
  }

  .ubo-reveal-synopsis {
    margin-top: 6px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ubo-progress i,
  .ubo-controls,
  .ubo-icon,
  .ubo-reveal-button {
    transition: none;
  }
}
