.docs {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2rem, 6vw, 4rem) var(--gap);
}

@media (min-width: 56rem) {
  .docs {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }

  .doc-nav {
    position: sticky;
    top: 5.5rem;
  }
}

.nav a[aria-current] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
}

.doc-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: var(--step--1);
  font-weight: 500;
}

@media (min-width: 56rem) {
  .doc-nav ul {
    display: grid;
    gap: 0.15rem;
  }
}

.doc-nav a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.9rem;
  border-left: 0.3rem solid transparent;
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink-2);
}

.doc-nav a:hover {
  color: var(--ink);
}

.doc-nav a[aria-current="page"] {
  border-left-color: var(--blue);
  color: var(--ink);
  font-weight: 600;
}

.doc {
  min-width: 0;
  max-width: 44rem;
}

.doc h1 {
  font-size: var(--step-3);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.doc-lede {
  margin-top: 1rem;
  font-size: var(--step-1);
  line-height: 1.42;
  color: var(--ink-2);
  text-wrap: pretty;
}

.doc h2 {
  margin-top: 3.25rem;
  font-size: var(--step-2);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  scroll-margin-top: 5.5rem;
}

.doc h2::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 0.6rem;
  margin-bottom: 1rem;
  border-radius: 0.3rem;
  background: var(--blue);
}

.doc h2:nth-of-type(4n + 2)::before {
  background: var(--red);
}
.doc h2:nth-of-type(4n + 3)::before {
  background: var(--yellow);
}
.doc h2:nth-of-type(4n + 4)::before {
  background: var(--green);
}

.doc p,
.doc ul,
.doc ol,
.doc .term,
.doc .table-scroll {
  margin-top: 1.1rem;
}

.doc ul,
.doc ol {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.4rem;
}

.doc ul {
  list-style: disc;
}

.doc ol {
  list-style: decimal;
}

.doc li::marker {
  color: var(--ink-2);
}

.doc a {
  font-weight: 500;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1.5px;
}

.doc a:hover {
  text-decoration-thickness: 2.5px;
}

.doc code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.doc .term {
  box-shadow: 6px 6px 0 var(--blue);
  margin-right: 6px;
}

.callout {
  padding: 1.1rem 1.4rem;
  border: 1.5px solid var(--line);
  border-bottom: 6px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-scroll {
  overflow-x: auto;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 1.5px solid var(--line);
  text-align: left;
}

.doc thead th {
  padding: 0 1rem 0.5rem 0;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-2);
}

.doc tbody th,
.doc td {
  padding: 0.7rem 1rem 0.7rem 0;
  border-top: 1.5px solid var(--line);
  vertical-align: top;
  font-weight: 400;
}

.doc tbody th {
  font-weight: 600;
}

.doc-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid var(--line);
  font-weight: 600;
}
