/* ========== SHARED WORK / GALLERY GRID (index, games, 3d, commissions) ========== */
.work-section {
  padding: 24px 64px 80px;
}

/* Directly under a stub-section intro — no extra top gap needed. */
.work-section--flush {
  padding-top: 0;
}

.work-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.work-section-title {
  font-size: 42px;
}

.work-section-intro {
  font-size: 16px;
  line-height: 1.6;
  color: #c9c3d4;
  max-width: 640px;
  margin: -12px 0 32px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.work-grid--3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-grid--5col {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Selected work mixes game banners with square 3D renders in one row —
   force every card's media to the same square frame so heights match
   and grid stretch doesn't leave empty space under the shorter cards. */
.work-grid--square .media-wrap {
  aspect-ratio: 1 / 1;
}

.work-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: opacity 0.6s ease;
  position: relative;
}

.work-card--paper {
  background: var(--paper);
}

.work-card-body {
  padding: 18px;
}

.work-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-top: 12px;
}

.work-card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.work-card--paper .work-card-title {
  color: var(--text-dark);
}

.work-card--paper .work-card-meta {
  color: var(--muted-dark);
}

/* ========== COMMISSIONS STRIP / PRICE GRID ========== */
.commissions-strip {
  margin: 0 64px 80px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 44px 48px;
  position: relative;
}

.commissions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 16px;
}

.commissions-title {
  font-size: 32px;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.price-card {
  border: 2px solid var(--line);
  padding: 18px;
}

.price-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}

.price-value {
  font-size: 26px;
  color: var(--yellow);
}

/* ========== FILTER CHIPS (games / 3d gallery) ========== */
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-chip {
  font-size: 11px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--text);
  color: var(--text);
}

.filter-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--ink);
}

.work-card--hidden {
  display: none;
}

/* ========== LIGHTBOX (click-to-enlarge gallery cards) ========== */
.work-card[data-lightbox] {
  cursor: zoom-in;
}

.work-card[data-lightbox]:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

body.lightbox-locked {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease, backdrop-filter 0.35s ease;
  backdrop-filter: blur(0px);
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(3px);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 17, 0.92);
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 10px 10px 0 var(--magenta);
  max-width: min(780px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.open .lightbox-frame {
  transform: scale(1) translateY(0);
}

.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  background: var(--magenta);
  color: var(--text);
}

.lightbox-media {
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 2px solid var(--ink);
  flex: 0 0 auto;
}

.lightbox-title {
  font-size: 22px;
  color: var(--text-dark);
}

@media (max-width: 640px) {
  .lightbox {
    padding: 20px;
  }
  .lightbox-close {
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
  }
  .lightbox-img {
    max-height: 58vh;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1300px) {
  .work-grid--5col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-grid--3col,
  .work-grid--5col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .work-section {
    padding-left: 24px;
    padding-right: 24px;
  }
  .commissions-strip {
    margin-left: 24px;
    margin-right: 24px;
  }
}

@media (max-width: 640px) {
  .work-section {
    padding-left: 20px;
    padding-right: 20px;
  }
  .commissions-strip {
    margin-left: 20px;
    margin-right: 20px;
    padding: 32px 24px;
  }
  .work-grid,
  .work-grid--3col,
  .work-grid--5col {
    grid-template-columns: 1fr;
  }
  .price-grid {
    grid-template-columns: 1fr;
  }
}
