/*  Страница знакомства Safe.
    Тёмная, спокойная, с одним акцентом: задача — объяснить и показать,
    а не поразить оформлением. Демонстрация — настоящий интерфейс
    диспетчерской во всю ширину, вокруг него ничего не отвлекает. */

:root {
  --bg: #0b0f1a;
  --bg-soft: #101728;
  --bg-card: #161d2e;
  --line: #232c42;
  --text: #eef2ff;
  --muted: #8b96b3;
  --accent: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 54px); letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.01em; }
h3 { font-size: 19px; }
p { margin: 0; }

/* ── Шапка ─────────────────────────────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 15, 26, .82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.top__row { display: flex; align-items: center; gap: 24px; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }

.brand__mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(160deg, #3b82f6, #1d4ed8);
}

.top__nav { display: flex; gap: 22px; margin-left: auto; }
.top__nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top__nav a:hover { color: var(--text); }

/* ── Кнопки ────────────────────────────────────────────────────────────── */

.button {
  display: inline-block;
  padding: 14px 24px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 16px; text-decoration: none;
  cursor: pointer;
}

.button:hover { filter: brightness(1.08); }

.button--ghost {
  background: transparent; color: var(--text); border-color: var(--line);
}
.button--ghost:hover { border-color: #3a4767; }

.button--small { padding: 9px 16px; font-size: 15px; }
.button--big { padding: 17px 34px; font-size: 18px; }

/* ── Первый экран ──────────────────────────────────────────────────────── */

.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(59,130,246,.20), transparent 70%),
    radial-gradient(700px 400px at 92% 0%, rgba(239,68,68,.14), transparent 70%);
}

.hero__row { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero__text > * + * { margin-top: 20px; }

.tag {
  display: inline-block; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 14px;
}

.hero__lead { color: #c3cbe4; font-size: 19px; max-width: 60ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  padding-top: 20px; border-top: 1px solid var(--line);
}

@media (max-width: 620px) {
  .hero__facts { grid-template-columns: 1fr; gap: 16px; }
}
.hero__facts b {
  display: block;
  font-size: 24px;
  /* Цифры при счёте не должны дёргать вёрстку: ширина разряда постоянная. */
  font-variant-numeric: tabular-nums;
}
.hero__facts span { color: var(--muted); font-size: 14px; }

/* Телефон на первом экране: показывает, что видит жилец. */
.phone {
  width: 280px; margin: 0 auto; padding: 22px 20px 26px;
  border: 1px solid var(--line); border-radius: 38px;
  background: linear-gradient(180deg, #141b2c, #0e1424);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  text-align: center;
}
.phone__bar { width: 60px; height: 5px; margin: 0 auto 26px; border-radius: 3px; background: #2b3550; }

.phone__panic {
  width: 150px; height: 150px; margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #f87171, #b91c1c 70%);
  font-weight: 800; font-size: 20px; letter-spacing: .06em;
  box-shadow: 0 0 0 10px rgba(239,68,68,.12), 0 0 0 22px rgba(239,68,68,.06);
}
.phone__hint { margin-top: 14px; color: var(--muted); font-size: 13px; }
.phone__status {
  margin-top: 24px; padding: 12px; border-radius: 14px;
  background: #101a2e; border: 1px solid var(--line);
  font-size: 14px;
}
.phone__row { margin-top: 10px; font-size: 14px; }
.phone__row--muted { color: var(--muted); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot--live { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }

/* ── Секции ────────────────────────────────────────────────────────────── */

.section { padding: 76px 0; }
.section--soft { background: var(--bg-soft); }
.section__lead { margin-top: 14px; color: var(--muted); font-size: 18px; max-width: 70ch; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }

.card {
  padding: 26px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card);
}
.card__icon { font-size: 26px; margin-bottom: 12px; }
.card p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* Шаги */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 40px 0 0; padding: 0; list-style: none; }

.step {
  position: relative; padding: 26px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card);
}
.step__number {
  width: 34px; height: 34px; margin-bottom: 14px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(59,130,246,.15); color: #93c5fd; font-weight: 700;
}
.step p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* ── Демонстрация ──────────────────────────────────────────────────────── */

.section--demo { padding-bottom: 40px; }

.demo__bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 30px 0 16px;
}
.demo__note { color: var(--muted); font-size: 15px; }
.demo__note.is-live { color: var(--ok); }

