@font-face {
  font-family: Tektur;
  src: url("./tektur-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0400-052F, U+2DE0-2DFF, U+A640-A69F, U+1C80-1C8A, U+20B4;
}

@font-face {
  font-family: Tektur;
  src: url("./tektur-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050807;
  --surface: #0a0d0c;
  --surface-raised: #0d100f;
  --surface-soft: rgba(255, 255, 255, .035);
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f0f3f2;
  --muted: #9c9f9e;
  --subtle: #6f7472;
  --primary: #eef0f2;
  --primary-hover: #ffffff;
  --primary-ink: #0a0b0d;
  --danger: #ff8e96;
  --max: 1380px;
  font-family: Tektur, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); }
body {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(900px 440px at 50% -180px, rgba(255, 255, 255, .08), transparent 72%),
    linear-gradient(180deg, #070a09 0%, var(--bg) 46%, #040605 100%);
}

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 200;
  width: min(1380px, calc(100% - 36px));
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: 8px 9px 8px 14px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 15px;
  background: linear-gradient(rgba(40, 42, 48, .6), rgba(12, 13, 16, .5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    0 18px 54px -30px rgba(0, 0, 0, .95);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
  padding: 4px 5px 4px 2px;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: .005em;
}

.brand-mark {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  display: block;
  object-fit: contain;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}

.header-nav a {
  padding: 8px 11px;
  border-radius: 8px;
  color: #9c9c9d;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: color .18s ease, background-color .18s ease;
}

.header-nav a:hover,
.header-nav a:focus-visible,
.header-nav a.active {
  color: var(--text);
  background: var(--surface-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.language-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
}

.language-switch button {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 32px;
  padding: 0;
  border: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}

.language-switch button:hover { color: var(--text); }
.language-switch button.active {
  border-color: rgba(255, 255, 255, .78);
  background: var(--primary);
  color: var(--primary-ink);
}

.login-button,
.docs-support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 22px -8px rgba(0, 0, 0, .5);
  transition: transform .2s ease, background-color .2s ease;
}

.login-button {
  height: 36px;
  padding: 0 16px;
  font-size: 13.5px;
}

.login-button:hover,
.docs-support-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.login-button:active,
.docs-support-button:active { transform: translateY(1px); }

.brand:focus-visible,
.header-nav a:focus-visible,
.language-switch button:focus-visible,
.login-button:focus-visible,
.docs-support-button:focus-visible,
.docs-list button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.docs-main {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 150px 0 68px;
}

.docs-hero {
  max-width: 760px;
  margin-bottom: 46px;
}

.docs-eyebrow {
  margin: 0 0 15px;
  color: #c6cac9;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .14em;
}

.docs-hero h1 {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1;
  letter-spacing: -.05em;
  font-weight: 650;
}

.docs-hero p:last-child {
  max-width: 65ch;
  margin: 21px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.docs-shell {
  min-height: 520px;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 11, 10, .92);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 32px 90px -58px rgba(0, 0, 0, .9);
}

.docs-sidebar {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
}

.docs-sidebar-title {
  padding: 4px 8px 14px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.docs-list {
  display: grid;
  gap: 6px;
  max-height: 560px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.docs-filters label { display: grid; gap: 8px; flex: 1 1 180px; min-width: 0; color: var(--muted); font-size: 13px; }
.docs-filters input, .docs-filters select { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }
.docs-filters :focus-visible, #docs-more:focus-visible, #docs-status button:focus-visible, .docs-empty button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.docs-filter-hint, #docs-status { color: var(--muted); font-size: 12px; line-height: 1.6; }
.docs-category { min-width: 0; }
.docs-category .docs-sidebar-title { margin: 12px 0 0; }
.docs-category button + button { margin-top: 6px; }
#docs-more { margin-top: 16px; }
#docs-more[hidden] { display: none; }
.docs-empty button { margin-top: 20px; }
.docs-article-body pre { max-width: 100%; overflow-x: auto; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); }
.docs-article-body code { overflow-wrap: anywhere; }
.docs-article-body .manual-figure { margin: 28px 0; }
.docs-article-body .manual-figure img { display: block; width: 100%; height: auto; }
.docs-article-body .manual-figure figcaption { margin-top: 9px; color: var(--subtle); font-size: 12px; line-height: 1.55; }

.docs-list button {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #b7bcba;
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.docs-list button:hover,
.docs-list button.active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .055);
  color: #fff;
}

.docs-list button span { display: block; }
.docs-list button small {
  display: block;
  margin-top: 5px;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.4;
}

.docs-loading {
  display: block;
  padding: 10px 8px;
  color: var(--subtle);
  font-size: 12px;
}

.docs-content {
  width: 100%;
  min-width: 0;
  padding: clamp(28px, 4vw, 52px);
}

.docs-article {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.docs-empty {
  max-width: 520px;
  padding: 66px 0;
}

.docs-empty h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.docs-empty p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.docs-support-button {
  min-height: 43px;
  margin-top: 25px;
  padding: 0 18px;
  font-size: 13px;
}

.docs-article-cover {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  margin-bottom: 30px;
  border-radius: 12px;
}

.docs-article-meta {
  margin: 0 0 12px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
}

.docs-article h2 {
  margin: 0;
  font-size: clamp(28px, 3.7vw, 44px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.docs-article-summary {
  margin: 18px 0 0;
  color: #b9bfbd;
  font-size: 15px;
  line-height: 1.6;
}

.docs-article-body {
  margin: 30px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: #d2d7d5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font: 14px/1.75 Tektur, ui-sans-serif, system-ui, sans-serif;
}

.docs-unavailable { color: #b7bcba; }
.docs-unavailable strong { display: block; margin-bottom: 9px; color: #fff; }

.status-main { min-height: calc(100dvh - 90px); }
.status-hero { margin-bottom: 34px; }

.status-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 11, 10, .92);
}

.status-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.status-summary strong,
.status-summary span { display: block; }
.status-summary strong { font-size: 17px; }
.status-summary div > span {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 11px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--subtle);
}
.status-indicator.is-ok { background: #57d399; }
.status-indicator.is-checking { background: #9aa0a0; animation: statusPulse 1.2s ease-in-out infinite; }
.status-indicator.is-unknown { background: #e0a85a; }

.status-refresh {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.status-refresh:hover { background: var(--surface-soft); }
.status-refresh:disabled { cursor: wait; opacity: .55; }

.status-services { display: grid; }
.status-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 26px;
  border-bottom: 1px solid var(--line);
}
.status-service h2 { margin: 0; font-size: 17px; }
.status-service p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.status-badge {
  flex: 0 0 auto;
  min-width: 132px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-badge.is-ok { border-color: rgba(87, 211, 153, .34); color: #79ddb0; background: rgba(87, 211, 153, .08); }
.status-badge.is-checking { color: var(--muted); }
.status-badge.is-unknown { border-color: rgba(224, 168, 90, .34); color: #e6b66f; background: rgba(224, 168, 90, .08); }
.status-honesty { margin: 0; padding: 20px 26px; color: var(--subtle); font-size: 11px; line-height: 1.6; }

@keyframes statusPulse { 50% { opacity: .35; } }

.docs-footer {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 32px));
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 11px;
}

.docs-footer a { text-decoration: none; }
.docs-footer a:hover { color: #fff; }

@media (max-width: 1040px) {
  .header-nav { display: none; }
  .header-actions { margin-left: auto; }
}

@media (max-width: 760px) {
  .docs-main { padding-top: 126px; }
  .docs-hero { margin-bottom: 34px; }
  .docs-shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .docs-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .docs-list {
    width: 100%;
    max-width: 100%;
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    max-height: 240px;
  }
  .docs-list > .docs-category {
    min-width: 0;
    flex: 0 0 min(78vw, 280px);
    scroll-snap-align: start;
  }
  .docs-content,
  .docs-article,
  .docs-article-summary,
  .docs-article-body { max-width: 100%; }
  .docs-empty { padding: 32px 0; }
}

@media (max-width: 620px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    padding: 10px 8px 10px 12px;
    border-radius: 14px;
  }

  .site-header .brand { gap: 8px; font-size: 15px; }
  .site-header .brand-mark { width: 28px; height: 28px; }
  .header-actions { gap: 7px; }
  .language-switch button { width: 32px; height: 30px; }
  .login-button { height: 34px; padding: 0 12px; font-size: 12px; }

  .docs-main,
  .docs-footer { width: calc(100% - 24px); }

  .docs-main { padding-top: 112px; }
  .docs-hero h1 { font-size: clamp(35px, 11vw, 47px); }
  .docs-hero p:last-child { font-size: 14px; }
  .docs-shell { border-radius: 14px; }
  .docs-sidebar { padding: 13px; }
  .docs-content { padding: 23px 20px; }
  .status-summary { grid-template-columns: auto 1fr; padding: 20px; }
  .status-refresh { grid-column: 1 / -1; width: 100%; }
  .status-service { align-items: flex-start; padding: 22px 20px; }
  .status-badge { min-width: 112px; }
  .status-honesty { padding: 18px 20px; }
}

@media (max-width: 370px) {
  .site-header .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .language-switch::before,
  .login-button,
  .docs-support-button,
  .docs-list button { transition: none; }
  .status-indicator.is-checking { animation: none; }
}
