/* ==========================================================================
   02 How We Work
   One band of marks, read left to right: under Problem Diagnosis the marks point every way; through Strategic
   Direction they turn toward one heading; under Digital Execution they align into continuous lines; under
   Reporting and Learning they become measured ticks. The grid is derived from the stage columns. Selecting a
   stage frames the whole stage, the way the hero frames one part of the photograph.
   Below desktop each stage carries its own short stretch of field at its own state.
   ========================================================================== */

.hww { position: relative; overflow: hidden; padding: 104px var(--m) 96px; background: var(--slate); }
.hww__field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hww__field line { stroke: var(--c); transition: stroke .5s var(--ease) var(--d, 0s); }
.hww__field line.on { stroke: var(--cs); }

.hww__head { position: relative; }
.hww .eyebrow { color: rgba(246, 244, 239, .72); }

.stages { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; margin: 80px 0 0; padding: 0; list-style: none; }
.stage { position: relative; cursor: pointer; }
.stage__plot { position: relative; height: 176px; }
.stage__frame { position: absolute; top: 0; left: calc(-1 * var(--fl, 22px)); width: calc(100% + var(--fl, 22px) + var(--fr, 18px)); height: calc(100% + var(--fb, 26px)); overflow: visible; pointer-events: none; }
.stage__frame rect { x: .5px; y: .5px; width: calc(100% - 1px); height: calc(100% - 1px); fill: none; stroke: var(--bone); stroke-opacity: .42; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .25s var(--ease); }
.stage.is-on .stage__frame rect { stroke-dashoffset: 0; transition: stroke-dashoffset .8s cubic-bezier(.6, .1, .2, 1) .05s; }

.stage__txt { padding-top: 30px; }
.stage__num { display: block; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; color: rgba(246, 244, 239, .6); transition: color .4s var(--ease); }
.stage.is-on .stage__num { color: var(--sage); }
.stage h3 { margin: 14px 0 0; font-family: var(--display); font-stretch: 92%; font-weight: 500; font-size: clamp(23px, 1.95vw, 28px); line-height: 1.1; letter-spacing: -0.01em; color: rgba(246, 244, 239, .8); transition: color .4s var(--ease); }
.stage.is-on h3 { color: var(--bone); }
.stage h3 button { all: unset; cursor: pointer; }
.stage h3 button::after { content: ''; position: absolute; inset: 0; }
.stage h3 button:focus-visible::after { outline: 2px solid var(--bone); outline-offset: 6px; }
.stage p { margin: 16px 0 0; max-width: 21em; font-size: 16px; line-height: 1.6; color: rgba(246, 244, 239, .66); text-wrap: pretty; transition: color .4s var(--ease); }
.stage p strong { font-weight: 500; color: rgba(246, 244, 239, .8); transition: color .4s var(--ease); }
.stage.is-on p { color: rgba(246, 244, 239, .82); }
.stage.is-on p strong { color: var(--bone); }

.hww__foot { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; margin-top: 58px; }
.hww__foot .link { grid-column: 4; justify-self: start; font-size: 17px; }

@media (prefers-reduced-motion: no-preference) {
  .hww__field line { transform-box: fill-box; transform-origin: center; }
  .hww.pre .hww__field line { transform: scale(0); }
  .hww.in .hww__field line { animation: lay .8s var(--ease) var(--a, 0s) both; }
}
@keyframes lay { from { transform: scale(0); } to { transform: none; } }

/* laptop and tablet: two by two, each stage with its own stretch of field */
@media (max-width: 1100px) {
  .hww { padding-top: 96px; }
  .stages, .hww__foot { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
  .stages { row-gap: 64px; margin-top: 64px; }
  .stage p { max-width: 30em; }
  .hww__foot .link { grid-column: 2; }
}
/* phones: the four stages become a swipeable row. One stage at a time, the next one peeking in at the edge;
   each stage carries its own four-row strip of field. Heading and CTA stay outside the scrolling row. */
@media (max-width: 640px) {
  .hww { padding: 80px var(--m) 72px; }
  .stages { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(100% - 44px); gap: 12px;
    margin: 40px calc(-1 * var(--m)) 0; padding: 0 var(--m); scroll-padding-inline: var(--m);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .stages::-webkit-scrollbar { display: none; }
  .stage { scroll-snap-align: start; padding: 18px 18px 24px; }
  .stage__frame { top: 0; left: 0; width: 100%; height: 100%; }
  .stage__txt { padding-top: 18px; }
  .stage h3 br { display: none; }
  .stage p { font-size: 15.5px; }
  .hww .carousel-nav { display: flex; }
  .hww__foot { grid-template-columns: 1fr; margin-top: 28px; }
  .hww__foot .link { grid-column: 1; }
}

/* hero → How We Work: when the hero stacks (tablet and phone), its copy and this section share the Slate
   surface, so the join needs less space than a change of section would */
@media (max-width: 900px) { .hww { padding-top: 64px; } }
@media (max-width: 640px) { .hww { padding-top: 56px; } }
