/* Services: "What we do" as a scroll story. The left stage holds one Hairline slab figure,
   decorative, camera-framed on each discipline as its block passes the focus line (svc.js). */

.nav { position: sticky; top: 0; z-index: 20; }

/* No JS: no stage, the blocks read as a plain full-measure stack. */
.story__stage { display: none; }
.js .story__stage { display: block; }
html:not(.js) .story__grid { display: block; }

.svc-cam { position: absolute; inset: 0; }
/* A class wins over the kernel's :where([data-hairline]) box, which keeps aspect-ratio 5/4. */
.svc-fig { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }

.story__text { display: grid; position: relative; }

.block { position: relative; }
.spine { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; }
/* The hairline track behind the fill; the fill covers it when full. */
.spine::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: rgba(0, 0, 0, .2); }
/* No-JS fallback: a smooth blend through the four colours. svc.js replaces it with pixel stops. */
.spine i { position: absolute; inset: 0; background: linear-gradient(to bottom, var(--strategy), var(--design) 33%, var(--software) 66%, var(--result)); }

.block h3 { font: var(--t-h3); letter-spacing: -.01em; margin: 0 0 12px; }
.promise { font: var(--t-lead); margin: 0 0 16px; }
.method { font: var(--t-body); margin: 0 0 24px; }
.label2 { font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4px; }
.deliverable, .gets li { font: var(--t-lead); }
.gets { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* Default (no JS): titles and deliverables ink, the promise and method body; spines full. */
.block h3, .label2, .deliverable, .gets li { color: var(--ink); }
.promise, .method { color: var(--body); }

/* Live: the active block's text is ink; the rest are muted. Colour eases between blocks. */
.live .block h3, .live .block p, .live .block li { transition: color .35s; }
.live .block:not(.on) h3, .live .block:not(.on) p, .live .block:not(.on) li { color: var(--muted); }
.live .block.on h3, .live .block.on p, .live .block.on li { color: var(--ink); }

/* Still (reduced motion): every block is at its final state. */
.still .block h3, .still .block p, .still .block li { color: var(--ink); }

@media (min-width: 961px) {
  .story__grid { display: grid; grid-template-columns: 7fr 5fr; align-items: start; }
  .story__stage { position: sticky; top: calc(var(--nav-h, 80px) + 48px); height: min(560px, 70vh); align-self: start; overflow: hidden; background: var(--paper); z-index: 1; }
  .story__text { row-gap: 48px; }
  .block { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; padding-left: 56px; }
}

@media (max-width: 960px) {
  /* Block flow, not a grid: a sticky stage has to travel the whole text column, and a grid
     row would confine it to its own row. */
  .story__grid { display: block; }
  .story__text { row-gap: 24px; }
  .story__stage { position: sticky; top: var(--nav-h, 64px); z-index: 2; height: 38vh; margin: 0 calc(-1 * var(--margin)); background: var(--paper); border-bottom: 1px solid rgba(0, 0, 0, .2); overflow: hidden; }
  .block { min-height: 55vh; display: flex; flex-direction: column; justify-content: center; padding-left: 28px; }
  .spine { width: 4px; }
}

/* The slab's palette, copied from the home page. */
.svc-fig {
  --hairline-plate: var(--paper);
  --hairline-stroke: 1;
  --hairline-edge: rgba(17, 17, 17, .45);
  --hairline-mid: rgba(17, 17, 17, .45);
  --hairline-lo: rgba(17, 17, 17, .45);
}
.svc-fig svg .hi { stroke-width: 1.5px; }
.svc-fig [data-kind="strategy"] .hi { stroke: var(--strategy); }
.svc-fig [data-kind="design"] .hi { stroke: var(--design); }
.svc-fig [data-kind="software"] .hi { stroke: var(--software); }
.svc-fig svg .dot.off { fill: rgba(17, 17, 17, .34); }

/* Chief's craft pass (Nov 12): keep the home page's 1px hairline when the camera zooms; let
   the zoomed slab fade out at the stage edges instead of a hard crop; no column rule (the
   hairline spine tracks stacked into a table divider). */
.svc-cam :is(path, line, polyline, polygon, ellipse, circle, rect) { vector-effect: non-scaling-stroke; }
.spine::before { display: none; }
@media (min-width: 961px) {
  .story__stage { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%); }
}

/* Close: the home page's close (full/full.css, Night ground, scan on the right, footer inside the
   black). Copied here so this page matches; site.css stays read-only. */
