:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d9d9de;
  --blue: #0066cc;
  --blue-dark: #004c99;
  --green: #0b7f60;
  --orange: #c94f2d;
  --navy: #152b40;
  --highlight: #fff3b0;
  --hero-wash: rgba(255, 255, 255, 0.98);
  --hero-wash-soft: rgba(255, 255, 255, 0.08);
  --chrome: rgba(245, 245, 247, 0.84);
  --drawer: rgba(255, 255, 255, 0.96);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #05070a;
    --surface: #111418;
    --surface-soft: #181c22;
    --ink: #f5f7fb;
    --muted: #c3cad6;
    --line: #303844;
    --blue: #66b3ff;
    --blue-dark: #2f8df0;
    --green: #4dd6a9;
    --orange: #ff8d6f;
    --navy: #d9e9ff;
    --highlight: #534a19;
    --hero-wash: rgba(17, 20, 24, 0.96);
    --hero-wash-soft: rgba(17, 20, 24, 0.18);
    --chrome: rgba(5, 7, 10, 0.82);
    --drawer: rgba(17, 20, 24, 0.96);
    --shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.store-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 12px 22px 78px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  margin: 0 -22px 12px;
  padding: 6px 22px;
  background: var(--chrome);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(217, 217, 222, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--blue), var(--green));
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  padding: 9px 15px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pill,
.secondary-btn {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--ink);
}

.primary-btn {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.hero {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(380px, 1.12fr);
  min-height: 520px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 4vw, 44px);
}

.kicker {
  width: fit-content;
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  background: var(--highlight);
  border-radius: 999px;
  padding: 5px 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2.35rem, 4.7vw, 4.05rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.95;
}

.accent {
  color: var(--blue);
}

.lead {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  font-weight: 520;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.stat strong {
  display: block;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.hero-art {
  min-height: 390px;
  background-image: linear-gradient(90deg, var(--hero-wash), var(--hero-wash-soft) 22%, rgba(255, 255, 255, 0) 42%), url("blrgo-ebooks-hero.png");
  background-position: center right;
  background-size: cover;
}

.section {
  margin-top: 42px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
}

.section-head p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.book-card {
  display: flex;
  flex-direction: column;
  min-height: 470px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.05);
}

.book-cover {
  min-height: 190px;
  border-radius: var(--radius);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-cover.ai {
  background: linear-gradient(145deg, #f06449, #b93864);
}

.book-cover.money {
  background: linear-gradient(145deg, #0b7f60, #143f52);
}

.book-cover.career {
  background: linear-gradient(145deg, #152b40, #2f6f97);
}

.book-cover span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.book-cover strong {
  font-size: 1.48rem;
  line-height: 1.08;
}

.book-card h2,
.book-card h3 {
  margin: 18px 0 0;
  font-size: 1.24rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.meta {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 520;
}

.toc {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.payment-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.payment-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.35;
}

.payment-status.error {
  color: var(--orange);
}

.payment-status.success {
  color: var(--green);
}

.price {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 1.52rem;
  font-weight: 800;
}

.actions {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.panel {
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(22px, 4vw, 42px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.05);
}

.panel p,
.panel li {
  color: var(--muted);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.5fr);
  gap: 18px;
  align-items: start;
}

.detail-main {
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(24px, 5vw, 54px);
  box-shadow: var(--shadow);
}

.detail .book-cover {
  min-height: 520px;
  box-shadow: var(--shadow);
}

.detail .book-cover strong {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.feature {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.feature strong {
  display: block;
}

.feature span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.87rem;
}

.sample {
  border-left: 4px solid var(--blue);
}

.success-panel {
  max-width: 760px;
  margin: 84px auto 0;
}

.legal-panel {
  max-width: 820px;
  margin: 54px auto 0;
}

.legal-panel h2 {
  margin: 28px 0 8px;
  font-size: 1.18rem;
}

.legal-panel p {
  color: var(--muted);
  font-weight: 520;
}

.addon-drawer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: min(390px, calc(100vw - 36px));
}

.addon-drawer summary {
  list-style: none;
  margin-left: auto;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  padding: 11px 15px;
  font-size: 0.86rem;
  font-weight: 750;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.addon-drawer summary::-webkit-details-marker {
  display: none;
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(520px, calc(100vh - 105px));
  overflow: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--drawer);
  padding: 10px;
  box-shadow: var(--shadow);
}

.addon-card {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
}

.addon-card strong {
  display: block;
  font-size: 0.94rem;
}

.addon-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

footer {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 22px 34px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 920px) {
  .hero,
  .detail,
  .book-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-art {
    min-height: 300px;
    order: -1;
  }

  .detail .book-cover {
    min-height: 360px;
    order: -1;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 14px 14px 82px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 -14px 14px;
    padding: 10px 14px;
  }

  .nav {
    justify-content: flex-start;
    width: 100%;
  }

  .pill,
  .primary-btn,
  .secondary-btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  h1 {
    font-size: clamp(2.25rem, 12vw, 3.6rem);
  }

  .hero-copy,
  .detail-main {
    padding: 24px;
  }

  .lead {
    font-size: 1.02rem;
  }

  .stats,
  .feature-list,
  .addon-grid {
    grid-template-columns: 1fr;
  }

  .book-card {
    min-height: 0;
  }
}
