/* Work: full-width showcase rows, in full colour. Each project is one row: its clip on one side in the clip's own
   shape (no cropping), a big numbered caption on the other, alternating sides. A large faint word sits behind each
   row so the open space carries lettering instead of blank. Each clip plays over a still of its first frame, only
   while on screen (js/work/clips.js). Rows pop in, then the caption rises and its eyebrow wipes in (the site's
   scroll reveals, js/lib/reveal.js, wired in js/main.js). Phones: one column, clip first. */
/* A jump to #work (header link) stops below the sticky header instead of under it. */
.work { padding-inline: var(--edge); counter-reset: row; overflow: hidden; scroll-margin-top: var(--header-space); }
.work > * { max-width: none; }
.work h2 { font-size: clamp(2.6rem, 0.8rem + 5vw, 8rem); line-height: 0.95; letter-spacing: -0.055em; }
.showcase { display: grid; gap: clamp(56px, 7vw, 120px); }

.tile {
  position: relative; isolation: isolate; counter-increment: row;
  display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 4vw, 80px);
}
.tile:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
.tile:nth-child(even) .tile__media { order: 2; }

.tile__media {
  position: relative; overflow: hidden; border-radius: 28px; background: #0f1519;
  border: 1px solid var(--line); box-shadow: 0 50px 90px -50px #10161a66;
}
.tile__shot { display: block; width: 100%; height: auto; }
/* Each clip sits over a still of its first frame and shows only while it is painting frames
   (js/work/clips.js sets .is-live), so a tile is never blank. */
.tile__clip { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease; }
.tile__clip.is-live { opacity: 1; }

/* Caption: the row number in outline, the eyebrow, a big title and one line of story. */
.tile__meta { display: grid; align-content: start; gap: 12px; }
.tile__meta::before {
  content: counter(row, decimal-leading-zero) / "";
  font: 600 clamp(3.4rem, 1.6rem + 4vw, 8rem)/0.9 var(--font-display); letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1.5px #087e9680;
}
.tile__meta .mono { justify-self: start; color: var(--teal); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.tile__meta h3 { font-size: clamp(1.8rem, 1rem + 2vw, 3.6rem); line-height: 1; letter-spacing: -0.045em; }
.tile__meta p { margin: 0; font-size: clamp(1rem, 0.9rem + 0.3vw, 1.15rem); line-height: 1.5; color: var(--ink-2); max-width: 36ch; }
.tile__meta a { text-decoration: none; }

/* The faint word behind the row, on the caption's side. */
.tile__word {
  position: absolute; z-index: -1; top: 50%; right: -2vw; translate: 0 -50%; pointer-events: none; white-space: nowrap;
  font: 600 clamp(4rem, 1rem + 10vw, 14rem)/0.9 var(--font-display); letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1.5px #087e9629;
}
.tile:nth-child(even) .tile__word { right: auto; left: -2vw; }

@media (prefers-reduced-motion: reduce) {
  .tile__clip { transition: none; }
}

@media (max-width: 860px) {
  .tile, .tile:nth-child(even) { grid-template-columns: 1fr; gap: 18px; }
  .tile:nth-child(even) .tile__media { order: 0; }
  .tile__media { border-radius: var(--radius); box-shadow: 0 30px 60px -40px #10161a66; }
  .tile__meta { gap: 8px; }
  .tile__word { display: none; } /* no open space beside the rows on a phone */
}
