/* Shared how-it-works numbered steps (landing + learn pages) */

.landing-steps {
    counter-reset: landing-step;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.landing-steps > li {
    counter-increment: landing-step;
    position: relative;
    padding-left: 2.75rem;
    margin-bottom: 1.25rem;
}

.landing-steps > li:last-child {
    margin-bottom: 0;
}

.landing-steps > li::before {
    content: counter(landing-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: var(--bs-primary);
    color: #fff;
    line-height: 1;
}

/* Shared how-it-works diagram (landing + learn pages) */

.landing-how-diagram {
    --landing-how-mark: 3.75rem;
    --landing-how-line: color-mix(in srgb, var(--bs-body-color) 28%, transparent);
    --landing-how-arrow: 0.5rem;
    --landing-how-shaft: 5.5rem;
    --landing-how-speed: #adb5bd;
    --landing-divider: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .landing-how-diagram {
    --landing-how-speed: #868e96;
    --landing-divider: rgba(255, 255, 255, 0.1);
}

.landing-how-rail {
    display: grid;
    grid-template-columns: var(--landing-how-mark) minmax(var(--landing-how-shaft), 1fr) var(--landing-how-mark) minmax(var(--landing-how-shaft), 1fr) var(--landing-how-mark);
    justify-content: center;
    align-items: start;
    min-width: 0;
}

.landing-how-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--landing-how-mark);
}

.landing-how-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--landing-how-mark);
    height: var(--landing-how-mark);
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--bs-primary) 28%, var(--landing-divider));
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
    font-size: 1.5rem;
    line-height: 1;
}

.landing-how-node--end .landing-how-mark {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: #fff;
}

.landing-how-label {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.landing-how-line {
    position: relative;
    height: var(--landing-how-mark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-how-line::before {
    content: "";
    flex: none;
    width: calc(var(--landing-how-shaft) - var(--landing-how-arrow));
    height: 2px;
    background-color: var(--landing-how-line);
}

.landing-how-line::after {
    content: "";
    width: var(--landing-how-arrow);
    height: var(--landing-how-arrow);
    margin-left: -1px;
    flex-shrink: 0;
    border-right: 2px solid var(--landing-how-line);
    border-top: 2px solid var(--landing-how-line);
    transform: rotate(45deg);
}

.landing-how-clock {
    position: absolute;
    left: 50%;
    top: calc(100% + 0.15rem);
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--landing-how-speed);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}

.landing-how-clock .bi {
    display: block;
    line-height: 1;
    translate: 0 0.1em;
}

[data-bs-theme="dark"] .landing-how-node--end .landing-how-mark {
    background-color: var(--bs-primary);
    color: #fff;
}

@media (max-width: 767.98px) {
    .landing-how-diagram {
        max-width: 18rem;
        margin-inline: auto;
    }

    .landing-how-rail {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.55rem;
    }

    .landing-how-line {
        flex-direction: column;
        align-items: center;
        width: auto;
        height: auto;
    }

    .landing-how-line::before {
        order: 1;
        flex: none;
        width: 2px;
        height: 1.75rem;
    }

    .landing-how-line::after {
        order: 2;
        margin-left: 0;
        margin-top: -1px;
        transform: rotate(135deg);
    }

    .landing-how-clock {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        order: 3;
        margin-top: 0.35rem;
        margin-bottom: 0.15rem;
    }
}
