.work-gallery {
  margin-top: 18px;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 360ms ease 160ms,
    transform 360ms ease 160ms;
}

.work-gallery[hidden] {
  display: none;
}

.work-gallery__heading {
  margin-bottom: 16px;
}

.work-gallery__heading p:last-child {
  max-width: 56ch;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.work-gallery__viewport {
  position: relative;
}

.work-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.work-gallery__item {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 20px;
  background: var(--surface-soft);
}

.work-gallery__open {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.work-gallery__open:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

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

.work-gallery__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(12, 12, 12, 0.66);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.work-gallery[data-gallery-layout="carousel"] .work-gallery__viewport {
  --gallery-card-size: clamp(150px, 18vw, 220px);
}

.work-gallery[data-gallery-layout="carousel"] .work-gallery__viewport::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 8px;
  width: 42px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--card-bg));
}

.work-gallery[data-gallery-layout="carousel"] .work-gallery__viewport:not(.work-gallery__viewport--scrollable)::after,
.work-gallery[data-gallery-layout="carousel"] .work-gallery__viewport--at-end::after {
  opacity: 0;
}

.work-gallery[data-gallery-layout="carousel"] .work-gallery__grid {
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 8px;
  scroll-padding-inline: 0;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.work-gallery[data-gallery-layout="carousel"] .work-gallery__grid::-webkit-scrollbar {
  display: none;
}

.work-gallery[data-gallery-layout="carousel"] .work-gallery__item {
  flex: 0 0 var(--gallery-card-size);
  width: var(--gallery-card-size);
  min-width: 0;
  scroll-snap-align: start;
}

body.has-gallery-lightbox {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 14px;
  align-items: center;
  padding: clamp(18px, 4vw, 34px);
  background: rgba(8, 8, 10, 0.86);
  backdrop-filter: blur(18px);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__figure {
  grid-column: 2;
  display: grid;
  gap: 12px;
  justify-self: center;
  max-width: min(92vw, 980px);
  margin: 0;
}

.gallery-lightbox__image {
  display: block;
  width: min(92vw, 980px);
  height: min(82vh, 820px);
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  object-fit: contain;
}

.gallery-lightbox__caption {
  justify-self: center;
  max-width: min(92vw, 760px);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(18, 18, 18, 0.62);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-lightbox__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 22, 22, 0.68);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font: inherit;
  font-size: 1.9rem;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.gallery-lightbox__button:hover,
.gallery-lightbox__button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.gallery-lightbox__button[hidden] {
  display: none;
}

.gallery-lightbox__close {
  position: absolute;
  top: clamp(14px, 3vw, 24px);
  right: clamp(14px, 3vw, 24px);
  z-index: 1;
}

.gallery-lightbox__nav--prev {
  grid-column: 1;
  justify-self: end;
}

.gallery-lightbox__nav--next {
  grid-column: 3;
  justify-self: start;
}

.site-footer {
  margin-top: 18px;
  padding: 28px 24px 22px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.site-footer__top,
.site-footer__bottom {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer__top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.site-footer__divider {
  height: 1px;
  margin: 18px 0 20px;
  background: var(--divider-line);
}

.site-footer__contact-line:empty,
.site-footer__meta:empty,
.site-footer__social:empty,
.site-footer__contact-line[hidden],
.site-footer__meta[hidden],
.site-footer__social[hidden] {
  display: none;
}

.site-footer__brand .eyebrow {
  margin-bottom: 0;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
}

.site-footer__contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: flex-end;
}

.site-footer__quick-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.site-footer__social {
  display: flex;
  justify-content: flex-end;
  align-self: center;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border-radius: 0;
  color: var(--text);
  text-decoration: none;
  border: 0;
  background: transparent;
}

.site-footer__social-link span {
  font-weight: 700;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  align-items: flex-start;
}

.site-footer__item {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 33ch;
}

.site-footer__item span {
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer__item strong,
.site-footer__item a {
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.site-footer__item--address {
  flex: 1 1 340px;
  max-width: 46ch;
}

.site-footer__copy {
  margin: 0 0 0 auto;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
  font-size: 0.96rem;
  max-width: 34ch;
}

.site-footer__copy a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.site-footer__copy a:hover {
  text-decoration: underline;
}

.site-footer__social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
