/* Шапка сайта VANYA с мегаменю по ТЗ 04 — одна на весь сайт (разметка vanya/partials/site-header.ejs, поведение
   js/site-header.js). Подключают head.ejs (старые страницы на Tilda, Bulma и hv-вёрстке), lp2-head.ejs (новые посадочные)
   и 404.ejs. Вид — шапка утверждённых посадочных lp2 (перенесена из lp2.css без изменений значений: на lp2 она не сдвинулась
   ни на пиксель — сверка снимков checks/shot.js до/после, stage5-shots/header).
   Изоляция. Шапка стоит внутри чужих стилей: на Tilda-страницах #allrecords a {color; text-decoration}, #allrecords ul
   {padding-left}, #allrecords b {font-weight} и сброс * {box-sizing: content-box}; на /partners — Bulma (.panel, a:hover,
   img {height: auto}); у hv-страниц свои :root-переменные с теми же именами, что у lp2 (--text, --bg, --surface). Поэтому:
   - каждое правило начинается с #site-header (специфичность id + класс выше любого #allrecords <тег>), классы — с префиксом sh-;
   - переменные свои, --sh-*, объявлены на самой шапке: ни :root страницы, ни тёмная тема кабинета их не меняют;
   - шрифт, кегль, межстрочный, цвет и сглаживание заданы на корне шапки, а не берутся у body страницы;
   - сброс полей и рамок у тегов внутри шапки (а не надежда на то, что их никто не трогал).
   Значения переменных — копия токенов lp2.css (:root, вариант A): поменяли цвет там — поменяйте и здесь.
   Файл кэшируется Cloudflare: ссылка на него идёт с ?v=<хеш содержимого> (SITE_HEADER_ASSETS в front.js), хеш считается
   при старте front.js — после правки на проде нужен рестарт. */

/* Onest — те же файлы и диапазоны, что в lp2.css, только начертания шапки: 400 (подписи пунктов), 500 (пункты, кнопки групп),
   600 (логотип, «Купить VPN»); из extra — 500 (знак валюты в «Попробовать за 10 ₽» и стрелка «→» у «Все …»). На lp2 эти
   правила совпадают с правилами lp2.css; на старых страницах браузер грузит только файлы, символы которых есть в шапке. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/onest/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/onest/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/onest/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/onest/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/onest/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/onest/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/onest/onest-extra-500-normal.woff2) format("woff2"); unicode-range: U+20B4, U+20B8, U+20BA, U+20BC, U+20BD, U+2190, U+2192; }

/* ---------- корень: переменные, шрифт, липкость ---------- */
/* --sh-text / --sh-text-2 / --sh-hover — текст и ховер панелей (всегда тёмное на белом); --sh-ink / --sh-ink-2 / --sh-row-hover —
   текст и ховер строки шапки: на главной поверх обложки они светлые (ниже), в остальном равны первым. */
#site-header {
	--sh-h: 64px;
	--sh-bg: rgba(255, 255, 255, .86);
	--sh-line: rgba(0, 0, 0, .07);
	--sh-text: #1C1C1E;
	--sh-text-2: #6C6C70;
	--sh-divider: #E5E5EA;
	--sh-hover: rgba(120, 120, 128, .1);
	--sh-focus: #1C1C1E;
	--sh-current: #E8101C;
	--sh-ink: var(--sh-text);
	--sh-ink-2: var(--sh-text-2);
	--sh-row-hover: var(--sh-hover);
	--sh-buy-bg: #EFEFF4;
	--sh-buy-hover: #E5E5EA;
	--sh-buy-text: #1C1C1E;
	--sh-panel-bg: #FFFFFF;
	--sh-panel-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 24px 56px -12px rgba(28, 28, 30, .22), 0 6px 18px rgba(28, 28, 30, .06);
	--sh-panel-current: #F2F2F7;
	--sh-font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	position: sticky; top: 0; z-index: 50;
	display: block; margin: 0; padding: 0;
	background: var(--sh-bg);
	-webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
	border: 0; border-bottom: 1px solid var(--sh-line);
	font-family: var(--sh-font); font-size: 17px; font-weight: 400; font-style: normal; line-height: 1.55;
	letter-spacing: normal; word-spacing: normal; text-align: left; text-indent: 0; text-transform: none; text-shadow: none; white-space: normal;
	color: var(--sh-text);
	-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
	font-feature-settings: "kern", "liga";
	-webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
