/* WORK: the receipts. A typographic index of shipped client sites beside a
   stationary preview frame that crossfades as rows are hovered (js/work.js).
   Nothing follows the mouse; the frame is sticky and calm. */

.s-work {
  padding-top: var(--section-gap);
}

.work-head {
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}

.work-headline {
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

/* ---------- layout: rows | preview ---------- */

.work-index {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) clamp(300px, 30vw, 460px);
  column-gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  margin-top: clamp(3rem, 7vh, 5rem);
}

/* ---------- index rows ---------- */

.work-row {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  grid-template-areas: 'num name' 'num meta';
  column-gap: var(--gutter);
  row-gap: 0.35rem;
  align-items: baseline;
  border-top: 1px solid var(--hairline);
  padding: clamp(1.4rem, 3.2vh, 2.2rem) 0;
}

.work-rows .work-row:last-child {
  border-bottom: 1px solid var(--hairline);
}

/* Same hover grammar as the capability rows: red tick, signal index, lean. */
.work-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--signal);
  transform: scaleY(0);
  transform-origin: 50% 0%;
  transition: transform 0.45s var(--ease-out);
}

.work-row:hover::before,
.work-row.is-current::before {
  transform: scaleY(1);
}

.work-num {
  grid-area: num;
  color: var(--paper-dim);
  transition: color 0.3s var(--ease-out);
}

.work-row:hover .work-num,
.work-row.is-current .work-num {
  color: var(--signal);
}

.work-name {
  grid-area: name;
  transition: transform 0.45s var(--ease-out);
}

.work-row:hover .work-name,
.work-row.is-current .work-name {
  transform: translateX(12px);
}

.work-meta {
  grid-area: meta;
  color: var(--paper-dim);
}

.work-live {
  color: var(--signal);
}

/* Inline thumbs are a mobile-only fallback; desktop uses the preview frame. */
.work-thumb {
  display: none;
}

/* ---------- stationary preview ---------- */

.work-preview {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}

/* Technical annotation above the frame: the reference site's film-frame
   language (overscan, crop ticks), worn by the one frame on the page. */
.frame-note {
  font-size: 9px;
  color: var(--paper-dim);
  opacity: 0.7;
  text-align: right;
  margin-bottom: 0.6rem;
}

.work-preview-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hairline);
  background: var(--ink-2);
}

.frame-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Crop ticks: small corner L-marks sitting just outside the frame. */
.tick {
  position: absolute;
  width: 10px;
  height: 10px;
  color: rgba(242, 240, 236, 0.4);
}

.tick-tl { top: -7px; left: -7px; border-top: 1px solid; border-left: 1px solid; }
.tick-tr { top: -7px; right: -7px; border-top: 1px solid; border-right: 1px solid; }
.tick-bl { bottom: -7px; left: -7px; border-bottom: 1px solid; border-left: 1px solid; }
.tick-br { bottom: -7px; right: -7px; border-bottom: 1px solid; border-right: 1px solid; }

.work-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}

.work-shot.is-active {
  opacity: 1;
}

/* The active shot breathes: a sixteen-second drift inside the frame, so the
   preview is alive without anything chasing the pointer. */
@media (prefers-reduced-motion: no-preference) {
  .work-shot.is-active {
    animation: shot-drift 16s ease-in-out infinite alternate;
  }
}

@keyframes shot-drift {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.work-caption {
  margin-top: 0.85rem;
  color: var(--paper-dim);
}

/* ---------- mobile collapse ---------- */

@media (max-width: 767px) {
  .work-index {
    display: block;
  }

  .work-preview {
    display: none;
  }

  .work-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'thumb' 'num' 'name' 'meta';
    row-gap: 0.7rem;
  }

  .work-thumb {
    grid-area: thumb;
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--hairline);
    margin-bottom: 0.4rem;
  }
}
