/*
 * Nexus Pay — общий слой редизайна 19.10.2026 (макет Claude Design, docs/redesign-1910/design).
 *
 * ── Что здесь ─────────────────────────────────────────────────────────────
 *
 * Токены обеих тем, базовая типографика, контейнер, шапка с меню телефона,
 * CTA «Всё живёт в Telegram», подвал, кнопки, плитки, крошки, метки, чипы,
 * текст длинных страниц и RTL. Всё, что нужно ОДНОЙ странице, — в её
 * assets/r26-<зона>.css, а не здесь.
 *
 * ── Почему классы с приставкой r- ─────────────────────────────────────────
 *
 * Файл подключается ПОСЛЕ site.css: на страницах ещё живёт прежнее содержимое
 * (co-body, sx-next, чат), и его стили нужны. В site.css уже заняты .wrap,
 * .lead, .tile, .block-подобные имена — общий класс без приставки получил бы
 * чужие свойства в довесок. Соответствие классов макета и наших — в
 * docs/redesign-1910/FOUNDATION.md.
 *
 * ── Темы ──────────────────────────────────────────────────────────────────
 *
 * Тёмная — основная, без атрибута. Светлая — html[data-theme="light"], её
 * включает кнопка в шапке (assets/site.js). Значения — из пар макета
 * X.dc.html / XLight.dc.html, один в один.
 */

/* Manrope — шрифт макета. Кириллица и латиница уже объявлены в fonts.css;
   здесь — расширенная латиница (ğ ş İ турецкого, ő ű и т. п.). */
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ══ Токены ══════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;

  --r-bg: #0A0A0F;            /* фон страницы */
  --r-surface: #12121A;       /* .block, .card2 макета */
  --r-surface-2: #0B0B12;     /* первый экран и CTA */
  --r-surface-3: #15151D;     /* иконки в подвале, всплывающие карточки */
  --r-raise: #1C1C26;         /* всплывашки поверх карточек */
  --r-text: #F3F2F8;
  --r-text-2: #C9C8D6;
  --r-muted: #9A99B0;
  --r-faint: #6E6D85;
  --r-brand: #5B3FEB;
  --r-brand-2: #6D55F0;
  --r-accent: #8E7CFF;        /* метки (.k), номера */
  --r-link: #B3A6FF;
  --r-link-hover: #D2CAFF;
  --r-green: #3DD68C;
  --r-on-green: #0A0A0F;
  --r-green-tint: rgba(61, 214, 140, 0.14);
  --r-red: #FF8A8E;
  --r-red-line: rgba(229, 72, 77, 0.16);

  --r-line: rgba(255, 255, 255, 0.06);
  --r-line-2: rgba(255, 255, 255, 0.08);
  --r-line-3: rgba(255, 255, 255, 0.1);
  --r-fill-1: rgba(255, 255, 255, 0.03);
  --r-fill-2: rgba(255, 255, 255, 0.04);
  --r-fill-3: rgba(255, 255, 255, 0.05);
  --r-hover: rgba(255, 255, 255, 0.06);
  --r-active: rgba(255, 255, 255, 0.08);
  --r-brand-tint: rgba(91, 63, 235, 0.18);
  --r-glow: rgba(91, 63, 235, 0.32);

  --r-hdr-bg: rgba(21, 21, 29, 0.72);
  --r-hdr-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --r-block-shadow: none;
  --r-btn-shadow: 0 12px 32px rgba(91, 63, 235, 0.35);
  --r-pop-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  --r-particle: #D2CAFF;
  --r-particle-glow: 0 0 12px 2px rgba(179, 166, 255, 0.95);
  --r-scrim: rgba(5, 5, 9, 0.62);

  --r-font: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --r-container: 1232px;
  --r-gutter: 16px;
  --r-hdr-h: 88px;            /* высота шапки с отступами: под неё уезжают якоря */

  /* Прежние токены site.css — в палитру макета, чтобы старое содержимое
     страниц (co-body, sx-next, чат, крошки) не выпадало из гаммы, пока зоны
     переводят его на новые блоки. */
  --paper: var(--r-bg);
  --card: var(--r-surface);
  --card-2: var(--r-surface-3);
  --ink: var(--r-text);
  --ink-2: var(--r-text-2);
  --muted: var(--r-muted);
  --line: var(--r-line-2);
  --hair: var(--r-line);
  --brand: #7C66F5;
  --brand-lift: #8E7CFF;
  --brand-soft: #B3A6FF;
  --link: var(--r-link);
  --glow: var(--r-glow);
  --pk-bg: var(--r-surface-3);
  --font-display: var(--r-font);
  --font: var(--r-font);
}