/* сброс внутри шапки: Tilda (* {box-sizing: content-box}, #allrecords ul {padding-left}), Bulma и стили страниц */
#site-header, #site-header *, #site-header *::before, #site-header *::after { box-sizing: border-box; }
#site-header div, #site-header nav, #site-header ul, #site-header li, #site-header p, #site-header a, #site-header b,
#site-header span, #site-header button { margin: 0; padding: 0; border: 0; float: none; }
#site-header ul, #site-header li { list-style: none; }
#site-header a { color: inherit; text-decoration: none; }
#site-header img, #site-header svg { display: block; max-width: 100%; }
#site-header p { text-wrap: pretty; }
#site-header :focus-visible { outline: 2px solid var(--sh-focus); outline-offset: 3px; border-radius: 6px; }
#site-header .sh-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- строка ---------- */
#site-header .sh-row { display: flex; align-items: center; gap: 16px; height: var(--sh-h); position: relative; max-width: 1180px; margin: 0 auto; padding-inline: 24px; }
#site-header .sh-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--sh-ink); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; flex: none; margin-right: auto; }
#site-header .sh-brand img { width: 32px; height: 32px; }
#site-header .sh-brand:hover { color: var(--sh-ink); }

#site-header .sh-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
#site-header .sh-link, #site-header .sh-trigger {
	display: inline-flex; align-items: center; gap: 4px;
	height: 38px; padding: 0 12px; border-radius: 11px;
	font: 500 15px/1 "Onest", system-ui, sans-serif; letter-spacing: -0.005em;
	color: var(--sh-ink); text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap;
	transition: background-color .15s ease;
}
#site-header .sh-link:hover, #site-header .sh-trigger:hover, #site-header .sh-group.is-open > .sh-trigger { background: var(--sh-row-hover); color: var(--sh-ink); }
#site-header .sh-lang { color: var(--sh-ink-2); }
#site-header .sh-chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; opacity: .7; }
#site-header .sh-group.is-open .sh-chev { transform: rotate(180deg); }
/* текущий раздел: группа меню, в которой лежит страница (и «Помощь» на /help) */
#site-header .is-current > .sh-trigger, #site-header .is-current > .sh-link { position: relative; }
#site-header .is-current > .sh-trigger::after { content: ""; position: absolute; left: 12px; right: 28px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--sh-current); }
#site-header .is-current > .sh-link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--sh-current); }
/* «Купить VPN» в шапке тихая: главное действие страницы стоит на первом экране, двух ярких кнопок быть не должно */
#site-header .sh-buy {
	display: inline-flex; align-items: center; height: 38px; padding: 0 16px; margin-right: 6px; border-radius: 999px;
	font: 600 15px/1 "Onest", system-ui, sans-serif; letter-spacing: -0.005em; white-space: nowrap;
	background: var(--sh-buy-bg); color: var(--sh-buy-text); text-decoration: none; box-shadow: var(--buy-ring, none);
	transition: background-color .15s ease;
}
#site-header .sh-buy:hover { color: var(--sh-buy-text); background: var(--sh-buy-hover); }
#site-header .sh-buy--mobile, #site-header .sh-burger { display: none; }

