.fame {
  padding-block: var(--space-2xl);
  background: var(--color-bg);
  overflow: hidden;
}

.fame__head {
  max-width: 56ch;
  margin-inline: auto;
  text-align: center;
}

.fame__head h2 {
  margin-top: var(--space-sm);
}

.fame__lead {
  margin-top: var(--space-md);
  margin-inline: auto;
}

/* ---- Scattered field of circular portraits. Each item's position/size
   comes from --x/--y/--size custom properties set inline per item, kept
   as percentages so the whole arrangement scales with the container. ---- */
.fame__field {
  position: relative;
  margin-top: var(--space-2xl);
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--space-md);
  height: 760px;
}

.fame__item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 1;
  transition: opacity var(--dur-med) var(--ease-silk), z-index 0s;
}

.fame__field.has-active .fame__item:not(.is-active) {
  opacity: 0.4;
}

.fame__photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 14px 30px -16px rgba(20, 25, 27, 0.35);
  transition: transform var(--dur-med) var(--ease-silk),
    box-shadow var(--dur-med) var(--ease-silk),
    outline-color var(--dur-med) var(--ease-silk);
  outline: 0px solid var(--color-bg);
  outline-offset: 0px;
}

.fame__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fame__item:hover:not(.is-active) .fame__photo,
.fame__item:focus-visible:not(.is-active) .fame__photo {
  transform: scale(1.08);
  box-shadow: 0 18px 36px -14px rgba(20, 25, 27, 0.4);
}

.fame__item:focus-visible {
  outline: none;
}

.fame__item:focus-visible:not(.is-active) .fame__photo {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

.fame__card {
  position: absolute;
  top: calc(100% + 0.9rem);
  left: 50%;
  width: max-content;
  max-width: 270px;
  transform: translate(-50%, -6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  box-shadow: 0 14px 30px -16px rgba(20, 25, 27, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-silk),
    transform var(--dur-med) var(--ease-silk);
}

.fame__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-ink);
  white-space: nowrap;
}

.fame__bio {
  font-size: var(--fs-caption);
  line-height: 1.5;
  color: var(--color-ink-soft);
}

.fame__item.is-active {
  z-index: 5;
  opacity: 1;
}

.fame__item.is-active .fame__photo {
  transform: scale(1.55);
  box-shadow: 0 30px 60px -20px rgba(20, 25, 27, 0.5);
  outline: 4px solid var(--color-bg);
  outline-offset: 0px;
}

.fame__item.is-active .fame__card {
  opacity: 1;
  transform: translate(calc(-50% + var(--shift, 0px)), 0);
}

/* The scattered field's height and per-item --size are both fixed px, so
   without a mobile scale-down the same 760px-tall canvas just gets narrower
   on small screens — very tall and sparse instead of compact. Shrinking
   both together keeps the scattered arrangement (--x/--y are percentages)
   proportional at any width. */
@media (max-width: 900px) {
  .fame__field {
    height: 560px;
  }

  .fame__item {
    width: calc(var(--size) * 0.8);
  }
}

@media (max-width: 640px) {
  .fame__field {
    height: 420px;
  }

  .fame__item {
    width: calc(var(--size) * 0.62);
  }

  .fame__card {
    max-width: 210px;
    padding: 0.65rem 0.85rem;
  }

  .fame__name {
    font-size: 0.85rem;
  }

  .fame__bio {
    font-size: 0.74rem;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fame__item,
  .fame__photo,
  .fame__card {
    transition: none;
  }
}
