:root {
  --brand: #39ff14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #0a0a0a;
  color: #ffffff;
}

button {
  font-family: inherit;
}

.gallery {
  padding: 4rem 1rem;
  background: #0a0a0a;
}

.gallery__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.gallery__header {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.gallery__heading {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.gallery__subheading {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #a3a3a3;
}

.stage {
  position: relative;
  margin-top: 2.5rem;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 1rem;
  background: #171717;
}

.stage:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.stage__track {
  display: flex;
  height: 100%;
  transform: translateX(0%);
}

@media (prefers-reduced-motion: no-preference) {
  .stage__track {
    transition: transform 550ms cubic-bezier(0.65, 0, 0.35, 1);
  }
}

.stage__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
  pointer-events: none;
}

.stage__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  max-width: 28rem;
  padding: 1.25rem;
}

.stage__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.625rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.stage__title {
  margin: 0.5rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
}

.stage__description {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.thumbs {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 0.625rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.thumb {
  flex-shrink: 0;
  position: relative;
  width: 5rem;
  height: 3.5rem;
  overflow: hidden;
  border-radius: 0.5rem;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
}

.thumb:hover {
  opacity: 0.8;
}

.thumb:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.thumb.is-active {
  opacity: 1;
  box-shadow:
    0 0 0 2px #171717,
    0 0 0 4px #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
  .thumb {
    transition:
      box-shadow 250ms ease,
      opacity 250ms ease;
  }
}

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

@media (min-width: 640px) {
  .stage {
    aspect-ratio: 16 / 8;
  }

  .stage__caption {
    padding: 2rem;
  }

  .thumbs {
    gap: 0.75rem;
  }

  .thumb {
    width: 6rem;
    height: 4rem;
  }
}

@media (min-width: 1024px) {
  .gallery {
    padding: 6rem 2rem;
  }

  .stage {
    margin-top: 3.5rem;
    aspect-ratio: 16 / 7;
  }

  .thumbs {
    margin-top: 1.5rem;
  }
}
