/* ==========================================================================
   ink.css — the fine-press edition
   Monochrome ink-on-paper design system · Cormorant Garamond + Courier Prime
   Self-contained: replaces site.css + docs.css on the redesigned pages only.
   Keeps the class contract of assets/js/site.js (theme toggle, copy buttons,
   docs sidebar, heading anchors, progress bar).
   Themes via [data-theme="light"|"dark"] on <html>.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
    color-scheme: light;

    /* paper & ink */
    --paper: #f7f5f0;
    --paper-raised: #fdfcfa;
    --paper-recessed: #efece4;
    --ink: #171512;
    --ink-soft: #3c3833;
    --ink-mute: #6d675e;
    --ink-faint: #98918a;
    --hairline: #d9d4ca;
    --hairline-strong: #171512;

    /* code plates: always dark, both themes */
    --plate: #171512;
    --plate-edge: #171512;
    --plate-text: #eae6dd;
    --plate-comment: #857e71;
    --plate-dim: #b3ac9f;
    --plate-bright: #ffffff;

    --font-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino", Georgia, serif;
    --font-mono: "Courier Prime", "Courier New", Courier, monospace;

    --measure: 72ch;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --paper: #121110;
    --paper-raised: #191816;
    --paper-recessed: #0c0b0a;
    --ink: #e9e5dc;
    --ink-soft: #cfcabf;
    --ink-mute: #948f85;
    --ink-faint: #6b665e;
    --hairline: #2e2c28;
    --hairline-strong: #e9e5dc;

    --plate: #0a0908;
    --plate-edge: #2e2c28;
    --plate-text: #ddd8cd;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-serif);
    font-size: 1.170rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

img,
video {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink);
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--ink-faint);
    text-underline-offset: 0.22em;
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
    text-decoration-color: currentColor;
}

