/* ==========================================================================
   Chara Visuals — components.css
   Повторно используемые компоненты. Правило: интерактивные элементы и
   игровой контент — с пиксельными углами, поверхности — со скруглением.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Логотип
   -------------------------------------------------------------------------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo__mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.logo__mark[src$=".svg"],
.media-slot__mark[src$=".svg"],
.launcher-card__icon img[src$=".svg"] {
  image-rendering: pixelated;
}

/* Свой логотип в прелоадере */
.preloader__logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  animation: logo-in 900ms var(--ease-out) both;
  filter: drop-shadow(0 0 18px rgba(255, 45, 66, 0.6));
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-8deg);
    filter: drop-shadow(0 0 0 rgba(255, 45, 66, 0));
  }
}

.logo__word {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo__word span {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--ash);
}

/* --------------------------------------------------------------------------
   Кнопки. Внешний .btn даёт свечение, внутренний .btn__face — форма и фон.
   -------------------------------------------------------------------------- */

.btn {
  --s: 3px;
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  font-weight: 600;
  font-size: var(--fs-15);
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  user-select: none;
  transition: filter var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn__face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  padding: 0 22px;
  transition:
    background-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
}

.btn:focus-visible .btn__face {
  box-shadow: inset 0 0 0 2px var(--bone);
}

/* Основная — «запитанная» */
.btn--primary .btn__face {
  background: var(--signal-deep);
  color: #fff;
  box-shadow: none;
}

.btn--primary:hover {
  filter: drop-shadow(0 0 14px rgba(255, 45, 66, 0.55));
}

.btn--primary:hover .btn__face {
  background: var(--signal);
}

/* Контурная — провод без сигнала, при наведении получает сигнал */
.btn--ghost .btn__face {
  background: rgba(255, 255, 255, 0.03);
  color: var(--bone);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.btn--ghost:hover .btn__face {
  background: rgba(255, 45, 66, 0.08);
  box-shadow: inset 0 0 0 1px var(--line-signal);
}

.btn--sm {
  font-size: 14px;
}

.btn--sm .btn__face {
  min-height: 40px;
  padding: 0 16px;
}

.btn--lg {
  font-size: var(--fs-17);
}

.btn--lg .btn__face {
  min-height: 56px;
  padding: 0 28px;
}

.btn--block {
  display: flex;
  width: 100%;
  white-space: normal;
}

.btn--block .btn__face {
  padding-block: 12px;
  line-height: 1.25;
  text-align: center;
}

.btn[aria-disabled="true"],
.btn:disabled {
  pointer-events: none;
  filter: none;
}

.btn[aria-disabled="true"] .btn__face,
.btn:disabled .btn__face {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ash-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading .btn__face {
  color: transparent;
  position: relative;
}

.btn.is-loading .btn__face::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Текстовая ссылка с «проводом» снизу */
.link {
  color: var(--bone);
  background-image: linear-gradient(var(--signal), var(--signal));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur-3) var(--ease-out), color var(--dur-2);
  padding-bottom: 2px;
}

.link:hover {
  background-size: 100% 1px;
}

.link--muted {
  color: var(--ash);
}

.link--muted:hover {
  color: var(--bone);
}

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding: 14px var(--gutter) 0;
  pointer-events: none;
}

.site-header__bar {
  pointer-events: auto;
  max-width: var(--container);
  height: 62px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 10px 0 18px;
  border-radius: 18px;
  background: rgba(14, 11, 16, 0.42);
  border: 1px solid transparent;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition:
    background-color var(--dur-3) var(--ease-out),
    border-color var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out);
}

.site-header.is-scrolled .site-header__bar {
  background: rgba(18, 14, 20, 0.78);
  border-color: var(--line);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.nav-link {
  position: relative;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: var(--fs-15);
  font-weight: 500;
  color: var(--ash);
  transition: color var(--dur-2), background-color var(--dur-2);
}

.nav-link:hover {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.04);
}

/* Текущая страница — «лампа» под ссылкой */
.nav-link[aria-current="page"],
.nav-link.is-active {
  color: var(--bone);
}

.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px 1px rgba(255, 45, 66, 0.8);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--bone);
}

.burger span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur-3) var(--ease-out), top var(--dur-3) var(--ease-out);
}

.burger span:nth-child(1) {
  top: 17px;
}

