:root {
  --paper: #f6f1e7;
  --card: #fffdf8;
  --ink: #3a352c;
  --ink-soft: #7a7263;
  --accent: #a66622;   /* sampled from the logo's marigolds */
  --lavender: #8a6aa1; /* sampled from the logo's lavenders */
  --edge: #d8d0bf;
  --shadow: 0 6px 22px rgba(20, 16, 8, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-header {
  text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 4px;
}
.site-header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.site-header p { color: var(--ink-soft); margin-top: 3px; font-size: 13.5px; }

.logo { width: 76px; height: 76px; }

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px clamp(12px, 4vw, 48px) 24px;
}

/* ---------- bookshelf: categories + carousel ---------- */
#flourish {
  text-align: center;
  color: var(--lavender);
  margin: 2px 0 8px;
  line-height: 0;
}

#cat-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
#cat-nav button {
  border: 1px solid var(--edge);
  background: var(--card);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease;
}
/* Two tidy rows of four on narrow screens; one row on wide. */
@media (max-width: 640px) {
  #cat-nav { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 380px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 641px) {
  #cat-nav button { padding: 7px 15px; }
}
#cat-nav button.active {
  background: var(--lavender);
  border-color: var(--lavender);
  color: #fff;
}

#carousel-wrap { position: relative; }
#carousel {
  --cardw: min(50vw, 250px);
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px calc(50% - var(--cardw) / 2) 10px;
  scrollbar-width: none;
}
#carousel::-webkit-scrollbar { display: none; }
.car-card {
  flex: none;
  width: var(--cardw);
  scroll-snap-align: center;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 200ms ease, opacity 200ms ease;
  transform: scale(0.86);
  opacity: 0.55;
}
.car-card.focused { transform: scale(1); opacity: 1; }
.car-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
}
.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--card);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
#car-prev { left: 2px; }
#car-next { right: 2px; }

#focus-info { text-align: center; margin-top: 0; }
#focus-info h2 { font-size: 18px; margin-top: 10px; }
#focus-info .muted { margin: 2px 0 9px; font-size: 13px; }
#focus-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
#focus-actions .btn { min-width: 116px; }
#samples {
  display: grid;
  grid-template-columns: repeat(3, min(27vw, 118px));
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
#samples button {
  position: relative;
  border: none;
  background: #fff;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 120ms ease;
}
#samples .badge { top: 6px; left: 6px; }
#samples button:hover { transform: translateY(-2px); }
#samples img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.samples-hint { text-align: center; font-size: 12.5px; }
#empty-note { text-align: center; padding: 40px 0; }

.muted { color: var(--ink-soft); }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary {
  background: #efe7d7;
  color: var(--ink);
  border: 1px solid var(--edge);
}
.btn-secondary:hover { background: #e9dfcb; }
.btn-quiet { background: #ece5d6; color: var(--ink); }
.card-actions .btn { flex: 1; }

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(20,16,8,0.25);
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
}
.site-footer .logo { display: block; margin: 0 auto 6px; }

/* ---------- modal ---------- */
#amazon-scrim {
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 12, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 340px;
}
.modal p { font-size: 15px; line-height: 1.5; margin-bottom: 18px; }
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; }

