/* =========================================================
   ЦИФРОВОЙ ПАРТНЁР — базовые стили и дизайн-система
   Всё строится на CSS-переменных, чтобы дальше легко
   менять тему, цвета и подключать эффекты/анимации.
   ========================================================= */

/* ---------- Дизайн-токены ---------- */
:root {
  /* ПАЛИТРА: чёрный + белый, синий — единственный насыщенный акцент,
     тауп — тёплый нейтраль (приглушён, поэтому с синим не конфликтует),
     рубин — только семантика (ошибки), рядом с синим не ставится.
     Контрасты выверены по WCAG на тёмном фоне. */
  --bg:            #0a0a0b;   /* мягкий чёрный — белый текст не «звенит» */
  --bg-soft:       #101012;
  --bg-elevated:   #151517;
  --surface:       #1c1c1f;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:          #ffffff;
  --text-muted:    #a8a29e;   /* тёплый серый в тон таупу — 9.4:1 */
  --text-dim:      #87817b;   /* тёплый приглушённый — 5.1:1 (проходит AA) */

  /* Акценты */
  --accent:        #3e86c4;   /* Yale Blue осветлённый — текст/иконки, 5.4:1 */
  --accent-deep:   #0f4c81;   /* Yale Blue оригинал — заливки с белым текстом, 8.9:1 */
  --accent-2:      #4da6f0;   /* яркий синий (тот же оттенок 208°) — логотип и мелкие акценты, 7.6:1 */
  --warm:          #a57865;   /* Dusty Taupe — тёплый нейтраль, 5.5:1 */
  --danger:        #d4506a;   /* Ruby осветлённый — текст ошибки, 5.2:1 */
  --danger-deep:   #9b2335;   /* Ruby оригинал — заливка с белым текстом, 7.8:1 */

  --gradient:      linear-gradient(120deg, #0f4c81, #2e6fa8); /* заливки/кнопки: белый текст ≥5:1 */
  --gradient-text: linear-gradient(120deg, #3e86c4, #7fb3e0);                  /* текст на тёмном */

  /* Типографика */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-hero:  clamp(2.6rem, 6vw, 5rem);
  --fs-h2:    clamp(2rem, 4vw, 3.2rem);
  --fs-h3:    clamp(1.3rem, 2vw, 1.6rem);
  --fs-body:  1.05rem;
  --lh:       1.6;

  /* Ритм и раскладка */
  --maxw:      1200px;
  --gutter:    clamp(1.2rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 8rem);
  --radius:    18px;
  --radius-sm: 12px;

  /* Движение (единые тайминги для будущих анимаций) */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --dur:       0.6s;
  --shadow:    0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Утилиты раскладки ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 1rem;
}
.section-title { font-size: var(--fs-h2); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.section-lead { color: var(--text-muted); max-width: 60ch; margin-top: 1rem; }
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  will-change: transform;
}
.btn--primary { background: var(--gradient); color: #fff; box-shadow: 0 10px 30px -8px var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px var(--accent); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface); transform: translateY(-2px); }

/* ---------- Шапка / навигация ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav__logo {
  font-weight: 800;
  font-size: clamp(1.45rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1;
  transition: opacity 0.25s var(--ease);
}
.nav__logo:hover { opacity: 0.75; }
.nav__logo span { color: var(--accent-2); }
.nav__links { display: flex; gap: 2rem; align-items: center; }
.nav__links a { color: var(--text-muted); font-size: 0.95rem; transition: color 0.3s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__cta { display: inline-flex; }
.nav__burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(7rem, 14vh, 11rem); padding-bottom: var(--section-y); overflow: hidden; }
.hero__glow { /* задел под фоновый эффект/анимацию */
  position: absolute; z-index: 0; inset: -20% 0 auto 0; height: 600px;
  background: radial-gradient(60% 60% at 50% 20%, rgba(15, 76, 129, 0.38), transparent 70%);
  pointer-events: none;
}
/* Двухколоночный hero: текст слева, ноутбук справа */
.hero__grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 0.88fr 1.12fr; }
}
.hero__content { max-width: 640px; }
.hero__visual { position: relative; width: 100%; }
.hero__title { font-size: clamp(2.4rem, 4.6vw, 4.2rem); line-height: 1.03; letter-spacing: -0.03em; font-weight: 800; }
.hero__subtitle { color: var(--text-muted); font-size: 1.15rem; margin-top: 1.5rem; max-width: 52ch; }
.hero__actions { display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }

