@font-face {
  font-family: "Andika";
  src: url("assets/fonts/andika-regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #201f1b;
  --paper: #f2ecd9;
  --paper-edge: #d8cfb6;
  --cover-depth: #61594c;
  --ease-book: cubic-bezier(0.22, 0.78, 0.18, 1);
  --book-h: min(64svh, 760px, calc(88vw / 1.6));
  --book-w: calc(var(--book-h) * 1.6);
  --cover-w: calc(var(--book-h) * 0.8);
  --read-progress: 0;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100svh;
  font-family: "Andika", Arial, sans-serif;
  color: var(--ink);
  background: #fafafa;
}

button { color: inherit; font: inherit; }

.reader {
  --read-progress: 0;
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  height: 100svh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 70% at 50% 36%, #ffffff 0%, #fafafa 58%, #f3f6f4 100%);
}

.reader::before {
  position: absolute;
  z-index: -2;
  right: -8%;
  bottom: -31%;
  left: -8%;
  height: 55%;
  content: "";
  transform: perspective(900px) rotateX(58deg);
  transform-origin: bottom;
  display: none;
  background: none;
  box-shadow: none;
}

.reader::after {
  position: absolute;
  z-index: -1;
  width: min(90vw, 1180px);
  height: 34svh;
  top: 53%;
  left: 50%;
  content: "";
  transform: translate(-50%, -6%);
  border-radius: 50%;
  background: rgba(12, 30, 32, 0.08);
  filter: blur(42px);
  opacity: 0.38;
}

.studio-grain {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: normal;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
}

.book-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100svh;
  display: grid;
  place-items: center;
  perspective: 2200px;
}

.book-rig {
  position: relative;
  width: var(--book-w);
  height: var(--book-h);
  transform-style: preserve-3d;
  transform-origin: 75% 50%;
  transform: translateX(-25%) rotateX(2deg) rotateY(-8deg) rotateZ(-0.35deg) scale(1.06);
  transition: transform 420ms var(--ease-book), filter 180ms ease;
  will-change: transform;
}

.reader[data-state="closed"] .book-rig:hover,
.reader[data-state="closed"] .book-rig:focus-within {
  transform: translateX(-25%) translateY(-6px) rotateX(1deg) rotateY(-16deg) rotateZ(-0.3deg) scale(1.08);
  filter: brightness(1.025);
}

.reader[data-state="flipping"] .book-rig,
.reader[data-state="open"] .book-rig {
  transform-origin: 50% 50%;
  transform: translateY(-1.2svh) rotateX(2.2deg);
}

.book-shadow {
  position: absolute;
  z-index: -8;
  right: -3%;
  bottom: -8%;
  left: -3%;
  height: 18%;
  border-radius: 50%;
  background: #0c1e20;
  filter: blur(22px);
  opacity: 0.14;
  transform: translateZ(-42px) rotateX(76deg);
  transition: left 420ms var(--ease-book), width 420ms var(--ease-book), opacity 420ms ease, transform 500ms var(--ease-book);
}

.reader[data-state="closed"] .book-shadow {
  left: 50%;
  width: 52%;
  right: auto;
  bottom: -7%;
  transform: translateX(-2%) translateZ(-46px) rotateX(76deg) skewX(-7deg);
}

.reader[data-state="open"] .book-shadow,
.reader[data-state="flipping"] .book-shadow {
  bottom: -10%;
  opacity: 0.5;
  filter: blur(28px);
}


.binding-spine {
  position: absolute;
  z-index: 6;
  top: 0;
  bottom: -10px;
  left: 50%;
  width: 12px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.1), transparent 20%, rgba(0,0,0,0.38) 50%, transparent 80%, rgba(255,255,255,0.08)),
    #2c3833;
  box-shadow: inset 0 0 0 1px rgba(20,30,25,0.4);
  transition: opacity 200ms ease;
}

.binding-spine span { display: none; }

.reader[data-state="open"] .binding-spine,
.reader[data-state="flipping"] .binding-spine {
  display: none;
  opacity: 0;
}

