:root {
  color-scheme: dark;
  --ink: #21184b;
  --ink-deep: #140f32;
  --violet: #342673;
  --paper: #fff8e8;
  --gold: #e1a62a;
  --leaf: #55a84b;
  --book-shadow: rgba(7, 5, 28, 0.55);
  --soft-radius: 18px;
  font-family: "Chalkboard SE", "Avenir Next Rounded", "Avenir Next", system-ui, sans-serif;
}

/* Early responsive fallback overrides. */
.hero-cover-wrap {
  position: absolute;
  z-index: 3;
  bottom: 42px;
  left: 7%;
  width: min(195px, 24vw);
  transform: rotate(6deg);
}

.flubby-book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flubby-card {
  display: grid;
  grid-template-columns: minmax(165px, 0.78fr) minmax(0, 1.22fr);
  min-height: 300px;
}

.flubby-card__cover-wrap {
  height: 100%;
  min-height: 300px;
  aspect-ratio: auto;
}

.flubby-card__cover {
  padding: 12px;
  object-fit: contain;
  object-position: center;
}

.flubby-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px 19px 18px;
}

.flubby-card h3,
.flubby-card__description {
  min-height: 0;
}

.flubby-card__actions {
  margin-top: auto;
}

@media (max-width: 700px) {
  .flubby-book-grid {
    grid-template-columns: 1fr;
  }

  .hero-cover-wrap {
    bottom: 37px;
    left: 3%;
    width: min(165px, 40vw);
  }

  .flubby-card {
    grid-template-columns: 42% 58%;
    min-height: 0;
  }

  .flubby-card__cover-wrap {
    min-height: 0;
  }

  .flubby-card__cover {
    padding: 8px;
  }

  .flubby-card__body {
    padding: 14px 13px 12px;
  }
}

/* Bobo's origin sits beside the book, as one compact series introduction. */
.collection-feature__aside.bobo-original-aside {
  display: grid;
  align-content: center;
  gap: 26px;
  min-height: 0;
  padding: 12px 0 0;
}

.bobo-original-copy {
  max-width: 480px;
}

