/* ==========================================================================
   MEDIA BOX — БАЗОВЫЕ СТИЛИ (base.css)
   --------------------------------------------------------------------------
   Подключается первым на всех страницах. Содержит:
     1. Дизайн-токены (цвета, радиусы, шрифт, анимации)
     2. Сброс и базовые правила документа
     3. Типографику
     4. Сетку и отступы (.container, .section, .stack, .grid)
     5. Кнопки (.btn)
     6. Карточки (.card), чипы (.chip)
     7. Формы (.field, .checkbox)
     8. Иконки (.icon)
     9. Ссылку «Перейти к содержимому», логотип, шапку, меню, бургер
    10. Подвал и соцсети
    11. Фокус, reduced motion, переходы между страницами

   Брейкпоинты (совпадают с MB.SITE.breakpoints):
     телефон  < 640px   → (max-width: 639.98px)
     планшет 640–1023px → (min-width: 640px) and (max-width: 1023.98px)
     ПК       ≥ 1024px  → (min-width: 1024px)
   Меню-бургер: < 1200px. В меню 6 разделов + кнопка «Подобрать решение»,
   строкой они спокойно помещаются только при полной ширине контейнера.
   Это же число — константа NAV_DESKTOP_MIN в assets/js/common/layout.js
   (менять в обоих местах).
   Hover-эффекты — только внутри @media (hover: hover) and (pointer: fine).
   Анимируются только transform и opacity.
   ========================================================================== */


/* ==========================================================================
   1. ТОКЕНЫ
   ========================================================================== */

:root {
  /* Фон и поверхности */
  --bg: #070a12;
  --bg-2: #0b1020;
  --surface: #0f1526;
  --surface-2: #151c31;

  /* Линии */
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);

  /* Текст */
  --text: #e9edf7;
  --text-muted: #8f98ad;   /* контраст ≈ 6.6:1 на --bg — подходит для основного текста */
  --text-dim: #7c86a0;     /* второстепенные подписи: тусклее --text-muted, но ≥ 4.5:1 на --bg и --surface (≈ 5.4 / 5.0) */

  /* Акценты: циан, фиолетовый, зелёный (успех) */
  --accent: #38d9ff;
  --accent-2: #7b5cff;
  --accent-3: #34e0a1;
  --accent-grad: linear-gradient(135deg, #38d9ff 0%, #7b5cff 100%);
  --glow-cyan: 0 0 24px rgba(56, 217, 255, .45);
  --glow-violet: 0 0 28px rgba(123, 92, 255, .45);

  /* Цвета соцсетей */
  --tg: #2aabee;
  --ig: #e1306c;
  --tt: #25f4ee;
  --tt-2: #fe2c55;
  --yt: #ff0033;

  /* Радиусы */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Шрифт и размеры */
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;

  /* Движение */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 700ms;

  /* Служебные (производные) */
  --danger: #ff6b81;
  --text-on-accent: #06101f;
  --header-bg: rgba(7, 10, 18, .72);
  --panel-bg: rgba(9, 13, 24, .97);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

/* На телефонах шапка ниже */
@media (max-width: 639.98px) {
  :root {
    --header-h: 64px;
  }
}


/* ==========================================================================
   2. СБРОС И ДОКУМЕНТ
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  /* Тонкий тёмный скроллбар (Firefox, новые Chrome/Edge) */
  scrollbar-width: thin;
  scrollbar-color: #242c45 var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
  /* Очень мягкое свечение сверху страницы */
  background-image:
    radial-gradient(1100px 520px at 50% -140px, rgba(123, 92, 255, .10), transparent 70%),
    radial-gradient(760px 420px at 88% -120px, rgba(56, 217, 255, .07), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

main {
  flex: 1 0 auto;
  display: block;
  min-width: 0;
  /* Декоративные свечения обрезаются у края экрана и не расширяют страницу.
     Именно clip (не hidden): он не создаёт контейнер прокрутки, sticky работает.
     overflow-x у body не помогает — браузер переносит его на окно. */
  overflow-x: clip;
}

main:focus {
  outline: none;
}

/* :where() — нулевая специфичность, чтобы любые классы легко переопределяли отступы */
:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
  margin: 0;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  flex-shrink: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

a,
button,
input,
select,
textarea,
label {
  -webkit-tap-highlight-color: transparent;
}

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

/* Списки с классом — без маркеров (списки в тексте остаются обычными) */
ul[class],
ol[class] {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Атрибут hidden всегда скрывает, даже если у класса задан display */
[hidden] {
  display: none !important;
}

::selection {
  background: rgba(56, 217, 255, .28);
  color: #fff;
}

/* Скроллбар для Safari и старых Chrome/Edge */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #242c45;
  border: 2px solid var(--bg);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #313b5c;
}


/* ==========================================================================
   3. ТИПОГРАФИКА
   ========================================================================== */

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 1.35rem + 3.4vw, 4rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}

h2 {
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
}

h3 {
  font-size: clamp(1.1875rem, 1.08rem + .5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.25;
}

h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
}

/* Разумные отступы между блоками текста вне .stack */
:where(h1, h2, h3, h4) + :where(p, ul, ol) {
  margin-top: .6em;
}

:where(p, ul, ol) + :where(p, ul, ol) {
  margin-top: 1em;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 700;
  color: var(--text);
}

small {
  font-size: .8125rem;
}

/* Небольшая надпись над заголовком */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 20px;
  height: 1px;
  flex-shrink: 0;
  background: var(--accent-grad);
}

