/* Homepage Folio: a compact reading-room window for the selected B direction. */
.books-preview {
  gap: clamp(1.8rem, 4vw, 4rem);
  padding-block: clamp(3.2rem, 5.5vw, 5rem);
}

.books-preview__copy h2 {
  font-size: clamp(2.6rem, 4.2vw, 4rem);
  letter-spacing: -.025em;
}

.books-folio-carousel {
  min-width: 0;
  --folio-ink: #43151d;
  --folio-gold: #a8793e;
  --folio-paper: #f8f1e7;
}

.books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
  position: relative;
  height: clamp(370px, 34vw, 435px);
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(67, 21, 29, .22);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .72), rgba(255, 253, 247, 0) 38%),
    radial-gradient(ellipse at 50% 66%, rgba(194, 163, 122, .25), transparent 58%),
    repeating-linear-gradient(0deg, rgba(67, 21, 29, .018) 0 1px, transparent 1px 5px),
    var(--folio-paper);
  box-shadow: 0 18px 34px rgba(63, 36, 25, .12);
}

.books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage--folio::before {
  position: absolute;
  z-index: 0;
  inset: .85rem;
  display: block;
  border: 1px solid rgba(67, 21, 29, .14);
  content: '';
  pointer-events: none;
}

.books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage--folio::after {
  position: absolute;
  z-index: 0;
  right: 4%;
  bottom: 8%;
  left: 4%;
  display: block;
  height: 11%;
  border-top: 1px solid rgba(168, 121, 62, .72);
  border-bottom: 2px solid rgba(67, 21, 29, .58);
  background: linear-gradient(180deg, rgba(182, 139, 82, .56), rgba(94, 55, 37, .24));
  box-shadow: 0 12px 18px rgba(67, 21, 29, .16);
  content: '';
  pointer-events: none;
}

.books-folio-carousel .prototype-carousel__deck-shadow {
  position: absolute;
  z-index: 1;
  right: 15%;
  bottom: 12%;
  left: 15%;
  display: block;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(67, 21, 29, .18);
  filter: blur(13px);
  pointer-events: none;
}

.books-folio-carousel .motion-track {
  z-index: 2;
}

.books-folio-carousel .motion-slide {
  top: 54%;
}

.books-folio-carousel .motion-slide:not(.is-active) {
  filter: saturate(.88);
}

.books-folio-carousel .motion-slide.is-active {
  filter: none;
}

.books-folio-carousel .motion-book {
  border: 1px solid rgba(67, 21, 29, .2);
  background: var(--folio-paper);
  box-shadow: 7px 13px 19px rgba(48, 32, 30, .17), 1px 2px 2px rgba(48, 32, 30, .18);
}

.books-folio-carousel .motion-slide.is-active .motion-book {
  box-shadow: 14px 21px 28px rgba(55, 28, 19, .25), 1px 2px 2px rgba(48, 32, 30, .2);
}

.books-folio-carousel .motion-book:hover,
.books-folio-carousel .motion-book:focus-visible {
  box-shadow: 12px 18px 27px rgba(55, 28, 19, .28);
}

.books-folio-carousel .motion-book__label {
  bottom: .7rem;
  border-color: rgba(255, 250, 240, .36);
  background: rgba(48, 32, 30, .9);
  color: #fffaf0;
}

.books-folio-carousel .prototype-carousel__details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  max-width: none;
  margin: 0;
  padding: 1rem .1rem .15rem;
  border-top: 1px solid rgba(67, 21, 29, .22);
}

.books-folio-carousel .prototype-carousel__eyebrow {
  margin: 0 0 .35rem;
  color: var(--folio-gold);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.books-folio-carousel .prototype-carousel__details h3 {
  max-width: 28ch;
  margin: 0;
  color: var(--folio-ink);
  font-size: clamp(1.4rem, 1.9vw, 2rem);
  line-height: 1.06;
}

.books-folio-carousel .prototype-carousel__translation {
  max-width: 42ch;
  margin: .35rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: .9rem;
  line-height: 1.18;
}

.books-folio-carousel .prototype-carousel__meta {
  margin: .42rem 0 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .02em;
}

.books-folio-carousel .prototype-carousel__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
}

.books-folio-carousel .prototype-carousel__status {
  min-width: 6ch;
  margin: 0;
  color: var(--muted);
  font-size: .66rem;
  letter-spacing: .1em;
  text-align: right;
}

