/* DEPRICED — shared visual system for sub-pages (privacy, terms, tiktok).
   Mirrors the main page: black canvas, white particle network, graphite cards. */

:root {
  --bg: #000000;
  --surface: #111111;
  --surface-2: #151515;
  --ink: #f5f5f5;
  --ink-secondary: #b8b8b8;
  --ink-muted: #707070;
  --line: #282828;
  --line-strong: #3d3d3d;
  --accent: #9b7cff;
  --accent-2: #c4adff;
  --accent-dark: #6e4fc7;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Unbounded", system-ui, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --max: 1120px;
  --pad-x: 22px;
  --header-h: 74px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
@media (max-width: 1024px) { html { font-size: 15.5px; } }
@media (max-width: 640px) { html { font-size: 14.5px; } }
@media (max-width: 400px) { html { font-size: 13.5px; } }

@media (max-width: 660px) {
  .lang-switch { gap: 2px; }
  .lang-btn { min-width: 33px; height: 30px; padding-inline: 8px; font-size: 9.5px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -.005em;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { -webkit-user-drag: none; user-drag: none; }

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

/* === BACKGROUND === */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #000; opacity: 0; transition: opacity 1.05s var(--ease-out) .08s; }
html.site-ready .bg { opacity: 1; }
.bg__grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 160px 160px;
  opacity: .17;
}
.bg__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(255, 255, 255, .018) 0%, transparent 22%, rgba(0, 0, 0, .22) 100%);
}
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .62; }

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  opacity: 0;
  transform: translateY(-9px);
  transition: opacity .72s var(--ease-out) .05s, transform .72s var(--ease-out) .05s;
}
html.site-ready .navbar { opacity: 1; transform: translateY(0); }
/* Full-bleed bar behind the fixed, page-width aligned header. */
.navbar::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: -1;
  background: rgba(6, 6, 8, .72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}

.navbar__brand { font-family: var(--font-display); font-size: .9rem; font-weight: 700; letter-spacing: .02em; }
.navbar__brand:hover { color: var(--accent-2); transition: color .3s ease; }
.navbar__right { display: flex; align-items: center; gap: 14px; }
.navbar__note { font-size: .62rem; font-weight: 600; letter-spacing: .2em; color: var(--ink-muted); text-transform: uppercase; }
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .72rem;
  font-weight: 600;
  transition: transform .45s var(--ease-out), border-color .55s var(--ease-out), background .5s ease, color .45s ease, box-shadow .62s var(--ease-out);
}
.nav-pill:hover {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: var(--accent);
  background: #191919;
  box-shadow: 0 0 0 1px rgba(155, 124, 255, .14), 0 10px 30px rgba(155, 124, 255, .08);
}
.nav-pill span { color: var(--accent-2); transition: transform .5s var(--ease-out); }
.nav-pill:hover span { transform: translateX(-2px); }

