/* Fixed paper mounts keep the original work clickable as the layers move. */
.work-stage,
.cs-index .cs-card .cs-preview.work-stage,
.paper-visual .zoom.work-stage {
  --sheet-angle: -2deg;
  --front-angle: 5deg;
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: 1.43;
  padding: 0;
  border: 1px solid #c7bfae;
  border-radius: 4px;
  background: linear-gradient(144deg, #fff6, transparent 62%), var(--mount, #e9e4d6);
}
.work-stage.work-stage--sage, .file-card:nth-child(3n+2) .work-stage {
  --mount: #dfe7da;
  --ring: #6e866644;
}
.work-stage.work-stage--clay, .file-card:nth-child(3n) .work-stage {
  --mount: #ecded3;
  --ring: #a2776249;
}
.work-stage::before {
  content: "";
  position: absolute;
  width: 83%;
  aspect-ratio: 1;
  top: -24%;
  right: -20%;
  border: 1px solid var(--ring, #867c5f42);
  border-radius: 50%;
  pointer-events: none;
}
.work-window, .work-float--panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #aea99d;
  border-radius: 7px;
  box-shadow: 0 15px 28px -15px #413b2a65, 0 3px 7px -3px #413b2a35;
}
.work-stage > .work-window {
  position: absolute;
  inset: 13% 9% 15%;
  transform: translateY(calc(var(--work-shift, 0px) * -.35)) rotate(var(--sheet-angle));
}
.work-stage--paired > .work-window { inset: 14% 13% 17% 5.7%; }
.work-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  height: clamp(13px,1.9vw,22px);
  padding-inline: 9px;
  border-bottom: 1px solid #dedbd1;
  background: #fcfaf4;
}
.work-bar > i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #aaa798;
}
.work-window-screen {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.work-stage .work-window-screen > img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center top;
}
.work-stage .work-float {
  position: absolute;
  z-index: 1;
  display: block;
  right: 5.3%;
  bottom: 10%;
  width: 26%;
  transform: translateY(var(--work-shift, 0px)) rotate(var(--front-angle));
  transform-origin: 50% 72%;
}
.work-stage .work-float > .phone-frame {
  width: 100%;
  padding: clamp(8px,1vw,12px) 3.5% 5%;
  border-radius: clamp(14px,2vw,24px);
  box-shadow: 0 10px 18px -8px #36302566, 0 1px 4px #3630252d, inset 0 0 0 1px white;
}
.work-stage .work-float .phone-display { border-radius: clamp(9px,1.2vw,17px); aspect-ratio: 1 / 1.85; }
.work-float:has(img[src*="package-"]) .phone-frame .phone-display { aspect-ratio: 1 / 1.60; }
.work-stage .work-float .phone-content img { height: auto; }
.work-stage .work-float > .phone-frame::before { top: 3px; width: 15%; height: 2px; }
.work-stage .work-float--panel {
  display: flex;
  width: 47%;
  aspect-ratio: 1.59;
  bottom: 9%;
  right: 4%;
  --front-angle: 3deg;
  padding: 4px;
  background: #faf8f0;
}
.work-stage .work-float--panel img { object-fit: contain; object-position: center; }
.file-card .work-stage { aspect-ratio: 1.52; }
.file-card .work-window-screen > img[src*="/documents/"] {
  object-fit: contain;
  object-position: center;
}
/* The study excerpt has its own responsive crop; show the whole chosen detail. */
.work-stage[data-doc="ratings-usability-study"] > .work-window {
  inset-block: 50% auto;
  translate: 0 -50%;
}
.work-stage[data-doc="ratings-usability-study"] picture,
.work-stage[data-doc="ratings-usability-study"] picture img {
  display: block;
  width: 100%;
  height: auto;
}
/* Evidence inside the story stays fully visible and opens at its original resolution. */
.paper-visual .work-stage--inline { aspect-ratio: auto; padding: clamp(.9rem,2.8vw,2.6rem) 5%; }
.paper-visual .work-stage--inline > .work-window {
  position: relative;
  inset: auto;
  width: 100%;
  --sheet-angle: -1deg;
}
.paper-visual .work-stage--inline .work-window-screen > img {
  display: block;
  height: auto;
  width: 100%;
  object-fit: contain;
}
.work-pair-motion .zoom:first-child .phone-frame { rotate: -2deg; }
.work-pair-motion .zoom:last-child .phone-frame { rotate: 3deg; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .work-window, .work-float { transition: rotate .55s cubic-bezier(.22,.72,.16,1); }
  :is(a.work-stage, a .work-stage):hover > .work-window { rotate: 1deg; }
  :is(a.work-stage, a .work-stage):hover > .work-float { rotate: -2deg; }
}
@media (prefers-reduced-motion:no-preference) {
  .work-entered { animation: work-arrive .76s cubic-bezier(.22,.72,.16,1) both; }
  .work-entered:focus-within { animation: none; }
}
@keyframes work-arrive {
  from { opacity: .25; translate: 0 21px; }
  to { opacity: 1; translate: 0 0; }
}
@media(max-width:650px) {
  .work-stage > .work-window { border-radius: 5px; }
  .work-stage .work-float { bottom: 12%; }
  .work-stage .work-float--panel { bottom: 9%; }
  .file-card .work-stage { aspect-ratio: 1.48; }
}
@media (prefers-reduced-motion:reduce), print {
  .work-stage { --work-shift: 0px !important; }
  .work-entered { animation: none; }
}

/* The Atlas screenshot already includes its own browser frame. */
.work-stage--atlas-details > .work-window {
  inset: 50% auto auto 50%;
  height: 86%;
  width: auto;
  max-width: 88%;
  aspect-ratio: 1379 / 1154;
  translate: -50% -50%;
}
.work-stage--atlas-details .work-window-screen > img { object-fit: contain; }
