/* PoseLab documentation
 * A read-the-docs style manual sharing the marketing/portal design language:
 * paper/ink palette, D-DIN, orange accents, a dark numbered sidebar, a light
 * prose column, and a right-hand "on this page" rail. Self-contained (tokens
 * inlined) so every /docs page links only this file. Fonts resolve from the
 * site root (/fonts), matching the portal.
 */

@font-face {
    font-family: "D-DIN";
    src: url("/fonts/D-DIN.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "D-DIN";
    src: url("/fonts/D-DIN-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: "D-DIN Mono";
    src: url("/fonts/D-DINExp.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

:root {
    --paper: #f4f1e9;
    --paper2: #ebe6da;
    --ink: #20211f;
    --muted: #686861;
    --line: #cbc5b7;
    --white: #fffdf8;
    --orange: #c4522e;
    --orange2: #9f3c1f;
    --green: #315d4a;
    --blue: #31566a;
    --red: #9f3529;
    --sidebar: #20211f;
    --code-bg: #26272400;
    --sans:
        "D-DIN", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --mono: "D-DIN Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
        monospace;
}

* {
    box-sizing: border-box;
}
html {
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--paper);
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 15px/1.62 var(--sans);
    -webkit-font-smoothing: antialiased;
}
a {
    color: var(--orange2);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Shell ---------- */
.docs {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
}
/* Mobile-only scrim; kept out of the grid flow on desktop. */
.scrim {
    display: none;
}

/* ---------- Sidebar (dark, numbered nav — mirrors the portal) ---------- */
.docs-side {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    overflow-y: auto;
    border-right: 1px solid #42433f;
    color: #e8e6df;
    background: var(--sidebar);
}
.docs-side .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 6px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}
.docs-side .brand:hover {
    text-decoration: none;
}
.mark {
    width: 18px;
    height: 18px;
    border: 5px solid var(--orange);
    border-radius: 50%;
}
.side-tag {
    margin: 0 8px 26px 36px;
    color: #94968f;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.side-nav {
    display: flex;
    flex-direction: column;
}
.side-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 2px 0;
    padding: 9px 11px;
    border-radius: 4px;
    color: #aeb0a9;
    font-weight: 600;
    text-decoration: none;
}
.side-nav a:hover {
    color: #fff;
    background: #2f302c;
    text-decoration: none;
}
.side-nav a.active {
    color: #fff;
    background: #333430;
}
.side-nav a span {
    width: 19px;
    color: #e18a68;
    font-family: var(--serif);
    font-size: 16px;
}
.docs-side-foot {
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top: 1px solid #444540;
    color: #94968f;
    font-size: 12px;
}
.docs-side-foot a {
    display: block;
    margin-top: 8px;
    color: #cacbc5;
}
.docs-side-foot a:hover {
    color: #fff;
}

/* ---------- Main column ---------- */
.docs-main {
    min-width: 0;
}
.docs-top {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 clamp(20px, 4vw, 54px);
    border-bottom: 1px solid var(--line);
    background: rgba(244, 241, 233, 0.92);
    backdrop-filter: saturate(1.1) blur(6px);
}
.docs-top .crumbs {
    color: var(--muted);
    font-size: 13px;
}
.docs-top .crumbs b {
    color: var(--ink);
}
.docs-top .top-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-links a {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.top-links a:hover {
    background: var(--white);
    text-decoration: none;
}
.top-links a.orange {
    border-color: var(--orange);
    color: #fff;
    background: var(--orange);
}
.top-links a.orange:hover {
    background: var(--orange2);
}
.menu-btn {
    display: none;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
}

/* content grid: prose + on-this-page rail */
.docs-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 40px;
    max-width: 1180px;
    padding: 46px clamp(20px, 4vw, 54px) 96px;
}
.doc-content {
    min-width: 0;
    max-width: 760px;
}

/* ---------- Prose ---------- */
.eyebrow {
    margin: 0 0 12px;
    color: var(--orange2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.doc-content h1 {
    margin: 0 0 14px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(34px, 5vw, 50px);
    line-height: 1.04;
    letter-spacing: -0.03em;
}
.lede {
    margin: 0 0 34px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}
.doc-content h2 {
    margin: 46px 0 14px;
    padding-top: 10px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 27px;
    line-height: 1.12;
    letter-spacing: -0.02em;
    scroll-margin-top: 78px;
}
.doc-content h3 {
    margin: 30px 0 10px;
    font-size: 17px;
    font-weight: 700;
    scroll-margin-top: 78px;
}
.doc-content p,
.doc-content li {
    color: #33342f;
}
.doc-content ul,
.doc-content ol {
    padding-left: 22px;
}
.doc-content li {
    margin: 6px 0;
}
.doc-content li::marker {
    color: var(--muted);
}
.doc-content strong {
    font-weight: 700;
}
.doc-content hr {
    margin: 44px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

/* section anchor link on hover */
.doc-content h2,
.doc-content h3 {
    position: relative;
}
.anchor {
    position: absolute;
    left: -22px;
    opacity: 0;
    color: var(--muted);
    font-weight: 400;
    text-decoration: none;
    transition: opacity 0.12s ease;
}
h2:hover .anchor,
h3:hover .anchor {
    opacity: 1;
}

/* ---------- Code ---------- */
code {
    padding: 1.5px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper2);
    font-family: var(--mono);
    font-size: 0.86em;
}
pre {
    margin: 18px 0;
    padding: 16px 18px;
    overflow-x: auto;
    border: 1px solid #3a3b37;
    border-radius: 8px;
    color: #e8e6df;
    background: #26272400;
    background: #262724;
    line-height: 1.5;
}
pre code {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 12.6px;
}
pre .c {
    color: #8f938a;
} /* comment  */
pre .k {
    color: #e18a68;
} /* keyword  */
pre .s {
    color: #a9c7a0;
} /* string   */
pre .n {
    color: #d9b26a;
} /* number   */
pre .t {
    color: #7fb2c6;
} /* type/def */

/* ---------- Callouts ---------- */
.callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    margin: 22px 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 6px;
    background: var(--white);
}
.callout p {
    margin: 0;
}
.callout p + p {
    margin-top: 8px;
}
.callout .ico {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.5;
}
.callout .lbl {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.callout.note {
    border-left-color: var(--blue);
}
.callout.note .ico,
.callout.note .lbl {
    color: var(--blue);
}
.callout.tip {
    border-left-color: var(--green);
}
.callout.tip .ico,
.callout.tip .lbl {
    color: var(--green);
}
.callout.warn {
    border-left-color: var(--orange);
}
.callout.warn .ico,
.callout.warn .lbl {
    color: var(--orange2);
}

/* ---------- Tables ---------- */
.doc-content table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 14px;
}
.doc-content th,
.doc-content td {
    padding: 10px 13px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.doc-content th {
    color: var(--muted);
    background: var(--paper2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.doc-content td code {
    white-space: nowrap;
}

/* ---------- Cards (getting started / examples) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.card {
    display: block;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: inherit;
    background: var(--white);
    text-decoration: none;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--orange);
    text-decoration: none;
}
.card .num {
    color: var(--orange2);
    font-family: var(--serif);
    font-size: 22px;
}
.card b {
    display: block;
    margin: 8px 0 6px;
    font-size: 16px;
}
.card small {
    color: var(--muted);
}

/* ---------- Page nav (prev / next) ---------- */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 56px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}
.page-nav a {
    max-width: 48%;
    padding: 13px 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: inherit;
    background: var(--white);
}
.page-nav a:hover {
    border-color: var(--orange);
    text-decoration: none;
}
.page-nav small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.page-nav b {
    font-size: 15px;
}
.page-nav .next {
    margin-left: auto;
    text-align: right;
}

/* ---------- On this page ---------- */
.on-page {
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}
.on-page b {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.on-page a {
    display: block;
    padding: 3px 0 3px 12px;
    border-left: 2px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}
.on-page a.sub {
    padding-left: 24px;
}
.on-page a:hover {
    color: var(--ink);
    text-decoration: none;
}
.on-page a.active {
    border-left-color: var(--orange);
    color: var(--ink);
    font-weight: 700;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .docs-body {
        grid-template-columns: minmax(0, 1fr);
    }
    .on-page {
        display: none;
    }
}
@media (max-width: 820px) {
    .docs {
        grid-template-columns: 1fr;
    }
    .docs-side {
        position: fixed;
        z-index: 40;
        width: 264px;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }
    .docs.nav-open .docs-side {
        transform: translateX(0);
    }
    .scrim {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: none;
        background: rgba(32, 33, 31, 0.4);
    }
    .docs.nav-open .scrim {
        display: block;
    }
    .menu-btn {
        display: inline-flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        transition: none !important;
    }
}
