/* ==========================================================================
   Техинформ — стили лендинга
   Дизайн-токены выведены из логотипа: тёмно-синий круг + мятный акцент.
   Светлая тема — по умолчанию (переключатель в шапке). Hero, «Примеры
   решений», CTA-форма и футер всегда используют тёмную фирменную подложку
   независимо от переключателя — это осознанный ритм секций, а не режим темы.
   ========================================================================== */

:root {
  /* Константы бренда — не меняются переключателем темы */
  --ink-950: #0B1626;
  --ink-900: #081020;
  --surface-800: #152238;
  --mint-500: #4ECDA1;
  --mint-300: #8FE3C4;
  --mint-rgb: 78, 205, 161;
  --slate-400: #9AA7BD;
  --hairline-dark: rgba(255, 255, 255, 0.08);

  /* Токены светлой темы (по умолчанию) */
  --bg: #F6F8FB;
  --bg-alt: #EEF2F8;
  --surface: #FFFFFF;
  --surface-rgb: 255, 255, 255;
  --surface-hover: #EEF6F2;
  --border: #E4E9F2;

  --text: #14213A;
  --text-muted: #374357;

  /* Тёмный вариант мятного — для ссылок/текста на светлом фоне (AA-контраст) */
  --link: #106B4F;
  --link-hover: #0C5940;

  /* Тёмный текст поверх мятной кнопки — контраст ≈10:1 */
  --on-accent: var(--ink-950);

  --error: #C81E3A;
  --success: #127a4e;

  --radius: 18px;
  --radius-sm: 12px;
  --container: 1200px;

  --transition: 0.25s ease;

  --font-display: "Unbounded", "Manrope", "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Manrope", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --glass-border: rgba(20, 33, 58, 0.08);
}

/* Тёмная тема — переключается кнопкой в шапке, атрибутом data-theme="dark" на <html>.
   Меняются только токены «читаемых» светлых секций (услуги/процесс/почему-мы/faq) —
   тёмные фирменные секции (hero/примеры/cta/футер/шапка) используют --ink-* напрямую
   и не зависят от этого переключателя. */
