.doc-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 223, 214, 0.96);
  box-shadow: 0 1px 0 var(--line);
}
.doc-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--nav-h);
}
.doc-nav__logo {
  display: block;
  flex: none;
  border-radius: 6px;
}
.doc-nav__logo img { width: auto; height: 3rem; }
.doc-nav__end { display: flex; gap: 0.5rem; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
.doc {
  flex: 1 0 auto;
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--section);
}
.doc h1 {
  font-size: var(--fs-xl);
  font-weight: 750;
  font-stretch: 85%;
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.doc__meta { margin-top: 0.75rem; color: var(--ink-soft); font-size: var(--fs-sm); }
.doc__lead { margin-top: 1.5rem; font-size: var(--fs-md); line-height: 1.5; }

.doc--404 { display: grid; align-content: center; justify-items: start; gap: 0.5rem; }
.doc__code {
  color: var(--red);
  font-size: clamp(6rem, 4rem + 12vw, 12rem);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 0.85;
  letter-spacing: -0.03em;
}
.doc__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }

.doc__toc {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-md);
  background: var(--ground-2);
}
.doc__toc h2 { font-size: var(--fs-base); font-weight: 700; }
.doc__toc ol { margin: 0.5rem 0 0; padding-left: 1.25rem; font-size: var(--fs-sm); line-height: 1.8; }
.doc__toc a { text-decoration: none; }
.doc__toc a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 0.2em; }

.doc section { margin-top: 2.5rem; }
.doc section h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.doc section p,
.doc section ul,
.doc section ol { margin-top: 0.75rem; }
.doc section ul,
.doc section ol { padding-left: 1.25rem; }
.doc section li + li { margin-top: 0.4rem; }
.doc a:not(.btn) { color: var(--red); text-underline-offset: 0.2em; }
.doc code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--ground-3);
  font-size: 0.875em;
}
.doc strong { font-weight: 650; }

.doc-foot {
  padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  background: var(--red);
  color: var(--on-red);
  font-size: 0.875rem;
}
.doc-foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.25rem; }
.doc-foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.doc-foot a {
  display: inline-block;
  padding: 0.7rem 0;
  margin: -0.7rem 0;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  background-origin: content-box;
  transition: background-size 300ms var(--ease-out);
}
.doc-foot a:hover,
.doc-foot a[aria-current="page"] { background-size: 100% 2px; }
.doc-foot .credit a { background-size: 100% 1px; font-weight: 650; }
.doc-foot .credit a:hover { background-size: 100% 2px; }
.doc-foot :focus-visible { outline-color: var(--on-red); }

@media (max-width: 47.99em) {
  .doc-nav__logo img { height: 2.5rem; }
  .doc-nav__end .btn { width: 2.5rem; padding: 0; }
}