.burger span:nth-child(2) {
  top: 25px;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.burger[aria-expanded="true"] span:nth-child(2) {
  top: 21px;
  transform: rotate(-45deg);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 6px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  transition: border-color var(--dur-2);
}

.account-chip:hover {
  border-color: var(--line-signal);
}

.account-chip__avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--dust);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .site-nav,
  .site-header__actions .btn--ghost {
    display: none;
  }

  .burger {
    display: block;
  }

  .site-header__bar {
    gap: 12px;
    justify-content: space-between;
  }
}

@media (max-width: 359px) {
  .site-header__actions .btn--primary {
    display: none;
  }

  .site-header__actions .account-chip span:last-child {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Мобильное меню — полноэкранный слой
   -------------------------------------------------------------------------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 28px) var(--gutter) max(28px, env(safe-area-inset-bottom));
  background: rgba(14, 11, 16, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
  overflow-y: auto;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-3) var(--ease-out), visibility 0s;
}

.mobile-menu__nav {
  display: grid;
  gap: 2px;
}

.mobile-menu__nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  letter-spacing: -0.03em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out), color var(--dur-2);
  transition-delay: calc(var(--i, 0) * 45ms + 60ms);
}

.mobile-menu__nav a[aria-current="page"] {
  color: var(--signal-hot);
}

.mobile-menu.is-open .mobile-menu__nav a {
  opacity: 1;
  transform: none;
}

.mobile-menu__nav a::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dust);
  transition: background-color var(--dur-2), box-shadow var(--dur-2);
}

.mobile-menu__nav a:active::after,
.mobile-menu__nav a[aria-current="page"]::after {
  background: var(--signal);
  box-shadow: 0 0 10px rgba(255, 45, 66, 0.9);
}

.mobile-menu__actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 32px;
}

/* --------------------------------------------------------------------------
   Поверхности
   -------------------------------------------------------------------------- */

.surface {
  position: relative;
  border-radius: var(--radius-l);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--obsidian-2);
  border: 1px solid var(--line);
}

.surface--pad {
  padding: clamp(22px, 3vw, 36px);
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* Небольшая метка-ярлык (не капсом) */
.tag {
  --s: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ash);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line-2);
  white-space: nowrap;
}

.tag--signal {
  color: var(--signal-hot);
  background: rgba(255, 45, 66, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 66, 0.3);
}

/* Лампа редстоуна: квадрат, который «загорается» */
.lamp {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--dust);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 66, 0.25);
  transition: background-color 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}

.lamp.is-on,
.is-on > .lamp {
  background: var(--signal);
  box-shadow:
    0 0 0 1px rgba(255, 120, 130, 0.6),
    0 0 12px 2px rgba(255, 45, 66, 0.7);
}

/* Уведомление на странице */
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius-m);
  background: rgba(255, 45, 66, 0.06);
  border: 1px solid rgba(255, 45, 66, 0.22);
  color: var(--bone);
  font-size: var(--fs-15);
  line-height: 1.5;
}

.notice .lamp {
  margin-top: 6px;
}

.notice p + p {
  margin-top: 4px;
}

.notice a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--signal);
}

.notice--neutral {
  background: var(--surface);
  border-color: var(--line);
}

/* --------------------------------------------------------------------------
   Медиа-слот: место под фото/видео. Пропорции фиксированы — файл любого
   размера не ломает вёрстку. Пустое состояние — «схема без сигнала».
   -------------------------------------------------------------------------- */

.media-slot {
  --s: 4px;
  --ratio: 16 / 9;
  position: relative;
  aspect-ratio: var(--ratio);
  width: 100%;
  overflow: hidden;
  background: var(--deepslate);
  isolation: isolate;
}

.media-slot__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 70% at 50% 110%, rgba(255, 45, 66, 0.1), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' shape-rendering='crispEdges'%3E%3Cpath fill='%235c0c18' fill-opacity='.38' d='M22 22h4v4h-4zM14 23h6v2h-6zM28 23h6v2h-6zM23 14h2v6h-2zM23 28h2v6h-2z'/%3E%3C/svg%3E") center / 48px 48px,
    linear-gradient(180deg, #1a151d, #141017);
}

