/* ============================================================
   Аргумент — лендинг домена
   Стиль общий с кабинетом (tokens.css). Здесь — компоновка
   публичной страницы: широкая, читаемая, без мобильных вкладок.
   ============================================================ */

@import url("tokens.css");

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Плавная смена темы */
body, .card, .btn, .btn-primary, .btn-ghost, .nav, .notice, .tag,
.hero, .section, .footer {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Мягкое свечение фона под первым экраном --- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -8%; left: 50%;
  width: min(900px, 100%); height: 560px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 62%);
  opacity: 0.45; filter: blur(18px);
  pointer-events: none;
  animation: hero-glow 9s ease-in-out infinite alternate;
}
/* Контент первого экрана — поверх свечения */
.hero > * { position: relative; z-index: 1; }
/* Живая волна (arc.js): лежит под контентом, события мыши не ловит —
   за курсором следит сам скрипт по родителю. Без WebGL канвас пуст и
   невидим, остаётся свечение .hero::before. */
.hero-arc {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
@keyframes hero-glow {
  from { opacity: 0.30; transform: translateX(-50%) scale(0.96); }
  to   { opacity: 0.52; transform: translateX(-50%) scale(1.05); }
}

/* --- Появление при загрузке и при прокрутке --- */
@keyframes l-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Первый экран — каскадное появление сразу после загрузки */
.hero-copy > * { animation: l-rise 0.7s var(--ease-out) both; }
.hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.13s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.21s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.29s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.37s; }

/* Карточка разбора: одна чистая анимация появления — подъём с лёгким
   «оседанием» (scale). Раньше здесь было ДВЕ анимации на transform
   (появление + вечное «парение»), и в момент передачи управления
   transform карточка дёргалась. Теперь движение одно и предсказуемое. */
.hero-doc { animation: doc-appear 0.8s var(--ease-out) 0.30s both; }
@keyframes doc-appear {
  0%   { opacity: 0; transform: translateY(26px) scale(0.985); }
  70%  { opacity: 1; transform: translateY(-4px) scale(1.004); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
/* «Живость» карточки — мягкая пульсация акцентной полосы сверху.
   Она анимирует opacity, а не transform, поэтому не конфликтует
   с появлением и не даёт дёрганья. */
.hero-doc::before { animation: doc-bar 4.5s ease-in-out 1.2s infinite; }
@keyframes doc-bar {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

/* Блоки ниже первого экрана проявляются при попадании в область видимости.
   Скрытие действует ТОЛЬКО когда JS добавил класс .js на <html>: без JS
   (или при его сбое) контент остаётся видимым — прогрессивное улучшение.
   Класс .reveal-in возвращает блок, наблюдатель вешает его при прокрутке. */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
html.js .reveal.reveal-in { opacity: 1; transform: none; }
/* Каскад внутри раскрытого блока */
.reveal-in .steps li, .reveal-in .mode, .reveal-in .g {
  animation: l-rise 0.5s var(--ease-out) both;
}
.steps li:nth-child(2), .mode:nth-child(2), .g:nth-child(2) { animation-delay: 0.07s; }
.steps li:nth-child(3), .mode:nth-child(3), .g:nth-child(3) { animation-delay: 0.14s; }
.mode:nth-child(4), .g:nth-child(4) { animation-delay: 0.21s; }
.mode:nth-child(5) { animation-delay: 0.28s; }
.mode:nth-child(6) { animation-delay: 0.35s; }

/* Карточки режимов — подсветка рамки и тени при наведении.
   Подъём transform здесь не используется: карточку уже анимирует
   entrance-анимация (fill: both), и она перекрывала бы hover-transform.
   Тактильный отклик дают рамка, тень и «ожившая» иконка. */
.mode { transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease); }
.mode:hover { box-shadow: var(--sh-md); border-color: var(--separator-2); }
/* Интерактивная сетка (grid.js): ячейка под курсором растёт,
   соседи приподнимаются слабее. */
.mode.g-big { transform: scale(1.045) translateY(-4px); z-index: 3; box-shadow: var(--sh-md); border-color: var(--separator-2); }
.mode.g-small { transform: scale(1.018) translateY(-2px); z-index: 2; }
.mode-ic { display: inline-block; color: var(--accent); transition: transform 0.3s var(--ease); }
.mode-ic svg { width: 26px; height: 26px; display: block; }
.mode:hover .mode-ic { transform: scale(1.14) rotate(-5deg); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: var(--accent-soft-2); color: var(--text); }

.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--r-md);
  font-weight: 650; font-size: 15px; border: 1px solid var(--separator-2);
  background: var(--card); color: var(--text);
  transition: transform 0.18s var(--ease), filter var(--dur-fast),
              background var(--dur-fast), box-shadow 0.18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98) translateY(0); }