[data-theme="dark"] {
  --bg: var(--ink-950);
  --bg-alt: var(--ink-900);
  --surface: var(--surface-800);
  --surface-rgb: 21, 34, 56;
  --surface-hover: #1B2A44;
  --border: var(--hairline-dark);

  --text: #EEF2F9;
  --text-muted: var(--slate-400);

  --link: var(--mint-500);
  --link-hover: var(--mint-300);

  --on-accent: var(--ink-950);

  --error: #ff8fa3;
  --success: #7be6a1;

  --glass-border: rgba(238, 241, 251, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

address {
  font-style: normal;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  text-align: center;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.section-lead {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 56px;
  font-size: 1.05rem;
}

section {
  padding: 112px 0;
}

/* ---------- Живая точка (фирменный элемент) ---------- */

.live-dot {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint-500);
  margin-right: 9px;
  vertical-align: middle;
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--mint-500);
  animation: dot-pulse 2.4s ease-out infinite;
}

.live-dot-on-mint {
  background: var(--ink-950);
}

.live-dot-on-mint::after {
  border-color: var(--ink-950);
}

@keyframes dot-pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot::after {
    animation: none;
    opacity: 0.4;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--mint-500);
  color: var(--on-accent);
  padding: 12px 26px;
  font-size: 0.95rem;
  box-shadow: 0 10px 26px rgba(var(--mint-rgb), 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(var(--mint-rgb), 0.42);
  background: var(--mint-300);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-secondary {
  background: transparent;
  color: inherit;
  border-color: rgba(var(--mint-rgb), 0.5);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.btn-secondary:hover {
  border-color: var(--mint-500);
  background: rgba(var(--mint-rgb), 0.1);
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.96);
}

.btn-pulse {
  animation: btn-pulse-glow 3.6s ease-in-out infinite;
}

@keyframes btn-pulse-glow {
  0%, 100% { box-shadow: 0 10px 26px rgba(var(--mint-rgb), 0.32); }
  50% { box-shadow: 0 10px 34px rgba(var(--mint-rgb), 0.62), 0 0 0 8px rgba(var(--mint-rgb), 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-pulse {
    animation: none;
  }
}

/* ---------- Header ---------- */
/* Шапка всегда использует тёмную фирменную палитру: прозрачная над hero,
   тёмное стекло при скролле — независимо от переключателя светлой/тёмной темы. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
}

.site-header.is-scrolled {
  background: rgba(11, 22, 38, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

/* Отступ, чтобы заголовки секций не прятались под sticky-шапкой при переходе по якорям */
section[id] {
  scroll-margin-top: 96px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0;
  color: #fff;
  flex-shrink: 0;
}

.logo-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition);
  white-space: nowrap;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--mint-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.main-nav a:hover {
  color: #fff;
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.main-nav a.is-active {
  color: var(--mint-300);
}

.main-nav a.is-active::after {
  transform: scaleX(1);
}

/* Honeypot-поле формы заявки: скрыто визуально, но доступно ботам, заполняющим все поля подряд */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.header-cta {
  flex-shrink: 0;
  padding: 10px 22px;
  font-size: 0.9rem;
  border-color: var(--mint-500);
  color: var(--mint-300);
  background: transparent;
}

.header-cta:hover {
  background: var(--mint-500);
  color: var(--on-accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  border-color: var(--mint-500);
  color: var(--mint-300);
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: #fff;
  transition: transform var(--transition), opacity var(--transition);
}

.burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.is-open span:nth-child(2) {
  opacity: 0;
}

.burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

.hero {
  position: relative;
  color: #fff;
  /* Отрицательный отступ поднимает фон hero под sticky-шапку (76px), чтобы
     прозрачная в начале шапка показывала тёмный фон hero, а не фон страницы —
     sticky-элемент всё равно резервирует своё место в потоке документа. */
  margin-top: -76px;
  padding: 226px 0 110px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline-dark);
  color: var(--mint-300);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 36px;
  color: var(--slate-400);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 650px;
  overflow: hidden;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.28;
}

.glow-blob-a {
  width: 420px;
  height: 420px;
  top: -8%;
  left: 6%;
  background: var(--mint-500);
  animation: drift-a 22s ease-in-out infinite;
}

.glow-blob-b {
  width: 380px;
  height: 380px;
  top: 18%;
  right: 8%;
  background: var(--mint-300);
  opacity: 0.16;
  animation: drift-b 26s ease-in-out infinite;
}

.glow-blob-c {
  width: 320px;
  height: 320px;
  bottom: -12%;
  left: 38%;
  background: #0F3A2E;
  animation: drift-c 30s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.12); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 40px) scale(0.9); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.08); }
}

.hero-cursor-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 30%), rgba(var(--mint-rgb), 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero:hover .hero-cursor-glow {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .glow-blob {
    animation: none;
  }
}

/* ---------- Hero: плавающие превью-карточки ---------- */

.hero-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}

.preview-card {
  position: absolute;
  width: 172px;
  background: rgba(21, 34, 56, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--hairline-dark);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.5), 0 0 32px rgba(var(--mint-rgb), 0.14);
}

.preview-card-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.preview-chat {
  top: 8%;
  left: 2%;
  animation: float-a 7s ease-in-out infinite;
}

.preview-chat-body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.preview-avatar {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--mint-500);
  color: var(--ink-950);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-avatar svg {
  width: 16px;
  height: 16px;
}

.preview-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline-dark);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: #EEF2F9;
  line-height: 1.4;
}

.preview-site {
  top: 10%;
  right: 2%;
  animation: float-b 8s ease-in-out infinite;
  animation-delay: -2s;
}

.preview-site-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.preview-site-hero {
  display: block;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--mint-300), var(--mint-500));
  opacity: 0.85;
}