.bobo-original-copy__label {
  margin: 0 0 13px;
  color: var(--library-coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.bobo-original-copy h3 {
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(30px, 4vw, 50px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.bobo-original-copy > p:not(.bobo-original-copy__label) {
  max-width: 430px;
  margin: 18px 0 0;
  color: var(--library-ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.bobo-source-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 430px;
}

.bobo-source-card {
  position: relative;
  margin: 0;
  padding: 8px 8px 24px;
  background: var(--library-paper);
  box-shadow: 5px 7px 0 rgba(42, 30, 88, 0.11);
}

.bobo-source-card:first-child {
  transform: rotate(-2deg);
}

.bobo-source-card:last-child {
  transform: rotate(2.5deg) translateY(11px);
}

.bobo-source-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #d9d3cc;
  object-fit: contain;
}

.bobo-source-card--photo img {
  object-position: center;
}

.bobo-source-card figcaption {
  position: absolute;
  right: 8px;
  bottom: 6px;
  left: 8px;
  overflow: hidden;
  color: var(--library-ink-soft);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-heading__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.section-heading__title-row h2 {
  margin: 0;
}

.series-origin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px 5px;
  border: 1.5px solid var(--library-coral);
  color: var(--library-coral);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(-2deg);
}

.section-heading__bobo-meta {
  display: flex;
  align-items: end;
  gap: 28px;
}

.collection-feature.collection-feature--bobo {
  grid-template-columns: minmax(0, 780px);
}

.collection-feature.collection-feature--bobo .book-card {
  max-width: 780px;
}

.section-heading__bobo-meta .section-heading__count {
  margin-bottom: 3px;
}

.bobo-story-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 7px;
  border: 0;
  border-bottom: 1.5px solid var(--library-coral);
  background: transparent;
  color: var(--library-coral);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: gap 160ms ease, color 160ms ease;
}

.bobo-story-button span {
  font-size: 18px;
  font-weight: 400;
}

.bobo-story-button:hover {
  gap: 12px;
  color: var(--library-ink);
}

.bobo-story-open {
  overflow: hidden;
}

.bobo-story-modal,
.bobo-story-modal__backdrop {
  position: fixed;
  inset: 0;
}

.bobo-story-modal {
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.bobo-story-modal__backdrop {
  background: rgba(33, 24, 75, 0.68);
  backdrop-filter: blur(5px);
}

.bobo-story-modal__panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(42, 30, 88, 0.23);
  background: var(--library-paper);
  box-shadow: 14px 16px 0 rgba(42, 30, 88, 0.18);
}

.bobo-story-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(42, 30, 88, 0.17);
}

.bobo-story-modal__header p {
  margin: 0 0 9px;
  color: var(--library-coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.bobo-story-modal__header h2 {
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(33px, 5vw, 60px);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.bobo-story-modal__close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(42, 30, 88, 0.24);
  border-radius: 50%;
  background: transparent;
  color: var(--library-ink);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.bobo-story-modal__close:hover {
  background: var(--library-yellow);
}

.bobo-story-modal__content {
  display: grid;
  grid-template-columns: minmax(240px, 0.86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(24px, 5vw, 62px);
  padding-top: 28px;
}

.bobo-story-modal__art {
  position: relative;
  margin: 0;
  padding: 12px 12px 33px;
  background: #f4eee2;
  box-shadow: 8px 10px 0 rgba(42, 30, 88, 0.12);
  transform: rotate(-2.5deg);
}

.bobo-story-modal__art::before {
  position: absolute;
  top: -14px;
  right: 26px;
  width: 90px;
  height: 24px;
  background: rgba(247, 211, 104, 0.84);
  content: "";
  transform: rotate(4deg);
}

.bobo-story-modal__art img {
  display: block;
  width: 100%;
  height: min(390px, 42dvh);
  background: #d9d3cc;
  object-fit: contain;
}

.bobo-story-modal__art figcaption {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 12px;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 14px;
  line-height: 1.2;
}

.bobo-story-modal__art figcaption span {
  color: var(--library-ink-soft);
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
}

.bobo-story-modal__copy {
  color: var(--library-ink-soft);
  font-size: 15px;
  line-height: 1.75;
}

.bobo-story-modal__copy p {
  margin: 0;
}

.bobo-story-modal__lead {
  margin-bottom: 12px !important;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.bobo-story-modal__facts {
  display: grid;
  gap: 10px;
  margin: 23px 0 0;
  padding: 0;
  list-style: none;
}

.bobo-story-modal__facts li {
  display: grid;
  grid-template-columns: minmax(95px, 0.4fr) minmax(0, 1fr);
  gap: 13px;
  padding-top: 10px;
  border-top: 1px solid rgba(42, 30, 88, 0.16);
}

.bobo-story-modal__facts strong {
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 18px;
  line-height: 1.2;
}

.bobo-story-modal__facts span {
  font-size: 13px;
  line-height: 1.45;
}

.bobo-story-modal__detail {
  margin-top: 21px !important;
  padding: 15px 17px;
  background: rgba(247, 211, 104, 0.25);
  color: var(--library-ink);
  font-size: 13px;
}

.bobo-story-modal__footer {
  margin-top: 27px;
  padding-top: 17px;
  border-top: 1px solid rgba(42, 30, 88, 0.17);
  color: var(--library-coral);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 17px;
  transform: rotate(-1deg);
}

@media (max-width: 900px) {
  .section-heading__bobo-meta {
    gap: 18px;
  }

  .bobo-story-modal__content {
    gap: 28px;
  }
}

@media (max-width: 700px) {
  .section-heading__title-row {
    align-items: start;
    flex-direction: column;
    gap: 11px;
  }

  .section-heading__bobo-meta {
    width: 100%;
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading__bobo-meta .section-heading__count {
    margin: 0;
  }

  .bobo-story-modal {
    padding: 12px;
  }

  .bobo-story-modal__panel {
    max-height: calc(100dvh - 24px);
    padding: 20px 17px 23px;
  }

  .bobo-story-modal__content {
    grid-template-columns: 1fr;
    gap: 29px;
  }

  .bobo-story-modal__art {
    width: min(100%, 300px);
    justify-self: center;
  }

  .bobo-story-modal__art img {
    height: min(320px, 42dvh);
  }

  .bobo-story-modal__copy {
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  .collection-feature__aside.bobo-original-aside {
    padding-left: 0;
  }

  .bobo-source-pair {
    max-width: 360px;
  }
}

@media (max-width: 700px) {
  .collection-feature__aside.bobo-original-aside {
    gap: 22px;
    margin-top: 38px;
    padding: 0 10px;
  }

  .bobo-original-copy h3 {
    font-size: 34px;
  }

  .bobo-source-pair {
    width: min(100%, 340px);
  }
}

/* Storybook maker layer: the landing page is a little studio, not just a shelf. */
.hero-model-card {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(380px, 45vw);
  min-height: 390px;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 17px 17px 15px;
  border: 1px solid rgba(42, 30, 88, 0.25);
  border-radius: 48% 52% 46% 54% / 45% 43% 57% 55%;
  background: rgba(239, 246, 229, 0.72);
  box-shadow: 13px 16px 0 rgba(42, 30, 88, 0.1);
  transform: rotate(-3deg);
}

.hero-model-card::before {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(42, 30, 88, 0.3);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.hero-model-label {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  padding: 7px 10px 6px;
  background: var(--library-coral);
  color: var(--library-paper);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  transform: rotate(5deg);
}

.hero-model {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 300px;
  --poster-color: transparent;
}

.hero-model-caption {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 8px;
  color: var(--library-ink-soft);
  font-size: 10px;
}

.hero-model-caption strong {
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 16px;
}

.hero-model-caption span {
  letter-spacing: 0.05em;
}

.hero-cover-wrap {
  position: absolute;
  z-index: 3;
  bottom: 42px;
  left: 7%;
  width: min(195px, 24vw);
  transform: rotate(6deg);
}

.bobo-origin {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(30px, 6vw, 92px);
  margin-top: 78px;
  padding: 27px;
  border: 1px solid rgba(42, 30, 88, 0.18);
  background: rgba(255, 250, 240, 0.58);
  box-shadow: 10px 12px 0 rgba(42, 30, 88, 0.07);
}

.bobo-origin__photo-wrap {
  position: relative;
  justify-self: center;
  width: min(100%, 355px);
  padding: 13px 13px 25px;
  background: var(--library-paper);
  box-shadow: 8px 10px 0 rgba(42, 30, 88, 0.13);
  transform: rotate(-3deg);
}

.bobo-origin__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #d9d3cc;
  object-fit: contain;
}

.bobo-origin__stamp {
  position: absolute;
  right: -15px;
  bottom: 7px;
  padding: 8px 11px 7px;
  background: var(--library-yellow);
  color: var(--library-ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: center;
  transform: rotate(5deg);
}

.bobo-origin__copy {
  max-width: 470px;
}

.bobo-origin__label {
  margin: 0 0 14px;
  color: var(--library-coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.bobo-origin h3 {
  max-width: 460px;
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(28px, 4vw, 52px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.bobo-origin__copy > p:not(.bobo-origin__label) {
  max-width: 410px;
  margin: 22px 0 0;
  color: var(--library-ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.bobo-origin__note {
  display: inline-block;
  margin-top: 24px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--library-coral);
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 16px;
  transform: rotate(-2deg);
}

.flubby-book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flubby-card {
  display: grid;
  grid-template-columns: minmax(165px, 0.78fr) minmax(0, 1.22fr);
  min-height: 300px;
}

.flubby-card__cover-wrap {
  height: 100%;
  min-height: 300px;
  aspect-ratio: auto;
  background: #dce9e4;
}

.flubby-card__cover {
  padding: 12px;
  object-fit: contain;
  object-position: center;
}

.flubby-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px 19px 18px;
}

.flubby-card h3,
.flubby-card__description {
  min-height: 0;
}

.flubby-card__actions {
  margin-top: auto;
}

@media (max-width: 900px) {
  .hero-model-card {
    width: min(350px, 48vw);
  }

  .bobo-origin {
    gap: 28px;
  }

  .flubby-card {
    grid-template-columns: minmax(145px, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 700px) {
  .hero-model-card {
    width: min(320px, 78vw);
    min-height: 365px;
  }

  .hero-model {
    height: 275px;
  }

  .hero-cover-wrap {
    bottom: 37px;
    left: 3%;
    width: min(165px, 40vw);
  }

  .bobo-origin {
    grid-template-columns: 1fr;
    gap: 33px;
    margin-top: 60px;
    padding: 18px;
  }

  .bobo-origin__copy {
    max-width: none;
  }

  .bobo-origin__copy > p:not(.bobo-origin__label) {
    font-size: 13px;
  }

  .flubby-card {
    grid-template-columns: 42% 58%;
    min-height: 0;
  }

  .flubby-card__cover-wrap {
    min-height: 0;
  }

  .flubby-card__cover {
    padding: 8px;
  }

  .flubby-card__body {
    padding: 14px 13px 12px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--paper);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid var(--paper);
  outline-offset: 4px;
}

.painted-room {
  position: fixed;
  inset: -32px;
  background-image:
    linear-gradient(rgba(18, 12, 48, 0.78), rgba(18, 12, 48, 0.9)),
    url("assets/background-original.png");
  background-position: center;
  background-size: cover;
  filter: blur(17px) saturate(0.82);
  transform: scale(1.08);
}

.painted-room::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, transparent 0 24%, rgba(9, 6, 29, 0.62) 83%);
}

.reader-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 3vw, 46px) max(18px, env(safe-area-inset-bottom));
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1260px, 100%);
  margin: 0 auto;
}

.reader-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.narration-status {
  max-width: 190px;
  overflow: hidden;
  color: #d8d0f6;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narration-status[data-state="speaking"]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(225, 166, 42, 0.15);
}

.book-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.book-mark__dot {
  width: 19px;
  height: 19px;
  border: 5px solid var(--gold);
  border-radius: 50%;
  background: var(--violet);
}

.book-mark p {
  margin: 0;
}

.book-mark__title {
  color: var(--paper);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.book-mark__subtitle {
  margin-top: 2px !important;
  color: #d8d0f6;
  font-size: 13px;
}

.quiet-button,
.page-button {
  border: 2px solid rgba(255, 248, 232, 0.42);
  border-radius: 999px;
  background: rgba(30, 22, 68, 0.76);
  color: var(--paper);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.quiet-button {
  padding: 9px 16px;
  font-size: 14px;
}

.quiet-button:hover,
.page-button:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(52, 38, 115, 0.92);
}

.quiet-button:active,
.page-button:active:not(:disabled),
.open-book:active {
  transform: translateY(1px) scale(0.98);
}

.book-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  perspective: 2200px;
}

.book {
  position: relative;
  width: min(88vw, calc(76dvh * 1.5), 1240px);
  aspect-ratio: 3 / 2;
  border-radius: var(--soft-radius);
  transform-style: preserve-3d;
  filter: drop-shadow(0 24px 36px var(--book-shadow));
  transition: width 420ms cubic-bezier(0.2, 0.75, 0.25, 1), opacity 240ms ease, transform 420ms ease;
}

.book::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border: 3px solid #bd7f1b;
  border-radius: 24px;
  background: #6a4314;
  box-shadow: 0 6px 0 #432b12, 0 20px 45px rgba(9, 6, 33, 0.46);
}

.book[data-mode="cover"] {
  width: min(52vw, calc(74dvh * 0.75), 560px);
  aspect-ratio: 3 / 4;
}

.page {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: var(--paper);
  backface-visibility: hidden;
  pointer-events: none;
}

.page--left {
  left: 0;
  border-radius: 14px 3px 3px 14px;
  box-shadow: inset -18px 0 24px rgba(30, 19, 56, 0.13);
}

.page--right {
  right: 0;
  border-radius: 3px 14px 14px 3px;
  box-shadow: inset 18px 0 24px rgba(30, 19, 56, 0.12);
}

.book[data-mode="cover"] .page--left,
.book[data-mode="cover"] .book-gutter {
  display: none;
}

.book[data-mode="cover"] .page--right {
  left: 0;
  width: 100%;
  border-radius: 14px;
  box-shadow: none;
}

.page img,
.flip-face img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.page-image--full {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-image--spread-left,
.page-image--spread-right {
  position: absolute;
  top: 0;
  width: 200%;
  height: 100%;
  max-width: none;
}

.page-image--spread-left {
  left: 0;
}

.page-image--spread-right {
  left: -100%;
}

.blank-page {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(52, 38, 115, 0.13), transparent 16%),
    #fff8e8;
}

.blank-page::after {
  content: "";
  position: absolute;
  inset: 11%;
  border: 3px solid rgba(225, 166, 42, 0.22);
  border-radius: 42% 58% 51% 49% / 57% 45% 55% 43%;
}

.book-gutter {
  position: absolute;
  z-index: 7;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 20px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(24, 14, 50, 0.3), rgba(255, 248, 232, 0.16), rgba(24, 14, 50, 0.25), transparent);
}

.flip-leaf {
  position: absolute;
  z-index: 12;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  pointer-events: none;
  visibility: hidden;
}

.flip-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
  backface-visibility: hidden;
}

.flip-front {
  border-radius: 3px 14px 14px 3px;
}

.flip-back {
  transform: rotateY(180deg);
  border-radius: 14px 3px 3px 14px;
}

.flip-leaf.flip-next {
  visibility: visible;
  animation: turn-next 760ms cubic-bezier(0.35, 0.02, 0.15, 1) both;
}

.flip-leaf.flip-previous {
  left: 0;
  transform-origin: right center;
  visibility: visible;
  animation: turn-previous 760ms cubic-bezier(0.35, 0.02, 0.15, 1) both;
}

@keyframes turn-next {
  0% { transform: rotateY(0deg); box-shadow: 0 0 0 transparent; }
  48% { box-shadow: -24px 8px 34px rgba(10, 7, 32, 0.38); }
  100% { transform: rotateY(-180deg); box-shadow: 0 0 0 transparent; }
}

@keyframes turn-previous {
  0% { transform: rotateY(0deg); box-shadow: 0 0 0 transparent; }
  48% { box-shadow: 24px 8px 34px rgba(10, 7, 32, 0.38); }
  100% { transform: rotateY(180deg); box-shadow: 0 0 0 transparent; }
}

.page-zone {
  position: absolute;
  z-index: 9;
  top: 0;
  bottom: 0;
  width: 16%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.page-zone--previous {
  left: 0;
}

.page-zone--next {
  right: 0;
}

.book[data-mode="cover"] .page-zone--previous {
  display: none;
}

.book[data-mode="cover"] .page-zone--next {
  width: 100%;
}

.open-book {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: 26px;
  display: grid;
  gap: 2px;
  min-width: 190px;
  padding: 12px 22px;
  transform: translateX(-50%) translateZ(40px);
  border: 3px solid var(--gold);
  border-radius: 999px;
  background: rgba(31, 23, 70, 0.9);
  color: var(--paper);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(9, 6, 28, 0.32);
}

.open-book:active {
  transform: translateX(-50%) translateY(1px) translateZ(40px) scale(0.98);
}

.open-book span {
  font-size: 17px;
  font-weight: 800;
}

.open-book small {
  color: #dcd5f6;
  font-size: 11px;
}

.book:not([data-mode="cover"]) .open-book {
  display: none;
}

.book.opening-cover {
  opacity: 0;
  transform: rotateY(-8deg) translateX(-3%) scale(0.96);
}

.book.jumping {
  opacity: 0;
  transform: scale(0.975);
}

.book.closing-cover {
  opacity: 0;
  transform: rotateY(8deg) translateX(3%) scale(0.96);
}

.mobile-scene,
.rotate-hint {
  display: none;
}

.reader-controls {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 130px;
  align-items: center;
  gap: 22px;
  width: min(760px, 100%);
  margin: 6px auto 0;
}

.page-button {
  min-height: 46px;
  padding: 9px 18px;
  font-weight: 700;
}

.page-button--primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #24184e;
}

.page-button--primary:hover:not(:disabled) {
  background: #f0bd47;
}

.page-button:disabled {
  cursor: default;
  opacity: 0.34;
}

.story-progress {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.story-progress p {
  margin: 0;
  color: #d8d0f6;
  font-size: 12px;
}

.progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.progress-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 248, 232, 0.34);
  cursor: pointer;
  transition: width 180ms ease, border-radius 180ms ease, background 180ms ease;
}

.progress-dot[aria-current="true"] {
  width: 28px;
  border-radius: 999px;
  background: var(--gold);
}

.completion-note {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 3px;
  max-width: 330px;
  padding: 16px 20px;
  transform: translateY(140%);
  border: 3px solid var(--gold);
  border-radius: var(--soft-radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 48px rgba(7, 5, 28, 0.42);
  transition: transform 280ms ease;
}

.completion-note.show {
  transform: translateY(0);
}

.completion-note span {
  color: #51466e;
  font-size: 13px;
}

@media (max-width: 760px), (max-height: 560px) {
  body {
    overflow: auto;
  }

  .reader-shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    min-height: 100dvh;
    padding-inline: 14px;
  }

  .quiet-button {
    padding: 8px 12px;
    font-size: 12px;
  }

  .reader-actions {
    gap: 6px;
  }

  .narration-status {
    display: none;
  }

  .book {
    display: none;
  }

  .mobile-scene {
    display: grid;
    place-items: center;
    width: 100%;
    height: min(68dvh, 720px);
    margin: 0;
    overflow: hidden;
    border: 3px solid #bd7f1b;
    border-radius: 14px;
    background: #21184b;
    box-shadow: 0 18px 34px rgba(7, 5, 28, 0.48);
  }

  .mobile-scene img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 170ms ease, transform 170ms ease;
  }

  .mobile-scene.changing img {
    opacity: 0;
    transform: translateX(12px);
  }

  .rotate-hint {
    display: block;
    margin: 8px 0 0;
    color: #d8d0f6;
    font-size: 12px;
    text-align: center;
  }

  .reader-controls {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    margin: 0 auto;
  }

  .page-button {
    min-height: 44px;
    padding-inline: 12px;
  }

  .progress-dots {
    display: none;
  }

  .completion-note {
    right: 14px;
    bottom: 82px;
    left: 14px;
    max-width: none;
    transform: translateY(calc(100% + 130px));
  }

  .completion-note.show {
    transform: translateY(0);
  }
}

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

/* --------------------------------------------------------------------------
   Storybook Room library
   A paper-and-crayon foyer for the books, before the full-screen reader opens.
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body[data-view="library"] {
  overflow-x: hidden;
  overflow-y: auto;
  background: #d8eff1;
  color: #2a1e58;
}

body[data-view="reader"] {
  overflow: hidden;
}

.library-view[hidden],
.reader-view[hidden] {
  display: none;
}

.library-view {
  --library-ink: #2a1e58;
  --library-ink-soft: #5b4f79;
  --library-paper: #fffaf0;
  --library-sky: #d8eff1;
  --library-yellow: #f3c45d;
  --library-coral: #ed8b71;
  --library-mint: #91bb8e;
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--library-sky);
  isolation: isolate;
}

.library-view::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(rgba(216, 239, 241, 0.54), rgba(216, 239, 241, 0.54)), url("assets/library-paper-texture.png");
  background-position: center;
  background-size: cover;
  content: "";
  opacity: 0.62;
  pointer-events: none;
}

.library-view::after {
  position: absolute;
  z-index: -1;
  top: 0;
  right: -13vw;
  width: 52vw;
  height: 46vw;
  max-width: 720px;
  max-height: 620px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.42);
  content: "";
  filter: blur(2px);
  pointer-events: none;
}

.library-header,
.library-view main,
.library-footer {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid rgba(42, 30, 88, 0.16);
}

.library-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--library-ink);
  text-decoration: none;
}

.library-brand__mark {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 7px 6px;
  border: 2px solid var(--library-ink);
  border-radius: 50% 46% 52% 44%;
  background: var(--library-yellow);
  transform: rotate(-7deg);
}

.library-brand__mark i {
  display: block;
  width: 5px;
  height: 11px;
  border-radius: 999px;
  background: var(--library-ink);
}

.library-brand__mark i:nth-child(2) {
  height: 15px;
  background: var(--library-coral);
}

.library-brand__mark i:nth-child(3) {
  height: 8px;
}

.library-brand strong,
.library-brand small {
  display: block;
}

.library-brand strong {
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.library-brand small {
  margin-top: 1px;
  color: var(--library-ink-soft);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.library-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
}

.library-nav a {
  color: var(--library-ink-soft);
  font-size: 14px;
  text-decoration: none;
  transition: color 160ms ease;
}

.library-nav a:hover,
.library-nav a:focus-visible {
  color: var(--library-ink);
}

.library-nav__button,
.library-primary {
  border: 2px solid var(--library-ink);
  border-radius: 999px;
  background: var(--library-ink);
  color: var(--library-paper);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.library-nav__button {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}

.library-nav__button:hover,
.library-primary:hover {
  background: #44337c;
  transform: translateY(-2px) rotate(-1deg);
}

.library-nav__button:active,
.library-primary:active,
.book-card:active {
  transform: translateY(1px) scale(0.98);
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.91fr) minmax(420px, 1.09fr);
  align-items: center;
  min-height: min(720px, calc(100dvh - 82px));
  padding: clamp(58px, 8vw, 108px) 0 clamp(78px, 9vw, 120px);
}

.library-hero__copy {
  position: relative;
  z-index: 2;
  padding-bottom: 14px;
}

.library-kicker,
.section-heading__label,
.library-note__label {
  margin: 0 0 17px;
  color: var(--library-coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.3;
}

.library-hero h1 {
  max-width: 620px;
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.93;
}

.library-hero h1 em {
  position: relative;
  display: inline-block;
  padding-inline: 0.08em 0.13em;
  color: var(--library-coral);
  font-style: normal;
  transform: rotate(-2deg);
}

.library-hero h1 em::after {
  position: absolute;
  right: 0.04em;
  bottom: -0.02em;
  left: 0;
  height: 0.12em;
  border-radius: 50%;
  background: var(--library-yellow);
  content: "";
  transform: rotate(-2deg);
  z-index: -1;
}

.library-hero__intro {
  max-width: 390px;
  margin: 28px 0 0;
  color: var(--library-ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.library-hero__actions {
  display: flex;
  align-items: center;
  gap: 23px;
  margin-top: 35px;
}

.library-primary {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  min-height: 52px;
  padding: 13px 19px 13px 22px;
  font-size: 14px;
}

.library-primary span {
  font-size: 18px;
  line-height: 1;
}

.library-text-link {
  color: var(--library-ink);
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 5px;
}

.library-text-link span {
  display: inline-block;
  margin-left: 6px;
  color: var(--library-coral);
  transition: transform 160ms ease;
}

.library-text-link:hover span {
  transform: translateY(3px);
}

.library-hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 545px;
}

.hero-orbit {
  position: absolute;
  border: 1.5px solid rgba(42, 30, 88, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit--one {
  width: min(40vw, 480px);
  height: min(31vw, 372px);
  transform: rotate(-16deg);
}

.hero-orbit--two {
  width: min(34vw, 420px);
  height: min(44vw, 545px);
  border-color: rgba(237, 139, 113, 0.33);
  transform: rotate(28deg);
}

.hero-cover-wrap {
  position: relative;
  width: min(310px, 54vw);
  padding: 13px 13px 19px;
  border: 1px solid rgba(42, 30, 88, 0.24);
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 19px 22px 0 rgba(42, 30, 88, 0.12), 0 24px 40px rgba(42, 30, 88, 0.18);
  transform: rotate(4deg);
  animation: cover-breathe 7s ease-in-out infinite;
}

.hero-cover {
  display: block;
  width: 100%;
  height: auto;
}

.hero-cover-tab {
  position: absolute;
  top: -16px;
  right: 28px;
  padding: 7px 11px 6px;
  border: 1px solid rgba(42, 30, 88, 0.25);
  border-bottom: 0;
  background: var(--library-yellow);
  color: var(--library-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  transform: rotate(3deg);
}

.hero-bookmark {
  position: absolute;
  right: 27px;
  bottom: -26px;
  width: 30px;
  height: 84px;
  background: var(--library-coral);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  transform: rotate(5deg);
}

.hero-sticker {
  position: absolute;
  top: 24px;
  right: 4%;
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  margin: 0;
  border-radius: 50%;
  background: var(--library-yellow);
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 15px;
  line-height: 1.1;
  text-align: center;
  transform: rotate(11deg);
}

.hero-sticker span {
  font-family: "Avenir Next", sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.hero-caption {
  position: absolute;
  right: 0;
  bottom: 36px;
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--library-ink-soft);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.hero-caption strong {
  color: var(--library-ink);
  font-size: 13px;
}

.hero-scribble {
  position: absolute;
  color: var(--library-coral);
  font-size: 22px;
}

.hero-scribble--left {
  top: 27%;
  left: 4%;
  transform: rotate(-17deg);
}

.hero-scribble--right {
  right: 2%;
  bottom: 18%;
  color: var(--library-yellow);
  transform: rotate(21deg);
}

@keyframes cover-breathe {
  0%, 100% { transform: rotate(4deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-8px); }
}

.library-note {
  display: grid;
  grid-template-columns: 92px minmax(200px, 0.95fr) minmax(120px, 1fr) minmax(210px, 0.8fr);
  align-items: center;
  gap: 28px;
  padding: 25px 0 28px;
  border-top: 1px solid rgba(42, 30, 88, 0.23);
  border-bottom: 1px solid rgba(42, 30, 88, 0.23);
}

.library-note__number {
  margin: 0;
  color: var(--library-coral);
  font-family: Georgia, serif;
  font-size: 56px;
  font-style: italic;
  line-height: 0.8;
}

.library-note__label {
  margin-bottom: 9px;
  color: var(--library-ink-soft);
  font-size: 10px;
}

.library-note__copy,
.library-note__aside {
  margin: 0;
  color: var(--library-ink);
  font-size: 14px;
  line-height: 1.6;
}

.library-note__aside {
  color: var(--library-ink-soft);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 15px;
  transform: rotate(-2deg);
}

.library-note__line {
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(42, 30, 88, 0.2);
}

.collection-section {
  padding: 106px 0 122px;
}

.collection-section--cappy {
  padding-top: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.section-heading__label {
  margin-bottom: 11px;
}

.section-heading h2 {
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(40px, 5vw, 67px);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.section-heading__count {
  margin: 0 3px 3px 0;
  color: var(--library-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

.section-heading__count span {
  color: var(--library-ink-soft);
  font-size: 12px;
  font-weight: 400;
}

.collection-feature {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(32px, 7vw, 110px);
  align-items: center;
}

.book-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.93fr) minmax(190px, 1fr);
  width: 100%;
  padding: 19px;
  border: 1px solid rgba(42, 30, 88, 0.24);
  border-radius: 4px;
  background: rgba(255, 250, 240, 0.76);
  color: var(--library-ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 12px 15px 0 rgba(42, 30, 88, 0.1);
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.book-card:hover {
  background: var(--library-paper);
  box-shadow: 18px 20px 0 rgba(42, 30, 88, 0.13);
  transform: translate(-4px, -5px) rotate(-0.5deg);
}

.book-card__cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #f0c65a;
}

.book-card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.book-card:hover .book-card__cover img {
  transform: scale(1.045);
}

.book-card__sound {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--library-ink);
  color: var(--library-paper);
  font-size: 11px;
  font-weight: 800;
}

.book-card__sound i {
  color: var(--library-yellow);
  font-size: 9px;
  font-style: normal;
}

.book-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 100%;
  padding: 11px 18px 8px 25px;
}

.book-card__meta {
  color: var(--library-coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.book-card__body strong {
  margin-top: 42px;
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(25px, 3vw, 39px);
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.book-card__description {
  max-width: 200px;
  margin-top: 20px;
  color: var(--library-ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.book-card__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(42, 30, 88, 0.16);
  font-size: 13px;
  font-weight: 800;
}

.book-card__action b {
  color: var(--library-coral);
  font-size: 19px;
  font-weight: 400;
}

.collection-feature__aside {
  position: relative;
  min-height: 360px;
  padding: 25px 0 0 27px;
}

.speech-bubble {
  position: absolute;
  top: 0;
  right: 7%;
  display: grid;
  place-items: center;
  width: 185px;
  height: 95px;
  border: 2px solid var(--library-ink);
  border-radius: 52% 48% 46% 54%;
  background: var(--library-yellow);
  color: var(--library-ink);
  font-family: Georgia, serif;
  font-size: 21px;
  font-style: italic;
  transform: rotate(4deg);
}

.speech-bubble__tail {
  position: absolute;
  bottom: -20px;
  left: 23px;
  width: 27px;
  height: 30px;
  border-right: 2px solid var(--library-ink);
  background: var(--library-yellow);
  clip-path: polygon(0 0, 100% 0, 24% 100%);
  transform: rotate(14deg);
}

.collection-feature__quote {
  margin: 122px 0 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: clamp(25px, 3vw, 37px);
  letter-spacing: -0.04em;
  line-height: 1.13;
  transform: rotate(-2deg);
}

.collection-feature__quote em {
  color: var(--library-coral);
  font-style: normal;
}

.mini-pages {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: end;
  width: 236px;
  height: 126px;
}

.mini-pages img {
  position: absolute;
  bottom: 0;
  width: 103px;
  height: 122px;
  border: 6px solid var(--library-paper);
  object-fit: cover;
  box-shadow: 4px 5px 0 rgba(42, 30, 88, 0.12);
}

.mini-pages img:first-child {
  right: 73px;
  transform: rotate(-7deg);
}

.mini-pages img:nth-child(2) {
  right: 0;
  transform: rotate(8deg);
}

.mini-pages span {
  position: absolute;
  bottom: -23px;
  right: 5px;
  color: var(--library-ink-soft);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.coming-shelf {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.3fr auto;
  align-items: center;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid rgba(42, 30, 88, 0.2);
  background: rgba(145, 187, 142, 0.64);
}

.coming-shelf__letter {
  align-self: stretch;
  padding: 29px 0 0 56px;
  color: rgba(42, 30, 88, 0.87);
  font-family: Georgia, serif;
  font-size: clamp(150px, 22vw, 270px);
  font-style: italic;
  line-height: 0.82;
}

.coming-shelf__copy {
  padding: 40px 30px;
}

.coming-shelf__copy p {
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: clamp(28px, 4vw, 52px);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.coming-shelf__copy span {
  display: inline-block;
  margin-top: 21px;
  color: var(--library-ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.coming-shelf__star {
  align-self: start;
  padding: 23px 34px 0 0;
  color: var(--library-yellow);
  font-size: 35px;
  transform: rotate(18deg);
}

.library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 92px;
  border-top: 1px solid rgba(42, 30, 88, 0.2);
  color: var(--library-ink-soft);
  font-size: 11px;
}

.library-footer span:first-child {
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: 14px;
}

.library-footer a {
  color: var(--library-ink);
  text-underline-offset: 4px;
}

.reader-view {
  min-height: 100dvh;
}

@media (max-width: 900px) {
  .library-hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  }

  .library-hero__visual {
    min-height: 470px;
  }

  .library-note {
    grid-template-columns: 70px minmax(160px, 1fr) minmax(60px, 0.55fr) minmax(150px, 0.85fr);
    gap: 18px;
  }

  .collection-feature {
    gap: 32px;
  }

  .book-card {
    grid-template-columns: minmax(160px, 0.9fr) minmax(160px, 1fr);
  }

  .book-card__body {
    padding-left: 18px;
  }
}

@media (max-width: 700px) {
  html {
    scroll-behavior: auto;
  }

  .library-header,
  .library-view main,
  .library-footer {
    width: min(100% - 30px, 520px);
  }

  .library-header {
    min-height: 72px;
  }

  .library-nav a {
    display: none;
  }

  .library-nav__button {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .library-hero {
    display: block;
    min-height: auto;
    padding: 64px 0 84px;
  }

  .library-hero h1 {
    font-size: clamp(51px, 15vw, 78px);
  }

  .library-hero__intro {
    max-width: 320px;
    margin-top: 24px;
    font-size: 15px;
  }

  .library-hero__actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-top: 28px;
  }

  .library-hero__visual {
    min-height: 455px;
    margin-top: 35px;
  }

  .hero-orbit--one {
    width: 92vw;
    height: 70vw;
  }

  .hero-orbit--two {
    width: 76vw;
    height: 102vw;
  }

  .hero-cover-wrap {
    width: min(286px, 69vw);
  }

  .hero-sticker {
    top: 4px;
    right: 1%;
    width: 78px;
    height: 78px;
    font-size: 12px;
  }

  .hero-caption {
    right: 4px;
    bottom: 20px;
  }

  .library-note {
    grid-template-columns: 58px 1fr;
    gap: 14px 18px;
    padding: 24px 0;
  }

  .library-note__number {
    grid-row: span 2;
    font-size: 45px;
  }

  .library-note__line {
    display: none;
  }

  .library-note__aside {
    grid-column: 2;
    font-size: 13px;
  }

  .collection-section {
    padding: 80px 0 92px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
  }

  .section-heading__count {
    text-align: left;
  }

  .collection-feature {
    display: block;
  }

  .book-card {
    grid-template-columns: minmax(130px, 0.83fr) minmax(150px, 1fr);
    padding: 11px;
  }

  .book-card__body {
    padding: 8px 10px 7px 16px;
  }

  .book-card__body strong {
    margin-top: 32px;
    font-size: clamp(22px, 7vw, 32px);
  }

  .book-card__description {
    margin-top: 14px;
    font-size: 12px;
  }

  .book-card__action {
    padding-top: 15px;
  }

  .collection-feature__aside {
    min-height: 320px;
    margin-top: 58px;
    padding-left: 10px;
  }

  .speech-bubble {
    right: 5%;
    width: 155px;
    height: 82px;
    font-size: 18px;
  }

  .collection-feature__quote {
    margin-top: 100px;
    font-size: 31px;
  }

  .coming-shelf {
    grid-template-columns: 0.72fr 1.28fr;
    min-height: 225px;
  }

  .coming-shelf__letter {
    padding: 31px 0 0 22px;
    font-size: 160px;
  }

  .coming-shelf__copy {
    padding: 34px 17px 29px 0;
  }

  .coming-shelf__copy p {
    font-size: 29px;
  }

  .coming-shelf__copy span {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .coming-shelf__star {
    position: absolute;
    top: 0;
    right: 14px;
    padding: 15px 0 0;
  }

  .library-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 120px;
    padding: 21px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cover-wrap {
    animation: none;
  }
}

/* Flubby shelf: six small books, each with a cover, a movie, and a PDF. */

.collection-section--flubby {
  padding-top: 0;
}

.section-heading--flubby h2 {
  color: #2c6480;
}

.flubby-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin: -2px 0 35px;
  padding: 0 0 25px;
  border-bottom: 1px solid rgba(42, 30, 88, 0.2);
}

.flubby-intro p {
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.045em;
  line-height: 1.04;
  transform: rotate(-1deg);
}

.flubby-intro em {
  color: #2c6480;
  font-style: normal;
}

.flubby-intro > span {
  max-width: 300px;
  color: var(--library-ink-soft);
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.flubby-book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.flubby-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42, 30, 88, 0.22);
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 7px 9px 0 rgba(42, 30, 88, 0.08);
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.flubby-card:hover {
  background: #fffaf0;
  box-shadow: 11px 14px 0 rgba(42, 30, 88, 0.12);
  transform: translateY(-5px) rotate(-0.4deg);
}

.flubby-card--duplicate {
  background: rgba(248, 238, 214, 0.78);
}

.flubby-card__cover-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #c9dfe3;
}

.flubby-card__cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.flubby-card:hover .flubby-card__cover {
  transform: scale(1.035);
}

.flubby-card__number {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 2px solid #2c6480;
  border-radius: 50%;
  background: var(--library-yellow);
  color: #2c6480;
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
  transform: rotate(-8deg);
}

.flubby-card__formats {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 8px 5px;
  background: rgba(42, 30, 88, 0.88);
  color: var(--library-paper);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.flubby-card__body {
  padding: 18px 18px 16px;
}

.flubby-card__meta {
  min-height: 27px;
  margin: 0;
  color: #2c6480;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.flubby-card h3 {
  min-height: 50px;
  margin: 10px 0 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", "Avenir Next Rounded", sans-serif;
  font-size: clamp(20px, 2.2vw, 27px);
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.flubby-card__duplicate {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 7px;
  background: rgba(237, 139, 113, 0.18);
  color: #a55045;
  font-size: 10px;
  font-weight: 800;
}

.flubby-card__description {
  min-height: 43px;
  margin: 14px 0 17px;
  color: var(--library-ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.flubby-card__actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid rgba(42, 30, 88, 0.16);
}

.flubby-video-button,
.flubby-pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 35px;
  padding: 7px 10px;
  border: 1.5px solid #2c6480;
  border-radius: 999px;
  color: #2c6480;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.flubby-video-button {
  background: #2c6480;
  color: var(--library-paper);
  cursor: pointer;
}

.flubby-video-button:hover,
.flubby-pdf-link:hover {
  background: var(--library-yellow);
  color: var(--library-ink);
  transform: translateY(-1px);
}

.flubby-video-button span {
  margin-right: 5px;
  font-size: 8px;
}

.flubby-pdf-link {
  background: transparent;
}

.flubby-pdf-link span {
  margin-left: 5px;
  font-size: 14px;
  font-weight: 400;
}

.video-open {
  overflow: hidden !important;
}

.video-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.video-modal[hidden] {
  display: none;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 50, 0.77);
  backdrop-filter: blur(7px);
}

.video-modal__panel {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100dvh - 44px);
  overflow: auto;
  padding: 20px;
  border: 2px solid var(--library-yellow);
  background: var(--library-paper);
  box-shadow: 13px 16px 0 rgba(9, 6, 28, 0.35);
}

.video-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.video-modal__header p {
  margin: 0 0 5px;
  color: #2c6480;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.video-modal__header h2 {
  max-width: 700px;
  margin: 0;
  color: var(--library-ink);
  font-family: "Chalkboard SE", "Bradley Hand", sans-serif;
  font-size: clamp(24px, 4vw, 42px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.video-modal__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--library-ink);
  border-radius: 50%;
  background: transparent;
  color: var(--library-ink);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.video-modal__close:hover {
  background: var(--library-yellow);
}

.video-modal video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 185px);
  background: #14102f;
}

.video-modal__hint {
  margin: 12px 0 0;
  color: var(--library-ink-soft);
  font-size: 12px;
}

@media (max-width: 900px) {
  .flubby-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .flubby-intro {
    align-items: start;
    flex-direction: column;
    gap: 13px;
  }

  .flubby-intro > span {
    max-width: 290px;
    text-align: left;
  }

  .flubby-book-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .flubby-card {
    display: grid;
    grid-template-columns: 42% 58%;
  }

  .flubby-card__cover-wrap {
    aspect-ratio: 0.82;
    height: 100%;
  }

  .flubby-card__body {
    padding: 14px 13px 12px;
  }

  .flubby-card h3 {
    min-height: 0;
    font-size: 23px;
  }

  .flubby-card__description {
    min-height: 0;
    margin-block: 10px 13px;
    font-size: 11px;
  }

  .flubby-card__actions {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
  }

  .flubby-video-button,
  .flubby-pdf-link {
    min-height: 31px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .video-modal {
    padding: 10px;
  }

  .video-modal__panel {
    padding: 13px;
  }

  .video-modal__header {
    margin-bottom: 11px;
  }

  .video-modal__close {
    width: 32px;
    height: 32px;
    font-size: 23px;
  }
}

@media (max-width: 700px) {
  .flubby-book-grid {
    grid-template-columns: 1fr;
  }
}

/* Final cascade overrides for the existing responsive library styles. */
.hero-cover-wrap {
  position: absolute;
  z-index: 3;
  bottom: 42px;
  left: 7%;
  width: min(195px, 24vw);
  transform: rotate(6deg);
}

.flubby-book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flubby-card {
  display: grid;
  grid-template-columns: minmax(165px, 0.78fr) minmax(0, 1.22fr);
  min-height: 300px;
}

.flubby-card__cover-wrap {
  height: 100%;
  min-height: 300px;
  aspect-ratio: auto;
}

.flubby-card__cover {
  padding: 12px;
  object-fit: contain;
  object-position: center;
}

.flubby-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px 19px 18px;
}

.flubby-card h3,
.flubby-card__description {
  min-height: 0;
}

.flubby-card__actions {
  margin-top: auto;
}

@media (max-width: 700px) {
  .flubby-book-grid {
    grid-template-columns: 1fr;
  }

  .hero-cover-wrap {
    bottom: 37px;
    left: 3%;
    width: min(165px, 40vw);
  }

  .flubby-card {
    grid-template-columns: 42% 58%;
    min-height: 0;
  }

  .flubby-card__cover-wrap {
    min-height: 0;
  }

  .flubby-card__cover {
    padding: 8px;
  }

  .flubby-card__body {
    padding: 14px 13px 12px;
  }
}