.media-slot__empty::before,
.media-slot__empty::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  background:
    linear-gradient(var(--line-2), var(--line-2)) top left / 18px 1px,
    linear-gradient(var(--line-2), var(--line-2)) top left / 1px 18px,
    linear-gradient(var(--line-2), var(--line-2)) top right / 18px 1px,
    linear-gradient(var(--line-2), var(--line-2)) top right / 1px 18px,
    linear-gradient(var(--line-2), var(--line-2)) bottom left / 18px 1px,
    linear-gradient(var(--line-2), var(--line-2)) bottom left / 1px 18px,
    linear-gradient(var(--line-2), var(--line-2)) bottom right / 18px 1px,
    linear-gradient(var(--line-2), var(--line-2)) bottom right / 1px 18px;
  background-repeat: no-repeat;
}

.media-slot__empty::after {
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(14, 11, 16, 0.55) 100%);
}

.media-slot__mark {
  width: clamp(28px, 6%, 52px);
  opacity: 0.16;
}

.has-custom-logo .media-slot__mark {
  filter: grayscale(1);
  opacity: 0.12;
}

.media-slot > img,
.media-slot > video,
.media-slot > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.media-slot.is-filled .media-slot__empty {
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}

.media-slot--frame {
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.media-slot--frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   Аккордеон (вопросы)
   -------------------------------------------------------------------------- */

.faq {
  border-top: 1px solid var(--line);
}

.faq__item {
  border-bottom: 1px solid var(--line);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 22px 0;
  text-align: left;
  font-size: var(--fs-20);
  font-weight: 500;
  line-height: 1.4;
  color: var(--bone);
  transition: color var(--dur-2);
}

.faq__q:hover {
  color: #fff;
}

.faq__icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  background: var(--ash);
  transition: transform var(--dur-3) var(--ease-out), background-color var(--dur-2);
}

.faq__icon::before {
  left: 0;
  right: 0;
  top: 6px;
  height: 2px;
}

.faq__icon::after {
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
}

.faq__item.is-open .faq__icon::after {
  transform: scaleY(0);
}

.faq__item.is-open .faq__icon::before,
.faq__q:hover .faq__icon::before,
.faq__q:hover .faq__icon::after {
  background: var(--signal);
}

.faq__a {
  overflow: hidden;
  height: 0;
  transition: height var(--dur-3) var(--ease-out);
}

.faq__a-inner {
  padding: 0 48px 24px 0;
  color: var(--ash);
  max-width: 64ch;
}

.faq__a-inner a {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--signal-deep);
  text-underline-offset: 3px;
}

.no-js .faq__a {
  height: auto;
}

/* --------------------------------------------------------------------------
   Сегментированные вкладки
   -------------------------------------------------------------------------- */

.segmented {
  --s: 3px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line);
}

.segmented__btn {
  --s: 2px;
  min-height: 40px;
  padding: 0 16px;
  font-size: var(--fs-15);
  font-weight: 500;
  color: var(--ash);
  transition: color var(--dur-2), background-color var(--dur-2), box-shadow var(--dur-2);
}

.segmented__btn:hover {
  color: var(--bone);
}

.segmented__btn[aria-selected="true"],
.segmented__btn[aria-pressed="true"] {
  color: #fff;
  background: rgba(255, 45, 66, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 66, 0.45);
}

/* --------------------------------------------------------------------------
   Слайдер сравнения «до/после»
   -------------------------------------------------------------------------- */

.compare {
  --pos: 50%;
  --s: 4px;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--deepslate);
  touch-action: pan-y;
  user-select: none;
  cursor: ew-resize;
}

.compare__layer {
  position: absolute;
  inset: 0;
}

.compare__layer .media-slot {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  height: 100%;
  clip-path: none;
}

.compare__layer--after {
  clip-path: inset(0 0 0 var(--pos));
}

