/* =========================================================================
   kptVPN — сайт в стиле личного кабинета (miniapp.kptvpn.ru)
   Палитра, скругления и кнопки — как в кабинете. Шрифт Manrope (на нём
   кабинет фактически отображает кириллицу). Вместо декоративных иконок —
   фрагменты настоящего интерфейса: щит подключения, выбор маршрута,
   переключатель DNS, ключ подписки, экран кабинета.
   ========================================================================= */

:root {
  --bg: #07130e;
  --panel: #0d1c16;
  --panel-2: #122319;
  --inset: #0a1611;
  --input: #14251c;
  --input-line: #30483a;
  --line: rgba(174, 200, 189, 0.12);
  --line-2: rgba(174, 200, 189, 0.2);
  --text: #f1f8f5;
  --text-2: #b4c9c0;
  --muted: #86a49a;
  --muted-2: #607a70;
  --accent: #047857;
  --accent-hover: #059669;
  --mint: #34d399;
  --mint-2: #6ee7b7;
  --ink: #04140d;
  --amber: #fbbf24;
  --red: #f87171;

  --f-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 68px;
  color-scheme: dark;
}

/* ---------- База ---------- */

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

[hidden] { display: none !important; }
.svg-defs { position: absolute; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 560px at 78% -6%, rgba(4, 120, 87, 0.2), transparent 70%) no-repeat,
    var(--bg);
  color: var(--text);
  font: 500 16px/1.6 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { overflow-x: clip; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
small { font-size: inherit; }

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

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
}

@media (min-width: 720px) {
  .container { width: min(100% - 80px, 1180px); }
}

.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.text-link {
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  transition: color 0.2s, border-color 0.2s;
}
.text-link:hover { color: var(--mint-2); border-color: var(--mint); }

/* Появление при скролле */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s ease calc(var(--d, 0) * 70ms),
    transform 0.8s var(--ease) calc(var(--d, 0) * 70ms);
}

