.home-badges {
  --badge-gap: clamp(.5rem, 1.2vw, .9rem);
  --badge-text: #f4f4f4;
  --badge-muted: #c4c4c4;
  padding-block: clamp(1rem, 1.7vw, 1.5rem);
  border-block: 1px solid #373737;
  background: #171717;
  color: var(--badge-text);
}

.home-badges-shell { max-width: 74rem; }

.home-badges h2,
.home-badges-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-badges-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--badge-gap);
  max-width: 29rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.home-badges-list > li { min-width: 0; }
.home-badge { position: relative; }
.home-badge[open] { z-index: 1; }

.home-badge summary {
  display: grid;
  width: min(100%, 4.25rem);
  aspect-ratio: 270 / 311;
  padding: .2rem;
  place-items: center;
  margin-inline: auto;
  border-radius: .25rem;
  list-style: none;
  cursor: pointer;
}

.home-badge summary::-webkit-details-marker { display: none; }
.home-badge :is(summary, a):focus-visible { outline-color: #dedede; outline-offset: 4px; }
.home-badge[open] summary, .home-badge summary:hover { background: #2a2a2a; }

.home-badge summary img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-badge-panel {
  position: relative;
  width: calc(300% + 2 * var(--badge-gap));
  margin-block-start: .68rem;
  padding: .85rem .95rem .57rem;
  border: 1px solid #777;
  border-radius: .55rem;
  background: #202020;
  text-align: start;
  box-shadow: 0 .65rem 1.5rem #0005;
}

.home-badge-panel strong {
  display: block;
  margin-block-end: .34rem;
  font-size: .925rem;
  line-height: 1.35;
}

.home-badge-panel p {
  color: var(--badge-muted);
  font-size: .875rem;
  line-height: 1.47;
}

.home-badge-panel a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-block-start: .06rem;
  color: var(--badge-text);
  font-size: .875rem;
  font-weight: 690;
  text-decoration: underline;
  text-underline-offset: .21em;
}

.home-badge-panel a:hover { color: #fff; }
.home-badge:not([open]) .home-badge-panel { display: none; }

@media (width < 900px) {
  .home-badges-list > :nth-child(3n + 2) .home-badge-panel { inset-inline-start: calc(-100% - var(--badge-gap)); }
  .home-badges-list > :nth-child(3n) .home-badge-panel { inset-inline-start: calc(-200% - 2 * var(--badge-gap)); }
}

@media (min-width: 900px) {
  .home-badges-list {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    max-width: 47rem;
  }

  .home-badge-panel {
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: 50%;
    width: 17.5rem;
    transform: translateX(-50%);
  }

  .home-badge-panel::before {
    position: absolute;
    inset-block-end: 100%;
    inset-inline: 0;
    height: .75rem;
    content: '';
  }

  .home-badges-list > li:nth-child(-n + 2) .home-badge-panel { inset-inline-start: 0; transform: none; }
  .home-badges-list > li:nth-last-child(-n + 2) .home-badge-panel { inset-inline-start: auto; inset-inline-end: 0; transform: none; }
}