.preview-site-line {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.preview-site-line.short {
  width: 60%;
}

.preview-widget {
  bottom: 10%;
  right: 14%;
  animation: float-c 6.5s ease-in-out infinite;
  animation-delay: -4s;
}

.preview-widget-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.preview-widget-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--mint-300);
}

.preview-widget-icon svg {
  width: 100%;
  height: 100%;
}

.preview-widget-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-400);
}

.preview-widget-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
}

.preview-widget-chart span {
  display: block;
  flex: 1;
  height: var(--h, 40%);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--mint-300), var(--mint-500));
}

@keyframes float-a {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-16px) rotate(-6deg); }
}

@keyframes float-b {
  0%, 100% { transform: translateY(0) rotate(4deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}

@keyframes float-c {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-18px) rotate(-3deg); }
}

@media (min-width: 1200px) {
  .hero-preview {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-chat,
  .preview-site,
  .preview-widget {
    animation: none;
  }
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  overflow: hidden;
  background: var(--ink-900);
  padding: 18px 0;
}

.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--mint-rgb), 0.7), transparent);
}

.marquee::before {
  top: 0;
}

.marquee::after {
  bottom: 0;
}

/* Затухание краёв цветом фона секции (--ink-900), а не alpha-маской: маска
   (mask-image) делает прозрачным весь элемент, включая его собственный фон,
   и на крайних пикселях сквозь него было видно фон страницы за секцией
   (светлый в светлой теме) — асимметричный «белый» край слева. Оверлей с
   непрозрачным цветом фона на обоих концах исключает этот эффект и остаётся
   симметричным по построению. */
.marquee-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}

.marquee-fade-left {
  left: 0;
  background: linear-gradient(90deg, var(--ink-900), transparent);
}

.marquee-fade-right {
  right: 0;
  background: linear-gradient(270deg, var(--ink-900), transparent);
}

@media (max-width: 640px) {
  .marquee-fade {
    width: 32px;
  }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee-content {
  display: inline-block;
  padding-right: 4px;
  color: var(--mint-300);
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
}

/* ---------- Статистика в hero (pill-чипы) ---------- */

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 52px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline-dark);
}

.stat-item .live-dot {
  margin-right: 12px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-right: 8px;
  white-space: nowrap;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--slate-400);
  white-space: nowrap;
}

/* ---------- Services (бенто-сетка, светлая секция) ---------- */

.services {
  background: var(--bg);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.services-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  /* dense — иначе широкая карточка "1С" (span 2), не помещаясь в остаток
     первой строки, оставляет там пустую ячейку вместо переноса следующей
     обычной карточки на её место */
  grid-auto-flow: dense;
}

.services-grid .card-featured {
  grid-column: span 2;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--mint-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--mint-rgb), 0.35);
  box-shadow: 0 20px 40px rgba(15, 25, 45, 0.1);
}

.card:hover::after {
  transform: scaleX(1);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(var(--mint-rgb), 0.14);
  color: var(--link);
  margin-bottom: 22px;
  transition: transform var(--transition), background var(--transition);
}

.card:hover .card-icon {
  transform: scale(1.08);
  background: var(--mint-500);
  color: var(--on-accent);
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  margin-bottom: 0;
}

.card-featured p {
  max-width: 380px;
}

/* ---------- Process (светлая секция, рельс с живой точкой) ---------- */

.process {
  background: var(--bg);
}

.process-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.process-rail {
  display: none;
  position: absolute;
  left: 4%;
  right: 4%;
  top: 46px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.process-rail-fill {
  display: block;
  height: 100%;
  width: 0%;
  position: relative;
  background: linear-gradient(90deg, var(--mint-500), var(--mint-300));
  transition: width 0.15s linear;
}

.process-rail-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--mint-500);
  box-shadow: 0 0 0 5px rgba(var(--mint-rgb), 0.22);
}

@media (min-width: 900px) {
  .process-rail {
    display: block;
  }
}

.process-step {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform var(--transition), border-color var(--transition);
}

