.exhibition-page {
  overflow: hidden;
  height: 100%;
  background: #050505;
}

.exhibition-page .exhibition-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #050505;
}

.exhibition-welcome {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(96px, env(safe-area-inset-bottom, 0px) + 72px);
  box-sizing: border-box;
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition:
    opacity 0.85s ease,
    visibility 0.85s ease;
}

.exhibition-welcome.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.exhibition-welcome__inner {
  width: min(720px, 100%);
  text-align: center;
  pointer-events: none;
}

.exhibition-welcome__title {
  margin: 0 0 0.85em;
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: clamp(1.65rem, 5.2vw, 3.35rem);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.96);
  opacity: 0;
  transform: translateY(18px);
  animation: exhibition-welcome-in 1.1s ease 0.15s forwards;
}

.exhibition-welcome__subtitle {
  margin: 0 0 2.75em;
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: clamp(1.05rem, 2.6vw, 1.75rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0;
  transform: translateY(18px);
  animation: exhibition-welcome-in 1.1s ease 0.35s forwards;
}

.exhibition-welcome__artist {
  margin: 0 0 0.9em;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: translateY(18px);
  animation: exhibition-welcome-in 1.1s ease 0.55s forwards;
}

.exhibition-welcome__meta {
  margin: 0;
  font-size: clamp(0.72rem, 1.5vw, 0.86rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  opacity: 0;
  transform: translateY(18px);
  animation: exhibition-welcome-in 1.1s ease 0.72s forwards;
}

@keyframes exhibition-welcome-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.exhibition-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --exhibition-bg-mid: #4a3828;
  --exhibition-bg-dark: #140f0b;
  --exhibition-bg-accent: #2e2218;
  background:
    radial-gradient(130% 92% at 50% 26%, var(--exhibition-bg-mid) 0%, transparent 72%),
    radial-gradient(105% 78% at 18% 62%, color-mix(in srgb, var(--exhibition-bg-accent) 72%, transparent) 0%, transparent 64%),
    radial-gradient(100% 75% at 82% 68%, color-mix(in srgb, var(--exhibition-bg-mid) 55%, transparent) 0%, transparent 62%),
    radial-gradient(95% 70% at 50% 92%, var(--exhibition-bg-accent) 0%, transparent 58%),
    linear-gradient(180deg, var(--exhibition-bg-dark) 0%, #050505 100%);
  will-change: background;
}

.exhibition-scroll-hint {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.55s ease,
    visibility 0.55s ease;
}

.exhibition-scroll-hint.is-visible {
  opacity: 1;
  visibility: visible;
}

.exhibition-scroll-hint__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.exhibition-scroll-hint__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  animation: exhibition-scroll-pulse 2.1s ease-in-out infinite;
}

@keyframes exhibition-scroll-pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
    box-shadow:
      0 6px 20px rgba(0, 0, 0, 0.28),
      0 0 0 0 rgba(255, 255, 255, 0.12);
  }

  50% {
    transform: translateY(9px);
    opacity: 1;
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.22),
      0 0 0 10px rgba(255, 255, 255, 0);
  }
}

