/* Discovery home: an editorial library, not a uniform catalog wall. */
.library-app { background: #f7f5f0; }
.library-app .site-header { background: rgba(247, 245, 240, .96); }
.library-home { padding: 0 0 34px; }
.library-home .section { margin-top: 74px; }

.home-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 54px 0 32px;
}
.home-kicker { display: inline-flex; align-items: center; gap: 10px; color: #8b664e; font-size: 11px; font-weight: 800; }
.home-kicker-line { display: inline-block; width: 28px; height: 1px; background: #ad8060; }
.home-intro h1 { margin: 9px 0 7px; color: #233b30; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.42; letter-spacing: -.045em; }
.home-intro h1 em { font-style: normal; color: #b07958; }
.home-intro p { margin: 0; color: #6a796e; font-size: 13px; }
.home-explore { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 17px; min-height: 43px; padding: 0; border: 0; border-bottom: 1px solid #b8c9bb; background: transparent; color: #245944; font-size: 12px; font-weight: 800; cursor: pointer; }
.home-explore span { font-size: 20px; line-height: 1; }

.home-stage { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(270px, .7fr); gap: 16px; min-height: 444px; }
.stage-feature { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 12px; min-width: 0; overflow: hidden; border-radius: 22px; background: #183c37; color: #fff; }
.stage-feature::before { content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; left: -230px; top: -280px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 52px rgba(255,255,255,.025), 0 0 0 104px rgba(255,255,255,.02); }
.stage-feature::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle at 9% 82%, rgba(203,146,89,.23), transparent 27rem), linear-gradient(135deg, transparent, rgba(4,30,26,.23)); }
.stage-watermark { position: absolute; top: 30px; left: 33px; color: rgba(255,255,255,.43); font-family: "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .18em; direction: ltr; }
.stage-copy { position: relative; z-index: 2; padding: 48px 48px 42px 12px; }
.stage-label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(227,198,141,.32); border-radius: 5px; color: #f1d4a4; font-size: 10px; font-weight: 800; }
.stage-label-dot { width: 5px; height: 5px; border-radius: 50%; background: #f1c983; box-shadow: 0 0 0 4px rgba(241,201,131,.12); }
.stage-counter { margin-top: 32px; color: #a6c3b5; font-size: 10px; letter-spacing: .05em; }
.stage-copy h2 { margin: 5px 0 0; max-width: 430px; color: #fffef8; font-size: clamp(36px, 4vw, 58px); line-height: 1.25; letter-spacing: -.06em; }
.stage-author { margin: 6px 0 0; color: #d5e2d9; font-size: 13px; }
.stage-description { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; max-width: 430px; margin: 24px 0 0; color: #bcd0c1; font-size: 12px; line-height: 2.1; }
.stage-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 29px; }
.stage-primary { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; min-width: 147px; min-height: 44px; padding: 0 15px; border: 0; border-radius: 8px; background: #e6bd83; color: #1c392d; cursor: pointer; font-size: 12px; font-weight: 800; box-shadow: 0 12px 24px rgba(0,0,0,.12); }
.stage-primary:hover { background: #f1d3a5; }
.stage-primary span { font-size: 18px; }
.stage-actions > span { color: #b4c8bb; font-size: 10px; }
.stage-art { position: relative; z-index: 1; justify-self: center; padding: 50px 5px 42px 0; }
.stage-art::before { content: ""; position: absolute; inset: 24% 0 17%; border-radius: 50%; background: rgba(237,206,142,.24); filter: blur(48px); }
.stage-art .book3d { --book-width: 220px; --book-thickness: 39px; }
.stage-art .book3d::after { color: #cbdccf; font-size: 9px; }

.stage-aside { display: grid; grid-template-rows: 1.06fr .94fr; gap: 16px; min-width: 0; }
.stage-next, .stage-method { min-width: 0; overflow: hidden; border-radius: 22px; }
.stage-next { display: flex; flex-direction: column; padding: 22px 25px 21px; background: #eee8da; }
.stage-next-top { display: flex; justify-content: space-between; gap: 10px; color: #6e6d5c; font-size: 10px; font-weight: 800; }
.stage-next-top span:last-child { color: #9a9b87; direction: ltr; }
.stage-next-content { display: grid; grid-template-columns: 98px minmax(0,1fr); align-items: center; gap: 16px; flex: 1; margin: 14px 0 12px; }
.stage-next-cover { width: 98px; aspect-ratio: 2/3; border-radius: 3px 8px 8px 3px; box-shadow: 8px 12px 21px rgba(39,45,30,.18); transform: rotate(3deg); }
.stage-next-content small { color: #9a7251; font-size: 10px; }
.stage-next-content h3 { margin: 7px 0 5px; color: #273b2f; font-size: 19px; line-height: 1.5; }
.stage-next-content p { margin: 0; color: #738071; font-size: 11px; }
.stage-next > button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 11px 0 0; border: 0; border-top: 1px solid #d3d3c4; background: transparent; color: #265d46; text-align: right; cursor: pointer; font-size: 11px; font-weight: 800; }
.stage-next > button span { font-size: 18px; }
.stage-method { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 25px; background: #dbe9dd; }
.stage-method::after { content: ""; position: absolute; width: 210px; height: 210px; bottom: -105px; left: -88px; border: 1px solid rgba(30,88,66,.16); border-radius: 50%; box-shadow: 0 0 0 35px rgba(30,88,66,.05), 0 0 0 70px rgba(30,88,66,.035); }
.stage-method > span { color: #4c745c; font-size: 10px; font-weight: 800; }
.stage-method h3 { position: relative; z-index: 1; margin: 10px 0; color: #215b43; font-size: 23px; line-height: 1.6; }
.method-steps { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.method-steps span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid rgba(38,102,68,.14); border-radius: 6px; background: rgba(255,255,255,.45); color: #34684c; font-size: 9px; font-weight: 700; }
.method-steps b { color: #8d785d; font-size: 9px; }

.home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.home-section-heading > div:first-child > span { display: block; color: #a6724f; font-size: 11px; font-weight: 800; }
.home-section-heading h2 { margin: 7px 0 0; color: #23392e; font-size: clamp(25px, 3vw, 36px); line-height: 1.4; letter-spacing: -.04em; }
.home-section-heading p { margin: 7px 0 0; color: #738075; font-size: 12px; }
.heading-period { color: #bf8b5f; }
.home-continue .continue-grid { gap: 14px; }

.home-shelf { padding: 30px 32px 26px; border: 1px solid #e9e6da; border-radius: 23px; background: #f0eee6; }
.home-shelf .home-section-heading { margin-bottom: 10px; }
.shelf-arrows { display: flex; gap: 7px; }
.shelf-arrows button { width: 38px; height: 38px; border: 1px solid #d8dbcf; border-radius: 50%; background: #fff; color: #2d5942; cursor: pointer; font-size: 19px; }
.shelf-arrows button:hover { border-color: #8eaf91; background: #e7efe5; }
.shelf-track { display: flex; gap: 18px; overflow-x: auto; padding: 18px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #c5c9b9 transparent; }
.shelf-book { flex: 0 0 174px; display: block; min-width: 0; text-decoration: none; scroll-snap-align: start; }
.shelf-book-art { position: relative; display: flex; align-items: end; justify-content: center; height: 220px; padding: 15px 17px 12px; border-radius: 10px; background: #e6e4da; box-shadow: inset 0 -5px 0 #d4d0c2; transition: background .2s ease; }
.shelf-book:nth-child(3n+2) .shelf-book-art { background: #e2e9df; box-shadow: inset 0 -5px 0 #cad8cc; }
.shelf-book:nth-child(3n+3) .shelf-book-art { background: #eae1d7; box-shadow: inset 0 -5px 0 #dacbbb; }
.shelf-book:hover .shelf-book-art { background: #d7e3d6; }
.shelf-cover { width: min(100%, 128px); max-height: 188px; aspect-ratio: 2/3; border-radius: 3px 7px 7px 3px; box-shadow: 9px 10px 19px rgba(36,43,30,.20); transition: transform .2s ease; }
.shelf-book:hover .shelf-cover { transform: translateY(-5px) rotate(-2deg); }
.shelf-book-number { position: absolute; top: 11px; right: 11px; color: #8b9887; font-family: "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 700; }
.shelf-book > strong { display: block; overflow: hidden; margin: 13px 1px 3px; color: #263b2f; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.shelf-book > small { display: block; overflow: hidden; margin: 0 1px; color: #748173; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.shelf-book-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 9px; color: #28664c; font-size: 10px; font-weight: 800; }

.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.topic-tile { position: relative; isolation: isolate; min-height: 167px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; overflow: hidden; padding: 20px 23px; border: 0; border-radius: 16px; text-align: right; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.topic-tile::before { content: ""; position: absolute; z-index: -1; width: 180px; height: 180px; top: -77px; left: -55px; border: 1px solid currentColor; border-radius: 50%; opacity: .18; box-shadow: 0 0 0 23px rgba(255,255,255,.07), 0 0 0 47px rgba(255,255,255,.05); }
.topic-tile:hover { transform: translateY(-4px); box-shadow: 0 13px 24px rgba(35,57,39,.09); }
.topic-tile-1 { color: #1f5a4c; background: #d9eae4; }
.topic-tile-2 { color: #81523e; background: #f0e0d5; }
.topic-tile-3 { color: #565278; background: #e4e1ef; }
.topic-tile-4 { color: #6a6440; background: #eeead0; }
.topic-tile-5 { color: #355970; background: #dceaf0; }
.topic-tile-6 { color: #694d60; background: #eddee7; }
.topic-index { font-size: 10px; font-weight: 800; opacity: .72; }
.topic-tile strong { max-width: 85%; font-size: clamp(19px, 2vw, 26px); line-height: 1.4; }
.topic-meta { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 11px; font-weight: 700; }
.topic-meta span { font-size: 21px; line-height: 1; }

.collection-section { scroll-margin-top: 105px; }
.collection-heading { margin-bottom: 23px; }
.collection-offline { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 14px; min-height: 39px; padding: 0 12px; border: 1px solid #d4dfd3; border-radius: 7px; background: #fff; color: #2b6048; cursor: pointer; font-size: 11px; font-weight: 800; }
.collection-offline span { font-size: 17px; }
.collection-frame { padding: 23px; border: 1px solid #e7e8e0; border-radius: 20px; background: #fff; box-shadow: 0 15px 40px rgba(28,53,38,.045); }
.collection-controls { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 11px; }
.collection-controls .search, .collection-controls .select { height: 50px; border-color: #e2e7df; background: #f8faf7; box-shadow: none; }
.collection-controls .search:focus, .collection-controls .select:focus { background: #fff; }
.collection-subnav { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 0 7px; border-bottom: 1px solid #e9ece7; }
.access-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.access-tabs button { padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: #6a7c6e; cursor: pointer; font-size: 11px; font-weight: 700; }
.access-tabs button:hover, .access-tabs button.active { background: #e9f2e9; color: #23694b; }
#resultCount { flex: 0 0 auto; color: #879186; font-size: 10px; }
.collection-result { display: flex; align-items: center; gap: 10px; }
.collection-result button { padding: 5px 8px; border: 0; border-radius: 6px; background: #f5eee7; color: #8b6249; cursor: pointer; font-size: 10px; }
.collection-result button[hidden] { display: none; }
.collection-frame .book-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.collection-frame .book-card { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 15px; min-height: 130px; padding: 10px 12px; border: 1px solid #e9ece6; border-radius: 11px; background: #fff; box-shadow: none; }
.collection-frame .book-card:hover { transform: translateY(-2px); border-color: #bdd3be; background: #f8fbf7; box-shadow: 0 8px 18px rgba(29,54,36,.06); }
.collection-frame .book-cover { width: 76px; height: 110px; aspect-ratio: auto; border-radius: 3px 6px 6px 3px; box-shadow: 5px 7px 12px rgba(29,48,33,.14); }
.collection-frame .book-card-body { min-width: 0; padding: 2px 0; }
.collection-frame .book-card h3 { font-size: 14px; line-height: 1.6; }
.collection-frame .book-card-author { font-size: 11px; }
.collection-frame .book-card-meta { margin-top: 8px; }
.collection-frame .book-card-meta .mini-badge:nth-child(2) { display: none; }
.collection-frame .mini-badge { min-height: 21px; padding: 0 6px; font-size: 9px; }
.collection-frame .book-card-progress { max-width: 250px; margin-top: 9px; }
.collection-frame .book-card-progress span { font-size: 9px; }
.collection-frame .favorite { top: 11px; left: 11px; width: 29px; height: 29px; }
.collection-frame .locked-cover { width: 76px; height: 110px; border-radius: 3px 6px 6px 3px; }
.collection-frame .locked-cover-button { width: 39px; height: 39px; }
.collection-frame .locked-cover-button svg { width: 21px; height: 21px; }
.load-more-books { display: flex; align-items: center; gap: 10px; margin: 26px auto 4px; padding: 11px 18px; border: 1px solid #d5e0d4; border-radius: 7px; background: #f3f8f2; color: #236548; cursor: pointer; font-size: 11px; font-weight: 800; }
.load-more-books:hover { background: #e5f2e6; }
.load-more-books[hidden] { display: none; }
.collection-frame .empty-state { margin: 20px 0; }
.collection-frame .empty-state span { display: block; }
.library-home .page-footer { margin-top: 75px; }

@media (max-width: 1024px) {
  .home-stage { grid-template-columns: minmax(0, 1fr) 280px; }
  .stage-feature { grid-template-columns: minmax(0,1fr) 200px; }
  .stage-copy { padding-right: 34px; }
  .stage-copy h2 { font-size: 42px; }
  .stage-art .book3d { --book-width: 175px; --book-thickness: 31px; }
  .collection-frame .book-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .home-stage { grid-template-columns: 1fr; }
  .stage-feature { min-height: 390px; grid-template-columns: minmax(0,1fr) 230px; }
  .stage-art .book3d { --book-width: 205px; --book-thickness: 35px; }
  .stage-aside { grid-template-columns: 1fr 1fr; grid-template-rows: auto; min-height: 222px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .library-home .section { margin-top: 56px; }
  .home-intro { align-items: start; flex-direction: column; gap: 15px; padding: 31px 0 22px; }
  .home-intro h1 { font-size: 31px; }
  .home-intro p { font-size: 11px; line-height: 1.9; }
  .home-explore { min-height: 31px; font-size: 10px; }
  .stage-feature { min-height: 0; grid-template-columns: minmax(0,1fr) 130px; gap: 0; border-radius: 17px; }
  .stage-watermark { top: 16px; left: 13px; font-size: 7px; }
  .stage-copy { padding: 29px 19px 27px 3px; }
  .stage-label { padding: 5px 7px; font-size: 8px; }
  .stage-counter { margin-top: 23px; font-size: 9px; }
  .stage-copy h2 { font-size: clamp(27px, 7vw, 39px); }
  .stage-author { font-size: 10px; }
  .stage-description { margin-top: 15px; font-size: 9px; line-height: 1.85; -webkit-line-clamp: 2; }
  .stage-actions { margin-top: 18px; }
  .stage-primary { min-width: 0; min-height: 37px; padding: 0 9px; gap: 7px; font-size: 10px; }
  .stage-actions > span { display: none; }
  .stage-art { padding: 50px 13px 26px 0; }
  .stage-art .book3d { --book-width: 105px; --book-thickness: 18px; }
  .stage-art .book3d::after { display: none; }
  .stage-aside { min-height: 182px; gap: 9px; }
  .stage-next, .stage-method { border-radius: 14px; padding: 14px; }
  .stage-next-top { font-size: 8px; }
  .stage-next-content { grid-template-columns: 47px minmax(0,1fr); gap: 7px; margin: 10px 0; }
  .stage-next-cover { width: 47px; }
  .stage-next-content small { font-size: 8px; }
  .stage-next-content h3 { margin: 2px 0; font-size: 12px; }
  .stage-next-content p { font-size: 8px; }
  .stage-next > button { padding-top: 5px; font-size: 9px; }
  .stage-method > span { font-size: 8px; }
  .stage-method h3 { font-size: 15px; }
  .method-steps { gap: 4px; }
  .method-steps span { padding: 3px 4px; font-size: 7px; }
  .method-steps b { display: none; }
  .home-section-heading h2 { font-size: 24px; }
  .home-section-heading p { font-size: 10px; }
  .home-shelf { padding: 21px 14px 16px; border-radius: 16px; }
  .shelf-track { gap: 10px; padding-top: 14px; }
  .shelf-book { flex-basis: 134px; }
  .shelf-book-art { height: 174px; padding: 12px 12px 9px; }
  .shelf-cover { max-height: 146px; width: 100px; }
  .shelf-book > strong { font-size: 11px; }
  .shelf-book > small { font-size: 9px; }
  .shelf-arrows button { width: 30px; height: 30px; font-size: 16px; }
  .topic-grid { gap: 9px; }
  .topic-tile { min-height: 145px; padding: 15px; }
  .topic-tile strong { font-size: 17px; }
  .topic-index, .topic-meta { font-size: 9px; }
  .collection-heading { align-items: start; }
  .collection-offline { padding: 0 7px; font-size: 9px; }
  .collection-controls { grid-template-columns: 1fr; }
  .collection-frame { padding: 13px; border-radius: 15px; }
  .collection-subnav { align-items: start; flex-direction: column; gap: 7px; padding-top: 13px; }
  .access-tabs button { padding: 7px 9px; font-size: 10px; }
  .collection-frame .book-grid { grid-template-columns: 1fr; gap: 7px; }
  .collection-frame .book-card { grid-template-columns: 66px minmax(0,1fr); gap: 12px; min-height: 111px; padding: 8px; }
  .collection-frame .book-cover, .collection-frame .locked-cover { width: 66px; height: 96px; }
  .collection-frame .book-card h3 { font-size: 12px; }
  .collection-frame .favorite { top: 9px; left: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .topic-tile, .shelf-cover { transition: none; }
}
