.story-body {
  min-height: 100vh;
  background: #87c56e;
}

.story-body .story-sound-toggle.is-playing .sound-icon {
  animation: story-sound-pulse 800ms steps(2, end) infinite;
}

.mobile-sound-button {
  border: 0;
  border-top: 2px dashed rgba(83, 58, 46, 0.28);
  padding: 13px 14px 10px;
  background: transparent;
  color: #254636;
  font-family: var(--display-font);
  font-size: 24px;
  text-align: left;
  cursor: pointer;
}

.mobile-sound-button[aria-pressed="true"] {
  color: #a75f42;
}

.storybook-page {
  position: relative;
  min-height: calc(100svh - 110px);
  overflow: hidden;
  padding: clamp(64px, 6vw, 96px) 24px clamp(72px, 7vw, 108px);
  background:
    linear-gradient(rgba(63, 116, 91, 0.06), rgba(30, 70, 46, 0.14)),
    url("../assets/images/bg-world.png") center bottom / cover fixed no-repeat;
}

.story-topbar {
  display: flex;
  width: min(96%, 1280px);
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 0 auto clamp(34px, 4vw, 54px);
}

.story-heading {
  min-width: 0;
  margin: 0;
  color: #fff8e7;
  text-shadow: 3px 3px 0 rgba(31, 48, 34, 0.72);
}

