/*
  All projects: an editorial index of big names. Hovering a row brings it
  forward while the others step back; on phones each row shows its stage as a
  small thumbnail.
*/
.projects-main {
  --arrive: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.3, 1.16, 0.45, 1);
}

/* Hero */
.pj-hero {
  padding-top: clamp(32px, 5vw, 72px);
}
.pj-title {
  display: flex;
  align-items: flex-start;
  gap: 0.12em;
  font-size: clamp(3.5rem, 1rem + 9.5vw, 9.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.pj-title-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.22em;
}
.pj-word {
  display: inline-block;
}
.pj-intro {
  max-width: 36ch;
  margin-top: 28px;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.45;
  text-wrap: pretty;
}
/* Index */
.pj-index {
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line-strong);
  list-style: none;
}
.pj-row-inner {
  min-height: 0;
}
.pj-link {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 22px;
  grid-template-areas:
    "thumb text arrow"
    "thumb meta arrow";
  align-items: center;
  gap: 4px 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: opacity 350ms var(--arrive);
}
.pj-no {
  display: none;
}
.pj-thumb {
  grid-area: thumb;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
}
.pj-thumb .stage {
  aspect-ratio: 4 / 3;
}
.pj-text {
  grid-area: text;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.pj-name {
  font-size: clamp(1.5rem, 1rem + 4.2vw, 5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  transition: transform 600ms var(--spring);
}
.pj-meta {
  grid-area: meta;
  color: var(--ink-3);
}
.pj-arrow {
  grid-area: arrow;
  color: var(--ink-3);
  transition: transform 450ms var(--spring), color 200ms;
}
.pj-link:hover .pj-arrow,
.pj-link:focus-visible .pj-arrow {
  color: var(--ink);
  transform: rotate(45deg);
}

/* Wide screens with a fine pointer: big rows, floating preview */
@media (min-width: 900px) {
  .pj-link {
    grid-template-columns: 56px minmax(0, 1fr) minmax(160px, auto) 28px;
    grid-template-areas: "no text meta arrow";
    gap: 24px;
    padding: 30px 0;
  }
  .pj-no {
    grid-area: no;
    display: block;
    align-self: start;
    padding-top: 0.9em;
    color: var(--ink-3);
  }
  .pj-thumb {
    display: none;
  }
  .pj-meta {
    justify-self: end;
    text-align: right;
  }
}
/* Hovering a row brings it forward and lets the others step back */
@media (hover: hover) {
  .pj-index:hover .pj-link {
    opacity: 0.3;
  }
  .pj-index .pj-link:hover,
  .pj-index .pj-link:focus-visible {
    opacity: 1;
  }
  .pj-link:hover .pj-name {
    transform: translateX(18px);
  }
}

/* Motion: the page assembles once, rows and cards arrive as they scroll in */
@media (prefers-reduced-motion: no-preference) {
  .pj-word {
    animation: pj-rise 1000ms var(--arrive) both;
    animation-delay: calc(60ms + var(--i) * 110ms);
  }
  .pj-intro {
    animation: pj-rise 900ms var(--arrive) 380ms both;
  }
  .pj-row {
    animation: pj-row 900ms var(--arrive) backwards;
    animation-delay: calc(520ms + var(--i) * 70ms);
  }
}
@keyframes pj-rise {
  from { opacity: 0; transform: translateY(0.4em); filter: blur(10px); }
}
@keyframes pj-row {
  from { opacity: 0; transform: translateY(28px); filter: blur(8px); }
}