.books-folio-carousel .prototype-carousel__buttons {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.books-folio-carousel .prototype-carousel__button {
  display: inline-grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(67, 21, 29, .34);
  border-radius: 50%;
  background: transparent;
  color: var(--folio-ink);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.books-folio-carousel .prototype-carousel__button svg {
  width: 1.05rem;
  height: 1.05rem;
}

.books-folio-carousel .prototype-carousel__button:hover,
.books-folio-carousel .prototype-carousel__button:focus-visible {
  background: var(--folio-ink);
  color: #fffaf0;
  transform: translateY(-1px);
}

.books-folio-carousel .prototype-carousel__button:focus-visible,
.books-folio-carousel .prototype-carousel__pause:focus-visible {
  outline: 2px solid var(--folio-gold);
  outline-offset: 3px;
}

.books-folio-carousel .prototype-carousel__pause {
  min-height: 2.55rem;
  padding: .5rem .75rem;
  border: 1px solid rgba(67, 21, 29, .28);
  background: transparent;
  color: var(--folio-ink);
  cursor: pointer;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.books-folio-carousel .prototype-carousel__pause:hover {
  background: rgba(255, 253, 247, .72);
}

@media (max-width: 1050px) and (min-width: 801px) {
  .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: 370px;
  }
}

@media (max-width: 800px) {
  .books-preview {
    gap: 1.7rem;
  }

  .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: 330px;
  }

  .books-folio-carousel .prototype-carousel__details {
    grid-template-columns: 1fr;
    gap: .8rem;
  }

  .books-folio-carousel .prototype-carousel__actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .books-folio-carousel .prototype-carousel__status {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .books-preview {
    padding-block: 3.2rem 3.8rem;
  }

  .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: 300px;
  }

  .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage--folio::before {
    inset: .65rem;
  }

  .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage--folio::after {
    bottom: 7%;
    height: 13%;
  }

  .books-folio-carousel .prototype-carousel__details {
    padding: .85rem .05rem .1rem;
  }

  .books-folio-carousel .prototype-carousel__details h3 {
    max-width: 22ch;
    font-size: clamp(1.3rem, 6vw, 1.7rem);
  }

  .books-folio-carousel .prototype-carousel__actions {
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: 275px;
  }

  .books-folio-carousel .prototype-carousel__button {
    width: 2.35rem;
    height: 2.35rem;
  }

  .books-folio-carousel .prototype-carousel__pause {
    min-height: 2.35rem;
  }
}

/* Full-canvas presentation: substantial enough to lead the page, while staying in normal page flow. */
#books-preview.books-section {
  min-height: 0;
}

#books-preview .books-preview {
  width: min(calc(100% - clamp(2rem, 6vw, 6rem)), 1500px);
  min-height: 0;
  grid-template-columns: minmax(13rem, .38fr) minmax(0, 1.62fr);
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

#books-preview .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
  height: clamp(420px, 40vw, 500px);
}

@media (max-width: 1050px) and (min-width: 801px) {
  #books-preview .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: clamp(400px, 42vw, 460px);
  }
}

@media (max-width: 800px) {
  #books-preview .books-preview {
    width: min(calc(100% - 2rem), var(--container));
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: clamp(2.5rem, 7vh, 4.5rem);
  }

  #books-preview .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: clamp(350px, 50svh, 440px);
  }
}

@media (max-width: 600px) {
  #books-preview .books-preview {
    width: min(calc(100% - 1.25rem), var(--container));
  }

  #books-preview .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: clamp(330px, 46svh, 410px);
  }
}

@media (max-width: 360px) {
  #books-preview .books-folio-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: min(48svh, 380px);
  }
}

/* Keep the introduction above the shelf so the Folio can use the full content canvas. */
#books-preview .books-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(1.6rem, 3vw, 2.6rem);
  grid-template-columns: none;
}

#books-preview .books-preview__copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  max-width: none;
}

#books-preview .books-preview__copy-intro {
  min-width: 0;
}

#books-preview .books-preview__copy-intro h2 {
  margin-bottom: .55rem;
}

#books-preview .books-preview__copy-intro > p:not(.eyebrow) {
  max-width: 30rem;
  margin: 0;
}

#books-preview .books-preview__copy .button {
  flex: 0 0 auto;
  margin: 0 0 .15rem auto;
}