/* === LANGUAGE SWITCH === */
.lang-switch {
  justify-self: end;
  position: relative;
  --thumb-x: 0px;
  --thumb-w: 38px;
  --lang-pad: 3px;
  --lang-gap: 3px;
  display: inline-flex;
  align-items: center;
  gap: var(--lang-gap);
  padding: var(--lang-pad);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111114;
}
.lang-btn {
  width: var(--thumb-w);
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #706b78;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .3s ease, background .35s var(--ease-out), box-shadow .45s var(--ease-out), transform .3s var(--ease-out);
}
.lang-btn:hover { color: #f4f1f8; }
.lang-btn.is-active {
  color: #fff;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.lang-btn:active { transform: scale(.94); }
/* Скользящая подсветка активной кнопки (позицию считает i18n.js). */
.lang-switch::before {
  content: "";
  position: absolute;
  top: var(--lang-pad);
  left: var(--lang-pad);
  width: var(--thumb-w);
  height: calc(100% - var(--lang-pad) * 2);
  border-radius: 999px;
  background: linear-gradient(135deg, #8c6cff, #6946c9);
  box-shadow: 0 5px 18px rgba(139, 108, 255, .22);
  transform: translateX(var(--thumb-x, 0px));
  transition:
    transform .38s var(--ease-out),
    width .38s var(--ease-out);
  pointer-events: none;
}
.lang-btn { position: relative; z-index: 1; }

/* Запасной вариант без JS: ползунок встаёт по активной кнопке. */
.lang-switch:has(.lang-btn[data-lang="ru"].is-active)::before { --thumb-x: 0px; }
.lang-switch:has(.lang-btn[data-lang="en"].is-active)::before { --thumb-x: calc(var(--thumb-w) + var(--lang-gap)); }


/* === PAGE / CARDS === */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 20px) var(--pad-x) 52px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color .65s var(--ease-out), box-shadow .75s var(--ease-out), background .55s ease, transform .55s var(--ease-out);
}
.card:hover {
  border-color: rgba(155, 124, 255, .24);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .30), 0 0 34px rgba(155, 124, 255, .055);
}
/* Border-only cursor glow, same as the main page. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(155, 124, 255, .34), rgba(155, 124, 255, .10) 38%, transparent 68%);
  -webkit-mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity .68s var(--ease-out);
}
.card:hover::before { opacity: .72; }

/* === HERO (brand row) === */
.hero { display: grid; grid-template-columns: 112px 1fr; gap: 26px; align-items: center; margin-top: 16px; }
.hero__avatar-wrap { width: 112px; height: 112px; border-radius: 50%; padding: 5px; border: 1px solid var(--line-strong); position: relative; }
.hero__avatar-wrap::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid var(--accent); clip-path: polygon(50% 0, 100% 0, 100% 34%, 50% 34%); animation: orbit 7s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; filter: contrast(1.04) saturate(.9); }
.hero__text { min-width: 0; }
.hero__text .hero__title { margin-top: 0; }

