/* Selected work on the home page, as a scroll gallery (Kevin, 19 Nov 2026): one full-screen stage
   stays put while the section scrolls (one screen per case); the current cover as background, its
   overtitle and title in the middle, every case's thumbnail in a glass bar (workstack.js). The
   shade, text, count and award rules below are shared with the hero's landing (manifesto.css). */
c-workstack {
  --ws-pad: calc(100px * var(--zoom, 1));
  display: block;
  position: relative;
  background: #000;
}
@media (width < 48rem) {
  c-workstack { --ws-pad: 16px; }
}
html.snap-work { scroll-snap-type: y proximity; }

/* snap points, one per panel (sticky panels never move in the flow) */
.ws-snap {
  position: absolute;
  inset-inline: 0;
  height: 100svh;
  pointer-events: none;
  scroll-snap-align: start;
}

/* the stronger veil of work.css: overtitle and title stay readable on bright photos */
.ws-shade {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 55% 30% at 50% 50%, rgb(0 0 0 / 0.35), transparent 75%),
    linear-gradient(rgb(0 0 0 / 0.5), rgb(0 0 0 / 0.42) 45%, rgb(0 0 0 / 0.42) 60%, rgb(0 0 0 / 0.65));
}
.ws-text {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-inline: var(--ws-pad);
  text-align: center;
}
.ws-eyebrow,
.ws-count {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ws-eyebrow { margin: 0 0 20px; color: #fff; }
/* award badge (Gravity): the finalist strip's yellow, black text */
.ws-award {
  margin: 0 0 18px;
  padding: 5px 10px 4px;
  border-radius: 4px;
  background: #e6ff3b;
  color: #000;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ws-title {
  max-width: 1100px;
  margin: 0;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.04em;
  white-space: pre-line;
}
@media (width < 48rem) {
  .ws-title { line-height: 1.05; }
}
.ws-count {
  position: absolute;
  bottom: 24px;
  right: var(--ws-pad);
  font-variant-numeric: tabular-nums;
  color: rgb(255 255 255 / 0.45);
}
.ws-count span { color: rgb(255 255 255 / 0.8); }

/* "BEA 2026 Award Finalist" on the Gravity case (Kevin, 19 Nov 2026): a small yellow rectangle in
   which the words scroll as the strip under the nav bar does */
.case-award {
  display: block;
  width: 230px;
  max-width: 100%;
  height: 24px;
  margin: 0 auto 18px;
  overflow: clip;
  border-radius: 5px;
  background: #e6ff3b;
  color: #111;
}
.case-award-track { display: flex; width: max-content; height: 100%; animation: case-award 14s linear infinite; }
.case-award-group { display: flex; }
.case-award-item { display: inline-flex; align-items: center; font-size: 10px; font-weight: 500; line-height: 24px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.case-award-sep { padding: 0 14px; font-size: 8px; }
@keyframes case-award { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- the gallery ---------- */
c-workstack { height: calc(var(--ws-n, 5) * 100svh); }
.ws-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: #000;
  color: #fff;
}
.ws-bgs { position: absolute; inset: 0; }
/* the covers crossfade, as on the About page (Kevin, 19 Nov 2026) */
.ws-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 1s ease; }
.ws-bg.is-on { opacity: 1; z-index: 2; }
/* the stack's photo scale, as the hero's landing draws the first cover */
.ws-bg img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); }
.ws-stage .ws-shade { z-index: 3; }
/* the whole stage opens the current case */
.ws-link { position: absolute; inset: 0; z-index: 4; }
.ws-stage .ws-text {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  height: auto;
  pointer-events: none;
}
.ws-stage .ws-text { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-inline: 0; }
.ws-heads { display: grid; place-items: center; }
.ws-copy { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; }
/* the titles live in the sliding row below (workstack.js), not in each case's copy */
.ws-stage .ws-copy .ws-title { display: none; }
.ws-row { --ws-w: 52vw; width: 100%; }
@media (width < 48rem) { .ws-row { --ws-w: 86vw; } }
.ws-track { display: flex; margin: 0; padding: 0; list-style: none; transition: transform 1s cubic-bezier(0.76, 0, 0.24, 1); }
.ws-track li { flex: none; width: var(--ws-w); padding: 0 24px; text-align: center; opacity: 0; transition: opacity 0.7s ease; }
.ws-track li.is-near { opacity: 0.4; }
.ws-track li.is-on { opacity: 1; }
.ws-ttl { margin: 0; font-size: clamp(36px, 5vw, 72px); line-height: 1; font-weight: 400; letter-spacing: -0.04em; text-wrap: balance; }
.ws-w { display: inline-block; overflow: clip; padding-bottom: 0.12em; margin-bottom: -0.12em; vertical-align: bottom; }
.ws-w > span { display: inline-block; }
.ws-track li.is-on .ws-w > span { animation: ws-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(0.2s + var(--i) * 0.07s); }
@keyframes ws-rise { from { transform: translateY(110%); } to { transform: none; } }
html.mh-land-wait .ws-row { opacity: 0; }
.ws-row { transition: opacity 0.4s ease; }
/* overtitle and title lines rise out of their masks; the previous case's leave upwards */
.ws-m { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.ws-m > span { display: block; transform: translateY(110%); }
.ws-copy.is-on .ws-m > span { transform: none; transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s; }
.ws-copy.is-on .ws-title .ws-m:nth-child(1) > span { transition-delay: 0.33s; }
.ws-copy.is-on .ws-title .ws-m:nth-child(2) > span { transition-delay: 0.41s; }
.ws-copy.is-on .ws-title .ws-m:nth-child(3) > span { transition-delay: 0.49s; }
.ws-copy.is-out .ws-m > span { transform: translateY(-110%); transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1); }
/* on the home gallery the award label leaves the title and sits just above the glass bar, as wide
   as it (workstack.js measures the bar) */
