:root {
  --ink: #17202a;
  --muted: #647084;
  --line: #dce2ea;
  --paper: #ffffff;
  --wash: #f6f8fb;
  --black: #111318;
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --shadow: 0 18px 42px rgba(23, 32, 42, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f6f8fb 0%, #ffffff 32%, #f7f9fc 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0f766e 0%, #2454a6 52%, #7c3aed 100%);
}

.top-nav {
  display: flex;
  gap: 18px;
  color: #445066;
  font-size: 14px;
  font-weight: 800;
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, .98fr);
  align-items: center;
  gap: 48px;
  padding: 42px 0 42px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: #536174;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section-title h2,
.group-heading h2,
.detail-copy h1 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 780px;
  margin-top: 14px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: .95;
}

.hero-copy p {
  max-width: 650px;
  margin: 22px 0 0;
  color: #4a5568;
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.black-button,
.outline-button,
.purple-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  padding: 12px 17px;
  font-size: 15px;
  font-weight: 900;
}

.black-button {
  border: 1px solid var(--black);
  background: var(--black);
  color: #fff;
}

.outline-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.purple-button {
  width: fit-content;
  min-height: 52px;
  margin-top: 24px;
  border: 1px solid var(--purple);
  background: var(--purple);
  color: #fff;
  box-shadow: 0 14px 28px rgba(124, 58, 237, .22);
}

.purple-button:hover {
  background: var(--purple-dark);
}

.hero-art {
  position: relative;
  min-height: 430px;
}

.hero-cover {
  position: absolute;
  width: 38%;
  min-width: 140px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .72);
}

.hero-cover-1 {
  left: 4%;
  top: 36px;
  transform: rotate(-7deg);
}

.hero-cover-2 {
  left: 32%;
  top: 0;
  z-index: 2;
  transform: rotate(3deg);
}

.hero-cover-3 {
  right: 4%;
  top: 58px;
  transform: rotate(7deg);
}

.hero-cover-4 {
  left: 25%;
  bottom: 0;
  width: 34%;
  transform: rotate(-2deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 58px;
}

.stats div {
  min-height: 104px;
  padding: 20px;
  background: #fff;
}

.stats strong {
  display: block;
  margin-bottom: 7px;
  font-size: 32px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-weight: 750;
}

.section-block {
  padding: 28px 0 64px;
}

.section-block.compact {
  padding-top: 4px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.section-title h2 {
  margin-top: 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.group-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 8px 22px rgba(23, 32, 42, .06);
}

.group-heading {
  border-left: 5px solid var(--accent);
  padding-left: 16px;
}

.group-heading h2 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.12;
}

.group-heading p {
  margin: 12px 0 0;
  color: var(--muted);
}

.mini-book-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.mini-book-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: #263142;
  font-size: 14px;
  font-weight: 800;
  background: #f9fafb;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.book-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(23, 32, 42, .06);
}

.cover-link {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 285px;
  padding: 22px 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, .10), rgba(36, 84, 166, .08)), #f2f5f8;
}

.cover-link img {
  width: min(72%, 178px);
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 15px 28px rgba(23, 32, 42, .22);
}

.book-number {
  position: absolute;
  left: 14px;
  top: 14px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(23, 32, 42, .08);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.book-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f9fafb;
  color: #526070;
  font-size: 12px;
  font-weight: 850;
}

.book-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: 0;
}

.book-card p {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.book-card .black-button {
  width: 100%;
  margin-top: auto;
}

.book-detail {
  display: grid;
  grid-template-columns: minmax(260px, .42fr) minmax(0, .58fr);
  gap: 54px;
  align-items: center;
  min-height: 650px;
  padding: 48px 0 64px;
}

.detail-cover {
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 34px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .10), rgba(15, 118, 110, .08)), #f2f5f8;
}

.detail-cover img {
  width: min(100%, 360px);
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: #445066;
  font-size: 14px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-copy h1 {
  max-width: 760px;
  margin-top: 12px;
  font-size: clamp(40px, 5vw, 72px);
  line-height: .98;
}

.subtitle {
  max-width: 760px;
  margin: 18px 0 0;
  color: #475467;
  font-size: 22px;
  line-height: 1.28;
  font-weight: 700;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.lead {
  max-width: 720px;
  margin: 0;
  color: #475467;
  font-size: 18px;
}

.detail-box {
  max-width: 720px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.detail-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: 0;
}

.detail-box p {
  margin: 0;
  color: var(--muted);
}

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

.related-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  font-weight: 850;
}

.related-card img {
  width: 70px;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  object-fit: cover;
}

.site-footer {
  padding: 28px 0 58px;
  color: #667085;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 980px) {
  .hero,
  .book-detail {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 30px;
  }

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

  .stats,
  .catalog-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-copy p,
  .lead {
    font-size: 16px;
  }

  .hero-art {
    min-height: 280px;
  }

  .hero-cover {
    min-width: 105px;
  }

  .stats,
  .group-grid,
  .catalog-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .cover-link {
    min-height: 260px;
  }

  .book-detail {
    padding-top: 22px;
  }

  .detail-copy h1 {
    font-size: 38px;
  }

  .subtitle {
    font-size: 18px;
  }
}