/* ---------- панели групп ---------- */
#site-header .sh-group { position: relative; }
#site-header .sh-panel {
	position: absolute; top: calc(100% + 10px); left: -8px; z-index: 60;
	display: none; grid-template-columns: repeat(2, minmax(250px, 1fr)); gap: 4px 12px;
	padding: 18px; border-radius: 22px;
	background: var(--sh-panel-bg); box-shadow: var(--sh-panel-shadow);
	color: var(--sh-text);
}
#site-header .sh-panel--narrow { grid-template-columns: minmax(270px, 1fr); }
#site-header .sh-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* мост под курсор */
#site-header .sh-group.is-open > .sh-panel { display: grid; }
html:not(.sh-js) #site-header .sh-group:hover > .sh-panel, html:not(.sh-js) #site-header .sh-group:focus-within > .sh-panel { display: grid; }
#site-header .sh-h { padding: 4px 12px 8px; font-size: 13px; font-weight: 500; color: var(--sh-text-2); }
/* подгруппа колонки (волна 2: «Роутер и браузер», «Мобильный интернет») — заголовок под списком колонки, с отступом от него */
#site-header .sh-h--sub { margin-top: 14px; }
#site-header .sh-panel ul { list-style: none; margin: 0; padding: 0; }
#site-header .sh-panel ul a { display: block; padding: 9px 12px; border-radius: 12px; color: var(--sh-text); text-decoration: none; transition: background-color .12s ease; }
#site-header .sh-panel ul a:hover { background: var(--sh-hover); color: var(--sh-text); }
#site-header .sh-panel ul b { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; }
#site-header .sh-panel ul span { display: block; font-size: 13px; line-height: 1.35; color: var(--sh-text-2); margin-top: 2px; }
#site-header .sh-panel ul a[aria-current="page"] { background: var(--sh-panel-current); }
#site-header .sh-panel ul a[aria-current="page"] b::after { content: attr(data-here); margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--sh-text-2); }
/* версии Windows вложены под «VPN для Windows»: это одна ветка, а не отдельная колонка */
#site-header .sh-sub { margin: 2px 0 6px 12px !important; padding-left: 12px !important; border-left: 1px solid var(--sh-divider); }
#site-header .sh-sub a { padding: 6px 12px !important; font-size: 14px; line-height: 1.3; }
#site-header .sh-all { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 12px; border-top: 1px solid var(--sh-divider); font-size: 15px; font-weight: 500; color: var(--sh-text); text-decoration: none; border-radius: 0 0 12px 12px; }
#site-header .sh-all::after { content: "→"; color: var(--sh-text-2); }
#site-header .sh-all:hover { color: var(--sh-text); background: var(--sh-hover); }
#site-header .sh-all[aria-current="page"] { background: var(--sh-panel-current); }

/* ---------- главная: шапка поверх обложки ---------- */
/* На / шапка лежит поверх обложки, а не отдельной полосой над ней: отрицательный отступ поднимает следующий
   блок под неё, sticky сохраняется. Пока страница не прокручена, шапка прозрачная, текст светлый (лёгкое затемнение сверху —
   чтобы он читался и на светлой части фото); после прокрутки (is-solid, js/site-header.js) и с открытым бургером — обычная
   белая. Выпадающие панели белые всегда: их цвета — не --sh-ink. Без JS шапка обычная белая и стоит над обложкой: прокрутку
   некому отследить, а белый текст поверх белой страницы не прочитать. */
#site-header.sh--over { margin-bottom: calc(-1 * var(--sh-h) - 1px); transition: background-color .2s ease, border-color .2s ease; }
html:not(.sh-js) #site-header.sh--over { margin-bottom: 0; }
html.sh-js #site-header.sh--over:not(.is-solid):not(.nav-open) {
	--sh-ink: #FFFFFF;
	--sh-ink-2: rgba(255, 255, 255, .72);
	--sh-row-hover: rgba(255, 255, 255, .14);
	--sh-buy-bg: rgba(255, 255, 255, .16);
	--sh-buy-hover: rgba(255, 255, 255, .26);
	--sh-buy-text: #FFFFFF;
	--sh-focus: #FFFFFF;
	background: linear-gradient(rgba(0, 0, 0, .28), rgba(0, 0, 0, 0)) no-repeat; /* без no-repeat градиент повторился бы в 1 px нижней рамки тёмной полосой */
	-webkit-backdrop-filter: none; backdrop-filter: none;
	border-bottom-color: transparent;
}
/* фокус внутри белой панели — тёмный, как обычно */
html.sh-js #site-header.sh--over .sh-panel { --sh-focus: #1C1C1E; }
/* с открытым бургером строка шапки белая, как выпадающее меню под ней: полупрозрачный фон поверх тёмной обложки был бы серым */
#site-header.sh--over.nav-open { background: var(--sh-panel-bg); }

/* Прыжок по якорю (#buy, #try на главной) ставит цель вплотную к верху окна — под липкую шапку. scroll-margin-top отодвигает
   её на высоту шапки (было в прежней nav-hv). */
#allrecords a[name] { scroll-margin-top: 65px; }

