/* Tools and reading layouts. Brand tokens are inherited from site.css. */
:root {
    --bg-page: var(--paper); --bg-soft: var(--paper-soft);
    --text-1: var(--ink); --text-2: var(--ink-2); --text-3: var(--ink-2);
    --text-on-dark: var(--on-dark); --text-on-dark-2: var(--on-dark-2);
    --border-1: var(--rule); --border-2: var(--rule-strong);
    --accent-strong: var(--accent-ink); --danger-ink: #a64026;
    --fs-h1: var(--fs-page); --fs-label: .8125rem;
    --space-1: .25rem; --space-2: .5rem; --space-3: .75rem;
    --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem;
    --space-7: 2.5rem; --space-8: 3rem;
    --section-gap: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- Page root ---------- */

.st-main {
    padding-top: calc(var(--header-h, 4.5rem) + clamp(2rem, 4vw, 3rem));
    padding-bottom: var(--space-8);
}

.st-container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.st-container--read {
    max-width: var(--container);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.st-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.st-muted {
    color: var(--ink-2);
}

::selection {
    background: var(--c-teal-light);
    color: var(--c-slate);
}

::-webkit-scrollbar {
    width: 0.75rem;
    height: 0.75rem;
}

::-webkit-scrollbar-track {
    background: var(--paper-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--c-gray-light);
    border: 2px solid var(--paper-soft);
    border-radius: var(--radius-sm);
}

/* ---------- Page head and prose ---------- */

.st-page__head h1 {
    font-size: var(--fs-h1);
    max-width: 44rem;
}

.st-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    margin-top: var(--space-3);
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.st-article-meta__category {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-ink);
}

.st-article-meta__sep {
    color: var(--c-gray-light);
}

.st-lead {
    margin-top: var(--space-4);
    max-width: 44rem;
    font-size: var(--fs-lead);
    line-height: 1.55;
    color: var(--ink-2);
}

.st-guide-note {
    margin-top: var(--space-5);
    max-width: 60rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--rule);
    background: var(--paper-soft);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--ink-2);
}

.st-content {
    margin-top: var(--section-gap);
}

.st-content > * + * {
    margin-top: 1.1rem;
}

.st-content h2 {
    margin-top: var(--section-gap);
    font-size: var(--fs-h2);
    letter-spacing: -0.025em;
}

.st-content h3 {
    margin-top: var(--space-6);
    font-size: var(--fs-h3);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.012em;
}

.st-content p,
.st-content li {
    max-width: 65ch;
}

.st-content ul {
    padding-left: 1.4rem;
    list-style: disc;
}

.st-content ol {
    padding-left: 1.4rem;
    list-style: decimal;
}

.st-content li + li {
    margin-top: 0.35rem;
}

/* Hub and post lists are ruled rows, not bulleted prose: beat the
   `.st-content ul` reset above. */
.st-content .st-cards {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Prose links use the marketing-site language: ink at rest with a quiet rule,
   accent on hover. */
.st-content a {
    color: var(--ink);
    text-decoration-color: var(--rule-strong);
    transition: color var(--dur-2) ease, text-decoration-color var(--dur-2) ease;
}

@media (hover: hover) and (pointer: fine) {
    .st-content a:hover {
        color: var(--accent-ink);
        text-decoration-color: var(--accent);
    }
}

/* Buttons keep their own language inside a prose column. */
.st-content .st-btn {
    text-decoration: none;
}

.st-content .st-btn--primary {
    color: var(--c-white);
}

.st-content .st-btn--ghost {
    color: var(--ink);
}

.st-content time,
.st-content code,
.st-table {
    font-variant-numeric: tabular-nums;
}

.st-content code {
    padding: 0.1rem 0.3rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-xs);
    background: var(--paper-soft);
    font-size: 0.9em;
}

/* Sections inside a body read as register entries: rule above, more space
   above the heading than below it. */
.st-content > section {
    padding-top: 1rem;
}

.st-content > section:first-child {
    margin-top: 0;
}

.st-content > section > h2:first-child {
    margin-top: 0;
}

/* ---------- Cards and lists (ruled rows, never boxes) ---------- */

.st-cards {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.st-card {
    padding-block: 1.35rem;
    border-bottom: 1px solid var(--rule);
    background: transparent;
    transition: background-color var(--dur-2) ease;
}

.st-card__title {
    font-size: var(--fs-h3);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.012em;
}

.st-card__title a {
    text-decoration: none;
    color: var(--ink);
    transition: color var(--dur-2) ease;
}

.st-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.4rem;
    font-size: var(--fs-xs);
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.st-card__category {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-ink);
}

.st-card__text {
    margin-top: 0.4rem;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    max-width: 65ch;
}