/* ---------- Кнопки, плашки, панели ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: 700 14.5px/1 var(--f-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn .icon { width: 17px; height: 17px; transition: transform 0.3s var(--ease); }
.btn:hover .icon--arrow { transform: translateX(3px); }
.platform .btn:hover .icon { transform: translateY(2px); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--input); border-color: var(--input-line); color: var(--text); }
.btn--secondary:hover { background: #182c22; border-color: #3f5e4c; }
.btn--disabled { border: 1px dashed var(--line-2); color: var(--muted); cursor: default; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 22px; font-size: 15.5px; }
.btn--block { width: 100%; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 28, 22, 0.8);
  color: var(--text-2);
  font: 600 12.5px/1 var(--f-sans);
  white-space: nowrap;
}
.pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: background 0.3s, box-shadow 0.3s;
}
.pill--on { border-color: rgba(52, 211, 153, 0.3); color: var(--mint-2); }
.pill--on i { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.pill--status { margin-bottom: 22px; }
.pill--status i { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.pill--status[data-state="degraded"] i { background: var(--amber); box-shadow: none; }
.pill--status[data-state="down"] i { background: var(--red); box-shadow: none; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0f2019, #0c1a14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s, box-shadow 0.4s;
}
/* Наклон за курсором и блик — координаты ставит JS */
[data-tilt] { transform-style: preserve-3d; }
[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(110, 231, 183, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
[data-tilt]:hover {
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-tilt]:hover::after { opacity: 1; }

.icon-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 12px;
  background: rgba(4, 120, 87, 0.18);
  color: var(--mint-2);
}
.icon-box .icon { width: 20px; height: 20px; }
.icon-box--lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-box--lg .icon { width: 26px; height: 26px; }

/* ---------- Шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.is-scrolled .header {
  background: rgba(7, 19, 14, 0.85);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 18px/1 var(--f-sans);
  letter-spacing: -0.02em;
}
.logo__mark { width: 28px; height: 28px; }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav__link { position: relative; color: var(--muted); font-size: 14px; font-weight: 600; transition: color 0.2s; }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link:hover,
.nav__link.is-active { color: var(--text); }

.header__actions { display: flex; align-items: center; gap: 12px; }

.burger {
  display: none;
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: var(--input);
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 21px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 17.5px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { top: 17.5px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */

.hero { padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 6vw, 72px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 540px;
  align-items: center;
  gap: 64px;
}
.hero__copy { display: flex; flex-direction: column; align-items: flex-start; }

.hero__title {
  font: 800 clamp(34px, 5.4vw, 70px)/1.04 var(--f-sans);
  letter-spacing: -0.035em;
}
.hero__accent { color: var(--mint); }

.hero__lead {
  max-width: 31em;
  text-wrap: pretty;
  margin-top: 22px;
  color: var(--text-2);
  font-size: 17px;
  font-weight: 500;
}

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

.hero__platforms {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 13.5px;
}
.hero__platforms .icon { width: 17px; height: 17px; color: var(--text-2); }
.hero__platforms span { margin-left: 4px; }

/* Сцена со щитом (как на странице входа в кабинет) + плавающая панель подключения */
.hero__visual {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 600px;
  perspective: 1200px;
}

.scene-glow {
  position: absolute;
  inset: 6% 4% 14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(16, 185, 129, 0.22), rgba(4, 120, 87, 0.08) 55%, transparent);
  filter: blur(10px);
  opacity: 0.75;
  animation: breathe 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.scene {
  position: relative;
  width: min(100%, 560px);
  cursor: pointer;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.scene__svg { width: 100%; height: auto; overflow: visible; animation: drift 8s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.scene__core { opacity: 0.55; transition: opacity 1s; }
.scene__orbit { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scene__comet { opacity: 0; animation: appear 0.6s ease 1.6s forwards; }
@keyframes appear { to { opacity: 1; } }
.scene__floor { transform-origin: 300px 590px; animation: floor 8s ease-in-out infinite; }
@keyframes floor {
  0%, 100% { transform: scaleX(1); opacity: 0.85; }
  50% { transform: scaleX(0.9); opacity: 0.6; }
}
.scene__sweep { transform: translateX(-160px); animation: sweep 5.5s ease-in-out 1s infinite; }
@keyframes sweep {
  0% { transform: translateX(-160px); }
  45%, 100% { transform: translateX(760px); }
}
.scene__spark { transform-box: fill-box; transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.15); }
}

.scene__shield { filter: saturate(0.55) brightness(0.8); transition: filter 1s var(--ease); }
.scene__edge { opacity: 0.7; transition: opacity 1s; }
.scene__lock { opacity: 0.7; transition: opacity 0.6s; }
.scene__shackle { transform: translateY(-14px); transition: transform 0.5s var(--ease); }

.scene__pulse { opacity: 0; transform-origin: 300px 307px; }
[data-scene-state="on"] .scene__pulse { animation: pulse 2.8s ease-out infinite; }
[data-scene-state="on"] .scene__pulse--late { animation-delay: 1.4s; }
@keyframes pulse {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.22); }
}

[data-scene-state="connecting"] .scene__shield { filter: saturate(0.85) brightness(0.95); }
[data-scene-state="connecting"] .scene__edge { animation: blink 0.7s steps(2) infinite; }
[data-scene-state="on"] .scene__shield { filter: none; }
[data-scene-state="on"] .scene__edge { opacity: 1; }
[data-scene-state="on"] .scene__core { opacity: 1; }
[data-scene-state="on"] .scene__lock { opacity: 1; }
[data-scene-state="on"] .scene__shackle { transform: none; }

