/*
 * ZENAX — public legal pages.
 *
 * Deliberately one committed look rather than a light/dark pair: these pages
 * are a brand surface and they carry the same ground (#050609) and accent
 * (#6366f1) as the app itself, so somebody arriving from a Play listing or from
 * the About screen lands somewhere that looks like the same product.
 *
 * `color-scheme: dark` is declared so the browser paints scrollbars and form
 * controls to match instead of dropping a white scrollbar onto a black page.
 */

:root {
  color-scheme: dark;

  --bg:            #050609;
  --bg-grad:       #090b12;
  --surface:       #0d0f16;
  --surface-2:     #12141d;
  --line:          rgba(255, 255, 255, 0.075);
  --line-strong:   rgba(255, 255, 255, 0.14);

  --ink:           #f3f3f8;
  --ink-2:         rgba(255, 255, 255, 0.63);
  --ink-3:         rgba(255, 255, 255, 0.42);

  --accent:        #6366f1;
  --accent-hover:  #585bef;
  --accent-soft:   rgba(99, 102, 241, 0.12);
  --accent-line:   rgba(99, 102, 241, 0.34);

  --danger:        #ff6b6b;
  --danger-soft:   rgba(229, 72, 77, 0.11);
  --danger-line:   rgba(229, 72, 77, 0.32);

  --telegram:      #2aabee;

  --radius:        14px;
  --radius-lg:     22px;
  --measure:       68ch;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(120% 70% at 50% 0%, var(--bg-grad), var(--bg) 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── language switching ─────────────────────────────────────────────────
   Both languages ship in the HTML so the page is readable with JavaScript
   off (and by anything that indexes it). One of them is hidden by the
   `data-lang` attribute the head script sets before first paint. */
html[data-lang="ru"] [data-l="en"] { display: none !important; }
html[data-lang="en"] [data-l="ru"] { display: none !important; }

/* ── header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 6, 9, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand__mark {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.brand__kind {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.lang {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang button:hover { color: var(--ink); }

html[data-lang="ru"] .lang button[data-set="ru"],
html[data-lang="en"] .lang button[data-set="en"] {
  background: var(--accent);
  color: #fff;
}

/* ── page shell ─────────────────────────────────────────────────────── */
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 46px 22px 110px;
}

.doc { max-width: 760px; }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  margin-bottom: 26px;
}
.crumb:hover { color: var(--ink-2); }

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 900;
  letter-spacing: -0.032em;
  line-height: 1.08;
  text-wrap: balance;
}

.intro {
  margin: 18px 0 0;
  max-width: var(--measure);
  font-size: 17px;
  color: var(--ink-2);
}

.updated {
  margin-top: 22px;
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
}

/* ── sections ───────────────────────────────────────────────────────── */
.sections {
  margin-top: 46px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

section { scroll-margin-top: 84px; }

h2 {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.012em;
}

p {
  margin: 0 0 13px;
  max-width: var(--measure);
  color: var(--ink-2);
}
p:last-child { margin-bottom: 0; }

.doc ul {
  margin: 0 0 13px;
  padding-left: 21px;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.doc ul:last-child { margin-bottom: 0; }
.doc li { color: var(--ink-2); }
.doc li::marker { color: var(--accent); }

strong { color: var(--ink); font-weight: 700; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

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

/* ── callout ────────────────────────────────────────────────────────── */
.callout {
  margin: 0 0 13px;
  padding: 14px 18px;
  max-width: var(--measure);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left-width: 3px;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
}
.callout:last-child { margin-bottom: 0; }

.callout--danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--ink);
}

/* ── term / detail pairs ────────────────────────────────────────────── */
.pairs {
  margin: 0;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.pairs > div {
  background: var(--surface);
  padding: 13px 17px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2.1fr;
  gap: 14px;
  align-items: baseline;
}

.pairs dt { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.pairs dd { margin: 0; color: var(--ink-2); font-size: 14.5px; }

@media (max-width: 560px) {
  .pairs > div { grid-template-columns: 1fr; gap: 4px; }
}

/* ── steps (deletion page) ──────────────────────────────────────────── */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 54px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 17px;
  top: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ── route cards (deletion page) ────────────────────────────────────── */
.routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  max-width: 900px;
}

.route {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route--primary { border-color: var(--accent-line); }

.route__tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
}

.route h2 { margin: 0; font-size: 18px; }
.route p { font-size: 14.5px; }

.btn {
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn--tg { background: var(--telegram); }
.btn--tg:hover { background: #1e97d6; color: #fff; }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }

.mail {
  font-size: 14px;
  color: var(--ink-3);
}
.mail a { font-weight: 600; }

/* ── index hub cards ────────────────────────────────────────────────── */
.hub {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}
.card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-2px);
  color: var(--ink);
}
.card h2 { margin: 0; font-size: 18px; }
.card p { margin: 0; font-size: 14.5px; }
.card__go { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 3px; }

/* ── footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 70px;
}

.site-footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 22px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-3);
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-left: auto; }
.site-footer a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ── print: legal documents get printed ─────────────────────────────── */
@media print {
  :root { color-scheme: light; }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .site-header, .site-footer, .lang, .crumb, .btn { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .doc { max-width: none; }
  p, li, .pairs dd { color: #222; }
  h1, h2, h3, strong, .pairs dt { color: #000; }
  .callout, .steps li, .route, .pairs > div {
    background: #f4f4f6;
    border: 1px solid #bbb;
    color: #000;
  }
  .eyebrow, .callout, .steps li::before { color: #000; }
  .steps li::before { background: #ddd; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  section { break-inside: avoid-page; }
}