::selection {
    background: var(--ink);
    color: var(--paper);
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

hr {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin: 2.5rem 0;
}

/* small caps utility voice — letterspaced monospace labels */
.smallcaps,
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ---------- Heading anchors (site.js) ---------- */

.heading-anchor {
    margin-left: 0.45rem;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 0.6em;
    font-weight: 400;
    opacity: 0;
    text-decoration: none;
    vertical-align: 0.15em;
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus-visible {
    opacity: 1;
}

/* ---------- Freshness / scope line on guides ---------- */

.guide-freshness {
    display: block;
    margin: 0 0 2.25rem;
    padding: 0.55rem 0 0;
    border-top: 1px solid var(--hairline);
    color: var(--ink-mute);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- Inline code & code plates ---------- */

code {
    font-family: var(--font-mono);
    font-size: 0.86em;
}

:not(pre) > code {
    padding: 0.05em 0.3em;
    background: var(--paper-recessed);
    border: 1px solid var(--hairline);
    color: var(--ink-soft);
    overflow-wrap: break-word;
}

pre {
    background: var(--plate);
    color: var(--plate-text);
    border: 1px solid var(--plate-edge);
    padding: 1rem 1.2rem;
    overflow-x: auto;
    line-height: 1.6;
    font-size: 0.86rem;
    tab-size: 4;
    margin: 0 0 1.2rem;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    display: block;
    white-space: pre;
}

/* JS-injected wrapper for copy buttons (site.js) */
.code-block {
    position: relative;
    margin: 0 0 1.2rem;
}

.code-block > pre {
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--plate-text);
    background: transparent;
    border: 1px solid var(--plate-comment);
    padding: 0.22rem 0.6rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.code-block:hover .copy-btn,
.copy-btn:focus-visible {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--plate-text);
    color: var(--plate);
}

.copy-btn.copied {
    opacity: 1;
    background: var(--plate-text);
    color: var(--plate);
}

@media (hover: none) {
    .copy-btn {
        opacity: 0.75;
    }
}

/* Prism tokens — engraving grays, no color */
.token.comment { color: var(--plate-comment); font-style: italic; }
.token.string { color: var(--plate-dim); }
.token.keyword,
.token.builtin { color: var(--plate-bright); font-weight: 700; }
.token.function { color: var(--plate-text); font-weight: 700; }
.token.number { color: var(--plate-bright); }
.token.operator,
.token.punctuation { color: var(--plate-dim); background: none; }
.token.variable,
.token.parameter { color: var(--plate-text); }

pre::selection, pre *::selection {
    background: var(--plate-text);
    color: var(--plate);
}

/* ---------- Callouts — distinguished by rule weight, not color ---------- */

.note,
.important,
.warning {
    padding: 0.9rem 1.2rem;
    margin: 1.5rem 0;
    background: var(--paper-raised);
    border: 1px solid var(--hairline);
}

.note > :first-child,
.important > :first-child,
.warning > :first-child {
    margin-top: 0;
}

.note > :last-child,
.important > :last-child,
.warning > :last-child {
    margin-bottom: 0;
}

.note {
    border-left: 3px solid var(--ink-faint);
}

.important {
    border-left: 3px double var(--ink);
    border-left-style: double;
    border-left-width: 7px;
}

.warning {
    border: 1px solid var(--ink);
    border-left: 7px solid var(--ink);
}

.callout-title {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 0.4rem;
}

/* ---------- Tables ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.98em;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--hairline);
    vertical-align: top;
}

th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border-top: 2px solid var(--hairline-strong);
    border-bottom: 1px solid var(--hairline-strong);
}

tr:last-child td {
    border-bottom: 1px solid var(--hairline-strong);
}

.table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.table-wrap > table {
    margin: 0;
}

/* ---------- Theme toggle (site.js) ---------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    color: var(--ink-mute);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.theme-toggle svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* show the icon for the mode you would switch to */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Return-home link at foot of guides ---------- */

.home-link {
    margin: 3.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hairline);
}

.home-link a {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-mute);
    border: 1px solid var(--hairline);
    padding: 0.55rem 1rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.home-link a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ==========================================================================
   The title page (homepage)
   ========================================================================== */

.home-wrap {
    max-width: 46rem;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 3rem;
}

/* ---------- Masthead ---------- */

.masthead {
    text-align: center;
    margin-bottom: 3rem;
}

.masthead-rule {
    border: 0;
    border-top: 1px solid var(--hairline-strong);
    margin: 0;
}

.masthead-rule + .masthead-rule {
    margin-top: 3px;
}

.masthead-inner {
    padding: 2.25rem 0 2rem;
}

.masthead .eyebrow {
    display: block;
    color: var(--ink-mute);
    margin: 0 0 1.4rem;
}

.masthead h1 {
    margin: 0;
    font-size: clamp(3rem, 9vw, 4.75rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.05;
}

.masthead .tagline {
    margin: 0.9rem 0 0;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--ink-soft);
}

.masthead .seal {
    display: block;
    margin: 1.6rem auto 0;
}

.seal {
    height: 52px;
    width: auto;
    flex: none;
    filter: grayscale(1) contrast(1.05);
    opacity: 0.85;
}

[data-theme="dark"] .seal {
    filter: grayscale(1) invert(0.9) contrast(1.1);
    opacity: 0.8;
}

/* floating theme toggle, pinned to the content column's right edge */
.home-wrap {
    position: relative;
}

.theme-toggle-floating {
    position: absolute;
    top: 4.1rem;
    right: 1.5rem;
    z-index: 40;
    background: var(--paper);
}

/* ---------- Contents sections ---------- */

.toc-part {
    margin-bottom: 2.75rem;
}

.toc-part-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 0 0 1.1rem;
}

.toc-part-head .numeral {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-size: 1.6rem;
    color: var(--ink-faint);
    min-width: 2.1rem;
}

.toc-part-head h2 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.toc-part-head::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--hairline);
    transform: translateY(-0.3em);
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-entry {
    display: block;
    padding: 0.85rem 0.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px dotted var(--hairline);
}

.toc-list li:last-child .toc-entry {
    border-bottom: none;
}

.toc-entry-line {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
}

.toc-entry .entry-no {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    min-width: 1.6rem;
    transition: color 0.15s ease;
}

.toc-entry .entry-title {
    font-size: 1.42rem;
    font-weight: 600;
    line-height: 1.25;
    transition: font-style 0s;
}