/* Стеклянная панель подключения */
.widget {
  position: absolute;
  right: -28px;
  bottom: 6px;
  z-index: 2;
  width: 300px;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: rgba(13, 28, 22, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.6s var(--ease);
}
.widget__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.widget__brand { display: inline-flex; align-items: center; gap: 8px; font: 800 14.5px/1 var(--f-sans); letter-spacing: -0.01em; }
.widget__brand .logo__mark { width: 20px; height: 20px; }
.widget[data-state="on"] [data-app-pill] { border-color: rgba(52, 211, 153, 0.3); color: var(--mint-2); }
.widget[data-state="on"] [data-app-pill] i { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.widget[data-state="connecting"] [data-app-pill] i { background: var(--amber); animation: blink 0.8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.connect {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--input-line);
  border-radius: 16px;
  background: var(--input);
  text-align: left;
  cursor: pointer;
  transition: background 0.5s, border-color 0.5s, box-shadow 0.6s;
}
.connect:hover { border-color: #3f5e4c; }
.connect__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a3127;
  color: var(--text-2);
  transition: background 0.5s, color 0.3s;
}
.connect__icon .icon { width: 22px; height: 22px; }
.connect__icon::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid transparent;
  border-top-color: var(--mint);
  border-radius: 50%;
  opacity: 0;
}
.connect__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.connect__text b { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }
.connect__text small { color: var(--muted); font-size: 12.5px; }
.connect__switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #2a3d34;
  transition: background 0.4s;
}
.connect__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cfe3da;
  transition: left 0.4s var(--ease), background 0.4s;
}
.widget[data-state="connecting"] .connect__icon::after { opacity: 1; animation: spin 0.8s linear infinite; }
.widget[data-state="connecting"] .connect__switch::after { left: 11px; }
.widget[data-state="on"] .connect {
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(135deg, rgba(4, 120, 87, 0.45), rgba(4, 120, 87, 0.18));
  box-shadow: 0 10px 30px -12px rgba(16, 185, 129, 0.6);
}
.widget[data-state="on"] .connect__icon { background: var(--mint); color: var(--ink); }
.widget[data-state="on"] .connect__text small { color: var(--mint-2); }
.widget[data-state="on"] .connect__switch { background: var(--mint); }
.widget[data-state="on"] .connect__switch::after { left: 21px; background: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.widget__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 0;
}
.widget__stats div { padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 19, 14, 0.5); }
.widget__stats dt { color: var(--muted); font-size: 11px; font-weight: 600; }
.widget__stats dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; white-space: nowrap; transition: color 0.4s; }
.widget[data-state="on"] [data-app-dns] { color: var(--mint-2); }

.toast {
  position: absolute;
  top: 64px;
  left: -8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 12px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-md);
  background: rgba(16, 35, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.toast.is-show { opacity: 1; transform: none; }
.toast__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--ink);
}
.toast__icon .icon { width: 16px; height: 16px; }
.toast b { display: block; font-size: 13.5px; font-weight: 700; }
.toast small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Цифры ---------- */

.stats { padding-bottom: clamp(24px, 4vw, 40px); }
.stats__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; padding: 22px; }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat__label { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat__value { margin: 18px 0 4px; font-size: clamp(30px, 3vw, 38px); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.stat__text { color: var(--muted); font-size: 14px; }

/* ---------- Секции ---------- */

.section { padding: clamp(72px, 9vw, 112px) 0 0; }
.section__head { max-width: 640px; margin-bottom: 32px; }
.section__title {
  font: 800 clamp(30px, 3.6vw, 44px)/1.1 var(--f-sans);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.section__lead { margin-top: 12px; color: var(--text-2); font-size: 16.5px; }

/* Фрагменты интерфейса */
.feature__ui {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--inset);
}
.ui-option,
.ui-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.ui-row { justify-content: space-between; }
.ui-option.is-selected { border-color: rgba(52, 211, 153, 0.45); background: rgba(4, 120, 87, 0.14); }
.ui-radio {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted-2);
  border-radius: 50%;
}
.is-selected .ui-radio { border-color: var(--mint); background: var(--mint); box-shadow: inset 0 0 0 3px var(--inset); }
.ui-option__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.ui-option__text b { font-size: 14px; font-weight: 700; }
.ui-option__text small { color: var(--muted); font-size: 12.5px; }
.ui-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--mint-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.ui-tag .icon { width: 12px; height: 12px; }
.ui-tag--muted { background: rgba(174, 200, 189, 0.08); color: var(--text-2); }

.ui-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--mint);
  transition: background 0.3s;
}
.ui-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 21px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.3s var(--ease);
}