#books-preview .books-folio-carousel {
  width: 100%;
}

@media (max-width: 600px) {
  #books-preview .books-preview {
    gap: 1.35rem;
  }

  #books-preview .books-preview__copy {
    display: block;
  }

  #books-preview .books-preview__copy .button {
    display: inline-flex;
    margin: .9rem 0 0;
  }
}

/* Homepage direction: B's turning folio held inside A's reading-room shelf. */
.books-hybrid-carousel {
  --hybrid-ink: #43151d;
  --hybrid-wood: #2b0d13;
  --hybrid-gold: #c5985c;
  --hybrid-paper: #f8f0e4;
}

.books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
  border-color: rgba(197, 152, 92, .66);
  background:
    repeating-linear-gradient(90deg, rgba(255, 242, 218, .028) 0 1px, transparent 1px 8px),
    radial-gradient(ellipse at 50% 45%, rgba(128, 76, 48, .32), transparent 64%),
    linear-gradient(135deg, #46151d, var(--hybrid-wood) 76%);
  box-shadow: 0 23px 42px rgba(45, 12, 17, .2), inset 0 0 0 1px rgba(255, 234, 194, .08);
}

.books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::before {
  z-index: 0;
  inset: .9rem;
  border-color: rgba(67, 21, 29, .22);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .92), rgba(255, 253, 247, .12) 44%, rgba(221, 195, 163, .28)),
    repeating-linear-gradient(0deg, rgba(83, 55, 40, .028) 0 1px, transparent 1px 5px),
    var(--hybrid-paper);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 247, .42), inset 0 -1.2rem 2.2rem rgba(93, 53, 35, .1);
}

.books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::after {
  z-index: 0;
  right: 5%;
  bottom: 10.5%;
  left: 5%;
  height: .62rem;
  border-top: 1px solid rgba(230, 193, 126, .86);
  border-bottom: 2px solid rgba(44, 19, 20, .9);
  border-radius: 1px;
  background: linear-gradient(180deg, #c09255, #70452e 48%, #2b1315 49%, #16070b 100%);
  box-shadow: 0 9px 15px rgba(10, 2, 5, .44);
  filter: none;
}

.books-hybrid-carousel .motion-track { z-index: 2; }

.books-hybrid-carousel .prototype-carousel__deck-shadow {
  z-index: 1;
  right: 12%;
  bottom: 12%;
  left: 12%;
  background: rgba(48, 18, 21, .24);
  filter: blur(14px);
}

.books-hybrid-carousel .motion-slide { top: 52%; }

.books-hybrid-carousel .motion-slide:not(.is-active) {
  filter: saturate(.88) brightness(.98);
}

.books-hybrid-carousel .motion-book {
  border: 1px solid rgba(67, 21, 29, .2);
  background: var(--hybrid-paper);
  box-shadow: 7px 14px 20px rgba(35, 12, 15, .24), 1px 2px 2px rgba(35, 12, 15, .2);
}

.books-hybrid-carousel .motion-slide.is-active .motion-book {
  box-shadow: 15px 23px 30px rgba(34, 10, 14, .33), 0 0 0 1px rgba(197, 152, 92, .72), 1px 2px 2px rgba(35, 12, 15, .24);
}

.books-hybrid-carousel .motion-book:hover,
.books-hybrid-carousel .motion-book:focus-visible {
  box-shadow: 13px 20px 29px rgba(34, 10, 14, .34), 0 0 0 1px rgba(197, 152, 92, .72);
}

.books-hybrid-carousel .motion-book__label {
  border-color: rgba(230, 193, 126, .5);
  background: rgba(55, 17, 24, .93);
}

.books-hybrid-carousel .prototype-carousel__details {
  border-top-color: rgba(197, 152, 92, .5);
}

.books-hybrid-carousel .prototype-carousel__eyebrow { color: #875f32; }

.books-hybrid-carousel .prototype-carousel__button,
.books-hybrid-carousel .prototype-carousel__pause {
  border-color: rgba(67, 21, 29, .38);
  color: var(--hybrid-ink);
}

@media (max-width: 600px) {
  .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::before { inset: .65rem; }

  .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::after {
    right: 6%;
    bottom: 9%;
    left: 6%;
    height: .52rem;
  }

  .books-hybrid-carousel .motion-slide { top: 50%; }
}

@media (max-width: 360px) {
  .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::after {
    right: 7%;
    left: 7%;
  }
}

/* Editorial refinement: let the supplied covers carry the composition. */
#books-preview .books-preview {
  gap: clamp(1.35rem, 2.8vw, 2.7rem);
  padding-block: clamp(2.8rem, 4.2vw, 4.25rem);
}

.books-hybrid-carousel {
  --hybrid-ink: #3a2925;
  --hybrid-rule: #cdbdad;
  --hybrid-paper: #f7f4ee;
  --hybrid-rail: #9c7958;
}

#books-preview .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
  height: clamp(360px, 30vw, 420px);
  overflow: hidden;
  border: 1px solid rgba(96, 70, 56, .28);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(247, 244, 238, .96)),
    var(--hybrid-paper);
  box-shadow: 0 12px 24px rgba(64, 45, 34, .09);
}

