: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: #ffffff;
  color: #171717;
}

button {
  font-family: inherit;
}

.gallery {
  padding: 4rem 1rem;
}

.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: #171717;
}

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

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

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

.carousel__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.carousel__slide.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .carousel__slide {
    transition: opacity 500ms ease;
  }
}

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

.carousel__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 1.25rem;
}

.carousel__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  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.25);
  backdrop-filter: blur(4px);
}

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

.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #171717;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 150ms ease;
}

.carousel__arrow:hover {
  background: #ffffff;
}

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

.carousel__arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

.carousel__arrow--prev {
  left: 0.75rem;
}

.carousel__arrow--next {
  right: 0.75rem;
}

.carousel__dots {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.carousel__dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 999px;
  border: none;
  background: #d4d4d4;
  cursor: pointer;
  padding: 0;
  transition:
    width 300ms ease,
    background-color 150ms ease;
}

.carousel__dot:hover {
  background: #a3a3a3;
}

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

.carousel__dot.is-active {
  width: 1.5rem;
  background: #171717;
}

.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;
}

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

  .carousel__caption {
    padding: 2rem;
  }

  .carousel__arrow {
    width: 2.5rem;
    height: 2.5rem;
    left: 1rem;
  }

  .carousel__arrow--prev {
    left: 1rem;
  }

  .carousel__arrow--next {
    right: 1rem;
  }
}

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

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