/* Filled works use the original stage footprint with a direct image cover.
   The reserved height retains the former inset, chrome and canvas geometry;
   empty slots continue to use their existing browser-window presentation. */
.site-card .card-stage.has-work,
.work-chapter .feature-window-area.has-work {
  position: relative;
  background: transparent;
  padding: 0 0 calc(
    max(var(--cover-min-height), (100% - 2 * var(--cover-side) - 2px) / var(--cover-ratio))
    + var(--cover-top) + var(--cover-chrome)
  );
}
.card-stage.has-work {
  --cover-side: 30px;
  --cover-top: 38px;
  --cover-chrome: 32px;
  --cover-ratio: 1.65;
  --cover-min-height: 0px;
}
.feature-window-area.has-work {
  --cover-side: 9%;
  --cover-top: 48px;
  --cover-chrome: 41px;
  --cover-ratio: 2.45;
  --cover-min-height: 300px;
}
.has-work > .work-cover {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  place-items: stretch;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  background: #fff;
  color: var(--collection-ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
}
/* Keep the shared browser bar above the image, within the existing cover bounds. */
.work-cover-canvas {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}
/* Outline white artwork without changing the cover's size or crop. */
.work-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  box-sizing: border-box;
  border: 1px solid #d9d9df;
  border-radius: inherit;
  pointer-events: none;
}
.work-cover > * { pointer-events: none; }
.work-cover:focus-visible { outline-offset: -3px; }
.work-cover:hover .site-cover { transform: scale(1.015); }
.work-cover:hover .preview-overlay,
.work-cover:focus-visible .preview-overlay { opacity: 1; transform: none; }
@media (hover: none) {
  .work-cover .preview-overlay { opacity: 1; transform: none; }
}
@media (min-width: 1600px) {
  .card-stage.has-work { --cover-ratio: 1.85; }
  .feature-window-area.has-work { --cover-min-height: 385px; }
}
@media (max-width: 1000px) {
  .card-stage.has-work { --cover-side: 20px; --cover-top: 25px; }
  .feature-window-area.has-work { --cover-min-height: 270px; }
}
@media (max-width: 760px) {
  .card-stage.has-work { --cover-side: 23px; --cover-top: 26px; --cover-ratio: 1.7; }
  .feature-window-area.has-work {
    --cover-side: 18px;
    --cover-top: 28px;
    --cover-chrome: 32px;
    --cover-ratio: 1.4;
    --cover-min-height: 200px;
  }
}
/* Give the featured website a fuller viewport proportion above the stacked layout. */
@media (min-width: 761px) {
  .work-chapter .feature-window-area.has-work {
    padding: 0;
    aspect-ratio: 16 / 9;
  }
}
/* Let the cover's shadow extend beyond the featured frame; artwork stays clipped. */
.work-chapter .featured-slot:has(> .feature-window-area.has-work) {
  overflow: visible;
}
.site-card .card-stage,
.work-chapter .feature-window-area.has-work {
  --cover-hover-shadow: 0 4px 12px rgb(29 29 31 / 8%);
  box-shadow: none;
  transform: none;
  transition: transform 240ms cubic-bezier(.2, .8, .2, 1), box-shadow 240ms ease;
}
/* Move the complete preview once, including the chrome of empty templates. */
.site-card .card-stage:not(.has-work) > .browser-window {
  box-shadow: none;
  transform: none;
}
/* The stationary article keeps the hover target stable while its preview lifts. */
@media (hover: hover) and (pointer: fine) {
  .site-card:hover .card-stage,
  .work-chapter .featured-slot:hover .feature-window-area.has-work {
    transform: translateY(-4px);
    box-shadow: var(--cover-hover-shadow);
  }
}
.site-card:has(:focus-visible) .card-stage,
.work-chapter .featured-slot:has(:focus-visible) .feature-window-area.has-work {
  transform: translateY(-4px);
  box-shadow: var(--cover-hover-shadow);
}
@media (prefers-reduced-motion: reduce) {
  .site-card .card-stage,
  .site-card:hover .card-stage,
  .site-card:has(:focus-visible) .card-stage,
  .work-chapter .featured-slot .feature-window-area.has-work,
  .work-chapter .featured-slot:hover .feature-window-area.has-work,
  .work-chapter .featured-slot:has(:focus-visible) .feature-window-area.has-work,
  .work-cover:hover .site-cover {
    transform: none;
    transition: none;
  }
}
