/* Site language (OSIC-283): the switch in the header and the Russian type. js/i18n.js sets <html lang>.
   The landing's fonts have no Cyrillic, so Russian uses the brand's bilingual set (docs/brand/identity.md):
   Oswald, IBM Plex Sans, IBM Plex Mono. Browsers fetch these only when a Russian page uses them. */
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/oswald-cyrillic.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/oswald-latin.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/ibm-plex-sans-cyrillic.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-cyrillic.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-cyrillic.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin.woff2?v=a588ffc522) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

html:lang(ru) {
  --f-display: "Oswald", "Arial Narrow", sans-serif;
  --f-body: "IBM Plex Sans", Arial, sans-serif;
  --f-record: "IBM Plex Mono", "Courier New", monospace;
  --f-term: "IBM Plex Mono", ui-monospace, monospace;
}

/* English left on a Russian page (the landing's headings) keeps the landing's own fonts. */
html:lang(ru) [lang="en"] {
  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Libre Franklin", "Franklin Gothic Book", Arial, sans-serif;
  --f-record: "Courier Prime", "Courier New", monospace;
  --f-term: "VT323", ui-monospace, monospace;
}

/* A non-English page stays hidden until its text is swapped, so English never flashes (i18n.js gives up after 3 s). */
html.i18n-pending body { visibility: hidden; }

/* The switch: a button with the current language and a menu under it. */
.lang-menu { position: relative; flex: none; }
.lang-menu > button { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 1px solid var(--line-paper);
  border-radius: 10px; background: transparent; color: var(--ink); font: 600 14px/1 var(--f-body); letter-spacing: .04em; cursor: pointer; }
.lang-menu > button:hover, .lang-menu > button[aria-expanded="true"] { border-color: var(--ink); }
.lang-menu > button svg { width: 16px; height: 16px; flex: none; }
.lang-menu > button .caret { width: 10px; height: 10px; transition: transform var(--t-fast) var(--ease-in); }
.lang-menu > button[aria-expanded="true"] .caret { transform: rotate(180deg); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 150px; margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--line-paper); border-radius: 10px; background: var(--paper); box-shadow: 0 18px 40px -18px rgba(23,22,15,.55); }
.lang-menu ul[hidden] { display: none; }
.lang-menu li + li { margin-top: 2px; }
.lang-menu li button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px; border: 0;
  border-radius: 6px; background: transparent; color: var(--ink); font: 400 15px/1.2 var(--f-body); text-align: left; cursor: pointer; }
.lang-menu li button:hover, .lang-menu li button:focus-visible { background: rgba(23,22,15,.08); outline: none; }
.lang-menu li button small { font: 400 12px/1 var(--f-record); color: var(--muted-ink); }
.lang-menu li button[aria-checked="true"] { font-weight: 600; }
.lang-menu li button[aria-checked="true"] small { color: var(--signal-paper); }