.st-card__action {
    margin-top: 0.6rem;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.st-card__action a {
    color: var(--accent-ink);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .st-card:hover {
        background: var(--paper-soft);
    }

    .st-card__title a:hover {
        color: var(--accent-ink);
        text-decoration: underline;
        text-decoration-color: var(--accent);
        text-underline-offset: 0.22em;
    }

    .st-card__action a:hover {
        text-decoration: underline;
        text-decoration-color: var(--accent);
        text-underline-offset: 0.22em;
    }
}

.st-empty {
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--rule);
    color: var(--ink-2);
}

.st-empty p + p {
    margin-top: 0.6rem;
}

.st-link-list {
    padding-left: 1.15rem;
    list-style: disc;
}

.st-link-list li + li {
    margin-top: 0.5rem;
}

/* Long official URLs must wrap instead of widening the page on phones. */
.st-link-list a,
.st-content a {
    overflow-wrap: anywhere;
}

/* ---------- Callouts, notices and tables ---------- */

.st-callout {
    padding: 0.9rem 1.1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--paper-soft);
}

.st-callout--info {
    border-color: rgba(38, 166, 154, 0.35);
    background: var(--c-teal-ultra);
}

.st-callout--warning {
    border-color: rgba(200, 80, 47, 0.4);
    background: rgba(200, 80, 47, 0.06);
}

.st-callout--success {
    border-color: rgba(26, 125, 116, 0.4);
    background: rgba(26, 125, 116, 0.07);
}

.st-notice {
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(255, 112, 67, 0.5);
    border-radius: var(--radius-sm);
    background: rgba(255, 112, 67, 0.07);
    font-weight: 500;
}

.st-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
}

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.st-table th,
.st-table td {
    padding: 0.65rem 0.8rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--rule);
}

.st-table th {
    background: var(--paper-soft);
    color: var(--ink-2);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.st-table caption {
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    background: var(--paper-soft);
    border-bottom: 1px solid var(--rule);
}

.st-table tr:last-child td {
    border-bottom: 0;
}

.st-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-xs);
    background: var(--paper-soft);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

/* ---------- Actions ---------- */

.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.35rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2) ease,
        color var(--dur-2) ease, border-color var(--dur-2) ease;
}

.st-btn:active {
    transform: scale(0.97);
}

.st-btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.st-btn--primary {
    background: var(--accent-ink);
    color: var(--c-white);
}

.st-btn--ghost {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--rule-strong);
}

/* Same hover language as the marketing-site buttons (A-HOVER). */
@media (hover: hover) and (pointer: fine) {
    .st-btn:not(:disabled):hover {
        transform: translateY(-1px);
    }

    .st-btn:not(:disabled):active {
        transform: scale(0.97);
    }

    .st-btn--primary:not(:disabled):hover {
        background: var(--accent-press);
        color: var(--c-white);
    }

    .st-btn--ghost:not(:disabled):hover {
        border-color: var(--accent);
        color: var(--accent-ink);
        background: var(--c-teal-ultra);
    }
}

/* ---------- Related and CTA ---------- */

.st-related {
    margin-top: var(--section-gap);
    padding-top: var(--space-5);
    border-top: 1px solid var(--rule);
}

.st-related h2 {
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.st-related ul {
    margin-top: var(--space-3);
    padding: 0;
    list-style: none;
}

.st-related li {
    padding: 0.7rem 0;
    border-top: 1px solid var(--rule);
}

.st-related li:last-child {
    border-bottom: 1px solid var(--rule);
}

.st-related a {
    font-weight: 600;
    text-decoration: none;
    transition: color var(--dur-2) ease;
}

@media (hover: hover) and (pointer: fine) {
    .st-related a:hover {
        text-decoration: underline;
        text-decoration-color: var(--accent);
        text-underline-offset: 0.22em;
    }
}

.st-related__text {
    display: block;
    margin-top: 0.15rem;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    font-weight: 400;
}

.st-cta {
    margin-top: var(--section-gap);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-radius: var(--radius);
    background: var(--c-slate);
    color: var(--on-dark);
}

.st-cta h2 {
    font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.9rem);
    letter-spacing: -0.025em;
}

.st-cta p {
    margin-top: 0.6rem;
    max-width: 56ch;
    color: var(--on-dark-2);
}

.st-cta .st-btn--primary {
    background: var(--c-teal-light);
    color: var(--c-slate-deep);
}

.st-cta .st-btn--ghost {
    background: transparent;
    color: var(--on-dark);
    border-color: rgba(255, 255, 255, 0.4);
}

@media (hover: hover) and (pointer: fine) {
    .st-cta .st-btn--primary:not(:disabled):hover {
        background: var(--c-white);
        color: var(--c-slate-deep);
    }

    .st-cta .st-btn--ghost:not(:disabled):hover {
        border-color: var(--c-teal-light);
        color: var(--c-teal-light);
    }
}

