/* ============================================================
   ЦИРТ / crm-builder.ru — дизайн-система
   Тёмный tech: глубокий сине-чёрный фон, cyan+violet акценты,
   моноширинные метки, тонкие линии, схематика.
   ============================================================ */

:root {
  --bg: #f7f9fc;
  --bg-raise: #eef2f8;
  --surface: #ffffff;
  --line: #e2e8f1;
  --line-strong: #c9d3e2;
  --text: #101727;
  --muted: #56627a;
  --faint: #8a95aa;

  --accent: oklch(0.52 0.12 220);         /* глубокий cyan-blue */
  --accent-2: oklch(0.54 0.15 295);       /* violet */
  --accent-dim: oklch(0.52 0.12 220 / 0.08);
  --accent-ink: #ffffff;                  /* текст на акцентной заливке */

  --font-display: "Unbounded", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 10px;
  --container: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Типографика ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.18; letter-spacing: -0.01em; }

.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.kicker::before { content: "//"; color: var(--faint); }

.lead { color: var(--muted); font-size: 19px; max-width: 56ch; text-wrap: pretty; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 15px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-arrow::after { content: "→"; font-family: var(--font-body); transition: transform 0.18s ease; }
.btn-arrow:hover::after { transform: translateX(4px); }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 36px;
  height: 72px;
}
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-mark { display: block; }
.logo-name { font-family: var(--font-display); font-size: 17px; font-weight: 500; letter-spacing: 0.02em; }
.logo-sub { font-family: var(--font-mono); font-size: 10px; color: var(--faint); letter-spacing: 0.1em; display: block; margin-top: 1px; }

.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a {
  font-size: 15px;
  color: var(--muted);
  transition: color 0.15s ease;
  padding: 6px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

.header-cta { display: flex; align-items: center; gap: 20px; }
.header-phone { font-family: var(--font-mono); font-size: 14px; color: var(--text); }
.header-phone:hover { color: var(--accent); }
.btn-compact { padding: 11px 20px; }

.nav-toggle { display: none; }

/* ---------- Секции ---------- */

.section { padding: 104px 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 56px; max-width: 720px; }
.section-head h2 { font-size: 38px; margin-bottom: 16px; }

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 110px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, black 0%, transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 72px; align-items: center; }
.hero h1 { font-size: 52px; margin-bottom: 24px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-bottom: 40px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Схема в герое */
.scheme { display: grid; gap: 14px; font-family: var(--font-mono); font-size: 13px; }
.scheme-row { display: flex; gap: 14px; justify-content: center; }
.scheme-node {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 18px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.scheme-node:hover { border-color: var(--accent); color: var(--text); }
.scheme-node::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; }
.scheme-core {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--text);
  font-weight: 600;
  padding: 18px 30px;
  font-size: 15px;
}
.scheme-core::before { background: var(--accent); }
.scheme-link { display: flex; justify-content: center; }
.scheme-link span { width: 1px; height: 22px; background: var(--line-strong); }

/* ---------- Статистика ---------- */

.stats { border-top: 1px solid var(--line); background: var(--bg-raise); }
.stats .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 0;
  padding-bottom: 0;
}
.stat {
  padding: 36px 28px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat b { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 500; color: var(--accent); }
.stat span { font-size: 14px; color: var(--muted); }

/* ---------- Направления ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 32px oklch(0.3 0.05 250 / 0.08); }
.service-num { font-family: var(--font-mono); font-size: 13px; color: var(--faint); }
.service-card h3 { font-size: 20px; }
.service-card p { color: var(--muted); font-size: 15px; flex: 1; text-wrap: pretty; }
.service-more { font-family: var(--font-mono); font-size: 13px; color: var(--accent); display: inline-flex; gap: 8px; }
.service-card:hover .service-more::after { transform: translateX(4px); }
.service-more::after { content: "→"; transition: transform 0.18s ease; }

/* ---------- Процесс ---------- */

.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { border-top: 2px solid var(--line-strong); padding-top: 22px; position: relative; }
.step::before {
  content: "";
  position: absolute;
  top: -2px; left: 0;
  width: 56px; height: 2px;
  background: var(--accent);
}
.step-num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); margin-bottom: 12px; display: block; }
.step h3 { font-size: 18px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 15px; text-wrap: pretty; }

/* ---------- Чипы интеграций ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 20px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.chip:hover { border-color: var(--accent-2); color: var(--text); }

/* ---------- Кейсы ---------- */