.open-block {
  position: absolute;
  z-index: 1;
  top: 1px;
  left: calc(-1px - (var(--read-progress) * 9px));
  right: calc(-1px - ((1 - var(--read-progress)) * 9px));
  bottom: -10px;
  pointer-events: none;
  opacity: 0;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(180deg, #e7deC6 0 88%, #c8bd9f 88%);
  box-shadow:
    inset 0 -1px 0 rgba(80, 64, 44, 0.22),
    0 10px 18px rgba(36, 28, 22, 0.24);
  transition: opacity 200ms ease, left 400ms var(--ease-book), right 400ms var(--ease-book);
}

.open-block::before,
.open-block::after {
  position: absolute;
  top: 0;
  bottom: 0;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(90deg, #f3ead3 0 1px, #d3c8ac 1px 2px);
}

.open-block::before {
  left: 0;
  width: calc(3px + (var(--read-progress) * 8px));
}

.open-block::after {
  right: 0;
  width: calc(3px + ((1 - var(--read-progress)) * 8px));
}

.reader[data-state="open"] .open-block,
.reader[data-state="flipping"] .open-block {
  opacity: 1;
}

.gutter {
  position: absolute;
  z-index: 7;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 18px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(28, 20, 14, 0.22) 42%, rgba(16, 10, 7, 0.38) 50%, rgba(255,255,255,0.1) 56%, transparent);
  transition: opacity 200ms ease;
}

.reader[data-state="open"] .gutter,
.reader[data-state="flipping"] .gutter {
  display: none;
  opacity: 0;
}

.volume-shell {
  position: absolute;
  z-index: 3;
  top: 0;
  left: calc(50% - 1px);
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0;
  background: #2f3c36;
  box-shadow:
    -12px 0 0 #2b3832,
    10px 0 0 #d6ccb2,
    0 11px 0 #c7bc9e,
    7px 14px 20px rgba(32, 26, 20, 0.3);
  transition: opacity 200ms ease;
}

.reader[data-state="closed"] .volume-shell {
  opacity: 1;
}

.inside-back-board {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(110deg, rgba(255,255,255,0.08), transparent 30%, rgba(0,0,0,0.12)),
    #6e7167;
  box-shadow: inset 18px 0 28px -18px rgba(20,14,10,0.55);
  transition: opacity 200ms ease;
}

.reader[data-last="true"] .inside-back-board {
  opacity: 1;
}

.reader[data-last="true"] .open-block {
  left: calc(-1px - (var(--read-progress) * 9px));
  right: 0;
}

.flip-book {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  background: var(--paper);
  outline: none;
}

.reader[data-state="closed"] .flip-book {
  background: transparent;
}

.flip-book:focus-visible {
  box-shadow: 0 0 0 3px rgba(30,45,39,0.88);
}

.stf__parent,
.stf__wrapper,
.stf__block,
.stf__item,
.stf__canvas {
  background: var(--paper) !important;
}

.reader[data-state="closed"] .stf__parent,
.reader[data-state="closed"] .stf__wrapper,
.reader[data-state="closed"] .stf__block {
  background: transparent !important;
}

.stf__parent {
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.stf__wrapper,
.stf__block {
  width: 100% !important;
  height: 100% !important;
  padding-bottom: 0 !important;
}

.page {
  background: var(--paper);
  overflow: hidden;
}

.page.hard {
  background: #3a433e;
}

.page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--paper);
  user-select: none;
  -webkit-user-drag: none;
}

.page.hard img {
  background: #3a433e;
}

.opening-cue {
  position: absolute;
  z-index: 24;
  touch-action: manipulation;
  top: calc(50% + (var(--book-h) / 2) + 48px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  color: rgba(37,39,35,0.78);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transform: translate(-50%, 7px);
  transition: opacity 300ms ease 140ms, transform 360ms var(--ease-book) 140ms;
}

.reader[data-state="closed"] .opening-cue {
  opacity: 0.78;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.reader[data-state="closed"] .opening-cue:hover {
  opacity: 1;
}

.opening-cue:focus-visible {
  outline: 2px solid #1e2d27;
  outline-offset: 4px;
}

.opening-cue-rule {
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.opening-cue-arrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0;
  animation: cue-breathe 1800ms ease-in-out infinite;
}

@keyframes cue-breathe {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -2px); }
}

