:root {
  --ink: #1d1823;
  --muted: #695f70;
  --paper: #ffffff;
  --soft: #f7f3ee;
  --line: #e9e1dc;
  --purple: #5f3bb1;
  --purple-dark: #2b174f;
  --brown: #6b432b;
  --brown-dark: #2f1d13;
  --brown-mid: #8a5b38;
  --cream: #fff7ea;
  --rust: #9c4d2f;
  --shadow: 0 24px 70px rgba(40, 22, 14, 0.12);
  --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--purple-dark);
  color: white;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 15px;
}

.nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-color: var(--purple);
}

.section-white,
.library-section {
  padding: clamp(70px, 10vw, 128px) clamp(20px, 5vw, 72px);
}

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.72fr);
  align-items: center;
  gap: clamp(38px, 7vw, 90px);
}

.eyebrow,
.label,
.book-type {
  margin: 0 0 14px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

h1 {
  max-width: 840px;
  font-size: clamp(50px, 8vw, 104px);
}

h2 {
  font-size: clamp(36px, 5vw, 68px);
}

h3 {
  font-size: 34px;
}

.lead {
  max-width: 650px;
  margin: 26px 0 34px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--purple-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.button.primary,
.button.small {
  background: var(--purple-dark);
  color: white;
}

.button.ghost {
  background: white;
  color: var(--purple-dark);
}

.button.small {
  min-height: 42px;
  width: 100%;
}

.feature-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(95,59,177,0.08), transparent 40%),
    var(--soft);
  box-shadow: var(--shadow);
}

.feature-card:before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -48px;
  bottom: -50px;
  border-radius: 50%;
  background: rgba(95,59,177,0.12);
}

.feature-card h2 {
  font-size: clamp(34px, 4vw, 52px);
}

.feature-card p:not(.label) {
  color: var(--muted);
  font-size: 18px;
}

.text-link {
  position: relative;
  z-index: 1;
  color: var(--purple-dark);
  font-weight: 800;
  text-decoration: none;
}

.library-section {
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.10), transparent 32%),
    linear-gradient(180deg, var(--brown), var(--brown-dark));
  color: white;
}

.section-heading {
  max-width: 850px;
  margin-bottom: 38px;
}

.section-heading p {
  color: var(--muted);
  font-size: 18px;
}

.section-heading.inverse .eyebrow { color: #e7c99b; }
.section-heading.inverse p { color: rgba(255,255,255,0.76); }

.bookshelf {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 32px;
  background:
    linear-gradient(to bottom, transparent 0 78%, rgba(0,0,0,0.22) 78% 82%, rgba(137,86,52,0.55) 82% 100%),
    linear-gradient(90deg, rgba(255,255,255,0.08), transparent 12% 88%, rgba(0,0,0,0.18)),
    #3b2418;
  box-shadow: inset 0 -16px 0 rgba(0,0,0,0.18), 0 34px 90px rgba(0,0,0,0.25);
}

.book-card {
  min-height: 415px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: 28px;
  border-radius: 12px 22px 22px 12px;
  color: var(--ink);
  box-shadow: 12px 16px 0 rgba(0,0,0,0.18);
  border-left: 14px solid rgba(0,0,0,0.18);
}

.book-purple {
  background: linear-gradient(160deg, #fbf8ff, #e9defd);
  border-left-color: var(--purple);
}

.book-cream {
  background: linear-gradient(160deg, #fffaf0, #f3dfbc);
  border-left-color: #b2763b;
}

.book-rust {
  background: linear-gradient(160deg, #fff5ef, #f0c7b7);
  border-left-color: var(--rust);
}

.book-type {
  color: var(--brown-mid);
  margin-bottom: 18px;
}

.book-card p:not(.book-type) {
  color: var(--muted);
  margin: 16px 0 0;
}

.book-footer {
  display: grid;
  gap: 14px;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  font-weight: 800;
}

.download-links a {
  color: var(--purple-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(95,59,177,0.35);
}

.author-section {
  background: white;
}

.author-card {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}

.author-photo {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 32%, rgba(255,255,255,0.25), transparent 25%),
    linear-gradient(135deg, var(--purple), var(--brown-dark));
  color: white;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow);
}

.author-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.faq-section {
  background: #fcfbf9;
}

.faq-list {
  max-width: 900px;
  border-top: 1px solid var(--line);
}

details {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

summary {
  cursor: pointer;
  font-weight: 850;
  font-size: 19px;
}

details p {
  color: var(--muted);
  margin: 12px 0 0;
}

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer p { margin: 0; }
.footer a { text-decoration: none; }

.story-page {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(54px, 10vw, 110px) 22px;
}

.story-page .back-link {
  color: var(--purple-dark);
  font-weight: 800;
  text-decoration: none;
}

.story-page h1 {
  font-size: clamp(44px, 8vw, 86px);
  margin-top: 28px;
}

.story-meta {
  color: var(--muted);
  margin: 20px 0 46px;
}

.story-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.85;
}

.story-body p { margin: 0 0 1.4em; }

@media (max-width: 900px) {
  .hero,
  .author-card,
  .bookshelf {
    grid-template-columns: 1fr;
  }
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .nav {
    flex-wrap: wrap;
  }
  .author-photo {
    max-width: 260px;
  }
}