.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.case-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.case-card:hover { border-color: var(--line-strong); box-shadow: 0 12px 32px oklch(0.3 0.05 250 / 0.08); }
.case-media { aspect-ratio: 16 / 9; background: var(--bg-raise); border-bottom: 1px solid var(--line); }
.case-media image-slot { width: 100%; height: 100%; }
.case-body { padding: 22px 26px 26px; }
.case-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); display: block; margin-bottom: 8px; }
.case-card h3 { font-size: 19px; margin-bottom: 8px; font-family: var(--font-body); font-weight: 600; }
.case-card p { color: var(--muted); font-size: 15px; }

/* ---------- Списки возможностей (внутр. страницы) ---------- */

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
}
.feature h3 { font-size: 17px; font-family: var(--font-body); font-weight: 600; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; text-wrap: pretty; }
.feature-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; color: var(--accent);
  margin-bottom: 16px;
}

.check-list { list-style: none; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 14px; color: var(--muted); font-size: 16px; }
.check-list li::before { content: "+"; font-family: var(--font-mono); color: var(--accent); flex-shrink: 0; }

/* ---------- Внутренние страницы ---------- */

.page-hero { padding: 80px 0 72px; position: relative; overflow: hidden; }
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 60% 80% at 85% 20%, black 0%, transparent 70%);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.breadcrumb { font-family: var(--font-mono); font-size: 13px; color: var(--faint); margin-bottom: 28px; display: flex; gap: 10px; }
.breadcrumb a:hover { color: var(--accent); }
.page-hero h1 { font-size: 44px; max-width: 18ch; margin-bottom: 22px; text-wrap: balance; }
.page-hero .lead { margin-bottom: 36px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.split h2 { font-size: 32px; margin-bottom: 18px; }
.split .lead { font-size: 17px; margin-bottom: 24px; }

/* ---------- CTA / форма ---------- */

.cta { background: var(--bg-raise); }
.cta .container { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.cta h2 { font-size: 36px; margin-bottom: 18px; }
.cta .lead { font-size: 17px; }

.lead-form { display: grid; gap: 14px; }
.lead-form label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); display: grid; gap: 8px; }
.lead-form input, .lead-form textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  transition: border-color 0.15s ease;
}
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: var(--accent); }
.lead-form textarea { resize: vertical; min-height: 96px; }
.lead-form .btn { margin-top: 6px; }
.form-note { font-size: 13px; color: var(--faint); }
.form-success {
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius);
  padding: 28px;
  font-size: 16px;
  display: none;
}
.form-success b { font-family: var(--font-display); font-weight: 500; display: block; margin-bottom: 8px; }

/* ---------- Подвал ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; background: var(--bg-raise); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; margin-bottom: 44px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; font-weight: 500; }
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a { color: var(--muted); font-size: 15px; }
.footer-col a:hover { color: var(--accent); }
.footer-desc { color: var(--muted); font-size: 15px; max-width: 36ch; margin-top: 16px; text-wrap: pretty; }
.footer-contact { font-family: var(--font-mono); font-size: 15px; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between; gap: 20px; font-size: 13px; color: var(--faint); }

/* ---------- Появление при скролле ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Адаптив ---------- */

@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; gap: 48px; }
  .hero h1 { font-size: 40px; }
  .services-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .stats .container { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .cta .container, .split { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--text); }
  .header-cta .btn { display: none; }
  .site-header .container { gap: 16px; }
  .site-nav.is-open {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--bg-raise);
    border-bottom: 1px solid var(--line);
    padding: 16px 32px 24px;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .hero { padding: 64px 0 72px; }
  .hero h1 { font-size: 32px; }
  .section { padding: 72px 0; }
  .section-head h2 { font-size: 29px; }
  .page-hero h1 { font-size: 31px; }
  .services-grid, .feature-grid, .cases-grid { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .stats .container { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; }
  .site-nav.is-open { padding: 16px 20px 24px; }
}

/* ---------- Honeypot (антиспам, скрыто) ---------- */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Состояние формы ---------- */
.lead-form.is-sending { opacity: 0.6; pointer-events: none; }
.form-error {
  border: 1px solid #d14;
  background: #fdecec;
  color: #a01020;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  margin-top: 12px;
  display: none;
}
.form-error.is-visible { display: block; }

/* ---------- Юридическая страница (политика) ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 22px; margin: 34px 0 12px; }
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--muted); font-size: 16px; margin-bottom: 14px; text-wrap: pretty; }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; }
.legal-note { font-size: 14px; color: var(--faint); margin-top: 28px; }