:root[data-theme="light"] {
  color-scheme: light;

  --r-bg: #F4F3F7;
  --r-surface: #FFFFFF;
  --r-surface-2: #FFFFFF;
  --r-surface-3: #F0EFF5;
  --r-raise: #E9E7F1;
  --r-text: #15131F;
  --r-text-2: #3A3950;
  --r-muted: #5F5D73;
  --r-faint: #8A8899;
  --r-accent: #4A2FD6;
  --r-link: #4A2FD6;
  --r-link-hover: #5B3FEB;
  --r-green: #178A50;
  --r-on-green: #F4F3F7;
  --r-green-tint: rgba(23, 138, 80, 0.12);

  --r-line: rgba(21, 19, 31, 0.06);
  --r-line-2: rgba(21, 19, 31, 0.08);
  --r-line-3: rgba(21, 19, 31, 0.1);
  --r-fill-1: rgba(21, 19, 31, 0.02);
  --r-fill-2: rgba(21, 19, 31, 0.03);
  --r-fill-3: rgba(21, 19, 31, 0.04);
  --r-hover: rgba(21, 19, 31, 0.06);
  --r-active: rgba(21, 19, 31, 0.08);
  --r-brand-tint: rgba(91, 63, 235, 0.1);
  --r-glow: rgba(91, 63, 235, 0.14);

  --r-hdr-bg: rgba(255, 255, 255, 0.8);
  --r-hdr-shadow: 0 12px 40px rgba(21, 19, 31, 0.08);
  --r-block-shadow: 0 10px 30px rgba(21, 19, 31, 0.05);
  --r-btn-shadow: 0 12px 32px rgba(91, 63, 235, 0.25);
  --r-pop-shadow: 0 20px 40px rgba(21, 19, 31, 0.12);
  --r-particle: #5B3FEB;
  --r-particle-glow: 0 0 12px 2px rgba(91, 63, 235, 0.5);
  --r-scrim: rgba(21, 19, 31, 0.36);

  --brand: #5B3FEB;
  --brand-lift: #6D55F0;
  --brand-soft: #8E7CFF;
}

/* ══ База ════════════════════════════════════════════════════════════════ */
html { scroll-padding-top: var(--r-hdr-h); }
body {
  background: var(--r-bg);
  color: var(--r-text);
  font-family: var(--r-font);
  font-size: 16px;
  /* В макете Manrope подключён начертаниями 500–800: обычный текст без
     указанного веса рисуется 500-м. Так и здесь. */
  font-weight: 500;
  line-height: 1.6;
}
a { color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--r-accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--r-font); font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(34px, 4.4vw + 4px, 56px); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3vw + 6px, 44px); line-height: 1.08; letter-spacing: -0.03em; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; }

/* Письмо, где буквы соединяются (арабский) или имеют надстрочную черту
   (хинди), разрывается отрицательной разрядкой; иероглифам она тоже не нужна. */
html[lang="ar"] body *, html[lang="hi"] body *, html[lang="zh"] body * { letter-spacing: 0 !important; }

/* В макете у элементов без явной высоты строки — normal (≈1.37 у Manrope).
   Всё, что собрано из блоков макета (в .r-wrap), — так же; прежнее содержимое
   (.wrap, co-body) остаётся со своими 1.6. */
.r-wrap, .r-hdr, .r-ftr, .r-menu { line-height: normal; }

/* ══ Контейнер и блоки ═══════════════════════════════════════════════════ */
.r-wrap { width: 100%; max-width: var(--r-container); margin: 0 auto; padding: 0 var(--r-gutter); box-sizing: border-box; }

