/* ==========================================================================
   Case pages (Selected Work / <case>) · one structure for every client.
   Patrace colours throughout (white, denim mist, plum); the work itself brings the client's colour.
   hero band + services running · thread · brief (facts + starting point) ·
   blocks: rows of work on colour, full-width bands with one line, chapters split in half
   (the work on colour beside the decisions) · outcome over a band · where to next.
   ========================================================================== */

/* ---------- Hero ---------- */
.cs-hero { padding-top: calc(var(--header-h) + 22px); }
.cs-hero-txt { display: grid; justify-items: center; text-align: center; padding-bottom: clamp(40px, 5vw, 70px); }
.cs-back { justify-self: start; margin-bottom: clamp(24px, 3vw, 40px); }
.cs-hero .cs-title { margin: 16px auto 0; max-width: 640px; font-family: var(--font-sans); font-weight: 300; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.cs-hero-ims { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--edge-gap); margin: 0 var(--edge-gap); }
.cs-hero-ims figure { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--denim-mist); }
.cs-hero-ims img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.js .cs-hero-ims img { opacity: 0; transform: scale(1.04); transition: opacity 1s ease calc(var(--i) * .12s), transform 1.8s cubic-bezier(.22,1,.36,1) calc(var(--i) * .12s); }
html.js .cs-hero-ims figure.is-in img { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .cs-hero-ims img { opacity: 1; transform: none; transition: none; } }

/* ---------- Thread ---------- */
.cs-thread { position: sticky; top: calc(var(--header-h) - 10px); z-index: 20; background: color-mix(in srgb, var(--white) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.cs-thread ol { list-style: none; margin: 0; padding: 14px var(--gutter); display: flex; justify-content: center; gap: clamp(18px, 3vw, 46px); overflow-x: auto; scrollbar-width: none; }
.cs-thread a { font-family: var(--font-label); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--washed-denim); text-decoration: none; white-space: nowrap; transition: color .4s ease; }
.cs-thread a.on, .cs-thread a:hover { color: var(--ink); }
.cs-thread-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; }
.cs-thread-bar i { display: block; height: 100%; width: 100%; background: var(--plum); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* ---------- Brief ---------- */
.cs-brief { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(40px, 7vw, 140px); padding-block: clamp(100px, 11vw, 170px); scroll-margin-top: 120px; }
.cs-meta { margin: 0; display: grid; gap: 22px; align-content: start; }
.cs-meta dt { margin-bottom: 6px; color: var(--soft-ink); }
.cs-meta dd { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.cs-meta dd a { display: block; color: inherit; text-decoration: none; }
.cs-meta dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cs-brief-txt { max-width: 640px; }
.cs-title { margin: 16px 0 28px; font-family: var(--font-sans); font-weight: 300; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.cs-p { margin: 0 0 1em; font-family: var(--font-serif); font-size: var(--size-editorial); line-height: 1.6; color: var(--ink); }
.cs-note { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--soft-ink); }

/* ---------- Colour grounds ---------- */
.cs-bg--white { background: var(--white); }
.cs-bg--mist { background: var(--denim-mist); }
.cs-bg--plum { background: var(--plum); }

/* ---------- Rows of work ---------- */
.cs-row { padding-block: clamp(50px, 6vw, 90px); }
.cs-row-in { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(8px, 1vw, 14px); width: min(100% - 2 * var(--gutter), calc(var(--n) * 250px)); margin: 0 auto; }
.cs-row figure { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--denim-mist); }
.cs-row img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.6s cubic-bezier(.22,1,.36,1); }
.cs-row figure:hover img { transform: scale(1.03); }
.cs-bg--white.cs-row + .cs-band-sec, .cs-row + .cs-row { margin-top: 0; }

/* ---------- Full-width bands with one line ---------- */
.cs-band { margin: 0; position: relative; overflow: hidden; background: var(--denim-mist); }
.cs-band img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-band-sec { position: relative; scroll-margin-top: 120px; }
.cs-band-sec .cs-band { height: min(70svh, 640px); }
.cs-band-sec .cs-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 55%, transparent), color-mix(in srgb, var(--ink) 10%, transparent) 60%); }
.cs-band-txt { position: absolute; inset: 0; display: grid; align-content: center; gap: 18px; }
.cs-band-txt .label { color: var(--white); }
.cs-band-line { margin: 0; max-width: 560px; font-family: var(--font-sans); font-weight: 300; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; letter-spacing: -.01em; color: var(--white); }

