/* ════════════════════════════════
   HOW JOTNO WORKS
   jotno.ai — works.css
════════════════════════════════ */

#how-it-works {
    position: relative;
    padding: var(--sec-y) var(--sec-x) var(--sec-y);
}

/* Light pools again, mirrored off the provider band so the journey reads as
   its own stage after the flat paper wash of "Who We Serve". */
#how-it-works::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 46% 54% at 88% 46%, rgba(8, 145, 178, 0.07), transparent 70%),
        radial-gradient(ellipse 40% 48% at 10% 12%, rgba(99, 102, 241, 0.06), transparent 70%);
}

.hw-inner {
    max-width: var(--sec-max);
    margin: 0 auto;
}

/* ════ HEAD ════ */
.hw-head {
    margin-bottom: 3.4rem;
}

.hw-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(14, 116, 144, 0.78);
    margin-bottom: 1.25rem;
}

.hw-eyebrow-line {
    width: 26px;
    height: 1px;
    background: rgba(8, 145, 178, 0.55);
    flex-shrink: 0;
}

.hw-title {
    font-family: 'Playfair Display', 'Plus Jakarta Sans', serif;
    font-size: clamp(1.95rem, 3vw, 2.65rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.12;
    color: var(--text);
    max-width: 680px;
}

/* SERIF accent — see the accent map in common.css. This band is an index:
   you read it and move on, so the phrase shifts to the display italic and
   takes no decoration at all. */
.hw-title-accent {
    font-style: italic;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ════ STEPS ════
   Five stages, five up, threaded by a hairline rail that bridges the
   gutters — the path itself is the only ornament the row needs. */
.hw-steps {
    --hw-gap: 2.4rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--hw-gap);
    list-style: none;
}

.hw-step {
    position: relative;
    min-width: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.hw-step:hover,
.hw-step:focus-within {
    transform: translateY(-4px);
}

.hw-num {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    color: var(--primary-dark);
    opacity: 0.85;
    margin-bottom: 0.85rem;
    transition: opacity 0.3s ease;
}

.hw-step:hover .hw-num,
.hw-step:focus-within .hw-num {
    opacity: 1;
}

/* ─── RAIL + NODE ─── */
.hw-marker {
    position: relative;
    display: block;
    height: 12px;
    margin-bottom: 1.15rem;
}

.hw-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 1px;
    /* Overshoot by one gutter so the rail runs unbroken between steps */
    width: calc(100% + var(--hw-gap));
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.32), rgba(8, 145, 178, 0.14));
}

/* The last stage has nothing to reach for — the rail fades out instead */
.hw-step:last-child .hw-marker::before {
    width: 58px;
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.32), rgba(8, 145, 178, 0));
}

.hw-dot {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.09);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* The node fills in on hover, the same move the icon tiles above make */
.hw-step:hover .hw-dot,
.hw-step:focus-within .hw-dot {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 6px rgba(8, 145, 178, 0.14);
    transform: translateY(-50%) scale(1.18);
}

.hw-name {
    font-family: 'Playfair Display', 'Plus Jakarta Sans', serif;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.hw-step:hover .hw-name,
.hw-step:focus-within .hw-name {
    color: var(--primary-dark);
}

.hw-desc {
    font-size: 0.85rem;
    line-height: 1.68;
    font-weight: 500;
    color: var(--muted);
}

/* ─── STAGGERED REVEAL ───
   The list carries the shared .fade-in hook; the steps ride in behind it
   one after another so the row reads left to right, like the path does. */
.hw-steps.fade-in .hw-step {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.hw-steps.fade-in.visible .hw-step {
    opacity: 1;
    transform: translateY(0);
}

.hw-steps.fade-in.visible .hw-step:nth-child(1) {
    transition-delay: 0.05s;
}

.hw-steps.fade-in.visible .hw-step:nth-child(2) {
    transition-delay: 0.14s;
}

.hw-steps.fade-in.visible .hw-step:nth-child(3) {
    transition-delay: 0.23s;
}

.hw-steps.fade-in.visible .hw-step:nth-child(4) {
    transition-delay: 0.32s;
}

.hw-steps.fade-in.visible .hw-step:nth-child(5) {
    transition-delay: 0.41s;
}

/* Hover must not fight the reveal transform once the row has landed */
.hw-steps.fade-in.visible .hw-step:hover,
.hw-steps.fade-in.visible .hw-step:focus-within {
    transform: translateY(-4px);
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {

    .hw-step,
    .hw-dot,
    .hw-num,
    .hw-name,
    .hw-steps.fade-in .hw-step {
        transition: none;
    }

    .hw-steps.fade-in .hw-step {
        opacity: 1;
        transform: none;
    }
}
