/* ============================================================
   Светлая тема: матовая бумага, графитовая тушь и один зелёный акцент.
   ============================================================ */

/* Шрифт self-hosted (скачан из Google Fonts, раздаётся с нашего домена) */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  /* Две краски: матовая тёплая бумага и графитовая тушь (не чёрная — мягче
     для глаз, контраст 13:1). Третья — приглушённый зелёный акцент: только
     в тексте и мелких деталях, никогда в фонах и заливках. */
  --bg: #f2f0ea;
  --surface: #fbfaf6;
  --ink: #262521;
  --ink-hover: #3d3b36;
  --muted: #67635c;
  --accent: #2a6e4b;
  --cta: #f2c94c;
  --cta-hover: #e6b92e;
  --accent-soft: rgba(42, 110, 75, 0.16);
  --warm: #8a5a32;
  --line: rgba(38, 37, 33, 0.14);
  --line-soft: rgba(38, 37, 33, 0.08);
  /* Бумажное зерно: едва заметный шум делает фон матовым, а не «экранным» */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.14 0 0 0 0 0.12 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --radius: 4px;
  --container: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--grain) repeat, var(--bg);
  background-size: 160px 160px, auto;
  color: var(--ink);
  font: 400 17px/1.62 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Выделение текста — единственное место, где акцент становится заливкой */
::selection { background: var(--accent-soft); }

h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 1.04; font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }
.nb { white-space: nowrap; }
a { color: inherit; text-decoration: none; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

/* На мобильных Safari/Chrome тап подсвечивает элемент серо-голубым прямоугольником —
   с нашим «бумажным» дизайном это выглядит чужеродно. Фокус с клавиатуры при этом
   остаётся: он идёт через :focus-visible и не затрагивается. */
a, button, summary, label, input, textarea, [role="button"], [role="switch"] {
  -webkit-tap-highlight-color: transparent;
}
/* Фокус с клавиатуры — аккуратная рамка в цвет акцента */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.container--narrow { max-width: 760px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--surface); padding: 10px 16px;
}
.skip:focus { left: 0; }

/* Тонкая линия — единственный «разделитель» в дизайне */
.hair { border-top: 1px solid var(--line); }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.header.is-stuck { border-bottom-color: var(--line); }
.header__inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.logo__mark { width: 26px; height: 26px; flex: 0 0 auto; }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.nav a { position: relative; padding-bottom: 2px; white-space: nowrap; transition: color 0.2s ease; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); background: var(--accent); }
.header__actions { display: flex; align-items: center; gap: 10px; }

