/* Оформление повторяет прежний сайт на Kubio: палитра, шрифт Mulish, квадратные кнопки
   с прописными буквами, синие линейки под заголовками, тёмные фоновые фото с затемнением.
   Шрифт лежит на своём сервере — запросов к Google Fonts нет. */
@font-face { font-family: "Mulish"; src: url("/static/fonts/mulish-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Mulish"; src: url("/static/fonts/mulish-latin-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215; }

:root {
  /* палитра прежнего сайта (kubio-color-1 … 6) */
  --c1: #4146f3;        /* основной синий: линейки, ссылки, значки */
  --c1-dark: #2a2d9d;
  --c1-pale: #e3e3f2;
  --c2: #6065ff;        /* кнопки */
  --c2-dark: #3f43a9;
  --c4: #16e2af;        /* бирюзовый акцент */
  --white: #ffffff;
  --ink: #26262c;       /* заголовки */
  --text: #17172b;      /* основной текст */
  --muted: #6f6f80;
  --line: #cccccc;
  --tint: rgba(38, 38, 44, 0.04);
  --err: #c62828;

  --font: "Mulish", Helvetica, Arial, sans-serif;
  --section: clamp(3.5rem, 8vw, 5.625rem);   /* 90px, как в оригинале */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--text); font: 300 16px/1.5 var(--font); }
h1, h2, h3, p, ul, dl, dd, figure, table { margin: 0; }
h1, h2, h3 { font-family: var(--font); color: var(--ink); text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(2.6rem, 1.2rem + 5.4vw, 5.5rem); line-height: 1.26; }
h2 { font-weight: 700; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.15; }
h3 { font-weight: 500; font-size: 1.4rem; line-height: 1.4; }
a { color: var(--c1); font-weight: 600; text-decoration: none; }
a:hover { color: var(--c1-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; }
.dark :focus-visible, .hero :focus-visible, .top--over:not(.is-stuck) :focus-visible { outline-color: var(--white); }

.wrap { width: min(100% - 2.5rem, 1232px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--white); padding: 0.5rem 1rem; z-index: 50; }
.skip:focus { top: 1rem; }
.lead { font-weight: 400; font-size: 1.2rem; line-height: 1.5; color: var(--ink); }
.lead--center { max-width: 50rem; margin-inline: auto; }
.note { font-size: 0.875rem; color: var(--muted); }

/* синяя линейка под заголовком */
.rule { width: 25%; max-width: 9rem; border-bottom: 4px solid var(--c1); margin-block: 1.1rem 1.4rem; }
.rule--short { width: 20%; }
.rule--center { width: 150px; max-width: none; margin-inline: auto; }

/* --- Кнопки: квадратные, прописные, с разрядкой ----------------------- */
.btn { display: inline-flex; justify-content: center; align-items: center; font: 400 14px/1 var(--font); letter-spacing: 1px; text-transform: uppercase; text-decoration: none; color: var(--white); background: var(--c2); border: 1px solid var(--c2); border-radius: 0; padding: 20px 40px; cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.btn:hover { background: var(--c2-dark); border-color: var(--c2-dark); color: var(--white); }
.btn--ghost { background: rgba(38, 38, 44, 0.2); border-color: var(--white); }
.btn--ghost:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.btn--submit { background: var(--c1); border-color: var(--c1); padding: 12px 30px; }
.btn--submit:hover { background: var(--c1-dark); border-color: var(--c1-dark); }
.btn--quiet { background: var(--white); color: var(--ink); border-color: var(--ink); padding: 12px 24px; }
.btn--quiet:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.actions--center { justify-content: center; }
.actions--stack { flex-direction: column; align-items: stretch; gap: 0.75rem; max-width: 24rem; }
.btn--outline { background: var(--white); color: var(--c1); border-color: var(--c1); padding: 12px 30px; }
.btn--outline:hover { background: var(--c1); border-color: var(--c1); color: var(--white); }
.contact__direct { display: flex; flex-direction: column; justify-content: center; gap: 0.5rem; }
.contact__direct .note { margin-top: 1.25rem; font-weight: 400; }
.contact__direct .note a { font-weight: 400; text-decoration: underline; }
.more { text-decoration: underline; text-underline-offset: 0.2em; }
.linklike { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* --- Шапка: прозрачная поверх первого экрана, белая при прокрутке ----- */
.top { position: sticky; top: 0; z-index: 30; background: var(--white); box-shadow: 0 0 10px rgba(23, 25, 39, 0.1); }
.top--over { position: fixed; top: 0; left: 0; right: 0; background: transparent; box-shadow: none; transition: background-color 0.25s, box-shadow 0.25s; }
.top--over.is-stuck { background: var(--white); box-shadow: 0 0 10px rgba(23, 25, 39, 0.1); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 30px; transition: padding 0.25s; }
.top.is-stuck .top__row { padding-block: 10px; }
.top__name { font-weight: 700; font-size: 24px; color: var(--ink); }
.top__nav { display: flex; flex-wrap: wrap; gap: 0.25rem 2.25rem; }
.top__nav a { font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--ink); padding-block: 10px; position: relative; }
.top__nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform 0.2s; }
.top__nav a:hover::after, .top__nav a:focus-visible::after { transform: scaleX(1); }
.top--over:not(.is-stuck) .top__name, .top--over:not(.is-stuck) .top__nav a, .top--over:not(.is-stuck) .top__toggle { color: var(--white); }
.top__toggle { display: none; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; line-height: 0; }

/* --- Первый экран ------------------------------------------------------ */
/* 200px сверху, как в оригинале, плюс высота шапки: Kubio добавлял её скриптом */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 290px 0 250px; text-align: center; color: var(--white);
  background: radial-gradient(60rem 40rem at 70% 20%, rgba(65, 70, 243, 0.45), transparent 60%), linear-gradient(160deg, #08082b, #131548 55%, #17172b); }
/* затемнение как в оригинале: цвет #26262C с непрозрачностью 0.7 */
.hero--img { background: linear-gradient(rgba(38, 38, 44, 0.7), rgba(38, 38, 44, 0.7)), url("/static/img/fon-1.png") 40% 18% / cover no-repeat fixed; background-color: #1b1c20; }
.hero h1 { color: var(--white); }
.hero__inner { max-width: 1000px; }
.hero__lead { font-size: 20px; line-height: 1.4; max-width: 1060px; margin: 3rem auto 0; }
.hero .actions { margin-top: 40px; }

/* --- Обычные разделы ---------------------------------------------------- */
.block { padding-block: var(--section); }
.block--center { text-align: center; }
.block p + p { margin-top: 1rem; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--flip .split__media { order: -1; }
.split__text .lead { margin-bottom: 1rem; }

.photo { display: block; width: 100%; height: auto; border-radius: 3px; }
.photo--card { aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 1.25rem; background: #eeeefa; }
.photo--wide { aspect-ratio: 1000 / 712; object-fit: cover; }
/* снимок панели аналитики: скруглённая рамка с тенью, как на прежнем сайте */
.photo--screen { border-radius: 12px; box-shadow: 0 1.25rem 3rem -1.25rem rgba(38, 38, 44, 0.35); }
.photo--empty { display: grid; place-items: center; background: var(--c1-pale); }
.photo--empty svg { width: 3rem; height: 3rem; fill: var(--c1); opacity: 0.35; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 3vw, 2.5rem); margin-top: 3rem; text-align: left; }
.cards--center { text-align: center; }
.card h3 { margin-bottom: 0.6rem; }
.card p + p { margin-top: 0.9rem; }
.card__icon { display: inline-block; margin-bottom: 1rem; }
.card__icon svg { width: 50px; height: 50px; fill: var(--c1); }
.card--case { background: var(--tint); padding: 1.75rem; }

/* две половины во всю ширину: фото и серая плашка с текстом */
.half { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.half__media { min-height: 600px; background: linear-gradient(135deg, var(--c1-pale), #c9caf0); }
.half__media--telegram { background: #e9e4dc url("/static/img/telegram.svg") 50% 40% / cover no-repeat; }
.half__media--excel { background: #1b6b3f url("/static/img/excel.svg") 50% 50% / cover no-repeat; }
.half__text { background: var(--tint); padding: clamp(2rem, 9vw, 9rem); display: flex; flex-direction: column; justify-content: center; }
.half__text > * + * { margin-top: 1rem; }
.half__text .rule { margin-block: 1.1rem 0.4rem; }
.half--flip .half__media { order: 2; }

.ticks { list-style: none; padding: 0; }
.ticks li { padding: 0.25rem 0 0.25rem 1.7rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0.15rem; top: 0.65em; width: 0.75rem; height: 0.4rem; border-left: 2px solid var(--c1); border-bottom: 2px solid var(--c1); transform: rotate(-45deg); }

/* --- Тёмные разделы с фото --------------------------------------------- */
.dark { position: relative; padding-block: var(--section); color: var(--white); background: linear-gradient(160deg, #17172b, #08082b); }
.dark--img { background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), #0e0f17 url("/static/img/dark-bg.svg") 50% 50% / cover no-repeat; }
.dark--fixed.dark--img { background-attachment: fixed; }
.dark__inner { text-align: center; }
.dark__inner h2 { color: var(--white); }
.dark__inner p { margin-top: 1rem; }

/* --- Счётчики ------------------------------------------------------------ */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem 1.5rem; margin-top: 3rem; }
.counter { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.counter dt { min-height: 4.2em; display: flex; align-items: flex-end; font-weight: 400; font-size: 0.9rem; line-height: 1.4; letter-spacing: 1px; text-transform: uppercase; color: var(--c1); max-width: 16rem; }
.counter dd { font-weight: 300; font-size: 3.5rem; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }

/* --- Контакты: белая карточка на тёмном фото ---------------------------- */
.contact { background: var(--white); color: var(--text); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 5vw, 4rem); padding: clamp(1.5rem, 4vw, 3.5rem); }
.contact__list { list-style: none; padding: 0; margin-top: 1.5rem; }
.contact__list li { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 18px; color: var(--ink); padding-block: 12px; border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
.contact__list li:first-child { border-top: 1px solid rgba(0, 0, 0, 0.12); }
.contact__list a { color: var(--ink); font-weight: 400; }
.contact__list a:hover { color: var(--c1); }
.contact__icon { line-height: 0; }
.contact__icon svg { width: 30px; height: 30px; fill: var(--c1); }
/* --- Живая диаграмма (на месте картинки из шаблона) ---------------------- */
.demo { background: var(--white); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 1.5rem 3rem -1.5rem rgba(65, 70, 243, 0.35); text-align: left; overflow: hidden; }
.demo table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.demo th, .demo td { border: 1px solid #e3e3ea; padding: 0; text-align: left; height: 2.35rem; }
.demo thead th { background: var(--c1-pale); font-weight: 600; color: var(--ink); padding: 0 0.6rem; border-top: 0; }
.demo tbody th { font-weight: 500; padding: 0 0.6rem; }
.demo tr > :first-child { border-left: 0; }
.demo tr > :last-child { border-right: 0; }
.demo input { width: 100%; height: 2.35rem; border: 0; background: transparent; font: inherit; color: inherit; padding: 0 0.6rem; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.demo input::-webkit-inner-spin-button, .demo input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.demo input:hover { background: #f4f4fb; }
.demo input:focus { outline: 2px solid var(--c1); outline-offset: -1px; background: var(--white); }
.demo__done { min-width: 8rem; }
.demo__done > div { display: grid; grid-template-columns: 1fr 3.2em; align-items: center; gap: 0.5rem; padding: 0 0.6rem; }
.demo__done output { text-align: right; }
.demo__done.is-low output { color: var(--err); font-weight: 700; }
.demo__chart { padding: 1rem 0.9rem 0.25rem; }
.demo__chart svg { display: block; width: 100%; height: auto; }
.demo__chart .bar-plan { fill: var(--c1-pale); }
.demo__chart .bar-fact { fill: var(--c1); transition: y 0.25s ease, height 0.25s ease; }
.demo__chart .bar-fact.is-low { fill: var(--c4); }
.demo__chart text { font: 500 10px var(--font); fill: var(--muted); text-anchor: middle; }
.demo__kpi { font-weight: 600; color: var(--ink); padding: 0.4rem 0 0.6rem; }
.demo figcaption { font-size: 0.875rem; color: var(--muted); padding: 0.6rem 0.9rem; border-top: 1px solid #e3e3ea; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 0.7rem; border: 0; background: transparent; color: var(--c1); display: block; }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--c1); }
progress::-moz-progress-bar { background: var(--c1); }
.is-low progress { color: var(--c4); }
.is-low progress::-webkit-progress-value { background: var(--c4); }
.is-low progress::-moz-progress-bar { background: var(--c4); }

/* --- Подвал: белый, по центру, как в оригинале --------------------------- */
.foot { background: var(--white); color: var(--muted); font-size: 0.875rem; font-weight: 400; padding-block: 2.5rem; border-top: 1px solid #ececf2; }
.foot a, .foot .linklike { color: var(--c1); font-weight: 400; }
.foot__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.foot__title { color: var(--ink); font-weight: 700; margin-bottom: 0.5rem; }
.foot__links { list-style: none; padding: 0; }
.foot__links li + li { margin-top: 0.35rem; }
.foot__note p + p { margin-top: 0.75rem; }

/* --- Окно выбора по cookie ------------------------------------------------ */
.cookie { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-width: 44rem; margin-inline: auto; background: var(--white); box-shadow: 0 0 24px rgba(23, 25, 39, 0.25); padding: 1.1rem 1.25rem; font-size: 0.9rem; font-weight: 400; z-index: 40; display: grid; gap: 0.9rem; }
.cookie__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cookie .btn { flex: 1 1 10rem; }   /* кнопки равнозначны: отказаться не труднее, чем согласиться */

/* --- Документы ------------------------------------------------------------- */
.doc { padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--section); max-width: 52rem; font-weight: 400; }
.doc h1 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.4rem); }
.doc h1::after { content: ""; display: block; width: 9rem; border-bottom: 4px solid var(--c1); margin-top: 1rem; }
.doc h2 { font-size: 1.3rem; font-weight: 700; margin-top: 2.25rem; }
.doc p, .doc ul, .doc .scroll { margin-top: 0.9rem; }
.doc ul { padding-left: 1.25rem; }
.doc li + li { margin-top: 0.4rem; }
.doc__meta { color: var(--muted); font-size: 0.875rem; }
.scroll { overflow-x: auto; }
.doc__table { border-collapse: collapse; font-size: 0.875rem; min-width: 40rem; }
.doc__table th, .doc__table td { border: 1px solid #dcdce6; padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
.doc__table th { background: var(--c1-pale); font-weight: 700; color: var(--ink); }
code { font-size: 0.92em; background: var(--c1-pale); padding: 0.05em 0.3em; }

/* --- Узкие экраны ------------------------------------------------------------ */
@media (max-width: 1023px) {
  .hero { padding: 180px 0 200px; }
  .top__row { padding-block: 20px; }
  .half__text { padding: 30px; }
  .half__media { min-height: 420px; }
}
@media (max-width: 767px) {
  .hero { min-height: 0; padding: 120px 0 110px; }
  .hero__lead { font-size: 16px; margin-top: 1.5rem; }
  .hero--img, .dark--fixed.dark--img { background-attachment: scroll; }   /* фиксированный фон на телефонах дёргается */
  .hero--img { background-position: 39% 16%; }
  .split, .half, .contact, .cards, .foot__grid { grid-template-columns: minmax(0, 1fr); }
  #automation { text-align: left; }
  #automation .rule--center { margin-inline: 0; }
  #automation .lead--center { margin-inline: 0; }
  .split--flip .split__media, .half--flip .half__media { order: 0; }
  .half__media { min-height: 300px; }
  .half__text { padding: 20px; padding-block: 2.5rem; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { padding: 16px 28px; }
  .foot__grid { text-align: center; }

  /* меню: тёмная выезжающая панель, как в оригинале */
  .js .top__toggle { display: block !important; }
  .js .top__nav { position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 85vw); background: var(--ink); flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 80px 0 20px; transform: translateX(100%); transition: transform 0.25s; visibility: hidden; z-index: 35; }
  .js .top__nav.is-open { transform: none; visibility: visible; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5); }
  .js .top .top__nav a { color: var(--white) !important; padding: 12px 20px; }
  .js .top__nav a::after { display: none; }
  .js .top__nav a:hover { background: var(--c1); }
  .js .top__toggle { position: relative; z-index: 36; }
  .js .top__toggle[aria-expanded="true"] { color: var(--white) !important; }
  html:not(.js) .top__row { flex-wrap: wrap; }
}
@media (max-width: 30rem) {
  .counters { grid-template-columns: minmax(0, 1fr); }
  .demo__done { min-width: 0; }
  .demo__done > div { grid-template-columns: 1fr; }
  .demo__done progress { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .hero--img, .dark--fixed.dark--img { background-attachment: scroll; }
}
