.work-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: #050505;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.work-transitioning .work-transition-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 120ms ease;
}

.work-transition-video-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.work-transition-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
  opacity: 0.8;
  filter: blur(1px) saturate(1.08) contrast(1.22) brightness(0.72);
  transform: scale(1.08);
}

.work-transition-overlay::before {
  position: absolute;
  inset: 0;
  content: '';
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.88)),
    radial-gradient(circle at 58% 42%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at 72% 58%, rgba(208, 164, 95, 0.2), transparent 34%);
}

.work-transition-overlay::after {
  position: absolute;
  inset: 7%;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-color: rgba(208, 164, 95, 0.54);
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 84px 84px;
  opacity: 0;
  transform: scale(1.04);
}

.work-transitioning .work-transition-overlay::after {
  animation: transitionFrameIn 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.work-transition-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -28%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), rgba(208, 164, 95, 0.24), transparent);
  filter: blur(22px);
  mix-blend-mode: screen;
  transform: skewX(-16deg);
}

.work-transitioning .work-transition-scan {
  animation: transitionScan 920ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.work-transition-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  color: rgba(245, 241, 232, 0.9);
  text-align: center;
  transform: translateY(18px);
  opacity: 0;
}

.work-transition-copy span {
  color: rgba(208, 164, 95, 0.86);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.work-transition-copy strong {
  font-size: clamp(34px, 7vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.work-transitioning .work-transition-copy {
  animation: transitionCopy 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.project-page {
  opacity: 1;
}

.project-page.project-page-ready {
  animation: none;
}

.project-page .gallery-image,
.project-page .video-frame,
.project-page .group-detail-block {
  opacity: 1;
  transform: none;
  filter: none;
}

.project-page.project-page-ready .gallery-image,
.project-page.project-page-ready .video-frame,
.project-page.project-page-ready .group-detail-block {
  animation: none;
}

.project-page.project-page-ready .gallery-image:nth-child(1),
.project-page.project-page-ready .video-frame:nth-child(1),
.project-page.project-page-ready .group-detail-block:nth-child(1) {
  animation-delay: 180ms;
}

.project-page.project-page-ready .gallery-image:nth-child(2),
.project-page.project-page-ready .video-frame:nth-child(2),
.project-page.project-page-ready .group-detail-block:nth-child(2) {
  animation-delay: 260ms;
}

.project-page.project-page-ready .gallery-image:nth-child(3),
.project-page.project-page-ready .video-frame:nth-child(3),
.project-page.project-page-ready .group-detail-block:nth-child(3) {
  animation-delay: 340ms;
}

.project-page.project-page-ready .gallery-image:nth-child(n + 4),
.project-page.project-page-ready .video-frame:nth-child(n + 4),
.project-page.project-page-ready .group-detail-block:nth-child(n + 4) {
  animation-delay: 420ms;
}

.project-page .mobile-exit-button {
  position: fixed !important;
  right: max(24px, env(safe-area-inset-right)) !important;
  bottom: max(24px, env(safe-area-inset-bottom)) !important;
  z-index: 10020 !important;
  display: none !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateZ(0);
}

.project-page .mobile-exit-button:hover {
  transform: translateY(-3px) translateZ(0);
}

@keyframes transitionScan {
  0% {
    opacity: 0;
    transform: translateX(0) skewX(-16deg);
  }

  34% {
    opacity: 0.78;
  }

  100% {
    opacity: 0;
    transform: translateX(620%) skewX(-16deg);
  }
}

@keyframes transitionFrameIn {
  0% {
    opacity: 0;
    transform: scale(1.08);
  }

  38% {
    opacity: 0.62;
  }

  100% {
    opacity: 0.18;
    transform: scale(1);
  }
}

@keyframes transitionCopy {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  34%,
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px) scale(1.01);
  }
}

@keyframes projectPageReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes projectMediaReveal {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(8px) brightness(0.82);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0) brightness(1);
  }
}

@media (max-width: 720px) {
  .work-transition-overlay::after {
    inset: 76px 16px 18px;
    background-size: 54px 54px;
  }

  .work-transition-copy strong {
    font-size: clamp(36px, 13vw, 58px);
  }

  .project-page .mobile-exit-button {
    display: inline-flex !important;
    right: max(16px, env(safe-area-inset-right)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    min-height: 52px;
    padding: 0 18px;
  }
}
