/* John Shufeldt's Library — editorial design system */
:root {
  --paper: #faf7f1;
  --paper-deep: #f3eee4;
  --ink: #1c1b18;
  --ink-soft: #54514a;
  --ink-faint: #8a857a;
  --green: #1e3a2f;
  --green-soft: #2c5444;
  --brass: #b08d3f;
  --brass-soft: #c9a866;
  --line: #e4ddcf;
  --card: #ffffff;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --shadow: 0 1px 2px rgba(28,27,24,.06), 0 8px 24px rgba(28,27,24,.09);
  --shadow-lift: 0 2px 4px rgba(28,27,24,.08), 0 16px 40px rgba(28,27,24,.16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-soft); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,247,241,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 30px; height: 30px; fill: var(--green); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--serif); font-weight: 600; font-size: 1.18rem;
  color: var(--ink); letter-spacing: -.01em;
}
.brand-tag {
  font-size: .62rem; font-weight: 700; letter-spacing: .24em;
  text-transform: uppercase; color: var(--brass);
}
.brand:hover .brand-name { color: var(--green); }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--ink-soft); font-size: .92rem; font-weight: 500;
  letter-spacing: .01em;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta {
  background: var(--green); color: #fff !important; padding: 8px 18px;
  border-radius: 999px; font-weight: 600;
}
.nav-cta:hover { background: var(--green-soft); }
.nav-burger {
  display: none; margin-left: auto; background: none; border: none;
  cursor: pointer; padding: 10px; flex-direction: column; gap: 5px;
}
.nav-burger span {
  display: block; width: 22px; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { padding: 52px 0 60px; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px;
  align-items: center;
}
.hero-left { display: flex; flex-direction: column; }
.hero-photo {
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lift);
  aspect-ratio: 4/5; width: 100%;
}
.nowrap { white-space: nowrap; }
.kicker {
  font-size: .8rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brass);
  margin-bottom: 18px;
}
h1.display {
  font-family: var(--serif); font-weight: 560; font-size: clamp(2.4rem, 4.6vw, 3.9rem);
  line-height: 1.08; letter-spacing: -.02em; margin-bottom: 24px;
}
h1.display em { font-style: italic; color: var(--green); }
h1.display.display-hero { font-size: clamp(2.8rem, 5.4vw, 4.4rem); margin-bottom: 20px; }
.mission-block {
  border-left: 3px solid var(--brass);
  padding: 4px 0 4px 22px;
  margin: 30px 0 4px;
  max-width: 33em;
}
.mission-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brass); margin-bottom: 8px;
}
.mission-text {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.6;
  color: var(--ink-soft);
}
.mission-text em { font-style: italic; color: var(--green); }
.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 34em; margin-bottom: 32px; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600;
  font-size: .98rem; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--green); color: #fff !important; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--green-soft); transform: translateY(-1px); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--brass); color: var(--ink); }
