/* UX/UI English — общая оболочка всех страниц: переменные, шапка, подвал, кнопки.
   Главная: site-chrome.css + redesign.css. Остальные страницы: rx.css (Raxon) + свои стили + site-chrome.css + redesign-theme.css. */

:root {
  --blue: #3355FF;
  --blue-deep: #2440D6;
  --blue-tint: #EDF0FF;
  --blue-line: #C9D2FF;
  --ink: #0D1233;
  --ink-2: #1A2150;
  --text: #14182B;
  --muted: #5A6079;
  --paper: #FFFFFF;
  --mist: #F3F4F9;
  --line: #E0E3EE;
  --marker: #BFEFD4;
  --tg: #229ED9;
  --on-ink: #FFFFFF;
  --on-ink-muted: #B9C0E4;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 28px;
  --font: "Onest", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ipa: "Noto Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

html[data-theme="dark"] {
    --blue: #5B78FF;
    --blue-deep: #7C93FF;
    --blue-tint: #1A2152;
    --blue-line: #323D85;
    --ink: #060817;
    --ink-2: #12173A;
    --text: #ECEEF8;
    --muted: #A3A9C4;
    --paper: #0E1124;
    --mist: #141831;
    --line: #2A3052;
    --marker: #155C3B;
  }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--paper); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 16px/1.2 var(--font); text-decoration: none; border: 1.5px solid transparent; border-radius: 12px; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.btn--s { padding: 10px 16px; font-size: 15px; }
