/* Вход поверх всех слоёв сайта. */
.intro {
  position: absolute;
  inset: 0;
  z-index: 2147483647;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
  opacity: 1;
  pointer-events: auto;
  user-select: none;
  overscroll-behavior: none;
  transition: opacity 900ms var(--ease);
}

.intro[hidden] {
  display: none;
}

.intro[data-state='play'] {
  opacity: 1;
}

.intro[data-state='done'] {
  opacity: 0;
}

.intro-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}

/* К гашению кадр входа совпадает с первым экраном без скачка яркости. */
.intro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(8, 10, 14, 0.62), rgba(8, 10, 14, 0)) top / 100% 160px no-repeat,
    linear-gradient(rgba(8, 10, 14, 0), rgba(8, 10, 14, 0.28) 35%, rgba(8, 10, 14, 0.78)) bottom / 100% 42% no-repeat;
  opacity: clamp(0, calc((var(--intro-p, 0) - 0.88) * 9), 1);
  pointer-events: none;
}

/* Небольшая подложка только под нижней подписью. */
.intro::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 26%;
  background: linear-gradient(
    to top,
    rgba(11, 14, 19, 0.32),
    rgba(11, 14, 19, 0.08) 48%,
    transparent
  );
  opacity: clamp(0, calc((0.07 - var(--intro-p, 0)) * 100), 1);
  pointer-events: none;
}

.intro-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(30px, 4.5vh, 94px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  transform: translateX(-50%);
  color: var(--text);
  opacity: clamp(0, calc((0.07 - var(--intro-p, 0)) * 100), 1);
  pointer-events: none;
}

.intro-hint-text {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(244, 239, 230, 0.78);
  text-shadow: 0 1px 12px rgba(11, 14, 19, 0.25);
}

.intro-hint-line {
  display: block;
  width: 1px;
  height: clamp(34px, 4vh, 70px);
  background: linear-gradient(
    to bottom,
    rgba(244, 239, 230, 0.7),
    rgba(244, 239, 230, 0.12)
  );
  transform-origin: center top;
  animation: intro-line-breathe 2600ms ease-in-out infinite;
}

@keyframes intro-line-breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.82);
  }

  50% {
    opacity: 0.9;
    transform: scaleY(1);
  }
}

.intro-progress {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 1px;
  overflow: hidden;
  background: rgba(244, 239, 230, 0.06);
  pointer-events: none;
}

.intro-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold-3);
  opacity: 0.38;
  transform: scaleX(clamp(0, var(--intro-p, 0), 1));
  transform-origin: left center;
}

/* Кадр остаётся под роликом, интерфейс не просвечивает. */
.app[data-intro='on'] > :not(.intro):not(.stage) {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

.app[data-intro='on'] > :not(.intro),
.app[data-intro='on'] > :not(.intro) * {
  pointer-events: none !important;
}

.app[data-intro='on'] > :not(.intro):not(.stage) * {
  visibility: hidden !important;
}

/* Проявление без изменения исходной раскладки. */
.top,
.hero-lead,
.stats,
.hero-actions {
  transition:
    opacity 620ms var(--ease),
    transform 720ms var(--ease),
    visibility 0s;
}

.hero-title {
  transform-origin: left bottom;
  transition: transform 900ms var(--ease);
}

.app[data-chrome='quiet'] .top,
.app[data-chrome='quiet'] .hero-lead,
.app[data-chrome='quiet'] .stats,
.app[data-chrome='quiet'] .hero-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s;
}

.app[data-chrome='quiet'] .top {
  transform: translateY(-10px);
}

.app[data-chrome='quiet'] .hero-lead,
.app[data-chrome='quiet'] .stats,
.app[data-chrome='quiet'] .hero-actions {
  transform: translateY(12px);
}

/* Перекрываем явные pointer-events у вложенных кнопок. */
.app[data-chrome='quiet'] .top *,
.app[data-chrome='quiet'] .hero-actions * {
  visibility: hidden;
  pointer-events: none;
}

.app[data-chrome='quiet'] .hero-title {
  transform:
    translate(clamp(32px, 3vw, 94px), calc(280px - 58vh))
    scale(2.15);
}

