:root {
  --max-width: 960px;

  --oat:        #f3f1e9;  /* page background            */
  --oat-card:   #fbfaf5;  /* raised surfaces, cards     */
  --forest-ink: #2c302a;  /* body text                  */
  --gold:       #9a7b4f;  /* accent: links, buttons     */
  --gold-deep:  #7f6540;  /* accent hover / pressed     */
  --sage:       #8a9a7b;  /* secondary / muted UI       */
  --sage-soft:  #d9ded0;  /* borders, dividers, tags    */
  --muted-text: #6f7568;  /* captions, metadata         */

  /* Semantic aliases — reference these in rules below */
  --bg:           var(--oat);
  --surface:      var(--oat-card);
  --text:         var(--forest-ink);
  --text-muted:   var(--muted-text);
  --accent:       var(--gold);
  --accent-hover: var(--gold-deep);
  --border:       var(--sage-soft);

  --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  --radius:     6px;
  --focus-ring: 0 0 0 3px rgba(154, 123, 79, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg:           #1c1f19;   /* deep forest ink, not black */
    --surface:      #262a22;
    --text:         #e9e5da;   /* warm oat text              */
    --text-muted:   #a3a692;
    --accent:       #c9a668;   /* gold brightened for dark   */
    --accent-hover: #dcbd85;
    --border:       #3a3f32;
  }
}
/* Manual override hook: <html data-theme="dark"> or "light" */
:root[data-theme='dark'] {
  --bg: #1c1f19; --surface: #262a22; --text: #e9e5da;
  --text-muted: #a3a692; --accent: #c9a668; --accent-hover: #dcbd85;
  --border: #3a3f32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--accent); color: var(--bg); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--accent);
  text-decoration-color: var(--border);
  text-underline-offset: 0.15em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:visited { color: var(--accent); }
a:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: var(--focus-ring);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
}

small, .meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.75em 1.5em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--secondary:hover { background: var(--accent); color: var(--bg); }

.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Pull quote / blockquote ---------- */
blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text);
}
blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Utility ---------- */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.center      { text-align: center; }

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.site-header .wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.25rem;
  font-family: var(--font-sans);
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}

.site-nav {
  font-family: var(--font-sans);
}

.site-nav a {
  margin-left: 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.site-nav a:hover {
  color: var(--accent-hover);
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-trigger {
  margin-left: 1.25rem;
  color: var(--text);
  cursor: default;
}

.nav-dropdown:hover .nav-trigger,
.nav-dropdown:focus-within .nav-trigger {
  color: var(--accent-hover);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 1.25rem;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(44, 48, 42, 0.12);
  padding: 0.5rem 0;
  z-index: 10;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  margin-left: 0;
  padding: 0.4rem 1rem;
  white-space: nowrap;
}

/* Main content */

main {
  flex: 1 0 auto;
  padding: 2.5rem 1.5rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  color: var(--accent);
}

.hero p {
  color: var(--text-muted);
}

/* Book grid (home page) */

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: 680px;
  margin: 0 auto;
  gap: 2.5rem;
}

@media (max-width: 700px) {
  .book-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

.book-card {
  display: block;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(44, 48, 42, 0.12);
}

.book-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.book-card h2 {
  font-size: 1rem;
  margin: 0.75rem 0;
}

/* Book detail page */

.book-detail {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.book-cover {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(44, 48, 42, 0.15);
}

.book-info {
  flex: 1;
  min-width: 260px;
}

.book-info h1 {
  margin-top: 0;
  color: var(--accent);
}

.book-meta {
  color: var(--text-muted);
  font-style: italic;
}

.buy-links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.buy-links a {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.75em 1.5em;
  text-decoration: none;
  display: inline-block;
  color: var(--accent);
  transition: background 0.15s ease, color 0.15s ease;
}

.buy-links a:hover {
  background: var(--accent);
  color: var(--bg);
}

/* About page */

.about-detail {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.about-photo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(44, 48, 42, 0.15);
}

.about-info {
  flex: 1;
  min-width: 260px;
}

.about-info h1 {
  margin-top: 0;
  color: var(--accent);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-footer p {
  margin: 0;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.social-links a {
  display: inline-flex;
  color: var(--text-muted);
}

.social-links a:hover {
  color: var(--accent-hover);
}

.social-links svg {
  width: 18px;
  height: 18px;
}
