/* Steps */
.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding-top: 0;
}

.steps li::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    margin-bottom: 16px;
    padding: 10px 0 11px;
    border-radius: 1px;
    background: var(--enamel-slate);
    color: var(--brass);
    font-size: var(--type-numeral-lg);
    font-weight: 500;
    box-shadow:
        inset 0 0 0 1px var(--brass),
        inset 0 0 0 4px var(--enamel-slate),
        inset 0 0 0 5px rgba(217, 181, 116, 0.4),
        0 4px 9px -3px rgba(0, 0, 0, 0.5);
}

.steps h3 {
    font-size: var(--type-subhead);
    margin-bottom: 6px;
}

.steps p {
    font-size: var(--type-body);
    color: var(--umber-soft);
    max-width: 60ch;
}

.porch-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    margin-top: 32px;
    list-style: none;
    padding: 0;
}

.porch-steps .plaque {
    display: inline-flex;
    align-items: center;
    width: 3.5rem;
    margin-bottom: 16px;
    padding: 10px 0 11px;
}

.porch-steps .figure {
    font-size: var(--type-numeral-lg);
}

.porch-steps p {
    margin-top: 6px;
}

/* Owners: the road from first message to first payout. The painted door ground
   of the owner hero, house-number plaques, and a brass rail between them drawn
   at the roofline's strength, the one stretch of the page that moves. */
.journey {
    --journey-gap: clamp(24px, 3vw, 48px);
    --journey-plaque: 4.5rem;
    --journey-rail: rgba(217, 181, 116, 0.6);
    background: var(--door-deep);
    color: var(--on-door);
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* Tenant steps: the same journey, hung as a panel on the page rather than a
   full-bleed band, so it doesn't butt against the section tabs. */
.journey-panel {
    padding: clamp(28px, 5vw, 56px);
    border-radius: 1px;
    box-shadow: 0 18px 36px -24px rgba(34, 30, 27, 0.6);
}

.journey .section-head p {
    color: var(--on-door);
}

.journey h2,
.journey h3 {
    color: var(--trim-white);
}

.journey .section-head {
    margin-bottom: clamp(40px, 5vw, 64px);
}

.steps.journey-steps {
    gap: 40px var(--journey-gap);
}

.steps.journey-steps li::before {
    width: var(--journey-plaque);
    height: var(--journey-plaque);
    margin-bottom: 24px;
    padding: 0;
    font-size: var(--type-headline);
}

/* Rail: from this plaque's right edge to the next plaque's left edge. */
.steps.journey-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(var(--journey-plaque) / 2);
    left: calc(var(--journey-plaque) + 12px);
    right: calc(-1 * var(--journey-gap) + 12px);
    height: 1px;
    background: var(--journey-rail);
}

.steps.journey-steps h3 {
    margin-bottom: 8px;
    font-size: var(--type-title);
}

.steps.journey-steps p {
    max-width: 30ch;
    color: var(--on-door);
}

.journey :focus-visible {
    outline-color: var(--trim-white);
}

@media (max-width: 960px) {
    /* Two to a row: the rail only runs between neighbours on the same row. */
    .steps.journey-steps li:nth-child(2n)::after {
        content: none;
    }
}

@media (max-width: 600px) {
    .journey {
        --journey-plaque: 3.5rem;
    }

    .steps.journey-steps {
        gap: 32px;
    }

    .steps.journey-steps li {
        grid-template-columns: var(--journey-plaque) minmax(0, 1fr);
        column-gap: 18px;
    }

    .steps.journey-steps li::before {
        margin-bottom: 0;
        font-size: var(--type-numeral-lg);
    }

    /* One column: the rail drops straight down the plaque column. */
    .steps.journey-steps li:not(:last-child)::after {
        content: "";
        top: calc(var(--journey-plaque) + 10px);
        bottom: -22px;
        left: calc(var(--journey-plaque) / 2);
        right: auto;
        width: 1px;
        height: auto;
    }
}

@media (max-width: 960px) {
    .steps,
    .porch-steps {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .steps,
    .porch-steps {
        grid-template-columns: 1fr;
    }

    .steps li {
        display: grid;
        grid-template-columns: 3.5rem minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        column-gap: 16px;
    }

    .steps li::before {
        grid-row: span 2;
        align-self: start;
        margin-bottom: 0;
    }

    .steps li > * {
        grid-column: 2;
    }

    .porch-steps li {
        display: grid;
        grid-template-columns: 3.5rem minmax(0, 1fr);
        grid-template-areas: "plaque h3" "plaque p";
        align-items: start;
        gap: 0 16px;
    }

    .porch-steps li .plaque {
        grid-area: plaque;
    }

    .porch-steps li h3 {
        grid-area: h3;
    }

    .porch-steps li p {
        grid-area: p;
    }

    .porch-steps .plaque {
        margin-bottom: 0;
    }
}

/* Switch page: "what happens next" beside the form. The steps component
   stacked into one column, with smaller plaques set beside each step. */
.steps.steps-stack {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 28px 0;
}

.steps.steps-stack li {
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    column-gap: 16px;
    grid-template-rows: auto 1fr;
}

.steps.steps-stack li::before {
    grid-row: span 2;
    align-self: start;
    width: 2.75rem;
    margin-bottom: 0;
    padding: 6px 0 7px;
    font-size: var(--type-numeral);
}

.steps.steps-stack h3 {
    margin-bottom: 6px;
}
