/* Лендинг 1Yes bb. Цвета, шрифт, кнопки и рамки – как в app.1yes.pro (2s-frontend packages/ui/src/themes),
   тёмная тема – модель уровней вики и Flow: страница → карточки → заливки, каждый уровень светлее. */
:root {
  color-scheme: light;
  --page: #f2f6f7;
  --card: #ffffff;
  --fill: #f2f6f7;
  --tile: #e8eef0;
  --line: #cfdbe1;
  --seam: #dfe8ec;
  --text: #262d30;
  --text-2: #4d5a62;
  --muted: #798992;
  --solid: #262d30;
  --solid-hover: #111516;
  --on-solid: #f2f6f7;
  --on-solid-2: #aabcc5;
  --on-solid-line: #4d5a62;
  --blue: #0088ff;
  --positive: #79c621;
  --add-bg: #ebffd4;
  --add-text: #3d6b0f;
  --del-bg: #fff0eb;
  --del-text: #b2380f;
  --shadow: 0 32px 64px -32px rgba(17, 21, 22, 0.22);
  --seg-track: #e8eef0;
  --seg-on: #ffffff;
  --maxw: 1120px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111516;
    --card: #1c2123;
    --fill: #262d30;
    --tile: #2e3539;
    --line: #353e43;
    --seam: #262d30;
    --text: #e4eaed;
    --text-2: #aebbc2;
    --muted: #94a3ab;
    --solid: #e4eaed;
    --solid-hover: #ffffff;
    --on-solid: #262d30;
    --on-solid-2: #4d5a62;
    --on-solid-line: #cfdbe1;
    --add-bg: #1f2c10;
    --add-text: #9fdf57;
    --del-bg: #351c13;
    --del-text: #ff6a3c;
    --shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.6);
    --seg-track: #1c2123;
    --seg-on: #2e3539;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111516;
  --card: #1c2123;
  --fill: #262d30;
  --tile: #2e3539;
  --line: #353e43;
  --seam: #262d30;
  --text: #e4eaed;
  --text-2: #aebbc2;
  --muted: #94a3ab;
  --solid: #e4eaed;
  --solid-hover: #ffffff;
  --on-solid: #262d30;
  --on-solid-2: #4d5a62;
  --on-solid-line: #cfdbe1;
  --add-bg: #1f2c10;
  --add-text: #9fdf57;
  --del-bg: #351c13;
  --del-text: #ff6a3c;
  --shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.6);
  --seg-track: #1c2123;
  --seg-on: #2e3539;
}
@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.5 "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { flex: 0 0 auto; }
.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Шапка – как верх бокового меню приложения: фон страницы, тонкая рамка снизу */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; }
.brand rect { fill: var(--solid); }
.brand path { fill: var(--on-solid); }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: 14px; }
.nav a { color: var(--text-2); text-decoration: none; transition: color 0.2s ease-in; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 719px) {
  .nav { display: none; }
  .top .btn { margin-left: auto; }
}