.process-step:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--mint-rgb), 0.35);
}

.process-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--link);
  margin-bottom: 12px;
}

.process-duration {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--link);
  background: rgba(var(--mint-rgb), 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

.process-step h3 {
  margin-bottom: 8px;
}

.process-step p {
  margin-bottom: 0;
}

/* ---------- Portfolio / «Примеры решений» — тёмная бенто-галерея ---------- */
/* Всегда тёмная фирменная секция, независимо от переключателя светлой/тёмной темы */

.portfolio {
  background: var(--ink-950);
  padding: 112px 0 96px;
}

.portfolio h2 {
  color: #fff;
}

.portfolio .section-lead {
  color: var(--slate-400);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: auto;
  gap: 24px;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-800);
  border: 1px solid var(--hairline-dark);
  border-radius: var(--radius);
  overflow: hidden;
  grid-column: span 3;
  transition: transform var(--transition), border-color var(--transition);
}

.portfolio-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--mint-rgb), 0.35);
}

.portfolio-grid .portfolio-card:nth-child(1) {
  grid-column: span 3;
  grid-row: span 2;
}

.portfolio-grid .portfolio-card:nth-child(2) {
  grid-column: span 3;
}

.portfolio-grid .portfolio-card:nth-child(3) {
  grid-column: span 3;
}

.portfolio-grid .portfolio-card:nth-child(4) {
  grid-column: span 3;
}

.portfolio-grid .portfolio-card:nth-child(5) {
  grid-column: span 3;
}

.portfolio-visual {
  flex: 1;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, rgba(var(--mint-rgb), 0.12), transparent 65%);
  border-bottom: 1px solid var(--hairline-dark);
}

.portfolio-body {
  padding: 22px 24px 26px;
}

.portfolio-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mint-300);
  background: rgba(var(--mint-rgb), 0.12);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 14px;
}

.portfolio-tag .live-dot {
  margin-right: 7px;
}

.portfolio-body h3 {
  color: #fff;
  margin-bottom: 8px;
}

.portfolio-body p {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--slate-400);
}

/* Мокап: CRM */

.mock-crm {
  width: 100%;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-crm-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint-500);
  flex-shrink: 0;
}

.mock-bar {
  display: block;
  height: 7px;
  width: var(--w, 60%);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.mock-crm-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 46px;
  margin-top: 4px;
}

.mock-crm-chart span {
  display: block;
  flex: 1;
  height: var(--h, 40%);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--mint-300), var(--mint-500));
  opacity: 0.9;
}

/* Мокап: мобильное приложение */

.mock-phone {
  position: relative;
  width: 108px;
  height: 168px;
  background: var(--ink-950);
  border: 1px solid var(--hairline-dark);
  border-radius: 20px;
  padding: 14px 10px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.mock-phone-notch {
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 auto 12px;
}

.mock-phone-screen {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-phone-card {
  display: block;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--mint-300), var(--mint-500));
  opacity: 0.85;
}

.mock-phone-line {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.mock-phone-line.short {
  width: 60%;
}

.mock-phone-btn {
  display: block;
  height: 20px;
  border-radius: 999px;
  background: rgba(var(--mint-rgb), 0.3);
  margin-top: 6px;
}

/* Мокап: чат-бот */

.mock-chat {
  width: 100%;
  max-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-chat-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #EEF2F9;
}

.mock-chat-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline-dark);
  border-bottom-left-radius: 3px;
}

.mock-chat-user {
  align-self: flex-end;
  background: var(--mint-500);
  color: var(--ink-950);
  border-bottom-right-radius: 3px;
}

/* Мокап уведомлений 1С — моноширинный шрифт, ассоциируется с документами/суммами */
.mock-chat-mono .mock-chat-bubble {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: -0.01em;
}

/* ---------- Reviews / «Почему выбирают нас» (светлая секция) ---------- */

.reviews {
  background: var(--bg-alt);
  text-align: center;
}