.app[data-chrome='full'] .top {
  transition-delay: 0s;
}

.app[data-chrome='full'] .hero-lead {
  transition-delay: 80ms;
}

.app[data-chrome='full'] .stats {
  transition-delay: 140ms;
}

.app[data-chrome='full'] .hero-actions {
  transition-delay: 260ms;
}

/* На большом мониторе название сохраняет масштаб композиции. */
@media (min-width: 2400px) {
  .app[data-chrome='quiet'] .hero-title {
    transform:
      translate(clamp(32px, 3vw, 94px), calc(280px - 58vh))
      scale(2.7);
  }
}

/* Тонкая шкала в обоих состояниях: геометрия не меняется. */
.rail {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.rail-arrow {
  transition:
    opacity 400ms var(--ease),
    visibility 0s;
}

.app[data-chrome='quiet'] .rail-arrow {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app[data-chrome='full'] .rail-arrow {
  transition-delay: 180ms;
}

.rail .tick::before {
  width: 6px;
  height: 1px;
  margin-top: 0;
  background: rgba(244, 239, 230, 0.28);
  box-shadow: none;
  transition:
    width 220ms var(--ease),
    background-color 220ms var(--ease);
}

.rail .tick.major::before {
  width: 11px;
  background: rgba(244, 239, 230, 0.5);
}

.rail .tick-label {
  font-size: 9px;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  color: rgba(244, 239, 230, 0.5);
  text-shadow: 0 1px 6px rgba(11, 14, 19, 0.65);
  transition: color 220ms var(--ease);
}

.rail .tick.roof .tick-label {
  color: rgba(244, 239, 230, 0.62);
}

.rail .tick:is(.on, :hover, [aria-selected='true'])::before {
  width: 16px;
  height: 1px;
  margin-top: 0;
  background: var(--text);
  box-shadow: none;
}

.rail .tick:is(.on, :hover, [aria-selected='true']) .tick-label {
  color: var(--text);
}

.rail .rail-bubble {
  left: 9px;
  min-width: 22px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: left;
  text-shadow: 0 1px 8px rgba(11, 14, 19, 0.7);
  box-shadow: none;
  transform: translateY(-50%);
}

/* Старые эффекты отключены. */
.dim,
.halo,
.glow,
.sweep {
  display: none;
}

/* Лента «матовое стекло» через весь экран по выбранному этажу (как в рилсе): ярче у башни, мягкие края. */
.overlay .band {
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 250ms var(--ease);
}

.app[data-floor] .overlay .band {
  opacity: 1;
}

/* Не переносим подсветку фасада в другие режимы. */
.app[data-mode]:not([data-mode='facade']) .overlay .band {
  opacity: 0;
}

/* Едет между этажами плавно. */
.overlay .band-move {
  transition: transform 380ms var(--ease);
}

.overlay .band-v0 {
  stop-color: #fff;
  stop-opacity: 0;
}

.overlay .band-v1 {
  stop-color: #fff;
  stop-opacity: 0.42; /* сила ленты; градиент лежит в defs, переменная группы до него не доходит */
}

.overlay .band-h-edge {
  stop-color: #fff;
  stop-opacity: 0.42;
}

.overlay .band-h-mid {
  stop-color: #fff;
  stop-opacity: 0.72;
}

.overlay .band-h-core {
  stop-color: #fff;
  stop-opacity: 1;
}

/* Белая таблетка на этаже — у курсора. */
.overlay .band-pill {
  fill: #fff;
  opacity: 0.95;
  transition: transform 160ms var(--ease);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

/* Без дыхания и задержек при ограничении движения. */
@media (prefers-reduced-motion: reduce) {
  .intro-hint-line {
    animation: none;
    opacity: 0.65;
    transform: none;
  }

  .intro,
  .top,
  .hero-title,
  .hero-lead,
  .stats,
  .hero-actions,
  .rail-arrow,
  .rail .tick::before,
  .rail .tick-label,
  .rail .rail-bubble,
  .overlay .band,
  .overlay .band-move,
  .overlay .band-pill {
    transition: none !important;
  }
}
