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

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

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

.tile--hero {
  grid-column: span 2;
}

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

.tile__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
}

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

.tile__category {
  margin: 0.125rem 0 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) {
  .mosaic {
    gap: 1rem;
  }

  .tile__caption {
    padding: 1rem;
  }

  .tile--wide {
    grid-column: span 2;
  }
}

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

  .mosaic {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    margin-top: 3.5rem;
  }

  .tile {
    aspect-ratio: auto;
  }

  .tile--hero {
    grid-row: span 2;
  }

  .tile--tall {
    grid-column: span 1;
    grid-row: span 2;
  }
}

/*
 * Gallery 07 — "balanced mosaic with soft scale-in and caption reveal"
 * animation identity. Same canonical transitions as
 * `Gallery07.tailwind.css`. Scoped so this never collides with another
 * Resource's own animation layer. Entirely disabled under reduced motion:
 * every tile already renders in its final, fully visible state, and
 * captions stay visible rather than gated behind hover.
 */
@media (prefers-reduced-motion: no-preference) {
  .tile {
    opacity: 0;
    transform: scale(0.92);
    transition:
      opacity 700ms ease,
      transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .tile.is-visible {
    opacity: 1;
    transform: scale(1);
  }

  .tile__image {
    transition: transform 450ms ease;
  }

  .tile:hover .tile__image {
    transform: scale(1.045);
  }

  .tile__caption {
    opacity: 0;
    transform: translateY(6px);
    transition:
      opacity 250ms ease,
      transform 250ms ease;
  }

  .tile:hover .tile__caption {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile__caption {
    opacity: 1;
  }
}