.btn-amazon { background: var(--brass); color: #fff !important; }
.btn-amazon:hover { background: #9a7a34; transform: translateY(-1px); }

/* ---------- stats band ---------- */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; padding: 28px 0; margin-top: 40px;
  border-top: 1px solid var(--line);
}
.stat-num {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 600;
  color: var(--green); line-height: 1;
}
.stat-label { font-size: .85rem; color: var(--ink-faint); margin-top: 6px; }

/* ---------- sections ---------- */
section { padding: 72px 0; }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 36px; }
h2.section-title {
  font-family: var(--serif); font-weight: 560; font-size: 2rem;
  letter-spacing: -.015em;
}
.section-link { margin-left: auto; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.section-sub { color: var(--ink-soft); max-width: 44em; margin: -24px 0 36px; }

/* ---------- cover shelf (horizontal scroll) ---------- */
.shelf {
  display: flex; gap: 18px; overflow-x: auto; padding: 10px 4px 24px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.shelf .cover-card { flex: 0 0 150px; scroll-snap-align: start; }

/* ---------- cover cards & grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 26px 20px;
}
.cover-card { display: block; }
.cover-frame {
  aspect-ratio: 2/3; border-radius: 6px; overflow: hidden;
  background: var(--paper-deep); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}
.cover-card:hover .cover-frame { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.cover-frame img { width: 100%; height: 100%; object-fit: cover; }
.cover-ph {
  width: 100%; height: 100%; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, var(--green) 0%, #142822 100%);
  color: #e8e2d4;
}
.cover-ph .ph-title { font-family: var(--serif); font-size: .95rem; line-height: 1.3; font-weight: 560; }
.cover-ph .ph-author { font-size: .72rem; opacity: .75; }
.cover-meta { padding: 10px 2px 0; }
.cover-title {
  font-size: .88rem; font-weight: 600; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cover-author { font-size: .78rem; color: var(--ink-faint); margin-top: 2px; }

/* ---------- category tiles ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.cat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; transition: border-color .15s, transform .15s;
}
.cat-tile:hover { border-color: var(--brass); transform: translateY(-2px); }
.cat-tile .cat-name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.cat-tile .cat-count { font-size: .82rem; color: var(--ink-faint); }

/* ---------- my books band ---------- */
.own-band { background: var(--green); color: #ece7da; }
.own-band h2.section-title, .own-band .kicker { color: #fff; }
.own-band .kicker { color: var(--brass-soft); }
.own-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.own-card {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 28px 24px 24px; text-align: center;
  transition: transform .15s; display: flex; flex-direction: column;
}
.own-card:hover { transform: translateY(-3px); }
.own-card img {
  height: 225px; width: auto; margin: 0 auto 20px; border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); object-fit: contain;
}
.own-card .own-title { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; color: #fff; line-height: 1.3; }
.own-card .own-sub { font-size: .82rem; color: #b8b0a0; margin: 6px 0 16px; flex: 1; }
.own-card .own-links { display: flex; gap: 10px; justify-content: center; }
.own-card .own-links a {
  font-size: .82rem; font-weight: 600; color: var(--brass-soft);
  border: 1px solid rgba(201,168,102,.4); padding: 6px 14px; border-radius: 999px;
}
.own-card .own-links a:hover { background: rgba(201,168,102,.15); }

/* ---------- quote ---------- */
.pull-quote {
  font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-style: italic; line-height: 1.45; text-align: center;
  max-width: 26em; margin: 0 auto; color: var(--ink);
}
.quote-attr { text-align: center; margin-top: 18px; color: var(--ink-faint); font-size: .9rem; }

/* ---------- library page ---------- */
.toolbar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  padding: 22px 0; position: sticky; top: 57px; z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--line); margin-bottom: 30px;
}
.search-box {
  flex: 1 1 260px; padding: 11px 18px; border: 1.5px solid var(--line);
  border-radius: 999px; font-size: .95rem; font-family: var(--sans);
  background: var(--card); color: var(--ink); outline: none;
}
.search-box:focus { border-color: var(--brass); }
select.filter {
  padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: .9rem; background: var(--card); color: var(--ink);
  font-family: var(--sans); outline: none; cursor: pointer;
}
.result-count { font-size: .85rem; color: var(--ink-faint); margin-left: auto; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
  font-size: .82rem; font-weight: 600; padding: 7px 15px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-soft);
  cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--brass); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- my books page ---------- */
.own-book-grid {
  display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start;
}
.own-book-cover {
  border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lift); position: sticky; top: 100px;
}
.own-book-cover img { width: 100%; display: block; }

/* ---------- book detail ---------- */
.book-hero { padding: 56px 0 48px; }
.book-grid { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: start; }
.book-cover-lg {
  border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lift);
  position: sticky; top: 100px;
}
.book-cover-lg .cover-ph { aspect-ratio: 2/3; }
.crumb { font-size: .82rem; color: var(--ink-faint); margin-bottom: 22px; }
.crumb a { color: var(--ink-faint); }
.crumb a:hover { color: var(--green); }
h1.book-title {
  font-family: var(--serif); font-weight: 560; font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.12; letter-spacing: -.015em; margin-bottom: 12px;
}
.book-byline { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 8px; }
.book-tags { display: flex; gap: 10px; margin: 18px 0 26px; flex-wrap: wrap; }
.tag {
  font-size: .78rem; font-weight: 600; padding: 5px 13px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-soft);
}
.prose { color: var(--ink); }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--serif); font-weight: 600; margin: 1.6em 0 .5em;
  letter-spacing: -.01em; line-height: 1.25;
}
.prose h3 { font-size: 1.25rem; }
.prose p { margin-bottom: 1em; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.4em; }
.prose li { margin-bottom: .45em; }
.prose strong { font-weight: 650; }
.takeaway-box {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  border-radius: 12px; padding: 34px 38px; margin: 30px 0;
  box-shadow: var(--shadow);
}
.takeaway-label {
  display: flex; align-items: center; gap: 10px;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brass); margin-bottom: 16px;
}
.section-divider { border: none; border-top: 1px solid var(--line); margin: 48px 0; }

