/* How it works (app/pages/how-it-works.php). Banner, section heads, the FAQ and the CTA band come from
   wisdigix.css; this file holds the three routes, the six numbered stations beside the held photo, the
   scoping ledger, your part on the raised graphite band and who does the work on the oil band. Prefix hiw-. */

/* 1. Ways to start: the head on the left, three routes as ruled rows on the right
   ----------------------------------------------------------------------- */
.hiw-start__grid { display: grid; gap: var(--s-6) var(--gap); }
@media (min-width: 992px) {
    .hiw-start__grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        align-items: start;
    }
    .hiw-start__grid > .wg-section-head { grid-column: 1 / span 5; margin-bottom: 0; }
    .hiw-routes { grid-column: 7 / -1; }
}
.hiw-start .wg-section-head .wg-meta { margin: var(--s-4) 0 0; }

.hiw-routes {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule-strong);
}
.hiw-routes > li { border-bottom: 1px solid var(--rule); }
.hiw-route {
    position: relative;
    display: grid;
    gap: .5rem var(--s-6);
    padding: clamp(1.5rem, 1.2rem + 1vw, 2rem) 0;
    color: var(--fg);
    text-decoration: none;
}
.hiw-route:hover { color: var(--fg); }
.hiw-route:focus-visible { outline-offset: 4px; }
@media (min-width: 640px) {
    .hiw-route { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
    .hiw-route__title { grid-row: 1 / span 3; }
}
.hiw-route__title {
    margin: 0;
    color: var(--fg-strong);
    font-size: var(--fs-h3);
    font-weight: 620;
    line-height: 1.2;
    letter-spacing: -.016em;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
    transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.hiw-route__text { margin: 0; }
.hiw-best {
    margin: 0;
    color: var(--fg-muted);
    font-size: var(--fs-small);
    line-height: 1.5;
}
.hiw-route__more { margin-top: .375rem; justify-self: start; }
.hiw-route:hover .hiw-route__title,
.hiw-route:focus-visible .hiw-route__title { text-decoration-color: var(--accent-fg); }
@media (hover: hover) and (pointer: fine) {
    .hiw-route:hover .hiw-route__more .wg-icon { transform: translateX(3px); }
}

/* 2. Process: six numbered stations on one rail, the photo held beside them
   ----------------------------------------------------------------------- */
.hiw-process { --station-ground: var(--ground); }
.hiw-process.wg-section--stone { --station-ground: var(--ground-alt); }
.hiw-process__grid { display: grid; gap: var(--s-8) var(--gap); }
@media (min-width: 992px) {
    .hiw-process__grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        align-items: start;
    }
    .hiw-stations { grid-column: 1 / span 7; }
    .hiw-process__aside { grid-column: 9 / -1; }
}

.hiw-stations { margin: 0; padding: 0; list-style: none; }
.hiw-station {
    position: relative;
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 0 clamp(1.25rem, .8rem + 1.6vw, 2.25rem);
    padding-bottom: clamp(2.5rem, 2rem + 2vw, 3.75rem);
}
.hiw-station:last-child { padding-bottom: 0; }
/* The rail: from the foot of one index to the head of the next */
.hiw-station::before {
    content: "";
    position: absolute;
    top: 3rem;
    bottom: 0;
    left: calc(1.5rem - .5px);
    border-left: 1px solid var(--rule-strong);
}
.hiw-station:last-child::before { display: none; }
.hiw-station__index {
    position: relative;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--station-ground);
    color: var(--fg-strong);
    font-family: var(--font-mono);
    font-size: .875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    line-height: 1;
}
/* The first station is where every project starts: it carries the one orange mark */
.hiw-station:first-child .hiw-station__index::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--station-ground);
    border-radius: 50%;
    background: var(--fg-strong);   /* "start here": a mist dot (orange is reserved for actions and the active state) */
    box-sizing: content-box;
}
.hiw-station__body { min-width: 0; }
.hiw-station__title {
    margin: .625rem 0 .625rem;
    font-size: var(--fs-h3);
    font-weight: 620;
    line-height: 1.25;
    letter-spacing: -.014em;
}
.hiw-station__body > p { max-width: 38rem; margin: 0; }