.advantages-grid {
  grid-template-columns: repeat(4, 1fr);
}

.advantages-grid .card {
  text-align: left;
}

.advantages-grid .card::before {
  content: attr(data-index);
  position: absolute;
  top: -6px;
  right: 12px;
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--text);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
}

.testimonials-grid {
  align-items: stretch;
}

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
}

.testimonial-text {
  color: var(--text);
  font-style: italic;
  margin-bottom: 16px;
}

.testimonial-author {
  color: var(--link);
  font-weight: 600;
  margin: 0;
}

/* ---------- FAQ ---------- */

.faq {
  background: var(--bg);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 24px;
  transition: border-color var(--transition);
}

.faq-item[open] {
  border-left-color: var(--mint-500);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(var(--mint-rgb), 0.14);
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--link);
  transition: transform 0.3s ease;
}

.faq-icon::before {
  width: 10px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.faq-icon::after {
  width: 2px;
  height: 10px;
  transform: translate(-50%, -50%);
}

.faq-item[open] .faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg) scale(0);
}

.faq-item[open] .faq-icon::before {
  transform: translate(-50%, -50%) rotate(180deg);
}

/* Анимация раскрытия без JS: браузер обычно скрывает содержимое <details> через
   display:none — здесь мы явно держим display:block и анимируем max-height. */
.faq-content {
  display: block;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}

.faq-item[open] .faq-content {
  max-height: 240px;
}

.faq-content p {
  margin: 0 0 20px;
}

@media (prefers-reduced-motion: reduce) {
  .faq-content,
  .faq-icon::before,
  .faq-icon::after {
    transition: none;
  }
}

/* ---------- Contact / CTA (тёмная секция) ---------- */