.toc-entry .entry-leader {
    flex: 1;
    min-width: 1.5rem;
    border-bottom: 1px dotted var(--ink-faint);
    opacity: 0.55;
    transform: translateY(-0.28em);
    transition: opacity 0.15s ease;
}

.toc-entry .entry-mark {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--ink-faint);
    transition: color 0.15s ease, transform 0.15s ease;
}

.toc-entry .entry-desc {
    display: block;
    margin: 0.25rem 0 0 2.45rem;
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.5;
    color: var(--ink-mute);
    max-width: 56ch;
}

.toc-entry:hover .entry-title {
    font-style: italic;
}

.toc-entry:hover .entry-no,
.toc-entry:hover .entry-mark {
    color: var(--ink);
}

.toc-entry:hover .entry-leader {
    opacity: 1;
}

.toc-entry:hover .entry-mark {
    transform: translateX(4px);
}

/* errata (deprecated) */
.errata {
    margin: 0;
    font-size: 0.98rem;
    font-style: italic;
    color: var(--ink-mute);
}

.errata a {
    color: inherit;
}

/* ---------- Colophon (footer) ---------- */

.colophon {
    margin-top: 4rem;
    text-align: center;
}

.colophon-rule {
    border: 0;
    border-top: 1px solid var(--hairline-strong);
    margin: 0 0 3px;
}

.colophon-rule + .colophon-rule {
    margin: 0;
}

.colophon .printer-mark {
    display: inline-block;
    font-size: 1.15em;
    line-height: 1;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.15s ease;
}

.colophon .printer-mark:hover {
    color: var(--ink);
    transform: translateY(-2px);
}

.colophon p {
    margin: 0 0 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.colophon p:first-of-type {
    margin-top: 1.6rem;
}

.colophon .set-in {
    color: var(--ink-faint);
    letter-spacing: 0.12em;
    text-transform: none;
    font-style: normal;
}

/* ---------- Title-page entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
    .masthead,
    .toc-part,
    .colophon {
        animation: ink-settle 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .toc-part:nth-of-type(1) { animation-delay: 0.1s; }
    .toc-part:nth-of-type(2) { animation-delay: 0.18s; }
    .toc-part:nth-of-type(3) { animation-delay: 0.26s; }
    .toc-part:nth-of-type(4) { animation-delay: 0.34s; }
    .toc-part:nth-of-type(5) { animation-delay: 0.42s; }
    .colophon { animation-delay: 0.5s; }

    @keyframes ink-settle {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }
}

/* ==========================================================================
   Document pages (guides)
   ========================================================================== */

/* ---------- Scroll progress (site.js) ---------- */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    z-index: 60;
    pointer-events: none;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--ink);
}

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 3.4rem;
    padding: 0 1.25rem;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--hairline);
}

.topbar-home {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-soft);
    white-space: nowrap;
}

.topbar-home:hover {
    color: var(--ink);
}

.topbar-home::before {
    content: "☜";
    margin-right: 0.5rem;
    color: var(--ink-faint);
}

.topbar-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    height: 2.1rem;
    padding: 0 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--hairline);
    cursor: pointer;
}

.toc-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.toc-toggle svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------- Shell: sidebar + content ---------- */

.docs-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    gap: 3rem;
}

.docs-sidebar {
    position: sticky;
    top: 3.4rem;
    align-self: start;
    height: calc(100vh - 3.4rem);
    overflow-y: auto;
    padding: 2rem 1rem 2rem 0;
    border-right: 1px solid var(--hairline);
    scrollbar-width: thin;
}

.docs-sidebar h2 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 1.5rem;
}

.nav-section {
    margin-bottom: 1.6rem;
}

.nav-section h3 {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 0.5rem;
}

.nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-section li {
    margin: 0;
}

.nav-section a {
    display: block;
    padding: 0.26rem 0 0.26rem 0.85rem;
    font-size: 1.02rem;
    line-height: 1.4;
    color: var(--ink-soft);
    text-decoration: none;
    border-left: 1px solid var(--hairline);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-section a:hover {
    color: var(--ink);
    border-left-color: var(--ink-mute);
}

.nav-section a.active {
    color: var(--ink);
    font-style: italic;
    border-left: 2px solid var(--ink);
    padding-left: calc(0.85rem - 1px);
}

.sidebar-backdrop {
    display: none;
}

/* ---------- Content ---------- */

.docs-content {
    max-width: var(--measure);
    padding: 2.75rem 0 4rem;
    min-width: 0;
}

.docs-content h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 600;
    line-height: 1.12;
}

