/* ─────────────────────────────────────────────
   Manttony VPN, сайт manttonyvpn.online.
   Отдельная дизайн-система от Mini App (webapp/index.html): десктоп-первый,
   более "технологичный" язык (сетки, крупная типографика, живая сеть узлов
   на фоне hero), но тот же бренд: акцентный teal и тёмная тема. Без CDN и
   внешних шрифтов, как и остальной проект, только системные шрифты + один
   самостоятельно захостенный вариативный шрифт для заголовков (см. ниже).

   Редизайн (28 июля, доп.): убраны трёхцветные градиенты на кнопках и
   градиентный текст в заголовке - это как раз типичные "нейросетевые"
   маркеры (см. исследование: одинаковый border-radius everywhere,
   фиолетово-синие/бирюзовые градиенты на всём подряд). Вместо этого -
   сплошные уверенные цвета с продуманными hover/press-состояниями, разная
   "ритмика" скругления углов (пилюли на кнопках, более собранные карточки),
   bento-сетка вместо однородной grid-3 на фиче-секции, spotlight-hover
   (курсор подсвечивает карточку изнутри), лёгкая зернистая текстура фона
   для объёма, самостоятельно захостенный дисплейный шрифт Unbounded
   (поддерживает кириллицу) для заголовков вместо системного стека везде.
   ───────────────────────────────────────────── */

@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded-variable.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #05070A;
  --bg-elevated: #0A0F16;
  --surface: rgba(255,255,255,.03);
  --surface-strong: rgba(255,255,255,.06);
  --surface-border: rgba(255,255,255,.08);
  --text: #F3F6F5;
  --text-70: rgba(243,246,245,.72);
  --text-50: rgba(243,246,245,.5);
  --text-40: rgba(243,246,245,.38);

  --accent: #3FE8C4;
  --accent-deep: #1FB89A;
  --accent-glow: rgba(63,232,196,.35);
  --secondary: #7C9CFF;
  --secondary-deep: #5B7BEA;

  --danger: #F98B8B;
  --ok: #3FE8C4;

  --on-accent: #04140F;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --grid-line: rgba(255,255,255,.035);
  --nav-bg: rgba(5,7,10,.72);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Unbounded", var(--font);
  --font-mono: "SF Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;

  --max-width: 1180px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
  --ease: cubic-bezier(.22,.85,.32,1);
}

/* ── Светлая тема - те же значения палитры, что в Mini App (webapp/index.html
   .t-light), переложенные на токены этого файла, чтобы бренд не разъезжался
   между сайтом и приложением. Переключается через data-theme на <html>,
   не системным prefers-color-scheme - выбор пользователя приоритетнее. ── */
:root[data-theme="light"] {
  --bg: #F3F9F7;
  --bg-elevated: #FFFFFF;
  --surface: rgba(14,154,126,.05);
  --surface-strong: rgba(255,255,255,.85);
  --surface-border: rgba(14,154,126,.16);
  --text: #0A2620;
  --text-70: rgba(10,38,32,.72);
  --text-50: rgba(10,38,32,.52);
  --text-40: rgba(10,38,32,.4);

  --accent: #0E9A7E;
  --accent-deep: #076F59;
  --accent-glow: rgba(14,154,126,.25);
  --secondary: #4A63D6;
  --secondary-deep: #3549B0;

  --danger: #D6455F;
  --ok: #1E9E6E;
  --on-accent: #FFFFFF;

  --grid-line: rgba(10,38,32,.045);
  --nav-bg: rgba(243,249,247,.78);
  --shadow: 0 20px 50px -20px rgba(10,38,32,.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Фон: тонкая сетка + свечения + зерно ── */
.bg-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
}
/* Лёгкая зернистость поверх фона - добавляет тактильную глубину, не даёт
   плоскому тёмному фону выглядеть как гладкая нейросетевая заглушка.
   SVG fractalNoise data-URI - без внешнего файла-текстуры. */
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .bg-grain { opacity: .02; mix-blend-mode: multiply; }

/* ── Живой фон вместо статичных пятен - на каждой странице сайта (не
   только на лендинге), медленно дрейфующие пятна-"аврора" на canvas,
   мягко реагирующие на курсор (см. window.initAuroraBackground в
   site-shell.js). Рисуется radial-градиентами, а не CSS filter:blur по
   всему вьюпорту - дешевле по производительности на весь сайт сразу. ── */
.bg-aurora { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .9; }
:root[data-theme="light"] .bg-aurora { opacity: .22; }
@media (prefers-reduced-motion: reduce) { .bg-aurora { display: none; } }

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

/* ── Навигация ── */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px) saturate(140%);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--surface-border);
}
.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 28px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -.01em; margin-right: auto; }
.nav-logo-badge {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface-strong); border: 1px solid var(--surface-border);
  display: flex; align-items: center; justify-content: center;
}
.nav-logo-badge img { width: 22px; height: 22px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links-mobile { display: none; }
.nav-links-theme-row { display: none; }
.nav-links a, .nav-links-mobile a { font-size: 13.5px; font-weight: 600; color: var(--text-50); transition: color .15s var(--ease); position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: var(--accent); border-radius: 2px; transition: right .25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }
.theme-toggle {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--surface-border); color: var(--text-70);
  transition: color .15s ease, background .15s ease, transform .2s var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--surface-strong); transform: rotate(-14deg); }

