/* FULL index: centred names in the display serif, dimming around the hovered one, and the hovered project's
   preview card centred below them. */

.index-cloud {
  position: relative;
  container-type: inline-size; /* its width never grows with its longest name */
  display: grid;
  place-items: center;
  align-content: center;
  padding: var(--space-9) var(--space-page);
}

.index-cloud__eyebrow {
  margin-bottom: var(--space-6);
  color: var(--ink-muted);
  text-align: center;
  text-wrap: balance;
}

.index-cloud__list {
  max-width: 1180px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 60px);
  font-size: min(clamp(30px, 3.6vw, 60px), 100cqi / 12.2); /* the longest name fits on a narrow phone */
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}

.index-cloud__item {
  color: var(--ink);
  text-decoration: none;
  transition: opacity var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard);
}
.index-cloud__item:focus-visible {
  outline-offset: 6px;
}
.index-cloud__entry {
  white-space: nowrap;
}
.index-cloud__sep {
  color: var(--ink-faint);
  transition: opacity var(--dur-base) var(--ease-standard);
}
.index-cloud__entry.is-line-end .index-cloud__sep {
  visibility: hidden;
}
.index-cloud.is-hovering .index-cloud__item:not(.is-active),
.index-cloud.is-hovering .index-cloud__sep {
  opacity: 0.3;
}

/* The card keeps its place below the names even while hidden, so showing it never moves the page. */
.index-cloud__card {
  position: relative;
  width: clamp(220px, 21vw, 320px);
  aspect-ratio: 16 / 10;
  margin-top: var(--space-7);
  overflow: hidden;
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  scale: 0.94;
  translate: 0 10px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-gold-400) 70%, transparent), 0 18px 50px rgb(92 68 34 / 0.28);
  transition: opacity var(--dur-base) var(--ease-out-expo), scale var(--dur-slow) var(--ease-out-expo), translate var(--dur-slow) var(--ease-out-expo);
}
[data-theme='dark'] .index-cloud__card,
.index-cloud[data-theme='dark'] .index-cloud__card {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-gold-400) 60%, transparent), 0 0 60px rgb(217 180 106 / 0.28), 0 18px 50px rgb(0 0 0 / 0.6);
}
.index-cloud__card.is-visible {
  opacity: 1;
  scale: 1;
  translate: 0 0;
}
.index-cloud__card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard);
}
.index-cloud__card img.is-shown {
  opacity: 1;
}
/* Name label in the card, legible on any artwork. */
.index-cloud__label {
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgb(7 8 11 / 0.55);
  color: var(--color-ivory);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Touch screens have no hover: a tap opens the project, so the card and its space go. */
@media (hover: none) {
  .index-cloud__card {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .index-cloud__card {
    scale: 1;
    translate: none;
    transition: opacity var(--dur-base) var(--ease-standard);
  }
}
