/* elm documentation — shared stylesheet
   Replaces normalize + stylesheet (Cayman) + github-light + modern-elm.
   Type: Bricolage Grotesque (display), Source Sans 3 (text), JetBrains Mono (code). */

@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;600&family=Overpass:wght@400;600;800&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --ink: #13212B;
    --ink-soft: #3D4F5C;
    --ink-faint: #6B7C88;
    --paper: #FAFBFC;
    --surface: #FFFFFF;
    --mist: #EEF3F7;
    --rule: #D9E1E8;
    --elm: #3274C9;
    --elm-deep: #1F5499;
    --elm-wash: rgba(50, 116, 201, 0.08);
    --leaf: #2E8A66;
    --leaf-wash: rgba(46, 138, 102, 0.09);
    --amber: #B7791F;
    --amber-wash: rgba(183, 121, 31, 0.09);
    --rust: #B4442F;
    --rust-wash: rgba(180, 68, 47, 0.08);
    --code-bg: #0F1B24;
    --code-fg: #DCE6EE;
    --code-rule: #22323E;

    --font-display: 'Overpass', 'Segoe UI', system-ui, sans-serif;
    --font-text: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    --font-code: 'Inconsolata', 'Cascadia Code', Consolas, monospace;

    --sidebar-w: 288px;
    --measure: 46rem;
    /* Code, tables and grids use the screen; running text stays at --measure. */
    --wide: 110rem;
    --radius: 6px;
    --radius-lg: 10px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #E4ECF2;
        --ink-soft: #B3C1CC;
        --ink-faint: #8495A2;
        --paper: #0E171E;
        --surface: #142029;
        --mist: #172530;
        --rule: #26384A;
        --elm: #7AB0EE;
        --elm-deep: #A5CBF5;
        --elm-wash: rgba(122, 176, 238, 0.12);
        --leaf: #5CC59A;
        --leaf-wash: rgba(92, 197, 154, 0.12);
        --amber: #E3A94F;
        --amber-wash: rgba(227, 169, 79, 0.12);
        --rust: #EE8A74;
        --rust-wash: rgba(238, 138, 116, 0.12);
        --code-bg: #091117;
        --code-rule: #1E2D39;
    }
}
:root[data-theme="dark"] {
    --ink: #E4ECF2;
    --ink-soft: #B3C1CC;
    --ink-faint: #8495A2;
    --paper: #0E171E;
    --surface: #142029;
    --mist: #172530;
    --rule: #26384A;
    --elm: #7AB0EE;
    --elm-deep: #A5CBF5;
    --elm-wash: rgba(122, 176, 238, 0.12);
    --leaf: #5CC59A;
    --leaf-wash: rgba(92, 197, 154, 0.12);
    --amber: #E3A94F;
    --amber-wash: rgba(227, 169, 79, 0.12);
    --rust: #EE8A74;
    --rust-wash: rgba(238, 138, 116, 0.12);
    --code-bg: #091117;
    --code-rule: #1E2D39;
}

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

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 1.5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.0625rem;
    line-height: 1.65;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--elm);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
a:hover { color: var(--elm-deep); text-decoration-thickness: 2px; }

:focus-visible {
    outline: 2px solid var(--elm);
    outline-offset: 2px;
    border-radius: 3px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

p, li { text-wrap: pretty; }

img { max-width: 100%; }

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

code, kbd, samp, pre { font-family: var(--font-code); }

:not(pre) > code {
    font-size: 0.95em;
    background: var(--mist);
    color: var(--ink);
    padding: 0.12em 0.38em;
    border-radius: 4px;
    border: 1px solid var(--rule);
    overflow-wrap: anywhere;
}

/* GitHub-style header anchor icons left over from the old theme */
.octicon { display: none; }
a.anchor:empty { display: none; }

/* ---------- Layout ---------- */

.layout-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    overflow-y: auto;
    background: var(--mist);
    border-right: 1px solid var(--rule);
    z-index: 1000;
    padding-bottom: 2rem;
    scrollbar-width: thin;
}

