/* Варианты заставки со старой картой Мериана 1642 года.
   Подключается вместе со splash.css; каждый вариант активируется классом на <body>.
   Карта уже оптимизирована: web/img/venice-merian-1642-2560.jpg и -800.jpg. */

#map-layer {
  position: fixed;
  inset: 0;
  z-index: 35;                 /* ниже #splash (40), выше #scene и интерфейса */
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--wall);
  pointer-events: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
#map-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%; /* Венеция на гравюре смещена кверху; опустим горизонт */
  filter: sepia(12%) contrast(1.05);
}
#map-layer .map-caption {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 34px);
  right: var(--gutter);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(207,202,194,.7);
  opacity: .9;
}

/* ---------- Вариант 1: карта внутри заставки, уходит вместе с ней ---------- */
body.splash-variant-1 #splash {
  background: transparent;
}
body.splash-variant-1 #splash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 40%, rgba(207,202,194,0) 0%, rgba(207,202,194,.55) 70%, rgba(207,202,194,.82) 100%),
    url("img/venice-merian-1642-2560.jpg");
  background-size: cover;
  background-position: center 42%;
  filter: sepia(10%) contrast(1.04);
}
body.splash-variant-1 #splash .mark,
body.splash-variant-1 #splash .place,
body.splash-variant-1 #splash .count,
body.splash-variant-1 #splash .src,
body.splash-variant-1 #splash .slow {
  text-shadow: 0 1px 0 rgba(207,202,194,.85);
}
body.splash-variant-1 #map-layer { display: none; }

/* ---------- Вариант 2: splash уходит первым, карта ещё 1.2 с держится поверх 3D ---------- */
body.splash-variant-2 #splash { background: var(--wall); }
body.splash-variant-2 #map-layer { opacity: 1; }
body.splash-variant-2.map-fade #map-layer { opacity: 0; }

/* ---------- Вариант 3: карта синхронно с reveal — уменьшается и растворяется ---------- */
body.splash-variant-3 #splash { background: transparent; }
body.splash-variant-3 #map-layer { opacity: 1; transition: none; }
body.splash-variant-3 .venice-arms { opacity: 0; }
body.splash-variant-3.map-fade #map-layer { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  #map-layer,
  body.splash-variant-1 #splash,
  body.splash-variant-1 #splash::before { transition: none; }
}