/* ── Оболочка личного кабинета: постоянная боковая навигация вместо
   маркетингового топ-меню на страницах dashboard/devices/referral/
   settings/support - раньше каждая такая страница просто переиспользовала
   .nav сайта (с пунктами FAQ/Тарифы вперемешку с личными разделами) и свой
   набор кнопок "Настройки"/"Выйти" в шапке контента, из-за чего личный
   кабинет не ощущался цельным разделом. На мобильных - нижний таб-бар
   вместо боковой панели (см. renderAccountShell в site-shell.js). ── */
.account-shell { display: flex; align-items: flex-start; min-height: 100vh; }
.account-sidebar {
  width: 232px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 12px;
  border-right: 1px solid var(--surface-border);
}
.account-sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 8px 10px 22px; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.account-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.account-nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--text-50); border: none; background: none; width: 100%; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.account-nav-link svg { flex-shrink: 0; opacity: .75; transition: opacity .15s ease; }
.account-nav-link:hover { background: var(--surface); color: var(--text); }
.account-nav-link.active { background: var(--surface-strong); color: var(--text); }
.account-nav-link.active svg { opacity: 1; color: var(--accent); }
.account-sidebar-foot { border-top: 1px solid var(--surface-border); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.account-main { flex: 1; min-width: 0; }
.account-topbar { display: flex; justify-content: flex-end; padding: 18px 28px 0; }

/* Нижний таб-бар - виден только на мобильных (см. media-запрос ниже) */
.account-tabbar { display: none; }

@media (max-width: 860px) {
  .account-sidebar { display: none; }
  .account-main { padding-bottom: 78px; }
  .account-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: var(--nav-bg); backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid var(--surface-border);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }
  .account-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 10px; font-weight: 700; color: var(--text-40); border-radius: 10px; }
  .account-tabbar a svg { opacity: .8; }
  .account-tabbar a.active { color: var(--accent); }
  .account-tabbar a.active svg { opacity: 1; }
}

/* ── Кнопки: сплошной цвет вместо трёхцветного градиента, форма пилюли,
   лёгкий "sheen" (световой блик), проходящий по кнопке при наведении -
   осмысленная микро-анимация вместо статичной заливки. ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 24px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; border: none; white-space: nowrap;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease), opacity .15s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 10px 26px -12px var(--accent-glow);
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .65s var(--ease);
}
.btn-primary:hover { background: var(--accent-deep); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 14px 30px -12px var(--accent-glow); transform: translateY(-1px); }
.btn-primary:hover::before { transform: translateX(130%); }
.btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--surface-border); }
.btn-ghost:hover { background: var(--surface-strong); border-color: color-mix(in srgb, var(--accent) 35%, var(--surface-border)); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-lg { height: 54px; padding: 0 32px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-danger-ghost { color: var(--danger); background: rgba(249,139,139,.08); border: 1px solid rgba(249,139,139,.25); border-radius: var(--radius-sm); }

/* ── Карточки: чуть более собранный радиус, чем раньше (14 вместо 16),
   опциональный spotlight-hover - курсор "подсвечивает" карточку изнутри
   (см. .spotlight-card, JS-часть в site-shell.js) вместо статичного фона. ── */
.card {
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius);
  padding: 24px;
}
.card-elevated { background: var(--bg-elevated); box-shadow: var(--shadow); }
.spotlight-card { position: relative; overflow: hidden; transition: border-color .2s ease, transform .25s var(--ease); }
.spotlight-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(360px circle at var(--mx,50%) var(--my,50%), var(--accent-glow), transparent 62%);
  transition: opacity .35s ease;
}
.spotlight-card:hover::before { opacity: .55; }
.spotlight-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--surface-border)); transform: translateY(-2px); }
.spotlight-card > * { position: relative; z-index: 1; }

/* Плитка-контейнер под иконку - замена мягкому диагональному градиенту
   "AI slop"-паттерна (icon в квадрате с fade-заливкой). Плоская
   поверхность + тонкая рамка + едва заметное радиальное свечение сверху. */
.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-strong); border: 1px solid var(--surface-border);
  position: relative; overflow: hidden;
}
.icon-tile::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 25% -10%, var(--accent-glow), transparent 65%);
  opacity: .6; pointer-events: none;
}
.icon-tile svg { position: relative; z-index: 1; }

