/* Homepage "How we work": Audit -> Build -> Run -> Throughout (CLAUDE.md §5, §11), after design-refs/how we work.png.
   Four stacked panels. Each has a progress row ("[0.1] —— 0.2 — 0.3 — 0.4"), a big title on the left,
   and a description plus a bordered card on the right. The long line after the current step grows as you scroll
   through the panel and shrinks back as you scroll up (static/how-we-work.js): the site's one significant animation.
   Mobile-first: everything stacks; two columns from 1024px, with the left column staying in view. */

:root {
    --how-ink: #111111;
    --how-ink-2: #525252;
    --how-ink-3: #737373;
    --how-mute: #a3a3a3;      /* steps that aren't the current one */
    --how-link: #c4c4c4;      /* the short grey lines between steps */
    --how-card-line: #1f2124;  /* the box outline, after design-refs/4steps.png */
    --how-card-divider: rgba(31, 33, 36, 0.25); /* the lines between its points: the outline's color, softened */
    --how-card-radius: 0.75rem; /* the reference's outer corner radius */
}

.how {
    padding-block: clamp(4rem, 3rem + 4vw, 7rem);
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    background-color: #ffffff; /* covers the page's grey wash, so the page and the white boxes match */
    color: var(--how-ink);
    font-family: "Geist", -apple-system, system-ui, sans-serif;
}

/* ---------- Heading: the same size as the point-of-view heading above it ---------- */
.how__title {
    margin: 0;
    font-size: var(--section-title); /* every section heading: 28px on phones to 55px from 1440px (site-header.css) */
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.how__intro {
    max-width: 60ch;
    margin: 1rem 0 0;
    color: var(--how-ink-2);
    font-size: 1.25rem; /* 20px */
    line-height: 1.6;
}


/* ---------- Panels ---------- */
.how__phases {
    margin: clamp(3rem, 2rem + 3vw, 5rem) 0 0;
    padding: 0;
    list-style: none;
}

.how__phase {
    display: grid;
    gap: 2rem;
    padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); /* no line between the steps: the space separates them */
}

.how__phase:last-child {
    padding-bottom: 0;
}

/* Grid items default to their content's width; let them shrink so the progress lines never widen the page */
.how__side,
.how__main {
    min-width: 0;
}

.how__link {
    width: 0; /* the SVG's built-in width would otherwise set the column's minimum */
}

/* Desktop: big title on the left (stays in view), description and card on the right */
@media (min-width: 1024px) {
    .how__phase {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        column-gap: clamp(2.5rem, 1rem + 4vw, 6rem);
        padding-block: 5rem;
    }

    .how__side {
        position: sticky;
        top: calc(var(--header-height, 5rem) + 2rem);
        align-self: start;
    }
}

/* ---------- Progress row ---------- */
.how__progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    color: var(--how-mute);
    font-size: 1.25rem; /* 20px */
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.how__mark {
    flex: none;
}

.how__mark.is-current {
    color: var(--how-ink);
}

/* The lines share the row's full width: the long one (after the current step) gets four parts, the others one */
.how__link {
    display: block;
    flex: 1 1 0;
    min-width: 0.75rem;
    height: 2px;
    overflow: visible;
}

.how__link--long {
    flex-grow: 4;
    min-width: 2rem;
}

/* The viewBox is 2 units tall in a 2px box, so the 1-unit stroke is 1px (no vector-effect: it breaks pathLength) */
.how__link-line {
    stroke: var(--how-link);
    stroke-width: 1;
}

.how__draw {
    stroke: var(--how-ink);
    stroke-dasharray: 1;
    stroke-dashoffset: 0; /* drawn by default: no JavaScript, or reduced motion, shows the finished line */
}

/* With JavaScript the line follows the scroll: static/how-we-work.js sets its length from how far the panel
   has scrolled, so it grows as you scroll down and shrinks back as you scroll up. It starts undrawn. */
.how.js-ready .how__draw {
    stroke-dashoffset: 1;
}

/* ---------- Title ---------- */
.how__name {
    margin: 1.5rem 0 0;
    font-size: clamp(2.5rem, 1.5rem + 4vw, 4rem); /* 40px on phones, 64px from about 1000px */
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

/* ---------- Description and card ---------- */
.how__desc {
    max-width: 32ch;
    margin: 0;
    font-size: clamp(1.25rem, 1rem + 0.75vw, 1.5rem); /* 20px on phones, 24px from about 1070px */
    line-height: 1.35;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

/* White box with a thin near-black outline (design-refs/4steps.png); a softer line between its three points */
.how__card {
    --how-item-space: clamp(1.25rem, 1rem + 1vw, 1.75rem);
    margin: 2rem 0 0;
    padding: 0 clamp(1.5rem, 1rem + 2vw, 2.5rem);
    border: 1px solid var(--how-card-line);
    border-radius: var(--how-card-radius);
    background: #ffffff;
    list-style: none;
}

.how__card > li {
    padding-block: var(--how-item-space);
}

.how__card > li:first-child {
    padding-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.how__card > li:last-child {
    padding-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.how__card > li + li {
    border-top: 1px solid var(--how-card-divider);
}

@media (min-width: 768px) {
    .how__progress {
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .how__card {
        margin-top: 3rem;
    }
}

.how__item-title {
    margin: 0;
    color: var(--how-card-line);
    font-size: clamp(1.125rem, 0.75rem + 1.2vw, 1.5rem); /* 18px on phones, 21px on tablets, 24px from 1024px */
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.how__item-text {
    max-width: 52ch;
    margin: 0.5rem 0 0;
    color: var(--how-ink-3); /* the reference's grey, darkened just enough to stay readable (4.7:1) */
    font-size: clamp(1rem, 0.8rem + 0.6vw, 1.25rem); /* 16px on phones, 17px on tablets, 20px from about 1200px */
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
    .how.js-ready .how__draw {
        stroke-dashoffset: 0 !important;
    }
}