.demo__frame {
  position: relative;
  height: min(74vh, 760px);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  background: #0d1220;
}
.demo__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.demo__cover {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(11,15,26,.92); text-align: center;
}
.demo__cover[hidden] { display: none; }
.demo__cover-title { font-size: 20px; font-weight: 600; }
.demo__cover-text { margin-top: 8px; color: var(--muted); }

.demo__tips {
  margin-top: 22px; padding: 22px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card);
}
.demo__tips ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.demo__tips li { margin-bottom: 6px; }
.demo__honest { margin-top: 16px; color: var(--muted); font-size: 14px; }

/* ── Возможности ───────────────────────────────────────────────────────── */

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }

.feature {
  padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card);
}
.feature p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* ── Цены ──────────────────────────────────────────────────────────────── */

.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }

.price {
  position: relative; padding: 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card);
  display: flex; flex-direction: column; gap: 16px;
}
.price--main { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(59,130,246,.35); }
.price__tag {
  position: absolute; top: -13px; left: 28px;
  padding: 3px 12px; border-radius: 999px;
  background: var(--accent); font-size: 13px; font-weight: 600;
}
.price__value { font-size: 34px; font-weight: 700; }
.price__value span { font-size: 16px; font-weight: 400; color: var(--muted); }
.price ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.price li { margin-bottom: 6px; }
.price .button { margin-top: auto; text-align: center; }
.price__note { margin-top: 26px; color: var(--muted); font-size: 14px; }

/* ── Вопросы ───────────────────────────────────────────────────────────── */

.faq { margin-top: 32px; display: grid; gap: 12px; }

.faq details {
  padding: 20px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card);
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '＋ '; color: var(--accent); }
.faq details[open] summary::before { content: '− '; }
.faq p { margin-top: 12px; color: var(--muted); }

/* ── Призыв и подвал ───────────────────────────────────────────────────── */

.section--cta {
  background: linear-gradient(140deg, #16203a, #0e1424);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cta { text-align: center; }
.cta p { margin: 16px auto 26px; color: var(--muted); max-width: 56ch; }

.footer { padding: 30px 0 40px; color: var(--muted); font-size: 14px; }
.footer__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 18px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ── Телефон и планшет ─────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .hero__row { grid-template-columns: 1fr; gap: 40px; }
  .hero__screen { order: -1; }
  .cards, .grid, .prices { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .top__nav { display: none; }
}

@media (max-width: 620px) {
  .steps { grid-template-columns: 1fr; }
  .wrap { width: calc(100% - 32px); }
  .section { padding: 54px 0; }
  .demo__frame { height: 70vh; }
}


/* ── Приёмы с движка serjey.com ──────────────────────────────────────────
   Перенесены с React на чистый CSS и JS: страница отдаётся статикой,
   сборщик здесь был бы лишним звеном в выкладке.
   Всё выключается при «меньше движения» — см. блок в конце файла. */

/* Сетка-фон первого экрана */
.hero { position: relative; overflow: hidden; }
.hero__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  /* Растворяем к краям: сетка не должна обрываться линией */
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 40%, transparent 100%);
}
.hero__row { position: relative; z-index: 1; }

/* Проявление слов при прокрутке */
.reveal__word {
  opacity: .18;
  transition: opacity .25s linear;
}

/* Луч-разделитель: бегает по линии между секциями */
.beam {
  position: relative;
  height: 1px;
  width: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, .05);
}
.beam > span {
  position: absolute;
  top: -0.5px;
  left: 0;
  height: 2px;
  width: 320px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  filter: blur(1.5px);
  animation: beam-run 7s ease-in-out infinite alternate;
}
.beam--reverse > span { animation-direction: alternate-reverse; }

@keyframes beam-run {
  from { transform: translateX(-320px); }
  to { transform: translateX(100vw); }
}

/* Появление блоков при прокрутке */
[data-appear] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s cubic-bezier(.16, 1, .3, 1),
              transform .5s cubic-bezier(.16, 1, .3, 1);
}
[data-appear].is-visible { opacity: 1; transform: none; }

