.grid {
  gap: 18px;
}

.work-more {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: clamp(18px, 3vw, 34px);
  padding: 20px 12px 0;
  border-top: 1px solid var(--line);
}

.work-more:has([aria-expanded="false"]) {
  background: linear-gradient(180deg, #f7f5f5, transparent 42px);
}

.work-progress {
  color: var(--muted);
  font-size: .9375rem;
}

.work-progress:empty {
  display: none;
}

.work-more .button {
  border: 1px solid transparent;
  cursor: pointer;
}

.work-more .button[aria-expanded="true"] {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.work-more .button[aria-expanded="true"]:hover {
  border-color: var(--red);
  color: var(--red);
}

#work-grid .project-cover {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: stretch;
  height: 100%;
  aspect-ratio: auto;
  overflow: visible;
  container-type: inline-size;
  border-radius: 10px;
  background: transparent;
  isolation: isolate;
}

.project-cover .cover-scene {
  align-items: flex-end;
  min-height: clamp(166px, 53cqw, 340px);
  height: auto;
  gap: 0;
  padding: 20px 5% 0;
  background: transparent;
  overflow: visible;
  --art-height: clamp(156px, 53cqw, 330px);
}

.project-cover .cover-panel {
  height: auto;
  width: auto;
  flex: 0 1 calc(var(--art-height) * var(--weight));
  transform-origin: center bottom;
  transform: translate(var(--slide, 0px), var(--lift, 0px)) rotate(var(--tilt, 0deg));
  transition: transform .35s cubic-bezier(.22, .75, .3, 1);
}

.card .project-cover .cover-panel img {
  display: block;
  height: auto;
  border-radius: 4px 4px 1px 1px;
  filter: drop-shadow(0 5px 8px #21191929);
}

.cover-pair .cover-panel:first-child {
  --direction: -1;
  --tilt: -2.5deg;
  z-index: 1;
}

.cover-pair .cover-panel + .cover-panel {
  --direction: 1;
  --tilt: 4deg;
  --lift: -7px;
  margin-inline-start: -9%;
}

.cover-solo .cover-panel {
  max-width: 100%;
  --tilt: -1deg;
}

.cover-caption {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  z-index: 2;
  margin-top: -22px;
  border-radius: 7px 0 9px 9px;
  min-height: 112px;
  padding: 15px 18px 16px;
  background: linear-gradient(160deg, #252529, #17171a 70%);
  color: #fff;
}

.cover-caption::before {
  content: "";
  position: absolute;
  top: -16px;
  right: 0;
  width: min(34%, 136px);
  height: 17px;
  background: #1d1d20;
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%);
}

.cover-caption::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  width: 36px;
  height: 6px;
  background: #d51a31;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transition: width .2s ease;
}

.cover-copy {
  display: grid;
  gap: 4px;
}

.cover-category {
  color: #ffc0c6;
  font-size: .8125rem;
  line-height: 1.2;
}

.card .cover-copy h3 {
  color: white;
  font-size: clamp(1.25rem, 5.8cqw, 1.95rem);
  letter-spacing: -.025em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.cover-type, .cover-context {
  color: #dedee1;
  font-size: .875rem;
  line-height: 1.25;
}

.cover-context {
  text-align: right;
  max-width: 9em;
}

.card a:focus-visible .cover-caption::after {
  width: 58px;
}

#work-grid .card a:focus-visible .cover-panel {
  --slide: calc(var(--direction, 0) * 6px);
  --lift: -12px;
  --tilt: calc(var(--direction, 0) * 1deg);
}

@media (hover: hover) and (pointer: fine) {
  .card a:hover .cover-caption::after { width: 58px; }
  #work-grid .card a:hover .cover-panel {
    --slide: calc(var(--direction, 0) * 6px);
    --lift: -12px;
    --tilt: calc(var(--direction, 0) * 1deg);
    transform: translate(var(--slide), var(--lift)) rotate(var(--tilt));
  }
}

@container (max-width: 360px) {
  .cover-caption {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding-inline: 14px;
  }
  .cover-context { max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-caption::after { transition: none; }
}
