:root {
  --lu-photo-transition-ink: #050506;
  --lu-photo-transition-gold: #cab88b;
}

/* Cross-document View Transitions — same-origin MPA opt-in.
   The browser holds the outgoing page's last painted frame (our full-cover optical
   plate) across the navigation, then reveals the incoming page over it. This masks
   the single blank document-swap frame with the matching plate; our JS transition
   then runs on the live incoming page. Unsupported browsers ignore this and keep
   the prior behaviour. */
@view-transition {
  navigation: auto;
}

::view-transition-group(root),
::view-transition-old(root) {
  animation: none;
}

::view-transition-new(root) {
  animation: lu-photo-vt-reveal 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
  mix-blend-mode: normal;
}

@keyframes lu-photo-vt-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

html.lu-photo-transition-active,
html.lu-photo-transition-active body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.lu-photo-transition {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: block;
  visibility: hidden;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  contain: strict;
}

.lu-photo-transition.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.lu-photo-transition__canvas,
.lu-photo-transition__fallback,
.lu-photo-transition__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lu-photo-transition__canvas {
  display: block;
}

.lu-photo-transition__fallback {
  object-fit: cover;
  transform: scale(1.12);
  opacity: 0;
  filter: saturate(0.88) contrast(1.04) brightness(0.7);
}

.lu-photo-transition.is-fallback .lu-photo-transition__fallback {
  opacity: 1;
}

.lu-photo-transition__shade {
  background:
    radial-gradient(circle at var(--lu-photo-origin-x, 50%) var(--lu-photo-origin-y, 50%),
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.01) 30%,
      rgba(5, 5, 6, 0.58) 74%,
      rgba(5, 5, 6, 0.94) 100%);
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.lu-photo-transition__status {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 5vh, 56px);
  transform: translate(-50%, 12px);
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--primary-font, "Montserrat"), sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
  white-space: nowrap;
}

.lu-photo-return,
.lu-photo-sound-toggle {
  position: fixed;
  z-index: 1205;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(8, 8, 10, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--primary-font, "Montserrat"), sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    transform 220ms ease;
}

.lu-photo-return {
  top: clamp(76px, 9vh, 104px);
  left: clamp(16px, 2.5vw, 36px);
  gap: 9px;
  padding: 0 16px;
}

.lu-photo-return::before {
  content: "\2190";
  font-size: 14px;
  line-height: 1;
}

.lu-photo-sound-toggle {
  right: clamp(16px, 2.5vw, 36px);
  bottom: clamp(16px, 3vh, 30px);
  width: 42px;
  padding: 0;
  cursor: pointer;
}

.lu-photo-sound-toggle::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.lu-photo-sound-toggle[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 1px;
  background: currentColor;
  transform: rotate(-45deg);
}

.lu-photo-return:hover,
.lu-photo-return:focus-visible,
.lu-photo-sound-toggle:hover,
.lu-photo-sound-toggle:focus-visible {
  color: #fff;
  border-color: rgba(202, 184, 139, 0.7);
  background: rgba(12, 12, 15, 0.64);
  transform: translateY(-2px);
  outline: none;
}

html.lu-photo-transition-active .lu-photo-return,
html.lu-photo-transition-active .lu-photo-sound-toggle {
  pointer-events: none;
}

@media (max-width: 640px) {
  .lu-photo-return {
    top: 72px;
    max-width: calc(100vw - 92px);
    min-height: 38px;
    padding: 0 13px;
    font-size: 9px;
  }

  .lu-photo-sound-toggle {
    width: 40px;
    min-height: 40px;
  }
}

/* Camera intro: the portal control lives only on panel 1, lower-right. */
.lu-photography-page[data-lu-photo-page="gears"] .stamps-intro-panel .lu-photo-return {
  position: absolute;
  top: auto;
  right: clamp(22px, 6vw, 92px);
  bottom: clamp(34px, 7vh, 82px);
  left: auto;
  width: clamp(96px, 9vw, 116px);
  height: clamp(96px, 9vw, 116px);
  min-height: 0;
  max-width: none;
  padding: clamp(12px, 1.4vw, 17px);
  flex-direction: column;
  gap: 5px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-top: 1.4px solid rgba(208, 243, 255, 0.4);
  border-left: 1.4px solid rgba(255, 255, 255, 0.2);
  border-right: 1.4px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1.2px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(20, 20, 22, 0.22);
  -webkit-backdrop-filter: blur(22px) saturate(200%);
  backdrop-filter: blur(22px) saturate(200%);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  transform: none;
  color: #fff !important;
}

.lu-photography-page[data-lu-photo-page="gears"] .stamps-intro-panel .lu-photo-return:hover,
.lu-photography-page[data-lu-photo-page="gears"] .stamps-intro-panel .lu-photo-return:focus-visible {
  background: #91BFAC;
  border-color: #FADC55;
  outline: 1px solid #FADC55;
  outline-offset: 2px;
  transform: translateY(-2px);
}

@media (max-width: 599px) {
  .lu-photography-page[data-lu-photo-page="gears"] .stamps-intro-panel .lu-photo-return {
    right: clamp(14px, 4vw, 24px);
    bottom: clamp(22px, 4vh, 36px);
    width: 84px;
    height: 84px;
    padding: 10px;
    font-size: 7.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lu-photo-transition,
  .lu-photo-return,
  .lu-photo-sound-toggle {
    transition: none !important;
  }

}