/* Кнопки – Button black из UI-кита: тёмная, радиус 12, высота 48 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--solid);
  color: var(--on-solid);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease-in, box-shadow 0.2s ease-in;
}
.btn:hover { background: var(--solid-hover); }
.btn svg { width: 16px; height: 16px; }
.btn.small { min-height: 36px; padding: 0 14px; border-radius: 10px; }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 13px;
  text-decoration: none;
  transition: box-shadow 0.2s ease-in;
}
a.pill:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.pill b { padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--text); font-weight: 500; }
.pill svg { width: 14px; height: 14px; color: var(--muted); }

/* Заголовки секций */
.hero { padding-top: 64px; text-align: center; }
.hero h1.wide { max-width: 16em; }
.hero h1:first-child { margin-top: 0; }
.nowrap { white-space: nowrap; }
.hero h1 {
  margin: 28px auto 0;
  max-width: 13em;
  font-size: clamp(36px, 5.6vw, 68px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lead { margin: 24px auto 0; max-width: 38em; color: var(--text-2); font-size: clamp(17px, 2.2vw, 20px); line-height: 1.5; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* Главная ценность на первом экране: три пункта одной полосой */
.value { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 920px; margin: 48px auto 0; border-radius: 16px; background: var(--card); text-align: left; }
.value li { display: flex; align-items: center; gap: 14px; padding: 20px 24px; }
.value li + li { border-left: 1px solid var(--seam); }
.value .icon { margin: 0; }
.value b { display: block; font-size: 15px; font-weight: 500; }
.value div span { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.4; }
@media (max-width: 759px) {
  .value { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
  .value li + li { border-left: 0; border-top: 1px solid var(--seam); }
}

.section { padding-top: 120px; }
.head { max-width: 760px; }
.head.center { margin: 0 auto; text-align: center; }
.kicker { color: var(--muted); font-size: 14px; }
.head h2 {
  margin-top: 10px;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.head p { margin-top: 16px; color: var(--text-2); font-size: 18px; line-height: 1.55; text-wrap: pretty; }
.head p a { text-underline-offset: 3px; text-decoration-color: var(--line); }
.head p a:hover { text-decoration-color: currentColor; }

.card { min-width: 0; background: var(--card); border-radius: 16px; padding: 28px; }
.card h3 { font-size: 18px; font-weight: 500; line-height: 1.3; }
.card p { margin-top: 8px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.icon svg { width: 20px; height: 20px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--fill); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 16px; }

/* Демо: окно приложения в двух режимах */
.demo { margin-top: 64px; text-align: center; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--seg-track); }
.seg button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-in, color 0.2s ease-in;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(17, 21, 22, 0.1); }
.demo-caption { margin-top: 14px; min-height: 1.5em; color: var(--muted); font-size: 14px; }

.window {
  max-width: 1040px;
  margin: 28px auto 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  text-align: left;
}
.win-bar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--seam); }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.win-bar span { flex: 1; margin-right: 46px; color: var(--muted); font-size: 12px; text-align: center; }
.win-body { display: grid; grid-template-columns: 236px 1fr; min-height: 440px; }
.win-side { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--seam); font-size: 14px; }
.side-new { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 500; }
.side-new svg { width: 16px; height: 16px; }
.side-label { margin: 14px 10px 6px; color: var(--muted); font-size: 12px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); }
.side-item.active { background: var(--fill); color: var(--text); }
.side-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item small { color: var(--muted); font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dot.run { background: var(--blue); animation: pulse 1.6s ease-in-out infinite; }
.dot.done { background: var(--positive); }

.win-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 24px; }
.view { display: flex; flex: 1; flex-direction: column; gap: 16px; }
.window[data-mode="user"] .only-it, .window[data-mode="it"] .only-user { display: none; }

.msg-me {
  align-self: flex-end;
  max-width: min(80%, 520px);
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--fill);
  font-size: 15px;
  line-height: 1.45;
}
.msg-agent { display: flex; flex-direction: column; gap: 12px; max-width: 560px; font-size: 15px; }
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.who b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--fill); color: var(--text); font-size: 11px; font-weight: 500; }
.steps { display: flex; flex-direction: column; gap: 8px; }
/* Шаги агента проявляются по очереди, когда окно попало на экран (класс play – из скрипта страницы) */
.steps li { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.js .steps li, .js .file { opacity: 0; }
.play .steps li, .play .file { animation: rise 0.5s ease-out forwards; }
.play .steps li:nth-child(1) { animation-delay: 0.2s; }
.play .steps li:nth-child(2) { animation-delay: 0.8s; }
.play .steps li:nth-child(3) { animation-delay: 1.4s; }
.play .file { animation-delay: 2s; }
.check { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--positive); color: #262d30; }
.check svg { width: 11px; height: 11px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.9s linear infinite; }
.file { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; padding: 10px 14px 10px 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.file .icon { width: 32px; height: 32px; margin: 0; border-radius: 8px; }
.file .icon svg { width: 16px; height: 16px; }
.file small { display: block; color: var(--muted); font-size: 12px; }

.tabs { display: flex; gap: 4px; font-size: 13px; }
.tabs span { padding: 4px 10px; border-radius: 8px; color: var(--muted); }
.tabs span.on { background: var(--fill); color: var(--text); }
.code {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--seam);
  font: 12.5px/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.code-head { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--seam); color: var(--text-2); }
.code-head em { color: var(--muted); font-style: normal; }
.code div { padding: 0 14px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.code .add { background: var(--add-bg); color: var(--add-text); }
.code .del { background: var(--del-bg); color: var(--del-text); }
.code .ctx { color: var(--text-2); }
.term { padding: 12px 14px; border-radius: 12px; background: var(--fill); font: 12.5px/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text-2); white-space: pre; overflow: hidden; }
.term b { color: var(--text); font-weight: 500; }
.term .ok { color: var(--positive); }

.composer { margin-top: auto; padding: 14px 16px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.composer p { color: var(--muted); font-size: 15px; }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.send { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: auto; border-radius: 10px; background: var(--solid); color: var(--on-solid); }
.send svg { width: 16px; height: 16px; }
@media (max-width: 719px) {
  .win-body { grid-template-columns: 1fr; min-height: 0; }
  .win-side { display: none; }
  .win-main { padding: 16px; }
  .composer-row .chip + .chip { display: none; }
}

/* Агенты */
.agents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 48px; }
.agent { display: flex; align-items: center; gap: 14px; padding: 20px; }
.agent .icon { margin: 0; font-size: 17px; }
.agent h3 { font-size: 17px; }
.agent p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.agent .tag { margin-left: auto; align-self: flex-start; }
@media (max-width: 959px) { .agents { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 519px) { .agents { grid-template-columns: 1fr; } }

/* Два режима */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 48px; }
.mode { display: flex; flex-direction: column; padding: 32px; }
.mode .kicker { font-size: 13px; }
.mode h3 { margin-top: 6px; font-size: 24px; letter-spacing: -0.01em; }
.mode > p { margin-top: 12px; font-size: 16px; }
.ticks { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; font-size: 15px; }
.ticks li { display: flex; gap: 12px; align-items: baseline; }
.ticks li::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--text); transform: translateY(-2px); }
.mode-sample { margin-top: 28px; padding: 16px; border-radius: 12px; background: var(--fill); font-size: 14px; line-height: 1.5; }
.mode-sample.mono { font: 12.5px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text-2); white-space: pre; overflow-x: auto; }
.mode-sample .who { margin-bottom: 6px; }
@media (max-width: 799px) { .modes { grid-template-columns: minmax(0, 1fr); } .mode { padding: 24px; } }
.note { margin-top: 20px; color: var(--muted); font-size: 14px; }