/* ── Типографика: дисплейный шрифт для заголовков, системный - для текста ── */
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
/* Раньше здесь был градиентный текст (бирюза → сине-фиолетовый) - убран как
   раз потому, что это один из самых узнаваемых "нейросетевых" паттернов.
   Вместо заливки - сплошной акцентный цвет + анимированное подчёркивание
   (штрих SVG дорисовывается после загрузки, см. .mark-underline в hero). */
.grad-text { color: var(--accent); }
p.lead { font-size: 17px; color: var(--text-70); line-height: 1.6; }
.mono { font-family: var(--font-mono); }

/* ── Секции ── */
section { padding: 96px 0; }
.section-head { max-width: 640px; margin: 0 0 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: 32px; margin-top: 12px; }
.section-head p { margin-top: 14px; }

/* ── Сетки ── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Bento-сетка: один "якорный" блок крупнее остальных + разновеликие
   соседи, вместо однородной сетки одинаковых карточек. ── */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 172px; gap: 14px; }
.bento-cell { grid-column: span 1; grid-row: span 1; }
.bento-cell.b-anchor { grid-column: span 2; grid-row: span 2; }
.bento-cell.b-wide { grid-column: span 2; }

/* ── Формы ── */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--text-50); }
.input {
  height: 46px; padding: 0 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--surface-border);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus { outline: none; border-color: var(--accent); background: var(--surface-strong); }
.input::placeholder { color: var(--text-40); }
.form-error { font-size: 12.5px; color: var(--danger); margin-top: -6px; margin-bottom: 12px; min-height: 16px; }
.form-divider { display: flex; align-items: center; gap: 12px; color: var(--text-40); font-size: 12px; margin: 22px 0; }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--surface-border); }

/* ── Значки/пилюли ── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface-strong); border: 1px solid var(--surface-border); color: var(--text-70); }
.pill-accent { color: var(--on-accent); background: var(--accent); border: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--accent-glow); display: inline-block; }

/* ── Скроллбар данных / таблицы ── */
.hairline { height: 1px; background: var(--surface-border); border: none; margin: 0; }

/* ── Footer ── */
footer { border-top: 1px solid var(--surface-border); padding: 48px 0; margin-top: 60px; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text-50); transition: color .15s ease; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12.5px; color: var(--text-40); }

/* ── Утилиты ── */
.center { text-align: center; }
.hidden { display: none !important; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated); border: 1px solid var(--surface-border); border-radius: 12px;
  padding: 13px 18px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100; max-width: 340px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Появление секций при скролле - используется на нескольких страницах,
   не только на лендинге, поэтому вынесено сюда, а не в inline <style>. ── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > * { animation: revealStagger .5s var(--ease) backwards; }
.reveal-stagger.in > *:nth-child(1) { animation-delay: .04s; }
.reveal-stagger.in > *:nth-child(2) { animation-delay: .09s; }
.reveal-stagger.in > *:nth-child(3) { animation-delay: .14s; }
.reveal-stagger.in > *:nth-child(4) { animation-delay: .19s; }
.reveal-stagger.in > *:nth-child(5) { animation-delay: .24s; }
.reveal-stagger.in > *:nth-child(6) { animation-delay: .29s; }
@keyframes revealStagger { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 860px) {
  section { padding: 64px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .bento-cell, .bento-cell.b-anchor, .bento-cell.b-wide { grid-column: span 1; grid-row: span 1; }
  .section-head h2 { font-size: 26px; }
  /* Шапка на мобильных: раньше здесь одновременно теснились переключатель
     темы, кнопка "Подключить VPN" и гамбургер - суммарно шире экрана,
     гамбургер обрезался за край. Тема переехала внутрь мобильной панели
     (см. .nav-links-theme-row + JS в renderNav), поля/зазоры сжаты. */
  .nav-inner { padding: 12px 16px; gap: 12px; }
  .nav-logo { font-size: 14.5px; }
  .nav-logo-badge { width: 30px; height: 30px; }
  .nav-actions { gap: 8px; }
  .nav-actions .theme-toggle { display: none; }
  .nav-links { display: none; }
  .nav-links-mobile { position: fixed; top: 60px; left: 0; right: 0; bottom: 0; z-index: 39; background: var(--bg); flex-direction: column; align-items: flex-start; padding: 20px 20px; gap: 4px; display: none; border-top: 1px solid var(--surface-border); overflow-y: auto; }
  .nav-links-mobile.open { display: flex; }
  .nav-links-mobile a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--surface-border); }
  .nav-links-theme-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 0 4px; }
  .nav-links-theme-row span { font-size: 13.5px; font-weight: 600; color: var(--text-50); }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--surface-border); color: var(--text); flex-shrink: 0; }
  .nav-actions .btn-ghost { display: none; }
  .nav-actions .btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  h1 { font-size: 32px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary::before { display: none; }
  .spotlight-card::before { display: none; }
}