/* You / We: the handoff in each station, two columns from 768px */
.hiw-roles {
    display: grid;
    margin: 1.375rem 0 0;
    border-top: 1px solid var(--rule);
}
.hiw-roles__row {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: .25rem 1rem;
    align-items: baseline;
    padding: .875rem 0;
    border-bottom: 1px solid var(--rule);
}
.hiw-roles dt {
    color: var(--fg-strong);
    font-size: var(--fs-label);
    font-weight: 650;
    letter-spacing: .02em;
    line-height: 1.5;
}
.hiw-roles dd {
    margin: 0;
    color: var(--fg);
    font-size: var(--fs-small);
    line-height: 1.55;
}
@media (min-width: 768px) {
    .hiw-roles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--gap);
        border-top: 0;
    }
    .hiw-roles__row {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        padding-top: .75rem;
        border-top: 1px solid var(--rule);
        border-bottom: 0;
    }
}

/* The held photo, with its note set on an obsidian shade at the foot (the only place text meets it) */
.hiw-feature {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--c-coal);
}
.hiw-feature img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: 58% 50%;
}
.hiw-feature__note {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 5rem clamp(1.25rem, 1rem + 1vw, 1.75rem) clamp(1.25rem, 1rem + 1vw, 1.75rem);
    background: linear-gradient(0deg, color-mix(in srgb, var(--c-obsidian) 92%, transparent) 0, color-mix(in srgb, var(--c-obsidian) 70%, transparent) 45%, transparent);
    color: var(--c-mist);
    font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.01em;
}
@media (min-width: 992px) {
    .hiw-feature img { aspect-ratio: 4 / 5; }
}
@media (max-width: 991px) {
    .hiw-process__aside { max-width: 40rem; }
}

/* 3. Scoping: the three tiers as a ruled ledger, then how the work runs and how it's priced
   ----------------------------------------------------------------------- */
.hiw-tiers {
    display: grid;
    border-top: 1px solid var(--rule-strong);
}
.hiw-tier {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: var(--s-6) 0;
    border-bottom: 1px solid var(--rule);
}
.hiw-tier p { margin: 0; }
.hiw-tier__title {
    margin: 0;
    font-size: var(--fs-h3);
    font-weight: 620;
    line-height: 1.25;
    letter-spacing: -.014em;
}
.hiw-tier .hiw-tier__count {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin-top: auto;
    padding-top: var(--s-4);
    color: var(--fg-muted);
    font-size: var(--fs-small);
}
.hiw-tier__count .wg-num {
    color: var(--fg-strong);
    font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.02em;
}
.hiw-examples {
    display: grid;
    gap: .375rem;
    margin: 0;
    padding: .75rem 0 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}
@media (min-width: 768px) {
    .hiw-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hiw-tier {
        padding: var(--s-6) var(--gap) var(--s-6) 0;
        border-bottom: 0;
    }
    .hiw-tier + .hiw-tier {
        padding-left: var(--gap);
        border-left: 1px solid var(--rule);
    }
    .hiw-tiers { border-bottom: 1px solid var(--rule); }
}

