html, body { max-width: 100%; overflow-x: hidden; }
.viewer:not([open]) { display: none; }
.screen-card strong { margin-top: 11px; }

/* Align the intro heading with the slide, after the left arrow and its gap. */
.intro-section .section-head { padding-left: 64px; }

@media (max-width: 900px) {
  .intro-section .section-head { padding-left: 0; }
}

/* Full-viewport viewer: upscale the artwork to the largest uncropped size. */
.viewer[open] {
  display: block;
  overflow: hidden;
}

.viewer figure {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 12px 62px;
}

.viewer figure img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 4px;
}

.viewer figcaption {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(7,10,29,.78);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.viewer-nav {
  position: fixed;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
}

.viewer-prev { left: 10px; }
.viewer-next { right: 10px; }
.viewer-close { z-index: 5; }

.screen-grid.grouped { display: block; }
.screen-group + .screen-group { margin-top: 64px; }
.screen-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid #252a42;
}
.screen-group-head h3 { margin: 0; font-size: 21px; font-weight: 600; }
.screen-group-head span { color: #686f8c; font-size: 12px; }
.screen-group-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 28px 22px;
}

@media (max-width: 900px) {
  .screen-group-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
  #slide-title { display: block; margin-top: 3px; }
  .viewer figure { padding: 8px; }
  .viewer figure img { max-width: none; max-height: none; }
  .viewer-nav { top: auto; transform: none; }
  .screen-group + .screen-group { margin-top: 48px; }
  .screen-group-grid { grid-template-columns: 1fr; gap: 24px; }
}