/* Для России */
.ru { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 48px; }
.ru .wide { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center; }
.ru .wide .icon { margin-bottom: 20px; }
.connectors { display: flex; flex-wrap: wrap; gap: 8px; }
.connectors span { padding: 10px 16px; border-radius: 12px; background: var(--fill); font-size: 15px; font-weight: 500; }
.connectors span.more { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 400; }
@media (max-width: 899px) {
  .ru { grid-template-columns: 1fr; }
  .ru .wide { grid-template-columns: 1fr; gap: 24px; }
}

/* Под себя */
.tailor { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tailor .head p + p { margin-top: 12px; }
.board { padding: 20px; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.board .msg-me { max-width: 100%; margin-left: auto; }
.board-title { margin: 20px 0 12px; color: var(--muted); font-size: 13px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--fill); font-size: 14px; font-weight: 500; }
.tile small { color: var(--muted); font-size: 12px; font-weight: 400; }
.tile.new { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--text); }
.js .tile.new { opacity: 0; }
.play .tile.new { animation: rise 0.6s 0.5s ease-out forwards; }
.tile.new small { color: var(--blue); }
@media (max-width: 859px) { .tailor { grid-template-columns: 1fr; gap: 32px; } }

/* Как в bb */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; margin-top: 40px; }
.feature { padding: 24px 0 28px; border-top: 1px solid var(--line); }
.feature h3 { font-size: 17px; font-weight: 500; }
.feature p { margin-top: 8px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
@media (max-width: 859px) { .features { grid-template-columns: 1fr 1fr; gap: 0 24px; } }
@media (max-width: 559px) { .features { grid-template-columns: 1fr; } }

/* Для компаний – тёмная плашка; в тёмной теме становится светлой */
.biz { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; padding: 48px; border-radius: 20px; background: var(--solid); color: var(--on-solid); }
.biz .kicker { color: var(--on-solid-2); }
.biz h2 { margin-top: 10px; font-size: clamp(28px, 3.6vw, 38px); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.biz p { margin-top: 16px; color: var(--on-solid-2); font-size: 17px; line-height: 1.55; }
.biz .btn { margin-top: 32px; background: var(--on-solid); color: var(--solid); }
.biz .btn:hover { background: var(--card); }
.biz ul { display: flex; flex-direction: column; align-self: center; }
.biz li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--on-solid-line); font-size: 15px; }
.biz li:last-child { border-bottom: 1px solid var(--on-solid-line); }
.biz li span { color: var(--on-solid-2); }
@media (max-width: 859px) { .biz { grid-template-columns: 1fr; gap: 32px; padding: 32px 24px; } }

.final { padding-top: 120px; padding-bottom: 120px; text-align: center; }
.final .actions { margin-top: 32px; }

.foot { border-top: 1px solid var(--line); }
.foot .wrap { padding-top: 28px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.legal { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--seam); font-size: 13px; }
.foot .brand { font-size: 15px; color: var(--text); }
.foot .brand svg { width: 22px; height: 22px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Страница для компаний */
.ent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; }
.ent-grid .card { padding: 32px; }
.ent-grid .num { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ent-grid h3 { margin-top: 28px; font-size: 22px; letter-spacing: -0.01em; }
.ent-grid p { font-size: 16px; }
@media (max-width: 759px) { .ent-grid { grid-template-columns: 1fr; } .ent-grid .card { padding: 24px; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.split .card { display: flex; gap: 16px; align-items: flex-start; }
.split .icon { margin: 0; }
.split .card p { margin-top: 4px; }
@media (max-width: 759px) { .split { grid-template-columns: 1fr; } }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}