/* Крупный вводный абзац */
.lead {
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 62ch;
}

.text-muted {
  color: var(--text-muted);
}

.text-dim {
  color: var(--text-dim);
}

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

/* Текст с градиентом акцента */
.gradient-text {
  color: var(--accent);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .gradient-text {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* Ссылки внутри текста */
.link,
:where(p, li, .lead, .field__hint, .checkbox) a:not([class]) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(56, 217, 255, .35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .link:hover,
  :where(p, li, .lead, .field__hint, .checkbox) a:not([class]):hover {
    color: #7fe6ff;
    text-decoration-color: currentColor;
  }
}

/* Скрыть визуально, оставить для экранных дикторов */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* ==========================================================================
   4. СЕТКА И ОТСТУПЫ
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(56px, 8vw, 112px);
}

.section--tight {
  padding-block: clamp(32px, 5vw, 64px);
}

/* Вертикальная стопка с равными промежутками */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, 16px);
}

.stack > * {
  margin: 0;
}

.stack--sm {
  --stack-gap: 8px;
}

.stack--lg {
  --stack-gap: clamp(24px, 3vw, 32px);
}

/* Сетка колонок: на телефоне всегда одна колонка */
.grid {
  display: grid;
  gap: var(--grid-gap, clamp(16px, 2.4vw, 24px));
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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


/* ==========================================================================
   5. КНОПКИ
   ========================================================================== */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 48px;
  padding: 11px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .005em;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out);
}

.btn .icon {
  width: 1.15em;
  height: 1.15em;
  transition: transform var(--dur) var(--ease-out);
}

/* Нажатие — лёгкое «вдавливание» (и на сенсорных экранах) */
.btn:active {
  transform: scale(.97);
}

/* Основная: градиент, тёмный текст, свечение при наведении */
.btn--primary {
  color: var(--text-on-accent);
  background: var(--accent-grad);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 8px 22px -10px rgba(56, 217, 255, .6);
}

/* Свечение — готовая тень на псевдоэлементе, анимируется только opacity */
.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow:
    0 10px 30px -6px rgba(56, 217, 255, .5),
    0 10px 36px -8px rgba(123, 92, 255, .55);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}

/* Лёгкий блик сверху (под текстом) */
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%);
  opacity: .7;
  pointer-events: none;
}

/* Второстепенная: прозрачная с рамкой */
.btn--ghost {
  color: var(--text);
  background-color: rgba(255, 255, 255, .03);
  border-color: var(--border-strong);
}

.btn--sm {
  min-height: 40px;
  padding: 8px 18px;
  font-size: .875rem;
}

.btn--lg {
  min-height: 56px;
  padding: 14px 32px;
  font-size: 1rem;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover::before {
    opacity: 1;
  }

  .btn--primary:hover {
    transform: translateY(-1px);
  }

  .btn--primary:active {
    transform: translateY(0) scale(.97);
  }

  .btn--ghost:hover {
    background-color: rgba(56, 217, 255, .06);
    border-color: rgba(56, 217, 255, .45);
  }

  .btn:hover .icon--arrow {
    transform: translateX(3px);
  }

  .btn:disabled:hover::before,
  .btn[aria-disabled="true"]:hover::before {
    opacity: 0;
  }
}


