.gallery-hero {
  display: grid;
  grid-template-columns: 0.76fr 1.24fr;
  align-items: center;
  gap: 58px;
  padding-top: 34px;
  padding-bottom: 74px;
}

.gallery-hero-copy {
  padding-block: 30px;
}

.back-link {
  display: inline-block;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 16px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 6px;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--aqua);
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--aqua);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-hero h1 {
  font-size: 76px;
  letter-spacing: -0.02em;
}

.gallery-hero h1 span {
  color: var(--aqua);
}

.gallery-hero-copy > p:not(.eyebrow) {
  max-width: 440px;
  margin: 27px 0 30px;
  color: var(--muted);
  font-size: 20px;
}

.gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-actions .button-secondary {
  border: 2px solid var(--aqua);
  background: transparent;
  color: var(--aqua);
}

.gallery-actions .button-secondary:hover,
.gallery-actions .button-secondary:focus-visible {
  background: var(--aqua);
  color: var(--background);
}

.gallery-feature,
.gallery-open {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.gallery-feature {
  position: relative;
  min-width: 0;
}

.gallery-feature img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-position: center 58%;
}

.gallery-feature span {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 8px 12px;
  background: rgba(16, 22, 23, 0.9);
  color: var(--foreground);
  font-size: 15px;
}

.gallery-section {
  padding-top: 70px;
  padding-bottom: 80px;
  border-top: 1px solid var(--line);
}

.service-inventory {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 72px;
  padding-top: 48px;
  padding-bottom: 52px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-inventory h2 {
  font-size: 58px;
  line-height: 0.96;
}

.service-inventory__intro > p:last-child {
  max-width: 390px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
}

.capability-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
}

.capability-group h3 {
  margin-bottom: 15px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 32px;
  line-height: 1;
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.capability-list li {
  position: relative;
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--foreground);
}

.capability-list li::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 0;
  width: 8px;
  height: 2px;
  background: var(--aqua);
  box-shadow: 0 0 8px rgba(57, 216, 193, 0.45);
}

.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 38px;
}

.gallery-heading h2,
.gallery-cta h2 {
  font-size: 64px;
}

.gallery-heading > p {
  max-width: 340px;
  margin-bottom: 7px;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 22px;
}

.gallery-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 60px;
  margin: 0;
}

.gallery-card button {
  width: 100%;
  display: block;
  aspect-ratio: 1;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signs-gallery-page .gallery-card:nth-child(2) img,
.signs-gallery-page .gallery-card:nth-child(n + 4) img {
  object-position: center 28%;
}

.specialty-gallery-page .gallery-feature img {
  object-position: center 52%;
}

.specialty-gallery-page .gallery-card:nth-child(1) img {
  object-position: 61% 53%;
}

.specialty-gallery-page .gallery-card:nth-child(2) img,
.specialty-gallery-page .gallery-card:nth-child(7) img {
  object-position: center 43%;
}

.specialty-gallery-page .gallery-card:nth-child(5) img {
  object-position: center 55%;
}

@media (min-width: 901px) {
  .gallery-grid--center-last .gallery-card:last-child:nth-child(3n + 1) {
    grid-column: 2;
  }
}

.wallpaper-story {
  padding-top: 70px;
  padding-bottom: 80px;
  border-top: 1px solid var(--line);
}

.wallpaper-story-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 58px;
  align-items: start;
}

.wallpaper-story-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.wallpaper-story-copy h2 {
  margin-bottom: 22px;
  font-size: 64px;
}

.wallpaper-story-copy > p:not(.eyebrow) {
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 19px;
}

.wallpaper-features {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.wallpaper-features li {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--foreground);
}

.gallery-card:nth-child(1) img {
  object-position: center;
}

.gallery-card:nth-child(3) img {
  object-position: 42% center;
}

.gallery-card:nth-child(4) img,
.gallery-card:nth-child(10) img {
  object-position: center;
}

.gallery-card:nth-child(11) img {
  object-position: 54% center;
}

.gallery-card figcaption {
  height: 60px;
  display: grid;
  grid-template-rows: 21px 20px;
  gap: 2px;
  padding-top: 11px;
  line-height: 1.3;
}