.contact {
  background: var(--ink-950);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-text h2 {
  text-align: left;
  color: #fff;
}

.contact-text > p {
  color: var(--slate-400);
}

.contact-details {
  margin-top: 32px;
}

.contact-item {
  font-size: 1.1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-item a {
  color: var(--mint-300);
  font-weight: 700;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.contact-links a {
  padding: 10px 20px;
  border: 1.5px solid rgba(var(--mint-rgb), 0.4);
  border-radius: 999px;
  font-weight: 600;
  color: #fff;
  transition: border-color var(--transition), background var(--transition);
}

.contact-links a:hover {
  border-color: var(--mint-500);
  background: rgba(var(--mint-rgb), 0.1);
}

.lead-form {
  background: var(--surface-800);
  border: 1px solid var(--hairline-dark);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
}

.lead-form h3 {
  margin-bottom: 8px;
  color: #fff;
}

.form-note {
  font-size: 0.9rem;
  margin-bottom: 24px;
  color: var(--slate-400);
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Floating-label поля: лейбл лежит поверх поля и «всплывает» при фокусе/заполнении */
.field {
  position: relative;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--hairline-dark);
  border-radius: var(--radius-sm);
  padding: 22px 14px 10px;
  color: #fff;
  font-family: inherit;
  /* 16px минимум — иначе iOS Safari зумит страницу при фокусе на поле */
  font-size: 1rem;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field textarea {
  padding-top: 24px;
}

.field label {
  position: absolute;
  left: 15px;
  top: 16px;
  font-size: 1rem;
  color: var(--slate-400);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.18s ease, color var(--transition), top 0.18s ease;
}

.field label.field-label-static {
  position: static;
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--slate-400);
}

/* Автозаполнение браузера (имя/телефон) красит фон поля своим стилем через
   UA-псевдокласс, игнорируя обычный background-color — box-shadow inset его
   не игнорирует. Секция всегда тёмная (не зависит от переключателя темы),
   поэтому один --surface-800 без светлого варианта. transition блокирует
   вспышку жёлтого/голубого фона Chrome до применения override. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-800) inset !important;
  box-shadow: 0 0 0 1000px var(--surface-800) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  transition: background-color 9999s ease-in-out 0s;
}

/* Firefox: другой (непрефиксованный) псевдокласс, отдельное правило —
   чтобы неподдерживаемый селектор не обнулил весь список у других браузеров */
.field input:autofill {
  background-color: var(--surface-800);
  color: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--mint-500);
  box-shadow: 0 0 0 4px rgba(var(--mint-rgb), 0.16);
}

.field input:not(:placeholder-shown) ~ label,
.field input:focus ~ label,
.field textarea:not(:placeholder-shown) ~ label,
.field textarea:focus ~ label {
  transform: translateY(-9px) scale(0.78);
  color: var(--mint-300);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-top: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA7BD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.field select:invalid {
  color: var(--slate-400);
}

/* ---------- Кастомный listbox для «Какая услуга интересует?» ----------
   Нативный select — единственный UI на мобильном (системный пикер удобнее
   пальцем); на устройствах с точным указателем (мышь) заменяется кастомным
   listbox в цветах сайта, т.к. открытый нативный <option> не поддаётся
   стилизации (фон/выделение рисует браузер/ОС). См. .field-select ниже. */

.field-select .select-trigger,
.field-select .select-trigger-label,
.field-select .select-listbox {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .field-select .select-native,
  /* Специфичность как у .field label.field-label-static (0,2,1) — иначе
     базовое правило её перебивает, и лейбл нативного select остаётся
     видимым поверх кастомного триггера */
  .field-select label.select-native-label {
    display: none;
  }

  .field-select .select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--hairline-dark);
    border-radius: var(--radius-sm);
    padding: 22px 14px 10px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
  }

  .field-select .select-trigger:focus-visible,
  .field-select .select-trigger.is-open {
    outline: none;
    border-color: var(--mint-500);
    box-shadow: 0 0 0 4px rgba(var(--mint-rgb), 0.16);
  }

  /* Валидация (setError в script.js) переключает .is-invalid на нативном
     select, который на десктопе скрыт — отражаем состояние на триггере */
  .field-select .select-native.is-invalid ~ .select-trigger {
    border-color: #ff8fa3;
  }

  .field-select .select-trigger-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .field-select .select-trigger-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--slate-400);
    transition: transform 0.2s ease;
  }

  .field-select .select-trigger.is-open .select-trigger-icon {
    transform: rotate(180deg);
  }

  .field-select .select-trigger-label {
    display: block;
  }

  .field-select.has-value .select-trigger-label,
  .field-select.is-open .select-trigger-label {
    transform: translateY(-9px) scale(0.78);
    color: var(--mint-300);
  }

  .field-select .select-listbox {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface-800);
    border: 1px solid var(--hairline-dark);
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
    max-height: 264px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  }

  .field-select .select-listbox.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .select-option {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--slate-400);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .select-option.is-active {
    background: rgba(var(--mint-rgb), 0.16);
    color: #fff;
  }

  .select-option[aria-selected="true"] {
    background: var(--mint-500);
    color: var(--on-accent);
    font-weight: 700;
  }

  @media (prefers-reduced-motion: reduce) {
    .field-select .select-listbox {
      transition: none;
    }
  }
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: #ff8fa3;
}

/* Цвета фиксированы (не завязаны на --error/--success), т.к. CTA-секция
   всегда тёмная независимо от переключателя светлой/тёмной темы */
.error-message {
  display: block;
  min-height: 18px;
  color: #ff8fa3;
  font-size: 0.82rem;
  margin: 4px 0 10px;
}

.lead-form button {
  margin-top: 10px;
}

.form-success {
  margin: 14px 0 0;
  color: #7be6a1;
  font-weight: 600;
  min-height: 20px;
}

/* ---------- SEO-текст ---------- */

.seo-text {
  position: relative;
  padding: 40px 0;
  background: var(--ink-900);
}

.seo-text p {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.8rem;
  /* Приглушённый, но AA-контрастный (≥4.5:1) на --ink-900 — прежний
     полупрозрачный slate-400 (0.7 alpha) давал только 4.37:1 */
  color: #8592AC;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  background: var(--ink-950);
  padding: 48px 0;
  border-top: 1px solid var(--hairline-dark);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
}