/* ==========================================================================
   6. КАРТОЧКИ И ЧИПЫ
   ========================================================================== */

.card {
  position: relative;
  isolation: isolate;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 60%),
    var(--surface);
  transition:
    transform var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}

/* Иконка в плашке — для карточек преимуществ/шагов */
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 22px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(56, 217, 255, .14), rgba(123, 92, 255, .14));
  border: 1px solid rgba(56, 217, 255, .22);
}

/* Карточка со свечением при наведении: тень и подсветка — на псевдоэлементах,
   меняется только opacity */
.card--glow::before,
.card--glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease-out);
}

.card--glow::before {
  z-index: -1;
  box-shadow:
    0 0 0 1px rgba(56, 217, 255, .32),
    0 20px 50px -18px rgba(56, 217, 255, .35),
    0 16px 48px -16px rgba(123, 92, 255, .35);
}

.card--glow::after {
  z-index: -1;
  background: radial-gradient(520px circle at 50% 0%, rgba(56, 217, 255, .09), transparent 55%);
}

/* Фокус внутри карточки (клавиатура) — такая же подсветка */
.card--glow:focus-within::before,
.card--glow:focus-within::after {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .card--glow:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 217, 255, .22);
  }

  .card--glow:hover::before,
  .card--glow:hover::after {
    opacity: 1;
  }
}

/* Выделенная карточка: градиентная рамка */
.card--featured {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(123, 92, 255, .10), rgba(56, 217, 255, 0) 45%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(56, 217, 255, .85), rgba(123, 92, 255, .85)) border-box;
  box-shadow: 0 30px 70px -36px rgba(123, 92, 255, .55);
}

@media (hover: hover) and (pointer: fine) {
  .card--featured.card--glow:hover {
    border-color: transparent;
  }
}

/* Чипы / бейджи */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .04);
  white-space: nowrap;
}

.chip .icon {
  width: 1.05em;
  height: 1.05em;
}

.chip--accent {
  color: var(--accent);
  border-color: rgba(56, 217, 255, .35);
  background: rgba(56, 217, 255, .08);
}


/* ==========================================================================
   7. ФОРМЫ
   ========================================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field__label {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.field__input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 1rem;          /* 16px — iOS не увеличивает страницу при фокусе */
  line-height: 1.4;
  color: var(--text);
  background-color: rgba(11, 16, 32, .8);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color var(--dur-fast) ease,
    background-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

/* Подсказки-примеры в полях несут смысл («@username или номер телефона»),
   поэтому контраст ≥ 4.5:1 на фоне поля — цвет задан явно, не через --text-dim */
.field__input::placeholder {
  color: #7a849b;
  opacity: 1;
}

textarea.field__input {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

select.field__input {
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f98ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
}

select.field__input option {
  color: var(--text);
  background-color: var(--surface);
}

@media (hover: hover) and (pointer: fine) {
  .field__input:hover {
    border-color: rgba(255, 255, 255, .26);
  }
}

/* Своя «рамка фокуса» у полей вместо общего outline */
.field__input:focus,
.field__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background-color: rgba(11, 16, 32, 1);
  box-shadow: 0 0 0 3px rgba(56, 217, 255, .18);
}

.field__hint {
  font-size: .8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--danger);
}

.field__error:empty {
  display: none;
}

.field--invalid .field__input,
.field__input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field--invalid .field__input:focus,
.field__input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 129, .2);
}

.field--invalid .field__label {
  color: #ffc2cb;
}

/* Чекбокс / радио: <label class="checkbox"><input type="checkbox"><span>Текст</span></label> */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox input {
  position: relative;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background-color: rgba(11, 16, 32, .8);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.checkbox input[type="radio"] {
  border-radius: 50%;
}

/* Галочка */
.checkbox input::before {
  content: '';
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border-left: 2px solid var(--text-on-accent);
  border-bottom: 2px solid var(--text-on-accent);
  transform: rotate(-45deg) scale(0);
  transition: transform var(--dur-fast) var(--ease-out);
}

.checkbox input[type="radio"]::before {
  width: 8px;
  height: 8px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text-on-accent);
  transform: scale(0);
}