/* Close and night footer: shared rules in ../css/nav.css. */
/* How we work: a full-bleed image band on a dark ground. The image drifts with scroll (--hw-x,
   set by svc.js) and is scaled 1.06 so its edges never show; the scrim keeps the white text
   readable. Reduced motion: svc.js does not arm the band, so the steps stay shown.
   The band is composed by its content: a viewport-height floor left the four steps floating in
   a field of grass, so the generous padding above and below now defines the band instead. */
.hw {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100vw; margin-left: calc(50% - 50vw); border-top: 0; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 0;
  padding: 160px var(--margin); background: var(--ink); color: var(--paper);
}
.hw::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: -48px; z-index: -2; pointer-events: none;
  background: url("../assets/img/services-motion.jpg") center / cover no-repeat;
  transform: translate3d(var(--hw-x, 0px), 0, 0) scale(1.06); will-change: transform; }
.hw::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, 0) 70%), rgba(0, 0, 0, .42); }
.hw > * { position: relative; z-index: 1; }
@media (max-width: 760px) { .hw { padding: 96px var(--margin); } }

/* The band's label is its headline: one large white line with 64px of air before the steps. */
.hw .head { margin-bottom: 64px; }
.hw .label { color: var(--paper); font: var(--t-h2); letter-spacing: -.02em; text-transform: none; }
.hw .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px; }
@media (max-width: 960px) { .hw .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hw .grid4 { grid-template-columns: 1fr; } }

/* Steps: a short 32px x 4px colour bar replaces the 6px full-width tab; no hover growth. */
.hw .step { border-top: 1px solid rgba(255, 255, 255, .3); }
.hw .step::before { top: -1px; left: 0; width: 32px; height: 4px; background: var(--c); transform: none; transition: none; }
.hw .step:hover::before { transform: none; }
.hw .step .num { color: var(--paper); }
.hw .step h3 { color: var(--paper); font: var(--t-h3); letter-spacing: -.01em; }
.hw .step p, .hw .step .kicker { color: rgba(255, 255, 255, .88); }
/* The step body grows with the band; the kicker keeps its small label voice. */
.hw .step p:not(.kicker) { font: var(--t-lead); }

/* Reveal (svc.js adds .hw--armed when the band can animate, .hw--in at 30% in view). */
.hw.hw--armed .step { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.hw.hw--armed.hw--in .step { opacity: 1; transform: none; }
.hw.hw--armed.hw--in .step:nth-child(2) { transition-delay: 90ms; }
.hw.hw--armed.hw--in .step:nth-child(3) { transition-delay: 180ms; }
.hw.hw--armed.hw--in .step:nth-child(4) { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  .hw .step { opacity: 1; transform: none; transition: none; }
}

/* Chief: phones stack the steps over the brighter part of the image; a firmer scrim keeps every line >= 4.5:1. */
@media (max-width: 600px) { .hw::after { background: linear-gradient(0deg, rgba(0, 0, 0, .55) 0, rgba(0, 0, 0, .1) 80%), rgba(0, 0, 0, .58); } }

/* Round 2 (Director). Each block below overrides an earlier rule; later rules win. */

/* 1. How we work: vertical stems instead of horizontal tabs. Each step has an 8px stem at its left
   edge, full step height, with a 48px gutter to the text (24px on phones). The stem draws top to
   bottom on reveal (svc.js adds .hw--armed / .hw--in). No horizontal rule. */
.hw .step { border-top: 0; padding: 0 0 0 56px; }
.hw .step::before { display: none; }
.hw .step::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--c); transform-origin: top; }
@media (max-width: 600px) { .hw .step { padding-left: 32px; } }
.hw.hw--armed .step::after { transform: scaleY(0); transition: transform .6s var(--ease); }
.hw.hw--armed.hw--in .step::after { transform: scaleY(1); }
.hw.hw--armed.hw--in .step:nth-child(2)::after { transition-delay: 90ms; }
.hw.hw--armed.hw--in .step:nth-child(3)::after { transition-delay: 180ms; }
.hw.hw--armed.hw--in .step:nth-child(4)::after { transition-delay: 270ms; }
@media (prefers-reduced-motion: reduce) {
  .hw .step::after { transform: none; transition: none; }
}

/* 3. Slab story: the stage is the viewport below the nav, less 48px; the label sits directly over it. */
.story { gap: 0; }
@media (min-width: 961px) {
  .story__stage { height: calc(100vh - var(--nav-h, 80px) - 48px); }
}

/* 4. Phones: sections that start under the floating logo island get at least 96px of top padding. */
@media (max-width: 760px) {
  .story { padding-top: 96px; }
  .hw { padding-top: 96px; }
}

/* Chief (Kassem: the Services and About openings share one system: the .open rules in ../css/nav.css).
   Only the photo is Services'. */
.open__img { background-image: url("../assets/img/services-water.jpg"); background-position: center 60%; }
