@font-face {
  font-family: 'Inter Local';
  src: url('fonts/inter-cyrillic.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter Local';
  src: url('fonts/inter-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-inter: 'Inter Local';
  --viewer-glass: color-mix(in srgb, var(--viewer-surface, #f6f8f8) 94%, transparent);
  --viewer-line: color-mix(in srgb, var(--viewer-text, #2e383c) 19%, transparent);
  --viewer-icon-filter: brightness(0);
  --header-height: 70px;
  --ui-inset: 32px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --move-duration: 1150ms;
}

:root:is([data-palette='graphite'], [data-palette='bronze']) {
  --viewer-icon-filter: brightness(0) invert(1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#pano {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html,
body {
  overscroll-behavior: none;
  background: var(--viewer-bg, #ebeeef);
}

body {
  position: fixed;
  inset: 0;
  color: var(--viewer-text, #2e383c);
  font-family: var(--font-inter), system-ui, sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--viewer-accent, #4e6571);
  outline-offset: 2px;
}

#pano {
  --transition-x: 50%;
  --transition-y: 54%;
  position: absolute;
  inset: 0;
  background: var(--viewer-bg, #ebeeef);
  filter: brightness(1) saturate(1);
  touch-action: none;
  will-change: filter;
}

body.is-moving #pano {
  animation: seamless-pano-focus var(--move-duration) ease-in-out both;
}

.tour-ui {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
}

.tour-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(var(--ui-inset), env(safe-area-inset-right, 0px)) 0 max(var(--ui-inset), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--viewer-line);
  background: var(--viewer-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.tour-logo {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 23px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.065em;
}

.tour-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: var(--viewer-icon-filter);
}

.tour-title { text-align: center; }

.tour-title h1 {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.045em;
}

.tour-kicker {
  color: var(--viewer-muted);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.tour-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 16px;
}

.tour-case {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.tour-case span:last-child { color: var(--viewer-accent); font-size: 17px; }
.tour-case:hover { color: var(--viewer-accent); }

.tour-hud {
  position: absolute;
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 12px);
  left: max(var(--ui-inset), env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-status,
.tour-hint {
  display: flex;
  align-items: center;
  border: 1px solid var(--viewer-line);
  border-radius: 999px;
  background: var(--viewer-glass);
  box-shadow: 0 10px 28px rgba(18, 25, 29, .10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.scene-status {
  min-height: 44px;
  gap: 6px;
  padding: 0 13px;
  color: var(--viewer-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: .06em;
}

.scene-status__label { margin-right: 3px; font-size: 9px; text-transform: uppercase; }
.scene-status__current { color: var(--viewer-text); font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.scene-status__divider { opacity: .55; }

.tour-hint {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  gap: 9px;
  padding: 9px 13px 9px 10px;
  color: var(--viewer-text);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity 400ms ease, transform 400ms var(--ease-out);
  animation: hint-enter 760ms 420ms var(--ease-out) both;
}

.tour-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
  animation: none;
}

.tour-hint__gesture {
  position: relative;
  width: 27px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--viewer-line);
  border-radius: 999px;
}

.tour-hint__gesture::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--viewer-accent);
  animation: gesture-drag 2.4s var(--ease-out) infinite;
}

.scene-transition {
  --transition-x: 50%;
  --transition-y: 54%;
  position: fixed;
  z-index: 15;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at var(--transition-x) var(--transition-y),
      rgba(255, 255, 255, 0.12) 0%,
      rgba(18, 19, 17, 0.1) 32%,
      rgba(8, 9, 8, 0.46) 100%
    );
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.scene-transition::before,
.scene-transition::after {
  content: "";
  position: absolute;
  pointer-events: none;
  will-change: opacity, transform;
}

.scene-transition::before {
  inset: -12%;
  background:
    radial-gradient(
      circle at var(--transition-x) var(--transition-y),
      transparent 0%,
      transparent 18%,
      rgba(7, 8, 7, 0.18) 47%,
      rgba(5, 6, 5, 0.72) 100%
    );
  opacity: 0;
  transform: scale(1.08);
}

.scene-transition::after {
  width: 56vmax;
  height: 56vmax;
  left: var(--transition-x);
  top: var(--transition-y);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.21) 0%,
    rgba(255, 255, 255, 0.08) 24%,
    transparent 68%
  );
  filter: blur(10px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.42);
}

body.is-moving .scene-transition {
  animation: seamless-transition var(--move-duration) ease-in-out both;
}

body.is-moving .scene-transition::before {
  animation: seamless-vignette var(--move-duration) ease-in-out both;
}

body.is-moving .scene-transition::after {
  animation: seamless-glow var(--move-duration) var(--ease-out) both;
}

.media-hotspot {
  position: relative;
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: #030506;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.025),
    inset 0 0 34px rgba(0, 0, 0, 0.5),
    0 12px 28px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  backface-visibility: hidden;
  transform-origin: 50% 50%;
}

.media-hotspot::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 2px;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.13),
    transparent 24%,
    transparent 72%,
    rgba(255, 231, 198, 0.05)
  );
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.media-hotspot__video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  object-fit: cover;
  background: #07121a;
  filter: saturate(0.9) contrast(1.04) brightness(0.86);
}

.media-hotspot--edge-to-edge {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.media-hotspot--edge-to-edge::after {
  inset: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.media-hotspot--edge-to-edge .media-hotspot__video {
  border-radius: 0;
}

.link-hotspot {
  --pin-size: 70px;
  position: relative;
  width: var(--pin-size);
  height: var(--pin-size);
  margin: calc(var(--pin-size) / -2) 0 0 calc(var(--pin-size) / -2);
  cursor: pointer;
  outline: none;
  isolation: isolate;
}

.link-hotspot::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.045);
  opacity: 0.58;
  transform: scale(0.82);
  animation: hotspot-pulse 2.8s var(--ease-out) infinite;
  pointer-events: none;
}

.link-hotspot-visual {
  position: absolute;
  inset: 10px;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.22), transparent 37%),
    linear-gradient(145deg, rgba(32, 34, 31, 0.88), rgba(9, 11, 10, 0.8));
  box-shadow:
    0 18px 38px -9px rgba(0, 0, 0, 0.58),
    0 4px 12px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32);
  transition:
    background 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease,
    transform 360ms var(--ease-spring),
    opacity 240ms ease,
    filter 240ms ease;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  will-change: transform, opacity, filter;
}

.link-hotspot-visual::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.1), transparent 42%);
  pointer-events: none;
}

