/* A single 3D plane per card. The capture has a definite box before transforms.
   Nested perspective + filtered percentage-sized previews were unstable in Safari. */
.project-card { transform-style: flat; }
.project-card .project-media {
  --capture-inset: 12px 24px 9px;
  --capture-rows: minmax(0, 1fr);
  display: block;
  perspective: none;
}
.project-featured .project-media {
  --capture-inset: 18px 26px 5px;
  --capture-rows: 22px minmax(0, 1fr);
}
.project-card .mini-browser {
  position: absolute;
  inset: var(--capture-inset);
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--capture-rows);
  justify-content: stretch;
  align-items: stretch;
  transform: translateY(0) rotate(-.6deg) scale(.96);
  transform-origin: 50% 50%;
  filter: none;
}
.project-card .mini-browser img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  box-shadow: 0 10px 14px #24133624;
}
.project-card:hover .mini-browser,
.project-card:focus-within .mini-browser {
  transform: translateY(-3px) rotate(.4deg) scale(1.015);
}
[data-theme='dark'] .project-card .mini-browser img { box-shadow: 0 10px 14px #0005; }
@media (max-width: 1200px) {
  .project-featured .project-media { --capture-inset: 12px; }
}
@media (max-width: 1000px) {
  .project-featured .project-media {
    --capture-inset: 12px 24px 9px;
    --capture-rows: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .project-card .project-media { --capture-inset: 16px 26px 8px; }
  .project-card .mini-browser { transform: rotate(-.4deg) scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  .project-card .mini-browser { transform: none; transition: none; }
}
