/* ==========================================================================
   Passion project gallery

   Measured against the 1920 x 11298 Frame 2 export from the Figma
   "Portfolio Design" file. Artwork is cut from a 2x export, so every image
   ships at roughly double its layout size.
     content column   x 105 -> 1822 (1716 wide)
     page title       64px Inter Semi Bold, centred
     section heading  48px Inter Semi Bold, left
     caption          20px Inter Regular, black, centred under its artwork
   ========================================================================== */

.gallery {
  --gal-caption: clamp(13px, 1.04vw, 20px);
  padding-bottom: clamp(64px, 26vw, 511px);
}

.gallery-title {
  margin: clamp(24px, 6.1vw, 118px) 0 clamp(10px, 1vw, 19px);
  font-weight: 600;
  font-size: clamp(2rem, 3.33vw, 4rem); /* Figma: 64px */
  line-height: 1.21;
  letter-spacing: -0.01em;
  text-align: center;
}

.gallery-category {
  margin: 0 0 clamp(72px, 14.8vw, 285px);
}

.gallery-category:last-child { margin-bottom: 0; }

.gallery-category h2 {
  font-weight: 600;
  font-size: clamp(1.4rem, 2.5vw, 3rem); /* Figma: 48px */
  line-height: 1.21;
  letter-spacing: -0.01em;
  margin: 0 0 clamp(14px, 1.6vw, 30px);
}

/* Each piece keeps the width and left offset it has in the frame, set per
   figure as a percentage of the content column via --vw / --vx. */
.project {
  margin: 0 0 clamp(28px, 4.6vw, 88px);
}

.project:last-child { margin-bottom: 0; }

.project img {
  width: 100%;
  max-width: var(--vw, 100%);
  height: auto;
  margin-left: var(--vx, 0);
  display: block;
  background: #f2f2f2;
}

.project video {
  width: 100%;
  max-width: var(--vw, 100%);
  height: auto;
  margin-left: var(--vx, 0);
  display: block;
  background: #1b1b1b;
}

.project-caption {
  margin: clamp(8px, 1.5vw, 28px) 0 0;
  font-size: var(--gal-caption);
  line-height: 1.21;
  color: var(--ink);
  text-align: center;
}

.project-caption span {
  margin-left: 0.7em;
}

/* Two pieces side by side. The frame staggers the second one downwards and
   pins each to the outside edge of its half. */
.project-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3.4vw, 59px);
  margin: 0 0 clamp(28px, 4.6vw, 88px);
  align-items: start;
}

@media (min-width: 640px) {
  .project-row { grid-template-columns: 1fr 1fr; }
  .project-row > .project:nth-child(2) { margin-top: var(--stagger, 0); }
  .project-row > .project:nth-child(2) img,
  .project-row > .project:nth-child(2) video { margin-left: auto; }
}

.project-row .project { margin-bottom: 0; }

@media (max-width: 720px) {
  /* Offsets that read as composition at 1920 only waste width on a phone */
  .project img,
  .project video { max-width: 100%; margin-left: 0; }
  .project-row > .project:nth-child(2) { margin-top: 0; }
}
