/* ---------------------------------------------------------------------------
   How it works: the five steps from a vacancy to somebody on site.

   Replaces a commented-out template section about real-time threat monitoring.
   These five are numbered because they genuinely are a sequence - nobody is
   deployed before verification - so the order carries information rather than
   decorating the list.
   --------------------------------------------------------------------------- */

.how-it-works {
    background: var(--secondary-color);
    padding: 96px 0;
}

/* ---- heading ---- */

.hiw-head {
    max-width: 720px;
    margin: 0 auto 52px;
    text-align: center;
}

.hiw-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #6f6b66;
    margin-bottom: 14px;
}

    .hiw-eyebrow .eyebrow-mark {
        width: 8px;
        height: 8px;
        background: var(--primary-color);
    }

.hiw-title {
    font-size: clamp(1.9rem, 3.8vw, 2.8rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.03em;
    margin: 0 0 14px;
    text-wrap: balance;
}

    .hiw-title span {
        color: var(--primary-color);
    }

.hiw-lead {
    font-size: 15.5px;
    line-height: 1.75;
    margin: 0;
}

/* ---- the steps ----

   A single row on a wide screen, so the sequence reads left to right the way a
   sequence should. The connecting rule runs behind the numbers and stops at
   each end, so it joins the steps rather than trailing off the section. */

.hiw-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    margin: 0 0 44px;
    padding: 0;
    list-style: none;
    position: relative;
    counter-reset: none;
}

.hiw-step {
    position: relative;
    padding: 0 18px;
}

    /* The rule between one number and the next. Not drawn after the last. */
    .hiw-step::before {
        content: '';
        position: absolute;
        top: 21px;
        left: calc(50% + 30px);
        right: calc(-50% + 30px);
        height: 1px;
        background: rgba(0, 0, 0, .15);
    }

    .hiw-step:last-child::before {
        display: none;
    }

.hiw-number {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .5px;
    margin-bottom: 18px;
}

.hiw-step h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
}

.hiw-step p {
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

/* ---- actions ---- */

.hiw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

    .hiw-actions .btn-outline {
        display: inline-block;
        border: 1px solid rgba(0, 0, 0, .28);
        border-radius: 40px;
        padding: 13px 30px;
        font-weight: 600;
        font-size: 15px;
        text-decoration: none;
        color: inherit;
        transition: background .18s ease, border-color .18s ease, color .18s ease;
    }

        .hiw-actions .btn-outline:hover,
        .hiw-actions .btn-outline:focus-visible {
            background: var(--accent-color);
            border-color: var(--accent-color);
            color: #fff;
        }

/* ---- keyboard ---- */

.how-it-works a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* ---- motion ---- */

@media (prefers-reduced-motion: reduce) {
    .hiw-actions .btn-outline {
        transition: none;
    }
}

/* ---- narrow screens ----

   Five across stops working well before the tablet breakpoint. Below it the
   steps stack and the rule turns vertical, running down the left beside the
   numbers - still a sequence, read top to bottom. */

@media (max-width: 1199px) {
    .hiw-steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 34px 0;
    }

    .hiw-step:nth-child(3)::before {
        display: none;
    }
}

@media (max-width: 767px) {
    .how-it-works {
        padding: 66px 0;
    }

    .hiw-steps {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hiw-step {
        display: grid;
        grid-template-columns: 42px 1fr;
        column-gap: 16px;
        padding: 0 0 26px 0;
    }

        .hiw-step::before {
            top: 46px;
            bottom: 0;
            left: 20px;
            right: auto;
            width: 1px;
            height: auto;
        }

        .hiw-step:last-child {
            padding-bottom: 0;
        }

    .hiw-number {
        grid-row: span 2;
        margin-bottom: 0;
    }

    .hiw-step h3 {
        margin-top: 9px;
    }

    .hiw-actions .btn-default,
    .hiw-actions .btn-outline {
        flex: 1 1 auto;
        text-align: center;
    }
}
