:root {
  --bg: #05090a;
  --sea-deep: #07151a;
  --sea-mid: #0e2a30;
  --sea-shore: #1f4d52;
  --land: #050a0b;
  --dot: #f6fbff;
  --ink: #c8d4d8;
}
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #000;
  color: var(--ink);
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  overflow: hidden;
}
#stage {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 55%, #07171c 0%, #03080a 60%, #000 100%);
}
#map {
  width: 100%;
  height: 100%;
  display: block;
  background: #03080a;
  contain: layout style;
}
.zoom-root {
  will-change: transform;
}
#vignette-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 35%,
    rgba(2, 7, 10, 0.45) 65%,
    rgba(2, 7, 10, 0.88) 100%
  );
  pointer-events: none;
  z-index: 2;
}
.title {
  position: absolute;
  right: 6vmin; top: 7vmin;
  text-align: center;
  color: #e9eef0;
  letter-spacing: 0.32em;
  pointer-events: none;
  user-select: none;
  z-index: 3;
}
.title .eyebrow {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.05vmin;
  letter-spacing: 0.5em;
  opacity: 0.78;
  margin-bottom: 0.6em;
}
.title h1 {
  margin: 0;
  font-weight: 500;
  font-size: 3.6vmin;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
}
.title .rule {
  width: 14vmin; height: 1px;
  background: linear-gradient(90deg, transparent, #8aa1a6, transparent);
  margin: 1.1em auto 0.9em;
  opacity: 0.55;
}
.title .sub {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.95vmin;
  letter-spacing: 0.42em;
  opacity: 0.62;
}
.credit {
  position: absolute;
  left: 50%; bottom: 3.5vmin;
  transform: translateX(-50%);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.85vmin;
  letter-spacing: 0.5em;
  color: #6b7c80;
  text-transform: uppercase;
  user-select: none;
  z-index: 3;
}
.legend {
  position: absolute;
  left: 6vmin; bottom: 6vmin;
  z-index: 3;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.95vmin;
  letter-spacing: 0.32em;
  color: #98a8ac;
  text-transform: uppercase;
  line-height: 2;
  user-select: none;
}
.legend .row { display: flex; align-items: center; gap: 0.9em; }
.legend .dot {
  width: 0.7vmin; height: 0.7vmin; border-radius: 50%;
  background: #f6fbff;
  box-shadow:
    0 0 0.4vmin #ffffff,
    0 0 1.2vmin rgba(220,240,255,0.85),
    0 0 2.6vmin rgba(150,200,220,0.55);
}
.loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #5d7378; font-family: "Inter", sans-serif; letter-spacing: 0.4em;
  font-size: 1.1vmin; text-transform: uppercase;
}

/* Zoom controls */
.zoom-ui {
  position: absolute;
  right: 5vmin; bottom: 5vmin;
  display: flex; flex-direction: column;
  gap: 0.4vmin;
  user-select: none;
  z-index: 3;
}
.zoom-ui button {
  width: 6vmin; height: 3.2vmin;
  background: rgba(10, 24, 28, 0.85);
  border: 1px solid rgba(120, 160, 170, 0.25);
  color: #c8dade;
  font-family: "Inter", sans-serif;
  font-size: 1.4vmin;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  backdrop-filter: blur(4px);
}
.zoom-ui button:hover {
  background: rgba(30, 60, 70, 0.9);
  border-color: rgba(180, 210, 220, 0.55);
  color: #fff;
}
.zoom-ui button:first-child { border-radius: 4px 4px 0 0; }
.zoom-ui button:last-child  { border-radius: 0 0 4px 4px; }
.zoom-ui .reset {
  margin-top: 0.6vmin;
  border-radius: 4px;
  font-size: 0.8vmin;
  letter-spacing: 0.2em;
}

