:root {
  --ink: #10192b;
  --navy: #111b2e;
  --navy-soft: #1b2942;
  --paper: #f5f1e8;
  --paper-bright: #fffdf8;
  --gold: #e8ad57;
  --gold-soft: #f3d7aa;
  --sky: #a9d5de;
  --sage: #8eb7a5;
  --muted: #667085;
  --line: rgba(16, 25, 43, 0.14);
  --shadow: 0 18px 50px rgba(20, 30, 48, 0.1);
  --radius: 20px;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; border-radius: 10px; background: white; color: var(--ink); }
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 80px;
  padding: 1rem clamp(1.25rem, 5vw, 5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: white;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand { display: inline-flex; gap: .75rem; align-items: center; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; font: 1.5rem "Libre Caslon Display", serif; color: var(--gold); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .92rem; letter-spacing: .02em; }
.brand small { color: rgba(255,255,255,.62); font-size: .72rem; margin-top: .1rem; }
.header-link { font-size: .84rem; color: rgba(255,255,255,.78); text-underline-offset: .25rem; }

.hero {
  min-height: 560px;
  padding: clamp(4rem, 8vw, 7rem) clamp(1.25rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 73% 44%, rgba(71, 137, 157, .25), transparent 30%),
    linear-gradient(135deg, #111b2e 0%, #14223a 54%, #0d1627 100%);
}

.hero::before { content: ""; position: absolute; inset: 0; opacity: .55; background-image: radial-gradient(circle at 20% 20%, white 0 1px, transparent 1.5px), radial-gradient(circle at 85% 64%, white 0 1px, transparent 1.5px); background-size: 160px 160px, 230px 230px; }
.hero-copy, .hero-orbit { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 .8rem; text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 700; color: #b78e52; }
.hero .eyebrow { color: var(--gold); }
h1, h2, h3 { margin-top: 0; font-family: "Libre Caslon Display", Georgia, serif; font-weight: 400; line-height: 1.05; }
h1 { max-width: 760px; margin-bottom: 1.3rem; font-size: clamp(3.25rem, 6.3vw, 6.6rem); letter-spacing: -.035em; }
.hero-lede { max-width: 650px; margin: 0; font-size: clamp(1rem, 1.5vw, 1.18rem); color: rgba(255,255,255,.7); }
.hero-actions { margin-top: 2rem; display: flex; align-items: center; gap: 1.35rem; flex-wrap: wrap; }
.button { min-height: 48px; padding: .82rem 1.2rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--gold); color: var(--ink); box-shadow: 0 12px 30px rgba(232, 173, 87, .2); }
.button-secondary { background: var(--ink); color: white; }
.text-link { font-weight: 600; font-size: .9rem; color: rgba(255,255,255,.78); text-underline-offset: .3rem; }

.hero-orbit { min-height: 400px; }
.planet { position: absolute; width: 190px; height: 190px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle at 35% 25%, #cee6df, #5d9298 36%, #315d73 65%, #172f4a 100%); box-shadow: inset -28px -20px 40px rgba(7,17,31,.6), 0 0 70px rgba(126,190,195,.18); }
.planet::after { content: ""; position: absolute; inset: 50% -34px auto; height: 18px; border: 5px solid rgba(232,173,87,.35); border-radius: 50%; transform: rotate(-10deg); }
.orbit { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; transform: translate(-50%, -50%) rotate(-10deg); }
.orbit-one { width: 390px; height: 230px; }
.orbit-two { width: 520px; height: 340px; transform: translate(-50%, -50%) rotate(20deg); }
.floating-book { position: absolute; width: 92px; aspect-ratio: 5/7; padding: .7rem; display: flex; align-items: flex-end; border-radius: 5px 10px 10px 5px; box-shadow: 12px 20px 30px rgba(0,0,0,.26); font-family: "Libre Caslon Display", serif; font-size: .74rem; letter-spacing: .08em; line-height: 1.05; animation: float 5s ease-in-out infinite; }
.floating-book::before { content: ""; position: absolute; inset: 0 auto 0 8px; border-left: 1px solid rgba(255,255,255,.25); }
.book-one { left: 8%; top: 8%; background: linear-gradient(160deg, #7c263b, #351321); transform: rotate(-8deg); }
.book-two { right: 4%; top: 24%; background: linear-gradient(160deg, #b9822d, #654014); transform: rotate(9deg); animation-delay: -1.5s; }
.book-three { left: 18%; bottom: 3%; background: linear-gradient(160deg, #3d7664, #1c3b35); transform: rotate(5deg); animation-delay: -3s; }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }

.discovery { padding: clamp(4.5rem, 8vw, 7rem) clamp(1.25rem, 7vw, 7rem); background: var(--paper-bright); }
.section-heading, .catalog-intro { display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.section-heading h2, .catalog-intro h2 { margin-bottom: 0; font-size: clamp(2.35rem, 4vw, 4rem); letter-spacing: -.025em; }
.section-heading > p { max-width: 410px; margin: 0 0 .4rem; color: var(--muted); }
.interest-grid { margin-top: 2.3rem; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .85rem; }
.interest-card { min-height: 138px; padding: 1.15rem; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: white; cursor: pointer; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease; }
.interest-card:hover, .interest-card[aria-pressed="true"] { transform: translateY(-3px); border-color: #c4934e; box-shadow: 0 12px 30px rgba(20,30,48,.08); }
.interest-card[aria-pressed="true"] { background: #fff8ec; }
.interest-icon { font-size: 1.55rem; }
.interest-card strong { font-size: .96rem; }
.interest-card small { color: var(--muted); }

.catalog { padding: clamp(4.5rem, 8vw, 7rem) clamp(1.25rem, 7vw, 7rem) clamp(5rem, 9vw, 8rem); }
.catalog-intro { align-items: center; }
.source-note { max-width: 470px; padding: .8rem 1rem; display: flex; gap: .65rem; align-items: flex-start; border: 1px solid rgba(58,124,94,.2); border-radius: 12px; background: rgba(142,183,165,.11); color: #3f5c52; font-size: .78rem; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: .32rem; border-radius: 50%; background: #4a9273; box-shadow: 0 0 0 4px rgba(74,146,115,.12); }

.filter-shell { margin-top: 2rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,248,.82); box-shadow: var(--shadow); }
.filter-shell label > span:first-child, .search-field > span { display: block; margin: 0 0 .4rem .1rem; color: #667085; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.search-control { height: 52px; display: flex; align-items: center; gap: .7rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.search-control:focus-within { border-color: #b88d4c; box-shadow: 0 0 0 3px rgba(184,141,76,.13); }
.search-control svg { width: 19px; height: 19px; fill: none; stroke: #6b7280; stroke-linecap: round; stroke-width: 1.8; }
.search-control input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-control input::placeholder { color: #a1a7b2; }
.select-row { margin-top: .9rem; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; }
select { width: 100%; min-height: 46px; padding: 0 2.2rem 0 .8rem; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: white; }
select:focus { border-color: #b88d4c; box-shadow: 0 0 0 3px rgba(184,141,76,.13); }
.filter-footer { margin-top: .9rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.check-control { display: flex; align-items: center; gap: .55rem; color: #4c5668; cursor: pointer; font-size: .82rem; }
.check-control input { position: absolute; opacity: 0; }
.check-control > span { width: 18px; height: 18px; display: inline-grid; place-items: center; border: 1px solid #aab1bc; border-radius: 5px; background: white; }
.check-control input:checked + span { border-color: #345d50; background: #345d50; }
.check-control input:checked + span::after { content: "✓"; color: white; font-size: .72rem; }
.check-control input:focus-visible + span { outline: 3px solid rgba(184,141,76,.25); }
.clear-button { border: 0; padding: .4rem .2rem; color: #7b5730; background: transparent; font-weight: 700; font-size: .82rem; cursor: pointer; text-decoration: underline; text-underline-offset: .2rem; }

.results-toolbar { min-height: 44px; margin: 1.5rem 0 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.results-toolbar p { margin: 0; }
.results-toolbar strong { font-size: .95rem; }
.results-toolbar p span { margin-left: .25rem; color: var(--muted); font-size: .84rem; }
.legend { display: flex; gap: 1rem; color: var(--muted); font-size: .72rem; }
.legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.verified { background: #3f8c6b; }
.legend-dot.review { background: #d78b3a; }

.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.book-card { min-height: 338px; display: grid; grid-template-columns: 98px 1fr; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-bright); box-shadow: 0 8px 24px rgba(21,32,51,.045); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.book-card:hover { transform: translateY(-4px); border-color: rgba(140,100,46,.34); box-shadow: 0 18px 40px rgba(21,32,51,.09); }
.cover-link { width: 98px; height: 148px; display: block; align-self: start; border-radius: 4px 9px 9px 4px; background: #e8e1d6; box-shadow: 7px 10px 20px rgba(15,23,38,.22); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.cover-link:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 9px 14px 26px rgba(15,23,38,.26); }
.mini-cover { width: 100%; height: 100%; display: block; object-fit: contain; background: #e8e1d6; }
.card-content { min-width: 0; display: flex; flex-direction: column; }
.card-topline { min-height: 24px; margin-bottom: .45rem; display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; }
.genre-label { color: #7b5730; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.verification { flex: 0 0 auto; display: inline-flex; gap: .3rem; align-items: center; color: #3c705c; font-size: .62rem; font-weight: 700; }
.verification.review { color: #a46120; }
.verification::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.book-card h3 { margin: 0 0 .4rem; font-size: 1.34rem; line-height: 1.08; }
.series-meta { margin: 0 0 .65rem; color: #566174; font-size: .72rem; font-weight: 600; }
.book-description { margin: 0; display: -webkit-box; overflow: hidden; color: #5e6674; font-size: .79rem; line-height: 1.5; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card-tags { margin-top: .7rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.card-tags span { padding: .25rem .48rem; border-radius: 999px; color: #5e5a51; background: #efe9dd; font-size: .62rem; }
.card-action { margin-top: auto; padding-top: .9rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid rgba(16,25,43,.08); }
.card-action a { font-size: .76rem; font-weight: 800; text-underline-offset: .25rem; }
.card-action small { color: #8b919c; font-size: .62rem; text-align: right; }

.empty-state { padding: 4rem 1rem; text-align: center; border: 1px dashed rgba(16,25,43,.22); border-radius: var(--radius); background: rgba(255,255,255,.35); }
.empty-icon { margin-bottom: .4rem; font-size: 2rem; }
.empty-state h3 { margin-bottom: .4rem; font-size: 1.6rem; }
.empty-state p { margin: 0 0 1.2rem; color: var(--muted); }

footer { padding: 1.5rem clamp(1.25rem, 7vw, 7rem); display: flex; justify-content: space-between; align-items: center; gap: 2rem; color: rgba(255,255,255,.76); background: var(--navy); font-size: .78rem; }
footer strong, footer span { display: block; }
footer strong { color: white; }
footer a { text-underline-offset: .2rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; z-index: 20; max-width: min(92vw, 520px); padding: .75rem 1rem; border-radius: 12px; color: white; background: #202a3c; box-shadow: 0 15px 50px rgba(0,0,0,.2); font-size: .78rem; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid rgba(232,173,87,.65); outline-offset: 3px; }

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

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 700px; padding-top: 4rem; }
  .hero-orbit { min-height: 320px; }
  .orbit-two { width: 440px; }
  .section-heading, .catalog-intro { align-items: flex-start; flex-direction: column; }
  .select-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .site-header { min-height: 68px; padding: .8rem 1rem; }
  .brand strong { font-size: .8rem; }
  .brand small { display: none; }
  .header-link { font-size: 0; }
  .header-link span { font-size: 1rem; }
  .hero { min-height: auto; padding: 4rem 1.25rem 2.5rem; }
  h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  .hero-orbit { min-height: 300px; scale: .86; }
  .discovery, .catalog { padding-left: 1rem; padding-right: 1rem; }
  .interest-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .interest-card { min-height: 126px; padding: .85rem; }
  .interest-card small { font-size: .68rem; }
  .select-row { grid-template-columns: 1fr; }
  .filter-footer, .results-toolbar { align-items: flex-start; flex-direction: column; }
  .legend { order: -1; }
  .book-grid { grid-template-columns: 1fr; }
  .book-card { min-height: 320px; grid-template-columns: 82px 1fr; }
  .cover-link { width: 82px; height: 125px; }
  footer { align-items: flex-start; flex-direction: column; }
}

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