/* Dawn documentation — the landing page's surface, with the sidebar as a rail. */

.docs-shell {
    display: flex;
    align-items: flex-start;
    gap: 3.5rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 7.5rem 1.5rem 5rem;
}

.docs-nav {
    position: sticky;
    top: 1.5rem;
    width: 15rem;
    flex-shrink: 0;
    padding-right: 1.5rem;
    border-right: 1px solid var(--line);
}

.docs-nav .brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.35rem;
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--foreground);
}

.docs-nav .brand img {
    width: 1.35rem;
    height: 1.35rem;
    object-fit: contain;
}

.docs-nav .brand span {
    color: var(--ash);
    font-style: italic;
}

.docs-nav a:not(.brand) {
    display: block;
    padding: 0.38rem 0.65rem;
    margin-bottom: 1px;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    color: oklch(from var(--foreground) l c h / 0.5);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.docs-nav a:not(.brand):hover {
    color: var(--foreground);
    background: oklch(from var(--foreground) l c h / 0.05);
}

.docs {
    min-width: 0;
    flex: 1;
    max-width: 46rem;
}

.docs h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--foreground);
}

.docs .updated {
    margin-top: 0.9rem;
    padding-bottom: 1.75rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
    color: oklch(from var(--foreground) l c h / 0.42);
}

.docs h2 {
    margin-top: 3.4rem;
    margin-bottom: 0.9rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--foreground);
    scroll-margin-top: 6.5rem;
}

.docs h3 {
    margin-top: 2.2rem;
    margin-bottom: 0.6rem;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--bone);
    scroll-margin-top: 6.5rem;
}

.docs p,
.docs li {
    font-size: 0.95rem;
    line-height: 1.8;
    color: oklch(from var(--foreground) l c h / 0.62);
}

.docs p {
    margin-bottom: 1rem;
}

.docs ul,
.docs ol {
    margin: 0 0 1.15rem;
    padding-left: 1.3rem;
}

.docs li {
    margin-bottom: 0.4rem;
}

.docs li::marker {
    color: var(--ash);
}

.docs strong {
    color: var(--bone);
    font-weight: 600;
}

.docs a {
    color: var(--bone);
    text-decoration: underline;
    text-decoration-color: oklch(from var(--foreground) l c h / 0.25);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.docs a:hover {
    text-decoration-color: oklch(var(--main-l) var(--main-c) var(--main-h) / 0.7);
}

.docs code {
    font-family: var(--mono);
    font-size: 0.84em;
    padding: 0.08rem 0.34rem;
    border-radius: 0.3rem;
    background: oklch(from var(--foreground) l c h / 0.06);
    color: var(--bone);
    white-space: nowrap;
}

.docs pre {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    border-radius: 0.9rem;
    border: 1px solid var(--line);
    background: #0e0e0e;
}

.docs pre code {
    background: none;
    border-radius: 0;
    padding: 0;
    white-space: pre;
    font-size: 0.82rem;
    line-height: 1.7;
    color: oklch(from var(--foreground) l c h / 0.76);
}

.docs pre code .lm { color: #e6e6e6; }               /* function/lib */
.docs pre code .kw { color: #cfcfcf; }               /* keyword */
.docs pre code .str { color: #b8b8b8; }              /* string */
.docs pre code .cmt { color: rgba(255, 255, 255, 0.34); font-style: italic; } /* comment */
.docs pre code .num { color: #a8a8a8; }              /* number */

.docs table {
    width: 100%;
    margin: 0 0 1.25rem;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.docs th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--bone);
    background: oklch(from var(--foreground) l c h / 0.03);
    border-bottom: 1px solid var(--line-2);
}

.docs td {
    padding: 0.6rem 0.75rem;
    vertical-align: top;
    color: oklch(from var(--foreground) l c h / 0.6);
    border-bottom: 1px solid var(--line);
}

.docs td code {
    white-space: nowrap;
}

.docs .note {
    margin: 0 0 1.25rem;
    padding: 0.9rem 1.1rem;
    border-left: 2px solid var(--ember);
    border-radius: 0.25rem 0.75rem 0.75rem 0.25rem;
    background: oklch(from var(--foreground) l c h / 0.035);
    font-size: 0.9rem;
    line-height: 1.75;
    color: oklch(from var(--foreground) l c h / 0.62);
}

.docs .note strong {
    color: var(--bone);
}

.docs-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
    color: oklch(from var(--foreground) l c h / 0.4);
}

.docs-footer a {
    color: oklch(from var(--foreground) l c h / 0.55);
    transition: color 0.2s ease;
}

.docs-footer a:hover {
    color: var(--foreground);
}

@media (max-width: 900px) {
    .docs-shell {
        flex-direction: column;
        align-items: stretch;
        gap: 1.75rem;
        padding: 0.6rem max(1.25rem, env(safe-area-inset-left)) calc(3.5rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-right));
    }

    .docs {
        width: 100%;
        max-width: 46rem;
    }

    /* The section list turns into a sticky rail you swipe sideways, instead of
       a wall of wrapped links that pushes the article a screen down. */
    .docs-nav {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.35rem;
        width: auto;
        margin: 0 -1.25rem;
        padding: 0.65rem 1.25rem;
        border-right: none;
        border-bottom: 1px solid var(--line);
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        background: oklch(from var(--background) l c h / 0.92);
        backdrop-filter: blur(14px) saturate(1.2);
        -webkit-backdrop-filter: blur(14px) saturate(1.2);
    }

    .docs-nav::-webkit-scrollbar {
        display: none;
    }

    .docs-nav .brand {
        flex: 0 0 auto;
        width: auto;
        margin-bottom: 0;
        padding-right: 0.7rem;
        font-size: 1.15rem;
    }

    .docs-nav a:not(.brand) {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        min-height: 2.5rem;
        margin-bottom: 0;
        padding: 0 0.85rem;
        border: 1px solid var(--line);
        border-radius: 9999px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .docs h2,
    .docs h3 {
        scroll-margin-top: 4.5rem;
    }

    .docs h1 {
        font-size: 2.1rem;
    }

    .docs h2 {
        margin-top: 2.6rem;
        padding-top: 1.4rem;
    }
}

@media (max-width: 600px) {
    .docs h1 {
        font-size: 1.95rem;
    }

    .docs code {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 760px) {
    .docs table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .docs td,
    .docs th {
        min-width: 8.5rem;
    }
}
