/* ==========================================================================
   /work - the gallery. Every picture is a real capture of a live site or a
   real Play Store screenshot, mounted like a print: a hairline mat, a second
   rule inset on hover, monochrome until you reach for it. Same rule as the
   game icons on the home page: the colour is the reward.
   ========================================================================== */

/* hero plate: four real prints in one hairline mount, in place of the
   engraving the other pages carry; it takes the shared morph name */
.mosaic {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--line-soft);
  background: var(--bg-raised);
  view-transition-name: hero-art;
}
.mosaic img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10;
  filter: grayscale(1) contrast(1.06) brightness(0.84);
}
@media (min-width: 62rem) { .mosaic { width: 100%; max-width: 31rem; justify-self: end; } }

.prints {
  display: grid;
  gap: var(--s-7) var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .prints { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .prints { grid-template-columns: repeat(3, 1fr); } }

.phones {
  display: grid;
  gap: var(--s-6) var(--s-4);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 30rem) { .phones { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .phones { grid-template-columns: repeat(5, 1fr); } }

.print {
  position: relative;
  margin: 0;
  display: flex; flex-direction: column; gap: var(--s-4);
  min-width: 0;
}
.print-mat {
  position: relative;
  display: block;
  padding: var(--s-2);
  border: 1px solid var(--line-soft);
  background: var(--bg-raised);
  transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
/* the deco double rule, drawn in on hover like the cards */
.print-mat::after {
  content: "";
  position: absolute; inset: 4px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color var(--dur) var(--ease-out);
}
.print img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top;
  background: var(--ink-200);
  filter: grayscale(1) contrast(1.06) brightness(0.84);
  transition: filter var(--dur-slow) var(--ease-out);
}
.print.phone img { aspect-ratio: 9 / 16; }

.print:hover .print-mat, .print:focus-within .print-mat { border-color: var(--paper-400); transform: translateY(-3px); }
.print:hover .print-mat::after, .print:focus-within .print-mat::after { border-color: var(--ink-400); }
.print:hover img, .print:focus-within img { filter: grayscale(0) contrast(1) brightness(1); }
/* touch screens have no hover: the print in the middle of the screen lights up instead */
@media (hover: none) {
  .print[data-lit] img { filter: grayscale(0) contrast(1) brightness(1); }
  .print[data-lit] .print-mat { border-color: var(--paper-400); }
}

.print figcaption { display: grid; gap: var(--s-2); }
.print h3 {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 460;
  font-variation-settings: 'opsz' 9;
  letter-spacing: 0.012em;
  line-height: 1.2;
}
.print.phone h3 { font-size: var(--t-base); }
.print h3 a { text-decoration: none; }
/* the name is the link; its hit area covers the whole print */
.print h3 a::after { content: ""; position: absolute; inset: 0; }
.print h3 a:focus-visible { outline: none; }
.print:has(h3 a:focus-visible) .print-mat { outline: 1px solid var(--paper-100); outline-offset: 4px; }
.print-what { color: var(--text-muted); font-size: var(--t-sm); line-height: 1.5; }
.print-where {
  font-size: var(--t-xs);
  letter-spacing: var(--track); text-transform: uppercase;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.work-sub { margin-top: var(--s-9); margin-bottom: var(--s-6); max-width: 56ch; }
.work-sub h3 {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 400;
  margin-bottom: var(--s-3);
}
.work-sub p { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .print-mat, .print img { transition: none; }
  .print:hover .print-mat, .print:focus-within .print-mat { transform: none; }
}
