:root {
  --paper: #f4eee4;
  --paper-2: #fffdf8;
  --ink: #1c1917;
  --muted: #5c534c;
  --line: #e4d8c8;
  --green: #2c4a3e;
  --green-2: #3d6454;
  --leather: #8b3a2f;
  --gold: #c4a35a;
  --shadow: 0 18px 40px rgba(44, 36, 24, 0.08);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: #000; color: #fff; padding: 8px 12px;
}
.skip-link:focus { left: 8px; z-index: 20; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244, 238, 228, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--green); color: #f6efe2;
  display: grid; place-items: center; font-weight: 700; letter-spacing: 0.04em;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text small { color: var(--muted); font-size: 12px; }
.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--paper-2);
  border-radius: 999px; padding: 10px 16px; font: inherit;
}
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav > a, .nav-dd > button {
  color: inherit; text-decoration: none; background: none; border: 0;
  font: inherit; cursor: pointer; padding: 8px 0;
}
.site-nav a[aria-current="page"] { color: var(--leather); font-weight: 600; }
.nav-dd { position: relative; }
.nav-dd-menu {
  display: none; position: absolute; top: 100%; right: 0;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 14px; min-width: 200px; padding: 10px;
  box-shadow: var(--shadow);
}
.nav-dd:hover .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { display: grid; }
.nav-dd-menu a { padding: 8px 10px; text-decoration: none; color: inherit; border-radius: 8px; }
.nav-dd-menu a:hover { background: var(--paper); }
.nav-search { display: flex; gap: 6px; }
.nav-search input, .contact-form input, .contact-form textarea, .login-card input {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font: inherit; background: var(--paper-2); min-width: 0; width: 100%;
}
.nav-search button, .btn {
  border: 0; border-radius: 999px; padding: 11px 18px; font: inherit; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--green); color: #f8f3ea; }
.btn-ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn-tiny { padding: 6px 12px; font-size: 13px; background: var(--green); color: #fff; }

.hero { padding: 48px 0 20px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; color: var(--leather); font-size: 12px; font-weight: 700; margin: 0 0 8px; }
h1, h2, h3, .footer-brand { font-family: var(--display); line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 42rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-stack { display: flex; justify-content: center; }
.hero-stack img {
  width: 150px; height: 225px; object-fit: cover; border-radius: 8px;
  box-shadow: var(--shadow); margin-inline: -18px; background: #ddd;
}
.hero-stack img:nth-child(1) { transform: rotate(-8deg); }
.hero-stack img:nth-child(2) { transform: translateY(-12px) rotate(2deg); z-index: 1; }
.hero-stack img:nth-child(3) { transform: rotate(7deg); }

.section { padding: 28px 0 48px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.book-card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.book-card a { color: inherit; text-decoration: none; display: block; padding: 0 0 14px; }
.book-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: #e8ddd0; }
.book-card h3 { font-size: 1rem; padding: 12px 12px 0; min-height: 2.6em; }
.book-card .by, .book-card .tag { margin: 0; padding: 0 12px; color: var(--muted); font-size: 13px; }
.book-card .tag { color: var(--leather); font-weight: 600; margin-top: 6px; }

.genre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.genre-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; text-decoration: none; color: inherit; min-height: 120px;
}
.genre-card strong { display: block; font-family: var(--display); font-size: 1.2rem; margin-bottom: 6px; }
.genre-card span { color: var(--muted); font-size: 0.95rem; }

.page-hero { padding: 36px 0 8px; }
.prose-block, .prose-page { padding: 20px 0 56px; max-width: 760px; }
.prose-page { width: min(760px, calc(100% - 32px)); }
.prose-block p, .prose-page p, .prose-page li { color: #3b342e; }

.book-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 32px 0; }
.book-cover-col img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); aspect-ratio: 2/3; object-fit: cover; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.crumbs a { color: inherit; }
.byline { color: var(--muted); margin-top: 0; }
.source-note { font-size: 13px; color: var(--muted); }
.sticky-actions {
  position: sticky; bottom: 12px; background: rgba(244,238,228,.94);
  padding: 10px; border-radius: 999px; width: fit-content;
}

.reader-bar { position: sticky; top: 72px; z-index: 8; background: var(--paper); border-bottom: 1px solid var(--line); }
.reader-bar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 52px; gap: 10px; }
.reader-tools { display: flex; gap: 6px; align-items: center; }
.reader-tools button {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 10px; padding: 8px 10px; font: inherit;
}
.reader-sheet {
  width: min(720px, calc(100% - 24px)); margin: 24px auto 40px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px 48px;
}
.reader-head h1 { font-size: 2rem; }
.reader-body { font-size: 1.125rem; line-height: 1.85; color: #2a241f; }
.reader-body p { margin: 0 0 1em; }
.reader-sheet.is-sepia { background: #f3e6c9; }
.reader-license { font-size: 12px; color: var(--muted); padding-bottom: 40px; }

.ad-slot { width: min(1120px, calc(100% - 32px)); margin: 12px auto; }
.ad-placeholder {
  min-height: 90px; border: 1px dashed var(--line); border-radius: 12px;
  display: grid; place-items: center; color: #8a8076; background: rgba(255,255,255,.35);
}
.ad-inpage { margin: 8px auto 28px; }

.site-footer { background: #24362f; color: #efe7da; padding: 40px 0 20px; }
.site-footer a { color: #f0d9a6; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer-heading, .footer-brand { color: #fff; }
.footer-grid a { display: block; margin: 6px 0; text-decoration: none; }
.footer-note { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 16px; font-size: 13px; color: #d9d0c4; }

.cookie-banner {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  background: #1c1917; color: #fff; border-radius: 16px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  z-index: 30; max-width: 1120px; margin: 0 auto;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner button { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--gold); font: inherit; }

.contact-form { display: grid; gap: 12px; }
.notice-ok, .notice-bad { padding: 12px; border-radius: 12px; }
.notice-ok { background: #e7f4ea; }
.notice-bad { background: #fde8e4; }

@media (max-width: 900px) {
  .hero-inner, .book-layout, .footer-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .genre-grid { grid-template-columns: 1fr 1fr; }
  .hero-stack { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 72px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 16px 18px;
  }
  .site-nav.is-open { display: flex; }
  .nav-dd-menu { position: static; display: grid; box-shadow: none; border: 0; padding: 0; }
  .sticky-actions { width: auto; justify-content: center; }
  .header-inner { position: relative; }
}
@media (max-width: 560px) {
  .genre-grid { grid-template-columns: 1fr; }
  .cookie-banner { flex-direction: column; align-items: stretch; }
}