/* Мобильное меню: круглая кнопка «···» и выдвижная плитка с разделами */
.burger {
  display: none; position: relative; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer;
}
.burger span {
  position: absolute; left: 50%; top: 50%;
  width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor;
}
.burger span:nth-child(1) { transform: translate(-50%, -50%) translateX(-8px); }
.burger span:nth-child(2) { transform: translate(-50%, -50%); }
.burger span:nth-child(3) { transform: translate(-50%, -50%) translateX(8px); }
.burger[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.menu {
  position: absolute; top: 100%; left: 0; right: 0; padding: 4px 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.menu:not([hidden]) { box-shadow: 0 18px 40px rgba(38, 37, 33, 0.07); }
.menu__links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu__links a {
  padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.95rem; color: var(--ink); transition: background 0.2s ease, color 0.2s ease;
}
.menu__links a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (min-width: 1181px) { .menu { display: none; } }

/* ---------- Кнопки: только тушь, без цвета и градиентов ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--surface);
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 13px 24px; font: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn--ghost:hover { background: transparent; border-color: var(--ink); }
.btn--sm { padding: 9px 18px; font-size: 0.88rem; }
.btn--block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: wait; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 3px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-arrow:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(44px, 6.5vw, 88px) 0 clamp(32px, 5vw, 56px); }
.hero__grid { position: relative; }
.hero__content { position: relative; z-index: 1; max-width: 780px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
/* Ширина заголовка ограничена, чтобы на ноутбуке он не заходил на портрет */
.hero h1 { margin: 22px 0 0; max-width: 16ch; }
.hero__lead {
  margin-top: 24px; max-width: 46ch;
  font-size: clamp(1.02rem, 1.5vw, 1.16rem); color: var(--muted); line-height: 1.6;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__price { margin-top: 14px; font-size: 0.92rem; font-weight: 600; color: var(--muted); }

/* Вырезанный портрет с растворёнными краями и мягким ореолом.
   Края растворены прямо в альфе картинки (mockup/make_images.py): снизу и по
   бокам силуэт уходит в прозрачность, поэтому у фотографии нет прямых срезов.
   Подача — большой мягкий круг с полным силуэтом: ноутбук виден, обод
   вырезан в самой картинке (mockup/make_images.py) и притушен по краю. */
.hero__visual {
  position: absolute; right: 0; bottom: 0; z-index: 0;
  width: min(48%, 560px); margin: 0; pointer-events: none;
}
.hero__photo {
  position: relative;
  width: 100%; height: auto; display: block;
  opacity: 0.88;
  /* Дымка вокруг круга: свечение по ободу + широкая мягкая тень снизу.
     drop-shadow строит форму точно по альфе круга — без пятен в CSS. */
  filter: grayscale(1) contrast(1.04)
          drop-shadow(0 0 34px rgba(38, 37, 33, 0.18))
          drop-shadow(0 30px 64px rgba(38, 37, 33, 0.22));
  transition: filter 0.5s ease;
}
.hero__photo:hover { filter: grayscale(1) contrast(1.12); }

.hero__foot {
  margin-top: clamp(32px, 4.5vw, 56px); padding-top: 26px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 64px); align-items: start;
}
.hero__platform {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: 0.86rem; color: var(--muted);
}
.hero__platform-label { flex: 0 0 100%; }
.ya-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.ya-brand strong { font-weight: 700; }
.ya-brand__mark { width: 20px; height: 20px; flex: 0 0 auto; }
.cl-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; }
.cl-brand__mark { width: 20px; height: 20px; flex: 0 0 auto; }

.stats { display: flex; gap: clamp(24px, 4vw, 56px); margin-left: auto; }
.stats__item { min-width: 0; }
.stats dt { font-size: 0.78rem; color: var(--muted); }
.stats dd {
  margin: 4px 0 0; font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  font-weight: 700; letter-spacing: -0.03em;
}

/* ---------- Факты и живой пример под первым экраном ---------- */
.demo { padding: 0 0 clamp(32px, 4vw, 52px); }

/* Три факта: жирный заголовок и под ним спокойное пояснение с воздухом между ними */
.highlights {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.highlights li { padding: 24px 32px 26px 0; }
.highlights li + li { padding-left: 32px; border-left: 1px solid var(--line-soft); }
.highlights strong {
  display: block; font-size: 1.08rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em;
}
.highlights li > span {
  display: block; margin-top: 10px; max-width: 32ch; text-wrap: balance;
  font-size: 0.92rem; line-height: 1.5; color: var(--muted);
}

/* Пример: слева то, что пришло, справа — что сделал агент. Одна причина, два результата */
.demo__title { margin-top: 40px; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.flow {
  display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.3fr);
  align-items: center; margin-top: 16px;
}
.flow--single { grid-template-columns: minmax(0, 560px); }
.flow__col { display: grid; gap: 14px; }
.flow__arrow { display: flex; justify-content: center; color: var(--muted); }
.flow__arrow svg { width: 44px; height: 12px; }

.note {
  padding: 16px 20px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 22px rgba(38, 37, 33, 0.06);
}
.note--agent { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.note__head { display: flex; align-items: center; gap: 10px; min-height: 24px; font-size: 0.82rem; color: var(--muted); }
.note__icon {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 6px; font-size: 0.72rem; font-weight: 700; color: var(--ink);
}
.note__app { font-weight: 600; }
.note--agent .note__icon, .note--agent .note__app { color: var(--accent); }
.note--agent .note__icon { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
/* Статус всегда в шапке карточки, справа: и «срочно», и «готово» читаются как состояние этой карточки */
.note__status { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.note__status--urgent {
  padding: 2px 10px; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: 0.74rem; font-weight: 600;
}
.note__status--done { color: var(--accent); font-weight: 600; }
.note__status svg { width: 15px; height: 15px; flex: 0 0 auto; }
.note h3 { margin-top: 12px; font-size: 1.04rem; }
.note__lines { display: grid; gap: 4px; margin-top: 8px; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.note--agent .note__lines { color: var(--ink); }
.note__lines strong { font-weight: 700; }

/* ---------- Секции ---------- */
.section { padding: clamp(36px, 4.2vw, 60px) 0; }
.section--alt { background: none; }

.section__head {
  border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: clamp(28px, 3.6vw, 44px);
}
.eyebrow {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow__num { color: var(--accent); font-variant-numeric: tabular-nums; }
.section__head h2 { margin-top: 18px; max-width: 26ch; }
.section__sub { margin-top: 16px; max-width: 62ch; color: var(--muted); }

/* Сетки: структура держится на линиях и воздухе, не на рамках */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.card {
  border-top: 1px solid var(--line-soft);
  padding: 24px 28px 26px;
}
.card:nth-child(3n + 1) { padding-left: 0; }
.card:nth-child(3n) { padding-right: 0; }
.card h3 + p, .card h3 + .tags { margin-top: 12px; }
.card p { color: var(--muted); font-size: 0.94rem; line-height: 1.62; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; }
.tags li {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.tags li + li { position: relative; padding-left: 15px; }
.tags li + li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--line);
}

/* Персональный агент */
.personal { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); }
.personal__text { margin-top: 20px; color: var(--muted); max-width: 48ch; }
.personal .btn { margin-top: 28px; }
.personal__list { border-top: 1px solid var(--line); }
.personal__list li {
  padding: 15px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 0.94rem; color: var(--muted);
}
.personal__list li strong { color: var(--ink); font-weight: 700; }

/* Платформы */
.platforms__label {
  border-top: 1px solid var(--line); padding-top: 20px;
  font-size: 0.92rem; font-weight: 600; color: var(--muted); margin-bottom: 8px;
}
/* Детали по каждой платформе свёрнуты: общие принципы видны сразу, остальное — по клику */
.platforms { margin-top: clamp(28px, 3.5vw, 44px); }
.platforms + .platforms { margin-top: 0; }
.platforms:last-of-type { border-bottom: 1px solid var(--line); }
.platforms__summary {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: baseline;
  padding: 22px 0; border-top: 1px solid var(--line); cursor: pointer; list-style: none;
}
.platforms__summary::-webkit-details-marker { display: none; }
.platforms__name { font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 700; letter-spacing: -0.03em; }
.platforms__caption { grid-column: 1; max-width: 56ch; color: var(--muted); font-size: 0.96rem; }
.platforms__more {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap;
  font-size: 0.9rem; font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.platforms__more::after { content: " ↓"; }
.platforms[open] .platforms__more::after { content: " ↑"; }
.platforms__summary:hover .platforms__more { border-color: var(--accent); color: var(--accent); }
.platforms .grid { padding-bottom: 20px; }

/* Процесс */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.step { border-top: 1px solid var(--line); padding: 24px 28px 0 0; }
.step__num {
  display: block; font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
  letter-spacing: -0.05em; color: var(--line); line-height: 1;
}
.step h3 { margin-top: 18px; }
.step p { margin-top: 10px; color: var(--muted); font-size: 0.94rem; }

/* Обо мне */
.about { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 88px); }
.about__text > p { margin-top: 18px; color: var(--muted); max-width: 56ch; }
.about__role { color: var(--ink) !important; font-weight: 600; }
.checklist { margin-top: 26px; border-top: 1px solid var(--line-soft); }
.checklist li {
  display: flex; gap: 12px; padding: 12px 0; font-size: 0.94rem;
  border-bottom: 1px solid var(--line-soft); color: var(--muted);
}
.checklist li::before { content: "—"; color: var(--accent); flex: 0 0 auto; }
.about__stack { border-top: 1px solid var(--line); padding-top: 20px; }
.about__stack h3 { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 18px; }
.chips li { font-size: 0.88rem; color: var(--muted); }
.chips li:not(:last-child)::after { content: ","; }

/* Документы — реестр строками, как FAQ и контакты: слева название, в центре описание,
   справа «Скачать PDF». Кнопки выстраиваются в одну колонку, а длинное описание
   (список модулей) не оставляет дыр в соседних карточках. */
.grid.docs-grid { grid-template-columns: 1fr; gap: 0; border-bottom: 1px solid var(--line); }
.doc {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 14.5rem;
  gap: 14px 48px; align-items: start;
  border-top: 1px solid var(--line); padding: 28px 0 30px;
}
.doc__head { grid-column: 1; }
.doc__text { grid-column: 2; font-size: 0.92rem; color: var(--muted); }
.doc__foot { grid-column: 3; justify-self: end; }
.doc__tag { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.doc h3 { margin-top: 8px; }
.doc__org { margin-top: 6px; font-size: 0.86rem; color: var(--muted); }
.doc__link {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; transition: border-color 0.2s ease;
}
.doc__link:hover { border-color: var(--ink); }
.doc__link svg { width: 16px; height: 16px; flex: 0 0 auto; }
.doc__size { font-weight: 500; color: var(--muted); }
.doc__size::before { content: "·"; margin-right: 9px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); max-width: 820px; }
.faq__item { border-bottom: 1px solid var(--line-soft); }
.faq__item summary {
  display: flex; align-items: center; gap: 16px; padding: 20px 0;
  font-size: 1.02rem; font-weight: 600; cursor: pointer; list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__icon {
  position: relative; margin-left: auto; width: 14px; height: 14px; flex: 0 0 auto;
}
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; background: var(--ink); transition: transform 0.25s var(--ease);
}
.faq__icon::before { left: 0; right: 0; top: 6.5px; height: 1.5px; }
.faq__icon::after { top: 0; bottom: 0; left: 6.5px; width: 1.5px; }
.faq__item[open] .faq__icon::before,
.faq__item[open] .faq__icon::after { background: var(--accent); }
.faq__item[open] .faq__icon::after { transform: scaleY(0); }
.faq__item p { padding: 0 40px 22px 0; color: var(--muted); max-width: 68ch; }

/* Контакты — крупная типографика вместо карточек */
.contacts__price { margin-top: 10px; font-weight: 600; }
.contacts { border-top: 1px solid var(--line); }
.contacts__item {
  display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap;
  padding: 22px 0; border-bottom: 1px solid var(--line-soft);
}
.contacts__item span { flex: 0 0 110px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.contacts__item strong {
  font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -0.03em;
  border-bottom: 2px solid transparent; transition: border-color 0.25s var(--ease);
}
.contacts__item:hover strong { border-bottom-color: var(--accent); }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); margin-top: clamp(36px, 4.5vw, 56px); }
.footer__inner {
  display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between;
  padding: 28px 32px 40px; font-size: 0.86rem; color: var(--muted);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer a:hover { color: var(--ink); }

/* ---------- Чат консультанта ---------- */
.chat { position: fixed; right: 24px; bottom: 24px; z-index: 60; }
.chat__toggle {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--surface); border: none; cursor: pointer;
  box-shadow: 0 10px 28px rgba(38, 37, 33, 0.18);
  transition: transform 0.25s var(--ease);
}
.chat__toggle:hover { transform: translateY(-2px); }

/* Подсказка у кнопки чата — вместо самооткрытия окна */
.chat__nudge {
  position: absolute; right: 68px; bottom: 6px; display: flex; align-items: flex-start; gap: 4px;
  width: max-content; max-width: min(260px, calc(100vw - 110px));
  padding: 10px 6px 10px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(38, 37, 33, 0.12);
  animation: nudge-in 0.4s var(--ease);
}
.chat__nudge[hidden] { display: none; }
.chat__nudge-text {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 0.88rem; line-height: 1.4; color: var(--ink);
}
.chat__nudge-text:hover { color: var(--accent); }
.chat__nudge-close {
  padding: 0 4px; border: 0; background: none; cursor: pointer;
  font-size: 1.1rem; line-height: 1; color: var(--muted);
}
@keyframes nudge-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Кнопка «Наверх» — справа; если чат включён, стоит над ним, а не поверх */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(38, 37, 33, 0.12);
  transition: transform 0.25s var(--ease), border-color 0.2s ease;
}
.to-top--above-chat { bottom: 92px; }
.to-top:hover { transform: translateY(-2px); border-color: var(--ink); }
.to-top[hidden] { display: none; }
/* Пока открыт чат, «Наверх» прячется: иначе на телефоне он выглядывает из-за окна консультанта */
body:has(.chat__panel:not([hidden])) .to-top { display: none; }
/* Окно консультанта — «матовое стекло» в духе Material 3: полупрозрачная бумага с размытием,
   крупные скругления, ответы агента разбиты на абзацы и списки. Акцент — только маркеры и точки. */
.chat__panel {
  position: absolute; right: 0; bottom: 72px; width: min(400px, calc(100vw - 48px));
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 22px;
  box-shadow: 0 0 0 1px var(--line-soft), 0 28px 64px rgba(38, 37, 33, 0.18);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: bottom right; animation: chat-in 0.32s var(--ease);
}
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.chat__panel[hidden] { display: none; }
.chat__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 14px 14px 20px; border-bottom: 1px solid var(--line-soft);
}
.chat__head strong { display: flex; align-items: center; gap: 10px; font-size: 0.98rem; letter-spacing: -0.01em; }
.chat__head strong::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.chat__close {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.chat__close:hover { color: var(--ink); background: rgba(38, 37, 33, 0.06); }
.chat__body {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 16px; height: 380px; overflow-y: auto; overscroll-behavior: contain;
}
.chat__msg {
  max-width: 88%; padding: 12px 16px; border-radius: 18px;
  font-size: 0.93rem; line-height: 1.6; overflow-wrap: anywhere;
  animation: msg-in 0.28s var(--ease);
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat__msg--bot {
  background: rgba(255, 255, 255, 0.72); color: var(--ink);
  border: 1px solid var(--line-soft); border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(38, 37, 33, 0.05);
}
.chat__msg--user {
  background: var(--ink); color: var(--surface); margin-left: auto; border-bottom-right-radius: 6px;
}
/* Разметка ответа: абзацы с воздухом, списки с зелёными маркерами, жирное — графитом */
.chat__text > * + * { margin-top: 14px; }
.chat__text > ul, .chat__text > ol { margin-top: 8px; }
.chat__text > h4 + * { margin-top: 6px; }
.chat__text h4 {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); padding-top: 10px; border-top: 1px solid var(--line-soft);
}
.chat__text > h4:first-child { padding-top: 0; border-top: 0; }
.chat__text strong { font-weight: 700; color: var(--ink); }
.chat__text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em;
  padding: 1px 5px; border-radius: 4px; background: rgba(38, 37, 33, 0.06); color: var(--warm);
}
/* Контакты: цветом, без кавычек; клик копирует, ссылка открывается */
.chat__link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.chat__link:hover { text-decoration-color: var(--accent); }
.chat__chip {
  position: relative; display: inline; padding: 0; border: 0; background: none;
  font: inherit; font-weight: 700; color: var(--accent); cursor: copy;
  border-bottom: 1px dashed var(--accent-soft); transition: border-color 0.2s ease;
}
.chat__chip--phone { color: var(--warm); border-bottom-color: rgba(150, 90, 50, 0.25); }
.chat__chip:hover { border-bottom-color: currentColor; }
.chat__chip::after {
  content: "Скопировано"; position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translate(-50%, 4px); padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  font-size: 0.72rem; font-weight: 600; color: var(--surface); background: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s var(--ease);
}
.chat__chip.is-copied::after { opacity: 1; transform: translate(-50%, 0); }
.chat__text ul, .chat__text ol { padding-left: 20px; }
.chat__text ul { list-style: none; padding-left: 16px; }
.chat__text li { position: relative; }
.chat__text li + li { margin-top: 5px; }
.chat__text ul li::before {
  content: ""; position: absolute; left: -14px; top: 0.66em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.chat__text ol { list-style: decimal; }
.chat__text ol li::marker { color: var(--accent); font-weight: 700; }
/* Копирование — маленькая кнопка под ответом */
.chat__copy {
  display: flex; align-items: center; justify-content: center; margin: 8px 0 -4px auto;
  width: 28px; height: 28px; border-radius: 50%; border: 0; background: none;
  color: var(--muted); cursor: pointer; opacity: 0.7;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.chat__copy:hover { opacity: 1; color: var(--ink); background: rgba(38, 37, 33, 0.06); }
.chat__copy.is-done { opacity: 1; color: var(--accent); }
/* «Думаю…» мягко пульсирует, ошибка — тёплый оттенок вместо серого */
.chat__msg--bot.typing { color: var(--muted); animation: msg-in 0.28s var(--ease), think 1.4s ease-in-out infinite; }
@keyframes think { 50% { opacity: 0.55; } }
.chat__msg--bot.error { background: rgba(250, 240, 232, 0.85); border-color: rgba(150, 90, 50, 0.22); }
.chat__form {
  display: flex; align-items: flex-end; gap: 8px; margin: 0 12px 12px; padding: 6px 6px 6px 16px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line-soft); border-radius: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat__form:focus-within { border-color: var(--line); box-shadow: 0 0 0 4px rgba(38, 37, 33, 0.05); }
.chat__form textarea {
  flex: 1 1 auto; resize: none; border: none; background: none; font: inherit; padding: 8px 0;
  font-size: 0.94rem; line-height: 1.45; max-height: 100px; outline: none; color: var(--ink);
}
.chat__form button {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; padding: 0;
  background: var(--ink); color: var(--surface); border: none; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s ease;
}
.chat__form button:hover { background: var(--ink-hover); transform: scale(1.05); }
.chat__msg--warn { background: rgba(250, 240, 232, 0.85); }
@media (prefers-reduced-motion: reduce) {
  .chat__panel, .chat__msg, .chat__msg--bot.typing { animation: none; }
}

/* ---------- Режимы чтения: «Простым языком» (по умолчанию) и «Технические детали» ---------- */
html[data-mode="simple"] [data-aud="pro"],
html[data-mode="pro"] [data-aud="simple"] { display: none !important; }

/* Смена режима: уходящий текст гаснет, новый проявляется с лёгким подъёмом (лесенкой — через --d) */
[data-aud] {
  transition: opacity 0.24s ease, transform 0.5s var(--ease);
  transition-delay: var(--d, 0ms);
}
html.mode-out [data-aud] { opacity: 0; transform: translateY(10px); transition-delay: 0ms; }


/* Переключатель: таблетка в углу экрана со свитчем в духе Material 3 — трек и бегунок,
   во включённом положении бегунок растёт и получает галочку. Заливка — графит, не акцент. */
.mode { position: fixed; left: 24px; bottom: 24px; z-index: 40; }
.mode__switch {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 10px 10px 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(38, 37, 33, 0.10);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.mode__switch:hover { border-color: color-mix(in srgb, var(--ink) 26%, transparent); box-shadow: 0 14px 36px rgba(38, 37, 33, 0.14); }
.mode__text { display: grid; line-height: 1.25; }
.mode__title { font-size: 0.86rem; font-weight: 700; letter-spacing: -0.01em; }
.mode__hint { font-size: 0.74rem; color: var(--muted); }
.mode__label { display: none; }
.mode__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mode__track {
  position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px;
  border: 2px solid var(--muted); background: transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.mode__thumb {
  position: absolute; top: 50%; left: 6px; width: 16px; height: 16px; margin-top: -8px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--muted); color: var(--ink);
  transition: left 0.32s var(--ease), width 0.32s var(--ease), height 0.32s var(--ease),
    margin 0.32s var(--ease), background-color 0.25s ease, box-shadow 0.25s ease;
}
.mode__thumb svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.4); transition: opacity 0.2s ease, transform 0.32s var(--ease); }
.mode__switch:hover .mode__thumb { box-shadow: 0 0 0 9px rgba(38, 37, 33, 0.07); }
.mode__switch:active .mode__thumb { left: 0; width: 28px; height: 28px; margin-top: -14px; }
.mode__input:checked + .mode__track { background: var(--ink); border-color: var(--ink); }
.mode__input:checked + .mode__track .mode__thumb { left: 20px; width: 24px; height: 24px; margin-top: -12px; background: var(--surface); }
.mode__input:checked + .mode__track .mode__thumb svg { opacity: 1; transform: none; }
.mode__switch:active .mode__input:checked + .mode__track .mode__thumb { left: 18px; width: 28px; height: 28px; margin-top: -14px; }
.mode__input:focus-visible + .mode__track { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Открытый чат важнее: таблетка уходит, чтобы не наслаиваться на окно консультанта */
.mode { transition: opacity 0.2s ease, transform 0.3s var(--ease); }
body:has(.chat__panel:not([hidden])) .mode { opacity: 0; transform: translateY(12px); pointer-events: none; }
/* Таблетка не должна закрывать подвал в самом конце страницы */
body:has(.mode) .footer__inner { padding-bottom: 96px; }

@media (prefers-reduced-motion: reduce) {
  [data-aud], .mode__thumb, .mode__thumb svg { transition: none; }
}

/* Появление при скролле.
   В мокапе анимация выключена — контент виден сразу, чтобы оценивать вёрстку.
   В проекте вернём: main.js уже умеет .reveal + .is-visible, для этого
   достаточно раскомментировать блок ниже. */
/*
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
*/
.reveal { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
/* Семь пунктов меню в строку помещаются только на широком экране */
@media (max-width: 1180px) {
  .nav { display: none; }
  .header__actions { margin-left: auto; }
  .burger { display: inline-flex; }
}
@media (max-width: 980px) {
  .personal, .about { grid-template-columns: 1fr; }
  /* На узких экранах наложение убираем: фото уходит под текст */
  .hero__grid { display: flex; flex-direction: column; }
  .hero__content { order: 1; }
  .hero__visual {
    position: static; order: 2; width: min(64%, 300px); margin: 28px 0 0;
  }
  .hero__foot { grid-template-columns: 1fr; }
  .stats { margin-left: 0; }
  .grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .flow__arrow { height: 48px; align-items: center; }
  .flow__arrow svg { transform: rotate(90deg); }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 24px 0 26px; }
  .doc__head, .doc__text, .doc__foot { grid-column: 1; }
  .doc__foot { justify-self: start; margin-top: 6px; }
  .step { padding-bottom: 28px; }
  .personal__text { margin-top: 0; }
  .card:nth-child(3n + 1), .card:nth-child(3n) { padding-left: 22px; padding-right: 22px; }
  .card:nth-child(2n + 1) { padding-left: 0; }
  .card:nth-child(2n) { padding-right: 0; }
}
@media (max-width: 620px) {
  .container, .footer__inner { padding-left: 20px; padding-right: 20px; }
  .menu__links { grid-template-columns: 1fr; }
  .grid, .steps { grid-template-columns: 1fr; }
  .docs-grid { gap: 32px 0; }
  /* Две кнопки первого экрана — одной ширины, друг под другом */
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .highlights { grid-template-columns: 1fr; }
  .highlights li { padding: 18px 0 20px; }
  .highlights li + li { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); }
  .highlights li > span { max-width: none; }
  .platforms__summary { grid-template-columns: 1fr; }
  .platforms__more { grid-column: 1; grid-row: auto; justify-self: start; }
  .card, .card:nth-child(2n + 1), .card:nth-child(2n) { padding-left: 0; padding-right: 0; }
  /* На телефоне угол занят чатом и его подсказкой: свитч стоит вертикально у правого края,
     без таблетки вокруг, а «Детали» написано прямо на дорожке. Высота — от «малого» экрана
     (svh): она не меняется, когда браузер прячет адресную строку, поэтому свитч не прыгает. */
  .mode { left: auto; right: 10px; bottom: auto; top: 58vh; top: 58svh; transform: translateY(-50%); }
  .mode__switch, .mode__switch:hover {
    padding: 0; gap: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .mode__text { display: none; }
  .mode__track {
    width: 34px; height: 104px; border-radius: 17px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(38, 37, 33, 0.12);
  }
  .mode__label {
    display: block; position: absolute; left: 50%; top: 10px; height: 60px;
    writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg);
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    text-align: center; color: var(--muted);
    transition: top 0.32s var(--ease), color 0.25s ease;
  }
  /* Бегунок ездит снизу вверх: внизу — выключено, вверху — включено */
  .mode__thumb, .mode__switch:active .mode__thumb {
    left: 7px; top: 77px; width: 16px; height: 16px; margin-top: 0;
    transition: top 0.32s var(--ease), left 0.32s var(--ease), width 0.32s var(--ease),
      height 0.32s var(--ease), background-color 0.25s ease, box-shadow 0.25s ease;
  }
  .mode__switch:hover .mode__thumb { box-shadow: none; }
  .mode__input:checked + .mode__track .mode__thumb,
  .mode__switch:active .mode__input:checked + .mode__track .mode__thumb {
    left: 3px; top: 3px; width: 24px; height: 24px; margin-top: 0;
  }
  .mode__input:checked + .mode__track .mode__label { top: 32px; color: var(--surface); }
  body:has(.chat__panel:not([hidden])) .mode { transform: translate(100%, -50%); }
  body:has(.mode) .footer__inner { padding-bottom: 104px; }
  .chat { right: 16px; bottom: 16px; }
  .to-top { right: 16px; bottom: 16px; }
  .to-top--above-chat { bottom: 84px; }
  /* Плавающие «наверх» и чат не должны закрывать подвал в конце страницы */
  .footer__inner { padding-bottom: 104px; }
  /* Контакты: подпись всегда над значением, длинная почта переносится */
  .contacts__item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .contacts__item span { flex: none; }
  .contacts__item strong { overflow-wrap: anywhere; }
  /* «Обсудить задачу» в шапке — всегда в одну строку, иначе кнопка раздувается */
  .header__actions .btn--sm {
    padding: 8px 14px; font-size: 0.8rem; white-space: nowrap;
  }
  .header__inner { gap: 12px; }
  .logo__text { font-size: 0.95rem; }
}
@media (max-width: 380px) {
  /* Совсем узкие экраны: имя в шапке уступает место кнопке */
  .logo__text { display: none; }
  .header__actions .btn--sm { padding: 8px 12px; font-size: 0.76rem; }
}


/* ---------- Страница политики и 404 ---------- */
.policy h1 { font-size: clamp(1.8rem, 5vw, 3.2rem); line-height: 1.08; hyphens: auto; }
.policy__body { margin-top: 28px; max-width: 68ch; }
.policy__body p { margin: 0 0 16px; line-height: 1.65; }
.policy__body p:last-child { margin-bottom: 0; }
.policy__lead { font-size: 1.08rem; color: var(--ink); }
.policy__head {
  display: flex; gap: 12px; align-items: baseline;
  margin: 34px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.3; letter-spacing: -0.015em;
}
.policy__num { color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.policy__back { margin-top: 44px; }
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 14px; }
.notfound .btn { margin-top: 28px; }

/* Реферальная регистрация Cloud.ru */
.referral-wrap { padding: 8px 0 40px; }
.referral {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  justify-items: start;
}
.referral h3 { margin: 0 0 8px; }
.referral p { margin: 0; max-width: 60ch; }
.referral__help { color: var(--muted); font-size: 0.92rem; }
.referral__help a { color: var(--accent); }
@media (max-width: 640px) { .referral .btn { width: 100%; justify-content: center; } }
.btn--accent { background: var(--cta); border-color: var(--cta); color: var(--ink); }
.btn--accent:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