/* Пустое «после» — с сигналом, чтобы сравнение читалось и без скриншотов */
.compare__layer--after .media-slot__empty {
  background:
    radial-gradient(ellipse 70% 80% at 70% 100%, rgba(255, 45, 66, 0.22), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff2d42' fill-opacity='.18' d='M22 22h4v4h-4zM14 23h6v2h-6zM28 23h6v2h-6zM23 14h2v6h-2zM23 28h2v6h-2z'/%3E%3C/svg%3E") center / 48px 48px,
    linear-gradient(180deg, #221419, #160f14);
}

.compare__layer--before .media-slot__empty {
  filter: grayscale(1) brightness(0.8);
}

.compare .media-slot__mark {
  display: none;
}

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: var(--signal);
  box-shadow: 0 0 14px 1px rgba(255, 45, 66, 0.8);
  z-index: 3;
  pointer-events: none;
}

.compare__knob {
  --s: 3px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: var(--signal-deep);
  color: #fff;
}

.compare__knob svg {
  width: 22px;
  height: 22px;
}

/* Ползунок для клавиатуры и экранных дикторов; мышь и касания — по всему блоку */
.compare__range {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.compare__range:focus-visible + .compare__handle .compare__knob {
  box-shadow: inset 0 0 0 2px #fff;
}

.compare__label {
  position: absolute;
  top: 16px;
  z-index: 3;
  pointer-events: none;
}

.compare__label--before {
  left: 16px;
}

.compare__label--after {
  right: 16px;
}

/* --------------------------------------------------------------------------
   Тур по возможностям: список слева, медиа справа
   -------------------------------------------------------------------------- */

.tour {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.4fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.tour__list {
  display: grid;
  border-top: 1px solid var(--line);
}

.tour__item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  align-items: start;
  width: 100%;
  padding: 20px 0 22px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  color: var(--ash);
  transition: color var(--dur-2);
}

.tour__item .lamp {
  margin-top: 9px;
}

.tour__title {
  font-size: var(--fs-20);
  font-weight: 600;
  color: inherit;
  line-height: 1.35;
}

.tour__text {
  grid-column: 2;
  font-size: var(--fs-15);
  line-height: 1.55;
  color: var(--ash);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out);
}

.tour__item:hover {
  color: var(--bone);
}

.tour__item[aria-selected="true"] {
  color: var(--bone);
}

.tour__item[aria-selected="true"] .tour__text {
  max-height: 8em;
  opacity: 1;
}

/* Таймер автопереключения — провод, по которому идёт сигнал */
.tour__timer {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(255, 45, 66, 0.8);
}

.tour__item[aria-selected="true"] .tour__timer {
  animation: tour-timer var(--tour-interval, 7000ms) linear forwards;
}

.tour.is-paused .tour__item[aria-selected="true"] .tour__timer {
  animation-play-state: paused;
}

@keyframes tour-timer {
  to {
    width: 100%;
  }
}

.tour__stage {
  position: relative;
}

.tour__panel {
  display: grid;
  gap: 18px;
}

.tour__panel[hidden] {
  display: none;
}

.tour__panel.is-entering .media-slot {
  animation: panel-in 560ms var(--ease-out);
}

@keyframes panel-in {
  from {
    opacity: 0.2;
    transform: scale(0.985);
  }
}

.tour__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ash);
  font-size: var(--fs-15);
}

@media (max-width: 860px) {
  .tour {
    grid-template-columns: 1fr;
  }

  .tour__stage {
    order: -1;
  }
}

/* --------------------------------------------------------------------------
   Шаги «Как начать»
   -------------------------------------------------------------------------- */

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}

.steps__wire {
  position: absolute;
  top: 27px;
  left: 28px;
  right: calc(33.33% - 28px);
  height: 2px;
  background: var(--dust);
  overflow: hidden;
}

.steps__wire::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(255, 45, 66, 0.9);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1600ms var(--ease-in-out);
}

.steps.is-on .steps__wire::after {
  transform: scaleX(1);
}

.step {
  position: relative;
  display: grid;
  gap: 14px;
  align-content: start;
}

.step__num {
  --s: 3px;
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 24px;
  color: var(--ash);
  background: var(--deepslate);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color 400ms, background-color 400ms, box-shadow 400ms;
  transition-delay: var(--step-delay, 0ms);
}

.steps.is-on .step__num {
  color: #fff;
  background: var(--signal-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 140, 150, 0.5);
}

.step h3 {
  font-size: var(--fs-20);
}

.step p {
  color: var(--ash);
  font-size: var(--fs-15);
  max-width: 30ch;
}

@media (max-width: 760px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-left: 0;
  }

  .steps__wire {
    top: 28px;
    bottom: 28px;
    left: 27px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .steps__wire::after {
    transform-origin: top;
    transform: scaleY(0);
  }

  .steps.is-on .steps__wire::after {
    transform: scaleY(1);
  }

  .step {
    grid-template-columns: 56px 1fr;
    column-gap: 18px;
    row-gap: 8px;
  }

  .step > :not(.step__num) {
    grid-column: 2;
  }

  .step__num {
    grid-row: 1 / span 3;
  }
}

/* --------------------------------------------------------------------------
   Формы
   -------------------------------------------------------------------------- */

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: var(--fs-15);
  font-weight: 500;
  color: var(--bone);
}

.field__label a {
  font-weight: 400;
  color: var(--ash);
  font-size: var(--fs-13);
}