.btn-primary { background: var(--grad-accent); color: var(--accent-text); border: none; box-shadow: var(--sh-accent); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 12px 34px var(--accent-glow); }
.btn-ghost:hover { background: var(--card-2); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; border-radius: var(--r-sm); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* --- Шапка --- */
.lhead {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--separator);
}
.lhead-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.lbrand { display: flex; align-items: center; gap: 11px; }

.brandmark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad-accent);
  display: grid; place-items: center; color: var(--accent-text);
  box-shadow: var(--sh-accent); flex: none;
}
.brandmark svg { width: 20px; height: 20px; }

.wordmark { display: flex; align-items: baseline; gap: 8px; }
.wordmark b { font-family: var(--font-serif); font-weight: 700; font-size: 20px; letter-spacing: var(--tracking-title); }
.wordmark span { font-size: 12.5px; color: var(--text-3); }

.lnav { display: flex; align-items: center; gap: 6px; }
.lnav a { padding: 9px 13px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14.5px; font-weight: 550; }
.lnav a:hover { color: var(--text); background: var(--card-2); }
.lnav > a:not(.btn) { display: none; }
.themebtn {
  width: 40px; height: 40px; border-radius: var(--r-pill); border: none; background: none;
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.themebtn:hover { background: var(--card-2); color: var(--text); }
.themebtn svg { width: 19px; height: 19px; }
@media (min-width: 760px) { .lnav > a:not(.btn) { display: inline-flex; } }

/* --- Первый экран --- */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 40px;
  padding-top: 64px; padding-bottom: 72px; align-items: center;
}
@media (min-width: 940px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; gap: 60px; padding-top: 96px; padding-bottom: 104px; }
}

.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; color: var(--text-2); margin-bottom: 20px;
  padding: 7px 14px 7px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--separator-2); background: var(--card);
}
.kicker-mark {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-serif);
  font-weight: 700; font-size: 14px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(33px, 5.4vw, 58px);
  font-weight: 700; line-height: 1.06; letter-spacing: var(--tracking-title);
  color: var(--text);
}
.lede {
  margin-top: 22px; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.62;
  color: var(--text-2); max-width: 54ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 20px; font-size: 13px; color: var(--text-3); max-width: 46ch; }

/* Карточка разбора — показывает формат результата */
.hero-doc {
  background: var(--card); border: 1px solid var(--separator-2);
  border-radius: var(--r-xl); padding: 22px; box-shadow: var(--sh-lg);
  position: relative; overflow: hidden;
}
.hero-doc::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad-accent);
}
.doc-head { display: flex; align-items: center; gap: 13px; padding-bottom: 16px; border-bottom: 1px solid var(--separator); }
.doc-seal {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-family: var(--font-serif); font-weight: 700; font-size: 22px;
}
.doc-title { font-family: var(--font-serif); font-size: 17px; font-weight: 700; }
.doc-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.doc-risks { list-style: none; padding: 16px 0; display: flex; flex-direction: column; gap: 11px; }
.doc-risks li { display: flex; gap: 11px; align-items: center; font-size: 14.5px; color: var(--text-2); }
.risk-lvl {
  flex: none; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill);
}
.risk-lvl.danger { background: var(--danger-soft); color: var(--danger); }
.risk-lvl.warn { background: var(--warn-soft); color: var(--warn); }
.risk-lvl.ok { background: var(--ok-soft); color: var(--ok); }