.r-block {
  position: relative; overflow: hidden;
  background: var(--r-surface); border: 1px solid var(--r-line); border-radius: 32px;
  box-shadow: var(--r-block-shadow);
}
.r-block--hero { background: var(--r-surface-2); }
.r-card { background: var(--r-surface); border: 1px solid var(--r-line); border-radius: 24px; }
.r-tile {
  border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 10px;
  min-height: 150px; box-sizing: border-box;
}

/* Свечение в углу блока (radial в макете). Ставится первым ребёнком блока. */
.r-glow {
  position: absolute; inset-inline-end: -160px; top: -240px; width: 680px; height: 680px;
  border-radius: 999px; pointer-events: none;
  background: radial-gradient(circle, var(--r-glow) 0%, rgba(91, 63, 235, 0) 62%);
}

/* Первый экран раздела: крошки, метка, заголовок, вводный абзац, чипы — и
   картинка справа. Сетка 1.3/0.7, как у PgTerms; странице с другой
   пропорцией хватит style="grid-template-columns: …". */
.r-hero {
  padding: 44px 56px; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 32px; align-items: center;
}
.r-hero-txt { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.r-hero-art { position: relative; display: flex; justify-content: center; }
.r-hero-art img { width: 260px; height: 260px; max-width: 100%; object-fit: contain; }

/* ══ Типографика блоков ══════════════════════════════════════════════════ */
.r-k { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; color: var(--r-accent); text-transform: uppercase; }
.r-h1 { margin: 0; font-size: clamp(34px, 4.4vw + 4px, 56px); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; }
.r-h2 { margin: 0; font-size: clamp(28px, 3vw + 6px, 44px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.r-lead { margin: 0; font-size: 17px; color: var(--r-muted); line-height: 1.55; }
.r-hero .r-lead { font-size: 18px; max-width: 600px; }

/* Заголовок секции: метка, h2, абзац — колонкой до 680 px. */
.r-sec { padding-top: 56px; display: flex; flex-direction: column; gap: 28px; }
.r-sec-head { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }

/* ══ Крошки ══════════════════════════════════════════════════════════════ */
.r-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 700; color: var(--r-muted); }
.r-crumb a { color: var(--r-muted); text-decoration: none; }
.r-crumb a:hover { color: var(--r-text); }
.r-crumb svg { flex: none; color: var(--r-faint); }
.r-crumb [aria-current] { color: var(--r-text); }
[dir="rtl"] .r-crumb svg { transform: scaleX(-1); }

/* ══ Чипы и бейджи ═══════════════════════════════════════════════════════ */
.r-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.r-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--r-fill-3); border: 1px solid var(--r-line-2);
  font-size: 13px; font-weight: 700; color: var(--r-text-2); white-space: nowrap;
}
.r-chip--on { background: var(--r-brand); border-color: var(--r-brand); color: #FFFFFF; }
.r-chip--warn { color: var(--r-red); border-color: var(--r-red-line); }
.r-new {
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; line-height: 1;
  padding: 3px 6px; border-radius: 999px; background: var(--r-green); color: var(--r-on-green);
}

/* ══ Кнопки ══════════════════════════════════════════════════════════════ */
.r-btn {
  height: 54px; padding: 0 24px; border-radius: 16px; border: 1px solid transparent;
  background: var(--r-brand); color: #FFFFFF; font-size: 15px; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; box-shadow: 0 12px 30px rgba(91, 63, 235, 0.35); cursor: pointer;
  transition: background .16s ease, transform .16s ease;
  box-sizing: border-box; white-space: nowrap;
}
.r-btn:hover { background: var(--r-brand-2); color: #FFFFFF; }
.r-btn:active { transform: translateY(1px); }
.r-btn--lg { height: 56px; padding: 0 28px; font-size: 16px; box-shadow: var(--r-btn-shadow); }
.r-btn--ghost {
  background: var(--r-fill-3); border-color: var(--r-line-3); color: var(--r-text); box-shadow: none; padding: 0 22px;
  height: 56px; /* 54 + рамка, как в макете */
}
.r-btn--ghost:hover { background: var(--r-hover); color: var(--r-text); }
.r-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ══ Плашка-пояснение (рамка с иконкой «i») ══════════════════════════════ */
.r-note {
  display: flex; gap: 14px; align-items: center; padding: 22px 24px; border-radius: 20px;
  background: var(--r-brand-tint); font-size: 14px; color: var(--r-text-2); line-height: 1.5;
}
.r-note svg { flex: none; color: var(--r-link); }

/* ══ Длинный текст (правовые, статьи, страницы без макета) ═══════════════ */
.r-prose { max-width: 720px; font-size: 16px; line-height: 1.7; color: var(--r-text-2); }
.r-prose h2 { margin: 36px 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--r-text); }
.r-prose h3 { margin: 24px 0 8px; font-size: 19px; color: var(--r-text); }
.r-prose p, .r-prose ul, .r-prose ol { margin: 0 0 14px; }
.r-prose a { color: var(--r-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.r-prose a:hover { color: var(--r-link-hover); }
.r-prose b, .r-prose strong { color: var(--r-text); }

/* ══ Анимации макета (общие для всех страниц) ════════════════════════════ */
.r-p {
  position: absolute; border-radius: 999px; background: var(--r-particle); box-shadow: var(--r-particle-glow);
  opacity: 0.9; animation: r-drift linear infinite; pointer-events: none;
}
@keyframes r-drift { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 0.9; } 85% { opacity: 0.9; } 100% { transform: translate(-40px, -140px); opacity: 0; } }
.r-float { animation: r-floaty 6s ease-in-out infinite; }
@keyframes r-floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.r-fly { animation: r-flyk 5s ease-in-out infinite; }
@keyframes r-flyk { 0%, 100% { transform: translate(0, 0) rotate(-3deg); } 50% { transform: translate(14px, -22px) rotate(3deg); } }
.r-pulse { animation: r-pulsek 2.4s ease-in-out infinite; }
@keyframes r-pulsek { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .r-p, .r-float, .r-fly, .r-pulse { animation: none; }
  .r-p { opacity: 0.6; }
}

/* ══ Шапка ═══════════════════════════════════════════════════════════════
 *
 * Плавающая плашка над страницей. Прилипает к верху при прокрутке: в макете
 * она стоит в потоке, но на первом экране выглядит так же, а по длинной
 * странице без неё не перейти в соседний раздел.
 */
.r-hdr { position: sticky; top: 0; z-index: 90; padding-top: 14px; padding-bottom: 10px; pointer-events: none; }
/* Плашка — над затемнением меню (оно внутри той же шапки). */
.r-hdr > .r-wrap { pointer-events: auto; position: relative; z-index: 91; }
.r-hdr-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  /* 66 = 64 + рамка: в макете у ссылок и блоков box-sizing: content-box. */
  height: 66px; padding: 0 10px 0 18px; box-sizing: border-box;
  border-radius: 22px; background: var(--r-hdr-bg); border: 1px solid var(--r-line-2);
  box-shadow: var(--r-hdr-shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
[dir="rtl"] .r-hdr-bar { padding: 0 18px 0 10px; }

.r-logo { display: flex; align-items: center; gap: 10px; color: var(--r-text); text-decoration: none; flex: none; min-width: 0; }
.r-logo-mark {
  width: 36px; height: 36px; border-radius: 12px; background: var(--r-brand); flex: none;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(91, 63, 235, 0.45);
}
.r-logo-txt { display: flex; flex-direction: column; line-height: 1.1; }
.r-logo-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.r-logo-sub { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--r-muted); white-space: nowrap; }

.r-nav {
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 16px;
  background: var(--r-fill-2); border: 1px solid var(--r-line);
}
.r-nav a {
  color: var(--r-text-2); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap;
  height: 38px; padding: 0 14px; border-radius: 12px; display: flex; align-items: center; gap: 6px;
}
.r-nav a:hover { background: var(--r-hover); color: var(--r-text); }
.r-nav a.r-on, .r-nav a[aria-current="page"] { background: var(--r-active); color: var(--r-text); }

.r-act { display: flex; align-items: center; gap: 8px; flex: none; position: relative; }
.r-ibtn {
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px; box-sizing: border-box;
  border: 1px solid var(--r-line-2); background: transparent; color: var(--r-text-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.r-ibtn:hover { background: var(--r-hover); color: var(--r-text); }
.r-ibtn--sq { width: 40px; padding: 0; }
.r-login {
  height: 40px; padding: 0 12px; display: flex; align-items: center;
  font-size: 14px; font-weight: 700; color: var(--r-text); text-decoration: none; white-space: nowrap;
}
.r-login:hover { color: var(--r-link); }
.r-tg {
  height: 44px; padding: 0 18px; border-radius: 14px; background: var(--r-brand); color: #FFFFFF;
  font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  text-decoration: none; box-shadow: 0 8px 24px rgba(91, 63, 235, 0.4);
}
.r-tg:hover { background: var(--r-brand-2); color: #FFFFFF; }
[dir="rtl"] .r-tg svg, [dir="rtl"] .r-btn svg.r-tg-ic { transform: scaleX(-1); }

/* Кнопка меню и меню телефона — скрыты, пока помещается полная шапка. */
.r-burger { display: none; }
.r-menu { display: none; }

/* Список языков (рисует assets/site.js в .r-act). Свой скролл и
   overscroll-behavior: на телефоне список длиннее экрана, и прокрутка
   не должна проваливаться в страницу под ним. */
.r-hdr .lang-panel {
  position: absolute; top: calc(100% + 12px); inset-inline-end: 0; z-index: 95;
  min-width: 210px; max-height: min(480px, calc(100dvh - 120px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; display: grid; gap: 2px;
  background: var(--r-surface); border: 1px solid var(--r-line-2); border-radius: 18px; box-shadow: var(--r-pop-shadow);
}
.r-hdr .lang-it { color: var(--r-text-2); font-size: 14px; font-weight: 700; border-radius: 12px; }
.r-hdr .lang-it:hover { background: var(--r-hover); color: var(--r-text); }
.r-hdr .lang-it.on { background: var(--r-brand-tint); color: var(--r-text); }

/* ── Ступень 1: не помещается меню (≤1199 px, или длинный язык — тогда
   класс .r-hdr--tight ставит r26.js). Меню уходит под кнопку. */
@media (max-width: 1199px) {
  .r-hdr .r-nav { display: none; }
  .r-burger { display: flex; }
}
.r-hdr--tight .r-nav { display: none; }
.r-hdr--tight .r-burger { display: flex; }

/* ── Ступень 2: телефон. В плашке — знак, язык, «Открыть в Telegram» значком
   и кнопка меню; тема и вход — в меню. */
@media (max-width: 719px) {
  :root { --r-hdr-h: 80px; }
  .r-hdr { padding-top: 10px; padding-bottom: 8px; }
  .r-hdr-bar { height: 60px; padding: 0 8px 0 12px; gap: 8px; border-radius: 20px; }
  [dir="rtl"] .r-hdr-bar { padding: 0 12px 0 8px; }
  .r-act { gap: 6px; }
  .r-act .r-theme, .r-act .r-login { display: none; }
  .r-act .r-tg { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .r-act .r-tg span { display: none; }
}
@media (max-width: 379px) {
  .r-logo-sub { display: none; }
  .r-act .r-tg { display: none; }
}

/* ── Меню (панель под шапкой) ─────────────────────────────────────────── */
.r-menu-scrim {
  position: fixed; inset: 0; z-index: 88; background: var(--r-scrim);
  opacity: 0; transition: opacity .2s ease; touch-action: none;
}
.r-menu {
  position: fixed; z-index: 89; inset-inline: var(--r-gutter); top: calc(var(--r-hdr-h) - 2px);
  max-height: calc(100dvh - var(--r-hdr-h) - 12px); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex-direction: column; gap: 14px; padding: 12px; box-sizing: border-box;
  background: var(--r-surface); border: 1px solid var(--r-line-2); border-radius: 22px; box-shadow: var(--r-pop-shadow);
  opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease;
}
@media (min-width: 720px) { .r-menu { inset-inline: auto var(--r-gutter); width: 380px; } }
@media (min-width: 1264px) { .r-menu { inset-inline-end: calc((100vw - var(--r-container)) / 2 + var(--r-gutter)); } }
.r-hdr.r-open .r-menu { display: flex; }
.r-hdr.r-open .r-menu-scrim { display: block; }
.r-hdr.r-on .r-menu, .r-hdr.r-on .r-menu-scrim { opacity: 1; transform: none; }
.r-menu-scrim { display: none; }
/* verify 19.10: у .r-hdr стоит pointer-events: none (чтобы пустые поля шапки
   не перехватывали касания), и меню с затемнением его наследовали — касание
   пункта меню попадало в страницу под ним, жест не листал меню, а затемнение
   не закрывало его. Меню и затемнение ловят касания сами. */
.r-menu, .r-menu-scrim { pointer-events: auto; }
.r-menu-nav { display: flex; flex-direction: column; gap: 2px; }
.r-menu-nav a {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: 14px;
  font-size: 17px; font-weight: 800; color: var(--r-text); text-decoration: none;
}
.r-menu-nav a:hover { background: var(--r-hover); }
.r-menu-nav a.r-on, .r-menu-nav a[aria-current="page"] { background: var(--r-active); }
.r-menu-act { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--r-line-2); }
.r-menu-row { display: flex; gap: 8px; }
.r-menu-row > * { flex: 1; }
.r-menu .r-btn { width: 100%; }
.r-menu .r-ibtn { height: 48px; border-radius: 14px; font-size: 14px; }
.r-menu .r-login { height: 48px; justify-content: center; border-radius: 14px; border: 1px solid var(--r-line-2); }
@media (prefers-reduced-motion: reduce) { .r-menu, .r-menu-scrim { transition: none; } }

/* Пока открыто меню (или чат на телефоне), страница под ним стоит. Сама
   блокировка — в assets/r26.js (iOS не слушается overflow на body, поэтому
   там ещё и position: fixed с запомненной прокруткой). */
html.r-lock, html.r-lock body { overflow: hidden; overscroll-behavior: none; }
/* Тело на время блокировки стоит position: fixed со сдвигом — липкая шапка
   уехала бы вместе с ним. Фиксируем её на том же месте, где она и была. */
html.r-lock .r-hdr { position: fixed; top: 0; left: 0; right: 0; }
/* Кнопка чата не висит поверх открытого меню. */
html.r-menu-open .chat { visibility: hidden; }

/* ══ CTA «Всё живёт в Telegram» ══════════════════════════════════════════ */
.r-cta-sec { padding-top: 44px; padding-bottom: 32px; }
.r-cta {
  background: var(--r-surface-2); padding: 40px 56px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 24px; align-items: center;
}
.r-cta .r-glow { inset-inline-end: -60px; top: -160px; background: radial-gradient(circle, var(--r-glow) 0%, rgba(91, 63, 235, 0) 60%); }
.r-cta-txt { position: relative; display: flex; flex-direction: column; gap: 16px; max-width: 540px; }
.r-cta-txt .r-btn { align-self: flex-start; }
.r-cta-art { position: relative; display: flex; justify-content: flex-end; align-items: center; }
.r-cta-art img { width: 420px; height: 420px; max-width: 100%; object-fit: contain; margin-block: -80px; margin-inline: 0 -20px; }
[dir="rtl"] .r-cta-art img { transform: scaleX(-1); }
[dir="rtl"] .r-cta-art .r-fly { animation-name: r-flyk-rtl; }
@keyframes r-flyk-rtl { 0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(-3deg); } 50% { transform: scaleX(-1) translate(14px, -22px) rotate(3deg); } }

/* Картинки тем: тёмная по умолчанию, светлая — по атрибуту. */
.r-light-only { display: none !important; }
:root[data-theme="light"] .r-dark-only { display: none !important; }
:root[data-theme="light"] .r-light-only { display: block !important; }

/* ══ Подвал ══════════════════════════════════════════════════════════════ */
.r-ftr { border-top: 1px solid var(--r-line-2); margin-top: 48px; padding: 0 0 40px; }
.r-ftr-in { padding-top: 40px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 28px; }
.r-ftr-grid { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 32px; }
.r-ftr-brand { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.r-ftr-name { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--r-text); text-decoration: none; }
.r-ftr-name svg { color: var(--r-accent); }
.r-ftr-brand p { margin: 0; font-size: 14px; color: var(--r-muted); line-height: 1.55; max-width: 300px; }
.r-ftr-col { display: flex; flex-direction: column; gap: 12px; font-size: 14px; min-width: 0; }
.r-ftr-h { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; color: var(--r-faint); text-transform: uppercase; margin: 0; }
.r-ftr-col a { color: var(--r-text-2); text-decoration: none; line-height: normal; }
.r-ftr-col a:hover { color: var(--r-text); }
.r-ftr-legal { display: flex; flex-direction: column; gap: 10px; padding-top: 28px; border-top: 1px solid var(--r-line-2); max-width: 760px; }
.r-ftr-legal b { font-size: 14px; font-weight: 800; color: var(--r-text); }
.r-ftr-legal span, .r-ftr-legal p { margin: 0; font-size: 13px; color: var(--r-muted); line-height: 1.55; }
.r-ftr-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--r-faint); }
.r-ftr-copy { display: flex; align-items: center; gap: 8px; }
.r-ftr-copy img { width: 20px; height: 20px; border-radius: 6px; }
.r-ftr-soc { display: flex; gap: 8px; }
.r-ftr-soc a {
  width: 38px; height: 38px; border-radius: 10px; background: var(--r-surface-3); border: 1px solid var(--r-line-2);
  color: var(--r-text-2); display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.r-ftr-soc a:hover { color: var(--r-text); }

/* ══ Чат поддержки и пелена перехода — в палитре макета ═════════════════ */
.chat-panel, .sup-scroll { overscroll-behavior: contain; }
.chat-btn { background: var(--r-brand); box-shadow: 0 12px 32px rgba(91, 63, 235, 0.4); }
@media (max-width: 560px) {
  .chat-panel { height: min(640px, calc(100dvh - 96px)); }
}

/* ══ Планшет и телефон ═══════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .r-ftr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .r-ftr-brand { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .r-hero { grid-template-columns: 1fr; padding: 32px 28px; }
  .r-hero-art img { width: 200px; height: 200px; }
  .r-cta { padding: 32px 28px; }
  .r-cta-art { justify-content: center; }
  .r-cta-art img { width: 300px; height: 300px; margin: -24px 0 -40px; }
}
@media (max-width: 719px) {
  .r-block { border-radius: 26px; }
  .r-hero { padding: 26px 20px; gap: 20px; }
  .r-hero .r-lead { font-size: 16px; }
  .r-hero-art img { width: 168px; height: 168px; }
  .r-sec { padding-top: 40px; gap: 22px; }
  .r-cta-sec { padding-top: 32px; padding-bottom: 24px; }
  .r-cta { padding: 28px 20px 8px; gap: 8px; }
  .r-cta-txt .r-btn { align-self: stretch; }
  .r-cta-art img { width: 240px; height: 240px; margin: -12px 0 -28px; }
  .r-ftr { margin-top: 32px; padding: 0 0 24px; }
  .r-ftr-in { padding-top: 32px; padding-bottom: 24px; gap: 24px; }
  .r-ftr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .r-ftr-bottom { flex-direction: column; align-items: flex-start; }
  .r-btn { height: 52px; }
  .r-chip { height: 36px; }
}
@media (max-width: 359px) {
  :root { --r-gutter: 12px; }
  .r-hero { padding: 22px 16px; }
  .r-cta { padding: 24px 16px 8px; }
  .r-ftr-grid { gap: 24px 14px; }
  .r-ftr-col { font-size: 13px; }
}
