/* Work-page refinements, using the existing palette, shell and breakpoints. */
.work-main {
  --work-section-space: clamp(64px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  gap: var(--work-section-space);
}
.work-main > section { margin-top: 0; }
.work-main .work-intro { padding-bottom: 0; }
.work-intro h1 { margin-bottom: 0; line-height: 1.1; }
/* The reveal mask previously ended at the tight line box and clipped glyphs.
   Leave clearance for descenders and the existing kinetic letter movement. */
html.motion-ready .work-intro h1[data-reveal="mask"].is-visible {
  clip-path: inset(-.2em -.12em -.28em);
}
.work-section-label {
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .07em;
}
.work-process__stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
}
.work-process__stages::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--line);
  transform-origin: left center;
}
.work-process__stages > li {
  position: relative;
  min-width: 0;
  padding: 0 26px 28px 0;
}
.work-process__stages > li::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.work-process__number {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.work-process h3 {
  margin-bottom: 8px;
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.work-process li p {
  max-width: 28ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}
.client-work > .work-grid { margin-top: 28px; row-gap: var(--work-section-space); }
.work-main .work-closing { padding-bottom: var(--work-section-space); }
/* The footer cannot reach the existing observer's inset viewport at the end
   of this page. Keep its links visible rather than waiting for that reveal. */
.work-body .site-footer > [data-reveal] { opacity: 1; transform: none; filter: none; }

@media (max-width: 820px) {
  .work-main { --work-section-space: clamp(48px, 7vw, 64px); }
  .work-process__stages { grid-template-columns: 1fr; gap: 24px; margin-top: 26px; }
  .work-process__stages::before { content: none; }
  .work-process__stages > li { padding: 0 0 0 26px; }
  .work-process__stages > li:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: -32px;
    left: 3px;
    width: 1px;
    background: var(--line);
    transform-origin: center top;
  }
  .work-process__stages > li::after { top: 6px; bottom: auto; }
  .work-process__number { margin-bottom: 6px; }
  .work-process li p { max-width: 46ch; }
}
@media (max-width: 700px) {
  .work-section-label { padding-top: 14px; font-size: 12px; }
}

/* One shared seven-second clock; the grey baseline never animates.
   Geometry is measured from the existing dots, including unequal mobile rows. */
.work-process__stages { --process-cycle: 7s; }
.work-process__stages::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .work-process.is-running .work-process__stages::after {
    animation: work-process-travel var(--process-cycle) var(--ease) infinite;
  }
  .work-process.is-running li::after {
    animation: var(--process-dot-animation) var(--process-cycle) var(--ease) infinite;
  }
  .work-process.is-running li h3,
  .work-process.is-running li p {
    animation: var(--process-text-animation) var(--process-cycle) var(--ease) infinite;
  }
  .work-process.is-running li h3 { --process-rest-opacity: .94; }
  .work-process.is-running li p { --process-rest-opacity: 1; }
  @keyframes work-process-travel {
    0% { opacity: 1; transform: translate(var(--process-x-1), var(--process-y-1)); }
    14.2857% { transform: translate(var(--process-x-2), var(--process-y-2)); }
    28.5714% { transform: translate(var(--process-x-3), var(--process-y-3)); }
    42.8571%, 71.4286% { opacity: 1; transform: translate(var(--process-x-4), var(--process-y-4)); }
    78.5714%, 85.7143% { opacity: 0; transform: translate(var(--process-x-4), var(--process-y-4)); }
    85.7144%, 92.8571% { opacity: 0; transform: translate(var(--process-x-1), var(--process-y-1)); }
    100% { opacity: 1; transform: translate(var(--process-x-1), var(--process-y-1)); }
  }
  .work-process.is-running li:nth-child(1) {
    --process-dot-animation: work-process-dot-1;
    --process-text-animation: work-process-text-1;
  }
  @keyframes work-process-dot-1 {
    0% { background: var(--muted); }
    3.4286%, 71.4286% { background: var(--accent); }
    78.5714%, 100% { background: var(--muted); }
  }
  @keyframes work-process-text-1 {
    0% { transform: translateY(0); opacity: var(--process-rest-opacity); }
    3.4286%, 71.4286% { transform: translateY(-2px); opacity: 1; }
    78.5714%, 100% { transform: translateY(0); opacity: var(--process-rest-opacity); }
  }
  .work-process.is-running li:nth-child(2) {
    --process-dot-animation: work-process-dot-2;
    --process-text-animation: work-process-text-2;
  }
  @keyframes work-process-dot-2 {
    0%, 14.2857% { background: var(--muted); }
    17.7143%, 71.4286% { background: var(--accent); }
    78.5714%, 100% { background: var(--muted); }
  }
  @keyframes work-process-text-2 {
    0%, 14.2857% { transform: translateY(0); opacity: var(--process-rest-opacity); }
    17.7143%, 71.4286% { transform: translateY(-2px); opacity: 1; }
    78.5714%, 100% { transform: translateY(0); opacity: var(--process-rest-opacity); }
  }
  .work-process.is-running li:nth-child(3) {
    --process-dot-animation: work-process-dot-3;
    --process-text-animation: work-process-text-3;
  }
  @keyframes work-process-dot-3 {
    0%, 28.5714% { background: var(--muted); }
    32.0000%, 71.4286% { background: var(--accent); }
    78.5714%, 100% { background: var(--muted); }
  }
  @keyframes work-process-text-3 {
    0%, 28.5714% { transform: translateY(0); opacity: var(--process-rest-opacity); }
    32.0000%, 71.4286% { transform: translateY(-2px); opacity: 1; }
    78.5714%, 100% { transform: translateY(0); opacity: var(--process-rest-opacity); }
  }
  .work-process.is-running li:nth-child(4) {
    --process-dot-animation: work-process-dot-4;
    --process-text-animation: work-process-text-4;
  }
  @keyframes work-process-dot-4 {
    0%, 42.8571% { background: var(--muted); }
    46.2857%, 71.4286% { background: var(--accent); }
    78.5714%, 100% { background: var(--muted); }
  }
  @keyframes work-process-text-4 {
    0%, 42.8571% { transform: translateY(0); opacity: var(--process-rest-opacity); }
    46.2857%, 71.4286% { transform: translateY(-2px); opacity: 1; }
    78.5714%, 100% { transform: translateY(0); opacity: var(--process-rest-opacity); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .work-process__stages > li::after { background: var(--accent); }
}
@media print {
  .work-process.is-running li::after,
  .work-process.is-running li h3,
  .work-process.is-running li p { animation: none; }
  .work-process.is-running .work-process__stages::after { display: none; animation: none; }
  .work-process__stages > li::after { background: var(--accent); }
}