.link-hotspot-visual::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: inherit;
  opacity: 0.8;
  transition: border-color 260ms ease, transform 360ms var(--ease-spring);
  pointer-events: none;
}

.link-hotspot-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 20px;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.42));
  transform: translate(-50%, -50%) rotate(var(--rotation, 0rad));
  transform-origin: 50% 50%;
}

.link-hotspot-arrow::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 8px;
  width: 2px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
}

.link-hotspot-arrow::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.no-touch .link-hotspot:hover .link-hotspot-visual,
.link-hotspot:focus-visible .link-hotspot-visual {
  border-color: #fff;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.27), transparent 39%),
    linear-gradient(145deg, rgba(37, 40, 41, 0.92), rgba(13, 14, 12, 0.84));
  box-shadow:
    0 22px 46px -10px rgba(0, 0, 0, 0.62),
    0 0 0 4px rgba(255, 255, 255, 0.1),
    0 0 24px rgba(255, 255, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-3px) scale(1.08);
}

.no-touch .link-hotspot:hover::before,
.link-hotspot:focus-visible::before {
  border-color: rgba(255, 255, 255, 0.68);
  opacity: 0.9;
  animation-play-state: paused;
  transform: scale(1.02);
}

.no-touch .link-hotspot:hover .link-hotspot-visual::after,
.link-hotspot:focus-visible .link-hotspot-visual::after {
  border-color: rgba(255, 255, 255, 0.48);
  transform: scale(1.04);
}

.link-hotspot.is-active::before {
  animation: pin-wave 620ms var(--ease-out) both;
}

