/* archive-hover.css — interactive Archive / Works list.
 *
 * A vertical list of projects, small type. Each row carries a collapsed
 * preview slot directly below it. Hovering a row promotes it to active:
 * its text turns from light-grey to ink and its slot expands, with the
 * lead image sliding DOWN into the now-opening masked window. The
 * previous row's slot collapses in the same tick, its image sliding UP
 * out of view through the same overflow:hidden mask.
 *
 * Animation contract:
 *   • duration 0.7s
 *   • easing   cubic-bezier(0.22, 1, 0.36, 1)
 *   • motion   Y-axis only — slot opens via grid-template-rows 0fr → 1fr
 *              while the image inside translates -101% → 0. No fade, no
 *              bounce, no elastic. The net height delta across the list
 *              is zero (one slot opens by N, another closes by N), so
 *              rows outside the moving pair stay put.
 */

.arc {
  position: relative;
  padding: 0 0 clamp(40px, 6vw, 80px);
}

/* ── The list ─────────────────────────────────────────────────────── */
.arc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.arc-item {
  border-bottom: 1px solid var(--rule-soft);
}
.arc-item:last-child { border-bottom: 0; }

.arc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
  padding: clamp(14px, 1.6vw, 22px) 0;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: color-mix(in oklab, var(--ink) 26%, transparent);
  transition: color 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.arc-row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}
.arc-row.is-active { color: var(--ink); }

.arc-title {
  font-family: var(--font-text);
  font-size: clamp(18px, 1.9vw, 26px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: inherit;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.font-display .arc-title { font-family: var(--font-text); }

.arc-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: inherit;
  text-align: right;
  white-space: nowrap;
}
.arc-meta-cat { letter-spacing: 0.02em; }
.arc-meta-year { font-variant-numeric: tabular-nums; }

/* ── Preview slot — the masked window living under each row ───────
 * grid-template-rows trick: 0fr (closed) → 1fr (open) animates SMOOTHLY
 * with the row content's natural height. The inner wrapper carries
 * overflow:hidden — that's the mask the image slides through.
 *
 * The slot ALSO transitions an outer block of margin (so the air around
 * the image animates with the same easing — without this the row text
 * pops away from the image at t=0).
 */
.arc-slot {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.arc-slot.is-open { grid-template-rows: 1fr; }

.arc-slot-inner {
  overflow: hidden;
  min-height: 0;          /* required for the grid trick */
}

/* The image lives inside the masked inner; translateY animates from
 * fully-above (-101% covers a sub-pixel rounding seam) to 0. The slot's
 * height grows from 0 to the image's natural height at the same time. */
/* Half-size preview — slot is 50% of the row width, left-aligned with the
 * title above it. object-fit: contain (not cover) so the image is shown
 * in its native aspect and never crops; the slot's tone fills any letter-
 * or pillar-box. The 4/3 frame matches the project-page lead-image
 * proportion so the same photo reads the same on both surfaces. */
.arc-slot-img {
  position: relative;
  width: 30%;
  aspect-ratio: 16 / 9;
  margin: clamp(10px, 1.4vw, 18px) 0 clamp(18px, 2vw, 26px);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  overflow: hidden;       /* second mask — keeps the contained image clipped during the slide */
  transform: translateY(-101%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.arc-slot.is-open .arc-slot-img { transform: translateY(0); }

/* MediaSlot fills the image box; contain so the photo is never cropped. */
.arc-slot-img .mslot,
.arc-slot-img image-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.arc-slot-img .mslot-media,
.arc-slot-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Reduced motion: no slides, just instant state swap. */
@media (prefers-reduced-motion: reduce) {
  .arc-slot,
  .arc-slot-img,
  .arc-row { transition: none; }
}
