/* ==========================================================
   R.L.S. Software — стили
   Тёмная тема, красный акцент из логотипа.
   Цвета и шрифты меняются в блоке :root.
   ========================================================== */

:root {
  --bg: #0a0b0d;
  --bg-2: #101216;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --line: #262b34;
  --line-2: #323843;
  --text: #eef0f4;
  --muted: #a4abb8;
  --red: #e30a0a;
  --red-hot: #ff4d44;
  --red-dim: #7a0a0c;
  --ok: #3ad07d;

  --r-s: 8px;
  --r-m: 14px;

  --font-head: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --font-body: "Onest", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace;

  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-s);
  background: var(--red); color: #fff; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 10px;
  font: 600 1rem var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #f21a1a; }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: #5a616f; background: var(--surface); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .92rem; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 11, 13, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-name { font: 700 1.05rem var(--font-head); letter-spacing: .01em; }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 12px; border-radius: var(--r-s);
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface); }

.header-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; }
.lang button {
  min-width: 38px; min-height: 32px; padding: 0 8px;
  background: none; border: 0; border-radius: 7px;
  color: var(--muted); font: 600 .8rem var(--font-body); letter-spacing: .04em;
  cursor: pointer; transition: color .15s, background .15s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- Первый экран ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(55% 65% at 82% 32%, rgba(227, 10, 10, .18), transparent 70%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1; opacity: .3;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 80% at 70% 40%, #000 15%, transparent 75%);
  mask-image: radial-gradient(70% 80% at 70% 40%, #000 15%, transparent 75%);
}
.hero-in {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 72px);
}

h1 {
  margin: 0 0 20px;
  font: 800 clamp(1.9rem, 4.4vw, 3.5rem)/1.08 var(--font-head);
  letter-spacing: -.015em;
  text-wrap: balance; hyphens: auto; overflow-wrap: break-word;
}
.lead { margin: 0 0 32px; max-width: 56ch; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.2rem); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px;
  margin: 0; padding-top: 24px; border-top: 1px solid var(--line);
}
.facts dt { font: 700 1.2rem var(--font-head); }
.facts dd { margin: 2px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }

/* Окно удалённого сеанса */
.session {
  overflow: hidden;
  background: rgba(16, 18, 22, .9);
  border: 1px solid var(--line-2); border-radius: var(--r-m);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.session-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font: 500 .85rem var(--font-mono); color: var(--muted);
}
.session-live { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.session-live i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  animation: pulse 2s ease-out infinite;
}

.log { list-style: none; margin: 0; padding: 10px 0; }
.log li {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 18px;
  font: 400 .95rem var(--font-mono); color: #636b79;
  transition: color .3s;
}
.log .st {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #3a404b;
  transition: background .25s, border-color .25s;
}
.log .st .ic { width: 13px; height: 13px; stroke-width: 3; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .2s; }
.log li.is-run { color: var(--text); }
.log li.is-run .st { border-color: #3a404b; border-top-color: var(--red-hot); animation: spin .8s linear infinite; }
.log li.is-done { color: var(--text); }
.log li.is-done .st { background: var(--ok); border-color: var(--ok); color: #06210f; }
.log li.is-done .st .ic { opacity: 1; transform: none; }

.log-done {
  margin: 0; padding: 14px 18px;
  border-top: 1px solid var(--line);
  font: 700 1.02rem var(--font-head); color: var(--muted);
  opacity: 0; transition: opacity .4s, color .4s;
  box-shadow: inset 3px 0 0 var(--red);
}
.log-done.is-on { opacity: 1; color: var(--text); }

/* Контур автомобиля, который "загорается" по ходу установки */
.vehicle { position: relative; margin-top: 26px; }
.vehicle img { width: 100%; height: auto; }
.v-base { opacity: .2; }
.v-scan {
  position: absolute; inset: 0;
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0);
  transition: clip-path 1s cubic-bezier(.4, 0, .2, 1);
  filter: drop-shadow(0 0 8px rgba(227, 10, 10, .55));
}
.v-beam {
  position: absolute; top: -4%; bottom: -4%; left: calc(var(--p) * 100%);
  width: 2px;
  background: linear-gradient(transparent, var(--red-hot), transparent);
  box-shadow: 0 0 14px 2px rgba(255, 77, 68, .55);
  transition: left 1s cubic-bezier(.4, 0, .2, 1), opacity .4s;
}
.hero.is-complete .v-beam { opacity: 0; }

/* ---------- Общее для секций ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 44px); }

h2 {
  margin: 0 0 14px;
  font: 800 clamp(1.65rem, 3.2vw, 2.6rem)/1.12 var(--font-head);
  letter-spacing: -.01em;
  text-wrap: balance; hyphens: auto; overflow-wrap: break-word;
}
h3 { margin: 0; font: 700 1.15rem/1.3 var(--font-head); }
.sub { margin: 0; max-width: 58ch; color: var(--muted); }

/* ---------- Марки (бегущая строка) ---------- */
.brands-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.brands-head .section-head { margin-bottom: clamp(24px, 3vw, 36px); }
.marquees {
  display: grid; gap: 14px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee {
  display: flex; width: max-content;
  animation: marquee var(--dur, 90s) linear infinite;
}
.marquee.rev { animation-direction: reverse; }
.marquees:hover .marquee { animation-play-state: paused; }

.m-track { display: flex; flex: none; align-items: center; gap: 14px; margin: 0; padding: 0 7px; list-style: none; }
.m-item {
  display: flex; align-items: center; justify-content: center;
  height: 72px; padding: 0 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.m-item img { width: auto; height: 36px; max-width: 150px; object-fit: contain; opacity: .85; user-select: none; }
/* тёмные логотипы делаем белыми, чтобы все плашки были одного цвета */
.m-item.on-light img { filter: brightness(0) invert(1); opacity: .85; }

.ask-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 24px;
  color: var(--red-hot); font-weight: 600; text-decoration: none;
}
.ask-link .ic { transition: transform .15s; }
.ask-link:hover .ic { transform: translateX(3px); }

/* ---------- Как работаем ---------- */
.process-grid {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(32px, 5vw, 72px);
}

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding: 0 0 32px 64px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--red-dim);
  color: var(--red-hot); font: 700 1rem var(--font-head);
}
.steps li::after {
  content: ""; position: absolute; left: 20px; top: 46px; bottom: 6px;
  width: 1px; background: var(--line-2);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps p { margin: 6px 0 0; max-width: 52ch; color: var(--muted); }

.need {
  margin-top: 40px; padding: 22px 24px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-m);
}
.need h3 { margin-bottom: 14px; color: var(--muted); font: 600 1rem var(--font-body); }
.need ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.need li { display: flex; align-items: center; gap: 10px; }
.need .ic { width: 1.3em; height: 1.3em; color: var(--red-hot); }