.checkbox input:checked {
  border-color: transparent;
  background: var(--accent-grad);
}

.checkbox input:checked::before {
  transform: rotate(-45deg) scale(1);
}

.checkbox input[type="radio"]:checked::before {
  transform: scale(1);
}

.checkbox input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.checkbox input[aria-invalid="true"],
.field--invalid .checkbox input {
  border-color: var(--danger);
}

@media (hover: hover) and (pointer: fine) {
  .checkbox:hover input:not(:checked) {
    border-color: rgba(56, 217, 255, .5);
  }
}


/* ==========================================================================
   8. ИКОНКИ
   ========================================================================== */

/* SVG из MB.icons: layout.js вставляет его в элементы с data-icon */
.icon {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
  line-height: 1;
}

.icon > svg,
.icon__svg {
  display: block;
  width: 100%;
  height: 100%;
}


/* ==========================================================================
   9. ШАПКА, ЛОГОТИП, МЕНЮ
   ========================================================================== */

/* «Перейти к содержимому» — видна только при переходе с клавиатуры */
.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-on-accent);
  background: var(--accent-grad);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
  opacity: 1;
  transform: none;
}

/* Логотип: CSS-знак (квадрат с градиентом и силуэтом телефона) + текст */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
}

.logo__mark {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-grad);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    0 6px 18px -6px rgba(56, 217, 255, .65);
  transition: transform var(--dur) var(--ease-out);
}

/* Силуэт телефона внутри знака */
.logo__mark::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 9px;
  width: 12px;
  height: 18px;
  border: 2px solid var(--text-on-accent);
  border-radius: 3.5px;
  background: rgba(255, 255, 255, .22);
}

/* «Кнопка» телефона */
.logo__mark::after {
  content: '';
  position: absolute;
  top: 19.5px;
  left: 13px;
  width: 4px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-on-accent);
}

.logo__text {
  display: inline-flex;
  align-items: baseline;
  gap: .08em;
  white-space: nowrap;
}

.logo__accent {
  color: var(--accent);
}

/* Текст логотипа + подпись компании «by Synergy Digital Group» */
.logo__words {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.logo__by {
  font-size: .625rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* На узких телефонах подпись не помещается рядом с языками и бургером */
@media (max-width: 419.98px) {
  .site-header .logo__by {
    display: none;
  }
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .logo__accent {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

@media (hover: hover) and (pointer: fine) {
  .logo:hover .logo__mark {
    transform: rotate(-6deg) scale(1.04);
  }
}

/* Шапка внутренних страниц: липкая, полупрозрачная, с размытием фона.
   На главной hero.css переопределяет её (.page--home .site-header). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background-color: rgba(7, 10, 18, .94);
  view-transition-name: site-header;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background-color: var(--header-bg);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

/* --- Меню строкой (≥ 1200px): 6 разделов + кнопка --- */
.site-nav {
  display: flex;
  align-items: center;
  /* меньше, чем раньше: в шапке теперь ещё и переключатель языка */
  gap: clamp(16px, 1.6vw, 26px);
}

.site-nav__link {
  position: relative;
  padding: 8px 0;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--dur-fast) ease;
}

/* Подчёркивание-градиент */
.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-grad);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease-out);
}

.site-nav__link[aria-current="page"] {
  color: var(--text);
}

.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Кнопка чуть отделена от текстовых пунктов */
.site-nav__cta {
  margin-left: 8px;
  white-space: nowrap;
}

/* Текущая страница «Подобрать решение» — тонкое кольцо вокруг кнопки */
.site-nav__cta[aria-current="page"] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 0 0 3px var(--bg),
    0 0 0 4px rgba(56, 217, 255, .55);
}

@media (hover: hover) and (pointer: fine) {
  .site-nav__link:hover {
    color: var(--text);
  }

  .site-nav__link:hover::after {
    transform: scaleX(1);
  }
}

/* --- Переключатель языка UA / EN / RU ---
   Русский скрыт для посетителей из Украины (boot.js ставит html[data-geo="ua"]). */
.lang-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}

.lang-switch__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--text-muted);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.lang-switch__link[aria-current="true"] {
  color: var(--text-on-accent);
  background: var(--accent-grad);
}

