.gallery-cluster-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #2f363b;
  visibility: hidden;
  opacity: 0;
}

.gallery-cluster-bg.is-visible {
  visibility: visible;
  opacity: 1;
}

.gallery-cluster-bg .cross-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.gallery-cluster-bg .cross-video::-webkit-media-controls,
.gallery-cluster-bg .cross-video::-webkit-media-controls-enclosure,
.gallery-cluster-bg .cross-video::-webkit-media-controls-panel,
.gallery-cluster-bg .cross-video::-webkit-media-controls-play-button,
.gallery-cluster-bg .cross-video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.gallery-cluster-bg .cross-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 52% 68% at 50% 50%,
      rgba(0, 0, 0, 0.34) 0%,
      rgba(0, 0, 0, 0.12) 42%,
      transparent 72%
    ),
    var(--cross-veil-grey, rgba(28, 28, 28, 0.72));
  -webkit-backdrop-filter: blur(var(--cross-veil-blur, 14px));
  backdrop-filter: blur(var(--cross-veil-blur, 14px));
  transform: translateZ(0);
}

:is(#section-gallery, #section-prints, #section-maquettes, #section-study) {
  --cross-veil-grey: rgba(28, 28, 28, 0.72);
  --cross-veil-blur: 14px;
  color: #ffffff;
}

#section-study {
  background: #3a4248;
}

#section-study main.study {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.study-gallery {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  box-sizing: border-box;
}

.study-gallery__layout {
  position: absolute;
  inset: 0;
}

.study-gallery__zone {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(3px, 0.5vw, 6px);
  min-width: 0;
  min-height: 0;
  padding: clamp(3px, 0.5vw, 6px);
  box-sizing: border-box;
}

/* Corner zones aligned to study cross cutout (desktop clip-path) */
.study-gallery__zone--tl {
  top: 8%;
  left: 0;
  width: 47%;
  height: 18%;
}

.study-gallery__zone--tr {
  top: 8%;
  right: 0;
  width: 47%;
  height: 18%;
}

.study-gallery__zone--bl {
  top: 30%;
  left: 0;
  width: 47%;
  bottom: 8%;
}

.study-gallery__zone--br {
  top: 30%;
  right: 0;
  width: 47%;
  bottom: 8%;
}

.study-gallery__item {
  margin: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.study-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 2px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}

:is(#section-gallery, #section-prints, #section-study) .cross-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #2f363b;
}

:is(#section-gallery, #section-prints, #section-study) .cross-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

:is(#section-gallery, #section-prints, #section-study) .cross-video::-webkit-media-controls {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-study) .cross-video::-webkit-media-controls-enclosure {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-study) .cross-video::-webkit-media-controls-panel {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-study) .cross-video::-webkit-media-controls-play-button {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-study) .cross-video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-study) .cross-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 52% 68% at 50% 50%,
      rgba(0, 0, 0, 0.34) 0%,
      rgba(0, 0, 0, 0.12) 42%,
      transparent 72%
    ),
    var(--cross-veil-grey);
  -webkit-backdrop-filter: blur(var(--cross-veil-blur));
  backdrop-filter: blur(var(--cross-veil-blur));
  transform: translateZ(0);
}

#section-study .cross-veil {
  clip-path: polygon(
    0% 0%,
    100% 0%,
    100% 100%,
    0% 100%,
    0% 0%,
    0% 8%,
    49% 8%,
    49% 26%,
    18% 26%,
    18% 30%,
    49% 30%,
    49% 92%,
    51% 92%,
    51% 30%,
    82% 30%,
    82% 26%,
    51% 26%,
    51% 8%,
    49% 8%,
    0% 8%
  );
}

@media (prefers-reduced-transparency: reduce) {
  :is(#section-gallery, #section-prints, #section-study) .cross-veil {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background:
      radial-gradient(
        ellipse 52% 68% at 50% 50%,
        rgba(0, 0, 0, 0.42) 0%,
        rgba(0, 0, 0, 0.18) 42%,
        transparent 72%
      ),
      rgba(28, 28, 28, 0.94);
  }
}

@media (max-width: 768px) {
  :is(#section-gallery, #section-prints, #section-study) {
    --cross-veil-blur: 12px;
  }

  .study-gallery__zone--tl,
  .study-gallery__zone--tr {
    width: 45%;
    height: 18%;
  }

  .study-gallery__zone--bl,
  .study-gallery__zone--br {
    width: 45%;
    top: 29%;
    bottom: 8%;
  }

  #section-study .cross-veil {
    clip-path: polygon(
      0% 0%,
      100% 0%,
      100% 100%,
      0% 100%,
      0% 0%,
      0% 8%,
      47% 8%,
      47% 26%,
      15% 26%,
      15% 29%,
      47% 29%,
      47% 92%,
      53% 92%,
      53% 29%,
      85% 29%,
      85% 26%,
      53% 26%,
      53% 8%,
      47% 8%,
      0% 8%
    );
  }
}