.exhibition-gallery {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

.exhibition-artwork {
  width: 100%;
  max-width: 100%;
}

.exhibition-artwork__track {
  width: 100%;
  max-width: 100%;
}

.exhibition-artwork:not(.exhibition-artwork--outro) .exhibition-artwork__track {
  height: 400svh;
}

.exhibition-artwork__gap {
  height: 60svh;
  width: 100%;
  flex-shrink: 0;
}

.exhibition-artwork__stage {
  position: sticky;
  top: 0;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 0;
  box-sizing: border-box;
  background: transparent;
  overflow: visible;
  contain: layout style;
}

.exhibition-artwork__figure {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.exhibition-artwork__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  height: 100%;
}

.exhibition-artwork__media {
  display: contents;
}

.exhibition-artwork__mobile-header {
  display: none;
}

.exhibition-artwork__frame {
  --exhibition-art-max-h: 86svh;
  --exhibition-scale: 1;
  --exhibition-fill-scale: 1;
  --exhibition-opacity: 1;
  position: relative;
  flex-shrink: 0;
  aspect-ratio: var(--art-ratio, 1);
  width: min(100%, calc(var(--exhibition-art-max-h) * var(--art-ratio)));
  height: auto;
  max-width: 100%;
  max-height: var(--exhibition-art-max-h);
  opacity: var(--exhibition-opacity);
  will-change: opacity;
}

.exhibition-artwork__link {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: calc(100% * var(--exhibition-fill-scale));
  height: calc(100% * var(--exhibition-fill-scale));
  transform: translate(-50%, -50%) scale(calc(var(--exhibition-scale) / var(--exhibition-fill-scale)));
  transform-origin: center center;
  cursor: default;
  will-change: transform;
  --exhibition-shadow-y: 10px;
  --exhibition-shadow-blur: 22px;
  --exhibition-shadow-alpha: 0.2;
  filter:
    drop-shadow(0 var(--exhibition-shadow-y) var(--exhibition-shadow-blur) rgba(0, 0, 0, var(--exhibition-shadow-alpha)))
    drop-shadow(0 calc(var(--exhibition-shadow-y) * 0.45) calc(var(--exhibition-shadow-blur) * 0.45) rgba(0, 0, 0, calc(var(--exhibition-shadow-alpha) * 0.65)));
}

.exhibition-artwork__link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.exhibition-artwork__info-wrap {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  transform: none;
}

.exhibition-artwork__info-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(0, 0, 0, 0.48);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 2px;
  padding: 7px 13px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.exhibition-artwork__info-btn:hover,
.exhibition-artwork__info-btn:focus-visible {
  background: rgba(0, 0, 0, 0.68);
  border-color: rgba(255, 255, 255, 0.72);
  outline: none;
}

.exhibition-artwork__caption {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: min(320px, calc(100vw - 32px));
  max-width: min(380px, calc(100vw - 32px));
  margin: 0;
  padding: 16px 18px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.exhibition-artwork__info-wrap:hover .exhibition-artwork__caption,
.exhibition-artwork__info-wrap:focus-within .exhibition-artwork__caption,
.exhibition-artwork__info-wrap.is-open .exhibition-artwork__caption {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.exhibition-artwork__title {
  margin: 0 0 0.5em;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: #ffffff;
}

.exhibition-artwork__meta {
  margin: 0;
  font-size: 0.86rem;
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.exhibition-artwork--outro .exhibition-artwork__track {
  height: 100svh;
}

.exhibition-outro {
  text-align: center;
  max-width: 520px;
  padding: 0 24px;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.exhibition-artwork--outro.is-active .exhibition-outro {
  opacity: 1;
  transform: translateY(0);
}

.exhibition-outro__label {
  margin: 0 0 0.75em;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.exhibition-outro__title {
  margin: 0 0 1.25em;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: #ffffff;
}

.exhibition-outro__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
}

.exhibition-outro__links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
  transition: opacity 0.25s ease;
}

.exhibition-outro__links a:hover,
.exhibition-outro__links a:focus-visible {
  opacity: 0.65;
}

@media (max-width: 932px), ((max-height: 500px) and (hover: none) and (pointer: coarse)) {
  .exhibition-gallery {
    height: 100dvh;
    height: 100svh;
    touch-action: pan-y;
    overscroll-behavior-x: none;
  }

  .exhibition-artwork__stage,
  .exhibition-artwork__figure {
    overflow: hidden;
    overflow: clip;
  }

  .exhibition-artwork__stack {
    gap: 12px;
    padding: 0 16px;
    box-sizing: border-box;
    justify-content: flex-start;
  }

  .exhibition-artwork__mobile-header {
    display: block;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    text-align: center;
    padding: 0 8px;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .exhibition-artwork__media {
    display: flex;
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    container-type: size;
  }

  .exhibition-artwork__mobile-title {
    margin: 0 0 0.35em;
    font-size: clamp(2rem, 8.4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: #ffffff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  }

  .exhibition-artwork__mobile-meta {
    margin: 0;
    font-size: clamp(0.78rem, 3.2vw, 0.9rem);
    font-style: italic;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  }

  .exhibition-artwork__info-wrap {
    display: none;
  }

  .exhibition-artwork__caption {
    min-width: min(280px, calc(100% - 8px));
    max-width: calc(100% - 8px);
    right: 0;
    left: auto;
  }

  .exhibition-artwork:not(.exhibition-artwork--outro) .exhibition-artwork__track {
    height: 130svh;
  }

  .exhibition-artwork__gap {
    display: none;
  }

  .exhibition-gallery {
    scroll-snap-type: y proximity;
  }

  .exhibition-artwork:not(.exhibition-artwork--outro) {
    scroll-snap-align: start;
  }

  .exhibition-artwork--outro {
    scroll-snap-align: start;
  }

  .exhibition-artwork__stage {
    height: 100dvh;
    height: 100svh;
    padding: 2vh 0;
  }

  .exhibition-artwork__frame {
    --exhibition-art-max-h: 100cqh;
    width: min(100%, calc(100cqh * var(--art-ratio)));
    height: auto;
    max-width: 100%;
    max-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exhibition-welcome__title,
  .exhibition-welcome__subtitle,
  .exhibition-welcome__artist,
  .exhibition-welcome__meta {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .exhibition-scroll-hint {
    display: none;
  }

  .exhibition-gallery {
    scroll-behavior: auto;
  }

  .exhibition-artwork:not(.exhibition-artwork--outro) .exhibition-artwork__track {
    height: 100svh;
  }

  .exhibition-artwork__gap {
    height: 30svh;
  }

  .exhibition-artwork__frame {
    opacity: 1;
    will-change: auto;
  }

  .exhibition-artwork__link {
    transform: translate(-50%, -50%);
    filter: none;
    will-change: auto;
  }

  .exhibition-artwork__caption,
  .exhibition-outro,
  .exhibition-artwork__info-btn {
    transition: none;
  }

  .exhibition-outro {
    opacity: 1;
    transform: none;
  }
}

/* Touch/mobile overrides — след reduced-motion, за iPhone incl. landscape + Reduce Motion */
@media (max-width: 932px), ((max-height: 500px) and (hover: none) and (pointer: coarse)) {
  .exhibition-artwork__gap {
    display: none;
  }

  .exhibition-artwork:not(.exhibition-artwork--outro) .exhibition-artwork__track {
    height: 130svh;
  }
}

@media (prefers-reduced-motion: reduce) and ((max-width: 932px), ((max-height: 500px) and (hover: none) and (pointer: coarse))) {
  .exhibition-artwork:not(.exhibition-artwork--outro) .exhibition-artwork__track {
    height: 100svh;
  }

  .exhibition-artwork__gap {
    display: none;
  }
}