.ui-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ui-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: var(--input);
}
.ui-field__value { flex: 1; overflow: hidden; color: var(--text-2); font-size: 14px; letter-spacing: 0.08em; white-space: nowrap; }
.ui-field__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.ui-field__btn .icon { width: 15px; height: 15px; }
.is-copied .ui-field__btn { background: var(--mint); color: var(--ink); }
.is-copied .ui-field { border-color: rgba(52, 211, 153, 0.45); }

.ui-dash__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 4px; }
.ui-dash__head b { font-size: 15px; font-weight: 800; }
.ui-dash__tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ui-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.ui-tile .icon { width: 18px; height: 18px; margin-bottom: 6px; color: var(--mint-2); }
.ui-tile b { font-size: 13.5px; font-weight: 700; }
.ui-tile small { color: var(--mint-2); font-size: 12px; }

/* ---------- «Всё работает само»: история при прокрутке ---------- */

.story { padding-top: clamp(72px, 9vw, 112px); }
.story .section__head { margin-bottom: 12px; }
.story__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 48px;
}
/* Без JS главы просто идут друг под другом */
.story__chapters { display: flex; flex-direction: column; gap: 48px; }
.story__nav { display: none; }
.story__visual { position: relative; display: grid; place-items: center; }
.story__svg { width: min(100%, 680px); height: auto; overflow: visible; }

.story__chapter h3 { font-size: clamp(26px, 2.8vw, 36px); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
.story__chapter p { max-width: 30em; margin-top: 12px; color: var(--text-2); font-size: 16.5px; }
.story__chapter .feature__ui { max-width: 420px; margin-top: 24px; }
.story__cta { margin-top: 16px; }

.connect--static { cursor: default; border-color: rgba(52, 211, 153, 0.45); background: linear-gradient(135deg, rgba(4, 120, 87, 0.45), rgba(4, 120, 87, 0.18)); }
.connect--static:hover { border-color: rgba(52, 211, 153, 0.45); }
.connect--static .connect__icon { background: var(--mint); color: var(--ink); }
.connect--static .connect__text small { color: var(--mint-2); }
.connect--static .connect__switch { background: var(--mint); }
.connect--static .connect__switch::after { left: 21px; background: #fff; }

/* С JS: сцена закреплена, главы сменяются по мере прокрутки */
.js .story__track { height: 420vh; height: 420svh; }
.js .story__sticky {
  position: sticky;
  top: var(--header-h);
  display: flex;
  align-items: center;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  overflow: hidden;
}
.js .story__grid { width: min(100% - 80px, 1180px); }
.js .story__nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.story__nav li {
  position: relative;
  padding-top: 14px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.3s;
}
.story__nav li span { display: block; margin-bottom: 2px; font: 500 11px/1 var(--f-mono); }
.story__nav li i {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.story__nav li i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mint);
  transform: scaleX(var(--fill, 0));
  transform-origin: 0 50%;
}
.story__nav li.is-active { color: var(--text); }
.story__nav li.is-active span { color: var(--mint); }

.js .story__chapters { display: grid; }
.js .story__chapter {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.6s var(--ease);
}
.js .story__chapter.is-active { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0.08s; }

.story__shield { animation: drift 8s ease-in-out infinite; }
.story__shackle { transform: translateY(-14px); transition: transform 0.6s var(--ease); }
.story__visual.is-locked .story__shackle { transform: none; }

.ov { opacity: 0; transition: opacity 0.6s ease; }
.story__visual[data-step="0"] .ov--connect,
.story__visual[data-step="1"] .ov--route,
.story__visual[data-step="2"] .ov--dns,
.story__visual[data-step="3"] .ov--panel { opacity: 1; }
.ov__wave { opacity: 0; transform-origin: 300px 307px; animation: pulse 2.8s ease-out infinite; }
.ov__wave--late { animation-delay: 1.4s; }
.ov__draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease) 0.2s; }
.story__visual[data-step="1"] .ov__draw { stroke-dashoffset: 0; }
.ov__label { fill: var(--muted); font: 500 15px var(--f-mono); }
.ov__label--accent { fill: var(--mint); }
.ov__label--warn { fill: var(--amber); }

