/* Projects page: the journal grid. Straight pictures in different sizes, a small white label on each,
   the title as a navy tile. Each tile takes its height from its picture's shape (--ar);
   --top drops a tile lower for a staggered scroll. Classes are prefixed pj- to stay clear of site.css. */

.pj { max-width: 1640px; margin-inline: auto; padding: clamp(28px, 4vw, 56px) clamp(16px, 3vw, 48px) clamp(48px, 6vw, 96px); }

.pj-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px clamp(20px, 3vw, 40px); margin-bottom: clamp(28px, 4vw, 48px); }
.pj-mark { width: clamp(130px, 14vw, 190px); height: auto; }
.pj-intro { flex: 1 1 360px; max-width: 62ch; margin: 0; color: var(--ink-soft); font-size: 17px; }

.pj-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); align-items: start; }
.pj-tile { position: relative; margin: var(--top, 0) 0 0; min-width: 0; grid-column: var(--c); aspect-ratio: var(--ar); overflow: hidden; background: #e9e6df; }
.pj-tile > a.pj-cover { position: absolute; inset: 0; z-index: 1; }
.pj-tile img, .pj-tile video { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); display: block; transition: transform 0.5s ease; }
.pj-tile:has(a.pj-cover):hover img { transform: scale(1.02); }
.pj-stack { grid-column: var(--c); min-width: 0; display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 24px); }
.pj-stack > .pj-tile { width: var(--w, 100%); margin-top: 0; }
.pj-tile--bare { background: none; overflow: visible; }
.pj-tile--bare img { object-fit: contain; }

.pj-label { position: absolute; z-index: 2; left: clamp(10px, 1.2vw, 18px); top: clamp(10px, 1.2vw, 18px); max-width: min(calc(100% - 20px), 34ch);
  margin: 0; background: #fff; color: var(--ink); padding: 8px 12px 9px; font-size: 15px; font-weight: 500; line-height: 1.25; pointer-events: none; }
.pj-label small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-soft); margin-top: 1px; }
.pj-label .pj-line { display: block; font-size: 13px; font-weight: 400; margin-top: 6px; }

.pj-title { background: var(--navy, #1c2560); color: #fff; display: flex; align-items: flex-end; padding: clamp(20px, 2.6vw, 40px); align-self: stretch; aspect-ratio: auto; }
.pj-title h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.6vw, 60px); line-height: 1.04; letter-spacing: -0.01em; }

@media (max-width: 860px) {
  .pj-grid { grid-template-columns: minmax(0, 1fr); }
  .pj-tile, .pj-stack { grid-column: 1; margin-top: 0; }
  .pj-stack > .pj-tile { width: 100%; }
  .pj-title { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { .pj-tile img { transition: none; } }