.btn--m { padding: 13px 20px; }
.btn--l { padding: 17px 26px; font-size: 17px; border-radius: 14px; }
.btn--primary { background: #3355FF; color: #fff; }
.btn--primary:hover { background: #2443E0; }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue-deep); }
.btn--light { background: #fff; color: #1B2FB0; }
.btn--light:hover { background: #E4E9FF; }
.btn--dark { background: var(--ink); color: #fff; border-color: var(--ink-2); }
.btn--dark:hover { background: var(--ink-2); }
.btn--tg { background: var(--tg); color: #fff; }
.btn--tg:hover { background: #1B8DC4; }

/* ---------- Шапка ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #3355FF; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -0.03em; }
.top__nav { display: flex; gap: 4px; margin-right: auto; }
.top__nav a { color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; padding: 9px 11px; border-radius: 9px; white-space: nowrap; }
.top__nav a:hover { background: var(--mist); color: var(--blue-deep); }
.top__nav a[aria-current="page"] { color: var(--blue-deep); background: var(--blue-tint); }
.burger { display: none; flex: none; width: 44px; height: 44px; border: 0; background: none; border-radius: 10px; cursor: pointer; padding: 0; position: relative; color: var(--text); }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, top .2s; }
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 25px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 1180px) {
  .top__in { gap: 12px; }
  .top__cta { margin-left: auto; }
  .burger { display: block; }
  .top__nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; margin: 0; }
  .top__nav.is-open { display: flex; }
  .top__nav a { font-size: 17px; padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .top__nav a:last-child { border-bottom: 0; }
}
@media (max-width: 420px) { .logo { font-size: 16px; } .top__cta { padding-inline: 12px; } }
@media (max-width: 389px) { .top__cta { display: none; } .burger { margin-left: auto; } }

/* ---------- Подвал ---------- */
.foot { border-top: 1px solid var(--line); padding: 44px 0 52px; font-size: 15px; }
.foot__in { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.foot__brand p { color: var(--muted); margin-top: 12px; max-width: 24em; }
.foot nav { display: grid; gap: 10px; align-content: start; }
.foot nav b { font-size: 15px; margin-bottom: 2px; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--blue-deep); text-decoration: underline; }
@media (max-width: 760px) { .foot__in { grid-template-columns: 1fr 1fr; } .foot__brand { grid-column: 1 / -1; } }


/* Шапка и подвал живут и на страницах Raxon: задаём им шрифт и сбрасываем наследуемое */
.top, .foot { font-family: var(--font); line-height: 1.55; }
.top .wrap, .foot .wrap { width: min(1160px, 100% - 40px); max-width: none; margin-inline: auto; padding-inline: 0; }
.top__nav a, .logo, .btn { -webkit-font-smoothing: antialiased; }

/* «English basics»: выпадающий список разделов (строится в js/scroll-top.js) */
.top__nav .rx-nav-drop__list { list-style: none; margin: 0; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(13, 18, 51, .35); z-index: 60; position: absolute; }
.top__nav .rx-nav-drop .rx-option { border-radius: 9px; font-size: 15px; }
.top__nav .rx-nav-drop__sep { background: var(--line); }
@media (max-width: 1180px) {
  .top__nav .rx-nav-drop { display: block; border-bottom: 1px solid var(--line); }
  .top__nav .rx-nav-drop > a { display: block; border-bottom: 0; background-image: none; }
  .top__nav .rx-nav-drop__list.rx-select__dropdown { display: block; position: static; border: 0; box-shadow: none; background: none; padding: 0 0 10px 14px; min-width: 0; }
  .top__nav .rx-nav-drop__list::before { display: none; }
  .top__nav .rx-nav-drop .rx-option { padding: 9px 4px; border-bottom: 0; font-size: 16px; color: var(--muted); }
  .top__nav .rx-nav-drop__sep { display: none; }
}

/* ---------- Тема: color-scheme и кнопка в шапке (js/theme.js) ---------- */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
.theme-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; padding: 0; transition: background .15s, color .15s, border-color .15s; }
.theme-btn:hover { background: var(--mist); color: var(--blue-deep); }
.theme-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn__moon { fill: currentColor !important; stroke: none !important; }
.theme-btn__sun { display: none; }
html[data-theme="dark"] .theme-btn__sun { display: block; }
html[data-theme="dark"] .theme-btn__moon { display: none; }
/* the button is always the last item before the burger: right edge on every page */
@media (max-width: 1180px) { .theme-btn { margin-left: auto; } .top__cta ~ .theme-btn { margin-left: 0; } }
@media (max-width: 520px) { .top__cta ~ .theme-btn { margin-left: auto; } }
.top__in .theme-btn ~ .burger { margin-left: 4px; }
/* phones: the theme button needs room, the hero has its own «Начать с главы 1» */
@media (max-width: 520px) { .top__cta { display: none; } }

/* «Сообщить об ошибке» по выделенному тексту (js/report-typo.js) */
.rt-btn { position: absolute; z-index: 90; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--ink, #0D1233); color: #fff; font: 600 14px/1 var(--font); cursor: pointer; box-shadow: 0 10px 24px -10px rgba(13, 18, 51, .5); white-space: nowrap; }
.rt-btn:hover { background: var(--ink-2, #1A2150); }
.rt-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .rt-btn { background: #fff; color: #0D1233; }
.rt-pop { position: fixed; z-index: 95; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 24px)); padding: 16px 18px 18px; border-radius: 16px; background: var(--paper); color: var(--text); border: 1px solid var(--line); box-shadow: 0 24px 48px -20px rgba(13, 18, 51, .45); font: 15px/1.45 var(--font); }
.rt-pop__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.rt-pop__head b { font-size: 16px; }
.rt-pop__x { width: 32px; height: 32px; margin: -6px -8px -6px 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.rt-pop__x:hover { background: var(--mist); color: var(--text); }
.rt-pop__q { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid #E0457B; background: var(--mist); border-radius: 0 8px 8px 0; max-height: 120px; overflow: auto; font-size: 14.5px; }
.rt-pop__l { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.rt-pop__l span { font-weight: 400; color: var(--muted); }
.rt-pop__l textarea { font: 15px/1.4 var(--font); padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--text); resize: vertical; }
.rt-pop__l textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
.rt-pop__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rt-pop__row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; }
.rt-pop__send { padding: 10px 16px; border: 0; border-radius: 10px; background: #3355FF; color: #fff; font: 600 15px/1 var(--font); cursor: pointer; }
.rt-pop__send:hover { background: #2443E0; }
.rt-pop__send:disabled { opacity: .6; cursor: default; }
.rt-pop__st { font-size: 14px; color: var(--muted); }
.rt-pop__st.is-ok { color: #1F8A4C; font-weight: 600; }
.rt-pop__st.is-err { color: #C62828; }
@media (max-width: 600px) { .rt-pop { left: 12px; right: 12px; bottom: 12px; width: auto; } }
