.detail-header {
  align-items: start;
  padding-top: 28px;
}

.detail-header .name { grid-column: 1 / 5; }
.detail-back { grid-column: 9 / 11; width: fit-content; }
.detail-count { grid-column: 12 / 13; justify-self: end; color: var(--muted); }
.detail-back::after, .pager-link::after, .detail-footer a::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.detail-back:hover::after, .pager-link:hover::after, .detail-footer a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.detail-intro {
  padding-top: clamp(58px, 5vw, 76px);
  padding-bottom: clamp(82px, 8vw, 112px);
  align-items: start;
}
.detail-label { display: none; }
.detail-title { grid-column: 4 / 10; grid-row: 1; font-size: clamp(30px, 2.6vw, 40px); font-weight: 400; line-height: 1.15; letter-spacing: -.025em; }
.detail-title--logo { line-height: 0; }
.detail-title--logo img { width: auto; height: auto; max-width: 150px; max-height: 38px; }
.detail-meta { grid-column: 4 / 10; grid-row: 2; padding-top: 30px; color: var(--muted); }
.detail-copy { grid-column: 4 / 10; grid-row: 3; width: 100%; padding-top: 17px; font-size: 15px; line-height: 2; }

.detail-media .gallery { grid-column: 2 / 12; min-width: 0; }
.gallery { outline: none; }
.gallery-main { width: 60%; margin: 0 auto; aspect-ratio: 3 / 2; overflow: hidden; }
.gallery-main img,
.gallery-main video { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-viewport { width: 60%; overflow-x: auto; overflow-y: hidden; margin: 22px auto 0; cursor: grab; touch-action: pan-y; user-select: none; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.gallery-viewport::-webkit-scrollbar { display: none; }
.gallery-viewport.is-dragging { cursor: grabbing; }
.gallery-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--gap) * 2)) / 3); gap: var(--gap); min-width: 100%; }
.gallery-slide { aspect-ratio: 3 / 2; overflow: hidden; cursor: pointer; opacity: .42; scroll-snap-align: start; transition: opacity .2s ease; }
.gallery-slide:hover,
.gallery-slide[aria-current="true"] { opacity: 1; }
.gallery-slide img,
.gallery-slide video { width: 100%; height: 100%; pointer-events: none; }
.gallery-slide img { object-fit: cover; }
.gallery-slide video { display: block; object-fit: cover; }
.gallery-slide--portrait img { object-fit: contain; }
.gallery-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 60%; margin: 12px auto 0; padding-top: 10px; border-top: 1px solid var(--ink); }
.gallery-button { width: fit-content; padding: 0; border: 0; color: inherit; background: none; font: inherit; cursor: pointer; }
.gallery-button:disabled { cursor: default; opacity: .25; }
.gallery-button:last-child { justify-self: end; }
.gallery-count { color: var(--muted); font-size: 11px; }

.project-social { margin-top: clamp(68px, 8vw, 112px); }
.project-social-inner { grid-column: 4 / 10; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--gap); padding-top: 16px; border-top: 1px solid var(--line); }
.project-social p { color: #444; line-height: 1.8; }
.project-social a { width: fit-content; white-space: nowrap; }
.project-social a::after { content: ""; display: block; width: 100%; height: 1px; background: currentColor; transform: scaleX(1); transform-origin: left; transition: transform .25s ease; }
.project-social a:hover::after { transform: scaleX(0); transform-origin: right; }
.project-social + .project-pager { margin-top: clamp(72px, 9vw, 132px); }

.project-pager {
  align-items: end;
  margin-top: clamp(100px, 13vw, 190px);
  padding-top: 18px;
  padding-bottom: 30px;
  border-top: 1px solid var(--line);
}
.pager-prev { grid-column: 4 / 6; }
.pager-all { grid-column: 6 / 8; justify-self: center; }
.pager-next { grid-column: 8 / 10; justify-self: end; text-align: right; }
.pager-link { width: fit-content; }
.pager-next .pager-link { margin-left: auto; }
.pager-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; }

@media (max-width: 700px) {
  .detail-header { padding-top: 20px; }
  .detail-header .name { grid-column: 1 / 4; }
  .detail-back { grid-column: 4 / 6; justify-self: end; }
  .detail-count { grid-column: 6 / 7; }
  .detail-intro { padding-top: 76px; padding-bottom: 56px; }
  .detail-title { grid-column: 1 / 7; font-size: 30px; }
  .detail-title--logo img { max-width: 120px; max-height: 32px; }
  .detail-meta { grid-column: 1 / 7; padding-top: 24px; }
  .detail-copy { grid-column: 1 / 7; padding-top: 15px; }
  .detail-media .gallery { grid-column: 1 / 7; }
  .gallery-main,
  .gallery-controls,
  .gallery-viewport { width: 100%; }
  .gallery-track { grid-auto-columns: 84%; gap: 10px; }
  .project-social { margin-top: 64px; }
  .project-social-inner { grid-column: 1 / 7; grid-template-columns: 1fr; gap: 16px; }
  .project-pager { row-gap: 35px; }
  .pager-prev { grid-column: 1 / 4; }
  .pager-all { grid-column: 1 / 7; grid-row: 2; justify-self: start; }
  .pager-next { grid-column: 4 / 7; }
}