.hiw-terms {
    display: grid;
    gap: var(--s-7) var(--gap);
    margin-top: clamp(3.5rem, 2.4rem + 3.6vw, 6rem);
}
@media (min-width: 992px) {
    .hiw-terms { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .hiw-terms__col:first-child { grid-column: 1 / span 6; }
    .hiw-terms__col:last-child { grid-column: 8 / -1; }
}
.hiw-terms .wg-h3 { margin: 0 0 1.125rem; }
.hiw-terms__col > p { max-width: 34rem; margin: 0 0 1rem; }
.hiw-terms__col > :last-child { margin-bottom: 0; }
.hiw-engagements { margin: 0; border-top: 1px solid var(--rule-strong); }
.hiw-engagements > div {
    display: grid;
    gap: .25rem 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
}
.hiw-engagements dt {
    color: var(--fg-strong);
    font-size: var(--fs-small);
    font-weight: 620;
    line-height: 1.5;
}
.hiw-engagements dd {
    margin: 0;
    color: var(--fg);
    font-size: var(--fs-small);
    line-height: 1.55;
}
@media (min-width: 480px) {
    .hiw-engagements > div { grid-template-columns: minmax(9rem, 2fr) minmax(0, 3fr); }
}

/* 4. Your part, on the raised graphite band: the head on the left, the list as ruled lines on the right
   ----------------------------------------------------------------------- */
.hiw-part__grid { display: grid; gap: var(--s-6) var(--gap); }
@media (min-width: 992px) {
    .hiw-part__grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        align-items: start;
    }
    .hiw-part__grid > .wg-section-head { grid-column: 1 / span 5; margin-bottom: 0; }
    .hiw-needs { grid-column: 7 / -1; }
}
.hiw-needs {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}
.hiw-needs li {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    color: var(--fg-strong);
    font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
    font-weight: 500;
    line-height: 1.45;
}
.hiw-needs .wg-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: .1em;
    color: var(--accent-fg);
    stroke-width: 2;
}

/* 5. Who does the work, on the oil band: the photo fills the left half, the text sits in the right columns
   ----------------------------------------------------------------------- */
.hiw-work { overflow: hidden; background-color: var(--c-oil); } /* .wg-dark's role in the dark system: the deepest band */
.hiw-work__media {
    position: relative;
    margin: 0;
    background: var(--c-coal);
}
.hiw-work__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 35% 50%;
}
.hiw-work__text > .wg-title { max-width: 12em; margin-bottom: var(--s-5); }
.hiw-work__desc { max-width: 36rem; margin: 0 0 var(--s-6); color: var(--fg); font-size: var(--fs-lead); line-height: 1.5; }
.hiw-work__list {
    display: grid;
    gap: .875rem;
    margin: 0;
    padding: var(--s-5) 0 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}
.hiw-work__list li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--fg-strong);
    line-height: 1.5;
}
/* Each line hangs off a small right-angle connector, the coordination view's line language */
.hiw-work__list li::before {
    content: "";
    position: absolute;
    top: .2em;
    left: .125rem;
    width: .75rem;
    height: .6em;
    border-bottom: 1px solid var(--rule-strong);
    border-left: 1px solid var(--rule-strong);
}
.hiw-work__note { margin: var(--s-5) 0 0; color: var(--fg-muted); font-size: var(--fs-small); }
@media (max-width: 991px) {
    .hiw-work { padding-top: 0; }
    .hiw-work__media { margin-bottom: var(--s-8); }
    .hiw-work__media img { aspect-ratio: 16 / 10; }
}
@media (min-width: 992px) {
    .hiw-work__media {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 50%;
    }
    /* An oil veil on the inner edge only, so the photo meets the band without a seam */
    .hiw-work__media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(270deg, var(--c-oil) 0, color-mix(in srgb, var(--c-oil) 40%, transparent) 14%, transparent 34%);
        pointer-events: none;
    }
    .hiw-work__grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: var(--gap);
        min-height: 26rem;
        align-items: center;
    }
    .hiw-work__text { grid-column: 8 / -1; }
}

/* 6. Questions: the head holds the left columns while the answers run beside it
   ----------------------------------------------------------------------- */
@media (min-width: 992px) {
    .hiw-faq__grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: var(--gap);
        align-items: start;
    }
    .hiw-faq__grid > .wg-section-head {
        position: sticky;
        top: calc(72px + var(--s-6));
        grid-column: 1 / span 4;
        margin-bottom: 0;
    }
    .hiw-faq__grid > .wg-faq { grid-column: 6 / -1; }
}

@media print {
    .hiw-process__aside,
    .hiw-work__media { display: none; }
}

/* Same ground, one hairline: the oil band and the obsidian sections beside it differ by too little to read
   as an edge, so the seam on either side is a 1px rule (the coal and graphite grounds carry their own edge) */
.wg-section:not(.wg-section--stone):not(.wg-ice):not(.wg-dark) + .wg-dark,
.wg-dark + .wg-section:not(.wg-section--stone):not(.wg-ice):not(.wg-dark) { border-top: 1px solid var(--rule); }