.footer-contact-block {
  text-align: center;
}

.footer-contact {
  margin-bottom: 10px;
  color: #fff;
}

.footer-contact a {
  color: var(--mint-300);
  font-weight: 600;
}

.footer-contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.footer-contact-links a {
  color: var(--mint-300);
  font-weight: 600;
  transition: color var(--transition);
}

.footer-contact-links a:hover {
  color: var(--mint-500);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-social a {
  color: var(--slate-400);
  font-weight: 600;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-social a:hover {
  color: #fff;
}

.footer-copy {
  width: 100%;
  text-align: center;
  margin: 0;
  font-size: 0.85rem;
  color: var(--slate-400);
  border-top: 1px solid var(--hairline-dark);
  padding-top: 24px;
}

/* ---------- Кнопка «наверх» ---------- */

.back-to-top {
  position: fixed;
  left: calc(24px + env(safe-area-inset-left, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, border-color var(--transition), color var(--transition);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--mint-500);
  color: var(--link);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 560px), (max-height: 560px) {
  .back-to-top {
    left: calc(16px + env(safe-area-inset-left, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.01ms;
  }
}

/* ---------- Плавающая кнопка контактов (FAB) ---------- */

.fab-widget {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fab-widget.is-hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.fab-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(16px) scale(0.5);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  transition-delay: 0s;
}

.fab-item svg {
  width: 22px;
  height: 22px;
}

.fab-menu.is-open .fab-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-menu.is-open .fab-item:nth-child(4) { transition-delay: 0s; }
.fab-menu.is-open .fab-item:nth-child(3) { transition-delay: 0.06s; }
.fab-menu.is-open .fab-item:nth-child(2) { transition-delay: 0.12s; }
.fab-menu.is-open .fab-item:nth-child(1) { transition-delay: 0.18s; }

.fab-instagram {
  background: linear-gradient(135deg, #f7941e, #e0266f);
}

.fab-telegram {
  background: linear-gradient(135deg, #2aabee, #229ed9);
}

.fab-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
}

.fab-chat {
  background: var(--mint-500);
  color: var(--ink-950);
}

.fab-main {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--mint-500);
  color: var(--ink-950);
  box-shadow: 0 12px 32px rgba(var(--mint-rgb), 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.fab-main:hover {
  transform: translateY(-2px);
}

.fab-main:active {
  transform: scale(0.94);
}

.fab-icon {
  position: absolute;
  width: 26px;
  height: 26px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.fab-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.fab-main.is-open .fab-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.fab-main.is-open .fab-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* «Онлайн»-индикатор — живая точка на кнопке-лаунчере чата */
.fab-status-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2ED47A;
  border: 2px solid var(--ink-950);
  transition: opacity 0.2s ease;
}

.fab-status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid #2ED47A;
  animation: dot-pulse 2.4s ease-out infinite;
}

.fab-main.is-open .fab-status-dot {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .fab-item,
  .fab-icon,
  .fab-status-dot::after {
    transition: none;
  }
  .fab-status-dot::after {
    animation: none;
  }
}

/* ---------- Чат-помощник ---------- */

.chat-widget {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  width: 380px;
  max-width: calc(100vw - 48px);
  max-height: min(600px, calc(100vh - 140px));
  background: var(--surface-800);
  border: 1px solid var(--hairline-dark);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 300;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.chat-widget.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--mint-500);
  color: var(--ink-950);
  font-weight: 700;
  flex-shrink: 0;
}

#chat-widget-title {
  display: flex;
  align-items: center;
}

.chat-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--ink-950);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.chat-close svg {
  width: 16px;
  height: 16px;
}

.chat-close:hover {
  background: rgba(11, 22, 38, 0.14);
}

.chat-messages {
  flex: 1;
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.chat-message p {
  margin: 0;
  color: inherit;
}

.chat-message-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline-dark);
  color: #EEF2F9;
  border-bottom-left-radius: 4px;
}

.chat-message-user {
  align-self: flex-end;
  background: var(--mint-500);
  color: var(--ink-950);
  border-bottom-right-radius: 4px;
}

.chat-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--hairline-dark);
  flex-shrink: 0;
}

