.doc-hero {
  border-top: 1px solid var(--color-line);
}

.doc-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  border-radius: var(--radius-window);
  background: var(--color-panel);
  padding: clamp(28px, 6vw, 64px);
}

.doc-hero-copy {
  max-width: 720px;
}

.doc-hero-copy .button-row {
  margin-top: 28px;
}

.doc-route {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-page);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.doc-route ol {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: route;
}

.doc-route li {
  position: relative;
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--color-line);
  padding: 13px 0 13px 35px;
  counter-increment: route;
}

.doc-route li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.doc-route li::before {
  position: absolute;
  top: 14px;
  left: 0;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-brand-soft);
  color: var(--color-brand-dark);
  content: counter(route);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
}

.doc-route b {
  font-size: 14px;
}

.doc-route li span {
  color: var(--color-ink-muted);
  font-size: 12px;
}

.doc-intro {
  max-width: 920px;
  margin-inline: auto;
}

.doc-intro h2 {
  font-size: clamp(25px, 3vw, 34px);
}

.doc-toc-section {
  position: relative;
  z-index: 20;
  padding-top: 8px;
  padding-bottom: 8px;
}

.doc-chapter {
  scroll-margin-top: calc(var(--header-height) + 72px);
}

.doc-chapter:nth-child(even) {
  background: var(--color-panel);
}

.doc-chapter:nth-child(even) .callout,
.doc-chapter:nth-child(even) .table-wrap,
.doc-chapter:nth-child(even) pre {
  box-shadow: var(--shadow-small);
}

.chapter-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
}

.chapter-mark span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-brand);
  color: var(--color-white);
}

.doc-chapter .prose > h2:first-of-type {
  margin-top: 0;
}

.doc-chapter .prose > h3 {
  padding-top: 4px;
}

.concept-flow {
  display: flex;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 28px 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-page);
  padding: 18px;
  box-shadow: var(--shadow-small);
}

.concept-flow span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-panel-strong);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.concept-flow b {
  color: var(--color-brand);
  font-family: var(--font-mono);
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.step-strip > div {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-page);
  padding: 17px;
  box-shadow: var(--shadow-small);
}

.step-strip span {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-brand-soft);
  color: var(--color-brand-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.step-strip b {
  display: block;
  font-size: 14px;
}

.step-strip p {
  margin: 6px 0 0;
  color: var(--color-ink-muted);
  font-size: 12px;
  line-height: 1.55;
}

.doc-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.doc-next > div:first-child {
  max-width: 610px;
}

.doc-next h2 {
  margin: 8px 0;
  font-size: clamp(25px, 3vw, 34px);
}

.doc-next .button-row {
  justify-content: flex-end;
}

@media (max-width: 880px) {
  .doc-hero-panel {
    grid-template-columns: 1fr;
  }

  .doc-route {
    max-width: 620px;
  }

  .step-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-next {
    align-items: flex-start;
    flex-direction: column;
  }

  .doc-next .button-row {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .doc-hero-panel {
    gap: 24px;
    padding: 22px;
  }

  .doc-hero-copy .button-row {
    margin-top: 22px;
  }

  .doc-route {
    padding: 19px;
  }

  .doc-toc-section {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .step-strip {
    grid-template-columns: 1fr;
  }

  .concept-flow {
    align-items: flex-start;
    flex-direction: column;
  }

  .concept-flow b {
    padding-left: 12px;
    transform: rotate(90deg);
  }

  .doc-next .button-row {
    width: 100%;
  }
}