@font-face {
  font-family: "Gloria Hallelujah";
  src: url("./assets/brand/gloria-hallelujah-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night-ink: #08152f;
  --night-deep: #050d20;
  --twilight: #1c3158;
  --ivory: #f6ebd2;
  --mint: #d3ffe8;
  --coral: #ef7d71;
  --lavender: #8f86a5;
  --quiet: rgba(246, 235, 210, 0.66);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night-ink);
}

body {
  color: var(--ivory);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button {
  color: inherit;
  font: inherit;
}

.experience {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: clip;
  background:
    radial-gradient(circle at 50% 42%, rgba(52, 86, 134, 0.24), transparent 38%),
    radial-gradient(circle at 18% 78%, rgba(79, 102, 152, 0.13), transparent 30%),
    linear-gradient(180deg, #0a1834 0%, var(--night-deep) 100%);
}

.experience::before {
  position: absolute;
  z-index: 8;
  inset: -50%;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, transparent 0 1px, rgba(255, 255, 255, 0.24) 1.5px 2px),
    repeating-radial-gradient(circle at 70% 60%, transparent 0 2px, rgba(0, 0, 0, 0.35) 2.5px 3px);
  background-size: 7px 7px, 9px 9px;
  mix-blend-mode: soft-light;
  transform: rotate(0.001deg);
}

.canvas-wrap {
  position: absolute;
  z-index: 1;
  inset: 0;
  touch-action: none;
  cursor: grab;
}

/* ---- Entrance: the scene develops rather than appears. ----
   While `is-veiled` (set in the markup) everything but the loading star
   is held transparent; when the book is ready the script swaps it for a
   short-lived `is-revealing`, whose slow, staggered transitions carry the
   develop-in — the book surfaces first, then the masthead, the cover
   copy, and finally the navigation. The transitions live only on
   `is-revealing` so the scene's normal page-turn and scene-change
   timings stay untouched once the entrance has played. */
.experience.is-veiled .canvas-wrap {
  opacity: 0;
  transform: translateY(14px) scale(0.988);
}

.experience.is-veiled .masthead,
.experience.is-veiled .cover-copy,
.experience.is-veiled .book-nav {
  opacity: 0;
}

/* Held a breath lower than its resting -59%, so the title rises with the
   book instead of merely fading over it. */
.experience.is-veiled .cover-copy {
  transform: translate(-50%, -56.5%);
}

.experience.is-revealing .canvas-wrap {
  transition:
    opacity 1300ms ease-out,
    transform 1300ms var(--ease-out);
}

.experience.is-revealing .masthead {
  transition: opacity 700ms ease-out 200ms;
}

.experience.is-revealing .cover-copy {
  transition:
    opacity 900ms ease-out 350ms,
    transform 900ms var(--ease-out) 350ms;
}

.experience.is-revealing .book-nav {
  transition: opacity 900ms ease-out 550ms;
}

.canvas-wrap.is-dragging {
  cursor: grabbing;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.masthead {
  position: absolute;
  z-index: 12;
  top: max(22px, env(safe-area-inset-top));
  left: clamp(20px, 4vw, 56px);
  right: clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

/* A link home rather than a static lockup: the reader who finishes the
   book leaves through the same door they came in. The masthead itself is
   pointer-transparent, so the link restores its own hit-testing. A small
   resting arrow carries the "this goes back" hint; hover confirms it with
   a handwritten aside. */
.brand {
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: rgba(246, 235, 210, 0.94);
  pointer-events: auto;
  text-decoration: none;
  transition: color 160ms ease;
}

/* The same hand-drawn arrow the page turns use, at its natural leftward
   orientation. */
.brand-back {
  display: block;
  width: 22px;
  height: 9px;
  flex: none;
  margin-right: 2px;
  overflow: hidden;
  color: transparent;
  background: url("./assets/menu/arrow.png") center / 100% 100% no-repeat;
  opacity: 0.55;
  transition:
    opacity 180ms ease-out,
    transform 200ms ease-out;
}

.brand-home-hint {
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  color: rgba(246, 235, 210, 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition:
    opacity 180ms ease-out,
    transform 200ms ease-out;
}

.brand:hover {
  color: rgba(246, 235, 210, 1);
}

.brand:hover .brand-back,
.brand:focus-visible .brand-back {
  opacity: 1;
  transform: translateX(-3px);
}

.brand:hover .brand-home-hint,
.brand:focus-visible .brand-home-hint {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.brand:focus-visible {
  border-radius: 10px;
  outline: 2px solid var(--mint);
  outline-offset: 5px;
}

.brand-mark {
  display: block;
  width: clamp(27px, 2.2vw, 31px);
  height: clamp(27px, 2.2vw, 31px);
  flex: none;
  opacity: 0.94;
  filter: drop-shadow(0 0 12px rgba(246, 235, 210, 0.16));
}

.brand-wordmark {
  font-family: "Gloria Hallelujah", "Comic Sans MS", cursive;
  font-size: clamp(17px, 1.45vw, 19px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.015em;
  transform: translateY(-1px);
}

.masthead-tools {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.gesture-hint {
  margin: 0;
  color: rgba(246, 235, 210, 0.4);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.sound-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1.5px solid rgba(246, 235, 210, 0.32);
  border-radius: 50%;
  background: rgba(8, 21, 47, 0.38);
  color: rgba(246, 235, 210, 0.86);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 200ms ease-out,
    border-color 200ms ease-out,
    transform 220ms var(--ease-out);
}

.sound-toggle svg {
  width: 17px;
  height: 17px;
  overflow: visible;
}

.sound-toggle .note-spark {
  opacity: 0.85;
  transition: opacity 200ms ease-out;
}

.sound-toggle .mute-line {
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.sound-toggle:hover {
  border-color: rgba(246, 235, 210, 0.6);
  color: rgba(246, 235, 210, 1);
  transform: scale(1.07);
}

.sound-toggle:focus-visible {
  border-color: rgba(211, 255, 232, 0.85);
  color: rgba(246, 235, 210, 1);
}

.sound-toggle.is-muted {
  color: rgba(246, 235, 210, 0.44);
}

.sound-toggle.is-muted .note-spark {
  opacity: 0;
}

.sound-toggle.is-muted .mute-line {
  opacity: 1;
}

.scene-copy {
  pointer-events: none;
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 180ms var(--ease-exit),
    transform 180ms var(--ease-exit);
}

.scene-copy.is-active {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 320ms var(--ease-out),
    transform 320ms var(--ease-out);
}

.cover-copy {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: min(31vw, 330px);
  transform: translate(-50%, -57%);
  text-align: center;
  text-shadow: 0 2px 24px rgba(1, 8, 25, 0.84);
}

.cover-copy.is-active {
  transform: translate(-50%, -59%);
}

.eyebrow,
.chapter {
  margin: 0 0 11px;
  color: var(--coral);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.cover-copy h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", Georgia, serif;
  font-size: clamp(30px, 3.6vw, 55px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.015em;
}

.cover-subtitle {
  max-width: 250px;
  margin: 17px auto 0;
  color: rgba(246, 235, 210, 0.72);
  font-family: "Iowan Old Style", "Baskerville", Georgia, serif;
  font-size: 16px;
  line-height: 1.7;
}

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

.story-transcript .scene-copy,
.story-transcript .scene-copy.is-active {
  transform: none;
  transition: none;
}

.loading {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(246, 235, 210, 0.64);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  transform: translate(-50%, 190px);
  transition: opacity 180ms var(--ease-exit);
}

.loading.is-hidden {
  opacity: 0;
}

.loading-star {
  color: var(--mint);
  filter: drop-shadow(0 0 8px rgba(211, 255, 232, 0.65));
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) rotate(18deg);
  }
}

.open-story {
  position: absolute;
  z-index: 15;
  bottom: calc(var(--safe-bottom) + 94px);
  left: 50%;
  display: flex;
  gap: 22px;
  align-items: center;
  min-width: 148px;
  padding: 12px 17px 12px 20px;
  border: 1px solid rgba(246, 235, 210, 0.28);
  border-radius: 999px;
  outline: none;
  background: rgba(5, 13, 32, 0.62);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.07em;
  transform: translateX(-50%);
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out,
    opacity 160ms ease-out,
    transform 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.open-story:disabled {
  cursor: wait;
  opacity: 0;
}

.open-story.is-hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

/* The exit pair, occupying the cover button's slot on the final spread.
   Hidden state keeps visibility for tab-order removal; the reveal is a
   slow rise so it reads as the book offering, not a popup arriving. */
.story-exit {
  position: absolute;
  z-index: 15;
  bottom: calc(var(--safe-bottom) + 94px);
  left: 50%;
  display: flex;
  gap: 24px;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition:
    opacity 640ms ease-out,
    transform 640ms var(--ease-out),
    visibility 0s linear 640ms;
}

.story-exit.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%);
  transition:
    opacity 640ms ease-out,
    transform 640ms var(--ease-out);
}

.exit-install {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 12px 17px 12px 20px;
  border: 1px solid rgba(246, 235, 210, 0.28);
  border-radius: 999px;
  background: rgba(5, 13, 32, 0.62);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  color: inherit;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-decoration: none;
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out,
    transform 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.exit-install:active {
  transform: scale(0.98);
  transition-duration: 0s;
}

.exit-home {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 2px;
  color: rgba(246, 235, 210, 0.62);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-decoration: none;
  transition: color 150ms ease-out;
}

.exit-install:focus-visible,
.exit-home:focus-visible {
  border-radius: 999px;
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.book-nav {
  position: absolute;
  z-index: 14;
  inset: 0;
  pointer-events: none;
}

.turn-button,
.progress-node {
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chapter-controls {
  position: absolute;
  bottom: max(6px, var(--safe-bottom));
  left: 50%;
  display: grid;
  grid-template-columns: 38px auto 38px;
  gap: 12px;
  align-items: center;
  width: max-content;
  height: 96px;
  pointer-events: none;
  transform: translateX(-50%);
}

.chapter-turn {
  position: relative;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  pointer-events: auto;
  opacity: 0.62;
  transition:
    opacity 180ms ease-out,
    transform 220ms var(--ease-out);
}

.chapter-turn span {
  display: block;
  width: 31px;
  height: 13px;
  overflow: hidden;
  color: transparent;
  background: url("./assets/menu/arrow.png") center / 100% 100% no-repeat;
  transition: transform 200ms ease-out;
}

.chapter-turn.turn-next span {
  transform: scaleX(-1);
}

.page-turn {
  position: absolute;
  z-index: 5;
  top: 47%;
  left: 0;
  display: grid;
  place-items: center;
  width: 78px;
  height: 58px;
  pointer-events: auto;
  opacity: 0.7;
  transform: translate3d(var(--page-turn-x), -50%, 0);
  transition: opacity 220ms ease-out;
}

.page-prev {
  --page-turn-x: calc(50vw - min(295px, 36vw));
}

.page-next {
  --page-turn-x: calc(50vw + min(295px, 36vw) - 78px);
}

.page-turn span {
  display: block;
  width: 62px;
  height: 25px;
  overflow: hidden;
  color: transparent;
  background: url("./assets/menu/arrow.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
  transition: transform 240ms var(--ease-out);
}

.page-next span {
  transform: scaleX(-1);
}

.turn-button:disabled {
  cursor: default;
  pointer-events: none;
  opacity: 0.16;
}

.progress-nodes {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 96px;
  pointer-events: auto;
}

.progress-node {
  --menu-shift: 0px;
  --title-tilt: 0deg;
  position: relative;
  z-index: 1;
  flex: 0 0 42px;
  width: 42px;
  height: 76px;
  animation: chapter-node-enter 520ms cubic-bezier(0.16, 1.35, 0.3, 1) backwards;
  transform: translateX(var(--menu-shift));
  transition: transform 300ms var(--ease-out);
}

.progress-node:nth-child(1) {
  --title-tilt: -3deg;
}

.progress-node:nth-child(2) {
  --title-tilt: 2deg;
  animation-delay: 45ms;
}

.progress-node:nth-child(3) {
  --title-tilt: -1.5deg;
  animation-delay: 90ms;
}

.progress-node:nth-child(4) {
  --title-tilt: 2.5deg;
  animation-delay: 135ms;
}

.progress-node::before {
  position: absolute;
  inset: 0;
  content: "";
}

.chapter-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  opacity: 0.58;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity 300ms ease-out,
    transform 300ms var(--ease-out);
}

.chapter-item.is-current {
  z-index: 2;
}

.chapter-item.is-current .chapter-preview {
  opacity: 1;
  transform: translate(-50%, -50%) scale(3.8);
}

.chapter-item.is-hovered {
  z-index: 5;
}

.chapter-item.is-hovered .chapter-preview {
  opacity: 1;
  transform: translate(-50%, -50%) scale(4);
}

.chapter-art {
  position: absolute;
  inset: 0;
  display: block;
  background-image: var(--thumb-image);
  background-position: var(--thumb-position);
  background-size: cover;
  filter: saturate(0.86) brightness(0.9);
  opacity: 0;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

.chapter-mask-1 {
  opacity: 1;
  -webkit-mask-image: url("./assets/menu/mask-1.png");
  mask-image: url("./assets/menu/mask-1.png");
}

.chapter-mask-2 {
  -webkit-mask-image: url("./assets/menu/mask-2.png");
  mask-image: url("./assets/menu/mask-2.png");
}

.chapter-mask-3 {
  -webkit-mask-image: url("./assets/menu/mask-3.png");
  mask-image: url("./assets/menu/mask-3.png");
}

.chapter-item.is-hovered:not(.is-current) .chapter-mask-1 {
  animation: chapter-mask-one 450ms steps(1, end) infinite;
}

.chapter-item.is-hovered:not(.is-current) .chapter-mask-2 {
  animation: chapter-mask-two 450ms steps(1, end) infinite;
}

.chapter-item.is-hovered:not(.is-current) .chapter-mask-3 {
  animation: chapter-mask-three 450ms steps(1, end) infinite;
}

.chapter-title {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90px;
  height: 90px;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--title-tilt)) scale(0.72);
  transform-origin: 50% 50%;
  transition:
    opacity 180ms ease-out,
    transform 300ms var(--ease-out);
}

.chapter-title path {
  fill: none;
}

.chapter-title text {
  fill: rgba(246, 235, 210, 0.9);
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  font-size: 9.4px;
  letter-spacing: 0.025em;
  text-anchor: middle;
}

.chapter-item.is-current .chapter-title {
  opacity: 0.94;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.chapter-item.is-hovered .chapter-title {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1.04);
}

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

@keyframes chapter-mask-one {
  0%,
  26.6%,
  100% {
    opacity: 1;
  }
  26.7%,
  99.9% {
    opacity: 0;
  }
}

@keyframes chapter-node-enter {
  from {
    opacity: 0;
    transform: translateX(var(--menu-shift)) translateY(-12px) scale(0.2);
  }

  to {
    opacity: 1;
    transform: translateX(var(--menu-shift)) translateY(0) scale(1);
  }
}

@keyframes chapter-mask-two {
  0%,
  26.6%,
  62.2%,
  100% {
    opacity: 0;
  }
  26.7%,
  62.1% {
    opacity: 1;
  }
}

@keyframes chapter-mask-three {
  0%,
  62.1%,
  100% {
    opacity: 0;
  }
  62.2%,
  99.9% {
    opacity: 1;
  }
}

.fallback {
  position: absolute;
  z-index: 30;
  top: 80px;
  left: 50%;
  width: min(460px, calc(100% - 40px));
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(246, 235, 210, 0.16);
  border-radius: 14px;
  background: rgba(5, 13, 32, 0.78);
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  transform: translateX(-50%);
}

.open-story:focus-visible,
.progress-node:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.turn-button:focus-visible {
  outline: none;
}

.turn-button:focus-visible span {
  outline: none;
  filter:
    drop-shadow(0 0 2px rgba(211, 255, 232, 0.95))
    drop-shadow(0 0 8px rgba(211, 255, 232, 0.5));
}

@media (hover: hover) {
  .open-story:not(:disabled):hover {
    border-color: rgba(211, 255, 232, 0.58);
    background: rgba(13, 29, 59, 0.82);
    transform: translateX(-50%) translateY(-1px);
  }

  .exit-install:hover {
    border-color: rgba(211, 255, 232, 0.58);
    background: rgba(13, 29, 59, 0.82);
    transform: translateY(-1px);
  }

  .exit-home:hover {
    color: rgba(246, 235, 210, 0.96);
  }

  .turn-button:not(:disabled):hover {
    opacity: 1;
  }

  .chapter-turn.turn-prev:not(:disabled):hover span {
    transform: translateX(-3px) rotate(-4deg);
  }

  .chapter-turn.turn-next:not(:disabled):hover span {
    transform: scaleX(-1) translateX(-3px) rotate(-4deg);
  }

  .page-prev:not(:disabled):hover span {
    transform: translateX(-8px) rotate(-6deg);
  }

  .page-next:not(:disabled):hover span {
    transform: scaleX(-1) translateX(-8px) rotate(-6deg);
  }
}

.open-story:not(:disabled):active {
  transform: translateX(-50%) scale(0.98);
  transition-duration: 0s;
}

.turn-button:not(:disabled):active {
  opacity: 0.54;
  transition-duration: 0s;
}

.progress-node:active .chapter-preview {
  transform: translate(-50%, -50%) scale(3.55);
  transition-duration: 0s;
}

@media (max-width: 700px) {
  .masthead {
    top: max(17px, env(safe-area-inset-top));
    left: 18px;
    right: 18px;
  }

  .gesture-hint {
    display: none;
  }

  .cover-copy {
    top: 47%;
    width: 55vw;
  }

  .cover-copy h1 {
    font-size: clamp(27px, 8vw, 38px);
  }

  .cover-subtitle {
    font-size: 14px;
  }

  .loading {
    transform: translate(-50%, 145px);
  }

  .open-story {
    bottom: calc(var(--safe-bottom) + 90px);
  }

  .story-exit {
    bottom: calc(var(--safe-bottom) + 90px);
    gap: 16px;
  }

  .chapter-controls {
    bottom: max(2px, var(--safe-bottom));
    grid-template-columns: 32px auto 32px;
    gap: 7px;
    height: 82px;
  }

  .chapter-turn {
    width: 32px;
    height: 32px;
  }

  .chapter-turn span {
    width: 27px;
    height: 11px;
  }

  .page-turn {
    top: 48%;
    width: 48px;
    height: 44px;
  }

  .page-prev {
    --page-turn-x: max(4px, calc(50vw - min(180px, 45vw)));
  }

  .page-next {
    --page-turn-x: calc(100vw - max(4px, calc(50vw - min(180px, 45vw))) - 48px);
  }

  .page-turn span {
    width: 42px;
    height: 17px;
  }

  .progress-nodes {
    height: 82px;
    gap: 5px;
  }

  .progress-node {
    flex-basis: 38px;
    width: 38px;
    height: 70px;
  }

  .chapter-preview {
    width: 13px;
    height: 13px;
  }

  .chapter-title {
    width: 78px;
    height: 78px;
  }

  .chapter-title text {
    font-size: 8.6px;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .cover-copy {
    top: 45%;
  }

  .cover-subtitle,
  .gesture-hint {
    display: none;
  }

  .open-story {
    bottom: calc(var(--safe-bottom) + 72px);
  }

  .story-exit {
    bottom: calc(var(--safe-bottom) + 72px);
  }

  .chapter-controls {
    bottom: 0;
    grid-template-columns: 28px auto 28px;
    gap: 5px;
    height: 66px;
  }

  .chapter-turn {
    width: 28px;
    height: 28px;
  }

  .chapter-turn span {
    width: 24px;
    height: 10px;
  }

  .page-turn {
    top: 47%;
    width: 44px;
    height: 38px;
  }

  .page-turn span {
    width: 38px;
    height: 15px;
  }

  .progress-nodes {
    height: 66px;
    gap: 4px;
  }

  .progress-node {
    flex-basis: 34px;
    width: 34px;
    height: 60px;
  }

  .chapter-preview {
    width: 12px;
    height: 12px;
  }

  .chapter-title {
    width: 68px;
    height: 68px;
  }

  .chapter-title text {
    font-size: 8.2px;
  }
}

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