/* ==========================================================================
   VPN — дизайн-система. Все цвета и размеры живут здесь, в токенах.
   Внешних ресурсов (шрифты, CDN, аналитика) нет и быть не должно:
   часть аудитории открывает сайт из-под блокировок.
   ========================================================================== */

:root {
  /* палитра */
  --bg:          #0e0e10;
  --surface:     #17171a;
  --surface-2:   #202024;
  --line:        #2b2b30;
  --text:        #f4f4f5;
  --muted:       #a1a1aa;
  --accent:      #ffdd2d;
  --accent-dim:  #e6c21f;
  --accent-ink:  #0e0e10;

  /* типографика: локальный гротеск подставится сюда, когда появится
     assets/fonts/*.woff2 — стек ниже остаётся как фолбэк */
  --font: "VPN Grotesk", system-ui, -apple-system, "Segoe UI",
          "Helvetica Neue", Arial, sans-serif;

  /* затемнение карты на фоне: больше альфа — темнее и тише карта */
  --scrim-top: rgba(14, 14, 16, .62);
  --scrim-mid: rgba(14, 14, 16, .86);
  --scrim-bottom: rgba(14, 14, 16, .97);
  --map-pos: center 9vh;
  --map-size: min(1700px, 168%);

  /* ритм */
  --gutter: 20px;
  --maxw: 1080px;
  --radius: 14px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--accent); color: var(--accent-ink); }

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

/* фон: точечная карта мира с дугами маршрутов, поверх неё — затемнение,
   сетка и жёлтое свечение. Карта лежит в репозитории, запросов наружу нет.
   Яркость карты регулируется альфой в --scrim-*. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 70% -10%, rgba(255, 221, 45, .07), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 100% 88px,
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 88px 100%,
    linear-gradient(180deg, var(--scrim-top), var(--scrim-mid) 46%, var(--scrim-bottom)),
    url("../img/world-routes.svg") var(--map-pos) / var(--map-size) auto no-repeat;
}

/* ---------- раскладка ---------- */

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

.section { padding-block: clamp(56px, 9vw, 104px); }
.section--tight { padding-block: clamp(40px, 6vw, 64px); }

.section__label {
  margin: 0 0 28px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
}
.section__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- шапка ---------- */

.header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: rgba(14, 14, 16, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  text-transform: uppercase;
  text-decoration: none;
}
.logo__mark {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav__link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* Кнопка входа — задел под личный кабинет; в разметке пока закомментирована,
   вернётся ссылкой на /account. */
.header .btn { padding: 8px 16px; font-size: 14px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background-color .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 rgba(255, 221, 45, .45);
}
.btn--primary:hover { background: #ffe55c; box-shadow: 0 0 34px -6px rgba(255, 221, 45, .55); }

.btn--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--muted); background: var(--surface-2); }

.btn__icon { width: 18px; height: 18px; flex: none; }

/* ---------- земной шар, разлетающийся иконками ---------- */

/* --p: прогресс разлёта, 0 — всё собрано в шаре, 1 — иконки на местах.
   По умолчанию 1: без JS блок просто сразу собран. */
.burst {
  --p: 1;
  --burst-scale: 1;
  position: relative;
  height: calc(380px * var(--burst-scale));
  display: flex;
  align-items: center;
  justify-content: center;
}

.burst__stage {
  position: relative;
  width: 0;
  height: 0;
  transform: scale(var(--burst-scale));
}

.burst__globe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  color: var(--accent);
  opacity: calc(.32 + .38 * var(--p));
  filter: drop-shadow(0 0 40px rgba(255, 221, 45, calc(.10 + .14 * var(--p))));
}

/* кольцо ударной волны: расходится и гаснет по мере разлёта */
.burst__ring {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(.55 + 1.15 * var(--p)));
  opacity: calc(.5 - .5 * var(--p));
}

.burst__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  color: var(--accent);
  opacity: calc(.18 + .52 * var(--p));
  transform:
    translate(calc(var(--x) * var(--p)), calc(var(--y) * var(--p)))
    rotate(calc(var(--r) * var(--p)))
    scale(calc(.28 + .72 * var(--p)));
  filter: drop-shadow(0 0 16px rgba(255, 221, 45, .22));
  will-change: transform;
}
.burst__icon svg { width: 100%; height: 100%; display: block; }

/* заголовка у блока нет, поэтому и воздух вокруг него меньше */
#reach { padding-block: clamp(20px, 3vw, 36px); }

/* «Стоимость» идёт сразу за hero, а «Оформить подписку» — за тезисами:
   сверху им хватает меньшего отступа, чем секции по умолчанию */
#plans     { padding-top: clamp(14px, 2.4vw, 26px); }
#subscribe { padding-top: clamp(16px, 2.8vw, 32px); }