/* ---------- find page ---------- */
.find-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 40px; box-shadow: var(--shadow); margin-bottom: 28px;
}
.find-q { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin-bottom: 20px; }
.find-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.find-opt {
  padding: 16px 20px; border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--ink-soft);
  background: var(--paper); transition: all .12s; text-align: left; font-family: var(--sans);
}
.find-opt:hover { border-color: var(--brass); }
.find-opt.on { border-color: var(--green); background: var(--green); color: #fff; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: start; padding-top: 56px; }
.about-photo { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lift); position: sticky; top: 100px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: 40px;
  color: var(--ink-faint); font-size: .86rem;
}
.foot-grid { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; }
.foot-mantra { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--ink-soft); }
.foot-note { max-width: 46em; margin-top: 16px; line-height: 1.6; }
footer a { color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  /* nav collapses to hamburger */
  .nav-burger { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(28,27,24,.12); padding: 8px 0 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 13px 24px; font-size: 1rem !important; color: var(--ink);
  }
  .nav-links a.nav-cta {
    margin: 10px 24px 0; text-align: center; border-radius: 12px;
  }

  .hero { padding: 36px 0 28px; }
  .hero-grid, .book-grid, .about-grid { grid-template-columns: 1fr; gap: 32px; }
  /* single column: left block then photo */
  .hero-photo { max-width: 400px; margin: 0 auto; width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-name { font-size: 1.05rem; }

  h1.display { font-size: clamp(1.9rem, 7.5vw, 2.5rem); }
  .lede { font-size: 1.05rem; }
  .stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px;
    margin-top: 8px; padding-top: 24px;
  }
  .stat-num { font-size: 1.8rem; }

  section { padding: 44px 0; }
  .section-head { flex-wrap: wrap; gap: 6px 20px; }
  h2.section-title { font-size: 1.6rem; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 18px 12px; }
  .shelf .cover-card { flex: 0 0 124px; }
  .cover-title { font-size: .8rem; }
  .cover-author { font-size: .72rem; }

  .toolbar { position: static; }
  .own-book-grid { grid-template-columns: 1fr; gap: 24px; }
  .own-book-cover { position: static; max-width: 220px; margin: 0 auto; }
  .book-cover-lg { position: static; max-width: 220px; margin: 0 auto; }
  .book-grid > div:first-child { order: -1; }
  .about-photo { position: static; max-width: 360px; margin: 0 auto; }
  .about-grid { padding-top: 36px; }
  .takeaway-box { padding: 24px 20px; }
  .find-card { padding: 26px 22px; }
  .find-opts { grid-template-columns: 1fr; }
  .own-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
  .own-card img { height: 180px; }
  .foot-grid { flex-direction: column; gap: 20px; }
  .foot-grid > div:last-child { text-align: left !important; }
}