/* ---------- адаптив ---------- */
@media (max-width: 1099px) {
	#site-header { --sh-h: 58px; }
	#site-header .sh-row { gap: 10px; }
	#site-header .sh-buy--mobile { display: inline-flex; height: 36px; padding: 0 14px; font-size: 14px; margin-right: 0; }
	#site-header .sh-burger { display: inline-grid; place-items: center; width: 42px; height: 42px; margin-right: -8px; border: 0; border-radius: 12px; background: none; color: var(--sh-ink); cursor: pointer; }
	#site-header .sh-burger svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
	#site-header .sh-burger[aria-expanded="true"] { background: var(--sh-hover); }
	#site-header .sh-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 1px; max-height: calc(100vh - 58px); max-height: calc(100dvh - 58px); overflow-y: auto; overscroll-behavior: contain; background: var(--sh-panel-bg); box-shadow: var(--sh-panel-shadow); border-radius: 0 0 22px 22px; padding: 10px 16px 18px; }
	#site-header.nav-open .sh-nav { display: block; }
	#site-header .sh-list { flex-direction: column; align-items: stretch; gap: 0; }
	#site-header .sh-item { border-bottom: 1px solid var(--sh-divider); }
	#site-header .sh-item--buy { display: none; } /* «Купить VPN» уже стоит в строке шапки */
	#site-header .sh-item--lang { border-bottom: 0; }
	/* пункты — в белой выпадающей панели: цвета панели, а не строки */
	#site-header .sh-link, #site-header .sh-trigger { width: 100%; height: 52px; padding: 0 6px; justify-content: space-between; font-size: 17px; border-radius: 10px; color: var(--sh-text); }
	#site-header .sh-link:hover, #site-header .sh-trigger:hover, #site-header .sh-group.is-open > .sh-trigger { background: var(--sh-hover); color: var(--sh-text); }
	#site-header .sh-lang { color: var(--sh-text-2); }
	#site-header .is-current > .sh-trigger::after, #site-header .is-current > .sh-link::after { display: none; }
	#site-header .sh-chev { width: 16px; height: 16px; }
	#site-header .sh-panel, #site-header .sh-panel--narrow { position: static; display: none; grid-template-columns: 1fr; box-shadow: none; padding: 0 0 12px; background: none; border-radius: 0; }
	#site-header .sh-panel::before { display: none; }
	#site-header .sh-h { padding: 10px 6px 4px; }
	#site-header .sh-h--sub { margin-top: 4px; }
	#site-header .sh-panel ul a { padding: 8px 6px; }
	#site-header .sh-sub { margin-left: 6px !important; }
	#site-header .sh-all { margin-top: 4px; padding: 12px 6px; border-radius: 0; }

	/* Без JS бургер не открывается, поэтому меню стоит под логотипом строкой ссылок с переносом.
	   В первой итерации оно оставалось внутри строки шапки высотой 58 px и полосой наезжало на крошки и H1.
	   Шапка без JS не липнет: в две-три строки ссылок она заняла бы четверть экрана телефона.
	   Группа с панелью раскрывается по фокусу (:focus-within) и занимает всю ширину, панель встаёт под ней. */
	html:not(.sh-js) #site-header { position: static; }
	html:not(.sh-js) #site-header .sh-row { flex-wrap: wrap; height: auto; min-height: 58px; padding-block: 9px 8px; row-gap: 4px; }
	html:not(.sh-js) #site-header .sh-burger { display: none; }
	html:not(.sh-js) #site-header .sh-nav { display: block; position: static; flex-basis: 100%; margin: 0 0 0 -8px; padding: 0; max-height: none; overflow: visible; background: none; box-shadow: none; border-radius: 0; }
	html:not(.sh-js) #site-header .sh-list { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 0 2px; }
	html:not(.sh-js) #site-header .sh-item { border-bottom: 0; }
	html:not(.sh-js) #site-header .sh-link, html:not(.sh-js) #site-header .sh-trigger { width: auto; height: 36px; padding: 0 8px; font-size: 15px; justify-content: flex-start; }
	html:not(.sh-js) #site-header .sh-group:focus-within { flex-basis: 100%; }
	/* по наведению не открываем: пункт перескакивал бы на новую строку из-под курсора */
	html:not(.sh-js) #site-header .sh-group:hover > .sh-panel { display: none; }
	html:not(.sh-js) #site-header .sh-group:focus-within > .sh-panel { display: grid; padding: 0 8px 10px; }
}

@media (max-width: 767px) {
	#site-header { --sh-h: 56px; font-size: 16px; line-height: 1.5; }
	#site-header .sh-row { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	#site-header, #site-header *, #site-header *::before, #site-header *::after { transition: none !important; }
}
