.work-head { padding: 90px 40px 0; }

.work-head__title {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(80px, 12vw, 190px);
  line-height: .92;
  letter-spacing: .04em;
  animation: fadeUp .9s cubic-bezier(.2, .7, .2, 1) both;
}

.work-head__bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 34px;
  border-bottom: 1px solid #dedcd4;
  animation: fadeUp .9s .08s cubic-bezier(.2, .7, .2, 1) both;
}

.work-head__count {
  font-size: 11px;
  letter-spacing: .2em;
  color: #8a877f;
  font-weight: 600;
  padding-bottom: 16px;
}

.work-tabs {
  position: relative;
  display: flex;
  gap: 44px;
  padding-bottom: 16px;
}

.work-tab {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: 600 13px 'Montserrat', sans-serif;
  letter-spacing: .18em;
  color: #8a877f;
  transition: color .35s ease;
}

.work-tab:hover { color: #161512; }
.work-tab.is-active { color: #161512; }

.work-tabs__indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: #161512;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), width .5s cubic-bezier(.2, .7, .2, 1);
}

.work-grid {
  padding: 40px 40px 0;
  display: grid;
  /* two up, fixed — not auto-fill, which would go to three on a wide screen */
  grid-template-columns: repeat(2, 1fr);
  /* butted together, no seam */
  gap: 0;
}

@keyframes tileReveal { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* Stills are shot mostly portrait — a 16/9 tile would crop away well over half
   of a 2:3 frame, so the photography grid stands its tiles up. Films stay 16/9,
   which is the shape they were actually finished in. */
.work-grid.is-stills .tile { aspect-ratio: 4 / 5; }

.tile {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e6e4dd;
  cursor: pointer;
  animation: tileReveal .8s cubic-bezier(.2, .7, .2, 1) both;
  animation-timeline: view();
  animation-range: entry 0% entry 42%;
}

@supports not (animation-timeline: view()) {
  .tile { animation: tileReveal .8s cubic-bezier(.2, .7, .2, 1) both; }
}

.tile__video,
.tile__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1), filter .5s ease;
  filter: brightness(.96);
}

.tile:hover .tile__video,
.tile:hover .tile__poster {
  transform: scale(1.05);
  filter: brightness(1);
}

/* The preview is a Vimeo iframe: it is built and left in place on first hover,
   then faded rather than removed, so hovering back is instant. It stays under
   the pointer's notice — the TILE takes the click, never the player. */
.tile__video {
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}

.tile.is-playing .tile__video { opacity: 1; }

/* a film whose poster Vimeo would not give up — better than a blank tile */
.tile.is-posterless { background: #d9d6ce; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(8, 7, 6, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn .3s ease both;
}

.lightbox[hidden] { display: none; }

.lightbox__stage {
  width: min(1200px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
}

.lightbox__stage video,
.lightbox__stage img,
.lightbox__stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

/* a still is whatever shape it is — don't letterbox it into 16/9 */
.lightbox__stage.is-still {
  aspect-ratio: auto;
  background: none;
  width: auto;
  height: 100%;
  display: flex;
}

.lightbox__stage.is-still img {
  width: auto;
  height: 100%;
  max-width: 100%;
}

.lightbox__close {
  position: absolute;
  top: 26px;
  right: 32px;
  background: none;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  color: #fff;
  font: 600 10px 'Montserrat', sans-serif;
  letter-spacing: .24em;
  padding: 10px 20px;
  cursor: pointer;
  transition: background .3s ease;
}

.lightbox__close:hover { background: rgba(255, 255, 255, .14); }

@media (max-width: 720px) {
  .work-head { padding: 120px 20px 0; }
  .work-grid { padding: 30px 20px 0; grid-template-columns: 1fr; }
  .work-tabs { gap: 24px; }
  .lightbox { padding: 20px; }
}
