.psbox-portfolio-gallery {
  --work-accent: #e9002d;
  background: #fff;
}

.psbox-portfolio-gallery .work-gallery {
  min-height: calc(100svh - 64px);
  padding: 28px 24px 100px;
  background: #fff;
  color: #191c21;
}

.work-gallery__shell {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
}

.work-gallery__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.work-gallery__filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 740px);
  margin: 0 auto 60px;
  padding: 9px;
  border-radius: 999px;
  background: #f3f4f6;
}

.work-gallery__filter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 60px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #626b78;
  font: inherit;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.work-gallery__filter:hover { background: #fff2f3; color: var(--work-accent); }
.work-gallery__filter[aria-pressed="true"] { background: var(--work-accent); color: #fff; }
.work-gallery__filter:focus-visible { outline: 3px solid #191919; outline-offset: -5px; }

.work-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-gallery__item { min-width: 0; }
.work-gallery [hidden] { display: none !important; }

.work-tile {
  position: relative;
  isolation: isolate;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 22px;
  background: #100e1c;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.work-tile::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgb(9 8 20 / 45%) 0%, transparent 42%, rgb(7 7 15 / 15%) 60%, rgb(7 7 15 / 85%) 100%);
  pointer-events: none;
}

.work-tile__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  transition: transform .55s cubic-bezier(.2, .65, .3, 1);
}

.work-tile__logo {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 28px;
  width: clamp(104px, 11vw, 154px);
  height: auto;
}

.work-tile__caption {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 28px;
  left: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.work-tile__caption h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(23px, 2.15vw, 34px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.3;
}

.work-tile__caption p {
  margin: 0;
  color: #e0dfeb;
  font-size: 14px;
  line-height: 1.5;
  word-break: keep-all;
}

.work-tile__arrow {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  color: #fff;
  transition: background-color .2s ease, border-color .2s ease;
}

.work-tile:hover .work-tile__image,
.work-tile:focus-visible .work-tile__image { transform: scale(1.045); }
.work-tile:hover .work-tile__arrow,
.work-tile:focus-visible .work-tile__arrow { background: var(--work-accent); border-color: var(--work-accent); }
.work-tile:focus-visible { outline: 3px solid var(--work-accent); outline-offset: 5px; }

.work-gallery__empty {
  display: grid;
  min-height: 350px;
  place-content: center;
  padding: 40px 20px;
  text-align: center;
}
.work-gallery__empty p { margin: 0; color: #626b78; font-size: 17px; line-height: 1.7; }

@media (max-width: 1000px) {
  .work-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-tile__caption h2 { font-size: 28px; }
}

@media (max-width: 600px) {
  .psbox-portfolio-gallery .work-gallery { padding: 24px 16px 64px; }
  .work-gallery__filters { margin-bottom: 32px; padding: 5px; }
  .work-gallery__filter { min-height: 50px; padding: 10px 4px; font-size: 14px; word-break: keep-all; }
  .work-gallery__filter[aria-pressed="true"] { background: var(--work-accent); }
  .work-gallery__grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .work-tile { border-radius: 20px; }
  .work-tile__logo { top: 24px; left: 24px; width: 130px; }
  .work-tile__caption { right: 24px; bottom: 24px; left: 24px; }
  .work-tile__caption h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .work-gallery__filter, .work-tile__image, .work-tile__arrow { transition: none; }
  .work-tile:hover .work-tile__image, .work-tile:focus-visible .work-tile__image { transform: none; }
}
