/* ============================================================
   Granite Pond Publishing
   Aesthetic drawn from the "A Machine Knows My Soul" cover:
   warm ivory ground, high-contrast serif display (Cormorant),
   clean sans for secondary text (Montserrat), quiet and spacious.
   ============================================================ */

:root {
  --ivory: #f3efe8;
  --ivory-deep: #ece4d7;
  --ink: #1b1814;
  --muted: #8c8475;
  --line: #ddd5c7;
  --dark: #161310;
  --gold: #b9a06f;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", system-ui, -apple-system, sans-serif;
  --max: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

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

/* ---------- shared type roles ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 26px;
  padding-bottom: 26px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.32rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark span { color: var(--muted); }
.site-nav { display: flex; gap: 30px; }
.site-nav a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--ink); border-color: var(--gold); }

/* ---------- hero (landing) ---------- */

.hero {
  text-align: center;
  padding: 96px 28px 84px;
  background:
    radial-gradient(120% 90% at 50% 0%, #faf8f4 0%, var(--ivory) 46%, var(--ivory-deep) 100%);
}
.hero .eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero .lede {
  max-width: 30em;
  margin: 26px auto 0;
  font-size: 1.06rem;
  color: #4a443c;
}
.rule {
  width: 54px;
  height: 1px;
  background: var(--gold);
  margin: 34px auto 0;
}

/* ---------- books grid ---------- */

.section { padding: 88px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
}
.section-head .eyebrow { display: block; margin-bottom: 16px; }

.books {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 52px 44px;
}
.book-card { text-align: center; display: flex; flex-direction: column; }
.book-card .cover {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 14px 34px rgba(30, 24, 16, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.book-card .cover img { width: 100%; aspect-ratio: 1600 / 2560; object-fit: cover; }
.book-card:hover .cover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(30, 24, 16, 0.24);
}
.book-card h3 {
  font-size: 1.5rem;
  margin: 24px 0 6px;
  letter-spacing: 0.01em;
}
.book-card .byline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.book-card .blurb {
  font-size: 0.95rem;
  color: #4a443c;
  margin: 14px auto 22px;
  max-width: 26em;
  flex-grow: 1;
}
.book-card .more {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
  align-self: center;
  transition: color 0.2s;
}
.book-card .more:hover { color: var(--gold); }

/* ---------- about strip ---------- */

.about { background: var(--ivory-deep); border-top: 1px solid var(--line); }
.about .wrap { max-width: 720px; text-align: center; }
.about p { font-size: 1.06rem; color: #443f37; }
.about p + p { margin-top: 16px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 15px 34px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ivory); }

/* ---------- book detail page ---------- */

.book-detail { padding: 80px 0 96px; }
.book-detail .grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 64px;
  align-items: start;
}
.book-detail .cover-col img {
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 18px 44px rgba(30, 24, 16, 0.22);
}
.book-detail .meta .eyebrow { display: block; margin-bottom: 18px; }
.book-detail h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: 0.015em;
}
.book-detail .subtitle {
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  color: #4a443c;
  margin-top: 10px;
  line-height: 1.3;
}
.book-detail .byline {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
}
.book-detail .desc { margin: 30px 0 0; }
.book-detail .desc p { color: #3f3a32; }
.book-detail .desc p + p { margin-top: 16px; }
.book-detail .actions {
  margin-top: 38px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.back-link {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }

/* ---------- footer (echoes the cover's dark sphere) ---------- */

.site-footer {
  background: var(--dark);
  color: #cfc7b7;
  border-top: 2px solid var(--gold);
  padding: 56px 0;
  text-align: center;
}
.site-footer .fwordmark {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #efe9dd;
}
.site-footer .flinks {
  margin-top: 18px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-footer .flinks a { color: #b6ad9c; transition: color 0.2s; }
.site-footer .flinks a:hover { color: var(--gold); }
.site-footer .copy {
  margin-top: 22px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #7d7665;
}

/* ---------- listen-to-a-sample (auto-advancing playlist) ---------- */

.sample-player {
  margin-top: 18px;
  width: 100%;
  max-width: 480px;
}
.sample-player[hidden] { display: none; }
.sample-player audio { width: 100%; }
.sample-nowplaying {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.sample-nowplaying strong { color: var(--ink); font-weight: 600; }
.sample-tracks { list-style: none; margin: 16px 0 0; padding: 0; }
.sample-tracks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: #4a443c;
  cursor: pointer;
  transition: color 0.15s;
}
.sample-tracks li:last-child { border-bottom: 1px solid var(--line); }
.sample-tracks li:hover { color: var(--ink); }
.sample-tracks li .num {
  width: 1.5em;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.sample-tracks li.active { color: var(--ink); font-weight: 600; }
.sample-tracks li.active .num { color: var(--gold); }
.sample-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- "how this book was made" call-to-action (book page) ---------- */

.making-cta {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.making-lead {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.4;
  color: #3f3a32;
  max-width: 30em;
  margin-bottom: 22px;
}

/* ---------- essay (How This Book Was Made) ---------- */

.essay { max-width: 720px; margin: 0 auto; padding: 78px 0 96px; }
.essay .eyebrow { display: block; text-align: center; margin-bottom: 16px; }
.essay h1 {
  text-align: center;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  letter-spacing: 0.015em;
  margin-bottom: 12px;
}
.essay .dateline {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.essay .essay-rule { width: 54px; height: 1px; background: var(--gold); margin: 0 auto 46px; }
.essay p { color: #3f3a32; font-size: 1.07rem; margin-bottom: 20px; }
.essay .epigraph {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 3.2vw, 1.8rem);
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
  max-width: 22em;
  margin: 46px auto;
}
.essay .sig { margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--line); }
.essay .sig .name { font-family: var(--display); font-size: 1.5rem; color: var(--ink); }
.essay .sig .note { color: #4a443c; font-size: 0.95rem; margin-top: 10px; }
.essay .sig .place {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-top: 14px;
}
.essay .sig .back-link { display: inline-block; margin-top: 30px; }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .books { grid-template-columns: repeat(2, 1fr); gap: 44px 32px; }
  .book-detail .grid { grid-template-columns: 1fr; gap: 40px; max-width: 460px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .books { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
  .site-header .wrap { flex-direction: column; gap: 16px; }
  .wordmark { font-size: 1.15rem; letter-spacing: 0.26em; }
  .hero { padding: 72px 24px 60px; }
  .hero h1 {
    font-size: clamp(1.8rem, 10vw, 2.7rem);
    letter-spacing: 0.015em;
    overflow-wrap: break-word;
  }
}
