:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --border: #e8e2d6;
  --text-primary: #221f1a;
  --text-secondary: #57524a;
  --text-muted: #928c7f;
  --accent: #a8461f;
  --accent-ink: #ffffff;
  --star: #d9a404;
  --shadow: 0 1px 2px rgba(30, 24, 12, 0.04), 0 8px 24px rgba(30, 24, 12, 0.06);
  --radius: 10px;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16140f;
    --surface: #201d17;
    --border: #322d24;
    --text-primary: #f2ede2;
    --text-secondary: #c4bcac;
    --text-muted: #8a8375;
    --accent: #e08654;
    --accent-ink: #1a1208;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #16140f;
  --surface: #201d17;
  --border: #322d24;
  --text-primary: #f2ede2;
  --text-secondary: #c4bcac;
  --text-muted: #8a8375;
  --accent: #e08654;
  --accent-ink: #1a1208;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  margin: 0;
  line-height: 1.5;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0 22px;
  background: var(--surface);
}
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-text a {
  color: inherit;
  text-decoration: none;
}
.brand-logo {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  justify-self: center;
}
.brand-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-tagline {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}
.header-search {
  justify-self: end;
}
.header-search input {
  width: 260px;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
}
.header-search input:focus {
  border-color: var(--accent);
}
.back-link {
  justify-self: end;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.back-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Static content pages (about, contact, privacy, terms) */
.page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 60px;
}
.page-content h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 8px;
}
.page-content .page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 32px;
}
.page-content h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 10px;
}
.page-content p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 14px;
}
.page-content ul {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 22px;
  margin: 0 0 14px;
}
.page-content li {
  margin-bottom: 6px;
}
.page-content a {
  color: var(--accent);
}
.page-content strong {
  color: var(--text-primary);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.form-field input,
.form-field textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}
.contact-submit {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.contact-submit:hover {
  opacity: 0.9;
}
.form-success {
  font-size: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  color: var(--text-primary);
  margin-top: 24px;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 18px;
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sort-group {
  align-items: center;
  gap: 7px;
}
.sort-group:not([hidden]) {
  display: flex;
}
.sort-label {
  font-size: 12px;
  color: var(--text-muted);
}
.sort-group select {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}
.sort-group select:focus {
  border-color: var(--accent);
}
.filter-chip {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.result-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* State messages */
.state-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.state-error {
  color: var(--accent);
  white-space: pre-line;
}

/* Grid */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 32px 0 60px;
}
.show-more-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}
.show-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.review-card:hover {
  transform: translateY(-2px);
}

.cover-wrap {
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #d8cdb8, #b9ab8c);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-fallback {
  padding: 16px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 15px;
  color: #4a3f2b;
  line-height: 1.3;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 3px;
}
.genre-pill {
  font-size: 9.5px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.card-stars {
  font-size: 12px;
  color: var(--star);
  letter-spacing: 1px;
}
.card-stars .empty { color: var(--border); }
.card-spice {
  font-size: 11px;
  letter-spacing: 1px;
}
.card-spice .spice-label {
  font-size: 10.5px;
  letter-spacing: normal;
  color: var(--text-muted);
}
.card-excerpt {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.read-more {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}
.buy-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  white-space: nowrap;
}
.buy-btn:hover { opacity: 0.9; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 36px 0 0;
  background: var(--surface);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 28px;
}
.footer-brand {
  display: flex;
  gap: 14px;
  max-width: 380px;
}
.footer-logo {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}
.footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-blurb {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  width: fit-content;
}
.social-link:hover {
  color: var(--accent);
}
.social-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}
.footer-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.footer-col a {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.disclosure {
  font-size: 11.5px;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.6;
  margin: 0;
}
.footer-copyright {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 8, 0.5);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.overlay:not([hidden]) {
  display: flex;
}
.overlay-panel {
  background: var(--surface);
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  padding: 32px 32px 28px;
  position: relative;
  box-shadow: var(--shadow);
}
.overlay-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.overlay-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
  padding-right: 24px;
}
.overlay-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.overlay-stars {
  font-size: 15px;
  color: var(--star);
  margin-bottom: 6px;
}
.overlay-spice {
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.overlay-spice .spice-label {
  font-size: 12.5px;
  letter-spacing: normal;
  color: var(--text-muted);
}
.overlay-body {
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 22px;
}
.overlay-body p { margin: 0 0 12px; }
.overlay-body p:last-child { margin-bottom: 0; }
.overlay-body h2 { font-size: 19px; font-weight: 600; margin: 18px 0 8px; }
.overlay-body h3 { font-size: 17px; font-weight: 600; margin: 14px 0 6px; }
.overlay-body ul, .overlay-body ol { margin: 0 0 12px; padding-left: 22px; }
.overlay-body li { margin-bottom: 4px; }
.overlay-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 12px; padding: 4px 16px;
  color: var(--text-secondary);
  font-style: italic;
}
.overlay-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.overlay-body code { font-family: monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.overlay-body pre { background: var(--surface-2); padding: 10px 14px; border-radius: var(--radius); overflow-x: auto; margin: 0 0 12px; }
.overlay-body strong { font-weight: 700; }
.overlay-buy {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

@media (max-width: 720px) {
  .site-header .wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .brand-logo { order: -1; }
  .header-search { justify-self: center; }
}

@media (max-width: 520px) {
  .review-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .brand-title { font-size: 24px; }
  .brand-logo { width: 84px; height: 84px; }
}