.sidebar-header {
    padding: 1.75rem 1.5rem 1.25rem;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

.sidebar-header h2 a {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--ink-soft);
    text-decoration: none;
}

/* The wordmark: "elm" set large in the display face */
.sidebar-header h2 a::before {
    content: "elm";
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink);
    line-height: 1;
}

.sidebar-header .version {
    margin-top: 0.35rem;
    font-size: 0.875rem;
    color: var(--ink-faint);
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
}

.nav-section { margin: 0 0 1.25rem; }

.nav-section h3 {
    margin: 0 0 0.35rem;
    padding: 0 0.75rem;
    font-family: var(--font-text);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ink-faint);
    letter-spacing: 0.01em;
}

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

.nav-section a {
    display: block;
    padding: 0.32rem 0.75rem;
    border-left: 2px solid transparent;
    color: var(--ink-soft);
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.nav-section a:hover {
    color: var(--ink);
    background: var(--elm-wash);
}

.nav-section a.active {
    color: var(--elm-deep);
    font-weight: 600;
    border-left-color: var(--elm);
    background: var(--elm-wash);
}

.theme-toggle {
    margin: 0 1.5rem 1rem;
    font: inherit;
    font-size: 0.85rem;
    color: var(--ink-faint);
    background: none;
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }

.layout-container > .main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    padding: 0 clamp(1rem, 4vw, 4rem) 4rem;
}

/* ---------- Hero / page heads ---------- */

.hero {
    max-width: var(--wide);
    padding: clamp(3rem, 8vw, 6rem) 0 2.5rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1rem;
}

