:root {
  --paper: #fbf7f0;
  --paper-2: #f3ece0;
  --card: #ffffff;
  --ink: #1d1916;
  --ink-2: #5b524a;
  --line: #e4d9c8;
  --accent: #b4441f;
  --accent-ink: #8f3315;
  --teal: #134e4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(29, 25, 22, .06), 0 6px 18px rgba(29, 25, 22, .08);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .4em; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: .75em 1.4em; font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn-small { padding: .55em 1.05em; font-size: .9rem; }
.btn-light { background: #fff; color: var(--teal); }
.btn-light:hover { background: var(--paper); color: var(--teal); }

/* header */
.site-header { background: rgba(251, 247, 240, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.25rem/1 var(--serif); color: var(--ink); text-decoration: none; }
.brand em { font-style: italic; color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--teal); color: #fff; font: 700 .95rem/1 var(--serif); letter-spacing: -.03em; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current] { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 500 .95rem var(--sans); color: var(--ink); }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; gap: 0; }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 12px; justify-content: center; }
}

/* hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #f6dccb 0, transparent 60%), linear-gradient(180deg, var(--paper-2), var(--paper)); border-bottom: 1px solid var(--line); }
.hero-inner { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); max-width: 760px; margin-left: max(16px, (100% - 1180px) / 2); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--teal); margin: 0 0 12px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.search { display: flex; gap: 8px; margin-top: 24px; max-width: 560px; }
.search input { flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .8em 1.2em; font: 1rem var(--sans); color: var(--ink); }

/* sections */
.section { padding: clamp(40px, 6vw, 64px) 0; }
.section-alt { background: var(--paper-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; }
.page-head { padding: 28px 0 8px; }
.page-head h1 { margin-top: 8px; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 28px 20px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; } }
.card { min-width: 0; }
.card[hidden] { display: none; }
.card-link { color: inherit; text-decoration: none; display: block; }
.card-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--paper-2); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card-link:hover .card-cover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 14px 28px rgba(29,25,22,.16); }
.card-cover .cover { width: 100%; height: 100%; object-fit: cover; }
.card-title { font: 600 1rem/1.3 var(--serif); margin: 12px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-link:hover .card-title { color: var(--accent); }
.card-author, .card-genre { margin: 0; font-size: .88rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-genre { font-size: .78rem; color: var(--teal); }
.pick { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font: 600 .7rem/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 999px; }
.cover-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 16px; background: linear-gradient(160deg, var(--teal), #0b302d); color: #fff; text-align: center; font: 700 1.05rem/1.25 var(--serif); }
.cover-fallback small { font: 500 .8rem var(--sans); opacity: .8; }

/* chips + categories */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.chip span { color: var(--ink-2); font-size: .82rem; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: inherit; text-decoration: none; transition: border-color .15s; }
.cat-card:hover { border-color: var(--accent); }
.cat-card h2 { font-size: 1.2rem; margin: 14px 0 2px; }
.cat-card p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.cat-covers { display: flex; gap: 8px; height: 120px; }
.cat-covers > * { width: 80px; height: 120px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow); font-size: .7rem; padding: 6px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.filters input, .filters select { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .65em .9em; font: 1rem var(--sans); color: var(--ink); max-width: 100%; }
.filters input { flex: 1 1 220px; }
.count { margin: 0 0 0 auto; color: var(--ink-2); font-size: .9rem; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 0; }

/* breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 18px 0 0; font-size: .88rem; color: var(--ink-2); }
.crumbs li + li::before { content: '›'; margin-right: 6px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* book page */
.book { padding: 24px 0 56px; }
.book-grid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
@media (max-width: 760px) { .book-grid { grid-template-columns: 1fr; } .book-media { max-width: 280px; } }
.book-media { position: sticky; top: 88px; }
@media (max-width: 760px) { .book-media { position: static; } }
.book-cover { border-radius: 8px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.1), 0 22px 44px rgba(29,25,22,.2); aspect-ratio: auto; }
.book-cover .cover { width: 100%; }
.book-cover .cover-fallback { aspect-ratio: 2 / 3; font-size: 1.5rem; }
.thumbs { display: flex; gap: 10px; margin-top: 14px; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; overflow: hidden; width: 64px; }
.thumb.is-on { border-color: var(--accent); }
.badge { display: inline-block; background: #fbe3d8; color: var(--accent-ink); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; padding: 5px 10px; border-radius: 999px; margin: 0 0 12px; }
.book-main h1 { margin-bottom: .3em; }
.subtitle { font: 500 1.2rem/1.45 var(--serif); color: var(--ink-2); margin: 0 0 12px; font-style: italic; }
.byline { margin: 0 0 20px; }
.buy-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.btn-buy { font-size: 1.05rem; padding: .85em 1.6em; }
.price { color: var(--ink-2); font-weight: 500; }
.prose { max-width: 68ch; }
.prose p, .prose ul { margin: 0 0 1em; }
.prose h2 { margin-top: 1.4em; }
.narrow { max-width: 720px; }
.summary p { font-size: 1.05rem; }
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin: 24px 0; max-width: 68ch; }
.details dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.details dd { margin: 2px 0 0; font-weight: 500; }
.author-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; max-width: 68ch; }
.author-box h2 { font-size: 1.3rem; }
.author-box p { margin: 0 0 .8em; }
.author-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 0 !important; }
.author-links a { font-weight: 600; font-size: .92rem; }

/* CTA band */
.cta-band { background: var(--teal); color: #fff; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 44px 0; flex-wrap: wrap; }
.cta-inner h2 { margin-bottom: .3em; }
.cta-inner p { margin: 0; opacity: .88; max-width: 60ch; }

/* footer */
.site-footer { background: var(--ink); color: #d9d1c6; padding: 44px 0 28px; }
.site-footer .brand { color: #fff; }
.site-footer p { margin: 12px 0 0; max-width: 40ch; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; align-content: start; }
.site-footer nav a { color: #fff; text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.footer-small { margin-top: 28px; padding-top: 18px; border-top: 1px solid #3b342e; font-size: .82rem; color: #a99e90; }
