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

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

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.gallery__card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  background: #f5f5f5;
}

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

.gallery__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.1) 55%, transparent);
  opacity: 0;
  pointer-events: none;
}

.gallery__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 0.75rem;
  transform: translateY(0.5rem);
  pointer-events: none;
}

.gallery__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
}

.gallery__category {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 640px) {
  .gallery__grid {
    gap: 1rem;
  }

  .gallery__caption {
    padding: 1rem;
  }
}

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

  .gallery__grid {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 3.5rem;
  }
}

/*
 * Gallery 02 — "card lift + overlay reveal" animation identity. Same
 * canonical keyframes/transitions as `Gallery02.tailwind.css`. Scoped with a
 * unique `al-gallery02-*` prefix so this never collides with another
 * Resource's own animation layer when copied standalone. Entirely disabled
 * under reduced motion: outside the media query below, every element
 * already renders in its final, fully visible state.
 */
@keyframes al-gallery02-reveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .al-gallery02-reveal {
    animation: al-gallery02-reveal 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .gallery__card {
    transition:
      transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 300ms ease;
  }

  .gallery__card:hover {
    transform: translateY(-6px);
  }

  .gallery__overlay {
    transition: opacity 300ms ease;
  }

  .gallery__card:hover .gallery__overlay {
    opacity: 1;
  }

  .gallery__caption {
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .gallery__card:hover .gallery__caption {
    transform: translateY(0);
  }
}
