/* Marzex Technologies, edition 4.3: Featured work (featured-work.html, marzex-featured.js).
   The page title on the centre line, then one wide card per platform: the picture, with a frosted bar along the foot
   holding the index, the name, a hairline and what the work covers.
   Motion (fw-live, set in the head unless motion is reduced): the title decodes in and wipes open like the header's
   wordmark (marzex-scale.js, the text scramble), and scrambles out as the cards scroll up over it; the lede fades. */

/* ---------- Head ---------- */
.fw { padding: calc(var(--header-h) + 5rem) 0 6rem; }
.fw-head { display: grid; justify-items: center; gap: 1.25rem; margin-bottom: 4.5rem; text-align: center; }
.fw-title { font: 400 clamp(2.5rem, 8vw, 7.5rem)/1 var(--sans); letter-spacing: -.035em; white-space: nowrap; }
.fw-lede { max-width: 36rem; text-wrap: balance; }

/* With motion, the head holds under the header while the cards scroll up over it, and the type waits for the fonts
   (the scramble holds each line's width). */
.fw-live .fw-head { position: sticky; top: calc(var(--header-h) + 2rem); z-index: 0; }
.fw-live .fw-list { position: relative; z-index: 1; }
.fw-live:not(.fw-ready) .fw-title, .fw-live:not(.fw-ready) .fw-lede, .fw-live:not(.fw-ready) .fw__bar > * { visibility: hidden; }

/* ---------- Cards ---------- */
.fw-list { list-style: none; display: grid; gap: var(--s-3); }
.fw-card {
  /* per card, inline: --px / --py, where the picture is cropped (its object-position, 0 to 1). The bar is placed in
     the card's own width (cqw). */
  container-type: inline-size;
  position: relative; isolation: isolate; overflow: hidden; display: block;
  aspect-ratio: 16 / 9; border-radius: var(--r-2xl); background: var(--gunmetal); color: var(--paper);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.fw-card .media {
  position: absolute; inset: 0; border-radius: 0;
  object-position: calc(var(--px, .5) * 100%) calc(var(--py, .5) * 100%);
  transition: transform .5s var(--s-power2-out);
}
.fw-card:hover .media { transform: scale(1.02); }

/* ---------- The bar ---------- */
.fw__bar {
  position: absolute; left: 4.5cqw; right: 4.5cqw; bottom: max(1rem, 2.6cqw);
  display: flex; align-items: center; gap: 1.5rem; padding: 1.125rem 1.5rem 1.125rem 1.25rem;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--ink) 52%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
}
.fw__num { align-self: flex-start; margin-top: .125rem; opacity: .8; }
.fw__name { flex: none; font-weight: 700; letter-spacing: -.03em; }
.fw__rule { flex: 1; min-width: 2rem; height: 1px; background: color-mix(in srgb, var(--paper) 60%, transparent); transform-origin: 0 50%; }
/* Dots between the tags: each tag's dot hangs in the gap before it, and the list pulls back by that gap and clips it,
   so a wrapped row never opens on a dot. */
.fw__tags { list-style: none; display: flex; flex-wrap: wrap; align-items: center; flex: none; margin-left: -1.25rem; clip-path: inset(-.5em 0 -.5em 1.25rem); white-space: nowrap; }
.fw__tags li { position: relative; margin-left: 1.25rem; }
.fw__tags li::before {
  content: ""; position: absolute; left: -.75rem; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%;
  background: currentColor;
}

/* ---------- Narrower ---------- */
@media (max-width: 1100px) {
  .fw__bar { display: grid; grid-template-columns: auto auto 1fr; column-gap: 1.25rem; row-gap: .5rem; }
  .fw__num { grid-row: 1 / 3; }
  .fw__tags { grid-column: 2 / 4; }
}
@media (max-width: 768px) {
  .fw { padding-top: calc(var(--header-h) + 3.5rem); }
  .fw-head { margin-bottom: 3rem; }
  .fw-card { aspect-ratio: 4 / 5; }
  .fw__bar { left: .75rem; right: .75rem; bottom: .75rem; grid-template-columns: auto 1fr; padding: 1rem 1.125rem; }
  .fw__name { flex: initial; }
  .fw__rule { grid-column: 2; min-width: 0; }
  .fw__tags { grid-column: 2; }
  .fw__num { grid-row: 1 / 4; }
}
