* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #f1efe6;
}

html {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  width: max-content;
  overflow: hidden;
  color: #111;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html.catalog-snap-page {
  overflow: hidden;
  scroll-snap-type: none;
}

html.catalog-snap-page body {
  width: 100%;
  overflow: hidden;
}

html.catalog-snap-page .catalog-gallery {
  width: 100vw;
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

html.catalog-snap-page .catalog-gallery.is-programmatic-scrolling {
  scroll-snap-type: none;
}

html.catalog-snap-page .catalog-gallery::-webkit-scrollbar {
  display: none;
}

.catalog-gallery {
  display: flex;
  width: max-content;
  height: 100vh;
  height: 100svh;
}

.catalog-spread {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f1efe6;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.catalog-book {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1efe6;
}

.catalog-book::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 5;
  width: 1px;
  background: rgba(17, 17, 17, .18);
  content: "";
  pointer-events: none;
}

.catalog-page {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f1efe6;
}

.catalog-image {
  position: absolute;
  margin: 0;
  overflow: hidden;
  background: #d7d4ca;
}

.catalog-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-image--one {
  top: 6%;
  left: 7%;
  width: 61%;
  height: 54%;
}

.catalog-image--two {
  bottom: 6%;
  left: 7%;
  width: 43%;
  height: 28%;
}

.catalog-image--three {
  top: 36%;
  left: 31%;
  width: 61%;
  height: 24%;
}

.catalog-image--four {
  right: 8%;
  bottom: 6%;
  width: 61%;
  height: 27%;
}

.catalog-number {
  position: absolute;
  font-size: clamp(1.35rem, 3.5vw, 3.5rem);
  font-weight: 300;
  line-height: 1;
}

.catalog-number--one {
  top: 6%;
  right: 19%;
}

.catalog-number--two {
  left: 52%;
  top: 66%;
}

.catalog-number--three {
  top: 36%;
  left: 18%;
}

.catalog-number--four {
  top: 67%;
  left: 18%;
}

/* The first right-hand page inverts the scale: 4 is the small plate, 3 is the hero. */
.catalog-spread:nth-child(1) .catalog-image--three {
  top: auto;
  right: 6%;
  bottom: 6%;
  left: auto;
  width: 54%;
  height: 39%;
}

.catalog-spread:nth-child(1) .catalog-image--four {
  top: 7%;
  right: 7%;
  bottom: auto;
  width: 43%;
  height: 28%;
}

.catalog-gallery:not(.home-catalog-gallery) .catalog-spread:nth-child(1) .catalog-image--four {
  top: 5%;
  right: 6%;
  width: min(56%, 34svh);
  height: auto;
  aspect-ratio: 3 / 4;
  background: transparent;
}

.catalog-gallery:not(.home-catalog-gallery) .catalog-spread:nth-child(1) .catalog-image--four img {
  object-fit: contain;
}

.catalog-spread:nth-child(1) .catalog-number--three {
  top: 55%;
  left: 18%;
}

.catalog-spread:nth-child(1) .catalog-number--four {
  top: 5%;
  left: 43%;
}

/* Spread two uses a looser specimen-book rhythm. */
.catalog-spread:nth-child(2) .catalog-image--one {
  top: 10%;
  left: 9%;
  width: 42%;
  height: 41%;
}

.catalog-spread:nth-child(2) .catalog-image--two {
  right: 8%;
  bottom: 7%;
  left: auto;
  width: 48%;
  height: 38%;
}

.catalog-gallery:not(.home-catalog-gallery) .catalog-spread:nth-child(2) .catalog-image--two img {
  object-fit: contain;
}

.catalog-spread:nth-child(2) .catalog-image--three {
  top: 8%;
  left: 10%;
  width: 70%;
  height: 30%;
}

.catalog-spread:nth-child(2) .catalog-image--four {
  top: auto;
  right: 7%;
  bottom: 7%;
  width: 62%;
  height: 43%;
  background: transparent;
}

.catalog-gallery:not(.home-catalog-gallery) .catalog-spread:nth-child(2) .catalog-image--three img,
.catalog-gallery:not(.home-catalog-gallery) .catalog-spread:nth-child(2) .catalog-image--four img {
  object-fit: contain;
}

.catalog-spread:nth-child(2) .catalog-number--one {
  top: 10%;
  right: 37%;
}

.catalog-spread:nth-child(2) .catalog-number--two {
  top: 55%;
  left: 38%;
}

.catalog-spread:nth-child(2) .catalog-number--three {
  top: 8%;
  left: 83%;
}

.catalog-spread:nth-child(2) .catalog-number--four {
  top: 50%;
  left: 18%;
}

/* Spread three mixes a tall archival plate with wider room views. */
.catalog-spread:nth-child(3) .catalog-image--one {
  top: 6%;
  left: 7%;
  width: 61%;
  height: 54%;
}

.catalog-spread:nth-child(3) .catalog-image--two {
  right: auto;
  bottom: 6%;
  left: 7%;
  width: 43%;
  height: 28%;
}

.catalog-spread:nth-child(3) .catalog-image--three {
  top: 8%;
  left: 8%;
  width: 62%;
  height: 32%;
}

.catalog-spread:nth-child(3) .catalog-image--four {
  right: 8%;
  bottom: 7%;
  width: 40%;
  height: 37%;
}

.catalog-spread:nth-child(3) .catalog-number--one {
  top: 6%;
  right: 19%;
}

.catalog-spread:nth-child(3) .catalog-number--two {
  top: 66%;
  left: 52%;
}

.catalog-spread:nth-child(3) .catalog-number--three {
  top: 8%;
  left: 73%;
}

.catalog-spread:nth-child(3) .catalog-number--four {
  top: 56%;
  left: 50%;
}

/* Spread four keeps the portrait intact while pairing it with wider room views. */
.catalog-spread:nth-child(4) .catalog-image--three {
  top: 7%;
  left: 9%;
  width: min(45%, 31svh);
  height: auto;
  aspect-ratio: 3 / 4;
  background: transparent;
}

.catalog-spread:nth-child(4) .catalog-image--three img {
  object-fit: contain;
}

.catalog-spread:nth-child(4) .catalog-image--four {
  right: 7%;
  bottom: 8%;
  width: 80%;
  height: 35%;
}

.catalog-spread:nth-child(4) .catalog-number--three {
  top: 7%;
  left: 56%;
}

.catalog-spread:nth-child(4) .catalog-number--four {
  top: 57%;
  left: 11%;
}

/* The final page gives the closing photograph its own quiet plate. */
.catalog-spread:nth-child(5) .catalog-image--one {
  top: 8%;
  left: 28%;
  width: min(44%, 45svh);
  height: auto;
  aspect-ratio: 3 / 4;
}

.catalog-spread:nth-child(5) .catalog-number--one {
  top: 8%;
  right: 22%;
}

@media (max-width: 700px) {
  .catalog-book {
    width: 100vw;
    height: 100%;
  }

}
