/* Preserve each screenshot's own proportions and let the gallery flow. */
.portfolio-panel,
.portfolio-content:not([hidden]) {
  height: auto;
  max-height: none;
  overflow: visible;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: auto;
}

.work-card-copy {
  flex: 0 0 auto;
}

/* Keep only the Behance mark on case cards. */
.work-card .external-arrow { display: none; }

/* Remove the extra page-bottom strip below the footer. */
footer { padding-bottom: 0; }

.work-grid > .work-card:nth-child(n) .work-card-art-frame {
  position: relative;
  display: block;
  flex: 0 0 auto !important;
  width: 100%;
  height: auto !important;
  min-height: 0;
  aspect-ratio: auto !important;
  margin: auto 0 0;
  overflow: hidden;
  border-radius: 16px;
  background: transparent;
}

.work-grid > .work-card:nth-child(n) .work-card-art-frame .card-art--portfolio {
  position: relative;
  inset: auto;
  display: block;
  width: 100% !important;
  height: auto !important;
  min-width: 0;
  max-width: 100%;
  max-height: none;
  object-fit: initial;
  object-position: left top;
  transform: none;
  filter: none;
}

@media (min-width: 761px) and (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid > .work-card,
  .work-grid > .work-card:nth-child(n) { grid-column: span 1; }
}

@media (max-width: 760px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .work-grid > .work-card,
  .work-grid > .work-card:nth-child(n) { grid-column: 1 / -1; }
}

@media (max-width: 419px) {
  .work-card-copy { padding: 12px 12px 0; }
}