.burst__note {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 1100px) { .burst { --burst-scale: .74; } }
@media (max-width: 760px)  { .burst { --burst-scale: .5; } }
@media (max-width: 460px)  { .burst { --burst-scale: .38; } }

/* ---------- hero ---------- *//* ---------- hero ---------- */

.hero { padding-block: clamp(64px, 12vw, 132px) clamp(40px, 7vw, 72px); }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  margin: 0;
  font-size: clamp(42px, 9vw, 88px);
  line-height: .96;
  font-weight: 800;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__lead {
  max-width: 46ch;
  margin: 26px 0 0;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* ---------- тарифы ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.plan--featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 221, 45, .07), transparent 55%), var(--surface);
}

.plan__badge {
  position: absolute;
  top: -11px;
  left: 30px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.plan__term {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.plan--featured .plan__price { color: var(--accent); }
.plan__currency { font-size: .5em; font-weight: 700; }

.plan__note {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- платформы ---------- */

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.platform {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.platform svg { width: 17px; height: 17px; flex: none; color: var(--accent); }

/* подпись к строке платформ внутри «Коротко» */
.subcap {
  margin: 28px 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- тезисы ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.fact {
  padding: 26px 24px;
  background: var(--surface);
}
.fact__num {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--accent);
}
.fact__title {
  margin: 10px 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.fact__text {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- CTA ---------- */

.cta {
  padding: clamp(32px, 6vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(38rem 18rem at 85% 0%, rgba(255, 221, 45, .12), transparent 62%),
    var(--surface);
}
.cta__title {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -.035em;
  text-transform: uppercase;
  line-height: 1.02;
}
.cta__text {
  max-width: 44ch;
  margin: 16px 0 0;
  color: var(--muted);
}
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.cta__hint {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- футер ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  font-size: 14px;
  color: var(--muted);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}
.footer__links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------- новости ---------- */

.notice {
  margin-bottom: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  color: var(--muted);
}
.notice p { margin: 0; }
.notice p + p { margin-top: 8px; }
.notice__title { font-weight: 700; color: var(--text); }
.notice b { color: var(--text); }
.notice a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(255, 221, 45, .4); }
.notice__ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  white-space: nowrap;
}

.news { display: grid; gap: 14px; }

.post {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.post__date {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.post__text {
  margin: 12px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.post__text b, .post__text strong { font-weight: 700; }
.post__text a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(255, 221, 45, .4); }
.post__text code, .post__text pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 1px 5px;
}
.post__text pre { display: block; padding: 12px 14px; overflow-x: auto; }
.post__text blockquote {
  margin: 10px 0;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
.post__text .spoiler { background: var(--surface-2); color: transparent; border-radius: 4px; }
.post__text .spoiler:hover { color: inherit; background: none; }

.post__media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.post__img {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
/* фото не обрезаем: вертикальные снимки вписываются целиком */
.post__img--zoom {
  object-fit: contain;
  background: var(--surface-2);
  cursor: zoom-in;
}
.post__img--zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lightbox {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.post__file { position: relative; }
.post__filelabel {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 14, 16, .8);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.post__file:not(:has(.post__img)) .post__filelabel { position: static; display: inline-block; }

.post__link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.post__link:hover { color: var(--accent); border-color: var(--accent); }

.state {
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}
.state a { color: var(--accent); }

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

@media (max-width: 720px) {
  /* на телефоне показываем не весь глобус, а приближённый кусок вокруг Европы */
  :root { --map-pos: 51% 6vh; --map-size: 1000px; }

  .plans { grid-template-columns: 1fr; }
  .header__inner { min-height: 58px; gap: 10px; }
  .nav { margin-left: 0; }
  .nav__link { padding: 8px 10px; }
  .hero__actions .btn, .cta__actions .btn { flex: 1 1 100%; }
  .footer__links { margin-left: 0; width: 100%; }
}

/* Узкие экраны: шапка целиком не помещалась — логотип, вкладки и «Вход»
   в сумме были шире экрана, и страница уезжала вбок. Ужимаем всё разом. */
@media (max-width: 560px) {
  .header__inner { gap: 8px; }
  .logo { font-size: 16px; gap: 8px; }
  .logo__mark { width: 22px; height: 22px; }
  .nav { gap: 2px; }
  .nav__link { padding: 7px 9px; font-size: 13px; }
  .header .btn { padding: 7px 13px; font-size: 13px; }
}

/* Совсем узкие: «Вход» уступает место вкладкам — это задел под ЛК,
   а призыв подписаться на странице и так повторяется дважды. */
@media (max-width: 430px) {
  .header .btn { display: none; }

  /* у кнопок nowrap: на узком экране «Связаться в Telegram» не помещалась
     в строку и растягивала страницу */
  .btn { padding-inline: 20px; white-space: normal; }
  .cta__actions .btn, .hero__actions .btn { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