.doc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 15px; border-top: 1px solid var(--separator); font-size: 12.5px; color: var(--text-3);
}
.doc-tag { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--card-3); }

/* --- Полосы разделов --- */
.band { padding-top: 66px; padding-bottom: 66px; border-top: 1px solid var(--separator); }
.band-title {
  font-family: var(--font-serif); font-size: clamp(24px, 3vw, 34px);
  font-weight: 700; letter-spacing: var(--tracking-title); margin-bottom: 34px; max-width: 22ch;
}

.steps { list-style: none; display: grid; grid-template-columns: 1fr; gap: 24px; counter-reset: s; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 30px; } }
.steps li { position: relative; }
.step-no {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-serif); font-weight: 700; font-size: 19px; margin-bottom: 15px;
}
.steps h3 { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.steps p { color: var(--text-2); font-size: 14.5px; }

.modes { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 620px) { .modes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .modes { grid-template-columns: repeat(3, 1fr); } }
.mode {
  background: var(--card); border: 1px solid var(--separator); border-radius: var(--r-lg);
  padding: 22px;
}
/* Переходы и отклик на наведение заданы выше (блок «Появление»). */
.mode-ic { margin-bottom: 13px; }
.mode h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.mode p { color: var(--text-2); font-size: 14px; }

.guarantees { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 700px) { .guarantees { grid-template-columns: 1fr 1fr; gap: 30px 44px; } }
.g h3 { font-family: var(--font-serif); font-size: 18.5px; font-weight: 700; margin-bottom: 8px; }
.g p { color: var(--text-2); font-size: 14.5px; max-width: 46ch; }

.cta-band { border-top: 1px solid var(--separator); }
.cta-card {
  background: var(--card); border: 1px solid var(--separator-2); border-radius: var(--r-xl);
  padding: 46px 30px; text-align: center; position: relative; overflow: hidden;
}
.cta-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad-accent);
}
.cta-card h2 { font-family: var(--font-serif); font-size: clamp(23px, 3vw, 32px); font-weight: 700; letter-spacing: var(--tracking-title); }
.cta-card p { color: var(--text-2); margin-top: 12px; }
.cta-card .hero-actions { justify-content: center; }

/* --- Подвал --- */
.lfoot { padding: 40px 0 56px; border-top: 1px solid var(--separator); }
.lfoot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; justify-content: space-between; }
.lfoot-note { color: var(--text-3); font-size: 13px; }
.lfoot-year { color: var(--text-3); font-size: 13px; }

/* --- Страница тех.работ --- */
.maint {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px; gap: 16px; max-width: 520px; margin: 0 auto;
}
.maint-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--grad-accent);
  box-shadow: var(--sh-accent); }
.maint h1 { font-family: var(--font-serif); font-size: 30px; font-weight: 700; letter-spacing: var(--tracking-title); }
.maint p { color: var(--text-2); font-size: 15px; line-height: 1.6; }
.maint-note { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* --- Баннеры-объявления (задаются админом) --- */
#landing-banners:empty { display: none; }
.lbanner {
  padding: 13px 18px; border-radius: var(--r-md); margin-top: 18px;
  font-size: 14.5px; line-height: 1.5; border: 1px solid transparent;
  animation: l-rise 0.5s var(--ease-out) both;
}
.lbanner-info   { background: var(--accent-soft);  border-color: var(--accent-soft-2); }
.lbanner-warn   { background: var(--warn-soft);    border-color: transparent; }
.lbanner-danger { background: var(--danger-soft);  border-color: transparent; }
.lbanner-ok     { background: var(--ok-soft);      border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  /* Свечение, появление карточки и пульсация полосы гасятся полностью */
  .hero::before { animation: none; }
  .hero-doc { animation: none; }
  .hero-doc::before { animation: none; }
  /* Скрытые блоки проявляются сразу — без JS-наблюдателя не пропадут */
  .reveal { opacity: 1; transform: none; }
}