.book-tools {
  position: absolute;
  z-index: 30;
  top: max(22px, env(safe-area-inset-top));
  right: max(24px, calc((100vw - var(--book-w)) / 2), env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.reader[data-state="open"] .book-tools,
.reader[data-state="flipping"] .book-tools {
  opacity: 0.62;
  pointer-events: auto;
  transform: translateY(0);
}

.reader[data-state="open"] .book-tools:hover,
.reader[data-state="open"] .book-tools:focus-within,
.reader[data-state="flipping"] .book-tools:hover,
.reader[data-state="flipping"] .book-tools:focus-within {
  opacity: 1;
}

.reader[data-state="closed"] .book-tools,
.reader[data-page="0"] .book-tools,
.reader[data-closing="true"] .book-tools {
  opacity: 0;
  pointer-events: none;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  touch-action: manipulation;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #2a2c28;
  background: rgba(244,239,222,0.5);
  box-shadow: 0 1px 0 rgba(255,255,255,0.28);
  cursor: pointer;
  transition: background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.icon-button:hover { background: rgba(248,244,230,0.88); transform: translateY(-1px); }
.icon-button:focus-visible { outline: 2px solid #1e2d27; outline-offset: 2px; }
.icon-button:disabled { opacity: 0.24; cursor: default; transform: none; }

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-rule { width: 1px; height: 20px; margin: 0 5px; background: rgba(31,32,29,0.25); }
.folio {
  width: 62px;
  border: 0;
  color: #292b27;
  background: transparent;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

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

.reader[data-orientation="portrait"] {
  --book-h: min(68svh, calc(82vw * 1.25));
  --book-w: calc(var(--book-h) * 0.8);
}

.reader[data-orientation="portrait"] .book-rig,
.reader[data-orientation="portrait"][data-state="closed"] .book-rig {
  transform-origin: 50% 50%;
  transform: rotateX(2deg) rotateY(0deg) rotateZ(-0.35deg);
}

.reader[data-orientation="portrait"][data-state="closed"] .book-rig:hover,
.reader[data-orientation="portrait"][data-state="closed"] .book-rig:focus-within {
  transform: translateY(-4px) rotateX(1deg) rotateY(-10deg) rotateZ(-0.35deg);
}

.reader[data-orientation="portrait"][data-state="open"] .book-rig,
.reader[data-orientation="portrait"][data-state="flipping"] .book-rig {
  transform: translateY(1svh) rotateX(1.4deg);
}

.reader[data-orientation="portrait"] .book-shadow,
.reader[data-orientation="portrait"][data-state="closed"] .book-shadow {
  left: 4%;
  right: 4%;
  width: auto;
  transform: translateZ(-46px) rotateX(76deg);
}

.reader[data-orientation="portrait"] .binding-spine,
.reader[data-orientation="portrait"] .gutter {
  display: none;
}

.reader[data-orientation="portrait"] .open-block {
  left: -6px;
  right: -6px;
}

.reader[data-orientation="portrait"] .volume-shell {
  left: 0;
  right: 0;
}

.reader[data-orientation="portrait"] .book-tools {
  top: max(12px, env(safe-area-inset-top));
  right: 50%;
  transform: translate(50%, -7px);
}

.reader[data-orientation="portrait"][data-state="open"] .book-tools,
.reader[data-orientation="portrait"][data-state="flipping"] .book-tools {
  transform: translate(50%, 0);
}

.reader[data-orientation="portrait"] .opening-cue {
  top: calc(50% + (var(--book-h) / 2) + 22px);
}

@media (max-height: 610px) and (min-width: 701px) {
  :root { --book-h: min(62svh, calc(88vw / 1.6)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}

/* HighFlyer 3D intro */

.reader {
  --cover-w: calc(var(--book-h) * 0.8);
  --cover-depth: 40px;
}

.reader[data-state="closed"] .book-rig,
.reader[data-state="opening"] .book-rig {
  width: var(--book-w);
  transform-origin: 50% 50%;
  transform: none;
}

.reader[data-state="closed"] .book-rig:hover,
.reader[data-state="closed"] .book-rig:focus-within {
  transform: none;
  filter: none;
}

.reader[data-state="closed"] .open-block,
.reader[data-state="closed"] .binding-spine,
.reader[data-state="closed"] .gutter,
.reader[data-state="closed"] .inside-back-board,
.reader[data-state="opening"] .open-block,
.reader[data-state="opening"] .binding-spine,
.reader[data-state="opening"] .gutter,
.reader[data-state="opening"] .inside-back-board,
.reader[data-state="closed"] .volume-shell,
.reader[data-state="opening"] .volume-shell {
  opacity: 0 !important;
  pointer-events: none;
}

.reader[data-state="closed"] .flip-book,
.reader[data-state="opening"] .flip-book {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.reader[data-state="open"] .intro-book,
.reader[data-state="flipping"] .intro-book {
  display: none;
}

.intro-book {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 8;
  display: block;
  width: var(--cover-w);
  height: var(--book-h);
  margin-left: calc(var(--cover-w) / -2);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 3000px;
  touch-action: manipulation;
  transition: width 0.5s var(--ease-book), margin-left 0.5s var(--ease-book);
}

.intro-book::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
}

.reader[data-state="opening"] .intro-book {
  width: var(--book-w);
  margin-left: calc(var(--book-w) / -2);
}

.intro-spread {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  overflow: hidden;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
}

.reader[data-state="opening"] .intro-spread {
  opacity: 1;
}

.intro-page {
  display: block;
  width: 50%;
  height: 100%;
  object-fit: cover;
}

.intro-volume {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  box-shadow: 13px 13px 8px rgba(40, 32, 26, 0.35);
}

.reader[data-state="closed"] .intro-book:hover .intro-volume,
.reader[data-state="closed"] .intro-book:focus-visible .intro-volume {
  transform: rotate3d(0, 1, 0, 35deg);
}

.reader[data-state="opening"] .intro-volume {
  transition: none;
  transform: none;
  box-shadow: 13px 18px 18px rgba(12, 30, 32, 0.16);
}

.reader[data-state="opening"] .intro-spine,
.reader[data-state="opening"] .intro-edge,
.reader[data-state="opening"] .intro-back {
  opacity: 0;
}

.intro-front,
.intro-spine,
.intro-edge,
.intro-back {
  position: absolute;
  display: block;
  top: 0;
}

.intro-front {
  inset: 0;
  width: 100%;
  transform-origin: 0% 50%;
  transform-style: preserve-3d;
  transform: translate3d(0, 0, calc(var(--cover-depth) / 2));
  z-index: 10;
  overflow: hidden;
  border-radius: 0 4px 4px 0;
  background: #2f3c36;
  box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.18);
  transition: opacity 0.45s ease, transform 0.45s var(--ease-book);
}

.reader[data-state="opening"] .intro-front {
  left: 50%;
  right: auto;
  top: 0;
  bottom: 0;
  width: var(--cover-w);
  margin-left: calc(var(--cover-w) / -2);
  opacity: 0;
  transform: none;
  pointer-events: none;
  box-shadow: none;
}

.intro-front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 4px 4px 0;
}

.intro-groove {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 3px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 1px 0 3px rgba(255, 255, 255, 0.08);
}

.intro-spine {
  width: var(--cover-depth);
  height: 100%;
  left: calc(var(--cover-depth) / -2);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.1), transparent 22%, rgba(0,0,0,0.28) 52%, transparent 82%, rgba(255,255,255,0.06)),
    #2f3c36;
  transform: rotate3d(0, 1, 0, -90deg);
  color: #e8e0cc;
}

.intro-spine-title,
.intro-spine-mark {
  position: absolute;
  left: 0;
  width: var(--book-h);
  height: var(--cover-depth);
  display: flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform-origin: 0 0;
  transform: rotate(90deg) translateY(calc(var(--cover-depth) * -1));
  padding: 0 16px;
  box-sizing: border-box;
}

.intro-spine-title {
  justify-content: flex-start;
  font-weight: 600;
}

.intro-spine-mark {
  justify-content: flex-end;
  opacity: 0.72;
  font-weight: 500;
}

.intro-edge {
  width: var(--cover-depth);
  height: calc(100% - 8px);
  top: 4px;
  right: calc(var(--cover-depth) / -2);
  background: repeating-linear-gradient(90deg, #f0e6cc 0 1px, #d4c9ad 1px 2px);
  transform: rotate3d(0, 1, 0, 90deg);
}

.intro-back {
  inset: 0;
  border-radius: 4px 0 0 4px;
  background:
    linear-gradient(180deg, #3c4741, #2a332e);
  transform: translate3d(0, 0, calc(var(--cover-depth) / -2)) rotateY(180deg);
}

.reader[data-state="closed"] .book-shadow,
.reader[data-state="opening"] .book-shadow {
  left: 6%;
  right: 2%;
  width: auto;
  bottom: -8%;
  transform: translateZ(-46px) rotateX(76deg) skewX(-8deg);
}

@media (prefers-reduced-motion: reduce) {
  .intro-volume,
  .intro-front {
    transition-duration: 1ms !important;
  }
}

.reader[data-finished="true"][data-state="closed"] .intro-book:hover .intro-volume,
.reader[data-finished="true"][data-state="closed"] .intro-book:focus-visible .intro-volume {
  transform: rotate3d(0, 1, 0, -35deg);
}

.reader[data-finished="true"] .intro-front {
  border-radius: 4px 0 0 4px;
  box-shadow: inset -4px 0 10px rgba(0, 0, 0, 0.18);
}

.reader[data-finished="true"] .intro-front img {
  border-radius: 4px 0 0 4px;
}

.reader[data-finished="true"] .intro-groove {
  left: auto;
  right: 10px;
}

.reader[data-finished="true"] .intro-spine {
  left: auto;
  right: calc(var(--cover-depth) / -2);
  transform: rotate3d(0, 1, 0, 90deg);
}

.reader[data-finished="true"] .intro-edge {
  right: auto;
  left: calc(var(--cover-depth) / -2);
  transform: rotate3d(0, 1, 0, -90deg);
}

.intro-front,
.intro-back,
.intro-spine,
.intro-edge {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.intro-back {
  overflow: hidden;
}

.intro-groove--back {
  left: auto;
  right: 10px;
}

/* Open-book gutter crease */
.crease {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 56px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(32, 22, 14, 0.04) 22%,
      rgba(22, 14, 8, 0.14) 46%,
      rgba(10, 6, 4, 0.23) 50%,
      rgba(255, 248, 232, 0.07) 54%,
      rgba(32, 22, 14, 0.05) 74%,
      transparent 100%);
  transition: opacity 220ms ease;
}

.crease::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  content: "";
  background: rgba(18, 12, 8, 0.17);
  transform: translateX(-50%);
  box-shadow: 1px 0 0 rgba(255, 250, 240, 0.06);
}

.reader[data-state="open"] .crease {
  z-index: 5;
  opacity: 1;
}

.reader[data-state="flipping"] .crease {
  z-index: 3;
  opacity: 1;
}

.reader[data-state="closed"] .crease,
.reader[data-state="opening"] .crease,
.reader[data-orientation="portrait"] .crease {
  opacity: 0;
}

.intro-spread::after {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 56px;
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(32, 22, 14, 0.04) 22%,
      rgba(22, 14, 8, 0.14) 46%,
      rgba(10, 6, 4, 0.23) 50%,
      rgba(255, 248, 232, 0.07) 54%,
      rgba(32, 22, 14, 0.05) 74%,
      transparent 100%);
}

.intro-spread::before {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  content: "";
  pointer-events: none;
  background: rgba(18, 12, 8, 0.17);
  transform: translateX(-50%);
  box-shadow: 1px 0 0 rgba(255, 250, 240, 0.06);
}

.page {
  position: relative;
}

.page--left::after,
.page--right::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  content: "";
  pointer-events: none;
}

.page--left::after {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(18, 10, 6, 0.11));
}

.page--right::after {
  left: 0;
  background: linear-gradient(90deg, rgba(18, 10, 6, 0.11), transparent);
}

.intro-back img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px 0 0 4px;
}