.chip {
  position: sticky; top: calc(var(--header-h) + 24px);
  padding: 28px; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-2); border-left: 3px solid var(--red); border-radius: var(--r-m);
}
.chip img { width: 100%; margin-bottom: 18px; opacity: .3; }
.chip h3 { margin-bottom: 10px; font-size: 1.3rem; }
.chip p { margin: 0 0 22px; color: var(--muted); }

/* ---------- Гарантия ---------- */
.warranty { background: var(--bg-2); }
.warranty-in {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
}
.warranty-lead { display: flex; align-items: center; gap: clamp(20px, 3vw, 36px); }
.seal { flex: none; width: clamp(110px, 14vw, 170px); height: auto; transform: rotate(-6deg); }

.perks { list-style: none; margin: 0; padding: 0; }
.perks li { padding: 18px 0; border-top: 1px solid var(--line); }
.perks li:last-child { border-bottom: 1px solid var(--line); }
.perks h3 { font-size: 1.08rem; }
.perks p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Контакты ---------- */
.contact-in {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 88px);
}
.contact-copy .sub { margin-bottom: 28px; }

.channels {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-m);
}
.channels li + li { border-top: 1px solid var(--line); }
.channels a {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: 24px 110px minmax(0, 1fr) 20px;
  min-height: 64px; padding: 16px 20px;
  color: var(--text); text-decoration: none;
  transition: background .15s;
}
.channels a:hover { background: var(--surface); }
.channels li:first-child a > .ic:first-child { color: var(--red-hot); }
.ch-name { font-weight: 600; }
.ch-id { color: var(--muted); overflow-wrap: anywhere; }
.channels .go { color: var(--muted); transition: transform .15s, color .15s; }
.channels a:hover .go { color: var(--red-hot); transform: translateX(3px); }

/* ---------- Подвал ---------- */
.site-footer { padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.footer-in img { height: 28px; width: auto; }
.foot-tag { margin: 0 auto 0 0; color: var(--muted); }
.foot-rights { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Плавающая кнопка на телефоне ---------- */
.mbar { display: none; }

/* ---------- Анимации ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(58, 208, 125, .55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(58, 208, 125, 0); }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1040px) {
  .nav { display: none; }
}

@media (max-width: 960px) {
  .hero-in,
  .process-grid,
  .warranty-in,
  .contact-in { grid-template-columns: minmax(0, 1fr); }
  .chip { position: static; }
  .vehicle { max-width: 560px; }
}

@media (max-width: 720px) {
  .head-cta { display: none; }
  .brand-name { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .facts > div { display: flex; align-items: baseline; gap: 12px; }
  .facts dt { flex: none; min-width: 7.5ch; }
  .facts dd { margin: 0; }
  .steps li { padding-left: 56px; }
  .m-item { height: 60px; padding: 0 16px; }
  .m-item img { height: 30px; max-width: 120px; }
  .channels a { grid-template-columns: 24px minmax(0, 1fr) 20px; column-gap: 14px; row-gap: 0; }
  .channels a > .ic:first-child { grid-row: 1 / span 2; }
  .channels .go { grid-column: 3; grid-row: 1 / span 2; }
  .ch-id { grid-column: 2; font-size: .92rem; }
  .warranty-lead { flex-direction: column; align-items: flex-start; }

  .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 24px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(10, 11, 13, .95) 45%);
    transform: translateY(110%); visibility: hidden;
    transition: transform .25s, visibility .25s;
    pointer-events: none;
  }
  .mbar .btn { width: 100%; pointer-events: auto; }
  .mbar.is-on { transform: none; visibility: visible; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquees { -webkit-mask-image: none; mask-image: none; padding: 0 20px; }
  .marquee { animation: none !important; width: auto; justify-content: center; }
  .m-track { flex-wrap: wrap; justify-content: center; }
  .m-track[aria-hidden="true"] { display: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