.chat-quick-btn {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline-dark);
  color: var(--mint-300);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.chat-quick-btn:hover {
  border-color: var(--mint-500);
  background: rgba(var(--mint-rgb), 0.1);
  color: var(--mint-500);
}

.chat-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--hairline-dark);
  flex-shrink: 0;
}

.chat-cta {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.84rem;
  color: #fff;
  transition: transform var(--transition), opacity var(--transition);
}

.chat-cta:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

/* Затемнённые фирменные цвета WhatsApp/Telegram — исходные #25d366/#2aabee
   с белым текстом дают контраст 1.98:1 и 2.68:1, ниже AA (нужно 4.5:1) */
.chat-cta-whatsapp {
  background: #0E6B5F;
}

.chat-cta-telegram {
  background: #146D9E;
}

@media (max-width: 560px), (max-height: 560px) {
  .fab-widget {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .chat-widget {
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: 82vh;
  }

  .chat-messages {
    max-height: none;
  }
}

/* ---------- Scroll-reveal ---------- */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal-on-scroll.is-inview {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid .card-featured {
    grid-column: span 2;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-grid .portfolio-card:nth-child(1),
  .portfolio-grid .portfolio-card:nth-child(2),
  .portfolio-grid .portfolio-card:nth-child(3),
  .portfolio-grid .portfolio-card:nth-child(4),
  .portfolio-grid .portfolio-card:nth-child(5) {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 900px) {
  .cards-grid,
  .advantages-grid,
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-text h2 {
    text-align: center;
  }

  .contact-item {
    justify-content: center;
  }

  .contact-links {
    justify-content: center;
  }
}

/* Шапка переходит на бургер-меню раньше, чем сетки карточек — иначе на
   планшетах (например, 768px) логотип + пункты меню + кнопка не помещаются в ряд */
@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: rgba(11, 22, 38, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline-dark);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .main-nav.is-open {
    max-height: 280px;
  }

  .main-nav a {
    width: 100%;
    text-align: center;
    padding: 16px;
    border-bottom: 1px solid var(--hairline-dark);
  }

  .header-cta {
    display: none;
  }

  .burger {
    display: flex;
  }
}

@media (max-width: 640px) {
  section {
    padding: 72px 0;
  }

  /* Компактная шапка на мобильном экономит место над hero (см. .hero
     margin-top/padding ниже — они завязаны на эту высоту, см. project_redesign_2026). */
  .header-inner {
    height: 64px;
  }

  .main-nav {
    top: 64px;
  }

  .hero {
    margin-top: -64px;
    padding: 88px 0 40px;
  }

  .hero-inner {
    padding-left: 28px;
    padding-right: 28px;
  }

  .hero-badge {
    padding: 5px 14px 5px 11px;
    font-size: 0.72rem;
    margin-bottom: 12px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin: 0 auto 16px;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .btn-lg {
    padding: 12px 22px;
    font-size: 0.92rem;
  }

  .cards-grid,
  .advantages-grid,
  .process-grid,
  .services-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .services-grid .card-featured {
    grid-column: span 1;
  }

  .hero-stats {
    gap: 10px;
    margin-top: 16px;
    padding-right: 0;
  }

  .stat-item {
    padding: 8px 14px;
  }

  .stat-item .live-dot {
    margin-right: 8px;
  }

  .stat-number {
    font-size: 0.88rem;
  }

  .stat-label {
    font-size: 0.76rem;
  }

  .marquee {
    padding: 10px 0;
  }

  .marquee-content {
    font-size: 0.85rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .container {
    padding: 0 16px;
  }

  .lead-form {
    padding: 24px;
  }
}
