/* ═══════════════════════════════════════════════════════════════════════════
   WORK: index grid and case study
   After the reference's use-cases archive and single use case, in our
   colours: brand green page, near-black tiles, the reference's light neutral
   (Toasted Sand) only as the hover state and the case card. Motion follows the
   site-wide curve (--motion-ease, expo.out) and stays on transform/opacity.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Index: filter bar ──────────────────────────────────────────────────── */
.wk__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 40px;
  margin-bottom: 40px;
}
.wk__bar .section-label { margin-bottom: 0; }
.wk__filters { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.wk__filter {
  min-height: 44px;
  padding: 0;
  color: var(--text-muted);
  transition: color 0.6s var(--motion-ease);
}
.wk__filter sup { font-size: 0.7em; margin-left: 2px; opacity: 0.7; }
.wk__filter:hover { color: var(--text); }
.wk__filter.is-active { color: var(--text); }   /* marked by a ">" arrow (motion.css) */

/* ── Index: grid ────────────────────────────────────────────────────────── */
.wk__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(22px, 2vw, 32px);
  row-gap: clamp(20px, 1.7vw, 28px);
}
@media (max-width: 1023px) { .wk__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .wk__grid { grid-template-columns: 1fr; } }

.wk__item[hidden] { display: none; }
.wk__item[data-animate-in] { opacity: 1; }

/* ── Index: tile ────────────────────────────────────────────────────────── */
.wk__tile {
  position: relative;
  aspect-ratio: 3.15 / 1;
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 44%);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px 14px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: var(--leaf);
  color: var(--text);
  opacity: 1;
  overflow: hidden;
  box-shadow: 0 10px 28px -24px rgba(14, 42, 30, 0.72);
  transform: translateZ(0);
  transition: transform 0.7s var(--motion-ease), box-shadow 0.7s var(--motion-ease);
}
.wk__index { grid-column: 1; grid-row: 1; color: rgba(246, 245, 243, 0.78); transition: color 0.55s var(--motion-ease); }
.wk__media {
  grid-column: 2; grid-row: 1 / -1;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--white);
  opacity: 1;
  transform: translateZ(0);
}
.wk__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 1;
  filter: none;
  transition: transform 0.7s var(--motion-ease), filter 0.7s var(--motion-ease);
}
.wk__meta { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 6px; align-self: end; min-width: 0; position: relative; z-index: 1; }
.wk__kind { color: var(--text-muted); transition: color 0.55s var(--motion-ease); }
.wk__title { color: var(--text); max-width: 17ch; font-size: clamp(17px, 1.3vw, 22px); line-height: 1.02; }
.wk__go {
  position: absolute; left: 12px; top: 38px;
  display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transform: translate3d(0, 4px, 0);
  transition: opacity 0.45s var(--motion-ease), transform 0.45s var(--motion-ease);
}
.wk__arrow { transition: transform 1s var(--motion-ease); }

/* Text-only live projects receive an abstract interface preview so the card
   composition stays consistent until a project screenshot is added. */
.wk__tile--text::after {
  content: '';
  grid-column: 2;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(38, 80, 60, 0.18), rgba(38, 80, 60, 0.18)) 12px 14px / 52% 7px no-repeat,
    linear-gradient(rgba(38, 80, 60, 0.1), rgba(38, 80, 60, 0.1)) 12px 31px / calc(100% - 24px) 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(38, 80, 60, 0.08) 0 1px, transparent 1px 25%) 12px 48px / calc(100% - 24px) calc(100% - 60px) no-repeat,
    repeating-linear-gradient(0deg, rgba(38, 80, 60, 0.08) 0 1px, transparent 1px 24%) 12px 48px / calc(100% - 24px) calc(100% - 60px) no-repeat,
    var(--white);
}
.wk__tile--text .wk__title { max-width: 12ch; }
.wk__tile--text .wk__go { color: currentColor; }

/* Each project has its own approved colour while the typography follows the
   contrast needs of that surface. The visual variety is deliberate, not a
   new set of page-level brand colours. */
