/* ============================================================
   /how — "How Inbox Imp works", the persistent help map (Q7).
   A wall label: one measure of prose, generous air, no cards.
   Tokens only (css/base.css) so it reads correctly in both themes.
   ============================================================ */

body.how-page .app-content {
    /* Prose wants a reading measure, not the 1200px app width. */
    max-width: 44rem;
    padding-bottom: 4rem;
}

/* Deep links land under the 56px sticky top bar without this. */
.how-stage,
.how-section {
    scroll-margin-top: 88px;
}

/* ── Header ───────────────────────────────────────────── */
.how-header {
    margin-bottom: 2rem;
}

.how-eyebrow {
    margin-bottom: 0.75rem;
    color: var(--text-faint);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.how-page h1 {
    font-size: clamp(2.25rem, 6vw, 2.75rem);
    margin-bottom: 1rem;
}

.how-standfirst {
    max-width: 34rem;
    margin-bottom: 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ── On this page ─────────────────────────────────────── */
.how-contents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.25rem;
    padding: 1rem 0;
    margin-bottom: 2.5rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.how-contents a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.how-contents a:hover,
.how-contents a:focus-visible {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 4px;
}

/* ── The five stages ──────────────────────────────────── */
.how-stages {
    list-style: none;
    margin: 0;
    padding: 0;
}

.how-stage {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0 0.75rem;
    margin-bottom: 2.75rem;
}

.how-step {
    margin: 0;
    padding-top: 0.35rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
}

body.how-page .how-stage-body h2,
body.how-page .how-section h2 {
    font-family: var(--font-subject);
    font-size: 1.375rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.625rem;
}

body.how-page .how-stage-body p,
body.how-page .how-section p {
    max-width: 36rem;
    margin-bottom: 0.875rem;
    font-size: var(--text-base);
    line-height: 1.65;
    color: var(--text-muted);
}

/* ── Quiet link to the live surface ───────────────────── */
.how-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 32px;
    color: var(--text-main);
    font-size: var(--text-sm);
    font-weight: 600;
}

.how-link:hover,
.how-link:focus-visible {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.how-link span {
    transition: transform var(--transition-fast);
}

.how-link:hover span {
    transform: translateX(2px);
}

/* ── Trailing sections (the piles, precedence) ────────── */
.how-section {
    padding-top: 1.75rem;
    margin-bottom: 2.75rem;
    border-top: 1px solid var(--line);
}

.how-piles {
    max-width: 36rem;
    margin: 0 0 1.25rem;
}

.how-piles dt {
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-family: var(--font-subject);
    font-size: 1.0625rem;
}

.how-piles dd {
    margin: 0 0 1.25rem;
    font-size: var(--text-base);
    line-height: 1.65;
    color: var(--text-muted);
}

.how-piles dd:last-child {
    margin-bottom: 0;
}

.how-order {
    max-width: 36rem;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.how-order li {
    margin-bottom: 0.75rem;
    font-size: var(--text-base);
    line-height: 1.65;
    color: var(--text-muted);
}

.how-order li::marker {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.how-order strong {
    color: var(--text-main);
    font-weight: 600;
}

@media (max-width: 640px) {
    .how-stage {
        grid-template-columns: 1.5rem 1fr;
        margin-bottom: 2.25rem;
    }

    .how-contents {
        gap: 0.25rem 1rem;
        margin-bottom: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .how-link span {
        transition: none;
    }
}