/* Магнитная кнопка */
[data-magnetic] {
  transition: transform .18s ease-out, filter .2s ease;
  will-change: transform;
}

/* Расшифровка текста */
[data-scramble] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95em;
  color: #c3cbe4;
  cursor: default;
}

/* Схема ролей: три орбиты вокруг сервера */
.orbit {
  position: relative;
  height: 460px;
  margin-top: 40px;
  display: grid;
  place-items: center;
}

.orbit__center {
  position: relative;
  z-index: 2;
  width: 132px; height: 132px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 30%, #1b2540, #0f1526);
  text-align: center;
  box-shadow: 0 0 0 10px rgba(59, 130, 246, .06), 0 0 60px rgba(59, 130, 246, .18);
}
.orbit__center b { font-size: 16px; }
.orbit__center span { color: var(--muted); font-size: 12px; }
.orbit__icon { font-size: 22px; }

.orbit__ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
}
.orbit__ring--inner { width: 260px; height: 260px; }
.orbit__ring--outer { width: 400px; height: 400px; }

/* Три роли на окружности. Места фиксированные: на вращающихся карточках
   они наезжали друг на друга в определённые моменты, и схема читалась
   хуже, чем без движения вовсе. */
.orbit__node {
  position: absolute;
  z-index: 3;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 22px;
  box-shadow: 0 0 0 6px rgba(11, 15, 26, .9);
}

/* Положение по краям внутреннего кольца (радиус 130). */
.orbit__node--top { transform: translateY(-130px); }
.orbit__node--left { transform: translate(-113px, 65px); }
.orbit__node--right { transform: translate(113px, 65px); }

/* Лёгкое дыхание: роли «живые», но не мешают читать. */
.orbit__node--top { animation: node-pulse 3s ease-in-out infinite; }
.orbit__node--left { animation: node-pulse 3s ease-in-out .5s infinite; }
.orbit__node--right { animation: node-pulse 3s ease-in-out 1s infinite; }

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(11, 15, 26, .9), 0 0 0 0 rgba(59, 130, 246, .0); }
  50% { box-shadow: 0 0 0 6px rgba(11, 15, 26, .9), 0 0 0 10px rgba(59, 130, 246, .12); }
}

/* Подписи под схемой */
.orbit__legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.orbit__legend > div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-card);
}

.orbit__legend b { display: block; font-size: 15px; margin-bottom: 6px; }
.orbit__legend span { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Искры на кнопке тревоги: кнопка «горит» */
.phone__panic { position: relative; overflow: hidden; }

.phone__sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.phone__sparks::before,
.phone__sparks::after {
  content: '';
  position: absolute;
  top: -8px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 3px rgba(255, 255, 255, .5);
  animation: fall 3.4s linear infinite;
}
.phone__sparks::before { left: 34%; animation-delay: .4s; }
.phone__sparks::after { left: 68%; animation-delay: 1.9s; }

/* Хвост искры: тонкая полоса в сторону движения. */
.phone__sparks::before,
.phone__sparks::after {
  background-image: linear-gradient(90deg, rgba(255,255,255,.6), transparent);
}

@keyframes fall {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .9; }
  100% { transform: translate(-90px, 150px); opacity: 0; }
}

/* Смена статуса на макете телефона */
.phone__status.is-changed { animation: status-flash .9s ease-out; }