.wk__item:nth-child(1) .wk__tile {
  background: var(--aqua);
}
.wk__item:nth-child(2) .wk__tile { background: var(--sand); }
.wk__item:nth-child(3) .wk__tile { background: var(--sky); }
.wk__item:nth-child(4) .wk__tile { background: var(--burnt-orange); }
.wk__item:nth-child(6) .wk__tile { background: var(--sun); }
.wk__item:nth-child(1) .wk__tile,
.wk__item:nth-child(2) .wk__tile,
.wk__item:nth-child(3) .wk__tile,
.wk__item:nth-child(6) .wk__tile { color: var(--green-strong); }
.wk__item:nth-child(1) .wk__title,
.wk__item:nth-child(1) .wk__kind,
.wk__item:nth-child(1) .wk__go,
.wk__item:nth-child(1) .wk__index,
.wk__item:nth-child(2) .wk__title,
.wk__item:nth-child(2) .wk__kind,
.wk__item:nth-child(2) .wk__go,
.wk__item:nth-child(2) .wk__index,
.wk__item:nth-child(3) .wk__title,
.wk__item:nth-child(3) .wk__kind,
.wk__item:nth-child(3) .wk__go,
.wk__item:nth-child(3) .wk__index,
.wk__item:nth-child(6) .wk__title,
.wk__item:nth-child(6) .wk__kind,
.wk__item:nth-child(6) .wk__go,
.wk__item:nth-child(6) .wk__index { color: var(--green-strong); }
/* Aqua and sky tiles: green-strong was 4.3:1 and 3.9:1. The deeper ink the
   homepage uses on sky clears AA on both. */