/* Tooltip card for clicked beacons */
#tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 18px));
  background: rgba(8, 18, 22, 0.92);
  border: 1px solid rgba(180, 210, 220, 0.25);
  border-radius: 6px;
  padding: 25px;
  color: #eef4f6;
  font-family: "Inter", sans-serif;
  font-size: 1.1vmin;
  letter-spacing: 0.04em;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  white-space: normal;
  z-index: 5;
}
#tooltip.visible { opacity: 1; visibility: visible; }
#tooltip::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: rgba(8, 18, 22, 0.92);
  border-right: 1px solid rgba(180, 210, 220, 0.25);
  border-bottom: 1px solid rgba(180, 210, 220, 0.25);
}
#tooltip .t-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.9vmin;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.35em;
}
#tooltip .t-coords {
  font-size: 0.95vmin;
  letter-spacing: 0.22em;
  color: #8eaab0;
  text-transform: uppercase;
}
#tooltip .t-close {
  position: absolute;
  top: 4px; right: 8px;
  font-size: 0.85vmin;
  color: #6a8388;
  cursor: pointer;
  padding: 4px;
}
#tooltip .t-close:hover { color: #fff; }
#tooltip .t-photos {
  display: inline-block;
  margin-top: 0.6em;
  font-family: "Inter", sans-serif;
  font-size: 0.85vmin;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #7ec8d0;
  cursor: pointer;
  border-bottom: 1px solid rgba(126,200,208,0.35);
  transition: color 0.15s, border-color 0.15s;
}
#tooltip .t-photos:hover { color: #c8f0f4; border-color: rgba(200,240,244,0.6); }
#tooltip .t-preview {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 4px;
  cursor: pointer;
}
#tooltip .t-preview img {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 3px;
  opacity: 0.82;
  transition: opacity 0.15s;
  display: block;
}
#tooltip .t-preview img:hover { opacity: 1; }
#tooltip .t-preview .t-preview-more {
  width: 80px;
  height: 56px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(180,210,220,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6vmin;
  color: #7ec8d0;
  text-transform: uppercase;
}

/* Beacon pulse — animates scale (so JS-set base radius is preserved) */
@keyframes beacon-pulse {
  0%   { transform: scale(0.9); opacity: 0.95; }
  70%  { transform: scale(4.5); opacity: 0;    }
  100% { transform: scale(4.5); opacity: 0;    }
}
.beacon-pulse {
  animation: beacon-pulse 2.6s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
/* Beacon core flicker */
@keyframes beacon-flicker {
  0%, 100% { opacity: 1; }
  45%      { opacity: 0.78; }
  55%      { opacity: 1; }
}
.beacon-core {
  animation: beacon-flicker 3.4s ease-in-out infinite;
  cursor: pointer;
}

/* ── Mobile portrait ── */
@media screen and (orientation: portrait) and (max-width: 768px) {
  /* Match desktop — flat #03080a so SVG square boundary is invisible */
  #stage { background: #03080a; }
  #map   { background: #03080a; }

  /* Title — centered, tighter spacing to prevent overflow */
  .title {
    right: auto; left: 50%; top: 5vw;
    transform: translateX(-50%);
    text-align: center;
    width: 90vw;
  }
  .title .eyebrow { font-size: 2.2vw; letter-spacing: 0.3em; }
  .title h1       { font-size: 5vw;   letter-spacing: 0.1em; text-indent: 0.1em; }
  .title .rule    { width: 22vw; }
  .title .sub     { font-size: 1.8vw; letter-spacing: 0.15em; }

  .legend { font-size: 2.2vw; left: 4vw; bottom: 8vw; }
  .legend .dot { width: 1.6vw; height: 1.6vw; }
  .credit { font-size: 1.8vw; bottom: 2vw; letter-spacing: 0.25em; }

  .zoom-ui { right: 3vw; bottom: 4vw; gap: 1vw; }
  .zoom-ui button { width: 10vw; height: 10vw; font-size: 5vw; }
  .zoom-ui .reset { font-size: 1.7vw; height: 10vw; }

  /* Отключаем зерно — дополнительная нагрузка на GPU */
  #film-grain { display: none; }


  #tooltip { font-size: 3vw; padding: 20px; }
  #tooltip .t-name    { font-size: 5.5vw; }
  #tooltip .t-coords  { font-size: 2.4vw; }
  #tooltip .t-close   { font-size: 3vw; }
  #tooltip .t-photos  { font-size: 2.6vw; }
  #tooltip .t-preview { grid-template-columns: repeat(3, 22vw); gap: 2vw; }
  #tooltip .t-preview img { width: 22vw; height: 15vw; }
  #tooltip .t-preview .t-preview-more { width: 22vw; height: 15vw; font-size: 3.75vw; }

  #vignette-overlay {
    background: radial-gradient(ellipse at 50% 50%,
      transparent 35%,
      rgba(2, 7, 10, 0.60) 70%,
      rgba(2, 7, 10, 0.95) 100%
    );
  }
}