.hero-title {
    margin: 0;
    font-size: clamp(2.4rem, 5.5vw, 4.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.02;
    max-width: 16ch;
}

.hero-subtitle {
    margin: 1.25rem 0 0;
    max-width: 38rem;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--elm); color: #fff; }
.btn-secondary { border-color: var(--rule); color: var(--ink); background: var(--surface); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

/* Session heartbeat diagram (landing page hero) */
.heartbeat {
    margin: 3rem 0 0;
    max-width: var(--wide);
    color: var(--ink-faint);
}
.heartbeat svg { display: block; width: 100%; height: auto; overflow: visible; }
.heartbeat .hb-line { fill: none; stroke: var(--rule); stroke-width: 2; }
.heartbeat .hb-pulse {
    fill: none;
    stroke: var(--elm);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1400;
    stroke-dashoffset: 0;
    animation: hb-draw 2.4s cubic-bezier(.6, 0, .2, 1) 0.3s backwards;
}
.heartbeat .hb-node { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.heartbeat .hb-node.ok { stroke: var(--leaf); }
.heartbeat .hb-call {
    font-family: var(--font-code);
    font-size: 13px;
    fill: var(--ink);
}
.heartbeat .hb-note {
    font-family: var(--font-text);
    font-size: 13px;
    fill: var(--ink-faint);
}
.heartbeat figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}
@keyframes hb-draw { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }

/* Old Cayman page header (web-api reference, legacy pages) */
.page-header {
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 4rem) 2rem;
    border-bottom: 1px solid var(--rule);
    background: var(--mist);
}
.page-header .btn { margin: 1rem 0.5rem 0 0; }
.project-name {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.project-tagline {
    margin: 0.75rem 0 0;
    font-size: 1.2rem;
    color: var(--ink-soft);
    font-weight: 400;
}
body > .main-content,
section.main-content {
    max-width: calc(var(--wide) + 8rem);
    padding: 1rem clamp(1rem, 4vw, 4rem) 4rem;
}

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

.content-section {
    max-width: var(--wide);
    padding: 3rem 0 1rem;
}
.content-section + .content-section { border-top: 1px solid var(--rule); }

.main-content > p, .main-content > ul, .main-content > ol,
.content-section > p, .content-section > ul, .content-section > ol,
.info-box p, .step p { max-width: var(--measure); }

.main-content h1 { font-size: 2.4rem; letter-spacing: -0.03em; margin: 2.5rem 0 1rem; }

.main-content h2,
.content-section h2 {
    font-size: clamp(1.75rem, 3vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 1.25rem;
}
section.main-content h2 { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

.main-content h3 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
.main-content h4 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
.main-content h5 { font-size: 1rem; margin: 1.25rem 0 0.4rem; font-family: var(--font-text); font-weight: 700; }

.main-content ul, .main-content ol { padding-left: 1.4rem; }
.main-content li { margin: 0.3rem 0; }
.main-content li::marker { color: var(--ink-faint); }

.main-content blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--rule);
    color: var(--ink-soft);
}

.main-content dl { max-width: var(--measure); margin: 0; }
.main-content dl dt {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}
.main-content dl dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.main-content dl dd { margin: 0.6rem 0 0; color: var(--ink-soft); }

/* Tables */
.main-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.main-content th, .main-content td {
    text-align: left;
    vertical-align: top;
    padding: 0.55rem 1rem 0.55rem 0;
    border-bottom: 1px solid var(--rule);
}
.main-content th {
    font-weight: 700;
    border-bottom: 2px solid var(--ink);
    white-space: nowrap;
}

/* ---------- Callouts ---------- */

.info-box,
.migration-notes,
.migration-challenge {
    max-width: var(--wide);
    margin: 1.75rem 0;
    padding: 1.1rem 1.4rem;
    background: var(--elm-wash);
    border-left: 3px solid var(--elm);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.migration-challenge { background: var(--amber-wash); border-left-color: var(--amber); }
.info-box > :first-child,
.migration-notes > :first-child,
.migration-challenge > :first-child { margin-top: 0; }
.info-box > :last-child,
.migration-notes > :last-child,
.migration-challenge > :last-child { margin-bottom: 0; }
.info-box h3, .info-box h4,
.migration-notes h3, .migration-notes h4,
.migration-challenge h3, .migration-challenge h4 { font-size: 1.05rem; margin: 0 0 0.4rem; }

/* Unreleased (preview) API surface */
span.preview {
    display: inline-block;
    vertical-align: 0.2em;
    margin-left: 0.4em;
    padding: 0.05em 0.5em;
    font-family: var(--font-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
    color: var(--amber);
    background: var(--amber-wash);
    border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
    border-radius: 999px;
}
.info-box.preview {
    background: var(--amber-wash);
    border-left-color: var(--amber);
}

.deprecated {
    color: var(--rust);
    background: var(--rust-wash);
    border-radius: 4px;
    padding: 0 0.35em;
}
div.deprecated, section.deprecated, p.deprecated {
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--rust);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------- Tabs ---------- */

.integration-tabs,
.example-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 1.5rem 0 0;
    border-bottom: 1px solid var(--rule);
}

.tab-btn {
    appearance: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-faint);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--elm); }

.integration-guide,
.code-example { display: none; }
.integration-guide.active,
.code-example.active { display: block; }

.integration-guide > h3,
.code-example > h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }

.code-examples { max-width: var(--wide); margin: 1.5rem 0 2.5rem; }

/* ---------- Steps: a vertical rail, because they are a sequence ---------- */

.integration-guide, .content-section { counter-reset: step; }

.step {
    position: relative;
    max-width: var(--wide);
    padding: 0 0 1.75rem 2.25rem;
    margin: 0;
}
.step:first-of-type { margin-top: 1.75rem; }
.step::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 1.6rem;
    bottom: 0;
    width: 2px;
    background: var(--rule);
}
.step:last-of-type::before { display: none; }
.step h4 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    position: relative;
}
.step h4::before {
    content: "";
    position: absolute;
    left: -2.25rem;
    top: 0.3rem;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--elm);
}
.step > *:last-child { margin-bottom: 0; }

