/* One palette follows the browser until an explicit theme is selected. */
:root {
  color-scheme: only light;
  --page: #eaeaea;
  --panel: #f4f4f4;
  --ink: #171816;
  --muted: #636560;
  --line: #cfcfca;
  --accent: #cbfb45;
  --accent-ink: #4f681c;
  --on-accent: #171816;
  --raised: #f9faf7;
  --inset: #e5e7e0;
  --canvas: #f4f5f1;
  --art: #dedfd9;
  --soft: #e0e3d8;
  --hover: #e9ece1;
  --selected: #f6f6f6;
  --tint: #f0f2e9;
  --quiet: #7b8170;
  --edge: #ffffff;
  --field-border: #c5cbb9;
  --accent-border: #99b65b;
  --shine: #ffffff;
  --rim: #ffffff65;
  --focus: #577319;
  --primary: #181917;
  --primary-ink: #ffffff;
  --primary-border: #41423d;
  --primary-hover: #292d23;
  --primary-shine: #777777;
  --primary-rim: #ffffff29;
  --primary-hover-shine: #999999;
  --glow-border: #d0d2c8;
  --hero-badge: #d5d6d0b0;
  --hero-word-start: #222222;
  --hero-word-middle: #858582;
  --network-frame: #e6e7e370;
  --window-interior: #ededeb;
  --route-selected: #e0edc1;
  --power-ring-inner: #cad0bf4d;
  --power-ring-outer: #d4d9cd60;
  --card-outline: #d5d8cf38;
  --card-hover-outline: #d5d8cf38;
  --art-highlight: #e0e5d2;
  --console-outline: #dee1d754;
  --console-side: #eceee7;
  --closing-surface: #e1e4da;
  --closing-word: #acb99842;
  --footer-surface: #eaece6;
  --form-surface: #f1f2ed;
  --field-surface: #fafbf7;
  --result-surface: #e7efda;
  --atmosphere: #bad97955;
  --orbit-line: #b7bcad;
  --orbit-fill: #dfe1d8;
  --shadow: 0 2px 2px #00000008, 0 5px 8px #00000009;
  --globe-filter: none;
}
:root[data-theme="light"] {
  color-scheme: only light;
}
/* Screen-only overrides leave every printed surface on the light palette. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: only dark;
    --page: #191c18;
    --panel: #272c24;
    --ink: #f0f2e9;
    --muted: #b4bcab;
    --line: #454e3d;
    --accent-ink: #cbfb45;
    --raised: #30372b;
    --inset: #20251e;
    --canvas: #22281e;
    --art: #2c3426;
    --soft: #333d2b;
    --hover: #37422e;
    --selected: #343e2b;
    --tint: #293422;
    --quiet: #a7b29a;
    --edge: #48523f;
    --field-border: #758368;
    --accent-border: #718b46;
    --shine: #ffffff0d;
    --rim: #ffffff0a;
    --focus: #cbfb45;
    --primary: #cbfb45;
    --primary-ink: #171816;
    --primary-border: #a6c940;
    --primary-hover: #d8ff75;
    --primary-shine: #edffb8;
    --primary-rim: #ffffff45;
    --primary-hover-shine: #f0ffc6;
    --glow-border: #84984f;
    --hero-badge: #363e2ec7;
    --hero-word-start: #505d3d;
    --hero-word-middle: #303a28;
    --network-frame: #232920b3;
    --window-interior: #20251e;
    --route-selected: #3b4b28;
    --power-ring-inner: #647c3325;
    --power-ring-outer: #647c3312;
    --card-outline: #38432a38;
    --card-hover-outline: #546d3238;
    --art-highlight: #333f27;
    --console-outline: #38432a38;
    --console-side: #242d1e;
    --closing-surface: #20271b;
    --closing-word: #a4c67a15;
    --footer-surface: #1e241a;
    --form-surface: #252d1f;
    --field-surface: #1e241a;
    --result-surface: #2d3c21;
    --atmosphere: #cbfb4510;
    --orbit-line: #566447;
    --orbit-fill: #2b3423;
    --shadow: 0 2px 2px #00000020, 0 5px 8px #00000025;
    --globe-filter: invert(1) hue-rotate(180deg);
  }
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: only dark;
    --page: #191c18;
    --panel: #272c24;
    --ink: #f0f2e9;
    --muted: #b4bcab;
    --line: #454e3d;
    --accent-ink: #cbfb45;
    --raised: #30372b;
    --inset: #20251e;
    --canvas: #22281e;
    --art: #2c3426;
    --soft: #333d2b;
    --hover: #37422e;
    --selected: #343e2b;
    --tint: #293422;
    --quiet: #a7b29a;
    --edge: #48523f;
    --field-border: #758368;
    --accent-border: #718b46;
    --shine: #ffffff0d;
    --rim: #ffffff0a;
    --focus: #cbfb45;
    --primary: #cbfb45;
    --primary-ink: #171816;
    --primary-border: #a6c940;
    --primary-hover: #d8ff75;
    --primary-shine: #edffb8;
    --primary-rim: #ffffff45;
    --primary-hover-shine: #f0ffc6;
    --glow-border: #84984f;
    --hero-badge: #363e2ec7;
    --hero-word-start: #505d3d;
    --hero-word-middle: #303a28;
    --network-frame: #232920b3;
    --window-interior: #20251e;
    --route-selected: #3b4b28;
    --power-ring-inner: #647c3325;
    --power-ring-outer: #647c3312;
    --card-outline: #38432a38;
    --card-hover-outline: #546d3238;
    --art-highlight: #333f27;
    --console-outline: #38432a38;
    --console-side: #242d1e;
    --closing-surface: #20271b;
    --closing-word: #a4c67a15;
    --footer-surface: #1e241a;
    --form-surface: #252d1f;
    --field-surface: #1e241a;
    --result-surface: #2d3c21;
    --atmosphere: #cbfb4510;
    --orbit-line: #566447;
    --orbit-fill: #2b3423;
    --shadow: 0 2px 2px #00000020, 0 5px 8px #00000025;
    --globe-filter: invert(1) hue-rotate(180deg);
  }
}

::selection {
  color: var(--on-accent);
}
:focus-visible {
  outline-color: var(--focus);
}
.skip-link,
.note-icon,
.illustration-button,
.confirm-label,
.power-symbol,
.new-badge,
.step:first-child .step-number,
.split-paths span:first-child {
  color: var(--on-accent);
}
.text-link,
.document a:not(.button):not(.brand) {
  text-decoration-color: var(--accent-border);
}
.button {
  border-color: var(--line);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  box-shadow:
    inset 0 1px 1px var(--shine),
    inset 0 -1px 1px #0000000d,
    var(--shadow);
}
.button:after {
  border-color: var(--rim);
}
.button:hover {
  background: var(--raised);
  box-shadow:
    inset 0 1px var(--shine),
    0 5px 10px #00000017;
}
.button-dark {
  background: var(--primary);
  border-color: var(--primary-border);
  color: var(--primary-ink);
  box-shadow:
    inset 0 1px 1px var(--primary-shine),
    0 3px 5px #0003;
}
.button-dark:after {
  border-color: var(--primary-rim);
}
.button-dark:hover {
  background: var(--primary-hover);
  box-shadow:
    inset 0 1px var(--primary-hover-shine),
    0 5px 10px #0003;
}
.button-glow {
  color: var(--on-accent);
  border-color: var(--glow-border);
}
.button-glow:hover {
  background:
    radial-gradient(ellipse at 100% 80%, #b9f120 0, transparent 78%), #e6e8df;
}
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.is-scrolled .header-shell {
  max-width: min(960px, calc(100% - 32px));
  border-color: var(--edge);
  box-shadow: var(--shadow);
}
.nav-wrap,
.nav-actions,
.nav-links {
  min-width: 0;
}
.nav-actions,
.nav-wrap > .brand {
  flex-shrink: 0;
}

/* Keep the native menus and full-size hit areas behind the compact labels. */
.preferences {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
}
.preference-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow:
    inset 0 1px var(--shine),
    inset 0 -1px #0000000a,
    0 2px 3px #00000008;
  transition: box-shadow 0.18s;
}
.preference-control:hover {
  background: var(--raised);
  border-color: var(--accent-border);
}
.preference-control:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  background: var(--raised);
}
.preference-control select {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: transparent;
  font-size: 16px;
  cursor: pointer;
}
.preference-control select:focus-visible {
  outline: none;
}
.preference-control option {
  background: var(--panel);
  color: var(--ink);
  font: 14px var(--font);
}
.preference-control .icon {
  width: 19px;
  height: 19px;
  pointer-events: none;
}
.theme-control .theme-moon {
  display: none;
}
:root[data-theme="dark"] .theme-control .theme-sun {
  display: none;
}
:root[data-theme="dark"] .theme-control .theme-moon {
  display: block;
  color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-control .theme-sun {
    display: none;
  }
  :root:not([data-theme]) .theme-control .theme-moon {
    display: block;
    color: var(--accent);
  }
}
:root[data-theme-mode="auto"] .theme-control:after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-ink);
  box-shadow: 0 0 0 2px var(--panel);
  pointer-events: none;
}
.language-control {
  width: 60px;
}
.language-code {
  padding-right: 10px;
  font: 500 12px/1 var(--mono);
  letter-spacing: -0.03em;
  pointer-events: none;
}
.language-control .language-icon {
  display: none;
}
.language-control:after {
  content: "";
  position: absolute;
  right: 9px;
  top: 17px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.docs-preferences {
  margin-bottom: 8px;
}
.docs-sidebar > .button {
  white-space: normal;
  text-align: left;
}
.no-js-preferences {
  display: none;
}
html:not(.js) .no-js-preferences {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 12px var(--mono);
}
.no-js-preferences a {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.no-js-preferences a[aria-current],
html:lang(ru) .no-js-preferences a[lang="ru"],
html:lang(en) .no-js-preferences a[lang="en"] {
  color: var(--accent-ink);
  border-color: var(--accent-border);
}

.hero-layout:before,
.window-sidebar,
.window-brand,
.sidebar-divider,
.inset-label,
.window-canvas,
.small-tag,
.hero-regions a,
.step:before {
  border-color: var(--line);
}
.hero-badge {
  background: var(--hero-badge);
  box-shadow: inset 0 1px var(--rim);
}
.hero-word {
  background-image: linear-gradient(
    var(--hero-word-start),
    var(--hero-word-middle) 80%,
    var(--page)
  );
}
.network-window {
  background: var(--network-frame);
  border-color: var(--line);
}
.window-inner {
  background: var(--window-interior);
  border-color: var(--edge);
  box-shadow: inset 0 0 1px var(--line);
}
.window-search {
  background: var(--inset);
  border-color: var(--field-border);
  color: var(--muted);
}
.window-app.active,
.docs-group a[aria-current="page"] {
  background: var(--selected);
  border-color: var(--edge);
  box-shadow:
    var(--shadow),
    0 0 0 1px var(--line);
}
.window-app:hover,
.usecase-tab:hover,
.docs-group a:hover {
  background: var(--hover);
}
.window-canvas {
  background: var(--canvas);
}
/* Only the two schematic SVG globes are recolored; app icons stay original. */
.hero-globe,
.server-console-side > img[src$="globe.svg"] {
  filter: var(--globe-filter);
}
.hero-regions a {
  background: var(--raised);
}
.hero-regions a:hover {
  background: var(--hover);
  border-color: var(--accent-border);
}
.floating-note,
.mini-store,
.android-dialog,
.country-stack > span,
.panel-caption,
.routing-countries > span,
.split-art span {
  background: var(--canvas);
  border-color: var(--edge);
}
.window-brand small,
.sidebar-caption,
.window-sidebar-foot,
.hero-regions a > span:last-child,
.crosshair,
.spec-strip i,
.country-stack small,
.app-index,
.tab-number,
.search-control > .icon,
.directory-head,
.country-label small,
.row-chevron,
.footer-column h2,
.footer-bottom,
.docs-sidebar > .brand + small,
.docs-sidebar > .brand + p,
.docs-sidebar > .sidebar-subtitle,
.docs-group > .eyebrow,
.docs-group > h2,
.docs-group > p,
.docs-toc a,
.form-field small,
.form-hint {
  color: var(--quiet);
}
.step-number,
.step-body,
.app-card,
.contact-card {
  border-color: var(--edge);
}
.step-art {
  background:
    radial-gradient(ellipse at 50% 10%, var(--atmosphere), transparent 70%),
    url("assets/terrain.svg") center/650px auto,
    var(--inset);
}
.country-stack > span:nth-child(2),
.routing-countries > span:nth-child(2) {
  border-color: var(--accent-border);
}
.routing-countries > span:nth-child(2) {
  background: var(--route-selected);
}
.power-rings {
  border-color: var(--accent-border);
  box-shadow:
    0 0 0 15px var(--power-ring-inner),
    0 0 0 30px var(--power-ring-outer);
}
.power-rings:before {
  border-color: var(--accent-border);
}
.connection-caption,
.check-list li:before,
.latency {
  color: var(--accent-ink);
}
.app-card {
  box-shadow:
    var(--shadow),
    0 0 0 5px var(--card-outline);
}
.app-card:hover {
  box-shadow:
    0 10px 20px #00000020,
    0 0 0 5px var(--card-hover-outline);
}
.app-card:target {
  outline-color: var(--focus);
}
.app-art {
  background: var(--art);
}
.app-art-rabochiy {
  background: var(--art-highlight);
}
.app-art img,
.routing-art > img {
  outline-color: var(--rim);
}
.app-orbit,
.app-art-rabochiy .app-orbit {
  border-color: var(--orbit-line);
  box-shadow:
    0 0 0 20px var(--orbit-fill),
    0 0 0 21px var(--orbit-line),
    0 0 0 45px var(--orbit-fill),
    0 0 0 46px var(--orbit-line),
    0 0 0 70px var(--orbit-fill),
    0 0 0 71px var(--orbit-line);
}
.usecase-panel {
  background:
    url("assets/terrain.svg") top center/700px auto,
    var(--inset);
}
.route-device,
.route-globe {
  background: var(--canvas);
  border-color: var(--line);
}
.route-line,
.route-line:after {
  background: var(--accent-border);
}
.split-paths span:before {
  border-color: var(--accent-border);
}
.split-paths span:first-child {
  background: var(--accent);
}
.servers-section {
  background: radial-gradient(
    ellipse at 50% 60%,
    var(--atmosphere),
    transparent 65%
  );
}
.server-console {
  background: var(--inset);
  border-color: var(--edge);
  box-shadow:
    var(--shadow),
    0 0 0 7px var(--console-outline);
}
.server-console-side {
  background: var(--console-side);
  border-color: var(--line);
}
.server-directory {
  background: var(--canvas);
  border-color: var(--line);
}
.search-control input {
  background: var(--inset);
  border-color: var(--field-border);
}
.sort-control select {
  background: var(--raised);
  border-color: var(--field-border);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.directory-head,
.server-row {
  border-color: var(--line);
}
.server-row:target {
  background: var(--tint);
}
.signal-bars {
  background:
    linear-gradient(to top, var(--accent-ink) 0 40%, transparent 40%) 0
      bottom/3px 100% no-repeat,
    linear-gradient(to top, var(--accent-ink) 0 70%, transparent 70%) 5px
      bottom/3px 100% no-repeat,
    linear-gradient(var(--accent-ink), var(--accent-ink)) 10px bottom/3px 100%
      no-repeat;
}
.ping-notice {
  background: var(--inset);
  border-color: var(--line);
}
.ping-notice > span,
.ping-notice p,
.footer-column a,
.footer-bottom > a,
.form-note,
.form-status,
#contact-status,
#copy-status {
  color: var(--muted);
}
.feature-symbol {
  background: var(--soft);
  border-color: var(--line);
  color: var(--accent-ink);
  box-shadow:
    inset 0 1px var(--shine),
    var(--shadow);
}
.faq-list summary > span {
  background: var(--panel);
  border-color: var(--line);
  color: var(--muted);
}
.faq-list details[open] summary > span {
  background: var(--accent);
  border-color: var(--accent-border);
  color: var(--on-accent);
}
.closing-section {
  background:
    radial-gradient(ellipse at 50% 105%, var(--atmosphere), transparent 70%),
    var(--closing-surface);
  border-color: var(--line);
}
.closing-ticker {
  border-color: var(--orbit-line);
  color: var(--quiet);
}
.closing-orbits {
  border-color: var(--orbit-line);
  box-shadow:
    0 0 0 30px var(--orbit-fill),
    0 0 0 31px var(--orbit-line),
    0 0 0 65px var(--orbit-fill),
    0 0 0 66px var(--orbit-line),
    0 0 0 100px var(--orbit-fill),
    0 0 0 101px var(--orbit-line);
}
.closing-word {
  color: var(--closing-word);
}
.site-footer {
  background: var(--footer-surface);
}
.docs-page {
  background: var(--page);
}
.docs-sidebar {
  border-color: var(--edge);
  box-shadow:
    var(--shadow),
    0 0 0 1px var(--line);
}
.docs-sidebar nav,
.doc-section h2,
.docs-toc nav {
  border-color: var(--line);
}
.doc-callout {
  background: var(--tint);
  border-color: var(--accent-border);
  border-left-color: var(--accent-ink);
}
.contact-form,
#contact-form {
  background: var(--form-surface);
  border-color: var(--edge);
}
.form-field input,
.form-field select,
.form-field textarea,
.form-control {
  background: var(--field-surface);
  border-color: var(--field-border);
}
.contact-result,
#contact-result {
  background: var(--result-surface);
  border-color: var(--accent-border);
}
.document th {
  background: var(--soft);
}

