.case-card .case-art {
  --case-reveal-delay: 0ms;
  --case-image-rise: 0px;
  --case-image-scale: 1;
  --art-depth-x: 0;
  --art-depth-y: 0;
}

/* Keep the article box stable so filtering and the artwork reveal can overlap. */
.has-reveal .case-card[data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}

.has-reveal .case-card[data-reveal] .case-art {
  clip-path: inset(0 round 16px);
  transition: clip-path .85s cubic-bezier(.22,.72,.2,1) var(--case-reveal-delay),
    opacity .5s ease-out var(--case-reveal-delay);
}

.has-reveal .case-card[data-reveal]:not(.is-revealed):not(:focus-within) .case-art {
  --case-image-rise: 23px;
  --case-image-scale: 1.065;
  clip-path: inset(9% 0 31% round 16px);
  opacity: 0;
}

.has-reveal .case-card[data-reveal] .case-info {
  transition: opacity .5s ease-out var(--case-reveal-delay),
    transform .66s cubic-bezier(.22,.72,.2,1) var(--case-reveal-delay);
}

.has-reveal .case-card[data-reveal]:not(.is-revealed):not(:focus-within) .case-info {
  opacity: 0;
  transform: translateY(11px);
}

.work-grid .case-card .case-art img {
  transform: perspective(780px) translate3d(calc(var(--art-depth-x) * 8px),
    calc(var(--case-image-rise) + var(--art-depth-y) * 6px), 0)
    rotateX(calc(var(--art-depth-y) * -3deg)) rotateY(calc(var(--art-depth-x) * 5deg))
    scale(var(--case-image-scale));
  transition: transform .78s cubic-bezier(.22,.72,.2,1) var(--case-reveal-delay);
}

.case-card .case-art::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0;
  background: radial-gradient(ellipse at var(--art-light-x, 50%) var(--art-light-y, 45%),
    #fff9, #fff2 27%, #fff0 57%);
  mix-blend-mode: soft-light;
  transition: opacity .5s ease-out;
}

.case-card .case-info h3 {
  text-decoration: underline solid transparent 1px;
  text-underline-offset: .21em;
  transition: text-decoration-color .32s ease-out;
}

.case-card:focus-within .case-art,
.case-card:focus-within .case-info {
  --case-reveal-delay: 0ms;
}

.case-card:focus-within .case-info h3 {
  text-decoration-color: #5c486d;
}

@media (min-width: 541px) {
  .case-card:nth-child(even) .case-art,
  .case-card:nth-child(even) .case-info {
    --case-reveal-delay: 65ms;
  }
}

@media (hover: hover) and (pointer: fine) {
  .case-card .case-art.has-art-light { --case-image-scale: 1.035; }
  .case-card .case-art.has-art-light img {
    transition: transform .27s cubic-bezier(.23,.74,.25,1);
  }
  .case-card .case-art.has-art-light::after { opacity: .82; }
  .case-card:hover .case-info h3 { text-decoration-color: #5c486d; }
}

@media (max-width: 540px) {
  .has-reveal .case-card[data-reveal] .case-art { clip-path: inset(0 round 12px); }
  .has-reveal .case-card[data-reveal]:not(.is-revealed):not(:focus-within) .case-art {
    clip-path: inset(7% 0 26% round 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .has-reveal .case-card[data-reveal]:not(.is-revealed) .case-art,
  .has-reveal .case-card[data-reveal]:not(.is-revealed) .case-info { opacity: 1; }
  .has-reveal .case-card[data-reveal]:not(.is-revealed) .case-art { clip-path: none; }
  .work-grid .case-card .case-art img,
  .has-reveal .case-card[data-reveal]:not(.is-revealed) .case-info { transform: none; }
  .case-card .case-art.has-art-light::after { opacity: 0; }
}