/* ---------- Chapters: the work on colour, the decisions on white ---------- */
.cs-ch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: min(100svh, 980px); scroll-margin-top: 60px; }
.cs-ch--flip .cs-ch-media { order: 2; }
.cs-ch-media { display: grid; place-items: center; padding: clamp(40px, 6vw, 90px); }
.cs-ch-media-in { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 16px); width: min(100%, calc(var(--n) * 330px)); }
.cs-ch-media-in[style*="--n:1"] { width: min(78%, 440px); }
.cs-ch-media figure { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; box-shadow: 0 30px 60px -36px color-mix(in srgb, var(--ink) 60%, transparent); }
.cs-ch-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-ch-txt { display: grid; align-content: center; padding: clamp(50px, 7vw, 120px); }
.cs-ch-k { display: flex; align-items: baseline; gap: 14px; margin: 0 0 24px; }
.cs-ch-title { margin: 0 0 clamp(30px, 3vw, 44px); max-width: 480px; font-family: var(--font-sans); font-weight: 300; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.cs-dec { list-style: none; margin: 0; padding: 0; max-width: 520px; }
.cs-dec li { border-top: 1px solid var(--line); padding: 15px 0 19px; display: grid; grid-template-columns: 140px 1fr; gap: 18px; }
.cs-dec li:last-child { border-bottom: 1px solid var(--line); }
.cs-dec-n { margin: 0; font-size: 14px; color: var(--ink); }
.cs-dec-t { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--soft-ink); }

/* ---------- Outcome ---------- */
.cs-out { scroll-margin-top: 60px; }
.cs-out-list { list-style: none; margin: 0; padding-block: clamp(70px, 8vw, 120px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 40px); }
.cs-out-list li { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: clamp(24px, 3vw, 44px); align-content: start; }
.cs-out-list p { margin: 0; font-family: var(--font-serif); font-size: var(--size-editorial); line-height: 1.4; color: var(--ink); }

/* ---------- Next case: the next brand, large, with the way back beneath ---------- */
.cs-review { margin-top: 0; }
.cs-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; margin: clamp(30px, 4vw, 60px) var(--edge-gap) 0; min-height: min(80svh, 760px); background: var(--denim-mist); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); }
.cs-next-txt { display: grid; align-content: space-between; gap: 40px; padding: clamp(36px, 5vw, 80px); }
.cs-next-name { display: block; margin: 16px 0 18px; font-family: var(--font-sans); font-weight: 300; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; letter-spacing: -.01em; }
.cs-next-line { display: block; max-width: 420px; font-family: var(--font-serif); font-size: var(--size-editorial); line-height: 1.5; color: var(--soft-ink); }
.cs-next-im { position: relative; overflow: hidden; }
.cs-next-im img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter 1s ease, transform 1.6s cubic-bezier(.22,1,.36,1); }
.cs-next:hover .cs-next-im img, .cs-next:focus-visible .cs-next-im img { filter: none; transform: scale(1.03); }
.cs-after { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 40px; padding-block: 30px clamp(90px, 10vw, 150px); }

@media (max-width: 900px) {
  .cs-hero-ims { grid-template-columns: repeat(var(--n), 70vw); overflow-x: auto; scrollbar-width: none; }
  .cs-brief { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-row-in { grid-template-columns: repeat(var(--n), 64vw); width: auto; margin: 0; padding-inline: var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .cs-ch { grid-template-columns: 1fr; min-height: 0; }
  .cs-ch--flip .cs-ch-media { order: 0; }
  .cs-ch-txt { padding: 50px var(--gutter) 80px; }
  .cs-dec li { grid-template-columns: 1fr; gap: 6px; }
  .cs-out-list { grid-template-columns: 1fr; }
  .cs-next { grid-template-columns: 1fr; min-height: 0; }
  .cs-next-im { aspect-ratio: 4 / 3; order: -1; }
  .cs-band-sec .cs-band { height: 60svh; }
}


/* ---------- Landscape pieces (websites, banners, spreads) ---------- */
.cs-hero-ims.is-wide figure, .cs-row figure.is-wide, .cs-ch-media figure.is-wide { aspect-ratio: 16 / 10; }
.cs-row-in:has(.is-wide) { width: min(100% - 2 * var(--gutter), calc(var(--n) * 420px)); }
.cs-ch-media-in.is-wide { width: min(100%, 620px); grid-template-columns: 1fr; }
.cs-out-head { padding-top: clamp(100px, 11vw, 170px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(40px, 7vw, 140px); }
.cs-out-head .cs-title { margin: 0; max-width: 620px; }
@media (max-width: 900px) { .cs-out-head { grid-template-columns: 1fr; gap: 14px; } }
