/* The PNGs are untouched originals. Each picture shows the original inner
   photo; complete belt-colored rings, labels and connections use HTML/CSS. */
.lineage-tree {
  --lineage-gap: clamp(.75rem, 2vw, 1.75rem);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--lineage-gap);
  margin: clamp(2rem, 4vw, 3.5rem) 0 2rem;
  padding: 0;
  list-style: none;
}

.lineage-tree__person {
  position: relative;
  min-width: 0;
  text-align: center;
}

.lineage-tree__visual {
  position: relative;
}

.lineage-tree__person:not(:last-child) .lineage-tree__visual::after {
  position: absolute;
  top: 50%;
  left: calc(100% + var(--lineage-gap) / 2);
  width: clamp(8px, 1.2vw, 16px);
  height: clamp(18px, 2.1vw, 28px);
  content: "";
  background: var(--cyan-400);
  opacity: .85;
  transform: translate(-50%, -50%);
  clip-path: polygon(0 0, 42% 0, 100% 50%, 42% 100%, 0 100%, 58% 50%);
}

.lineage-tree__frame {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 176px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(111,119,140,.24);
  border-radius: 50%;
  background: linear-gradient(145deg, #28282b, #08090b 70%);
  box-shadow: 0 8px 24px -18px rgba(0,0,0,.65), inset 0 0 0 1px rgba(255,255,255,.025);
}

/* Expand the colored ring exactly 1px outwards at every viewport size. */
.lineage-tree__frame::before {
  position: absolute;
  inset: -1px;
  content: "";
  border: inherit;
  border-radius: inherit;
  background: inherit;
  box-shadow: inherit;
}

.lineage-tree__person--red .lineage-tree__frame {
  background: linear-gradient(145deg, #b84c51, #913139 75%);
}

.lineage-tree__person--coral .lineage-tree__frame {
  background: repeating-conic-gradient(from -30deg,
    #a53b43 0deg 60deg, #101113 60deg 120deg);
}

.lineage-tree__portrait {
  position: relative;
  display: block;
  z-index: 1;
  width: calc(72% - 2px); /* Move the inner edge 1px inward. */
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.3);
}

.lineage-tree__portrait img {
  position: absolute;
  display: block;
  width: 1144.067797%; /* 1350 / 118 */
  max-width: none;
  height: auto;
  left: calc(var(--portrait-x) * -100% / 118);
  top: calc(-188 * 100% / 118);
}

.lineage-tree__label {
  position: relative;
  z-index: 2;
  padding: .85rem .15rem 0;
}

.lineage-tree__label h3 {
  margin: 0;
  font-size: clamp(.75rem, 1.13vw, .98rem);
  font-weight: 750;
  line-height: 1.25;
  color: var(--white);
  text-wrap: balance;
}

.lineage-tree__label p {
  margin: 0;
  font-size: clamp(.65rem, .88vw, .76rem);
  line-height: 1.5;
  color: var(--ink-dim);
  text-wrap: balance;
}

.lineage-tree__person--red .lineage-tree__label p,
.lineage-tree__person--coral .lineage-tree__label p {
  color: #f09b9f;
}

@media (max-width: 639px) {
  .lineage-tree {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    margin-top: 2rem;
  }

  .lineage-tree__person {
    width: min(100%, 260px);
    margin: 0 auto;
  }

  .lineage-tree__frame {
    width: 176px;
  }

  .lineage-tree__portrait img {
    width: 423.728814%; /* 500 / 118 */
    left: calc(-191 * 100% / 118);
    top: calc(var(--portrait-y) * -100% / 118);
  }

  .lineage-tree__person:not(:last-child) .lineage-tree__visual::after {
    content: none;
  }

  .lineage-tree__person:not(:last-child)::after {
    position: absolute;
    top: calc(100% + 11px);
    left: 50%;
    width: 28px;
    height: 18px;
    content: "";
    background: var(--cyan-400);
    opacity: .85;
    transform: translateX(-50%);
    clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 42%, 50% 100%, 0 42%);
  }

  .lineage-tree__label {
    min-height: 0;
    padding-top: .75rem;
  }

  .lineage-tree__label h3 {
    min-height: 0;
    font-size: 1rem;
  }

  .lineage-tree__label p {
    margin-top: 0;
    font-size: .8rem;
  }
}