/* ---------- Code ---------- */

pre,
pre[class*="language-"] {
    position: relative;
    margin: 1rem 0 1.5rem;
    padding: 1.1rem 1.25rem;
    max-width: var(--wide);
    overflow-x: auto;
    background: var(--code-bg);
    color: var(--code-fg);
    border: 1px solid var(--code-rule);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    line-height: 1.55;
    tab-size: 4;
    text-shadow: none;
}
pre code, pre[class*="language-"] code,
code[class*="language-"] {
    font-family: var(--font-code);
    font-size: inherit;
    background: none;
    color: inherit;
    border: 0;
    padding: 0;
    text-shadow: none;
    white-space: pre;
}

pre[class*="language-"].line-numbers { padding-left: 3.6em; }
.line-numbers .line-numbers-rows { border-right: 1px solid var(--code-rule); }
.line-numbers-rows > span::before { color: #4A5E6D; }

/* Syntax palette, tuned to the ink background */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6F8697; font-style: italic; }
.token.punctuation { color: #9FB2C1; }
.token.keyword, .token.important, .token.atrule { color: #8FB8F2; }
.token.class-name, .token.builtin, .token.namespace { color: #F2C98F; }
.token.function { color: #7FD6B4; }
.token.string, .token.char, .token.attr-value, .token.regex { color: #C8E59A; }
.token.number, .token.boolean, .token.constant, .token.symbol { color: #F0A58A; }
.token.operator, .token.entity, .token.url { color: #C5D3DE; }
.token.property, .token.tag, .token.selector, .token.attr-name { color: #B9A6F2; }

/* Prism toolbar / copy button */
div.code-toolbar { position: relative; max-width: var(--wide); }
div.code-toolbar > .toolbar {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s;
}
div.code-toolbar:hover > .toolbar,
div.code-toolbar:focus-within > .toolbar { opacity: 1; }
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > button.copy-to-clipboard-button {
    font-family: var(--font-text);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--code-fg);
    background: #22323E;
    border: 1px solid #33485A;
    border-radius: 4px;
    padding: 0.2rem 0.6rem;
    box-shadow: none;
    cursor: pointer;
}
div.code-toolbar > .toolbar > .toolbar-item > button:hover { background: #2D4252; }

/* One-line install commands */
.install-command {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--measure);
    margin: 0.5rem 0 1rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
    border: 1px solid var(--code-rule);
}
.install-command code,
.install-command > code {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    color: var(--code-fg);
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.875rem;
}
.install-command code::before { content: "$ "; color: #6F8697; }

.copy-btn {
    flex: none;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--code-fg);
    background: #22323E;
    border: 1px solid #33485A;
    border-radius: 4px;
    padding: 0.2rem 0.65rem;
    cursor: pointer;
}
.copy-btn:hover { background: #2D4252; }
.copy-btn.copied { color: #7FD6B4; border-color: #3C6B5A; }

/* ---------- Concept grids ---------- */

.concept-grid,
.product-types,
.restriction-models,
.feature-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0 2rem;
    max-width: var(--wide);
    margin: 1.5rem 0 2rem;
}

/* Grid items read as definitions: a ruled top edge, no box */
.concept-card,
.product-type,
.restriction-model,
.feature-column {
    padding: 1rem 0 1.25rem;
    border-top: 2px solid var(--ink);
}
.concept-card h3,
.product-type h4,
.restriction-model h4,
.feature-column h3,
.feature-column h4 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
}
.concept-card p,
.product-type p,
.restriction-model p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.feature-column ul { padding-left: 1.1rem; margin: 0; }
.feature-column li { color: var(--ink-soft); }

/* ---------- Flow diagram ---------- */

.flow-diagram {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    max-width: var(--wide);
    margin: 1.5rem 0 2rem;
}
.flow-step {
    flex: 1 1 9rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--ink-soft);
}
.flow-step strong { color: var(--ink); font-family: var(--font-display); font-weight: 600; }
.flow-arrow {
    align-self: center;
    color: var(--ink-faint);
    font-size: 1.1rem;
}

/* ---------- Migration guide ---------- */

.migration-section { max-width: var(--wide); margin: 2rem 0; }

.migration-comparison,
.feature-mapping {
    display: grid;
    /* Side by side only when each column fits a reasonable code line. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr));
    gap: 1.25rem;
    max-width: var(--wide);
    margin: 1.25rem 0 2rem;
}
.migration-before,
.migration-after {
    min-width: 0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--rule);
}
.migration-before { background: var(--mist); }
.migration-after { background: var(--leaf-wash); border-color: color-mix(in srgb, var(--leaf) 35%, transparent); }
.migration-before h5,
.migration-after h5 { margin: 0 0 0.5rem; font-size: 1rem; }
.migration-before pre,
.migration-after pre { margin-bottom: 0; }

.timeline {
    position: relative;
    max-width: var(--wide);
    margin: 1.5rem 0 2rem;
    padding-left: 2rem;
    border-left: 2px solid var(--rule);
}
.timeline-item { position: relative; padding: 0 0 1.75rem; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: calc(-2rem - 7px);
    top: 0.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--ink);
}
.timeline-item h4 { margin-top: 0; }
.timeline-tasks,
.timeline-deliverables { margin-top: 0.75rem; }

/* ---------- Footer ---------- */

.site-footer {
    max-width: var(--wide);
    margin-top: 4rem;
    padding: 2.5rem 0 0;
    border-top: 1px solid var(--rule);
    color: var(--ink-faint);
    font-size: 0.92rem;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1.5rem;
}
.footer-section h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-text);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
}
.footer-section ul { list-style: none; margin: 0; padding: 0; }
.footer-section li { margin: 0.2rem 0; }
.footer-section a { color: var(--ink-soft); text-decoration: none; }
.footer-section a:hover { color: var(--elm); text-decoration: underline; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}
.site-footer-owner, .site-footer-credits { display: block; }
body > .site-footer,
section.main-content .site-footer { margin-left: 0; }

/* ---------- Mobile ---------- */

.mobile-menu-toggle,
.mobile-overlay { display: none; }

@media (max-width: 960px) {
    .mobile-menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        position: fixed;
        top: 0.75rem;
        right: 0.75rem;
        z-index: 1001;
        width: 2.6rem;
        height: 2.6rem;
        padding: 0 0.65rem;
        background: var(--ink);
        border: 0;
        border-radius: var(--radius);
        cursor: pointer;
    }
    .mobile-menu-toggle span { display: block; height: 2px; background: var(--paper); border-radius: 1px; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }
    .sidebar.mobile-open {
        transform: none;
        box-shadow: 0 0 0 100vmax rgba(10, 18, 24, 0.45);
    }
    .mobile-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 999;
    }

    .layout-container > .main-content {
        margin-left: 0;
        padding: 0 1rem 3rem;
    }
    .hero { padding-top: 4rem; }
    .flow-arrow { display: none; }
}

@media (max-width: 520px) {
    body { font-size: 1rem; }
    .content-section { padding-top: 2.25rem; }
    pre, pre[class*="language-"] { font-size: 0.8rem; padding: 0.9rem; border-radius: var(--radius); }
    pre[class*="language-"].line-numbers { padding-left: 3.2em; }
    .tab-btn { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
    .integration-tabs, .example-tabs { flex-wrap: nowrap; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .heartbeat .hb-pulse { animation: none; }
    .sidebar { transition: none; }
}

@media print {
    .sidebar, .mobile-menu-toggle, .mobile-overlay, .theme-toggle, .hero-buttons, div.code-toolbar > .toolbar { display: none !important; }
    .layout-container > .main-content { margin: 0; padding: 0; }
    .integration-guide, .code-example { display: block; }
    pre, pre[class*="language-"] { white-space: pre-wrap; border-color: #999; }
}