.story-heading p {
  margin: 0 0 4px;
  font-family: var(--readable-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-heading h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(44px, 5.3vw, 78px);
  font-weight: 600;
  line-height: 0.92;
}

.story-reader {
  width: min(96%, 1280px);
  margin-inline: auto;
}

.storybook {
  position: relative;
  min-height: clamp(620px, 52vw, 720px);
  border: 10px solid #73533f;
  border-radius: 12px 18px 18px 12px;
  background: #d3b77c;
  box-shadow:
    14px 16px 0 rgba(58, 37, 28, 0.4),
    inset 0 0 0 5px #a9865f;
  perspective: 1800px;
  isolation: isolate;
}

.storybook::before {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 18px;
  background: linear-gradient(90deg, #b08b60, #73533f 48%, #d5b87e 52%, #a9835e);
  box-shadow: 0 0 18px rgba(75, 48, 31, 0.28);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.storybook::after {
  position: absolute;
  z-index: 8;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: calc(50% - 8px);
  border: 4px solid #c9ad72;
  background: linear-gradient(90deg, #d9c68e, #fff1c8 25%, #f8e8bc);
  box-shadow: inset 10px 0 20px rgba(104, 72, 44, 0.16);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform-origin: left center;
}

.storybook.is-flipping-next::after {
  animation: page-sheet-next 560ms cubic-bezier(0.42, 0, 0.2, 1);
}

.storybook.is-flipping-previous::after {
  right: auto;
  left: 8px;
  transform-origin: right center;
  animation: page-sheet-previous 560ms cubic-bezier(0.42, 0, 0.2, 1);
}

.story-spread {
  position: absolute;
  inset: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: calc(100% - 16px);
}

.story-spread[hidden] {
  display: none;
}

.story-spread.is-entering {
  z-index: 1;
  animation: spread-enter 560ms ease both;
}

.story-spread.is-leaving {
  z-index: 2;
  animation: spread-leave 560ms ease both;
}

.book-page {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(42px, 4.3vw, 68px);
  border: 4px solid #c7ad74;
  background:
    radial-gradient(circle at 16% 15%, rgba(177, 145, 84, 0.12) 0 5px, transparent 6px),
    radial-gradient(circle at 88% 82%, rgba(177, 145, 84, 0.11) 0 9px, transparent 10px),
    #fff0c7;
  color: #30281f;
  box-shadow: inset 0 0 24px rgba(126, 91, 48, 0.12);
}

.book-page:first-child {
  border-radius: 7px 0 0 7px;
  padding-right: clamp(48px, 5vw, 78px);
}

.book-page:last-child {
  border-radius: 0 9px 9px 0;
  padding-left: clamp(48px, 5vw, 78px);
}

.book-page::before,
.book-page::after {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #b59a64;
  content: "";
}

.book-page::before {
  top: 16px;
  left: 16px;
  border-top: 4px solid;
  border-left: 4px solid;
}

.book-page::after {
  right: 16px;
  bottom: 16px;
  border-right: 4px solid;
  border-bottom: 4px solid;
}

.chapter-label {
  margin: 0 0 8px;
  color: #8e5039;
  font-family: var(--readable-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-page h2 {
  max-width: 530px;
  margin: 0 0 22px;
  color: #254636;
  font-family: var(--display-font);
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 600;
  line-height: 1;
}

.book-page p,
.book-page blockquote {
  position: relative;
  z-index: 2;
  margin: 0 0 19px;
  font-family: var(--readable-font);
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.53;
}

.book-page blockquote {
  margin: 24px 0;
  border-left: 5px solid #bd754c;
  padding: 16px 0 16px 22px;
  color: #50382a;
  font-weight: 700;
}

.cover-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cover-page h2 {
  max-width: 510px;
  font-size: clamp(39px, 4.2vw, 64px);
}

.story-lede {
  max-width: 500px;
  font-size: clamp(18px, 1.45vw, 22px) !important;
}

.guide-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.guide-page p {
  max-width: 470px;
}

.story-tip {
  margin-top: 10px !important;
  border: 3px dashed #b8935c;
  padding: 16px 18px;
  background: rgba(255, 249, 226, 0.62);
}

.story-bowl {
  width: 100px;
  margin-bottom: 24px;
}

.founder-sprite,
.elder-sprite {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 16px;
  width: 90px;
  height: 120px;
  background-position: 0 50%;
  background-repeat: no-repeat;
  background-size: 800% 500%;
  image-rendering: pixelated;
  opacity: 0.92;
}

.founder-sprite {
  background-image: url("../assets/images/character-woman-6x.png");
}

.elder-sprite {
  background-image: url("../assets/images/character-older-woman-6x.png");
}

.final-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.final-message {
  color: #8e5039;
  font-family: var(--display-font) !important;
  font-size: clamp(25px, 2.4vw, 36px) !important;
  font-weight: 600;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.story-actions a,
.story-nav-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 4px solid #52372e;
  border-radius: 8px;
  padding: 10px 22px;
  background: #a75f42;
  box-shadow:
    inset 0 0 0 3px #d1845d,
    4px 5px 0 #4e392f;
  color: #fff8e7;
  font-family: var(--display-font);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.story-actions a:last-child {
  background: #396049;
  box-shadow:
    inset 0 0 0 3px #5f8168,
    4px 5px 0 #263c30;
}

.story-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 30px;
}

.story-nav-button {
  gap: 10px;
  min-width: 154px;
  cursor: pointer;
}

.story-nav-button:first-child {
  justify-self: start;
}

.story-nav-button:last-child {
  justify-self: end;
}

.story-nav-button:not(:disabled):hover,
.story-actions a:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.story-nav-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.55;
}

.story-progress {
  color: #fff8e7;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(31, 48, 34, 0.75);
}

.story-progress p {
  margin: 0 0 8px;
  font-family: var(--readable-font);
  font-size: 15px;
  font-weight: 700;
}

.story-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.story-dots button {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 140ms ease;
}

.story-dots button::before {
  width: 14px;
  height: 14px;
  border: 2px solid #fff8e7;
  background: transparent;
  box-shadow: 2px 2px 0 rgba(42, 51, 35, 0.5);
  content: "";
  transition: background-color 140ms ease;
}

.story-dots button:hover {
  transform: translateY(-2px);
}

.story-dots button:hover::before {
  background: rgba(255, 240, 168, 0.55);
}

.story-dots button:focus-visible {
  outline-color: #fff8e7;
  outline-offset: 4px;
}

.story-dots .is-current::before {
  background: #fff0a8;
}

.story-sound-status {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  margin: 0;
  border: 3px solid #315442;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff8e7;
  color: #274334;
  font-family: var(--readable-font);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.story-sound-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes page-sheet-next {
  0% { opacity: 0; transform: rotateY(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0.12; transform: rotateY(-180deg); }
}

@keyframes page-sheet-previous {
  0% { opacity: 0; transform: rotateY(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0.12; transform: rotateY(180deg); }
}

@keyframes spread-enter {
  from { opacity: 0.4; transform: scale(0.992); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spread-leave {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes story-sound-pulse {
  50% { transform: translateY(-3px); }
}

@media (max-width: 900px) {
  .storybook-page {
    background-attachment: scroll;
  }

  .storybook {
    min-height: 760px;
  }

  .book-page {
    padding: 42px;
  }

  .book-page:first-child {
    padding-right: 52px;
  }

  .book-page:last-child {
    padding-left: 52px;
  }

  .book-page p,
  .book-page blockquote {
    font-size: 16px;
    line-height: 1.48;
  }
}

@media (max-width: 700px) {
  .storybook-page {
    min-height: calc(100svh - 178px);
    padding: 34px 14px 60px;
  }

  .story-close {
    margin-bottom: 2px;
  }

  .story-topbar,
  .story-reader {
    width: 100%;
  }

  .story-topbar {
    align-items: flex-start;
    margin-bottom: 30px;
  }

  .storybook {
    min-height: 980px;
    border-width: 7px;
  }

  .storybook::before {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 14px;
    background: linear-gradient(#b08b60, #73533f 48%, #d5b87e 52%, #a9835e);
    transform: translateY(-50%);
  }

  .storybook::after {
    display: none;
  }

  .story-spread {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .book-page,
  .book-page:first-child,
  .book-page:last-child {
    padding: 40px 30px;
    border-radius: 5px;
  }

  .book-page h2 {
    font-size: clamp(30px, 8.5vw, 42px);
  }

  .book-page p,
  .book-page blockquote {
    font-size: 16px;
  }

  .founder-sprite,
  .elder-sprite {
    opacity: 0.42;
  }

  .story-controls {
    grid-template-columns: 1fr 1fr;
  }

  .story-progress {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .story-nav-button {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .storybook {
    min-height: 1110px;
  }

  .book-page,
  .book-page:first-child,
  .book-page:last-child {
    padding: 34px 22px;
  }

  .story-actions {
    display: grid;
  }

  .story-actions a {
    width: 100%;
  }

  .story-nav-button {
    padding-inline: 12px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storybook::after,
  .story-spread,
  .story-sound-toggle.is-playing .sound-icon,
  .story-sound-status {
    animation: none !important;
    transition: none !important;
  }
}

/* Pixel sprite storybook -------------------------------------------------- */

.story-reader {
  width: min(100%, 1180px);
}

.storybook-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 190 / 160;
  margin-inline: auto;
  isolation: isolate;
}

.pixel-book-sprite {
  position: absolute;
  z-index: 1;
  inset: 0;
  background-image: url("../assets/images/story/book-red-spritesheet.png");
  background-repeat: no-repeat;
  background-size: 700% 100%;
  filter: drop-shadow(14px 18px 0 rgba(47, 20, 39, 0.32));
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  pointer-events: none;
  transform-origin: center;
}

.pixel-book-sprite[data-frame="0"] { background-position: 0% 0; }
.pixel-book-sprite[data-frame="1"] { background-position: 16.6667% 0; }
.pixel-book-sprite[data-frame="2"] { background-position: 33.3333% 0; }
.pixel-book-sprite[data-frame="3"] { background-position: 50% 0; }
.pixel-book-sprite[data-frame="4"] { background-position: 66.6667% 0; }
.pixel-book-sprite[data-frame="5"] { background-position: 83.3333% 0; }
.pixel-book-sprite[data-frame="6"] { background-position: 100% 0; }

.pixel-book-sprite.is-reversed {
  transform: scaleX(-1);
}

.storybook-stage .storybook {
  position: absolute;
  z-index: 2;
  inset: 17.5% 13.25% 18.5%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  perspective: 1500px;
  transition: opacity 180ms ease;
}

.storybook-stage.is-open .storybook,
.storybook-stage.is-turning .storybook {
  opacity: 1;
}

.storybook-stage .storybook::before,
.storybook-stage .storybook::after {
  display: none;
}

.storybook-stage .story-spread {
  inset: 0;
  min-height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9%;
}

.storybook-stage .book-page,
.storybook-stage .book-page:first-child,
.storybook-stage .book-page:last-child {
  min-height: 0;
  padding: clamp(18px, 1.85vw, 28px) clamp(16px, 2vw, 30px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-color: rgba(78, 38, 48, 0.5) transparent;
  scrollbar-width: thin;
}

.storybook-stage .book-page::before,
.storybook-stage .book-page::after {
  display: none;
}

.storybook-stage .chapter-label {
  margin-bottom: 7px;
  color: #713348;
  font-family: var(--body-font);
  font-size: clamp(11px, 1vw, 14px);
}

.storybook-stage .book-page h2 {
  margin-bottom: clamp(10px, 1.2vw, 17px);
  color: #2e2635;
  font-size: clamp(25px, 2.35vw, 37px);
  line-height: 1.06;
}

.storybook-stage .book-page p,
.storybook-stage .book-page blockquote {
  margin-bottom: clamp(10px, 1.15vw, 16px);
  font-size: clamp(13px, 1.16vw, 17px);
  line-height: 1.43;
}

.storybook-stage .book-page blockquote {
  margin-block: clamp(14px, 1.6vw, 22px);
  border-left-color: #8c4562;
  padding: 12px 0 12px 17px;
}

.storybook-stage .cover-page h2 {
  font-size: clamp(31px, 3.05vw, 47px);
}

.storybook-stage .story-lede {
  font-size: clamp(14px, 1.25vw, 18px) !important;
}

.storybook-stage .guide-page {
  padding-inline: clamp(20px, 2.7vw, 40px);
}

.storybook-stage .guide-page p {
  max-width: 410px;
}

.storybook-stage .story-bowl {
  width: clamp(54px, 6vw, 78px);
  margin-bottom: 15px;
}

.storybook-stage .story-tip {
  margin-top: 4px !important;
  border: 3px dashed #9d6d54;
  padding: 11px 14px;
  background: rgba(244, 209, 167, 0.32);
}

.storybook-stage .founder-sprite,
.storybook-stage .elder-sprite {
  width: clamp(60px, 7vw, 88px);
  height: clamp(80px, 9vw, 112px);
  right: 4px;
  bottom: 0;
}

.storybook-stage .final-message {
  color: #713348;
  font-size: clamp(23px, 2.25vw, 34px) !important;
}

.mobile-guide,
.mobile-health-intro {
  display: none;
}

.storybook-stage .story-actions {
  gap: 10px;
  margin-top: 4px;
}

.storybook-stage .story-actions a {
  min-height: 46px;
  border-color: #3f1832;
  border-radius: 2px;
  padding: 9px 15px;
  background: #8b3f5d;
  box-shadow:
    inset 0 0 0 3px #c97778,
    4px 5px 0 #32142a;
  font-size: clamp(16px, 1.5vw, 20px);
}

.storybook-stage .story-actions a:last-child {
  background: #485f4c;
  box-shadow:
    inset 0 0 0 3px #77916f,
    4px 5px 0 #263c30;
}

.storybook-stage .story-spread.is-entering {
  animation: pixel-spread-enter 480ms steps(4, end) both;
}

.storybook-stage .story-spread.is-leaving {
  animation: pixel-spread-leave 480ms steps(4, end) both;
}

.story-controls {
  width: min(100%, 960px);
  margin: clamp(18px, 2.5vw, 30px) auto 0;
}

.story-nav-button {
  border-radius: 2px;
  background: #8b3f5d;
  box-shadow:
    inset 0 0 0 3px #c97778,
    4px 5px 0 #32142a;
}

.story-dots button::before {
  border-width: 3px;
  border-color: #fff1c9;
  background: #472039;
  box-shadow: 2px 2px 0 #281326;
}

.story-dots .is-current::before {
  background: #f7cb72;
}

@keyframes pixel-spread-enter {
  from { opacity: 0.2; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pixel-spread-leave {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-8px); }
}

@media (max-width: 980px) and (min-width: 861px) {
  .storybook-stage .storybook {
    inset: 17% 12.5% 18%;
  }

  .storybook-stage .book-page,
  .storybook-stage .book-page:first-child,
  .storybook-stage .book-page:last-child {
    padding: 13px 15px;
  }

  .storybook-stage .book-page h2 {
    font-size: clamp(24px, 3.2vw, 34px);
  }

  .storybook-stage .book-page p,
  .storybook-stage .book-page blockquote {
    font-size: clamp(13px, 1.7vw, 16px);
    line-height: 1.4;
  }
}

@media (min-width: 861px) {
  .storybook-stage .story-spread > .book-page:first-child {
    padding-left: clamp(24px, 2.7vw, 42px);
  }

  .storybook-stage .story-spread > .book-page:last-child {
    padding-right: clamp(38px, 4vw, 60px);
  }

  .storybook-stage .book-page:not(.cover-page) h2 {
    font-size: clamp(23px, 2.12vw, 34px);
    line-height: 1.1;
  }

  .storybook-stage .book-page blockquote {
    padding-right: 8px;
    font-size: clamp(13px, 1.08vw, 16px);
  }

  .storybook-stage .guide-page {
    justify-content: center;
    padding-top: clamp(30px, 3vw, 46px);
    padding-right: clamp(54px, 5vw, 76px);
    padding-bottom: clamp(30px, 3vw, 46px);
    padding-left: clamp(24px, 2.8vw, 44px);
  }

  .storybook-stage .guide-page > * {
    transform: translate(
      clamp(-24px, -1.55vw, -14px),
      clamp(-26px, -1.7vw, -14px)
    );
  }

  .storybook-stage .guide-page .story-bowl {
    width: clamp(46px, 4.6vw, 64px);
    margin-bottom: clamp(8px, 1vw, 13px);
  }

  .storybook-stage .guide-page h2 {
    margin-bottom: clamp(10px, 1vw, 14px);
    font-size: clamp(25px, 2vw, 32px);
  }

  .storybook-stage .guide-page > p:not(.story-tip) {
    max-width: 340px;
    margin-bottom: clamp(12px, 1.1vw, 16px);
    font-size: clamp(13px, 1.05vw, 16px);
    line-height: 1.42;
  }

  .storybook-stage .guide-page .story-tip {
    width: min(100%, 320px);
    margin: 0 !important;
    border-width: 2px;
    padding: 10px 14px;
    font-size: clamp(12px, 0.98vw, 15px);
    line-height: 1.38;
  }
}

@media (min-width: 861px) {
  .storybook-page {
    overflow: visible;
    padding: 60px 20px 24px;
  }

  .story-topbar {
    position: absolute;
    z-index: 10;
    top: 0;
    right: calc(11.1% - 70px);
    left: auto;
    width: auto;
    justify-content: flex-end;
    margin: 0;
    transform: none;
  }

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

  .story-reader {
    display: flow-root;
    position: relative;
    width: min(100%, 1000px, max(820px, calc(152svh - 274px)));
  }

  .storybook-stage {
    aspect-ratio: 190 / 160;
    margin-top: -11.0526%;
    margin-bottom: -10%;
  }

  .storybook-stage .storybook {
    position: absolute;
    inset: 17.5% 13.25% 18.5%;
    width: auto;
  }

  .storybook-stage .story-spread {
    position: absolute;
    inset: 0;
    min-height: 100%;
    gap: 2.5%;
  }

  .storybook-stage .story-spread[hidden] {
    display: none;
  }

  .storybook-stage .book-page,
  .storybook-stage .book-page:first-child,
  .storybook-stage .book-page:last-child {
    overflow: visible;
    padding: 22px 28px;
  }

  .storybook-stage .story-spread > .book-page:first-child {
    padding-left: 36px;
  }

  .storybook-stage .story-spread > .book-page:last-child {
    padding-right: 36px;
  }

  .storybook-stage .cover-page,
  .storybook-stage .guide-page,
  .storybook-stage .final-page {
    justify-content: flex-start;
  }

  .storybook-stage .cover-page h2 {
    margin-bottom: 10px;
    font-size: clamp(26px, 2.1vw, 34px);
  }

  .storybook-stage .story-spread > .guide-page:last-child {
    padding: 22px 36px;
    align-items: flex-start;
    text-align: left;
  }

  .storybook-stage .guide-page > * {
    transform: none;
  }

  .storybook-stage .book-page p,
  .storybook-stage .book-page blockquote,
  .storybook-stage .guide-page > p:not(.story-tip),
  .storybook-stage .guide-page .story-tip {
    font-size: 16px;
    line-height: 1.38;
  }

  .storybook-stage .book-page p,
  .storybook-stage .book-page blockquote {
    margin-bottom: 10px;
  }

  .storybook-stage .book-page:not(.cover-page) h2 {
    font-size: clamp(27px, 2vw, 31px);
  }

  .story-controls {
    position: fixed;
    z-index: 20;
    bottom: 12px;
    left: 50%;
    width: min(calc(100% - 40px), 826px, calc(125.5svh - 226px));
    margin: 0;
    transform: translateX(-50%);
  }

  .story-progress {
    border: 2px solid #5b3524;
    padding: 4px 8px;
    background: #fff0c7;
    color: #2e2635;
    text-shadow: none;
  }
}

@media (max-width: 860px) {
  .storybook-page {
    display: flex;
    height: calc(100svh - var(--site-header-height));
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 12px 12px;
  }

  .story-reader {
    display: flex;
    width: min(100%, 480px);
    min-height: 0;
    flex: 1;
    flex-direction: column;
  }

  .story-topbar {
    width: 100%;
    height: 46px;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin: 0 0 6px;
  }

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

  .story-close {
    width: 46px;
    height: 46px;
  }

  .storybook-stage {
    aspect-ratio: auto;
    min-height: 0;
    flex: 1;
  }

  .pixel-book-sprite {
    display: none;
  }

  .storybook-stage .storybook {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 7px solid #241022;
    border-radius: 5px;
    padding: 8px;
    background:
      linear-gradient(135deg, #eba637 0 18px, transparent 19px) top left / 27px 27px no-repeat,
      linear-gradient(225deg, #eba637 0 18px, transparent 19px) top right / 27px 27px no-repeat,
      linear-gradient(45deg, #eba637 0 18px, transparent 19px) bottom left / 27px 27px no-repeat,
      linear-gradient(315deg, #eba637 0 18px, transparent 19px) bottom right / 27px 27px no-repeat,
      #4a203c;
    box-shadow:
      8px 10px 0 rgba(47, 20, 39, 0.34),
      inset 0 0 0 3px #6e3e4a;
    opacity: 1;
    perspective: 1200px;
  }

  .storybook-stage .story-spread {
    position: absolute;
    inset: 8px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    height: calc(100% - 16px);
    min-height: 0;
  }

  .storybook-stage .story-spread[hidden] {
    display: none;
  }

  .storybook-stage .book-page,
  .storybook-stage .book-page:first-child,
  .storybook-stage .book-page:last-child {
    display: none;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    padding: 22px clamp(20px, 5vw, 28px);
    background:
      radial-gradient(circle at 16% 13%, rgba(126, 76, 57, 0.09) 0 3px, transparent 4px),
      radial-gradient(circle at 86% 84%, rgba(126, 76, 57, 0.08) 0 5px, transparent 6px),
      #dfba93;
    box-shadow:
      inset 0 0 0 3px #f4d7ad,
      inset 0 0 0 7px #a87361;
  }

  .storybook-stage .book-page.is-mobile-current {
    display: block;
    border-radius: 3px;
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .storybook-stage .cover-page.is-mobile-current,
  .storybook-stage .guide-page.is-mobile-current,
  .storybook-stage .final-page.is-mobile-current {
    display: flex;
  }

  .storybook-stage .guide-page.is-mobile-current {
    align-items: flex-start;
    text-align: left;
  }

  .storybook-stage .book-page.is-mobile-turning-next {
    display: block;
    transform-origin: left center;
    animation: mobile-page-out-next 320ms cubic-bezier(0.55, 0, 0.45, 1) both;
  }

  .storybook-stage .book-page.is-mobile-turning-previous {
    display: block;
    transform-origin: right center;
    animation: mobile-page-out-previous 320ms cubic-bezier(0.55, 0, 0.45, 1) both;
  }

  .storybook-stage .cover-page.is-mobile-turning-next,
  .storybook-stage .cover-page.is-mobile-turning-previous,
  .storybook-stage .guide-page.is-mobile-turning-next,
  .storybook-stage .guide-page.is-mobile-turning-previous,
  .storybook-stage .final-page.is-mobile-turning-next,
  .storybook-stage .final-page.is-mobile-turning-previous {
    display: flex;
  }

  .storybook-stage .book-page.is-mobile-entering-next {
    transform-origin: right center;
    animation: mobile-page-in-next 320ms cubic-bezier(0.2, 0.75, 0.35, 1) both;
  }

  .storybook-stage .book-page.is-mobile-entering-previous {
    transform-origin: left center;
    animation: mobile-page-in-previous 320ms cubic-bezier(0.2, 0.75, 0.35, 1) both;
  }

  .storybook-stage .book-page::before,
  .storybook-stage .book-page::after {
    display: block;
    width: 12px;
    height: 12px;
    border-color: #f4c84f;
  }

  .storybook-stage .book-page::before {
    top: 6px;
    left: 6px;
    border-width: 4px 0 0 4px;
    border-style: solid;
  }

  .storybook-stage .book-page::after {
    right: 6px;
    bottom: 6px;
    border-width: 0 4px 4px 0;
    border-style: solid;
  }

  .storybook-stage .book-page h2,
  .storybook-stage .cover-page h2 {
    max-width: 100%;
    margin-bottom: 10px;
    font-size: clamp(24px, 6vw, 30px);
    line-height: 1.1;
  }

  .storybook-stage .book-page p,
  .storybook-stage .book-page blockquote,
  .storybook-stage .story-lede {
    max-width: 100%;
    margin-bottom: 10px;
    font-size: 16px !important;
    line-height: 1.38;
  }

  .storybook-stage .mobile-guide {
    display: block;
    margin-top: 12px;
  }

  .storybook-stage .mobile-guide-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  .storybook-stage .mobile-guide-heading img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  .storybook-stage .mobile-guide-heading h3 {
    margin: 0;
    color: #2e2635;
    font-family: var(--display-font);
    font-size: 24px;
    line-height: 1.1;
  }

  .storybook-stage .mobile-guide p {
    margin-bottom: 8px;
  }

  .storybook-stage .mobile-guide .story-tip {
    margin: 4px 0 0 !important;
    border-width: 2px;
    padding: 8px 10px;
  }

  .storybook-stage .mobile-health-intro {
    display: block;
    margin-top: 14px;
    border-top: 2px dashed rgba(113, 51, 72, 0.45);
    padding-top: 10px;
  }

  .storybook-stage .health-intro-desktop,
  .storybook-stage .cover-page .founder-sprite {
    display: none;
  }

  .storybook-stage .chapter-label {
    margin-bottom: 6px;
    font-size: 14px;
  }

  .storybook-stage .book-page blockquote {
    margin-block: 12px;
    padding: 8px 0 8px 12px;
  }

  .storybook-stage .cover-page,
  .storybook-stage .guide-page,
  .storybook-stage .final-page {
    justify-content: flex-start;
  }

  .storybook-stage .founder-sprite,
  .storybook-stage .elder-sprite {
    opacity: 0.5;
  }

  .story-controls {
    width: 100%;
    min-height: 48px;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    margin: 8px 0 0;
  }

  .story-progress {
    grid-column: auto;
    grid-row: auto;
  }

  .story-progress p {
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
  }

  .story-dots {
    display: none;
  }

  .story-nav-button {
    min-height: 44px;
    font-size: 16px;
  }

  .storybook-stage .story-actions a {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .story-topbar {
    align-items: center;
    gap: 16px;
  }

  .story-close {
    width: 46px;
    height: 46px;
  }

  .storybook-stage .book-page,
  .storybook-stage .book-page:first-child,
  .storybook-stage .book-page:last-child {
    padding-right: 20px;
    padding-left: 20px;
  }

  .storybook-stage .story-tip {
    padding: 12px;
  }

  .story-controls {
    gap: 6px;
  }

  .story-nav-button {
    min-height: 44px;
    padding-inline: 6px;
    font-size: 16px;
  }
}

@keyframes mobile-page-out-next {
  from { opacity: 1; transform: rotateY(0deg); }
  to { opacity: 0; transform: rotateY(-72deg); }
}

@keyframes mobile-page-out-previous {
  from { opacity: 1; transform: rotateY(0deg); }
  to { opacity: 0; transform: rotateY(72deg); }
}

@keyframes mobile-page-in-next {
  from { opacity: 0; transform: rotateY(50deg); }
  to { opacity: 1; transform: rotateY(0deg); }
}

@keyframes mobile-page-in-previous {
  from { opacity: 0; transform: rotateY(-50deg); }
  to { opacity: 1; transform: rotateY(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-book-sprite,
  .storybook-stage .storybook,
  .storybook-stage .story-spread,
  .storybook-stage .book-page {
    animation: none !important;
    transition: none !important;
  }
}
