/* works.css — the work as a contact sheet.
   One frame per shipment with the product inside it, the name and one line
   under it. No card chrome: the frames line up, the captions stay out of the
   way, and the eye scans. Used on /portfolio, the home and v4; the page's own
   tokens colour it, with fallbacks for pages that lack one. */

.works {
  --w-line: var(--line, #dddddd);
  --w-bg: var(--bg-2, var(--bg, #f7f7f7));
  --w-ink: var(--ink, #0a0a0a);
  --w-ink-2: var(--ink-2, #222222);
  --w-ink-low: var(--ink-low, var(--ink-dim, #767676));
  --w-green: var(--green-deep, #033003);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 30px;
  margin-top: 28px;
  text-align: left;
}
/* Two across: the home's four, side by side in the reading column. */
.works--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; margin-left: auto; margin-right: auto; }

.work { display: block; min-width: 0; color: inherit; text-decoration: none; position: relative; }
.work--wide { grid-column: span 2; }
.work__media {
  display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-bg);
  transition: border-color 0.2s ease;
}
/* Two singles plus the gap, at the singles' height. Off by a pixel at most. */
.work--wide .work__media { aspect-ratio: 3.3; }
.work__media img, .work__media video {
  display: block; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: var(--pos, 50% 50%);
}
.work__media img { transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1); }
.work__clip { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s ease; }
.work.is-moving .work__clip { opacity: 1; }
.work__name {
  margin: 12px 0 0; font-family: 'Fraunces', Georgia, serif; font-weight: 500;
  font-size: 19px; letter-spacing: -0.01em; line-height: 1.15; color: var(--w-ink);
  transition: color 0.18s ease;
}
.work--wide .work__name { font-size: 24px; }
.work__line {
  margin: 4px 0 0; font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--w-ink-2); max-width: 38ch;
}
.work__line a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--w-ink-low); }
.work__line a:hover { color: var(--w-green); border-bottom-color: var(--w-green); }
.work--soon .work__media img { opacity: 0.85; }
@media (hover: hover) {
  .work:hover .work__media { border-color: var(--w-ink); }
  .work:hover .work__media img { transform: scale(1.02); }
  .work:hover .work__name { color: var(--w-green); }
}
.work:focus-visible { outline: 2px solid var(--w-green); outline-offset: 4px; border-radius: 8px; }
@media (max-width: 700px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 20px; margin-top: 20px; }
  .work__media { border-radius: 6px; }
  .work__name { margin-top: 9px; font-size: 16px; }
  .work--wide .work__name { font-size: 19px; }
  .work__line { font-size: 14px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  .work__media, .work__media img, .work__name, .work__clip { transition: none; }
  .work:hover .work__media img { transform: none; }
}