.st-cta__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: var(--space-5);
}

/* Hostname label beside an inline official link. */
.st-source__host {
    color: var(--ink-2);
    font-size: var(--fs-xs);
    word-break: break-all;
    font-variant-numeric: normal;
}

/* ---------- Forms ---------- */

.st-field {
    display: block;
}

.st-field label,
.st-field .st-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: var(--fs-xs);
    font-weight: 600;
}

.st-input {
    width: 100%;
    max-width: 24rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}

.st-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(77, 182, 172, 0.25);
}

.st-help {
    margin-top: 0.3rem;
    max-width: 52ch;
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.st-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 34rem) {
    .st-container--read {
        max-width: 100%;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Shared page frame; a readable column within the same site-wide width. */
.st-main { padding-top: calc(var(--header-h) + clamp(2.5rem, 5vw, 4.5rem)); padding-bottom: clamp(3rem, 7vw, 6rem); }
.st-page__head { max-width: 52rem; }
.st-page__head h1 { max-width: 52rem; text-wrap: balance; line-height: 1.1; }
.st-lead { max-width: 46rem; }
.st-content h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); line-height: 1.2; text-wrap: balance; }
.st-content h3 { line-height: 1.35; }
.st-content section > p, .st-content section > ul, .st-content section > ol,
.st-content section > div + p { margin-top: 1rem; }
.st-content > section + section { margin-top: 2.75rem; }
.st-content > section:first-child { padding-top: 0; }
.st-content > link { display: none; }
.st-content :is(h2,h3,section) { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.st-page--guide .st-content { max-width: 48rem; }
.st-toc { margin-top: 2rem; font-size: .875rem; }
.st-toc details { border: 0; }
.st-toc summary { font-weight: 600; cursor: pointer; padding-block: .75rem; }
.st-toc ol { list-style: none; padding: 0; margin: .5rem 0 0; }
.st-toc a { display: block; padding: .45rem 0; color: var(--ink-2); text-decoration: none; line-height: 1.45; }
.st-toc a:hover, .st-toc a:focus-visible { color: var(--accent-ink); text-decoration: underline; }
.st-page--guide .st-content { margin-top: 2rem; }
.st-callout, .st-notice, .st-guide-note { border: 0; }
.st-table-wrap { border: 0; border-radius: 0; }
.st-table th { white-space: normal; }
.st-related ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2.5rem; }
.st-related li, .st-related li:last-child { border: 0; padding: 0; }
.st-cta { padding: clamp(1.5rem, 4vw, 3rem); }
.st-cta__actions { gap: .75rem; }
.st-content .st-cards { border: 0; }
.st-content .st-card { max-width: none; margin: 0; padding: 1.5rem 0; }
.st-content .st-card__title { margin: 0; }
.st-card__category { text-transform: none; letter-spacing: 0; }
.st-topic-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1.5rem 0 0; }
.st-topic-nav a { display: inline-flex; padding-block: .5rem; color: var(--accent-ink); font-weight: 600; }
.st-content .st-cards--tools .st-card { padding: 2rem; border: 0; border-radius: var(--radius); background: var(--paper-soft); }
.st-cards--tools { display: grid; gap: 1.5rem; }
.st-cards--tools .st-card__action { margin-top: 1.25rem; }
.st-cards--tools .st-card__title a { display: block; }
.st-content .st-guide-group { margin-top: 3rem; padding: 0; }
.st-guide-group__intro { color: var(--ink-2); }
.st-article-meta__category { text-transform: none; letter-spacing: 0; }
@media (min-width: 56rem) {
    .st-page--guide { display: grid; grid-template-columns: minmax(0, 48rem) minmax(12rem, 1fr); column-gap: clamp(2rem, 5vw, 5rem); }
    .st-page--guide .st-page__head { grid-column: 1 / -1; }
    .st-page--guide .st-content { grid-column: 1; grid-row: 2; }
    .st-toc { grid-column: 2; grid-row: 2; align-self: start; position: sticky; top: calc(var(--header-h) + 1.5rem); max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto; }
    .st-page--guide > :is(.st-related,.st-cta) { grid-column: 1 / -1; }
    .st-cards--tools { grid-template-columns: 1.1fr 1fr; }
    .st-cards--posts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 3rem; }
}
@media (max-width: 40rem) {
    .st-main { padding-top: calc(var(--header-h) + 2rem); }
    .st-toc { padding: .5rem 1rem; background: var(--paper-soft); }
    .st-related ul { grid-template-columns: 1fr; }
    .st-cta__actions .st-btn { width: 100%; }
    .st-content .st-cards--tools .st-card { padding: 1.5rem; }
}
