/*
 * Apex — Work index (/work/).
 * Centred title + subtitle, a row of category filter pills, then a stacked list
 * of project cards that reuse the case-study hero card (.apex-cs-hero*). Loaded
 * on top of case-study.css. Modelled on the Figma "Wireframe - Works" frame.
 */

/* Roomy gap below the list before the contact section, matching the case-study
   pages (~254px to "Get in touch"). */
.apex-works {
  margin-bottom: clamp(4.5rem, 8vw, 10rem);
  /* Soft dark glow behind the head (from the Figma head background): two wide
     top glows (brighter toward the sides, dimmer centre) fading to black. */
  background:
    radial-gradient(65vw 560px at 18% -60px, #1d232e 0%, rgba(0, 0, 0, 0) 68%),
    radial-gradient(65vw 560px at 82% -60px, #1b212b 0%, rgba(0, 0, 0, 0) 68%),
    #000;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------- Intro */

.apex-works__intro {
  text-align: center;
  /* Top pad clears the fixed header (5rem) on every width. */
  padding-block: clamp(6.5rem, 9vw, 9rem) clamp(2rem, 4vw, 3.5rem);
  padding-inline: clamp(1.5rem, 5vw, 5rem);
}

.apex-works__title {
  font-size: clamp(2.25rem, 3.35vw, 4.1875rem); /* ~67px at 1999, measured in Figma */
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--apex-text);
}

.apex-works__subtitle {
  margin-top: clamp(0.75rem, 1.4vw, 1.25rem);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a0a0a0;
}

/* --------------------------------------------------------------- Filters */

.apex-works__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-inline: clamp(1.5rem, 5.5vw, 7rem);
  padding-bottom: clamp(2rem, 3vw, 3rem);
}

.apex-works__filter {
  padding: 0.625rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  background: transparent;
  color: #c2c2c2;
  font: inherit;
  font-size: 0.6875rem; /* 11px */
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--apex-transition), background var(--apex-transition),
    border-color var(--apex-transition);
}

.apex-works__filter:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.apex-works__filter.is-active {
  background: #fff;
  border-color: #fff;
  color: #000;
}

/* ----------------------------------------------------------------- Cards */

.apex-works__list {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 0.7vw, 0.875rem); /* light gaps between the films */
}

/* Each card is the case-study hero card as a link. */
.apex-works__card {
  display: flex;
  text-decoration: none;
  color: inherit;
  min-height: max(28rem, 40vw); /* a touch shorter than the case-study hero */
  padding-block: clamp(3rem, 5vw, 5rem) clamp(2.5rem, 4.5vw, 5.5rem);
  border-bottom: 0; /* cards are separated by the gap, not the hero's border */
}

.apex-works__card .apex-cs-hero__media img,
.apex-works__card .apex-cs-hero__media video {
  transition: transform 0.6s var(--apex-ease);
}

.apex-works__card:hover .apex-cs-hero__media img,
.apex-works__card:hover .apex-cs-hero__media video {
  transform: scale(1.04);
}

.apex-works__card[hidden] {
  display: none; /* overrides .apex-cs-hero's display:flex when filtered out */
}

/* -------------------------------------------------------------- Empty state */

.apex-works__empty {
  display: grid;
  place-items: center;
  min-height: max(24rem, 34vw);
  padding: clamp(3rem, 8vw, 8rem) 1.5rem;
  text-align: center;
}

.apex-works__empty[hidden] {
  display: none;
}

.apex-works__empty p {
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #6a6a6a;
}

/* ----------------------------------------------------------------- Responsive */

@media (max-width: 960px) {
  .apex-works__card {
    min-height: max(24rem, 60vw);
  }
}
