/* ============================================================================
   how-to.css — the instructional page: sticky contents + numbered steps.
   ========================================================================= */

.ht-version {
    margin-top: var(--sp-4);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: .05em;
    color: var(--ink-muted);
}

.ht-version a { color: var(--accent); }

.ht {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    padding-block: clamp(2.5rem, 6vw, 4.5rem);
    align-items: start;
}

@media (min-width: 940px) {
    .ht { grid-template-columns: 15rem minmax(0, 1fr); }

    .ht__toc {
        position: sticky;
        /* Clears the sticky header, which is why this is not just 0. */
        top: calc(var(--header-h) + 2rem);
    }
}

/* ── Contents ───────────────────────────────────────────────────────────── */

.ht__toc-title {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: var(--sp-4);
}

.ht__toc-list {
    display: grid;
    gap: .1rem;
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc;
    border-left: 1px solid var(--line);
}

.ht__toc-list a {
    display: block;
    padding: .45rem 0 .45rem 1rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: var(--step--1);
    color: var(--ink-muted);
    text-decoration: none;
    transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.ht__toc-list a:hover {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* ── Body ───────────────────────────────────────────────────────────────── */

.ht__section { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

.ht__section + .ht__section {
    margin-top: clamp(3rem, 7vw, 5rem);
    padding-top: clamp(2rem, 5vw, 3rem);
    border-top: 1px solid var(--line);
}

.ht__body h2 { margin-bottom: var(--sp-5) !important; }

.ht__body code {
    padding: .12em .4em;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.ht__body .notice { margin-top: var(--sp-5); }

.ht__body .figure { margin-block: var(--sp-5); max-width: 42rem; }

.ht__figures {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    margin-block: var(--sp-5);
}

.ht__figures .figure { margin: 0; max-width: none; }

@media (min-width: 620px) {
    .ht__figures--four { grid-template-columns: repeat(4, 1fr); }
}

/* ── Numbered steps ─────────────────────────────────────────────────────── */

.ht__steps {
    list-style: none;
    padding: 0;
    margin: var(--sp-5) 0 0;
    counter-reset: ht-step;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
    max-width: var(--measure);
}

.ht__steps li {
    counter-increment: ht-step;
    position: relative;
    padding: var(--sp-4) 0 var(--sp-4) 3rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
    max-width: none;
}

.ht__steps li::before {
    content: counter(ht-step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: var(--sp-4);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--accent);
}

/* .prose adds top margin to every sibling; the list items supply their own. */
.ht__steps li + li { margin-top: 0; }