html:lang(en) .hero h1 {
  font-size: clamp(40px, 4.1vw, 60px);
  letter-spacing: -0.045em;
}
html:lang(en) .hero-description {
  max-width: 32ch;
}
html:lang(en) .section-heading h2 {
  max-width: 24ch;
}
html:lang(en) .section-heading.centered h2 {
  margin-inline: auto;
}
@media (min-width: 761px) and (max-width: 1000px) {
  .nav-wrap,
  .is-scrolled .nav-wrap {
    gap: 16px;
  }
  .nav-links,
  .is-scrolled .nav-links {
    gap: 16px;
  }
  .nav-links a {
    font-size: 13px;
  }
}
@media (max-width: 1000px) {
  .nav-actions > .button-small {
    display: none;
  }
}
@media (max-width: 760px) {
  .nav-wrap,
  .is-scrolled .nav-wrap {
    gap: 8px;
  }
  .nav-actions {
    gap: 6px;
  }
  .nav-links {
    border-color: var(--edge);
  }
  .nav-links a:hover {
    background: var(--hover);
  }
  .is-scrolled .header-shell {
    max-width: calc(100% - 20px);
  }
  .docs-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 12px;
  }
  .docs-sidebar > .brand {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }
  .docs-sidebar > .brand + small,
  .docs-sidebar > .brand + p,
  .docs-sidebar > .sidebar-subtitle {
    grid-column: 1;
    grid-row: 2;
    margin: 6px 0 0;
  }
  .docs-preferences {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
  }
  .docs-sidebar > .button {
    grid-column: 1 / -1;
    position: static;
    width: 100%;
    margin: 16px 0 0;
    min-height: 42px;
    font-size: 12px;
  }
  .docs-sidebar > nav {
    grid-column: 1 / -1;
  }
  .docs-page .copy-page {
    border-color: var(--line);
  }
  html:lang(en) .hero h1 {
    font-size: clamp(35px, 10.3vw, 52px);
    white-space: normal;
  }
}
@media (forced-colors: active) {
  .preference-control {
    border-color: ButtonText;
    color: ButtonText;
    forced-color-adjust: none;
    background: Canvas;
  }
  .preference-control:focus-within {
    outline-color: Highlight;
  }
  .preference-control option {
    color: CanvasText;
    background: Canvas;
  }
  .theme-control .theme-moon,
  :root[data-theme="dark"] .theme-control .theme-moon,
  :root:not([data-theme]) .theme-control .theme-moon {
    color: ButtonText;
  }
}
@media print {
  :root,
  :root:not([data-theme]),
  :root[data-theme] {
    color-scheme: only light !important;
    --globe-filter: none;
  }
  .preferences,
  .no-js-preferences,
  html:not(.js) .no-js-preferences {
    display: none;
  }
  body,
  .docs-page {
    background: #fff;
    color: #000;
  }
  .docs-sidebar {
    display: none;
  }
  .doc-callout {
    background: transparent;
  }
}
