/* Директор Агент — лендинг. Токены по дизайн-системе Agentarius 2.0 (профиль Director): Manrope, нейтральные серые, голубой акцент #2f78bd. */

@font-face { font-family: Manrope; src: url(/fonts/Manrope-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #ffffff;
  --ground-2: #f3f3f2;
  --ground-3: #e9e9e7;
  --ink: #171717;
  --ink-2: #4d4d4d;
  --line-strong: #767676;
  --accent: #2f78bd;
  --accent-hover: #2867a3;
  --on-accent: #ffffff;
  --accent-ink: #22629f;
  --accent-soft: #e6eff8;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --inv-ground: #171717;
  --inv-ink: #ececec;
  --inv-ink-2: #b4b4b4;

  --margin: clamp(16px, 4vw, 64px);
  --gap-section: clamp(96px, 12vw, 192px);
  --r: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --t-display: clamp(40px, 8.4vw, 128px);
  --t-h2: clamp(32px, 4.6vw, 64px);
  --t-statement: clamp(20px, 1.8vw, 26px);
  --t-body: clamp(16px, 1.15vw, 18px);
  --t-small: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #171717;
    --ground-2: #1f1f1f;
    --ground-3: #2a2a2a;
    --ink: #ececec;
    --ink-2: #b4b4b4;
    --line-strong: #808080;
    --accent: #2f78bd;
    --accent-hover: #3a86cf;
    --accent-ink: #8bbbe8;
    --accent-soft: #1d2a37;
    --warn: #e5b45a;
    --warn-soft: #3a2f1a;
    --inv-ground: #000000;
    --inv-ink: #ececec;
    --inv-ink-2: #b4b4b4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #171717;
  --ground-2: #1f1f1f;
  --ground-3: #2a2a2a;
  --ink: #ececec;
  --ink-2: #b4b4b4;
  --line-strong: #808080;
  --accent: #2f78bd;
  --accent-hover: #3a86cf;
  --accent-ink: #8bbbe8;
  --accent-soft: #1d2a37;
  --warn: #e5b45a;
  --warn-soft: #3a2f1a;
  --inv-ground: #000000;
  --inv-ink: #ececec;
  --inv-ink-2: #b4b4b4;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--t-body)/1.55 Manrope, system-ui, sans-serif;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
p, li, dd { text-wrap: pretty; }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 20; background: var(--ink); color: var(--ground); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { top: 12px; }

/* Кнопки: заливка, наведение меняет только цвет */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  border-radius: var(--r);
  background: var(--accent); color: var(--on-accent);
  font: 600 16px/24px Manrope, system-ui, sans-serif;
  text-decoration: none; white-space: nowrap;
  transition: background-color 200ms var(--ease);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; line-height: 20px; }
.btn-inv { background: #ffffff; color: #1d4f80; }
.btn-inv:hover { background: #e6eff8; color: #1d4f80; }

/* Шапка: простая полоса */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  padding: 12px var(--margin);
  background: var(--ground);
}
.mark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.mark:hover { color: var(--ink); }
.mark-bg { fill: #171717; }
.mark-d { stroke: #ffffff; }
:root[data-theme="dark"] .mark-bg { fill: #2a2a2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark-bg { fill: #2a2a2a; } }
.bar nav { display: flex; gap: 24px; margin-left: auto; }
.bar nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.bar nav a:hover { color: var(--ink); }
.bar-end { display: flex; align-items: center; gap: 12px; }
.theme {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.theme:hover { background: var(--ground-2); color: var(--ink); }

/* Первый экран */
.hero {
  display: flex; flex-direction: column; gap: clamp(48px, 9vh, 112px);
  padding: clamp(48px, 12vh, 160px) var(--margin) 0;
}
.display {
  font-size: var(--t-display); line-height: 0.98; letter-spacing: -0.035em; font-weight: 600;
}
.display .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.display .line > span { display: inline-block; }
.hero-foot { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
.lead { font-size: var(--t-statement); line-height: 1.4; max-width: 38ch; letter-spacing: -0.01em; }
.hero-act { display: grid; justify-items: end; gap: 12px; text-align: right; }
.note { font-size: var(--t-small); line-height: 20px; color: var(--ink-2); max-width: 36ch; }

/* Общие заголовки разделов */
.h2 { font-size: var(--t-h2); line-height: 1.04; letter-spacing: -0.03em; max-width: 18ch; }
section { padding: 0 var(--margin); }
main > section + section { margin-top: var(--gap-section); }

/* Пульт: текст слева, живой экран справа */
.pult { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.pult-text { display: grid; gap: 24px; position: sticky; top: 96px; }
.pult-text p { max-width: 44ch; }
.pult-shot figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--ink-2); }

.ui {
  background: var(--ground-2); border-radius: var(--r-lg); padding: 24px;
  display: grid; gap: 12px; font-size: 15px; line-height: 22px;
}
.ui-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 4px; }
.ui-title { font-weight: 600; font-size: 18px; }
.ui-count { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; }
.ui-card { background: var(--ground); border-radius: 8px; padding: 16px 20px; display: grid; gap: 12px; }
.ui-card-main { padding: 20px; gap: 16px; }
.ui-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.ui-card h3 { font-size: 16px; line-height: 24px; }
.tag { flex: none; font-size: 13px; line-height: 18px; padding: 2px 8px; border-radius: 6px; background: var(--ground-2); color: var(--ink-2); font-weight: 500; }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.ui-calc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ui-calc div { background: var(--ground-2); border-radius: 6px; padding: 8px 12px; }
.ui-calc dt { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.ui-calc dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-why { color: var(--ink-2); }
.ui-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ui-btn {
  min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--ground-3); color: var(--ink); font: 600 14px/20px Manrope, system-ui, sans-serif;
  transition: background-color 200ms var(--ease);
}
.ui-btn:hover { background: var(--ground-2); }
.ui-btn-main { background: var(--accent); color: var(--on-accent); }
.ui-btn-main:hover { background: var(--accent-hover); }
.ui-btn[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.ui-result { color: var(--ink); font-weight: 500; }
.ui-result:empty { display: none; }

/* Принцип крупно, слова проявляются при прокрутке; рядом пример ответа */
.say { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center; }
.say-text-wrap { display: grid; gap: 32px; }
.say-text-wrap p { max-width: 44ch; }
.say-text { font-size: clamp(30px, 4.6vw, 68px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; }
.say-text .l { display: block; white-space: nowrap; }
.say-text .w { transition: opacity 600ms var(--ease); }
.say-text .w.dim { opacity: 0.28; }
.say-shot figcaption, .roles-shot figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--ink-2); }
.chat { gap: 16px; }
.msg-me { justify-self: end; max-width: 80%; background: var(--ground-3); padding: 12px 16px; border-radius: 16px 16px 4px 16px; }
.msg-agent { display: grid; gap: 12px; background: var(--ground); padding: 16px 20px; border-radius: 8px; }
.msg-src { color: var(--ink-2); font-size: 14px; line-height: 20px; }
.msg-agent-short { background: var(--ground); padding: 12px 16px; border-radius: 8px; }

/* Роли: фрагмент слева, текст справа */
.roles { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center; }
.roles-text { display: grid; gap: 24px; }
.roles-text p { max-width: 44ch; }
.roles-table { width: 100%; border-collapse: collapse; background: var(--ground); border-radius: 8px; overflow: hidden; }
.roles-table th, .roles-table td { text-align: left; padding: 10px 16px; font-size: 15px; line-height: 22px; }
.roles-table thead th { font-size: 13px; line-height: 18px; color: var(--ink-2); font-weight: 600; }
.roles-table tbody tr:nth-child(odd) { background: var(--ground-2); }
.roles-table tbody th { font-weight: 600; }
.roles-table td { color: var(--ink-2); }
.roles-table td:first-of-type { color: var(--ink); }
.roles-try { display: grid; gap: 8px; }
.roles-try .msg-me { justify-self: end; }

/* Модули: крупный список, по строке на модуль */
.modules-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; margin-bottom: 48px; }
.modules-head p { max-width: 44ch; }
.mod-list li {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr) minmax(0, 1.4fr); gap: 32px; align-items: baseline;
  padding: 20px 24px; margin: 0 -24px; border-radius: var(--r);
}
.mod-list li:nth-child(odd) { background: var(--ground-2); }
.mod-name { font-size: clamp(24px, 3.2vw, 44px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; }
.mod-desc { color: var(--ink); }
.mod-state { justify-self: end; font-size: var(--t-small); color: var(--ink-2); font-weight: 500; white-space: nowrap; }

/* Защита данных: два образца рядом */
.privacy-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px; align-items: end; margin-bottom: 64px; }
.privacy-head p { max-width: 52ch; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spec-box {
  position: relative; overflow: hidden; height: clamp(320px, 34vw, 480px);
  background: var(--ground-2); border-radius: var(--r-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.spec-box figcaption { font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.spec-ui { background: var(--ground); padding: 16px 20px; border-radius: 8px; font-size: 16px; line-height: 24px; position: relative; z-index: 1; }
.spec-word {
  position: absolute; left: 20px; bottom: -0.32em;
  font-size: clamp(88px, 12vw, 200px); line-height: 1; font-weight: 700; letter-spacing: -0.05em; white-space: nowrap;
  color: var(--ink);
}
.spec-inv { background: var(--inv-ground); color: var(--inv-ink); }
.spec-inv figcaption { color: var(--inv-ink-2); }
.spec-inv .spec-ui { background: var(--inv-ink); color: var(--inv-ground); }
.spec-inv .spec-word { color: var(--inv-ink); }

/* Сравнение: таблица без линий, наш столбец залит */
.compare .h2 { margin-bottom: 48px; max-width: 22ch; }
.cmp { display: grid; position: relative; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 4fr); }
.cmp-row > span { padding: 18px 24px; }
.cmp-row:nth-child(even) > span:not(.cmp-us) { background: var(--ground-2); }
.cmp-cap { font-weight: 600; font-size: 18px; }
.cmp-top > span { font-weight: 700; padding-top: 24px; }
.cmp-us { background: var(--accent); color: var(--on-accent); }
.cmp-top .cmp-us { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.cmp-row:last-child .cmp-us { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cmp-top .cmp-cap { background: transparent !important; }

/* Этапы одной полосой */
.how .h2 { margin-bottom: 64px; }
.stages { display: flex; gap: 6px; min-height: 22vh; counter-reset: none; }
.st { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 8px; min-width: 0; }
.st b { font-size: clamp(20px, 2vw, 28px); font-weight: 600; letter-spacing: -0.02em; }
.st span { max-width: 30ch; }
.st-a { flex: 2; background: var(--ground-2); }
.st-b { flex: 2; background: var(--ground-3); }
.st-c { flex: 3; background: var(--accent-soft); }
.st-d { flex: 5; background: var(--accent); color: var(--on-accent); }

/* Где мы сейчас */
.state { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 64px; align-items: start; }
.state-head { display: grid; gap: 24px; }
.state-head p { max-width: 36ch; }
.state-table { border-collapse: collapse; width: 100%; }
.state-table th, .state-table td { text-align: left; vertical-align: top; padding: 18px 24px; border: 0; }
.state-table th { font-weight: 600; width: 32%; }
.state-table tr:nth-child(odd) { background: var(--ground-2); }
.state-table tr:nth-child(odd) th { border-top-left-radius: var(--r); border-bottom-left-radius: var(--r); }
.state-table tr:nth-child(odd) td { border-top-right-radius: var(--r); border-bottom-right-radius: var(--r); }

/* Вопросы: широкий заголовок, вопросы с отступом */
.faq .h2 { margin-bottom: 64px; }
.faq-list { margin-left: 33.333%; display: grid; gap: 8px; }
.faq details { border-radius: var(--r); transition: background-color 200ms var(--ease); }
.faq details[open] { background: var(--ground-2); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 16px 24px; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.35; font-weight: 500;
  border-radius: var(--r);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg); transition: transform 300ms var(--ease);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.faq summary:hover { background: var(--ground-2); }
.faq details p { padding: 0 24px 24px; max-width: 64ch; }

/* Финальный призыв: перевёрнутые цвета */
.close {
  background: var(--accent); color: var(--on-accent);
  min-height: 80svh; display: flex; flex-direction: column; justify-content: space-between; gap: 64px;
  padding-top: clamp(64px, 10vw, 144px); padding-bottom: 48px;
}
.display-2 { font-size: clamp(40px, 7.2vw, 112px); line-height: 0.98; letter-spacing: -0.035em; max-width: 14ch; }
.close-foot { display: flex; justify-content: space-between; align-items: end; gap: 48px; }
.close-foot p { max-width: 44ch; font-size: clamp(17px, 1.4vw, 20px); }

/* Подвал */
.foot { background: var(--inv-ground); color: var(--inv-ink); padding: 96px var(--margin) 32px; overflow: hidden; }
.foot-name { font-size: clamp(40px, 11vw, 176px); line-height: 1; font-weight: 700; letter-spacing: -0.05em; white-space: nowrap; }
.foot-row { display: flex; justify-content: space-between; align-items: start; gap: 32px; margin-top: 64px; flex-wrap: wrap; }
.foot a { color: var(--inv-ink); }
.foot a:hover { color: var(--inv-ink-2); }
.foot-mail { font-size: clamp(22px, 2.4vw, 34px); font-weight: 600; letter-spacing: -0.02em; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; font-size: 15px; }
.foot-links a { text-decoration: none; }
.foot-legal { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-top: 80px; font-size: 13px; line-height: 18px; color: var(--inv-ink-2); }
.foot-legal p { max-width: 70ch; }

/* Появление при прокрутке: только когда скрипт работает */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .display .line > span { transform: translateY(105%); transition: transform 900ms var(--ease); }
.js .display .line:nth-child(2) > span { transition-delay: 110ms; }
.js.loaded .display .line > span { transform: none; }
.js .hero-foot { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease) 350ms, transform 700ms var(--ease) 350ms; }
.js.loaded .hero-foot { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .hero-foot, .js .display .line > span { transform: none !important; transition: opacity 400ms linear; }
  .js .display .line > span { opacity: 1; }
}

/* Планшет */
@media (max-width: 1024px) {
  .bar nav { display: none; }
  .bar-end { margin-left: auto; }
  .pult, .say, .roles { grid-template-columns: 1fr; gap: 40px; }
  .roles-text { order: -1; }
  .pult-text { position: static; }
  .modules-head, .privacy-head { grid-template-columns: 1fr; gap: 24px; }
  .state { grid-template-columns: 1fr; }
  .faq-list { margin-left: 0; }
}

/* Телефон */
@media (max-width: 640px) {
  .bar { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
  .mark span { font-size: 15px; }
  .bar .btn-sm { display: none; }
  .hero { padding-top: 40px; gap: 40px; }
  .display { font-size: 8.4vw; letter-spacing: -0.04em; }
  .say-text { font-size: 8vw; }
  .roles-table { table-layout: fixed; }
  .roles-table th, .roles-table td { padding: 8px 6px; font-size: 13px; line-height: 18px; }
  .roles-table thead th { font-size: 13px; }
  .foot { padding-top: 64px; }
  .hero-foot { grid-template-columns: 1fr; gap: 24px; }
  .lead { font-size: 19px; }
  .hero-act { justify-items: stretch; text-align: left; }
  .hero-act .btn { width: 100%; }
  .ui { padding: 12px; }
  .ui-card, .ui-card-main { padding: 16px; }
  .ui-calc { grid-template-columns: 1fr 1fr; }
  .ui-row { flex-direction: column; gap: 8px; }
  .mod-list li { grid-template-columns: 1fr; gap: 8px; padding: 16px; margin: 0 calc(var(--margin) * -1); border-radius: 0; }
  .mod-state { justify-self: start; }
  .spec { grid-template-columns: 1fr; }
  .spec-box { height: 300px; }
  .spec-word { font-size: 25vw; }
  .cmp-top { display: none; }
  .cmp-row { grid-template-columns: 1fr; margin-bottom: 12px; }
  .cmp-row > span { padding: 12px 16px; }
  .cmp-row > .cmp-cap { padding-bottom: 4px; background: var(--ground-2); border-radius: var(--r) var(--r) 0 0; }
  .cmp-row > span:not(.cmp-cap):not(.cmp-us) { background: var(--ground-2); border-radius: 0 0 var(--r) var(--r); }
  .cmp-row .cmp-us { border-radius: 0 !important; }
  .cmp-row .cmp-us::before { content: "Директор Агент: "; font-weight: 600; }
  .cmp-row > span:not(.cmp-cap):not(.cmp-us)::before { content: "Обычный чат: "; font-weight: 600; }
  .stages { flex-direction: column; }
  .st-a, .st-b { min-height: 96px; }
  .st-c { min-height: 128px; }
  .st-d { min-height: 176px; }
  .state-table, .state-table tbody, .state-table tr, .state-table th, .state-table td { display: block; width: auto; }
  .state-table tr { border-radius: var(--r); }
  .state-table th { padding: 16px 16px 4px; }
  .state-table td { padding: 0 16px 16px; }
  .faq summary { padding: 16px; font-size: 19px; }
  .faq details p { padding: 0 16px 16px; }
  .close-foot { flex-direction: column; align-items: stretch; }
  .close-foot .btn { width: 100%; }
  .foot-legal { flex-direction: column; align-items: start; }
}
