:root {
  color: #000;
  background: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background: #fff;
}

button {
  font: inherit;
}

.showcase {
  display: grid;
  grid-template-columns: 4rem minmax(0, 38rem) 4rem;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 2.5rem);
  min-height: 100vh;
  min-height: 100svh;
  padding: 2rem 1rem;
}

.character {
  width: 100%;
  margin: 0;
  text-align: center;
}

.image-frame {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.image-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  transform-origin: center;
  will-change: opacity, transform;
}

.image-frame .character-image--incoming {
  opacity: 0;
}

.character figcaption {
  position: relative;
  margin-top: clamp(1rem, 2.5vh, 1.75rem);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
}

.character-name {
  display: block;
  margin: 0;
  font: inherit;
  backface-visibility: hidden;
  transform-origin: center;
  will-change: opacity, transform;
}

.character-name--incoming {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.arrow {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #000;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.arrow svg {
  display: block;
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:hover {
  background: #f2f2f2;
  transform: scale(1.08);
}

.arrow:active {
  transform: scale(0.96);
}

.arrow:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}

@media (max-width: 42rem) {
  .showcase {
    grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    gap: 0.25rem;
    padding-inline: 0.5rem;
  }

  .arrow {
    width: 3rem;
    height: 3rem;
  }

  .arrow svg {
    width: 1.625rem;
    height: 1.625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arrow,
  .image-frame img {
    transition: none;
  }
}