.ov--panel {
  position: absolute;
  right: 0;
  bottom: 10%;
  z-index: 2;
  width: 300px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: rgba(13, 28, 22, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.85);
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.7s var(--ease);
}
.story__visual[data-step="3"] .ov--panel { transform: none; }
.ov--panel .ui-dash__tiles { margin-top: 10px; gap: 6px; }
.ov--panel .ui-tile { padding: 10px 9px; }
.ov--panel .ui-tile b { font-size: 12.5px; }
.ov--panel .ui-tile small { font-size: 11.5px; }

/* Как начать */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.step__num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 50%;
  background: rgba(4, 120, 87, 0.2);
  color: var(--mint-2);
  font-size: 14px;
  font-weight: 800;
}
.step b { font-size: 16px; font-weight: 700; }
.step small { color: var(--muted); font-size: 14px; }

/* Скачать */
.platforms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.platform { display: flex; flex-direction: column; align-items: flex-start; padding: 22px; }
.platform .icon-box { margin-bottom: 16px; }
.platform__name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.platform__text { margin: 2px 0 20px; color: var(--muted); font-size: 14px; }
.platform .btn { margin-top: auto; }
.platform__meta { margin-top: 8px; align-self: center; color: var(--muted-2); font-size: 12px; }
.platform.is-soon .icon-box { border-color: var(--line); background: rgba(174, 200, 189, 0.06); color: var(--muted); }
.platform.is-soon .platform__name { color: var(--text-2); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.faq__heading { font: inherit; }
.faq__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  background: none;
  text-align: left;
  font: 700 15.5px/1.45 var(--f-sans);
  cursor: pointer;
  transition: color 0.2s;
}
.faq__trigger:hover { color: var(--mint-2); }
.faq__chev { display: grid; color: var(--muted); transition: transform 0.3s var(--ease); }
.is-open .faq__chev { transform: rotate(90deg); color: var(--mint-2); }
.faq__item.is-open { border-color: var(--line-2); }
.faq__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.faq__panel > div { overflow: hidden; }
.faq__panel p { padding: 0 20px 20px; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.is-open .faq__panel { grid-template-rows: 1fr; }
.no-js .faq__panel { grid-template-rows: 1fr; }

/* Telegram */
.contacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 100%;
  padding: 20px;
  transition: border-color 0.2s, background 0.2s;
}
.contact__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.contact__go { display: grid; color: var(--muted); transition: color 0.2s, transform 0.3s var(--ease); }
.contact__label { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.contact__handle { color: var(--mint); font-size: 13px; }
.contact__text { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.contact:hover { border-color: rgba(52, 211, 153, 0.35); background: linear-gradient(180deg, #11261d, #0d1d16); }
.contact:hover .contact__go { color: var(--mint-2); transform: translate(2px, -2px); }

/* ---------- 404 ---------- */

.notfound { min-height: calc(100vh - var(--header-h) - 200px); padding-top: clamp(64px, 10vw, 120px); }
.notfound__code { display: block; margin-bottom: 12px; color: var(--mint); font-size: 56px; font-weight: 500; line-height: 1; }
.notfound__title { font: 800 clamp(36px, 4.8vw, 58px)/1.06 var(--f-sans); letter-spacing: -0.035em; }
.notfound__lead { max-width: 36em; margin-top: 12px; color: var(--text-2); font-size: 17px; }

/* ---------- Подвал ---------- */

.footer { margin-top: clamp(80px, 10vw, 120px); border-top: 1px solid var(--line); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  padding: 40px 0 32px;
}
.footer__brand p { max-width: 26em; margin-top: 12px; color: var(--muted); font-size: 14px; }
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  color: var(--muted-2);
  font-size: 13px;
}
.footer__docs { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer__docs a { color: var(--text-2); transition: color 0.2s; }
.footer__docs a:hover { color: var(--mint-2); }

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

@media (max-width: 1120px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) 460px; gap: 32px; }
  .hero__visual { min-height: 540px; }
  .widget { right: 0; width: 290px; }
}

@media (max-width: 960px) {
  .burger { display: block; }
  .header__inner { gap: 16px; }
  .header__actions { margin-left: auto; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 6px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .header.is-open { background: var(--bg); border-bottom-color: var(--line); }
  .header.is-open .nav { display: flex; }
  .nav__link { padding: 14px 0; color: var(--text-2); font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav__link:last-child { border-bottom: 0; }

  .hero__grid { grid-template-columns: 1fr; gap: 24px; }
  .hero__visual { display: block; width: 100%; max-width: 520px; min-height: 0; margin-inline: auto; }
  .scene { width: min(100%, 440px); margin-inline: auto; }
  .widget { position: relative; right: auto; bottom: auto; width: 100%; max-width: 380px; margin: -70px auto 0; transform: none; }
  .toast { top: 24px; left: 50%; transform: translate(-50%, -8px); }
  .toast.is-show { transform: translate(-50%, 0); }

  .story__grid { grid-template-columns: 1fr; gap: 32px; }
  .story__visual { order: -1; }
  .js .story__grid {
    width: min(100% - 32px, 560px);
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: center;
    gap: 16px;
    padding-block: 12px;
  }
  .js .story__visual { height: 100%; min-height: 0; }
  .js .story__svg { width: 100%; height: 100%; max-height: 46svh; }
  .js .story__nav { margin-bottom: 18px; }
  .story__nav li { font-size: 12px; }
  .ov--panel { width: 290px; bottom: 0; }
  .steps,
  .platforms,
  .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero__actions { width: 100%; flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .scene { width: min(100%, 320px); }
  .widget { margin-top: -48px; }

  .stats__grid,
  .steps,
  .contacts { grid-template-columns: 1fr; }
  .ui-tile { padding: 10px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 960px) and (max-height: 860px) {
  .js .story__chapter .feature__ui { display: none; }
}

@media (max-width: 640px) {
  .ov--panel { width: 232px; padding: 12px; }
  .ov--panel .pill { padding: 4px 8px; font-size: 11px; }
  .ov--panel .ui-tile small { display: none; }
  .ov--panel .ui-tile b { font-size: 11px; }
  .ov--panel .ui-tile .icon { margin-bottom: 2px; }
}

@media (max-width: 400px) {
  .story__nav li { font-size: 0; }
  .story__nav li span { margin: 0; font-size: 11px; }
}

@media (max-width: 420px) {
  .platforms { grid-template-columns: 1fr; }
}

/* ---------- Режимы анимаций ----------
   reduce-motion (системная настройка): без «наездов» при прокрутке и наклонов,
   спокойная анимация сцены остаётся — как в личном кабинете.
   motion-off (?motion=off): анимации выключены полностью. */

html.reduce-motion { scroll-behavior: auto; }
.reduce-motion [data-reveal] { transform: none; }
.reduce-motion .scene,
.reduce-motion .widget { transform: none; }

.motion-off *,
.motion-off *::before,
.motion-off *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0s !important;
}
.motion-off [data-reveal] { opacity: 1; }
.motion-off .scene__orbit { stroke-dashoffset: 0; }
.motion-off .scene__comet { opacity: 1; }