.field__label a:hover {
  color: var(--bone);
}

.input-wrap {
  --s: 3px;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow var(--dur-2), background-color var(--dur-2);
}

.input-wrap:hover {
  box-shadow: inset 0 0 0 1px rgba(241, 233, 230, 0.22);
}

.input-wrap:focus-within {
  background: rgba(255, 45, 66, 0.04);
  box-shadow: inset 0 0 0 1px var(--signal);
}

.input-wrap.is-invalid {
  box-shadow: inset 0 0 0 1px var(--signal-hot);
  background: rgba(255, 45, 66, 0.06);
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: var(--fs-17);
  color: var(--bone);
}

.input::placeholder {
  color: var(--ash-2);
}

.input:-webkit-autofill {
  -webkit-text-fill-color: var(--bone);
  transition: background-color 9999s ease-out;
  caret-color: var(--bone);
}

.input-wrap__btn {
  flex-shrink: 0;
  height: 40px;
  margin-right: 5px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--ash);
}

.input-wrap__btn:hover {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.05);
}

.field__error {
  font-size: var(--fs-13);
  color: var(--signal-hot);
  min-height: 0;
}

.field__hint {
  font-size: var(--fs-13);
  color: var(--ash-2);
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: var(--fs-15);
  color: var(--ash);
  cursor: pointer;
  line-height: 1.5;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check__box {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color var(--dur-2), box-shadow var(--dur-2);
}

/* Галочка вместо внутреннего квадрата */
.check__box::after {
  content: "";
  width: 10px;
  height: 5px;
  margin-top: -3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform var(--dur-2) var(--ease-out);
}

.check input:checked + .check__box {
  background: var(--signal-deep);
  box-shadow: inset 0 0 0 1px var(--signal);
}

.check input:checked + .check__box::after {
  transform: rotate(-45deg) scale(1);
}

.check input:focus-visible + .check__box {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.check a {
  color: var(--bone);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--signal-deep);
}

.check.is-invalid .check__box {
  box-shadow: inset 0 0 0 1px var(--signal-hot);
}

.form {
  display: grid;
  gap: 18px;
}

.form__status {
  font-size: var(--fs-15);
}

/* --------------------------------------------------------------------------
   Модальное окно (<dialog>)
   -------------------------------------------------------------------------- */

.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-l);
  background: var(--obsidian-2);
  color: var(--bone);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 45, 66, 0.06);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(8, 6, 10, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal[open] {
  animation: modal-in 360ms var(--ease-out);
}

.modal[open]::backdrop {
  animation: fade-in 360ms var(--ease-out);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 26px 0;
}

.modal__head h2 {
  min-width: 0;
  font-size: clamp(1.3rem, 0.95rem + 1.6vw, 2rem);
}

.modal__body {
  padding: 22px 26px 26px;
}

/* На телефоне крестик уходит в угол, заголовку остаётся вся ширина */
@media (max-width: 480px) {
  .modal__head {
    position: relative;
    padding: 46px 20px 0;
  }

  .modal__head .icon-btn {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .modal__head h2 {
    font-size: 1.2rem;
  }

  .modal__body {
    padding: 18px 20px 22px;
  }
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ash);
  transition: color var(--dur-2), background-color var(--dur-2);
}

.icon-btn:hover {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.06);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 480px) {
  .modal__actions .btn {
    flex: 1 1 100%;
  }
}

/* --------------------------------------------------------------------------
   Всплывающие уведомления
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 300;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  --s: 3px;
  pointer-events: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #1d171f;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 40px -20px rgba(0, 0, 0, 0.9);
  font-size: var(--fs-15);
  line-height: 1.45;
  animation: toast-in 420ms var(--ease-out);
}

.toast.is-leaving {
  animation: toast-out 260ms var(--ease-in-out) forwards;
}

.toast .lamp {
  margin-top: 6px;
}

.toast--error .lamp,
.toast--success .lamp {
  background: var(--signal);
  box-shadow: 0 0 10px rgba(255, 45, 66, 0.8);
}

.toast strong {
  display: block;
  font-weight: 600;
}

.toast span {
  color: var(--ash);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --------------------------------------------------------------------------
   Видео YouTube с загрузкой по клику
   -------------------------------------------------------------------------- */

.yt {
  cursor: pointer;
}

.yt__play {
  --s: 4px;
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: var(--signal-deep);
  color: #fff;
  transition: background-color var(--dur-2), transform var(--dur-2) var(--ease-out);
}

