:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #090a0c;
  color: #f7f7f4;
  font-family: Inter, Arial, sans-serif;
}

button,
a {
  font: inherit;
}

.brochure-shell {
  display: flex;
  min-height: 100svh;
  padding: clamp(14px, 2vw, 28px) clamp(16px, 3vw, 46px) clamp(12px, 2vw, 24px);
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(255, 255, 255, .08), transparent 51%),
    linear-gradient(150deg, #181a1f 0%, #0e1014 55%, #08090b 100%);
}

.brochure-header {
  position: relative;
  z-index: 20;
  width: min(1380px, 100%);
  min-height: 66px;
  margin: 0 auto;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.brochure-heading {
  text-align: center;
  line-height: 1;
}

.brochure-heading p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, .48);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.brochure-heading h1 {
  margin: 0;
  font-size: clamp(17px, 1.7vw, 25px);
  font-weight: 600;
  letter-spacing: -.035em;
}

.brochure-heading>span {
  display: block;
  min-height: 12px;
  margin-top: 8px;
  color: rgba(255, 255, 255, .58);
  font-size: clamp(9px, .8vw, 11px);
  font-weight: 500;
}

.close-brochure {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 50%;
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .84);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.flipbook {
  display: flex;
  min-height: 0;
  padding: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.book-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 36px);
  flex: 1 1 auto;
  place-items: center;
  perspective: 3600px;
}

.book {
  position: relative;
  width: min(90vw, calc((100svh - 184px) * 1.412), 1320px);
  aspect-ratio: 840 / 595;
  isolation: isolate;
  transform-style: preserve-3d;
  filter: drop-shadow(0 26px 22px rgba(0, 0, 0, .52));
  transition: transform 1.42s cubic-bezier(.4, 0, .16, 1);
}

.book.is-cover {
  transform: translateX(-25%);
}

.book::before {
  content: "";
  position: absolute;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 50%;
  width: clamp(10px, 1.4vw, 22px);
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(255, 255, 255, .07) 28%, transparent 52%, rgba(0, 0, 0, .25));
  mix-blend-mode: multiply;
}

.book-page {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: #f1efe9;
  box-shadow: 0 2px 1px rgba(255, 255, 255, .3), 0 4px 15px rgba(0, 0, 0, .28);
}

.book-page-left {
  left: 0;
  border-radius: 5px 0 0 5px;
}

.book-page-right {
  right: 0;
  border-radius: 0 5px 5px 0;
}

.book-page img,
.page-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-page.is-empty {
  opacity: 0;
  pointer-events: none;
}

.book-page::after,
.page-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.book-page-left::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .045), transparent 18%, rgba(0, 0, 0, .14));
}

.book-page-right::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .14), transparent 18%, rgba(0, 0, 0, .025));
}

.turn-sheet {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  will-change: transform, filter;
  --turn-progress: 0;
  --turn-crest: 0;
}

.turn-sheet.is-turning-prev {
  right: auto;
  left: 0;
  transform-origin: right center;
}

.turn-sheet::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: var(--turn-crest);
  background: linear-gradient(90deg, rgba(0, 0, 0, .34), transparent 18%, transparent 78%, rgba(255, 255, 255, .14));
  mix-blend-mode: multiply;
}

.turn-sheet.is-turning-prev::after {
  background: linear-gradient(270deg, rgba(0, 0, 0, .34), transparent 18%, transparent 78%, rgba(255, 255, 255, .14));
}

.page-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: visible;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #f1efe9;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .13);
}

.page-face-front {
  border-radius: 0 5px 5px 0;
}

.page-face-back {
  visibility: hidden;
  border-radius: 5px 0 0 5px;
  transform: rotateY(180deg) translateZ(.1px);
}

.turn-sheet.is-turning-prev .page-face-front {
  border-radius: 5px 0 0 5px;
}

.turn-sheet.is-turning-prev .page-face-back {
  border-radius: 0 5px 5px 0;
}

.turn-sheet.is-past-half .page-face-front {
  visibility: hidden;
}

.turn-sheet.is-past-half .page-face-back {
  visibility: visible;
}

.page-face-front::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .17), transparent 24%, rgba(0, 0, 0, .02));
}

.page-face-back::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .025), transparent 74%, rgba(0, 0, 0, .18));
}

.page-hit-area {
  position: absolute;
  z-index: 40;
  top: 7%;
  bottom: 7%;
  width: 17%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.page-hit-area-prev {
  left: 0;
}

.page-hit-area-next {
  right: 0;
}

.book-controls {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
}

.book-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: #17191e;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

.book-button-index {
  width: auto;
  min-width: 64px;
  height: auto;
  min-height: 38px;
  padding: .62em 1em;
  border-radius: 999px;
  font-size: clamp(9px, .75vw, 12px);
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}

.book-fullscreen {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 19px;
}

.book-button:disabled {
  opacity: .3;
  cursor: default;
}

.book-button:not(:disabled):hover,
.close-brochure:hover {
  transform: translateY(-2px);
  background: #fff;
}

.book-hint {
  display: none;
}

@media (max-width: 900px) {
  .brochure-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
  }

  .brochure-header {
    position: absolute;
    inset: 8px 10px auto;
    width: auto;
    min-height: 38px;
  }

  .brochure-heading p,
  .brochure-heading h1 {
    display: none;
  }

  .brochure-heading>span {
    margin: 0;
    padding: .58em .9em;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    background: rgba(0, 0, 0, .2);
    font-size: 9px;
    backdrop-filter: blur(8px);
  }

  .close-brochure {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  .flipbook {
    height: 100%;
  }

  .book-stage {
    height: 100%;
    padding: 9px;
  }

  .book {
    width: min(96dvw, calc((100dvh - 18px) * 1.412));
  }

  .page-hit-area {
    display: none;
  }

  .book-controls {
    position: absolute;
    right: 0;
    bottom: 8px;
    left: 0;
    margin: 0;
  }

  .book-button {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .book-button-index {
    width: auto;
    min-width: 56px;
    min-height: 34px;
    padding: .58em .86em;
    font-size: clamp(8px, 2.2vw, 10px);
  }

  .book-fullscreen {
    display: grid;
  }

  .book-hint {
    display: none;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .brochure-shell {
    position: fixed;
    top: 100dvh;
    left: 0;
    width: 100dvh;
    height: 100dvw;
    min-height: 0 !important;
    transform: rotate(-90deg);
    transform-origin: left top;
  }

  .book {
    width: min(96dvh, calc((100dvw - 18px) * 1.412));
  }

  .book-button-index {
    font-size: clamp(8px, 1.6vh, 10px);
  }
}

@media (min-width: 901px) {
  .book-fullscreen {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .close-brochure,
  .book-button,
  .book {
    transition: none;
  }
}