:root {
  color-scheme: light;
  font-family: Tahoma, sans-serif;
  color: #ffffff;
  background: #ae1517;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.reader {
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(12px, 2.5vw, 28px) clamp(12px, 3vw, 34px);
}
.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ffffff;
}
h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.65rem);
  letter-spacing: -.035em;
}
.logo-header img {
  width: 170px;
  /*	background: #fff;
	padding: 10px;
	border-radius: 12px;*/
}
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 44px;
  color: #ffffff;
  font-weight: 600;
  font-size: .9rem;
  text-underline-offset: .2em;
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: var(--book-aspect, 1.2);
  min-height: 120px;
  max-height: clamp(200px, calc(100vh - 176px), 920px);
  max-height: clamp(200px, calc(100svh - 176px), 920px);
  margin-block: 12px;
  touch-action: pan-y pinch-zoom;
}
.book {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: clip;
}
.spread {
  position: absolute;
  display: flex;
  align-items: flex-start;
}
.spread.is-outgoing {
  z-index: 1;
  pointer-events: none;
}
.sheet {
  position: relative;
  flex: none;
  margin: 0;
  background: white;
}
.sheet canvas {
  display: block;
}
.turn-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  perspective: 1500px;
  pointer-events: none;
}
.turn-leaf {
  position: absolute;
  transform-style: preserve-3d;
}
.turn-leaf[data-direction="next"] {
  transform-origin: left center;
}
.turn-leaf[data-direction="previous"] {
  transform-origin: right center;
}
.turn-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
}
.turn-face.is-back {
  transform: rotateY(180deg);
}
.turn-face canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.turn-light {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(var(--light-angle, 90deg), #0005 0%, #0000 35%, #fff3 76%, #fff8 95%, #0002 100%);
}
.turn-leaf[data-direction="previous"] .turn-face:not(.is-back) .turn-light, .turn-leaf[data-direction="next"] .turn-face.is-back .turn-light {
  --light-angle: 270deg;
}
.turn-shadow {
  position: absolute;
  opacity: 0;
  filter: blur(9px);
  background: linear-gradient(90deg, #25252500, #25252555 50%, #25252500);
}
.status {
  z-index: 3;
  max-width: 28rem;
  text-align: center;
  background: #c12930;
  padding: .55em .85em;
  border-radius: .4em;
}
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
}
.arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #ae1517;
  border-radius: 50%;
  background: white;
  color: #ae1517;
  cursor: pointer;
}
.arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arrow[aria-disabled="true"] {
  opacity: .38;
  cursor: default;
}
@media (hover: hover) {
  .arrow:not([aria-disabled="true"]):hover {
    background: #e8e5dd;
  }
}
.arrow:focus-visible, .pdf-link:focus-visible {
  outline: 2px solid #315b9c;
  outline-offset: 3px;
}
.counter {
  margin: 0;
  min-width: 100px;
  text-align: center;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.notice {
  margin-top: 24px;
}
@media screen and (max-width: 767px) {
  .reader-header {
    border-bottom: 0px solid #ffffff;
  }
  h1 {
    display: none
  }
}
@media screen and (max-width: 767px) {
  .reader { padding-inline: 6px; }
  .reader-header { padding-inline: 6px; }
  .stage { margin-block: 6px; max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); }
}

@media screen and (max-width: 767px) {
  .mobile-turn { perspective: 1100px; }
  .mobile-turn .turn-leaf { -webkit-transform-style: preserve-3d; }
  .mobile-turn .mobile-paper-back { background: linear-gradient(90deg, #ddd, #fafafa 30%, #fff); }
}

@media screen and (max-width: 767px) {
  .mobile-turn .turn-leaf { will-change: transform; }
  .stage { touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; }
}