/* ---------- Сетки карточек ---------- */
.grid { display: grid; gap: 1.5rem; margin-top: 3rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: grid; place-items: center;
  margin-bottom: 1.2rem;
  color: var(--accent-2);          /* иконки на currentColor берут этот цвет */
  border: 1px solid var(--border);
}
.card__icon svg { width: 24px; height: 24px; display: block; }
.card__title { font-size: var(--fs-h3); font-weight: 700; margin-bottom: 0.6rem; }
.card__text { color: var(--text-muted); font-size: 0.98rem; }

/* ---------- Полный цикл (УТП) ---------- */
.cycle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3rem; align-items: stretch; }
.cycle__step { position: relative; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.cycle__num { font-size: 0.85rem; color: var(--accent-2); font-weight: 700; letter-spacing: 0.1em; }
.cycle__step h3 { margin: 0.6rem 0; font-size: var(--fs-h3); }
.cycle__step p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Шаги процесса ---------- */
.steps { counter-reset: step; margin-top: 3rem; display: grid; gap: 1rem; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start; padding: 1.5rem 0; border-top: 1px solid var(--border); }
.step__num { counter-increment: step; font-size: 1.5rem; font-weight: 800; color: var(--accent); min-width: 3ch; }
.step__num::before { content: "0" counter(step); }
.step h3 { font-size: var(--fs-h3); }
.step p { color: var(--text-muted); margin-top: 0.3rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 3rem; max-width: 800px; }
.faq__item { border-top: 1px solid var(--border); }
.faq__q { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.4rem 0; font-size: 1.1rem; font-weight: 600; }
.faq__q .plus { transition: transform 0.3s var(--ease); color: var(--accent-2); }
.faq__item.is-open .plus { transform: rotate(45deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease); color: var(--text-muted); }
.faq__a p { padding-bottom: 1.4rem; }

/* ---------- CTA / форма ---------- */
.cta { background: var(--bg-soft); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); padding: clamp(2rem, 5vw, 4rem); text-align: center; }
.form { display: grid; gap: 1rem; max-width: 480px; margin: 2rem auto 0; text-align: left; }
.form label { font-size: 0.85rem; color: var(--text-muted); }
.form input, .form textarea {
  width: 100%; padding: 0.9rem 1rem; border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color 0.3s var(--ease);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .btn { justify-content: center; }
.form__hint { font-size: 0.8rem; color: var(--text-dim); text-align: center; }

/* ---------- Футер ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 3rem; color: var(--text-muted); }
.footer__grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer__note { font-size: 0.85rem; color: var(--text-dim); margin-top: 1rem; }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim);
}
.footer__bottom a { color: var(--text-muted); transition: color 0.25s var(--ease); }
.footer__bottom a:hover { color: var(--text); }
.footer__links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ---------- Правовые документы (страница документов) ---------- */
.legal { max-width: 840px; margin-top: 2.5rem; display: grid; gap: 1rem; }
.legal__doc { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); overflow: hidden; }
.legal__doc > summary { cursor: pointer; list-style: none; padding: 1.2rem 1.5rem; font-weight: 600; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.legal__doc > summary::-webkit-details-marker { display: none; }
.legal__doc > summary::after { content: "+"; color: var(--accent-2); font-size: 1.4rem; line-height: 1; }
.legal__doc[open] > summary::after { content: "\2013"; }
.legal__body { padding: 0 1.5rem 1.5rem; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }
.legal__body p { margin-bottom: 0.7rem; }
.legal__body h4 { color: var(--text); margin: 1.3rem 0 0.4rem; font-size: 1rem; }
.legal__body ul { padding-left: 1.2rem; list-style: disc; margin: 0.4rem 0; }
.legal__body li { margin: 0.35rem 0; }
.legal__ph { color: var(--warm); font-weight: 600; }        /* плейсхолдеры [ФИО] и т.п. */
.legal__note { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ---------- Реквизиты исполнителя (фото + данные) ---------- */
.requisites { display: flex; gap: 2rem; align-items: center; margin-top: 2.5rem; flex-wrap: wrap; }
.requisites__photo {
  position: relative; flex: none;
  width: clamp(220px, 26vw, 300px);
  aspect-ratio: 62 / 80;              /* портрет, как исходник */
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  --lens: 85px;                       /* радиус ч/б пятна */
}
.requisites__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.req-color { filter: contrast(1.02); }   /* база — в цвете */
/* Ч/б «линза» следует за курсором: маска-кружок в точке (--mx, --my) */
.req-gray {
  filter: grayscale(1) contrast(1.06);
  -webkit-mask-image: radial-gradient(circle var(--lens) at var(--mx, -300px) var(--my, -300px), #000 60%, transparent 100%);
          mask-image: radial-gradient(circle var(--lens) at var(--mx, -300px) var(--my, -300px), #000 60%, transparent 100%);
}
.requisites__data h3 { font-size: var(--fs-h3); }
.requisites__data .req-status { color: var(--accent-2); font-weight: 600; margin-top: 0.3rem; }
.requisites__data ul { list-style: none; margin-top: 1.2rem; display: grid; gap: 0.5rem; color: var(--text); }
.requisites__data .req-label { color: var(--text-dim); display: inline-block; min-width: 92px; }

/* ---------- Чекбокс согласия в форме ---------- */
.form__consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; text-align: left; }
.form__consent input { margin-top: 0.15rem; width: 17px; height: 17px; flex: none; accent-color: var(--accent); cursor: pointer; }
.form__consent a { color: var(--accent-2); text-decoration: underline; }

/* ---------- Анимации появления (scroll-reveal) ----------
   Progressive enhancement: элементы прячутся ТОЛЬКО когда
   JS активен (html.js). Без JS / для краулеров — всё видно.
   JS добавляет .is-visible при попадании в вьюпорт. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.08s; }
[data-reveal][data-delay="2"] { transition-delay: 0.16s; }
[data-reveal][data-delay="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Hero: строка-приглашение в конструктор ---------- */
/* Обёртка CTA: колонка шириной ровно с ряд из двух кнопок */
.hero__cta { display: inline-flex; flex-direction: column; align-items: stretch; gap: 0.9rem; margin-top: 2.5rem; }
.hero__cta .hero__actions { margin-top: 0; }

/* Кнопка-приглашение в конструктор: тёмная, во всю ширину обёртки */
.hero__try {
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.hero__try:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -14px #000;
}

/* ---------- Блок «Обо мне» ---------- */
.about { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.about__photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 62 / 80; background: var(--surface); box-shadow: var(--shadow); }
.about__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about__lead { max-width: 60ch; }
.about__points { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.about__points li { position: relative; padding-left: 1.6rem; color: var(--text-muted); }
.about__points li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-2); font-weight: 700; }

/* Заглушки контента — видно, что надо заменить. При вставке реального
   текста убери атрибут data-placeholder, чтобы снять серый/курсив. */
[data-placeholder] { color: var(--text-dim); font-style: italic; }

/* ---------- Переключатель языка (вставляется скриптом i18n.js) ---------- */
.lang {
  display: inline-flex; align-items: center; flex: none;
  margin-left: 0.9rem; margin-right: 0.6rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 1px; gap: 1px;
}
.lang__btn {
  padding: 0.18rem 0.4rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.3;
  color: var(--text-dim);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.lang__btn:hover { color: var(--text); }
/* На узких десктопах шапке тесно — поджимаем меню, чтобы пункты
   не липли к логотипу (переключатель языка занимает своё место). */
@media (min-width: 861px) and (max-width: 1100px) {
  .nav__links { gap: 1.2rem; }
  .nav__links a { font-size: 0.9rem; }
  .lang { margin-left: 0.6rem; margin-right: 0.4rem; }
}
.lang__btn.is-active { background: var(--surface); color: var(--text); }

/* ---------- Уведомление о cookie (вставляется скриптом cookie.js) ---------- */
.cookie {
  position: fixed; z-index: 1500;
  left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
  max-width: 720px; margin-inline: auto;
  display: flex; align-items: center; gap: 1.2rem 1.5rem; flex-wrap: wrap;
  padding: 1.1rem 1.3rem;
  background: rgba(16, 16, 18, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.cookie.is-shown { opacity: 1; transform: none; }
.cookie__text { flex: 1 1 320px; }
.cookie__title { display: block; font-size: 0.98rem; margin-bottom: 0.3rem; }
.cookie__text p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.cookie__text a { color: var(--accent-2); text-decoration: underline; }
.cookie__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cookie .btn { padding: 0.6rem 1.1rem; font-size: 0.85rem; }

@media (max-width: 560px) {
  .lang { margin-right: 0.5rem; }
  .lang__btn { padding: 0.25rem 0.45rem; font-size: 0.72rem; }
  .nav__cta { padding: 0.45rem 0.8rem; font-size: 0.78rem; }
  .cookie__actions { width: 100%; }
  .cookie .btn { flex: 1; justify-content: center; }
}

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

/* Телефон: сначала ноутбук, потом кнопки.
   display:contents у .hero__content «растворяет» обёртку, и её дети
   становятся элементами колонки — тогда ноутбук можно поставить между
   текстом и кнопками одним свойством order. */
@media (max-width: 899px) {
  /* Полоска под шапкой на телефоне не нужна — она резала кадр */
  .site-header, .site-header.is-scrolled { border-bottom-color: transparent; }

  /* Кнопка в шапке компактнее: на телефоне она занимала половину строки.
     nowrap — иначе в узкой шапке надпись ломалась на две строки. */
  .nav__cta {
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
    white-space: nowrap;
    box-shadow: 0 6px 18px -8px var(--accent);
  }

  .hero__grid { display: flex; flex-direction: column; align-items: stretch; }
  .hero__content { display: contents; }
  .eyebrow { align-self: flex-start; }   /* плашка по содержимому, не во всю ширину */
  .hero__visual { order: 1; margin-top: 0.5rem; }
  .hero__cta { order: 2; margin-top: 2rem; }

  /* Две кнопки в ряд, третья — под ними во всю ширину */
  .hero__actions { display: flex; flex-wrap: nowrap; gap: 0.7rem; }
  .hero__actions .btn {
    flex: 1 1 0; min-width: 0;
    justify-content: center; text-align: center;
    padding-inline: 0.9rem; font-size: 0.92rem; white-space: nowrap;
  }
}

@media (max-width: 860px) {
  .grid--2, .grid--3, .cycle, .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 300px; margin-inline: auto; }
  .hero__cta { display: flex; }   /* на телефоне — во всю ширину */
  /* Закрытое меню уезжает вверх, но при высоком списке ссылок его нижняя
     граница не успевала уйти за экран и висела полоской внутри шапки.
     visibility скрывает панель целиком (и убирает ссылки из-под таба),
     а задержка возвращает её только после анимации закрытия. */
  .nav__links {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem var(--gutter); gap: 1.2rem;
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform 0.4s var(--ease), visibility 0s linear 0.4s;
  }
  .nav__links.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.4s var(--ease), visibility 0s linear 0s;
  }
  .nav__burger { display: flex; }
  .footer__grid { flex-direction: column; }
}
