:root {
  --bg: #e9e0ce;
  --panel: rgba(247, 241, 227, .58);
  --panel-soft: #ddd1bb;
  --text: #292720;
  --muted: #746c5d;
  --line: #c4b69d;
  --accent: #805c35;
  --accent-soft: #aa895e;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { position: relative; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, sans-serif; }
body::before { content: ""; position: fixed; z-index: 9999; inset: 0; pointer-events: none; opacity: .22; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E"), radial-gradient(circle at 15% 20%, rgba(255,255,255,.7), transparent 32%), radial-gradient(circle at 82% 72%, rgba(128,92,53,.08), transparent 38%); mix-blend-mode: multiply; }
a { color: inherit; }
.site-header, main, footer { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.wordmark, h1, h2 { font-family: Georgia, serif; }
.wordmark { color: var(--accent); font-size: 1.4rem; text-decoration: none; }
nav { display: flex; gap: 1.1rem; }
nav a { color: var(--muted); font-size: .9rem; text-decoration: none; }
nav a:hover, .source-link:hover { color: var(--accent); }
.hero { padding: clamp(4rem, 10vw, 8rem) 0 3rem; max-width: 850px; }
.search-header { max-width: 850px; padding: 3rem 0 2rem; }
.search-header h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 400; }
.search-count { margin: -.25rem 0 0; color: var(--muted); font-size: .9rem; }
.hero h1 { margin: 0; font-size: clamp(3.2rem, 9vw, 6.5rem); font-weight: 400; line-height: .95; }
.hero > p:not(.eyebrow) { color: var(--muted); font-family: Georgia, serif; font-size: clamp(1.2rem, 3vw, 1.7rem); }
.eyebrow, .book-date, .source-name { color: var(--accent); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.search { display: flex; gap: .65rem; margin: 2rem 0 1rem; }
input, button { border: 1px solid var(--line); border-radius: 2px; font: inherit; }
input { flex: 1; min-width: 0; padding: .9rem 1rem; background: rgba(255, 252, 242, .55); color: var(--text); }
button { padding: .9rem 1.4rem; background: var(--accent); color: #fffaf0; cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; }
.filters a { padding: .35rem .7rem; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; text-decoration: none; }
.book-grid { border: 1px solid var(--line); border-bottom: 0; background: #dfd3bd; }
.book-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 1rem; min-width: 0; padding: .65rem .8rem; border-bottom: 1px solid var(--line); background: rgba(223, 211, 189, .82); }
.book-cover-link { display: block; width: 48px; height: 72px; background: #d8cbb3; box-shadow: 0 2px 5px rgba(70, 52, 31, .16); }
.book-cover { display: block; width: 48px; height: 72px; border: 1px solid var(--line); object-fit: cover; }
.book-content { min-width: 0; }
.book-line { margin: 0; }
.book-line-primary { color: var(--text); font-family: Georgia, serif; font-size: 1.05rem; }
.book-line-primary time { color: var(--accent); font-family: system-ui, sans-serif; font-size: .82rem; font-variant-numeric: tabular-nums; }
.book-line-primary a { text-decoration: none; }
.book-line-primary a:hover { color: var(--accent); }
.book-line-secondary { color: var(--muted); font-size: .88rem; }
.book-description { display: inline; margin-left: .3rem; color: var(--muted); font-size: .88rem; }
.book-description summary { display: inline; color: var(--accent); cursor: pointer; list-style: none; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: .2rem; }
.book-description summary::-webkit-details-marker { display: none; }
.book-description summary::after { content: " +"; text-decoration: none; }
.book-description[open] summary::after { content: " −"; }
.book-description[open] { display: block; margin: .35rem 0 0; }
.book-description p { max-width: 78ch; margin: .4rem 0 .2rem; padding-left: .8rem; border-left: 2px solid var(--line); color: var(--text); line-height: 1.55; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.5rem 0; color: var(--muted); font-size: .88rem; }
.pagination a { color: var(--accent); text-decoration: none; }
.pagination a:last-child { text-align: right; }
.prose, .empty { max-width: 720px; padding: 5rem 0; }
.search-empty { margin: 0; padding: 2rem 0; color: var(--muted); }
footer { margin-top: 4rem; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 700px) {
  .site-header { align-items: flex-start; gap: 1rem; }
  nav { flex-wrap: wrap; justify-content: flex-end; gap: .5rem .8rem; }
  .search { flex-direction: column; }
  .book-line-primary { font-size: 1rem; }
}