.ws-stage { --ws-bar-b: 24px; }
.ws-stage .case-award {
  position: absolute;
  left: 50%;
  bottom: calc(var(--ws-bar-b) + var(--ws-bar-h, 71px) + 8px);
  width: var(--ws-bar-w, 418px);
  max-width: calc(100% - 32px);
  margin: 0;
  border-radius: 7px;
  transform: translateX(-50%);
}
@media (width < 48rem) { .ws-stage { --ws-bar-b: 16px; } }
.ws-copy .case-award { opacity: 0; transition: opacity 0.3s ease; }
.ws-copy.is-on .case-award { opacity: 1; transition-delay: 0.3s; }
.ws-stage .ws-count { z-index: 5; }

/* the glass bar: every case's thumbnail, the current one lit */
.ws-bar {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 6;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  transform: translateX(-50%);
  transition: opacity 0.6s ease 0.1s;
}
/* it shows once the hero has handed over (the landing draws the first case without it) */
html.mh-land-wait .ws-bar { opacity: 0; }
.ws-thumb {
  position: relative;
  width: 76px;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #111;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ws-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ws-thumb:hover { opacity: 0.85; }
/* the current one: full opacity and one white ring just outside it, following its corners */
.ws-thumb { outline: 1.5px solid transparent; outline-offset: 2px; transition: opacity 0.4s ease, outline-color 0.4s ease; }
.ws-thumb.is-on { opacity: 1; outline-color: #fff; }
.ws-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (width < 48rem) {
  .ws-bar { bottom: 16px; gap: 4px; padding: 4px; border-radius: 10px; }
  .ws-thumb { width: 54px; border-radius: 6px; }
  .ws-stage .ws-count { display: none; } /* the bar shows where you are */
}
@media (max-width:-1px) {
  .ws-m > span, .ws-copy.is-on .ws-m > span, .ws-copy.is-out .ws-m > span { transition: none; }
}