.yt:hover .yt__play {
  background: var(--signal);
  transform: translate(-50%, -50%) scale(1.05);
}

.yt__play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */

.site-footer {
  position: relative;
  margin-top: clamp(40px, 6vw, 80px);
  padding: clamp(48px, 6vw, 72px) 0 32px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 60%);
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 0.6fr));
  gap: 32px;
}

.site-footer__brand p {
  margin-top: 16px;
  max-width: 30ch;
  color: var(--ash);
  font-size: var(--fs-15);
}

.site-footer__col h3 {
  font-size: var(--fs-15);
  font-weight: 600;
  margin-bottom: 14px;
}

.site-footer__col ul {
  display: grid;
  gap: 10px;
}

.site-footer__col a {
  color: var(--ash);
  font-size: var(--fs-15);
  transition: color var(--dur-2);
}

.site-footer__col a:hover {
  color: var(--bone);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.social {
  --s: 3px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ash);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color var(--dur-2), box-shadow var(--dur-2), background-color var(--dur-2);
}

.social:hover {
  color: #fff;
  background: rgba(255, 45, 66, 0.1);
  box-shadow: inset 0 0 0 1px var(--line-signal);
}

.social svg {
  width: 19px;
  height: 19px;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ash-2);
  font-size: var(--fs-13);
  line-height: 1.6;
}

.site-footer__legal {
  display: grid;
  gap: 4px;
  max-width: 64ch;
}

@media (max-width: 860px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 340px) {
  .site-footer__top {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Прелоадер (только первая загрузка главной в сессии)
   -------------------------------------------------------------------------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--obsidian);
  transition: opacity 500ms var(--ease-out), visibility 0s linear 500ms;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

.preloader__mark {
  display: grid;
  grid-template-columns: repeat(7, 10px);
  grid-template-rows: repeat(7, 10px);
}

.preloader__mark i {
  background: var(--bone);
  opacity: 0;
  transform: scale(0.4);
  animation: px-in 360ms var(--ease-out) forwards;
  animation-delay: calc(var(--d) * 32ms);
}

.preloader__mark i.is-signal {
  background: var(--signal);
  box-shadow: 0 0 14px 2px rgba(255, 45, 66, 0.8);
}

@keyframes px-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Статистика и отзывы — появляются только при заполненных данных
   -------------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stat {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-44);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.stat__label {
  margin-top: 8px;
  color: var(--ash);
  font-size: var(--fs-15);
}

.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.quote {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px;
}

.quote blockquote {
  font-size: var(--fs-17);
  line-height: 1.6;
}

.quote figcaption {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-15);
}

.quote figcaption span {
  display: block;
  color: var(--ash);
  font-size: var(--fs-13);
}

.quote__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--dust);
}

/* --------------------------------------------------------------------------
   Переключатель языка
   -------------------------------------------------------------------------- */

.flag {
  display: inline-block;
  width: 22px;
  height: 15px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lang {
  position: relative;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bone);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  transition: border-color var(--dur-2), background-color var(--dur-2);
}

.lang__btn:hover,
.lang.is-open .lang__btn {
  border-color: var(--line-signal);
  background: rgba(255, 45, 66, 0.06);
}

.lang__btn > svg {
  width: 16px;
  height: 16px;
  color: var(--ash);
  transition: transform var(--dur-3) var(--ease-out);
}

.lang.is-open .lang__btn > svg {
  transform: rotate(180deg);
}

.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  border-radius: 14px;
  background: #17121a;
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9);
  animation: menu-in 220ms var(--ease-out);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.lang__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: var(--fs-15);
  font-weight: 500;
  color: var(--ash);
  text-align: left;
  transition: color var(--dur-2), background-color var(--dur-2);
}

.lang__item:hover,
.lang__item:focus-visible {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.05);
}

.lang__item[aria-checked="true"] {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 45, 66, 0.12);
}

.lang__item > svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--signal);
}

/* В мобильном меню — две кнопки рядом */
.lang-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.lang-buttons__item {
  --s: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  font-weight: 600;
  color: var(--ash);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color var(--dur-2), background-color var(--dur-2), box-shadow var(--dur-2);
}

.lang-buttons__item[aria-pressed="true"] {
  color: #fff;
  background: rgba(255, 45, 66, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 66, 0.55);
}

@media (max-width: 1120px) {
  .site-header__lang {
    display: none;
  }
}