.books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::before {
  inset: .9rem;
  border: 1px solid rgba(96, 70, 56, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(218, 204, 186, .09));
  box-shadow: none;
}

.books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::after {
  right: 4.5%;
  bottom: 10.5%;
  left: 4.5%;
  height: .38rem;
  border-top: 1px solid rgba(156, 121, 88, .86);
  border-bottom: 1px solid rgba(87, 62, 48, .62);
  background: linear-gradient(180deg, rgba(199, 166, 128, .76), rgba(150, 112, 78, .58));
  box-shadow: 0 5px 10px rgba(67, 45, 32, .13);
}

.books-hybrid-carousel .prototype-carousel__deck-shadow {
  right: 14%;
  bottom: 12%;
  left: 14%;
  height: 1rem;
  background: rgba(78, 55, 42, .12);
  filter: blur(11px);
}

.books-hybrid-carousel .motion-track { z-index: 2; }

.books-hybrid-carousel .motion-slide { top: 52%; }

.books-hybrid-carousel .motion-slide:not(.is-active) {
  filter: saturate(.9) brightness(.99);
}

.books-hybrid-carousel .motion-book {
  border: 1px solid rgba(68, 47, 36, .18);
  background: #fbfaf7;
  box-shadow: 6px 11px 17px rgba(59, 40, 31, .16), 1px 2px 2px rgba(59, 40, 31, .13);
}

.books-hybrid-carousel .motion-slide.is-active .motion-book {
  box-shadow: 11px 17px 24px rgba(59, 40, 31, .2), 0 0 0 1px rgba(156, 121, 88, .42), 1px 2px 2px rgba(59, 40, 31, .14);
}

.books-hybrid-carousel .motion-book:hover,
.books-hybrid-carousel .motion-book:focus-visible {
  box-shadow: 10px 16px 23px rgba(59, 40, 31, .22), 0 0 0 1px rgba(156, 121, 88, .54);
}

.books-hybrid-carousel .motion-book__label {
  border-color: rgba(255, 250, 242, .5);
  background: rgba(52, 37, 31, .82);
}

.books-hybrid-carousel .prototype-carousel__details {
  border-top-color: rgba(96, 70, 56, .2);
}

.books-hybrid-carousel .prototype-carousel__eyebrow {
  color: #846044;
}

.books-hybrid-carousel .prototype-carousel__button,
.books-hybrid-carousel .prototype-carousel__pause {
  border-color: rgba(96, 70, 56, .32);
  color: var(--hybrid-ink);
}

.books-hybrid-carousel .prototype-carousel__button:hover,
.books-hybrid-carousel .prototype-carousel__button:focus-visible,
.books-hybrid-carousel .prototype-carousel__pause:hover {
  background: var(--hybrid-ink);
  color: #fffaf3;
}

@media (max-width: 800px) {
  #books-preview .books-preview {
    gap: 1.45rem;
  }

  #books-preview .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: clamp(310px, 45svh, 380px);
  }
}

@media (max-width: 600px) {
  .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::before {
    inset: .65rem;
  }

  .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage::after {
    right: 6%;
    bottom: 9%;
    left: 6%;
    height: .32rem;
  }

  .books-hybrid-carousel .motion-slide { top: 50%; }
}

@media (max-width: 360px) {
  #books-preview .books-hybrid-carousel.motion-carousel[data-carousel-mode="folio"] .prototype-carousel__stage {
    height: 285px;
  }
}