.link-hotspot.is-active .link-hotspot-visual {
  border-color: #fff;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.3), transparent 62%),
    rgba(25, 28, 29, 0.88);
  animation: pin-go 620ms var(--ease-out) both;
  pointer-events: none;
}

.link-hotspot.is-active .link-hotspot-arrow {
  animation: arrow-launch 500ms var(--ease-out) both;
}

body.is-moving .link-hotspot:not(.is-active) {
  pointer-events: none;
}

body.is-moving .link-hotspot:not(.is-active) .link-hotspot-visual {
  opacity: 0.25;
  filter: blur(1px);
  transform: scale(0.88);
}

@keyframes pin-go {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  42% {
    opacity: 1;
    transform: scale(1.18);
  }

  100% {
    opacity: 0;
    filter: blur(3px);
    transform: scale(0.68);
  }
}

@keyframes pin-wave {
  0% {
    opacity: 0.75;
    transform: scale(0.82);
  }

  100% {
    border-color: rgba(255, 231, 198, 0);
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes arrow-launch {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--rotation, 0rad));
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -92%) rotate(var(--rotation, 0rad));
  }
}

@keyframes hotspot-pulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.82);
  }

  50% {
    opacity: 0.82;
    transform: scale(1);
  }
}

@keyframes hint-enter {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes gesture-drag {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-9px, -50%);
  }

  50% {
    opacity: 1;
    transform: translate(4px, -50%);
  }
}

@keyframes seamless-pano-focus {
  0% {
    filter: brightness(1) saturate(1) blur(0);
  }

  52% {
    filter: brightness(0.86) saturate(0.92) blur(1.6px);
  }

  100% {
    filter: brightness(1) saturate(1) blur(0);
  }
}

@keyframes seamless-transition {
  0% {
    opacity: 0;
  }

  46% {
    opacity: 0.56;
  }

  100% {
    opacity: 0;
  }
}

@keyframes seamless-vignette {
  0% {
    opacity: 0;
    transform: scale(1.08);
  }

  50% {
    opacity: 0.76;
    transform: scale(0.97);
  }

  100% {
    opacity: 0;
    transform: scale(0.92);
  }
}

@keyframes seamless-glow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.42);
  }

  50% {
    opacity: 0.82;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

.pwa-install,
.pwa-notice,
.pwa-help {
  color: var(--viewer-text);
  font: inherit;
  border: 1px solid var(--viewer-line);
  background: var(--viewer-glass);
  box-shadow: 0 16px 40px rgba(18, 25, 29, .16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.pwa-install {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}

.pwa-install:hover { background: var(--viewer-panel); }

.pwa-notice {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom, 0px)) + 66px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100vw - 36px);
  padding: 12px 16px;
  border-radius: 16px;
}

.pwa-notice p,
.pwa-help p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.pwa-notice__action {
  flex: none;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--viewer-accent);
  color: var(--viewer-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.pwa-help {
  width: min(380px, calc(100vw - 36px));
  max-height: calc(100dvh - 60px);
  margin: auto;
  padding: 28px;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--viewer-surface);
  touch-action: pan-y;
}

.pwa-help::backdrop { background: rgba(18, 25, 29, .55); backdrop-filter: blur(6px); }
.pwa-help img { border-radius: 16px; margin-bottom: 18px; }
.pwa-help h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.2; }
.pwa-help p { color: var(--viewer-muted); }
.pwa-help form { margin-top: 24px; }

.pwa-install[hidden],
.pwa-notice[hidden],
.pwa-notice__action[hidden] {
  display: none;
}

@media (max-width: 768px), (max-height: 500px) {
  :root { --header-height: 60px; --ui-inset: 14px; }
  .tour-logo { gap: 5px; font-size: 16px; }
  .tour-logo img { width: 23px; height: 23px; }
  .tour-title h1 { font-size: 13px; }
  .tour-kicker { font-size: 8px; letter-spacing: .1em; }
  .tour-actions { gap: 4px; }
  .tour-case { min-width: 44px; justify-content: center; }
  .tour-case span:first-child { display: none; }
  .tour-hint { bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .link-hotspot { --pin-size: 66px; }
}
