:root {
  --ink: #182235;
  --muted: #68738b;
  --line: rgba(33, 45, 72, .10);
  --paper: #f8f9fd;
  --surface: rgba(255,255,255,.78);
  --indigo: #4d53ea;
  --violet: #7944d9;
  --cyan: #32a7ca;
  --shadow: 0 18px 50px rgba(31, 39, 87, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; transition: background .25s ease, color .25s ease; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(77, 83, 234, .35); outline-offset: 3px; }
.page-shell { min-height: 100vh; overflow: hidden; background: radial-gradient(circle at 10% 13%, rgba(141, 128, 255, .16), transparent 26rem), radial-gradient(circle at 88% 10%, rgba(66, 182, 231, .13), transparent 21rem), var(--paper); }
.site-header { height: 78px; max-width: 1230px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 9px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 19px; font-weight: 800; letter-spacing: -.8px; text-decoration: none; }
.brand em { font-style: normal; background: linear-gradient(120deg, var(--indigo), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: #fff; border-radius: 9px; background: linear-gradient(135deg, var(--indigo), var(--violet)); box-shadow: 0 5px 15px rgba(80, 78, 225, .25); font-size: 15px; letter-spacing: -1px; }
.header-actions { display: flex; align-items: center; gap: 19px; }
.header-note { color: var(--muted); font-size: 13px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--indigo); transition: transform .2s, background .2s; }
.icon-button:hover { transform: translateY(-2px); background: #fff; }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.moon-icon { display: none; }
.hero { max-width: 980px; margin: 0 auto; padding: 90px 28px 76px; text-align: center; }
.eyebrow, .result-kicker, .loading-kicker, .group-title p { color: var(--indigo); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(77, 83, 234, .13); border-radius: 50px; background: rgba(255,255,255,.65); }
.eyebrow span { width: 6px; height: 6px; border-radius: 100%; background: #55c59f; box-shadow: 0 0 0 4px rgba(85,197,159,.15); }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { max-width: 730px; margin: 23px auto 19px; color: var(--ink); font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(43px, 6.7vw, 74px); font-weight: 800; line-height: 1.04; letter-spacing: -4px; }
.hero h1 span { background: linear-gradient(103deg, #4f58e8 10%, #8745d8 55%, #2aa7ca); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { max-width: 570px; margin: 0 auto 34px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.search-panel { max-width: 750px; margin: 0 auto; padding: 7px; display: flex; gap: 8px; border: 1px solid rgba(77,83,234,.17); border-radius: 19px; background: rgba(255,255,255,.75); box-shadow: 0 18px 40px rgba(51, 61, 125, .09), inset 0 1px rgba(255,255,255,.7); backdrop-filter: blur(12px); }
.search-input-wrap { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 15px; }
.search-input-wrap svg { flex: 0 0 auto; width: 22px; fill: none; stroke: #6d77aa; stroke-width: 2; stroke-linecap: round; }
.search-input-wrap input { width: 100%; min-width: 0; height: 51px; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-input-wrap input::placeholder { color: #9ba4b9; }
.search-button { min-height: 51px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 21px; color: #fff; border: 0; border-radius: 14px; background: linear-gradient(115deg, #4f59e9, #7148d7); box-shadow: 0 8px 22px rgba(79, 81, 224, .27); font-weight: 700; transition: transform .2s, box-shadow .2s; }
.search-button:hover { transform: translateY(-2px); box-shadow: 0 11px 26px rgba(79, 81, 224, .36); }
.search-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-button.is-loading { pointer-events: none; opacity: .78; }
.search-button.is-loading span { display: none; }
.search-button.is-loading::after { content: ""; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.search-button.is-loading svg { display: none; }
.search-error { max-width: 750px; margin: 10px auto 0; padding: 10px 14px; color: #b23949; border-radius: 10px; background: #fff0f1; font-size: 14px; text-align: left; }
.topic-row { width: min(100%, 660px); margin: 20px auto 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; overflow: hidden; }
.topic-row > span { flex: 0 0 auto; }
.topics-viewport { min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 38px, #000 calc(100% - 38px), transparent); mask-image: linear-gradient(90deg, transparent, #000 38px, #000 calc(100% - 38px), transparent); }
.topics-track { display: flex; width: max-content; gap: 7px; animation: topics-scroll 18s linear infinite; will-change: transform; }
.topics-viewport:hover .topics-track, .topics-viewport:focus-within .topics-track { animation-play-state: paused; }
.topics { display: flex; flex: 0 0 auto; gap: 7px; }
.topic-chip { padding: 6px 11px; color: #566178; border: 1px solid var(--line); border-radius: 50px; background: rgba(255,255,255,.50); font-size: 12px; transition: background .2s, border .2s, transform .2s; }
.topic-chip:hover { color: var(--indigo); border-color: rgba(77,83,234,.3); background: #fff; }
@keyframes topics-scroll { to { transform: translateX(calc(-50% - 3.5px)); } }
.trust-strip { margin: 58px auto 0; display: flex; justify-content: center; gap: 26px; color: var(--muted); font-size: 12px; }
.trust-strip span { display: flex; align-items: center; gap: 6px; }
.trust-strip i { color: var(--indigo); font-style: normal; font-weight: 700; }
.loading-state, .results-section { max-width: 1160px; margin: 0 auto; padding: 0 28px 80px; }
.loading-state { min-height: 235px; display: flex; align-items: center; justify-content: center; gap: 22px; text-align: left; }
.loading-state h2 { max-width: 410px; margin: 4px 0 7px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 22px; letter-spacing: -1px; }
.loading-state p:not(.loading-kicker) { max-width: 450px; margin-bottom: 0; color: var(--muted); font-size: 14px; }
.orbital-loader { position: relative; width: 65px; height: 65px; flex: 0 0 auto; border: 2px solid rgba(77,83,234,.14); border-radius: 50%; animation: spin 1.4s linear infinite; }
.orbital-loader::after, .orbital-loader span { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--indigo); box-shadow: 0 0 18px rgba(77,83,234,.45); }
.orbital-loader::after { top: -7px; left: 50%; transform: translateX(-50%); }
.orbital-loader span { right: -5px; bottom: 7px; width: 8px; height: 8px; background: var(--cyan); }
@keyframes spin { to { transform: rotate(360deg); } }
.results-section { padding-top: 16px; }
.results-heading { display: flex; justify-content: space-between; gap: 25px; margin-bottom: 41px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.result-kicker { margin-bottom: 8px; }
.results-heading h2 { margin-bottom: 8px; font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(31px, 4.5vw, 44px); line-height: 1; letter-spacing: -2.5px; }
.results-heading h2 span { color: var(--indigo); }
.results-heading p:not(.result-kicker) { max-width: 680px; margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.result-status { align-self: center; flex: 0 0 auto; padding: 8px 11px; color: #346b60; border: 1px solid rgba(73,174,145,.17); border-radius: 9px; background: rgba(93, 194, 159, .09); font-size: 12px; font-weight: 600; }
.result-status.fresh { color: #5352b2; border-color: rgba(86, 83, 221,.17); background: rgba(86,83,221,.08); }
.results-group { margin-bottom: 55px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.group-title { display: flex; align-items: center; gap: 12px; }
.heading-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-family: Georgia, serif; font-size: 23px; }
.books-icon { color: #6756d2; background: rgba(104,86,210,.11); }
.sites-icon { color: #168db2; background: rgba(22,141,178,.11); font-family: inherit; font-size: 20px; }
.group-title p { margin: 0 0 2px; font-size: 9px; letter-spacing: 1.25px; }
.group-title h3 { margin: 0; font-family: "Plus Jakarta Sans", sans-serif; font-size: 20px; letter-spacing: -1px; }
.count-badge { padding: 5px 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.resource-grid { display: grid; gap: 16px; }
.books-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.websites-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.resource-card { min-width: 0; position: relative; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 9px 22px rgba(37, 44, 77, .035); overflow: hidden; transition: transform .22s ease, box-shadow .22s ease, border .22s; }
.resource-card:hover { transform: translateY(-5px); border-color: rgba(77,83,234,.23); box-shadow: var(--shadow); }
.book-cover { position: relative; height: 154px; overflow: hidden; color: #fff; background: linear-gradient(122deg, #5059dc, #764cd3 56%, #278bba); }
.book-cover::before { content: ""; position: absolute; inset: 0; opacity: .22; background-image: radial-gradient(circle at 75% 26%, #fff 0 2px, transparent 3px), radial-gradient(circle at 25% 70%, #fff 0 1px, transparent 2px); background-size: 26px 26px, 18px 18px; }
.book-cover img { width: 100%; height: 100%; position: relative; display: block; object-fit: cover; }
.book-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; font-family: Georgia, serif; font-size: 32px; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.rank-pill { position: absolute; z-index: 2; top: 11px; left: 11px; padding: 5px 8px; color: #fff; border-radius: 7px; background: rgba(22, 29, 70, .73); backdrop-filter: blur(4px); font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.rank-explanation { position: relative; z-index: 4; flex: 0 0 auto; }
.book-card > .rank-explanation { position: absolute; top: 10px; right: 10px; }
.rank-help { padding: 5px 8px; color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; background: rgba(22,29,70,.73); backdrop-filter: blur(4px); font-size: 10px; font-weight: 700; }
.website-card .rank-help { color: var(--indigo); border-color: rgba(77,83,234,.13); background: rgba(77,83,234,.08); }
.rank-tooltip { width: min(250px, calc(100vw - 70px)); position: absolute; z-index: 8; top: calc(100% + 8px); right: 0; padding: 12px; visibility: hidden; opacity: 0; color: var(--ink); border: 1px solid rgba(77,83,234,.16); border-radius: 11px; background: var(--paper); box-shadow: 0 14px 34px rgba(31,39,87,.18); text-align: left; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.rank-explanation:hover .rank-tooltip, .rank-explanation:focus-within .rank-tooltip { visibility: visible; opacity: 1; transform: translateY(0); }
.rank-tooltip strong, .rank-tooltip span, .rank-tooltip small { display: block; }
.rank-tooltip strong { margin-bottom: 5px; color: var(--indigo); font-size: 11px; }
.rank-tooltip span { font-size: 11px; line-height: 1.45; }
.rank-tooltip small { margin-top: 7px; color: var(--muted); font-size: 9.5px; }
.card-body { padding: 17px; }
.resource-card h4 { min-height: 38px; margin: 0 0 5px; overflow: hidden; color: var(--ink); font-family: "Plus Jakarta Sans", sans-serif; font-size: 15px; line-height: 1.3; letter-spacing: -.5px; }
.book-author { min-height: 17px; margin: 0 0 10px; color: var(--indigo); font-size: 12px; font-weight: 600; }
.resource-description { min-height: 61px; margin: 0 0 13px; color: var(--muted); font-size: 12.5px; line-height: 1.53; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trust-label { overflow: hidden; color: #65817b; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.resource-link { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 8px 10px; color: var(--indigo); border-radius: 8px; background: rgba(77,83,234,.08); font-size: 11px; font-weight: 700; text-decoration: none; transition: background .2s; }
.resource-link:hover { background: rgba(77,83,234,.15); }
.resource-link svg { width: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.website-card { display: flex; min-height: 214px; flex-direction: column; padding: 18px; }
.website-top { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 13px; }
.site-monogram { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; color: #fff; border-radius: 11px; background: linear-gradient(135deg, #3694c1, #4c5fdd); font-family: "Plus Jakarta Sans", sans-serif; font-size: 14px; font-weight: 800; }
.site-name-wrap { min-width: 0; flex: 1; }
.website-card h4 { min-height: 0; margin-bottom: 2px; white-space: nowrap; text-overflow: ellipsis; }
.domain { overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.website-card .resource-description { min-height: 57px; flex: 1; }
.site-rank { padding: 4px 6px; color: var(--indigo); border-radius: 6px; background: rgba(77,83,234,.08); font-size: 10px; font-weight: 700; }
.site-footer { max-width: 1230px; margin: 0 auto; padding: 27px 28px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.footer-brand { font-size: 14px; }
.footer-brand .brand-mark { width: 23px; height: 23px; border-radius: 7px; font-size: 12px; }
.site-footer p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

body.dark { --ink: #eff1fc; --muted: #a1a9bf; --line: rgba(192, 199, 255, .12); --paper: #10131f; --surface: rgba(27, 32, 52, .76); --shadow: 0 20px 52px rgba(0,0,0,.3); }
body.dark .page-shell { background: radial-gradient(circle at 10% 8%, rgba(116, 86, 219,.21), transparent 24rem), radial-gradient(circle at 88% 10%, rgba(32, 148, 195,.16), transparent 21rem), var(--paper); }
body.dark .eyebrow, body.dark .search-panel, body.dark .topic-chip { background: rgba(27,32,52,.72); }
body.dark .icon-button:hover, body.dark .topic-chip:hover { background: #272d49; }
body.dark .moon-icon { display: block; }
body.dark .sun-icon { display: none; }
body.dark .search-error { color: #ffadb7; background: rgba(159,50,69,.2); }
body.dark .trust-label { color: #8fc3b7; }

@media (max-width: 800px) { .hero { padding-top: 64px; } .books-grid, .websites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trust-strip { gap: 14px; } .header-note { display: none; } }
@media (max-width: 560px) { .site-header { height: 67px; padding: 0 19px; } .hero { padding: 52px 18px 60px; } .hero h1 { font-size: 43px; letter-spacing: -2.7px; } .hero-copy { font-size: 15px; } .search-panel { flex-direction: column; padding: 6px; border-radius: 16px; } .search-input-wrap input { height: 44px; } .search-button { min-height: 47px; } .trust-strip { align-items: flex-start; flex-direction: column; margin-top: 34px; gap: 8px; } .loading-state, .results-section { padding-left: 18px; padding-right: 18px; } .loading-state { min-height: 205px; gap: 14px; } .orbital-loader { width: 48px; height: 48px; } .results-heading { align-items: flex-start; flex-direction: column; margin-bottom: 30px; } .result-status { align-self: flex-start; } .books-grid, .websites-grid { grid-template-columns: 1fr; gap: 13px; } .book-cover { height: 165px; } .site-footer { align-items: flex-start; flex-direction: column; gap: 13px; padding: 23px 18px; } .site-footer span:last-child { max-width: 235px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } .topics-track { animation: none !important; } }