html[data-geo="ua"] .lang-switch__link[data-lang="ru"] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .lang-switch__link:not([aria-current="true"]):hover {
    color: var(--text);
    background-color: rgba(255, 255, 255, .06);
  }
}

/* Порядок в шапке: логотип … меню … языки … бургер */
.site-header__inner .site-nav { order: 1; margin-left: auto; }
.site-header__inner .lang-switch { order: 2; }
.site-header__inner .nav-toggle { order: 3; }

@media (max-width: 1199.98px) {
  .site-header__inner .lang-switch { margin-left: auto; }
  .site-header__inner { gap: 10px; }
}

@media (max-width: 379.98px) {
  .lang-switch__link {
    min-width: 30px;
    padding: 4px 6px;
  }
}

/* --- Кнопка-бургер (видна < 1200px) --- */
.nav-toggle {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-right: -4px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

/* Три полоски: сама полоска + ::before / ::after; при открытии — крестик */
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
}

.nav-toggle__bar {
  position: relative;
  transition: background-color var(--dur-fast) ease;
}

.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: '';
  position: absolute;
  left: 0;
  transition: transform var(--dur) var(--ease-out);
}

.nav-toggle__bar::before {
  transform: translateY(-6px);
}

.nav-toggle__bar::after {
  transform: translateY(6px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
  transform: rotate(-45deg);
}

@media (hover: hover) and (pointer: fine) {
  .nav-toggle:hover {
    border-color: rgba(56, 217, 255, .45);
    background-color: rgba(56, 217, 255, .06);
  }
}

/* --- Меню-бургер: выпадающая панель на всю ширину (< 1200px) ---
   Телефон (< 640px): 6 разделов одной колонкой, кнопка «Подобрать решение»
   на всю ширину снизу. Планшет и узкий ПК (640–1199px): разделы в две
   колонки (по рядам слева направо — как в меню строкой), кнопка снизу.
   Панель и пункты анимируются только через opacity и transform. */
@media (max-width: 1199.98px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px var(--gutter) 22px;
    /* Вырез экрана iPhone в альбомной ориентации не перекрывает пункты */
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    padding-bottom: max(22px, env(safe-area-inset-bottom));
    border-bottom: 1px solid var(--border);
    background: var(--panel-bg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity var(--dur) var(--ease-out),
      transform var(--dur) var(--ease-out),
      visibility 0s linear var(--dur);
  }

  body.nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }

  .site-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--border);
    font-size: 1.0625rem;
    color: var(--text);
    white-space: normal;
    /* Пункты проявляются мягкой «волной» при открытии меню */
    opacity: 0;
    transform: translateY(-6px);
    transition:
      color var(--dur-fast) ease,
      opacity var(--dur) var(--ease-out),
      transform var(--dur) var(--ease-out);
  }

  body.nav-open .site-nav__link {
    opacity: 1;
    transform: none;
    /* Задержка — только у появления; цвет при наведении меняется сразу */
    transition-delay: 0s, var(--nav-delay, 0s), var(--nav-delay, 0s);
  }

  .site-nav__link:nth-child(2) { --nav-delay: 25ms; }
  .site-nav__link:nth-child(3) { --nav-delay: 50ms; }
  .site-nav__link:nth-child(4) { --nav-delay: 75ms; }
  .site-nav__link:nth-child(5) { --nav-delay: 100ms; }
  .site-nav__link:nth-child(6) { --nav-delay: 125ms; }

  /* Вместо подчёркивания — шеврон справа */
  .site-nav__link::after {
    position: static;
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    margin-left: auto;
    margin-right: 5px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    border-radius: 0;
    background: none;
    opacity: .4;
    transform: rotate(45deg);
    transform-origin: center;
    transition: opacity var(--dur-fast) ease;
  }

  .site-nav__link[aria-current="page"] {
    color: var(--accent);
  }

  .site-nav__link[aria-current="page"]::after {
    opacity: 1;
    transform: rotate(45deg);
  }

  .site-nav__cta {
    width: 100%;
    min-height: 50px;
    margin: 18px 0 0;
    font-size: .9375rem;
  }

  /* Затемнение страницы под открытым меню (перехватывает касания,
     чтобы не сработала ссылка под ним; клик по нему закрывает меню) */
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(3, 5, 10, .55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease-out), visibility 0s linear var(--dur);
  }

  body.nav-open::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
}