.page-hit {
  display: none;
}

@media (hover: none), (max-width: 700px) {
  .reader[data-state="open"] .book-tools,
  .reader[data-state="flipping"] .book-tools {
    top: auto;
    right: auto;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%);
    background: rgba(244, 239, 222, 0.94);
    box-shadow: 0 6px 22px rgba(32, 26, 20, 0.18);
  }

  .reader[data-orientation="portrait"][data-state="open"] .book-tools,
  .reader[data-orientation="portrait"][data-state="flipping"] .book-tools {
    top: auto;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .reader[data-state="closed"] .book-tools,
  .reader[data-state="opening"] .book-tools,
  .reader[data-closing="true"] .book-tools {
    opacity: 0;
    pointer-events: none;
  }

  .icon-button {
    width: 48px;
    height: 48px;
  }

  .icon-button svg {
    width: 22px;
    height: 22px;
  }

  .opening-cue {
    min-height: 44px;
    padding: 10px 16px;
  }

  .page-hit {
    position: absolute;
    z-index: 20;
    top: 50%;
    width: calc(var(--book-w) * 0.26);
    height: calc(var(--book-h) * 0.58);
    display: none;
    align-items: center;
    margin: 0;
    padding: 0 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .page-hit--prev {
    left: calc(50% - (var(--book-w) / 2));
    justify-content: flex-start;
  }

  .page-hit--next {
    right: calc(50% - (var(--book-w) / 2));
    justify-content: flex-end;
  }

  .reader[data-state="open"] .page-hit,
  .reader[data-state="flipping"] .page-hit {
    display: flex;
  }

  .page-hit-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    color: #2a2c28;
    background: rgba(244, 239, 222, 0.94);
    box-shadow: 0 2px 10px rgba(32, 26, 20, 0.18);
  }

  .page-hit-mark svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}
