:root { --case-ink: #000; }

.carbon-page { --case-section-gap: 100px; }

.case-study {
  align-items: center;
  padding: 0 68px 122px;
}

.project-link:focus-visible,
.desktop-preview a:focus-visible,
.lightbox-trigger:focus-visible {
  outline: 3px solid #111;
  outline-offset: 4px;
}

.project-link {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 64px;
  align-self: center;
  display: flex;
  width: 387px;
  max-width: 100%;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  padding: 20px 30px;
  border-radius: 0;
  background: var(--project-accent);
  color: var(--project-tint);
  text-decoration: none;
}

.project-link__title {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  font-size: var(--heading-size);
  font-weight: 500;
  line-height: 1.4;
}

.project-link__title img {
  display: block;
  width: 32px;
  height: 32px;
  padding: 5px;
  rotate: -45deg;
}

.project-link__url {
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  font-size: var(--body-size);
  font-weight: 200;
  line-height: 1.3;
  padding-bottom: 3px;
  opacity: 0.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-preview {
  width: 100%;
  margin: 0;
}

.desktop-preview a {
  position: relative;
  display: block;
  aspect-ratio: var(--desktop-frame-ratio);
}

.desktop-preview__screen {
  position: absolute;
  z-index: 1;
  inset: var(--desktop-screen-inset);
  overflow: hidden;
  background: #fff;
}

.desktop-preview__screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.desktop-preview__frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.project-content {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 90px;
  align-items: start;
}

.project-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 45px;
  justify-content: center;
}

.iteration-grid { margin: 0; }

.iteration-grid noscript img { aspect-ratio: 585 / 685; }

.iteration-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lightbox-trigger {
  display: block;
  min-width: 0;
  aspect-ratio: 190 / 165;
  margin: 0;
  padding: 0;
  border: 1px solid #777;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.iteration-grid noscript img,
.lightbox-trigger img {
  display: block;
  width: 100%;
  height: auto;
}

.lightbox-trigger--inset img {
  width: 108.44%;
  max-width: none;
  transform: translateX(-7.87%);
}

.lightbox-trigger--wide img {
  width: 117.44%;
  max-width: none;
}

.image-lightbox {
  width: min(900px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.image-lightbox::backdrop {
  background: rgb(0 0 0 / 72%);
}

.image-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 900px);
  max-height: calc(100vh - 48px);
  margin: auto;
  background: #fff;
  object-fit: contain;
}

@media (max-width: 1200px) {
  .case-study { padding-inline: 48px; }
  .project-content { gap: 56px; }
}

@media (max-width: 760px) {
  .carbon-page { --case-section-gap: 72px; }

  .case-introduction { width: 100%; min-width: 0; }

  .project-link__title { font-size: 24px; }

  .project-content { display: contents; }
  .desktop-preview { order: 1; width: min(100%, 520px); margin-inline: auto; }
  .project-copy { order: 2; gap: 40px; }

}