/* Планшет и узкий ПК: разделы в две колонки, кнопка — на всю ширину снизу */
@media (min-width: 640px) and (max-width: 1199.98px) {
  .site-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(24px, 4vw, 48px);
    padding-top: 10px;
  }

  .site-nav__cta {
    grid-column: 1 / -1;
    margin-top: 20px;
  }
}

/* Наведение мышью в панели (узкое окно на ПК): шеврон ярче, без подчёркивания.
   Правило стоит после общего hover и перекрывает его scaleX(1). */
@media (max-width: 1199.98px) and (hover: hover) and (pointer: fine) {
  .site-nav__link:hover {
    color: var(--accent);
  }

  .site-nav__link:hover::after {
    opacity: 1;
    transform: rotate(45deg);
  }
}


/* ==========================================================================
   10. ПОДВАЛ И СОЦСЕТИ
   ========================================================================== */

.site-footer {
  position: relative;
  padding-block: clamp(48px, 6vw, 72px) 28px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(11, 16, 32, 0), rgba(11, 16, 32, .7));
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 640px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 48px;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
    align-items: start;
  }

  .site-footer__brand {
    grid-column: auto;
  }
}

.site-footer__text {
  max-width: 36ch;
  margin-top: 16px;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.site-footer__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.site-footer__nav a {
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted);
  transition: color var(--dur-fast) ease;
}

.site-footer__nav a[aria-current="page"] {
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__nav a:hover {
    color: var(--text);
  }
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(32px, 5vw, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-muted);
}

/* Контакт в подвале («Написать в Telegram») */
.site-footer__contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--accent);
  transition: color var(--dur-fast) ease;
}

.site-footer__contact .icon {
  width: 18px;
  height: 18px;
}

.site-footer__legal {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .2);
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__contact:hover,
  .site-footer__legal:hover {
    color: var(--text);
  }
}

/* Цена в гривнах рядом с долларовой (заполняет layout.js по data-uah) */
.price__uah {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Соцсети — квадратные кнопки с иконками */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.socials__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .03);
  transition:
    color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    background-color var(--dur-fast) ease,
    transform var(--dur) var(--ease-out);
}

.socials__link .icon {
  width: 20px;
  height: 20px;
}

@media (hover: hover) and (pointer: fine) {
  .socials__link:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, .3);
    background-color: rgba(255, 255, 255, .06);
    transform: translateY(-2px);
  }

  .socials__link[data-link="telegram"]:hover {
    color: var(--tg);
    border-color: rgba(42, 171, 238, .5);
    background-color: rgba(42, 171, 238, .08);
  }

  .socials__link[data-link="instagram"]:hover {
    color: var(--ig);
    border-color: rgba(225, 48, 108, .5);
    background-color: rgba(225, 48, 108, .08);
  }

  .socials__link[data-link="tiktok"]:hover {
    color: var(--tt);
    border-color: rgba(37, 244, 238, .45);
    background-color: rgba(254, 44, 85, .08);
  }

  .socials__link[data-link="youtube"]:hover {
    color: var(--yt);
    border-color: rgba(255, 0, 51, .5);
    background-color: rgba(255, 0, 51, .08);
  }
}


/* ==========================================================================
   11. ФОКУС, REDUCED MOTION, ПЕРЕХОДЫ МЕЖДУ СТРАНИЦАМИ
   ========================================================================== */

/* Видимая рамка фокуса для клавиатуры на всех интерактивных элементах */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.socials__link:focus-visible,
.nav-toggle:focus-visible {
  outline-offset: 2px;
}

/* Плавная смена страниц (где браузер поддерживает; иначе — обычный переход) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 280ms;
  animation-timing-function: var(--ease-out);
}

/* Пользователь просит минимум анимации — отключаем движение глобально */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  .btn--primary:hover,
  .card--glow:hover,
  .socials__link:hover {
    transform: none;
  }

  /* Пункты меню-бургера появляются все сразу, без «волны» */
  body.nav-open .site-nav__link {
    transition-delay: 0s;
  }
}

/* Печать: светлый фон, без шапки-меню и декора */
@media print {
  body {
    color: #000;
    background: #fff;
  }

  .site-header,
  .skip-link,
  .nav-toggle,
  .socials {
    display: none !important;
  }
}