.wk__item:nth-child(1) .wk__title,
.wk__item:nth-child(1) .wk__kind,
.wk__item:nth-child(1) .wk__go,
.wk__item:nth-child(1) .wk__index,
.wk__item:nth-child(3) .wk__title,
.wk__item:nth-child(3) .wk__kind,
.wk__item:nth-child(3) .wk__go,
.wk__item:nth-child(3) .wk__index { color: #10281e; }

.wk__item:nth-child(4) .wk__tile,
.wk__item:nth-child(4) .wk__title,
.wk__item:nth-child(4) .wk__kind,
.wk__item:nth-child(4) .wk__go,
.wk__item:nth-child(4) .wk__index { color: #160a03; }   /* 5.0:1 on burnt orange */

/* Service cards continue the approved project palette without relying on
   list position, so filtering never changes their visual identity. */
.wk__item[data-tone='aqua'] .wk__tile { background: var(--aqua); }
.wk__item[data-tone='sand'] .wk__tile { background: var(--sand); }
.wk__item[data-tone='sky'] .wk__tile { background: var(--sky); }
.wk__item[data-tone='orange'] .wk__tile { background: var(--burnt-orange); }
.wk__item[data-tone='purple'] .wk__tile { background: var(--grant-purple); }
.wk__item[data-tone='sun'] .wk__tile { background: var(--sun); }
.wk__item[data-tone] .wk__tile,
.wk__item[data-tone] .wk__title,
.wk__item[data-tone] .wk__kind,
.wk__item[data-tone] .wk__go,
.wk__item[data-tone] .wk__index { color: var(--green-strong); }

/* Purple is reserved for dashboard/product UI and is used at full strength. */
.wk__item[data-accent='grant-dashboard'] .wk__tile {
  background: var(--grant-purple);
  color: var(--lc-ink, #26503c);
  box-shadow: none;
}
.wk__item[data-accent='grant-dashboard'] .wk__title,
.wk__item[data-accent='grant-dashboard'] .wk__kind,
.wk__item[data-accent='grant-dashboard'] .wk__go,
.wk__item[data-accent='grant-dashboard'] .wk__index { color: #120720; }   /* 4.9:1 on purple */

/* Hover and keyboard focus keep each card's identity and bring it forward. */
.wk__tile:hover,
.wk__tile:focus-visible {
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 24px 48px -30px rgba(14, 42, 30, 0.86);
}
.wk__tile:hover .wk__title, .wk__tile:focus-visible .wk__title,
.wk__tile:hover .wk__kind,  .wk__tile:focus-visible .wk__kind,
.wk__tile:hover .wk__go,    .wk__tile:focus-visible .wk__go { color: currentColor; }
.wk__tile:hover .wk__media img, .wk__tile:focus-visible .wk__media img { transform: scale(1.015); filter: none; }
.wk__tile:hover .wk__go, .wk__tile:focus-visible .wk__go { opacity: 1; transform: none; }
.wk__tile:hover .wk__arrow, .wk__tile:focus-visible .wk__arrow { transform: translate3d(4px, 0, 0); }
.wk__tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wk__item[data-accent='grant-dashboard'] .wk__tile:hover,
.wk__item[data-accent='grant-dashboard'] .wk__tile:focus-visible {
  box-shadow: 0 24px 48px -30px rgba(14, 42, 30, 0.86);
}

/* Touch: show the call to action, since there is no hover to reveal it. */
@media (hover: none) { .wk__go { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .wk__tile,
  .wk__media img,
  .wk__go,
  .wk__arrow { transition: none; }
  .wk__tile:hover,
  .wk__tile:focus-visible,
  .wk__tile:hover .wk__media img,
  .wk__tile:focus-visible .wk__media img { transform: none; }
}

@media (max-width: 1220px) {
  .wk__tile { aspect-ratio: 2.65 / 1; min-height: 144px; }
}
@media (max-width: 700px) {
  .wk__grid { row-gap: 18px; }
  .wk__tile { aspect-ratio: 2.6 / 1; min-height: 138px; }
}
@media (max-width: 430px) {
  .wk__tile { aspect-ratio: 2.15 / 1; grid-template-columns: minmax(0, 1fr) minmax(112px, 42%); }
  .wk__kind { font-size: 10px; }
}

/* ── Case study ─────────────────────────────────────────────────────────── */
.cs {
  display: grid;
  grid-template-columns: 16vw minmax(0, 1fr) 6vw;
  gap: 24px;
  padding: 200px var(--gutter) var(--section-y);
}
.cs__rail { position: relative; }
.cs__back {
  position: sticky; top: 150px;
  color: var(--text);
  gap: 10px;
}
.cs__back-arrow { transform: rotate(180deg); transition: transform 0.7s var(--motion-ease); }
.cs__back:hover .cs__back-arrow { transform: rotate(180deg) translateX(4px); }

.cs__card {
  grid-column: 2;
  background: var(--panel);
  color: var(--ink);
  border-radius: 0;
  padding: clamp(24px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vw, 56px);
}
.cs__head { display: flex; flex-direction: column; gap: 20px; }
/* 0.66, not 0.6: on Toasted Sand 60% ink is 4.39:1, just under AA. */
.cs__meta { color: var(--green-strong, #26503c); }
.cs__title { color: var(--ink); }
.cs__lead { color: var(--green-strong, #26503c); max-width: 52ch; }

/* Solid tint (the old 6% leaf wash, flattened onto the white card). */
.cs__media { margin: 0; border-radius: 0; overflow: hidden; background: #ECF0EB; }
.cs__media img { display: block; width: 100%; height: auto; }
.cs__media--phone { max-width: 280px; justify-self: center; border-radius: 0; }

.cs__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.cs__facts > div { padding: 16px 18px; border-radius: 0; background: var(--sand); }
.cs__facts > div:nth-child(2) { background: color-mix(in srgb, var(--sky) 52%, var(--white)); }
.cs__facts > div:nth-child(3) { background: color-mix(in srgb, var(--aqua) 52%, var(--white)); }
.cs__facts > div:nth-child(4) { background: color-mix(in srgb, var(--sun) 48%, var(--white)); }
.cs__facts dt { color: var(--green-strong, #26503c); margin-bottom: 8px; }
.cs__facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.cs__link { color: var(--green-bg); font-weight: 700; }

.cs__section { display: flex; flex-direction: column; gap: 16px; }
.cs__section--split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.cs__section p { color: var(--green-strong, #26503c); max-width: 48ch; }
.cs__label { color: var(--green-strong, #26503c); margin: 0; }
.cs__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cs__tags li { padding: 8px 14px; border-radius: 999px; background: var(--sand); color: var(--green-strong); }
.cs__tags li:nth-child(2) { background: color-mix(in srgb, var(--aqua) 55%, var(--white)); }
.cs__tags li:nth-child(3) { background: color-mix(in srgb, var(--sky) 55%, var(--white)); }

/* Brand green as text on the light card needs the deep green for contrast. */
.cs__card .link-arrow { color: var(--green-bg); }

.cs-next { padding: 0 var(--gutter) var(--section-y); }
.cs-next__link {
  display: flex; flex-direction: column; gap: 12px;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 0;
  background: var(--aqua);
  color: var(--green-strong);
  transition: background-color 1s var(--motion-ease), color 1s var(--motion-ease);
}
.cs-next__eyebrow { color: #10281e; }

/* The expanded dashboard concept carries the same scoped purple cue as its
   archive tile, without changing the green page ground or global controls. */
.pillar[data-accent='grant-dashboard'] {
  padding-inline: clamp(20px, 3vw, 44px);
  border-radius: 0;
  background: color-mix(in srgb, var(--grant-purple) 18%, transparent);
  box-shadow: inset 4px 0 0 var(--grant-purple);
}
.cs-next__link:hover { background: var(--sand); color: var(--ink); }
.cs-next__link:hover .cs-next__eyebrow { color: var(--green-bg); }

@media (max-width: 1023px) {
  .cs { grid-template-columns: 1fr; padding-top: 140px; }
  .cs__card { grid-column: 1; }
  .cs__back { position: static; }
  .cs__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs__section--split { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .wk__filter, .wk__tile, .wk__index, .wk__kind, .wk__media img, .wk__go, .wk__arrow,
  .cs__back-arrow, .cs-next__link { transition: none; }
  .wk__tile:hover .wk__media img { transform: none; }
}

/* ── Client work: each live project led by its screenshot ──────────────────
   A bone card per project (ink type, 8:1) so the words read cleanly on the
   green page. The screenshot sits in a simple browser frame; alternate rows
   swap sides so three projects do not read as a list. */
.wp__heading { margin: 0 0 clamp(36px, 4vw, 56px); }
.wp__project {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 3.5vw, 56px);
  align-items: center;
  padding: clamp(16px, 2vw, 24px);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
}
.wp__project + .wp__project { margin-top: clamp(20px, 2vw, 28px); }
.wp__project--reverse .wp__shot { order: 2; }
.wp__shot {
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: #e8e8e5;
  box-shadow: 0 1px 0 rgba(38, 80, 60, 0.12);
}
.wp__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(38, 80, 60, 0.12);
}
.wp__dots { display: inline-flex; gap: 6px; }
.wp__dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(38, 80, 60, 0.25); }
.wp__url { color: rgba(38, 80, 60, 0.85); }
.wp__shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.9s var(--motion-ease);
}
.wp__project:hover .wp__shot img { transform: scale(1.02); }
.wp__body { display: flex; flex-direction: column; gap: 16px; padding: clamp(4px, 1vw, 16px); }
.wp__meta { color: var(--ink); opacity: 0.85; }
.wp__title { color: var(--ink); margin: 0; font-size: clamp(26px, 2.4vw, 36px); line-height: 1; }
.wp__copy { color: var(--ink); margin: 0; max-width: 46ch; }
.wp__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.wp__tags li { padding: 7px 10px; border-radius: 999px; background: rgba(71, 156, 115, 0.14); color: var(--ink); }
.wp__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 8px; }
.wp__ext { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); }
.wp__ext svg { transition: transform 0.4s var(--motion-ease); }
.wp__ext:hover svg { transform: translateX(3px); }

/* ── Explorations: smaller cards, one row of three ─────────────────────── */
.wx__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: clamp(32px, 4vw, 48px); }
.wx__heading { margin: 0; }
.wx__lede { margin: 0; max-width: 46ch; }
.wx__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); max-width: 1080px; }
.wx__card { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 120px; }
.wx__media { overflow: hidden; border-radius: 0; aspect-ratio: 16 / 10; background: var(--deep); }
.wx__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wx__meta { margin: 8px 0 0; opacity: 0.85; }
.wx__title { margin: 0; font-size: clamp(20px, 1.6vw, 24px); line-height: 1.05; }
.wx__copy { margin: 0; max-width: 40ch; }

/* ── Closing call to action ─────────────────────────────────────────────── */
.wcta { padding-top: 0; }
.wp + .wx { margin-top: 0; }
.wcta__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: end;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
}
.wcta__eyebrow { margin: 0 0 16px; color: var(--ink); }
.wcta__title { margin: 0 0 16px; color: var(--ink); }
.wcta__copy { margin: 0; max-width: 48ch; color: var(--ink); }
.wcta__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.wcta__secondary { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
#client-work { scroll-margin-top: 0; }
.wp__project { scroll-margin-top: 120px; }

@media (max-width: 900px) {
  .wp__project { grid-template-columns: 1fr; }
  .wp__project--reverse .wp__shot { order: 0; }
  .wx__head { grid-template-columns: 1fr; }
  .wx__grid { grid-template-columns: 1fr; }
  .wx__card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 16px; align-items: start; }
  .wx__media { grid-row: 1 / span 3; }
  .wx__meta { margin: 0; }
  .wcta__card { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wx__card { display: flex; gap: 10px; }
  .wx__meta { margin-top: 6px; }
  .wx__grid { gap: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .wp__shot img, .wp__ext svg { transition: none; }
  .wp__project:hover .wp__shot img { transform: none; }
}
