.books-page {
  --book-purple: #35104f;
  --book-plum: #47155e;
  --book-gold: #f6bf3e;
  --paper: #fff4dc;
  margin: 0;
  color: var(--book-purple);
  background: var(--paper);
  font-family: "DM Sans", Arial, sans-serif;
}
.books-page .site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 4.55rem;
  padding: .35rem clamp(.8rem, 3.8vw, 3.25rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(100deg, #2b0a45, #46175a 54%, #2e0b49);
  border-bottom: 1px solid rgba(255, 209, 92, .28);
  box-shadow: 0 5px 16px rgba(30, 9, 43, .15);
}
.books-page .brand { flex: 0 0 auto; gap: .55rem; }
.books-page .brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.05rem;
  height: 3.05rem;
  border-radius: 50%;
  color: #f6bf3e;
  border: 2px solid #f6bf3e;
  box-shadow: 0 0 0 4px rgba(246, 191, 62, .11), inset 0 0 20px rgba(246, 191, 62, .2);
  font-size: 1.45rem;
}
.books-page .brand-mark::before,.books-page .brand-mark::after {
  content: "✦";
  position: absolute;
  font-size: .55rem;
}
.books-page .brand-mark::before { transform: translate(-1.1rem,-.9rem); }
.books-page .brand-mark::after { transform: translate(1.1rem,.9rem); }
.books-page .brand-copy { gap: .05rem; line-height: .95; }
.books-page .brand-copy strong {
  color: #fff9ee;
  font: 800 clamp(.93rem, 2vw, 1.2rem)/.96 "Fraunces", Georgia, serif;
  letter-spacing: -.02em;
  white-space: normal;
}
.books-page .brand-copy small {
  margin-top: .14rem;
  color: #f1d98f;
  font-size: .52rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.books-page .site-nav .nav-button,.header-quest-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 2.55rem;
  padding: .55rem 1.35rem;
  border: 0;
  border-radius: 999px;
  color: #361349;
  background: linear-gradient(#ffe190, #f3b935);
  box-shadow: 0 3px 0 rgba(129, 78, 12, .28);
  font-size: .92rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.header-quest-button { display: none; margin-left: auto; }
.books-page .menu-button {
  display: none;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  padding: .42rem .35rem;
  border: 0;
  border-radius: .35rem;
  background: transparent;
}
.books-page .menu-button span:not(.sr-only) { height: 2px; margin: 5px 0; background: #fff9f2; }
.books-page .site-nav {
  position: static;
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.7rem, 1.8vw, 1.6rem);
  margin-left: auto;
  color: #fff9f2;
  font-size: .86rem;
}
.books-page .site-nav a { padding: .35rem 0; text-decoration: none; }
.books-page .site-nav a.active { color: #ffdc72; border-bottom: 2px solid #ffdc72; }
.books-page .site-nav .nav-button { margin-left: .4rem; color: #361349; }
.books-main { overflow: hidden; background: var(--paper); }
.books-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.3rem 1rem .95rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.95), transparent 65%),
    repeating-radial-gradient(ellipse at 12% 100%, transparent 0 2rem, rgba(132,82,38,.04) 2.04rem 2.12rem, transparent 2.18rem 4rem),
    linear-gradient(120deg, #f7e6c1, #fff5df 47%, #f6e5bf);
}
.books-hero__copy { position: relative; z-index: 2; max-width: 58rem; margin: 0 auto; text-align: center; }
.eyebrow {
  margin: 0 0 .2rem;
  color: #694a70;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .17em;
  line-height: 1.3;
  text-transform: uppercase;
}
.books-hero h1 {
  margin: 0 auto .38rem;
  color: #35104f;
  font: 800 clamp(2.5rem, 7.7vw, 5.1rem)/.92 "Caprasimo", "Fraunces", Georgia, serif;
  letter-spacing: -.045em;
  text-shadow: 0 2px 0 rgba(255,255,255,.72);
}
.books-hero h1 span { color: #9a5906; }
.hero-intro {
  max-width: 34rem;
  margin: .5rem auto 0;
  color: #382549;
  font-size: clamp(.96rem, 2vw, 1.05rem);
  line-height: 1.4;
}
.hero-decoration { position: absolute; z-index: 0; height: auto; pointer-events: none; }
.hero-passport { top: 5.5rem; left: -3.7rem; width: clamp(8rem, 20vw, 13rem); transform: rotate(-12deg); filter: drop-shadow(0 8px 8px rgba(47,23,39,.2)); }
.hero-stamp { top: 1.45rem; right: 2.6%; width: clamp(5rem, 10vw, 7.5rem); transform: rotate(7deg); opacity: .86; }
.book-carousel {
  position: relative;
  z-index: 2;
  width: min(100%, 78rem);
  margin: 1.1rem auto 0;
  touch-action: pan-y;
}
.carousel-stage { position: relative; height: clamp(25rem, 43vw, 33rem); }
.carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(9rem, 19vw, 15rem);
  height: 88%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,.95);
  border-radius: 1.15rem;
  background: #f4e2bf;
  box-shadow: 0 14px 28px rgba(48,21,43,.24);
  transform: translate(-50%, -50%) scale(.84);
  opacity: 0;
  visibility: hidden;
  transition: transform .3s ease, opacity .3s ease, left .3s ease, visibility .3s;
}
.book-spread { display: grid; grid-template-columns: 44% 56%; width: 100%; height: 100%; background: #fff8e7; }
.book-cover {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  margin: 0;
  padding: 1.05rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,.6), transparent 70%),
    linear-gradient(135deg, #ecd29a, #f8e7bd 50%, #dfc087);
  box-shadow: inset -13px 0 22px -18px rgba(53,16,79,.72);
}
.book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: .35rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(37,21,32,.28));
}
.book-cover figcaption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.book-details {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.1rem, 3.3vw, 2.6rem) clamp(1rem, 3.5vw, 2.6rem);
  text-align: left;
  background:
    radial-gradient(circle at 100% 100%, rgba(191,141,81,.11), transparent 34%),
    repeating-linear-gradient(0deg, rgba(147,103,53,.025) 0, rgba(147,103,53,.025) 1px, transparent 1px, transparent 6px),
    #fff9e9;
  box-shadow: inset 13px 0 22px -18px rgba(53,16,79,.52);
}
.book-label {
  align-self: flex-start;
  margin-bottom: .5rem;
  padding: .28rem .62rem;
  border: 1px solid rgba(104,56,102,.32);
  border-radius: .3rem;
  color: #704c78;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.book-details h2 {
  margin: 0;
  color: #35104f;
  font: 800 clamp(1.55rem, 4vw, 2.55rem)/.98 "Fraunces", Georgia, serif;
  letter-spacing: -.035em;
}
.book-role { margin: .48rem 0 .55rem; color: #95600d; font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.book-summary { max-width: 31rem; margin: 0 0 .8rem; color: #33233f; font-size: clamp(.9rem, 1.4vw, 1rem); line-height: 1.42; }
.book-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; margin: .15rem 0 .9rem; }
.book-facts > div { display: flex; min-width: 0; align-items: flex-start; gap: .42rem; padding-right: .42rem; border-right: 1px solid rgba(86,51,82,.17); }
.book-facts > div:last-child { padding-right: 0; border-right: 0; }
.fact-icon {
  display: grid;
  flex: 0 0 1.8rem;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
  color: #fff4da;
  background: #5c2180;
  font: 700 1.05rem/1 Georgia, serif;
}
.book-facts > div:nth-child(2) .fact-icon { background: #a86e11; }
.book-facts > div:nth-child(3) .fact-icon { background: #96702d; }
.book-facts > div > span:last-child { display: flex; flex-direction: column; gap: .15rem; }
.book-facts b { color: #583765; font-size: .68rem; letter-spacing: .09em; }
.book-facts strong { color: #33233f; font-size: .88rem; line-height: 1.22; }
.gold-button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  align-self: flex-start;
  padding: .62rem 1.35rem;
  border-radius: 999px;
  color: #351449;
  background: linear-gradient(#ffe18b, #f2b72f);
  box-shadow: 0 4px 0 #bb7d1b, 0 8px 14px rgba(56,32,18,.16);
  font-size: .95rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.gold-button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #bb7d1b, 0 10px 16px rgba(56,32,18,.2); }
.carousel-card.is-active {
  z-index: 3;
  width: min(88vw, 68rem);
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.carousel-card.is-prev,.carousel-card.is-next {
  z-index: 2;
  opacity: .88;
  visibility: visible;
}
.carousel-card.is-prev .book-spread,.carousel-card.is-next .book-spread { display: block; }
.carousel-card.is-prev .book-details,.carousel-card.is-next .book-details { display: none; }
.carousel-card.is-prev .book-cover,.carousel-card.is-next .book-cover { height: 100%; padding: .55rem; }
.carousel-card.is-prev .book-cover img,.carousel-card.is-next .book-cover img { object-fit: cover; }
.carousel-card.is-prev { left: 10%; transform: translate(-50%, -50%) scale(.87) rotate(-2deg); }
.carousel-card.is-next { left: 90%; transform: translate(-50%, -50%) scale(.87) rotate(2deg); }
.carousel-card.is-hidden { visibility: hidden; }
.carousel-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  padding: 0 0 .18rem;
  border: 1px solid #e8d4b9;
  border-radius: 50%;
  color: #35104f;
  background: #fffaf2;
  box-shadow: 0 5px 14px rgba(45,17,52,.18);
  font: 400 2.7rem/1 Georgia, serif;
  cursor: pointer;
  transform: translateY(-50%);
}
.carousel-previous { left: .35rem; }
.carousel-next { right: .35rem; }
.carousel-dots { display: flex; justify-content: center; gap: .65rem; margin: .2rem auto .25rem; }
.carousel-dot { width: 1rem; height: 1rem; padding: 0; border: 0; border-radius: 50%; background: #cdb4d1; cursor: pointer; }
.carousel-dot.is-active { background: #6815a2; }
.carousel-hint { margin: .35rem 0 0; color: #5d4965; font-size: .82rem; text-align: center; }
.books-page :focus-visible { outline: 3px solid #a56bd0; outline-offset: 4px; }
.friends-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.7rem 1rem 2.1rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 6%, rgba(255,255,255,.92), transparent 69%),
    repeating-radial-gradient(ellipse at 10% 90%, transparent 0 2rem, rgba(126,76,36,.035) 2.04rem 2.1rem, transparent 2.15rem 4rem),
    linear-gradient(130deg, #fff0ce, #fff8e7 46%, #f7e6bf);
  border-top: 5px solid #44155d;
}
.friends-section h2 { margin: 0; color: #35104f; font: 800 clamp(1.8rem, 5vw, 2.8rem)/1 "Fraunces", Georgia, serif; letter-spacing: -.035em; }
.friends-intro { margin: .35rem auto 1rem; color: #442d56; font-size: 1rem; }
.friend-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem; width: min(100%, 56rem); margin: 0 auto; }
.friend-card { display: flex; min-width: 0; flex-direction: column; align-items: center; color: #311347; text-decoration: none; }
.friend-avatar {
  display: block;
  width: clamp(3.35rem, 13vw, 6.6rem);
  aspect-ratio: 1;
  margin: 0 auto .25rem;
  border: 2px solid #e3c27e;
  border-radius: 50%;
  background-image: url("assets/cck-characters.png");
  background-repeat: no-repeat;
  background-size: 400% 100%;
  box-shadow: 0 3px 8px rgba(74,40,58,.15);
}
.friend-zoe .friend-avatar { background-position: 66.67% center; }
.friend-mateo .friend-avatar { background-position: 33.33% center; }
.friend-kalina .friend-avatar { background-position: 0 center; }
.friend-eliud .friend-avatar { background-position: 100% center; }
.friend-card strong { font: 800 1.05rem/1.15 "Fraunces", Georgia, serif; }
.friend-role { margin-top: .05rem; font: 700 .88rem/1.2 "Fraunces", Georgia, serif; }
.friend-card small { margin-top: .18rem; color: #5b4564; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.quest-cta {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  min-height: 17rem;
  overflow: hidden;
  padding: 2.1rem 1rem 4.3rem;
  color: #35104f;
  text-align: center;
  background:
    url("assets/books-mountains-bottom.jpg") center bottom / 100% 6rem no-repeat,
    radial-gradient(ellipse at 50% 0%, #fff9ec 0, #f4e3c2 70%, #ead6b2 100%);
}
.quest-cta::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(255,247,225,.13), transparent 50%, rgba(255,247,225,.15)); }
.quest-cta h2 { max-width: 15ch; margin: .12rem 0 0; color: #35104f; font: 800 clamp(2rem, 6vw, 3.3rem)/1.03 "Caprasimo", "Fraunces", Georgia, serif; }
.quest-cta p:not(.eyebrow) { max-width: 34rem; margin: .5rem auto 1.05rem; color: #39244c; font-size: 1rem; line-height: 1.45; }
.quest-cta .gold-button { align-self: center; min-width: 15rem; }
.quest-suitcase { position: absolute; z-index: -1; bottom: .2rem; left: -2.4rem; width: clamp(8rem, 20vw, 14rem); height: auto; opacity: .9; transform: rotate(-6deg); }
.quest-stamp {
  position: absolute;
  right: clamp(1rem, 7vw, 6rem);
  top: 2rem;
  display: grid;
  width: 8rem;
  height: 8rem;
  place-content: center;
  border: 2px dashed #95677f;
  border-radius: 50%;
  color: #684260;
  font: 800 .68rem/1.4 "Fraunces", Georgia, serif;
  letter-spacing: .1em;
  transform: rotate(9deg);
}
@media (min-width: 761px) {
  .books-page .site-header { min-height: 4.7rem; }
  .header-quest-button,.books-page .menu-button { display: none; }
  .books-hero { padding: 1.6rem 2rem 1rem; }
  .book-carousel { margin-top: 1.2rem; }
  .carousel-stage { height: clamp(29rem, 43vw, 34rem); }
  .carousel-card.is-prev { left: 8%; }
  .carousel-card.is-next { left: 92%; }
  .carousel-arrow { width: 3.65rem; height: 3.65rem; }
  .carousel-previous { left: 1.2%; }
  .carousel-next { right: 1.2%; }
  .friends-section { padding: 2.2rem 2rem 2.5rem; }
  .friend-list { gap: 1.35rem; }
  .friend-avatar { width: clamp(5rem, 10vw, 7.3rem); }
  .friend-card strong { font-size: 1.18rem; }
  .friend-role { font-size: .95rem; }
  .friend-card small { font-size: .8rem; }
  .quest-cta { min-height: 19rem; padding-top: 2.7rem; background-size: 100% 8rem, auto; }
}
@media (max-width: 760px) {
  .books-page .site-header { position: relative; top: auto; min-height: 4.55rem; gap: .45rem; padding: .38rem .7rem; }
  .books-page .brand { gap: .48rem; }
  .books-page .brand-mark { width: 2.55rem; height: 2.55rem; }
  .books-page .brand-copy strong { font-size: clamp(.79rem, 3.6vw, .94rem); }
  .books-page .brand-copy small { font-size: .43rem; letter-spacing: .105em; }
  .header-quest-button { display: inline-flex; min-height: 2.4rem; margin-left: auto; padding: .48rem .82rem; font-size: clamp(.72rem, 3.3vw, .9rem); }
  .books-page .menu-button { display: block; width: 2.35rem; height: 2.35rem; margin-left: .1rem; }
  .books-page .site-nav { position: absolute; top: calc(100% + .25rem); left: .75rem; right: .75rem; z-index: 55; display: none; flex-direction: column; align-items: stretch; gap: .2rem; padding: .65rem; border: 1px solid #d2aa57; border-radius: .85rem; color: #fff; background: rgba(48,12,72,.98); box-shadow: 0 8px 22px rgba(31,10,44,.25); }
  .books-page .site-nav.open { display: flex; }
  .books-page .site-nav a { padding: .55rem .65rem; }
  .books-page .site-nav a.active { border-bottom: 0; background: rgba(255,255,255,.08); }
  .books-page .site-nav .nav-button { display: none; }
  .books-hero { padding: 1.05rem .85rem .8rem; }
  .books-hero h1 { max-width: 16ch; font-size: clamp(2.05rem, 8.4vw, 2.75rem); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
  .hero-intro { max-width: 31rem; margin-top: .6rem; font-size: .98rem; }
  .hero-passport,.hero-stamp { display: none; }
  .book-carousel { width: min(100%, 32rem); margin-top: 1rem; }
  .carousel-stage { height: auto; }
  .carousel-card { height: auto; border-width: 2px; border-radius: .85rem; }
  .carousel-card.is-active { position: relative; top: auto; left: auto; width: 100%; height: auto; margin: 0 auto; transform: none; }
  .book-spread { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .book-cover { aspect-ratio: 1; min-height: 0; padding: .45rem; background: linear-gradient(135deg, #28113f, #3d1c55 55%, #211034); box-shadow: inset 0 -12px 22px -18px rgba(19,8,32,.85); }
  .book-cover img { width: min(100%, 22rem); height: auto; max-height: none; object-fit: contain; }
  .book-details { padding: 1.1rem 1.15rem 1.2rem; box-shadow: inset 0 12px 22px -18px rgba(53,16,79,.48); }
  .book-label { margin-bottom: .42rem; padding: .27rem .52rem; font-size: .68rem; }
  .book-details h2 { font-size: clamp(1.55rem, 6vw, 2rem); line-height: 1.02; }
  .book-role { margin: .42rem 0 .5rem; font-size: .72rem; line-height: 1.3; }
  .book-summary { max-width: 34rem; margin-bottom: .75rem; font-size: .98rem; line-height: 1.45; }
  .book-facts { grid-template-columns: 1fr; gap: .55rem; margin: .1rem 0 .9rem; }
  .book-facts > div { align-items: center; gap: .55rem; padding: 0; border: 0; }
  .fact-icon { flex-basis: 1.75rem; width: 1.75rem; height: 1.75rem; font-size: 1rem; }
  .book-facts > div > span:last-child { gap: .07rem; }
  .book-facts b { font-size: .68rem; }
  .book-facts strong { font-size: .91rem; line-height: 1.25; }
  .book-link { min-height: 2.9rem; align-self: stretch; padding: .65rem 1rem; font-size: .94rem; text-align: center; }
  .carousel-card.is-prev,.carousel-card.is-next { display: none; }
  .carousel-arrow { top: clamp(7rem, 29vw, 9rem); width: 2.65rem; height: 2.65rem; font-size: 2rem; }
  .carousel-previous { left: .45rem; }
  .carousel-next { right: .45rem; }
  .carousel-dots { gap: .65rem; margin-top: .55rem; }
  .carousel-dot { width: .88rem; height: .88rem; }
  .carousel-hint { font-size: .78rem; }
  .friends-section { padding: 1.4rem .45rem 1.65rem; }
  .friends-section h2 { font-size: clamp(1.65rem, 7vw, 2.35rem); }
  .friends-intro { margin-bottom: .7rem; font-size: .92rem; }
  .friend-list { gap: .18rem; }
  .friend-avatar { width: clamp(3rem, 15vw, 4.2rem); margin-bottom: .2rem; }
  .friend-card strong { font-size: .9rem; }
  .friend-role { font-size: clamp(.69rem, 2.8vw, .82rem); }
  .friend-card small { margin-top: .14rem; font-size: clamp(.57rem, 2.2vw, .68rem); letter-spacing: .07em; }
  .quest-cta { min-height: 16rem; padding: 1.9rem .8rem 3.7rem; background-size: 100% 5rem, auto; }
  .quest-cta h2 { max-width: 13ch; font-size: clamp(1.9rem, 8vw, 2.8rem); }
  .quest-cta p:not(.eyebrow) { max-width: 25rem; font-size: .94rem; }
  .quest-suitcase { left: -2.9rem; width: 7.5rem; }
  .quest-stamp { right: .55rem; top: .6rem; width: 5rem; height: 5rem; font-size: .48rem; }
}
@media (max-width: 390px) {
  .books-page .site-header { padding-inline: .52rem; }
  .books-page .brand-mark { width: 2.2rem; height: 2.2rem; }
  .books-page .brand-copy small { font-size: .39rem; }
  .header-quest-button { padding-inline: .6rem; }
  .books-page .menu-button { width: 2rem; }
  .books-hero h1 { font-size: 2.05rem; }
  .book-details { padding: 1rem .9rem 1.1rem; }
  .book-summary { font-size: .94rem; }
  .friend-role { font-size: .66rem; }
  .friend-card small { font-size: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel-card,.gold-button { transition: none; }
}
