.deepdoc-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  padding-top: clamp(72px, 10vw, 124px);
  padding-bottom: clamp(68px, 9vw, 108px);
  background:
    linear-gradient(180deg, var(--color-panel), var(--color-bg));
}

.deepdoc-hero::before {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, var(--color-grid) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, var(--color-grid) 0 1px, transparent 1px 32px);
  content: "";
  mask-image: radial-gradient(ellipse at center, var(--color-text), transparent 72%);
  pointer-events: none;
}

.deepdoc-hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.deepdoc-hero .eyebrow {
  margin-top: 20px;
}

.deepdoc-hero h1 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 0.28em;
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.deepdoc-hero .lead {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

.deepdoc-intro-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.deepdoc-facts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.deepdoc-facts span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-panel) 88%, transparent);
  padding: 4px 13px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.deepdoc-route-map {
  position: absolute;
  z-index: 1;
  right: 50%;
  bottom: -18px;
  width: min(920px, 92vw);
  color: var(--color-accent);
  opacity: 0.24;
  transform: translateX(50%);
  pointer-events: none;
}

.deepdoc-route-map path,
.deepdoc-route-map circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.deepdoc-route-map circle {
  fill: var(--color-panel);
  stroke-width: 2;
}

.deepdoc-article {
  max-width: calc(940px + var(--gutter) * 2);
}

.deepdoc-preface {
  margin-bottom: 38px;
  border-top: 4px solid var(--color-accent);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-panel);
  padding: clamp(22px, 4vw, 34px);
  color: var(--color-text-muted);
  font-size: 17px;
}

.deepdoc-preface p:last-child {
  margin-bottom: 0;
}

.deepdoc-article .toc-tabs {
  margin-bottom: 72px;
}

.deepdoc-section {
  position: relative;
  padding-bottom: 72px;
}

.deepdoc-section + .deepdoc-section {
  border-top: 1px solid var(--color-border);
  padding-top: 80px;
}

.deepdoc-section:last-child {
  padding-bottom: 0;
}

.deepdoc-section h2 {
  max-width: 800px;
}

.deepdoc-section h3 {
  margin-top: 2.1em;
  padding-left: 16px;
  border-left: 4px solid var(--color-accent);
  font-size: clamp(21px, 3vw, 27px);
}

.deepdoc-section p,
.deepdoc-section li {
  color: var(--color-text-muted);
}

.deepdoc-section h2 + h3 {
  margin-top: 1.4em;
}

.section-index {
  margin-bottom: 10px;
  color: var(--color-accent) !important;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.deepdoc-section .table-scroll {
  margin-top: 30px;
  margin-bottom: 34px;
}

.deepdoc-section pre {
  margin-top: 24px;
  margin-bottom: 26px;
  box-shadow: 0 22px 44px -34px var(--shadow-card);
}

.deepdoc-section code {
  font-size: 13px;
  line-height: 1.75;
}

.deepdoc-section .callout {
  margin-top: 34px;
  margin-bottom: 34px;
}

.deepdoc-section .callout p {
  color: var(--color-text-muted);
}

.deepdoc-section a {
  font-weight: 700;
}

@media (max-width: 768px) {
  .deepdoc-hero {
    padding-top: 62px;
    padding-bottom: 70px;
  }

  .deepdoc-hero h1 {
    gap: 0.12em 0.24em;
  }

  .deepdoc-route-map {
    bottom: -6px;
    width: 150vw;
    opacity: 0.16;
  }

  .deepdoc-preface {
    font-size: 16px;
  }

  .deepdoc-article .toc-tabs {
    margin-bottom: 56px;
  }

  .deepdoc-section {
    padding-bottom: 58px;
  }

  .deepdoc-section + .deepdoc-section {
    padding-top: 64px;
  }

  .deepdoc-section h3 {
    padding-left: 12px;
  }
}

@media (max-width: 480px) {
  .deepdoc-intro-links {
    align-items: stretch;
    flex-direction: column;
  }

  .deepdoc-intro-links .btn {
    width: 100%;
  }

  .deepdoc-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deepdoc-facts span {
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .deepdoc-section pre {
    padding: 15px;
  }
}