.collab-section {
  --silver: #626970;
  --row-height: clamp(4.35rem, 7.5svh, 6.25rem);
  --section-top: clamp(1rem, 3.6svh, 2.75rem);
  --settle-space: max(0px, calc(50svh - var(--row-height) - var(--section-top) - 1rem));
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 100svh;
  padding-block: var(--section-top) max(4.75rem, calc(env(safe-area-inset-bottom) + 3.8rem));
  overflow-anchor: none;
}
.collab-section::before, .collab-section::after {
  content: "";
  position: absolute; inset: -11rem 0 0; z-index: -1; pointer-events: none;
  background-size: 100% 30rem; background-repeat: repeat-y;
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgb(0 0 0 / 20%) 5rem, #000 17rem);
  mask-image: linear-gradient(to bottom, transparent, rgb(0 0 0 / 20%) 5rem, #000 17rem);
  animation: silver-bands-rise 38s linear infinite;
  animation-play-state: paused;
}
.collab-section::before {
  background-image: linear-gradient(to bottom,
    #fafafa 0%, #f0f0f0 9%, #d6d7d8 18%, #efeff0 26%, #f8f8f8 34%,
    #dcddde 44%, #f6f6f6 57%, #d4d5d6 70%, #f5f5f5 84%, #e7e7e8 92%, #fafafa 100%);
}
.collab-section::after {
  background-image: linear-gradient(to bottom,
    #ff00a8 0%, #f639b3 9%, #d991be 18%, #f746b9 26%, #ff0eac 34%,
    #d28db7 44%, #ff10ae 57%, #c987b0 70%, #fc1ab0 84%, #e477bc 92%, #ff00a8 100%);
  opacity: 0;
}
@keyframes silver-bands-rise { to { background-position: 0 -30rem; } }
html[data-motion="on"] .collab-section::before,
html[data-motion="on"] .collab-section::after {
  animation-play-state: running;
  transition: opacity .38s ease;
}
body.is-fuchsia .collab-section { --silver: #481033; }
body.is-fuchsia .collab-section::before { opacity: 0; }
body.is-fuchsia .collab-section::after { opacity: 1; }

.collab-index { padding-top: calc(var(--settle-space) * var(--index-progress, 0)); }
.collab-index > .section-label { margin: 0 var(--gutter) .25rem; }
.collab-row { width: 100%; }
.collab-head {
  --side-rail: clamp(3.75rem, 11vw, 11rem);
  width: 100%; min-height: var(--row-height); padding: .45rem var(--gutter);
  display: grid; grid-template-columns: var(--side-rail) minmax(0, 1fr) var(--side-rail);
  align-items: center; gap: .45rem;
  position: relative;
  list-style: none; cursor: pointer; user-select: none; touch-action: manipulation;
}
.collab-head::-webkit-details-marker { display: none; }
.collab-head:focus-visible { outline-offset: -3px; }
.collab-year {
  grid-area: 1 / 1; justify-self: start;
  font-size: .875rem; font-variant-numeric: tabular-nums; color: var(--muted);
}
.client-name, .collab-flight {
  color: var(--silver, #626970);
  font-size: clamp(1.8rem, 3.25vw, 3.5rem); font-weight: 700; line-height: 1.07;
  letter-spacing: -.058em; text-align: center; text-wrap: balance;
}
.client-name { grid-area: 1 / 2; justify-self: center; min-width: 0; }
.collab-indicator {
  grid-area: 1 / 3; justify-self: end;
  position: relative; display: block; width: 1rem; height: 1rem; color: var(--muted);
}
.collab-indicator::before, .collab-indicator::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 100%; height: 1.5px;
  background: currentColor; transform: translate(-50%, -50%);
}
.collab-indicator::after { transform: translate(-50%, -50%) rotate(90deg); }
[open] > .collab-head .collab-year { visibility: hidden; }
[open] > .collab-head .collab-indicator { grid-area: 1 / 1; justify-self: start; transform: rotate(45deg); }
body.collab-project-open .collab-section { padding-block-start: 0; }
.collab-index.has-open { padding-top: 0; }
.collab-index.has-open > .section-label, .collab-index.has-open > .collab-row:not([open]) { display: none; }
.collab-row[open] > .collab-head {
  position: sticky; top: 0; z-index: 3;
  background: rgb(250 250 250 / 93%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body.is-fuchsia .collab-row[open] > .collab-head { background: rgb(255 41 174 / 92%); }
.collab-head.is-flying .client-name { opacity: 0; }
.collab-flight {
  position: fixed; z-index: 7; display: grid; place-items: center;
  pointer-events: none; margin: 0; padding: 0;
}

.collab-reveal {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(2.75rem, 6vw, 5.25rem); width: min(70rem, calc(100% - 2 * var(--gutter)));
  margin: clamp(1.5rem, 3.5svh, 3rem) auto 0;
}
/* Hide the panel before the native details element opens; never transition
   from visible to hidden while the title is moving. */
.collab-reveal.is-entering, .collab-reveal.is-leaving {
  visibility: hidden; opacity: 0; animation: none; transition: none;
}
html[data-motion="on"] .collab-reveal.is-revealed {
  animation: collab-panel-appear .28s ease-out both;
}
@keyframes collab-panel-appear { from { opacity: 0; } to { opacity: 1; } }
.collab-figure .media-pending { visibility: hidden; }

.collab-figure { width: fit-content; max-width: 100%; min-width: 0; }
.collab-figure img, .collab-figure video {
  width: auto; height: auto; max-width: 100%; max-height: 86svh; object-fit: contain;
}
.collab-figure video { background: #151416; }
.collab-figure figcaption {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-top: .55rem; color: var(--muted); font-size: .8125rem; line-height: 1.3;
}
.collab-project-note { width: min(100%, 35rem); text-align: center; }
.collab-project-note h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.024em; }
.collab-project-note p { margin-top: .45rem; font-size: 1rem; line-height: 1.4; text-wrap: pretty; }

@media (max-width: 53.75rem) {
  .collab-section { --row-height: clamp(4.35rem, 9svh, 5.75rem); }
  .collab-section::before, .collab-section::after { inset-block-start: -8rem; animation-duration: 45s; }
  .collab-index { padding-top: var(--settle-space); }
  .collab-index.has-open { padding-top: 0; }
  .collab-head { --side-rail: clamp(2.35rem, 8vw, 4.25rem); gap: .3rem; }
  .client-name, .collab-flight { font-size: clamp(1.4rem, 5.1vw, 2.2rem); }
  .collab-indicator { width: .875rem; height: .875rem; }
  .collab-row[open] > .collab-head { padding-block-start: max(.45rem, env(safe-area-inset-top)); }
  .home-screen, .collab-section { scroll-snap-align: start; }
  html[data-section-glide][data-motion="on"]:not(.reading-project):not(.has-dialog):not(.guided-scroll) { scroll-snap-type: y proximity; }
}
html.guided-scroll { scroll-snap-type: none; scroll-behavior: auto; overflow-anchor: none; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) { scroll-behavior: auto; }
}

/* Client titles remain directly over the colour field. */
.collab-head::after, .collab-indicator { display: none; }
.collab-row[open] > .collab-head,
body.is-fuchsia .collab-row[open] > .collab-head {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.collab-index > .section-label { margin: -1px; }

.collab-year { font-size: clamp(1.5rem, 2.8vw, 3rem); font-weight: 700; letter-spacing: -.055em; line-height: 1.07; }
.collab-head { --side-rail: clamp(4.5rem, 13vw, 12rem); }
@media (max-width: 53.75rem) {
 .collab-year { font-size: clamp(1.2rem, 4.4vw, 1.9rem); }
 .collab-head { --side-rail: clamp(3.25rem, 12vw, 5.5rem); }
}

.collab-year { font-size: clamp(1.3rem, 2.4vw, 2.6rem); }
@media (max-width: 53.75rem) {
 .collab-year { font-size: clamp(1.05rem, 3.8vw, 1.65rem); }
}
body.is-fuchsia .collab-section { --silver: #fff; }

.collab-year { font-size: clamp(1rem, 1.75vw, 1.9rem); }
@media (max-width: 53.75rem) {
 .collab-year { font-size: clamp(.875rem, 2.9vw, 1.25rem); }
}

/* A catalogue-like index, with the identity effect retained in the background. */
.collab-section {
  --row-height: 3rem;
  --section-top: 1.25rem;
  --settle-space: 0px;
  --silver: var(--ink);
}
.collab-section::before { opacity: .12; }
.collab-index > .section-label { margin: 0 var(--gutter) .7rem; }
.collab-head {
  --side-rail: clamp(4rem, 13vw, 11rem);
  grid-template-columns: var(--side-rail) minmax(0, 1fr) 1.5rem;
  gap: .5rem;
  padding-block: .6rem;
}
.client-name, .collab-flight {
  font-size: 15px; font-weight: 400; line-height: 1.45;
  letter-spacing: -.01em; text-align: left; text-wrap: pretty;
}
.client-name { justify-self: start; }
.collab-flight { place-items: center start; }
.collab-year { font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: 0; }
.collab-indicator { display: block; width: .7rem; height: .7rem; }
.collab-indicator::before, .collab-indicator::after { height: 1px; }
[open] > .collab-head .collab-indicator { grid-area: 1 / 3; justify-self: end; }
.collab-row[open] > .collab-head { background: var(--paper); }
body.is-fuchsia .collab-row[open] > .collab-head { background: var(--fuchsia); }
.collab-project-note { text-align: left; max-width: 36ch; }
.collab-project-note h3, .collab-project-note p { font-size: 14px; font-weight: 400; letter-spacing: 0; line-height: 1.55; }
.collab-figure figcaption { font-size: 12px; font-weight: 400; }
@media (max-width: 53.75rem) {
  .collab-section { --row-height: 3rem; --settle-space: 0px; }
  .collab-head { --side-rail: 3.5rem; }
  .client-name, .collab-flight { font-size: 13px; }
  .collab-year, .collab-figure figcaption { font-size: 11px; }
  .collab-project-note h3, .collab-project-note p { font-size: 13px; }
  html[data-section-glide][data-motion="on"]:not(.reading-project):not(.has-dialog):not(.guided-scroll) { scroll-snap-type: none; }
}

/* Restore the original responsive client scale and centered composition. */
.collab-section {
  --row-height: clamp(4.35rem, 7.5svh, 6.25rem);
  --section-top: clamp(1rem, 3.6svh, 2.75rem);
  --settle-space: max(0px, calc(50svh - var(--row-height) - var(--section-top) - 1rem));
}
.collab-head {
  --side-rail: clamp(4.5rem, 13vw, 12rem);
  grid-template-columns: var(--side-rail) minmax(0, 1fr) var(--side-rail);
  gap: .45rem;
}
.client-name, .collab-flight {
  font-size: clamp(1.8rem, 3.25vw, 3.5rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -.04em;
  text-align: center; text-wrap: balance; overflow-wrap: anywhere;
}
.client-name { justify-self: center; max-width: 100%; }
.collab-flight { place-items: center; }
.collab-year { font-size: clamp(1rem, 1.75vw, 1.9rem); line-height: 1.15; }
.collab-indicator { display: none; }
@media (max-width: 53.75rem) {
  .collab-section { --row-height: clamp(4.35rem, 9svh, 5.75rem); }
  .collab-head { --side-rail: clamp(3.25rem, 12vw, 5.5rem); gap: .3rem; }
  .client-name, .collab-flight { font-size: clamp(1.4rem, 5.1vw, 2.2rem); }
  .collab-year { font-size: clamp(.875rem, 2.9vw, 1.25rem); }
}

/* Stronger moving silver bands, and coordinated accent variants. */
.collab-section::before, .collab-section::after {
  background-size: 100% 34rem;
  animation-name: editorial-bands-rise;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12rem);
  mask-image: linear-gradient(to bottom, transparent, #000 12rem);
}
.collab-section::before {
  background-image: linear-gradient(to bottom, #fff 0%, #d6d7da 13%, #a5a8ad 25%, #f9f9fa 41%, #c3c5c9 57%, #969ba3 72%, #e1e2e5 87%, #fff 100%);
  opacity: .88;
}
.collab-section::after {
  background-image: linear-gradient(to bottom, var(--accent-base, #ff00a8) 0%, var(--accent-light, #ff80d1) 19%, var(--accent-dark, #e90095) 36%, var(--accent-base, #ff00a8) 52%, var(--accent-light, #ff80d1) 69%, var(--accent-dark, #e90095) 86%, var(--accent-base, #ff00a8) 100%);
}
@keyframes editorial-bands-rise { to { background-position: 0 -34rem; } }
body.has-colour .collab-section { --silver: var(--accent-ink); }
body.has-colour .collab-section::before { opacity: 0; }
body.has-colour .collab-section::after { opacity: .96; }
/* Keep the open title transparent and match the selected-work lift exactly. */
.collab-row[open] > .collab-head,
body.has-colour .collab-row[open] > .collab-head,
body.is-fuchsia .collab-row[open] > .collab-head {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-motion="on"] .collab-head .client-name { transition: transform .22s var(--ease); }
@media (hover: hover) {
  html[data-motion="on"] .collab-head:not(.is-flying):hover .client-name { transform: translateY(-2px); }
}
body.has-colour .collab-flight { color: #fff !important; }
@media (max-width: 53.75rem) {
  .collab-section { --settle-space: 0px; --section-top: 2rem; min-height: 0; padding-bottom: 3rem; }
  .collab-index { padding-top: 0; }
  .collab-index > .section-label { margin-bottom: .75rem; }
  .collab-head { grid-template-columns: minmax(0, 1fr); gap: .4rem; padding: 1rem var(--gutter) 1.25rem; }
  .collab-year { grid-area: 1 / 1; font-size: 12px; font-weight: 400; }
  .client-name, .collab-flight { font-size: clamp(1.55rem, 5.3vw, 2.25rem); line-height: 1.18; text-align: left; }
  .client-name { grid-area: 2 / 1; justify-self: start; overflow-wrap: normal; }
  .collab-row[open] > .collab-head { padding-top: max(1rem, env(safe-area-inset-top)); padding-right: calc(var(--gutter) + 3rem); }
  .collab-row[open] > .collab-head::before { content: "\2190  Back"; grid-area: 1 / 1; font-size: 12px; color: var(--ink); }
  .collab-row[open] > .collab-head .collab-year { display: none; }
  .collab-reveal { width: calc(100% - 2 * var(--gutter)); margin-top: 1.5rem; gap: 2rem; }
  .collab-figure { width: 100%; }
  .collab-figure img, .collab-figure video { max-height: none; width: 100%; height: auto; }
  .collab-project-note { max-width: none; }
  .collab-project-note h3, .collab-project-note p { font-size: 14px; }
  .home-screen, .collab-section { scroll-snap-align: none; }
  html[data-section-glide][data-motion="on"]:not(.reading-project):not(.has-dialog):not(.guided-scroll) { scroll-snap-type: none; }
}

@media (max-width: 53.75rem) {
  /* Reserve space for the transparent footer over the end of the gradient. */
  body:not(.collab-project-open) .collab-section {
    padding-bottom: calc(var(--mobile-footer-height) + 1.5rem);
  }
}

/* V8: one viewport-sized colour field, independent of the index/gallery
   layout. A repeating texture travels on the compositor; opening a client
   never changes the layer's geometry or restarts its animation. */
.gradient-field { display: none; }
html[data-gradient-ready] .collab-section::before,
html[data-gradient-ready] .collab-section::after { content: none; animation: none; }
html[data-gradient-ready] .gradient-field {
  display: block; position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden; isolation: isolate;
  --spill-depth: 240px;
  --spill-edge: 70vh;
  --band-period: 34rem;
  /* A broad, gently eased feather: the ellipse softly leads the linear
     ramp, and both remain completely transparent above the artwork. */
  --spill-mask: radial-gradient(ellipse 78% var(--spill-depth) at 51% calc(var(--spill-edge) + var(--spill-depth)), rgb(0 0 0 / 48%) 0%, rgb(0 0 0 / 38%) 30%, rgb(0 0 0 / 18%) 58%, rgb(0 0 0 / 4%) 82%, rgb(0 0 0 / 1%) 94%, transparent 100%),
    linear-gradient(to bottom, transparent var(--spill-edge), rgb(0 0 0 / 2%) calc(var(--spill-edge) + var(--spill-depth) * .15), rgb(0 0 0 / 12%) calc(var(--spill-edge) + var(--spill-depth) * .32), rgb(0 0 0 / 36%) calc(var(--spill-edge) + var(--spill-depth) * .50), rgb(0 0 0 / 70%) calc(var(--spill-edge) + var(--spill-depth) * .72), rgb(0 0 0 / 94%) calc(var(--spill-edge) + var(--spill-depth) * .90), #000 calc(var(--spill-edge) + var(--spill-depth)));
  -webkit-mask-image: var(--spill-mask);
  mask-image: var(--spill-mask);
  -webkit-mask-composite: source-over;
  mask-composite: add;
}
.gradient-bands {
  position: absolute; inset: 0 0 auto;
  height: calc(100% + var(--band-period));
  background-size: 100% var(--band-period); background-repeat: repeat-y;
  animation: field-bands-rise 38s linear infinite paused;
}
.gradient-bands-neutral {
  background-image: linear-gradient(to bottom, #fff 0%, #d6d7da 13%, #a5a8ad 25%, #f9f9fa 41%, #c3c5c9 57%, #969ba3 72%, #e1e2e5 87%, #fff 100%);
  opacity: .88;
}
.gradient-bands-accent {
  background-image: linear-gradient(to bottom, var(--accent-base, #ff00a8) 0%, var(--accent-light, #ff80d1) 19%, var(--accent-dark, #e90095) 36%, var(--accent-base, #ff00a8) 52%, var(--accent-light, #ff80d1) 69%, var(--accent-dark, #e90095) 86%, var(--accent-base, #ff00a8) 100%);
  opacity: 0;
}
html[data-motion="on"] .gradient-bands {
  animation-play-state: running; will-change: transform; transition: opacity var(--colour-duration) var(--colour-ease);
}
/* Keep the neutral texture underneath the accent for an uninterrupted crossfade. */
body.has-colour .gradient-bands-neutral { opacity: .88; }
body.has-colour .gradient-bands-accent { opacity: .96; }
@keyframes field-bands-rise { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-1 * var(--band-period)), 0); } }
@media (max-width: 53.75rem) {
  .gradient-bands { animation-duration: 45s; }
}

html[data-motion="on"] :is(.collab-year, .collab-figure figcaption, .collab-flight),
html[data-motion="on"] .collab-row[open] > .collab-head::before {
  transition: color var(--ink-duration) var(--colour-ease);
}
html[data-motion="on"] .collab-head .client-name {
  transition: transform .22s var(--ease), color var(--ink-duration) var(--colour-ease);
}

/* V11: a single feathered mask avoids mobile WebKit's multi-mask compositing
   issues; the band texture remains continuously animated behind the content. */
@media (max-width: 53.75rem) {
  html[data-gradient-ready] .gradient-field {
    --spill-mask: linear-gradient(to bottom, transparent var(--spill-edge),
      rgb(0 0 0 / 6%) calc(var(--spill-edge) + var(--spill-depth) * .22),
      rgb(0 0 0 / 30%) calc(var(--spill-edge) + var(--spill-depth) * .46),
      rgb(0 0 0 / 75%) calc(var(--spill-edge) + var(--spill-depth) * .72),
      #000 calc(var(--spill-edge) + var(--spill-depth)));
    -webkit-mask-composite: source-over;
    mask-composite: add;
  }
  html[data-motion="on"] .gradient-bands { animation-duration: 38s; }
}

/* V12: a small canvas avoids animated CSS masks on mobile WebKit. */
.mobile-gradient { display: none; }
@media (max-width: 53.75rem) {
  html[data-mobile-gradient] .gradient-field {
    -webkit-mask-image: none; mask-image: none;
    -webkit-mask-composite: initial; mask-composite: initial;
    isolation: auto;
  }
  html[data-mobile-gradient] .gradient-bands { display: none; }
  html[data-mobile-gradient] .mobile-gradient {
    display: block; position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none;
  }
}

/* V16: subtly strengthen the regular face without full synthetic bold.
   The flying title uses the same weight during its desktop transition. */
.client-name, .collab-flight, .collab-year {
  font-weight: 400;
  -webkit-text-stroke: .012em currentColor;
}


/* V19: match idle titles to the years, and standardize project media widths. */
.collab-reveal { width: min(50vw, calc(100% - 2 * var(--gutter))); }
.collab-figure { width: 100%; }
.collab-figure img, .collab-figure video {
  width: 100%; height: auto; max-width: 100%; max-height: none;
}
.collab-project-note a { text-decoration: underline; text-underline-offset: .15em; }
@media (max-width: 53.75rem) {
  /* Keep the same width across all media, without shrinking work on phones. */
  .collab-reveal { width: calc(100% - 2 * var(--gutter)); }
}

/* V23: one text colour for every client state, matching the year.
   --muted is #585858 in neutral mode and white in the alternative colour modes. */
.collab-row > .collab-head .client-name,
.collab-row > .collab-head:is(:hover, :focus-visible, :active) .client-name,
.collab-row[open] > .collab-head .client-name,
.collab-row[open] > .collab-head:is(:hover, :focus-visible, :active) .client-name {
  color: var(--muted); text-shadow: none;
}
/* Longer, smaller, left-aligned text on the same axis as the artwork. */
.collab-project-note { width: 100%; max-width: none; text-align: left; color: var(--ink); }
.collab-project-note h3, .collab-project-note p { max-width: 70ch; font-size: 12px; line-height: 1.7; letter-spacing: 0; font-weight: 400; text-wrap: pretty; }
.collab-project-note h3 { margin-bottom: .75em; }
.collab-project-note p { margin-top: 0; }
.collab-project-note p + p { margin-top: .9em; }
.collab-project-note .project-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
@media (max-width: 53.75rem) {
 .collab-project-note h3, .collab-project-note p { font-size: 12px; line-height: 1.7; }
}

/* V22 — tighter media spacing, preserving caption breathing room. */
.collab-reveal { gap: clamp(2.25rem, 4.8vw, 4rem); }
.collab-reveal > .collab-project-note { margin-bottom: calc(clamp(2.75rem, 6vw, 5.25rem) - clamp(2.25rem, 4.8vw, 4rem)); }
@media (max-width: 53.75rem) {
  .collab-reveal { gap: 1.5rem; }
  .collab-reveal > .collab-project-note { margin-bottom: .5rem; }
}