.gallery-card figcaption strong {
  color: var(--foreground);
  font-size: 16px;
  font-weight: 600;
  line-height: 21px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card figcaption span {
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-feature img,
  .gallery-card img {
    transition:
      transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 260ms ease-out,
      filter 260ms ease-out;
  }

  .gallery-feature:hover img,
  .gallery-feature:focus-visible img,
  .gallery-card button:hover img,
  .gallery-card button:focus-visible img {
    transform: translateY(-6px);
    box-shadow:
      0 11px 28px rgba(0, 0, 0, 0.34),
      0 0 0 2px var(--aqua),
      0 0 14px 3px rgba(57, 216, 193, 0.75),
      0 0 36px 8px rgba(57, 216, 193, 0.4);
    filter:
      brightness(1.045)
      drop-shadow(0 0 14px rgba(57, 216, 193, 0.46));
  }
}

.gallery-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 45px;
  margin-bottom: 62px;
  padding-top: 45px;
  padding-bottom: 45px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.work-category-nav {
  padding-top: 6px;
  padding-bottom: 62px;
}

.work-category-nav > p {
  margin: 0 0 15px;
  color: var(--aqua);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-category-nav > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.work-category-nav a {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--foreground);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition:
    border-color 180ms ease-out,
    color 180ms ease-out,
    box-shadow 180ms ease-out,
    text-shadow 180ms ease-out;
}

.work-category-nav a:hover,
.work-category-nav a:focus-visible {
  border-color: var(--aqua);
  color: var(--aqua);
  box-shadow:
    inset 0 0 16px rgba(57, 216, 193, 0.08),
    0 0 16px rgba(57, 216, 193, 0.18);
  text-shadow: 0 0 12px rgba(57, 216, 193, 0.72);
}

.gallery-dialog {
  width: min(92vw, 1180px);
  max-height: 92vh;
  padding: 48px 24px 24px;
  border: 1px solid var(--line);
  background: var(--background);
  color: var(--foreground);
}

.gallery-dialog::backdrop {
  background: rgba(3, 7, 8, 0.9);
  backdrop-filter: blur(6px);
}

.gallery-dialog figure {
  margin: 0;
}

.gallery-dialog img {
  max-height: calc(92vh - 175px);
  object-fit: contain;
}

.gallery-dialog figcaption {
  height: auto;
  padding-top: 12px;
  color: var(--foreground);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 14px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--aqua);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  color: #ffffff;
}

.dialog-navigation {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr minmax(96px, auto);
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dialog-navigation button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--aqua);
  background: transparent;
  color: var(--aqua);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dialog-navigation button:hover,
.dialog-navigation button:focus-visible {
  background: var(--aqua);
  color: var(--background);
}

.dialog-count {
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

@media (max-width: 900px) {
  .gallery-hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-bottom: 54px;
  }

  .gallery-hero-copy {
    padding-bottom: 0;
  }

  .back-link {
    margin-bottom: 30px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallpaper-story-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .service-inventory {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .capability-groups .capability-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .gallery-hero {
    padding-top: 12px;
    padding-bottom: 44px;
  }

  .gallery-hero h1 {
    font-size: 54px;
  }

  .gallery-hero-copy > p:not(.eyebrow) {
    font-size: 18px;
  }

  .gallery-section {
    padding-top: 48px;
    padding-bottom: 50px;
  }

  .service-inventory {
    gap: 26px;
    padding-top: 38px;
    padding-bottom: 40px;
  }

  .service-inventory h2 {
    font-size: 46px;
  }

  .capability-groups,
  .capability-list {
    grid-template-columns: 1fr;
  }

  .capability-groups {
    gap: 32px;
  }

  .gallery-heading {
    display: block;
    margin-bottom: 28px;
  }

  .gallery-heading h2,
  .gallery-cta h2,
  .wallpaper-story-copy h2 {
    font-size: 44px;
  }

  .gallery-heading > p {
    margin-top: 16px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-actions .button {
    min-height: 54px;
    padding-inline: 10px;
    text-align: center;
  }

  .wallpaper-story {
    padding-top: 48px;
    padding-bottom: 50px;
  }

  .gallery-card {
    margin-bottom: 26px;
  }

  .gallery-cta {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 36px;
  }

  .work-category-nav {
    padding-bottom: 42px;
  }

  .work-category-nav > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-category-nav a:last-child {
    grid-column: 1 / -1;
  }

  .gallery-dialog {
    width: calc(100vw - 24px);
    padding: 44px 12px 14px;
  }

  .gallery-dialog img {
    max-height: calc(100vh - 210px);
  }

  .dialog-navigation {
    grid-template-columns: 96px 1fr 96px;
    gap: 8px;
  }

  .dialog-navigation button {
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-feature img,
  .gallery-card img {
    transition-duration: 80ms !important;
  }
}
