/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --purple: #6b3fa0;
  --purple-dark: #4e2d73;
  --purple-light: #a855f7;
  --purple-bg: #f5f0ff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --white: #ffffff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1), 0 16px 48px rgba(0,0,0,.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.9em; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--purple);
  color: var(--white);
  transition: background .2s, transform .15s;
  cursor: pointer;
  border: none;
}
.btn:hover { background: var(--purple-dark); transform: translateY(-1px); }
.btn-sm { padding: 8px 18px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}
.btn-outline:hover { background: var(--purple); color: var(--white); }
.btn-buy {
  background: var(--purple);
  font-size: 1.15rem;
  padding: 18px 48px;
}

/* ── Nav ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--purple);
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, var(--purple-bg) 0%, var(--white) 60%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
}
.hero-eyebrow {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gray-900);
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 12px;
  max-width: 520px;
}
.hero-description {
  font-size: 1.05rem;
  color: var(--gray-500);
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-ctas { display: flex; gap: 16px; margin-bottom: 32px; }
.hero-proof {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--gray-500);
}
.dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gray-400);
}
.hero-image img {
  width: 340px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ── Logos ────────────────────────────────────────── */
.logos {
  padding: 40px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.logos-label {
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: 16px;
}
.logos-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-400);
}

/* ── Section shared ──────────────────────────────── */
.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto 48px;
}

/* ── Features ────────────────────────────────────── */
.features { padding: 96px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.feature-card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  transition: box-shadow .2s;
}
.feature-card:hover { box-shadow: var(--shadow); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}
.feature-card p { color: var(--gray-600); font-size: 0.95rem; }

/* ── Learn ───────────────────────────────────────── */
.learn {
  padding: 96px 0;
  background: var(--gray-50);
}
.learn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.learn-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--gray-200);
}
.learn-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--purple-light);
  flex-shrink: 0;
  width: 48px;
}
.learn-item h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--gray-900);
}
.learn-item p { font-size: 0.9rem; color: var(--gray-600); }

/* ── Chapters ────────────────────────────────────── */
.chapters { padding: 96px 0; }
.chapter-list {
  max-width: 720px;
  margin: 0 auto;
}
.chapter-item {
  border-bottom: 1px solid var(--gray-200);
}
.chapter-item:first-child { border-top: 1px solid var(--gray-200); }
.chapter-item summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background .15s;
  list-style: none;
}
.chapter-item summary::-webkit-details-marker { display: none; }
.chapter-item summary::marker { display: none; content: ""; }
.chapter-item summary:hover { background: var(--gray-50); }
.chapter-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--purple);
  width: 28px;
  flex-shrink: 0;
}
.chapter-title {
  flex: 1;
  font-weight: 600;
  color: var(--gray-800);
}
.chapter-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
}
.chapter-arrow::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--gray-400);
  border-bottom: 2px solid var(--gray-400);
  transform: translate(-50%, -65%) rotate(45deg);
  transition: transform .2s;
}
.chapter-item[open] .chapter-arrow::before {
  transform: translate(-50%, -35%) rotate(-135deg);
}

/* Chapter content preview */
.chapter-preview {
  position: relative;
  padding: 0 20px 24px 64px;
}
.chapter-visible-text p {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 12px;
}
.chapter-visible-text code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}
.chapter-blurred-text {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}
.chapter-blurred-text p {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 12px;
}
.chapter-blur-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,.95) 60%);
}

/* ── Code Sample ─────────────────────────────────── */
.code-sample { padding: 96px 0; }
.code-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.code-block {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--gray-900);
}
.code-block-header {
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  background: var(--gray-800);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
}
.code-block code {
  color: #e4e4e7;
  font-family: var(--mono);
}
.code-block .kw { color: #c084fc; }
.code-block .fn { color: #67e8f9; }
.code-block .mod { color: #fbbf24; }
.code-block .str { color: #86efac; }
.code-block .interp { color: #fbbf24; }
.code-block .num { color: #f9a8d4; }
.code-block .comment { color: #71717a; font-style: italic; }

/* ── Audience ────────────────────────────────────── */
.audience {
  padding: 96px 0;
  background: var(--gray-50);
}
.audience-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.audience-card {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--gray-200);
}
.audience-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--gray-900);
}
.audience-card p { font-size: 0.95rem; color: var(--gray-600); }

/* ── Author ──────────────────────────────────────── */
.author { padding: 96px 0; }
.author-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.author-text p {
  font-size: 1.05rem;
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.7;
}
.author-text code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Buy ─────────────────────────────────────────── */
.buy {
  padding: 96px 0;
  background: linear-gradient(135deg, var(--purple-bg) 0%, #ede9fe 100%);
}
.buy-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px;
}
.buy-details {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.buy-cover {
  width: 180px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.buy-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.buy-meta {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 20px;
}
.buy-includes {
  list-style: none;
  margin-bottom: 24px;
}
.buy-includes li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--gray-700);
}
.buy-includes li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--purple);
  font-weight: 700;
}
.buy-isbn {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 24px;
  font-family: var(--mono);
}

/* ── Footer ──────────────────────────────────────── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--gray-200);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--gray-400);
}
.footer-isbn { font-family: var(--mono); font-size: 0.8rem; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text { order: 1; }
  .hero-image { order: 0; display: flex; justify-content: center; }
  .hero-image img { width: 220px; }
  .hero h1 { font-size: 2.5rem; }
  .hero-subtitle, .hero-description { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .hero-proof { justify-content: center; flex-wrap: wrap; }

  .features-grid,
  .learn-grid,
  .code-grid { grid-template-columns: 1fr; }

  .audience-grid { grid-template-columns: 1fr; }

  .buy-details {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .buy-includes li { text-align: left; }
  .buy-card { padding: 32px 24px; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }

  .section-title { font-size: 1.75rem; }
}