/* === TYPOGRAPHY === */
.section-title {
  --rule-left: 96px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
/* Линия идёт от фиксированной точки до правого края: текст её не касается. */
.section-title::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--rule-left);
  right: 0;
  height: 1px;
  background: var(--line);
  transition: left .32s var(--ease-out);
}
.section-title--short { margin-bottom: 10px; }
.eyebrow { color: var(--accent-2); font-size: .62rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.06;
  background: linear-gradient(100deg, #ffffff 20%, #d9ccff 58%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__title { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 10px 0 14px; }
.lede { max-width: 820px; color: var(--ink-secondary); font-size: .85rem; line-height: 1.75; }
.muted { color: var(--ink-muted); }
.body-text { max-width: 96ch; color: var(--ink-muted); font-size: .82rem; line-height: 1.75; }
.body-text + .body-text { margin-top: 13px; }

/* === BADGES / PILLS === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.pill--accent { color: var(--accent-2); border-color: rgba(155, 124, 255, .3); background: rgba(155, 124, 255, .08); }
.pill--ok { color: #86efac; border-color: rgba(134, 239, 172, .28); background: rgba(20, 83, 45, .16); }
.pill--ok::before,
.pill--accent::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px color-mix(in srgb, currentColor 55%, transparent);
}
.pill--accent::before { background: var(--accent); box-shadow: 0 0 12px rgba(155, 124, 255, .5); }
.code {
  font-family: var(--font-body);
  font-size: .9em;
  letter-spacing: 0;
  color: var(--accent-2);
  background: rgba(155, 124, 255, .09);
  border: 1px solid rgba(155, 124, 255, .16);
  padding: 1px 6px;
  border-radius: 6px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 650;
  transition: transform .45s var(--ease-out), border-color .55s var(--ease-out), background .5s ease, color .45s ease, box-shadow .62s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); background: #1a1a1a; }
.btn span { color: var(--accent-2); }
.btn--solid { border-color: rgba(155, 124, 255, .42); background: rgba(155, 124, 255, .13); color: #e8ddff; }
.btn--solid:hover { border-color: var(--accent); background: rgba(155, 124, 255, .18); box-shadow: 0 10px 30px rgba(155, 124, 255, .12); }
.btn--ghost:hover { border-color: var(--accent); box-shadow: 0 10px 30px rgba(155, 124, 255, .08); }
.btn--tiktok { --brand: #25f4ee; border-color: rgba(255, 255, 255, .2); background: #151515; font-weight: 700; }
.btn--tiktok:hover { border-color: var(--brand); box-shadow: -4px 4px 0 rgba(37, 244, 238, .5), 4px -4px 0 rgba(254, 44, 85, .45); }
.btn--row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* === LAYOUT: TOC + CONTENT === */
.layout-grid { display: grid; grid-template-columns: 288px 1fr; gap: 18px; align-items: start; }
.toc { position: sticky; top: 20px; padding: 20px; }
.toc-links { display: flex; flex-direction: column; gap: 4px; max-height: min(66vh, 620px); overflow-y: auto; padding-right: 4px; }
.toc-links::-webkit-scrollbar { width: 4px; }
.toc-links::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.toc-link {
  display: block;
  color: var(--ink-muted);
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: color .35s ease, background .4s ease, border-color .45s var(--ease-out), transform .45s var(--ease-out);
}
.toc-link:hover { color: var(--ink); background: #ffffff06; border-color: var(--line); transform: translateX(3px); }
.toc-link.is-active { color: #e8ddff; background: rgba(155, 124, 255, .12); border-color: rgba(155, 124, 255, .3); }
.content-column { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* === LEGAL SECTIONS === */
.legal-section { scroll-margin-top: calc(var(--header-h) + 16px); padding: 26px; }
.legal-section h2 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 14px;
}
.legal-section ul { margin-top: 13px; padding-left: 20px; color: var(--ink-muted); }
.legal-section li { font-size: .8rem; line-height: 1.7; margin-bottom: 7px; }
.legal-section li::marker { color: var(--accent-dark); }

.notice {
  margin-top: 16px;
  padding: 15px 17px;
  background: #0d0d0d;
  border: 1px solid rgba(155, 124, 255, .22);
  border-radius: 16px;
  color: var(--accent-2);
  font-size: .78rem;
  line-height: 1.65;
}

.contact-box { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.contact-item { background: #0d0d0d; border: 1px solid var(--line); border-radius: 16px; padding: 15px 17px; transition: border-color .5s var(--ease-out), background .45s ease; }
.contact-item:hover { border-color: var(--line-strong); background: #101010; }
.contact-label { display: block; color: var(--ink-muted); font-size: .58rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 5px; }
.contact-value, .contact-value a { color: #d7d1dc; font-size: .82rem; font-weight: 600; }
.contact-value a { transition: color .3s ease; }
.contact-value a:hover { color: var(--accent-2); }

/* === PANELS / STEPS (tiktok) === */
.panel { border: 1px solid var(--line); border-radius: 16px; background: #0d0d0d; padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.panel-title { font-family: var(--font-display); font-size: .95rem; font-weight: 600; }
.list { display: flex; flex-direction: column; }
.list-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row b { display: block; font-family: var(--font-body); font-weight: 600; font-size: .74rem; color: var(--accent-2); margin-bottom: 5px; }
.list-row span { display: block; color: var(--ink-muted); font-size: .72rem; line-height: 1.6; }

.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: grid; grid-template-columns: 38px 1fr; gap: 13px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 16px; background: #0d0d0d; transition: border-color .5s var(--ease-out), transform .45s var(--ease-out), background .45s ease; }
.step:hover { transform: translateY(-2px); border-color: var(--line-strong); background: #101010; }
.num { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid rgba(155, 124, 255, .28); background: rgba(155, 124, 255, .09); color: var(--accent-2); font-family: var(--font-display); font-size: .72rem; font-weight: 600; }
.step-title { font-size: .8rem; font-weight: 600; margin-bottom: 3px; }
.step-desc { color: var(--ink-muted); font-size: .72rem; line-height: 1.6; }

.hint { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #0d0d0d; color: var(--ink-muted); font-size: .75rem; line-height: 1.65; }
.hint strong { color: var(--ink-secondary); font-weight: 650; }

/* === FOOTER === */
.footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0 0; color: #5e5864; font-size: .66rem; }
.footer__links { display: flex; gap: 16px; }
.footer a { transition: color .2s ease; }
.footer a:hover { color: var(--accent-2); }

/* === TOAST === */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 18px);
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: #17131f;
  border: 1px solid #3b2c55;
  color: #ddd8e7;
  box-shadow: 0 15px 45px rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  font-size: .76rem;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* === VEILS / REVEAL === */
#site-veil {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity .72s var(--ease-out), visibility 0s linear .72s;
}
html.site-ready #site-veil { opacity: 0; visibility: hidden; }

/* Language switch: blur only the text, cards/borders stay sharp.
   Two directions so the entrance animation of .navbar is never overridden. */
html.lang-swapping [data-i18n],
html.lang-swapping .toc-link,
html.lang-swapping [data-block] :is(p, h1, h2, li),
html.lang-swapping [data-block] [data-t="label"],
html.lang-swapping [data-block] [data-t="notice"] {
  filter: blur(5px);
  opacity: .3;
  transition:
    filter .16s ease-in,
    opacity .16s ease-in;
}

html.lang-swapping.lang-out [data-i18n],
html.lang-swapping.lang-out .toc-link,
html.lang-swapping.lang-out [data-block] :is(p, h1, h2, li),
html.lang-swapping.lang-out [data-block] [data-t="label"],
html.lang-swapping.lang-out [data-block] [data-t="notice"] {
  filter: blur(0);
  opacity: 1;
  transition:
    filter .3s var(--ease-out),
    opacity .3s var(--ease-out);
}

/* Blocks, chips and icons stay perfectly sharp (no blur, no fade). */
html.lang-swapping :is(.card, .panel, .step, .num, .setup-panel, .toc, .link-row, .btn, .tab, .lang-btn, .pill, .nav-pill, .notice, .code, .link-icon, .link-arrow, .avatar, .hero__avatar-wrap, img, svg, canvas),
html.lang-swapping.lang-out :is(.card, .panel, .step, .num, .setup-panel, .toc, .link-row, .btn, .tab, .lang-btn, .pill, .nav-pill, .notice, .code, .link-icon, .link-arrow, .avatar, .hero__avatar-wrap, img, svg, canvas) {
  filter: none;
  opacity: 1;
}

html.lang-swapping .lang-btn {
  pointer-events: none;
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .74s var(--ease-out) var(--reveal-delay, 0s), transform .74s var(--ease-out) var(--reveal-delay, 0s); }
html.site-ready .reveal.in-view { opacity: 1; transform: translateY(0); }
html.site-settled .reveal { will-change: auto; }

@media (min-width: 2560px) {
  :root { --max: 1240px; --header-h: 92px; }
  .navbar { padding: 26px var(--pad-x); }
  .page { padding-top: calc(var(--header-h) + 24px); gap: 20px; }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .layout-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc-links { max-height: none; }
}

@media (max-width: 640px) {
  :root { --pad-x: 12px; --header-h: 64px; }
  .navbar { padding: 13px var(--pad-x); }
  .navbar__note { display: none; }
  .page { padding: calc(var(--header-h) + 16px) var(--pad-x) 38px; gap: 12px; }
  .card { padding: 17px 15px; border-radius: 17px; }
  .legal-section { padding: 20px 17px; }
  .hero__title { font-size: 1.5rem; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 16px; }
  .hero__avatar-wrap { width: 96px; height: 96px; }
  .hero__text { text-align: center; }
  .btn--row .btn { flex: 1 1 100%; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .footer { flex-direction: column; align-items: flex-start; padding: 14px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  #site-veil { display: none !important; }

  .navbar,
  .page,
  [data-i18n],
  .toc-link,
  [data-block] :is(p, h1, h2, li),
  [data-block] [data-t="label"],
  [data-block] [data-t="notice"] {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .bg,
  .navbar,
  .reveal,
  [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  .hero__avatar-wrap::before { animation: none !important; }
  html { scroll-behavior: auto; }
}