@keyframes status-flash {
  0% { background: #16233d; }
  100% { background: #101a2e; }
}

/* ── Уважение к настройке «меньше движения» ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .beam > span,
  .orbit__node,
  .phone__sparks::before,
  .phone__sparks::after,
  .phone__status.is-changed { animation: none !important; }

  [data-appear] { opacity: 1; transform: none; }
  .reveal__word { opacity: 1; }
  .hero__grid { display: none; }

}

@media (max-width: 620px) {
  .orbit { height: 320px; margin-top: 24px; }
  .orbit__halo { width: 230px; height: 230px; }
  .orbit__ring--inner { width: 210px; height: 210px; }
  .orbit__ring--outer { width: 310px; height: 310px; }

  .orbit__legend { grid-template-columns: 1fr; }
  .orbit__node { width: 44px; height: 44px; font-size: 18px; }
  .orbit__node--top { transform: translateY(-105px); }
  .orbit__node--left { transform: translate(-91px, 52px); }
  .orbit__node--right { transform: translate(91px, 52px); }
}


/* ── Вторая волна приёмов с движка ──────────────────────────────────────
   Текст, курсор, внимание. Первый файл (effects.js) отвечает за фон
   и появление блоков, этот — за чтение и отзывчивость. */

/* Заголовки, собирающиеся из размытия */
.gen__word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
}

.is-generating .gen__word {
  animation: generate-in .55s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes generate-in {
  to { opacity: 1; filter: blur(0); }
}

/* Мягкое проявление слов: лёгкий наклон блока и размытие слова */
.soft__word {
  display: inline-block;
  opacity: .16;
  filter: blur(2.4px);
  transition: opacity .18s linear, filter .18s linear;
}

[data-reveal-soft] { will-change: transform; }

/* Лучи на первом экране */
.spotlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.spotlight__ray {
  position: absolute;
  top: -40%;
  height: 180%;
  width: 380px;
  filter: blur(40px);
  opacity: .5;
}

.spotlight__ray--1 {
  left: -10%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, .28), transparent);
  animation: ray-drift 19s ease-in-out infinite alternate;
}

.spotlight__ray--2 {
  left: 35%;
  width: 260px;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, .18), transparent);
  animation: ray-drift 26s ease-in-out infinite alternate-reverse;
}

.spotlight__ray--3 {
  right: -5%;
  width: 300px;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, .14), transparent);
  animation: ray-drift 23s ease-in-out infinite alternate;
}

@keyframes ray-drift {
  from { transform: translateX(-8%) rotate(8deg); }
  to { transform: translateX(14%) rotate(-6deg); }
}

/* Искры от курсора */
.spark {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* Наклонная сетка с подсветкой клетки */
[data-boxes] { position: relative; overflow: hidden; }

.boxes {
  position: absolute;
  top: -30%;
  left: -10%;
  width: 130%;
  height: 160%;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 1fr;
  transform: translate(-10%, -10%) skewX(-42deg) skewY(10deg) scale(.8);
  pointer-events: none;
  z-index: 0;
  opacity: .55;
}

.boxes__cell {
  position: relative;
  border-left: 1px solid rgba(255, 255, 255, .028);
  border-top: 1px solid rgba(255, 255, 255, .028);
  pointer-events: auto;
  transition: background-color .25s ease;
}

.boxes__cell.is-lit { background-color: rgba(59, 130, 246, .13); }

/* Плюсики на пересечениях: сетка читается как чертёж */
.boxes__cell--plus::before {
  content: '+';
  position: absolute;
  top: -9px;
  left: -6px;
  font-size: 12px;
  color: rgba(255, 255, 255, .13);
}

/* Содержимое секции — над сеткой */
[data-boxes] > .wrap { position: relative; z-index: 1; }

/* Полоса прочитанного */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 70;
  background: rgba(255, 255, 255, .05);
}

.progress > span {
  display: block;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

/* Кнопка, которая прилипает снизу */
.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 65;
  padding: 14px 28px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;

  /* Скрыта, пока не понадобилась: выезжает снизу. */
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.sticky-cta.is-shown { transform: translate(-50%, 0); opacity: 1; }
.sticky-cta:hover { filter: brightness(1.08); }

/* Карточки и шаги: отзыв на курсор */
.card, .step, .feature, .price, .orbit__legend > div {
  transition: transform .25s cubic-bezier(.16, 1, .3, 1),
              border-color .25s ease,
              background-color .25s ease;
}

.card:hover, .step:hover, .feature:hover, .orbit__legend > div:hover {
  transform: translateY(-3px);
  border-color: #33415f;
}

.price:hover { transform: translateY(-3px); }

/* ── Отключаем всё движение по системной настройке ────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .gen__word { opacity: 1; filter: none; animation: none !important; }
  .soft__word { opacity: 1; filter: none; }
  .spotlight__ray { animation: none !important; }
  .spark { display: none; }
  .boxes { display: none; }
  .sticky-cta { transition: none; }
}
