.DocsPage {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: clamp(1.5rem, 1rem + 3vw, 4rem);
    width: min(100% - 2 * var(--PageGutter), var(--ContentWidth));
    margin-inline: auto;
    padding-top: clamp(6rem, 5rem + 4vw, 8rem);
    padding-bottom: var(--SectionSpace);
}

.DocsSide {
    position: sticky;
    top: 6rem;
    align-self: start;
    max-height: calc(100dvh - 7.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: var(--SpaceTiny);
    scrollbar-width: thin;
    scrollbar-color: var(--BorderStrong) transparent;
}

.DocsSide h2 {
    margin: var(--SpaceMedium) 0 var(--SpaceTiny);
    font-size: var(--SizeMicro);
    font-weight: var(--WeightBold);
    letter-spacing: var(--TrackingWide);
    text-transform: uppercase;
    color: var(--InkSubtle);
}

.DocsSide h2:first-child {
    margin-top: 0;
}

.DocsSide ul {
    display: grid;
    gap: 1px;
    padding: 0;
    list-style: none;
}

.DocsSide a {
    display: block;
    padding: 0.3125rem 0.75rem;
    border-inline-start: 1px solid var(--BorderDefault);
    font-size: var(--SizeSmall);
    color: var(--InkMuted);
    transition:
        color var(--DurationFast) var(--EaseOut),
        border-color var(--DurationFast) var(--EaseOut),
        background-color var(--DurationFast) var(--EaseOut);
}

.DocsSide a:hover {
    color: var(--InkStrong);
    background: rgb(255 255 255 / 0.03);
}

.DocsSide a[aria-current="true"] {
    border-color: var(--AccentBright);
    color: var(--InkWhite);
    background: var(--AccentSoft);
}

.DocsBody {
    min-width: 0;
    max-width: 52rem;
}

.DocsIntro {
    margin-bottom: var(--SpaceGiant);
}

.DocsEyebrow {
    display: inline-block;
    margin-bottom: var(--SpaceBase);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--BorderDefault);
    border-radius: var(--RadiusRound);
    font-size: var(--SizeCaption);
    color: var(--InkMuted);
    background: var(--SurfaceRaised);
}

.DocsIntro h1 {
    font-size: var(--SizeDisplay);
    font-weight: var(--WeightHeavy);
    line-height: var(--LeadingTight);
    letter-spacing: var(--TrackingTight);
    color: var(--InkWhite);
}

.DocsIntro p {
    max-width: 38rem;
    margin-top: var(--SpaceBase);
    font-size: var(--SizeLead);
    line-height: var(--LeadingBody);
    color: var(--InkMuted);
}

.DocSection {
    padding-block: var(--SpaceHuge);
    border-top: 1px solid var(--BorderSubtle);
    scroll-margin-top: 5rem;
}

.DocSection h2 {
    margin-bottom: var(--SpaceBase);
    font-size: var(--SizeSubtitle);
    font-weight: var(--WeightBold);
    line-height: var(--LeadingSnug);
    letter-spacing: var(--TrackingSnug);
    color: var(--InkWhite);
}

.DocSection h3 {
    margin: var(--SpaceLarge) 0 var(--SpaceSmall);
    font-size: var(--SizeHeading);
    font-weight: var(--WeightBold);
    color: var(--InkStrong);
    scroll-margin-top: 5rem;
}

.DocSection p {
    margin-bottom: var(--SpaceSmall);
    line-height: var(--LeadingBody);
    color: var(--InkMuted);
    text-wrap: pretty;
}

.DocSection strong {
    font-weight: var(--WeightBold);
    color: var(--InkStrong);
}

.DocSection a:not(.Button) {
    color: var(--AccentBright);
    text-underline-offset: 0.2em;
}

.DocSection a:not(.Button):hover {
    text-decoration: underline;
}

.DocSection code,
.DocCode {
    font-family: var(--FontMono);
    font-size: 0.875em;
}

.DocSection p code,
.DocList dd code {
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--BorderSubtle);
    border-radius: 0.3125rem;
    color: var(--InkStrong);
    background: var(--SurfaceHover);
}

.DocList {
    display: grid;
    margin: var(--SpaceSmall) 0 var(--SpaceMedium);
    border: 1px solid var(--BorderDefault);
    border-radius: var(--RadiusMedium);
    overflow: hidden;
    background: var(--SurfaceBase);
    box-shadow: var(--InsetHighlight);
}

.DocRow {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    gap: var(--SpaceBase);
    padding: 0.875rem 1.125rem;
    border-top: 1px solid var(--BorderSubtle);
    transition: background-color var(--DurationFast) var(--EaseOut);
}

.DocRow:first-child {
    border-top: 0;
}

.DocRow:hover {
    background: var(--SurfaceHover);
}

.DocRow dt {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.DocRow dt code {
    font-weight: var(--WeightMedium);
    color: var(--InkWhite);
    overflow-wrap: anywhere;
}

.DocTag {
    padding: 0.0625rem 0.5rem;
    border-radius: var(--RadiusRound);
    font-size: var(--SizeMicro);
    font-weight: var(--WeightMedium);
    color: var(--AccentBright);
    background: var(--AccentSoft);
}

.DocRow dd {
    min-width: 0;
    font-size: var(--SizeSmall);
    line-height: var(--LeadingBody);
    color: var(--InkMuted);
    overflow-wrap: anywhere;
}

.DocSteps {
    counter-reset: step;
}

.DocSteps .DocRow dt {
    counter-increment: step;
}

.DocSteps .DocRow dt::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: var(--RadiusRound);
    font-size: var(--SizeMicro);
    font-weight: var(--WeightBold);
    color: var(--InkInverse);
    background: var(--AccentBright);
}

.DocNote {
    margin: var(--SpaceBase) 0;
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--BorderDefault);
    border-inline-start: 2px solid var(--AccentBlue);
    border-radius: var(--RadiusSmall);
    font-size: var(--SizeSmall);
    line-height: var(--LeadingBody);
    color: var(--InkMuted);
    background: var(--SurfaceRaised);
}

.DocBlock {
    margin: var(--SpaceBase) 0 var(--SpaceMedium);
    padding: 1rem 1.125rem;
    overflow-x: auto;
    border: 1px solid var(--BorderDefault);
    border-radius: var(--RadiusMedium);
    background: var(--SurfaceRaised);
    box-shadow: var(--InsetHighlight);
    scrollbar-width: thin;
}

.DocBlock code {
    display: block;
    font-size: var(--SizeSmall);
    line-height: 1.7;
    white-space: pre;
    color: var(--InkStrong);
}

.DocsToggle {
    display: none;
}

@media (max-width: 62rem) {
    .DocsPage {
        grid-template-columns: minmax(0, 1fr);
    }

    .DocsSide {
        position: static;
        max-height: none;
        padding: var(--SpaceBase);
        border: 1px solid var(--BorderDefault);
        border-radius: var(--RadiusMedium);
        background: var(--SurfaceBase);
    }

    .DocsSide ul {
        grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    }
}

@media (max-width: 40rem) {
    .DocRow {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }
}