.docs-content .lead {
    font-size: 1.28rem;
    font-style: italic;
    color: var(--ink-mute);
    margin: 0 0 2rem;
}

.docs-content h2 {
    font-size: 1.7rem;
    margin: 3rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hairline);
}

.docs-content h3 {
    font-size: 1.35rem;
    margin: 2.25rem 0 0.75rem;
}

.docs-content h4 {
    font-size: 1.15rem;
    margin: 1.75rem 0 0.6rem;
}

/* anchor offset below sticky topbar */
.docs-content [id] {
    scroll-margin-top: 4.5rem;
}

.docs-content p {
    margin: 0 0 1rem;
}

.docs-content ul,
.docs-content ol {
    margin: 0 0 1.2rem;
    padding-left: 1.6rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
}

.docs-content li > p {
    margin-bottom: 0.55rem;
}

.docs-content li::marker {
    color: var(--ink-mute);
}

/* Step numbers in headings — folio style */
.section-number {
    display: inline-block;
    margin-right: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.62em;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--ink-mute);
    border: 1px solid var(--ink-mute);
    padding: 0.12em 0.5em;
    vertical-align: 0.22em;
}

/* Step labels above command blocks (quick-reference pages) */
.section-title {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 1.25rem 0 0.5rem;
}

/* Caption note directly under a code block */
.code-caption {
    font-size: 0.98rem;
    color: var(--ink-mute);
    font-style: italic;
    margin-top: -0.55rem;
}

/* Footnote / attribution block at end of guides */
.footnote {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hairline);
    color: var(--ink-mute);
    font-size: 1rem;
    font-style: italic;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .docs-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .toc-toggle {
        display: inline-flex;
    }

    .docs-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 80;
        width: min(20rem, 85vw);
        height: 100vh;
        height: 100dvh;
        background: var(--paper);
        border-left: 1px solid var(--hairline-strong);
        border-right: none;
        padding: 1.75rem 1.4rem 2rem;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        visibility: hidden;
    }

    .docs-sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(10, 9, 8, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .docs-content {
        padding-top: 2rem;
    }
}

@media (max-width: 640px) {
    .home-wrap {
        padding: 2rem 1.1rem 2.5rem;
    }

    .theme-toggle-floating {
        top: 2.7rem;
        right: 1.1rem;
    }

    .masthead-inner {
        padding: 1.75rem 0 1.5rem;
    }

    .masthead h1 {
        font-size: 2.7rem;
    }

    .masthead .tagline {
        font-size: 1.1rem;
    }

    .toc-entry .entry-leader,
    .toc-entry .entry-mark {
        display: none;
    }

    .toc-entry .entry-title {
        font-size: 1.28rem;
    }

    .toc-entry .entry-desc {
        margin-left: 2.45rem;
    }

    .topbar {
        padding: 0 0.9rem;
    }

    .topbar-title {
        display: none;
    }

    .docs-shell {
        padding: 0 1rem;
    }

    .docs-content h1 {
        font-size: 2rem;
        overflow-wrap: break-word;
    }

    .docs-content h2 {
        font-size: 1.45rem;
        margin-top: 2.5rem;
    }

    .docs-content h3 {
        font-size: 1.2rem;
    }

    pre {
        font-size: 0.8rem;
        padding: 0.8rem 0.95rem;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ---------- Print ---------- */

@media print {
    .topbar,
    .progress-bar,
    .docs-sidebar,
    .sidebar-backdrop,
    .copy-btn,
    .home-link,
    .theme-toggle {
        display: none !important;
    }

    .docs-shell {
        display: block;
        max-width: 100%;
        padding: 0;
    }

    body {
        font-size: 11pt;
        background: #fff;
        color: #000;
    }

    pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        border: 1px solid #999;
        background: #fff;
        color: #000;
    }

    .note, .important, .warning {
        break-inside: avoid;
    }
}
