body.lab-page {
  margin: 0;
}

.lab-intro {
  padding-inline: 1.125rem;
  text-align: center;
}

.lab-intro h1,
.lab-study-title h2 {
  margin: 0;
}

.lab-exhibition {
  width: min(91%, 86rem);
  margin-inline: auto;
  padding-bottom: clamp(2rem, 5vw, 4.5rem);
}

.lab-study {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: clamp(1rem, 2.4vw, 2.6rem);
  margin-block-end: clamp(5rem, 12vw, 11rem);
}

.lab-study:last-child {
  margin-block-end: 0;
}

.lab-study-title {
  grid-area: title;
  min-width: 0;
}

.lab-study-copy {
  max-width: 38ch;
  margin: 1rem 0 0;
}

.lab-descriptors {
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
  color: var(--portfolio-muted);
  font: 400 var(--portfolio-meta-size)/1.65 var(--portfolio-sans);
}

.lab-frame {
  min-width: 0;
  margin: 0;
}

.lab-frame-hero { grid-area: hero; }
.lab-frame-context { grid-area: context; }
.lab-frame-detail { grid-area: detail; }

.lab-photo {
  display: block;
  position: relative;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.lab-photo:focus-visible,
.lab-viewer-toolbar button:focus-visible {
  outline: 1px solid var(--portfolio-ink);
  outline-offset: 5px;
}

.lab-photo img {
  display: block;
  width: 100%;
  height: auto;
}

#light-through-matter {
  grid-template-areas:
    "detail detail detail detail detail detail detail detail detail detail detail detail"
    "title title title context context context context context hero hero hero hero";
}

#light-through-matter .lab-frame-detail {
  width: min(100%, 68rem);
  justify-self: center;
}

#light-through-matter .lab-study-title {
  align-self: center;
}

#light-through-matter .lab-frame-hero {
  margin-block-start: clamp(1.25rem, 4vw, 3.5rem);
}

#silk-surface {
  grid-template-areas:
    "context context context context context context context context . title title title"
    ". hero hero hero hero hero . detail detail detail detail .";
}

#silk-surface .lab-study-title {
  align-self: end;
  padding-block-end: 1.5rem;
}

#silk-surface .lab-frame-detail {
  margin-block-start: clamp(1.25rem, 6vw, 6rem);
}

#industrial-spa {
  grid-template-areas:
    ". title title title detail detail detail detail detail detail detail detail"
    "hero hero hero hero hero . . context context context context context";
}

#industrial-spa .lab-study-title {
  align-self: center;
}

#industrial-spa .lab-frame-context {
  margin-block-start: clamp(1.5rem, 5vw, 4rem);
}

#sculptural-objects {
  grid-template-areas:
    ". hero hero hero hero hero hero hero . title title title"
    "context context context context context context . detail detail detail detail .";
}

#sculptural-objects .lab-study-title {
  align-self: center;
}

#sculptural-objects .lab-frame-detail {
  align-self: end;
}

.lab-viewer {
  width: min(94vw, 73rem);
  max-width: calc(100% - 1rem);
  max-height: 94vh;
  max-height: 94dvh;
  padding: 0;
  border: 1px solid var(--portfolio-line);
  background: var(--portfolio-paper);
  color: var(--portfolio-ink);
  overscroll-behavior: contain;
}

.lab-viewer::backdrop {
  background: rgb(39 37 32 / 70%);
}

.lab-viewer-inner {
  display: grid;
  gap: .625rem;
  padding: .75rem clamp(.75rem, 2.5vw, 2rem);
}

.lab-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font: 400 var(--portfolio-meta-size)/1.5 var(--portfolio-sans);
}

.lab-viewer-toolbar button {
  min-height: 44px;
  padding: .25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .25rem;
}

.lab-viewer-caption {
  text-align: center;
  color: var(--portfolio-muted);
}

.lab-viewer-image {
  display: grid;
  place-items: center;
  height: min(67vh, 49rem);
  height: min(67dvh, 49rem);
  margin: 0;
  touch-action: pan-y;
}

.lab-viewer-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

html:has(.lab-viewer[open]) { overflow: hidden; }

@media (max-width: 760px) {
  .lab-exhibition {
    width: calc(100% - 2rem);
  }

  .lab-study:is(#light-through-matter, #silk-surface, #industrial-spa, #sculptural-objects) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .9rem .35rem;
  }

  #light-through-matter {
    grid-template-areas:
      "detail detail detail detail detail detail"
      "title title title title title ."
      "context context context context context context"
      ". hero hero hero hero hero";
  }

  #silk-surface {
    grid-template-areas:
      "context context context context context context"
      "title title title title title ."
      "hero hero hero hero hero ."
      ". detail detail detail detail detail";
  }

  #industrial-spa {
    grid-template-areas:
      "detail detail detail detail detail detail"
      "title title title title title ."
      ". hero hero hero hero hero"
      "context context context context context context";
  }

  #sculptural-objects {
    grid-template-areas:
      "hero hero hero hero hero hero"
      ". title title title title title"
      "context context context context context context"
      ". detail detail detail detail detail";
  }

  #light-through-matter .lab-frame-hero,
  #silk-surface .lab-frame-detail,
  #industrial-spa .lab-frame-context {
    margin-block-start: 0;
  }

  #silk-surface .lab-study-title {
    padding-block-end: 0;
  }

  .lab-study-title {
    padding: .5rem 0 1rem;
  }

  .lab-viewer-image {
    height: 53vh;
    height: 53dvh;
  }
}
