:root{
  --bg:#031322;
  --text:#ffffff;
  --nav-bg:rgba(7,28,50,0.7);
  --nav-border:rgba(255,255,255,0.08);
  --accent:#4fb0ff;
  --nav-h: 100px;
  --badge-gap: 0px;  /* если нужен зазор между шапкой и баджем, например 8px */

  /* для документации */
  --muted: #9db1c9;
  --code-bg: #0b1d33;
  --code-border: rgba(255,255,255,0.08);
  --toc-w: 260px;
}
*{ box-sizing:border-box; }
html, body {
  height:100%;
  -webkit-text-size-adjust: 100%; /* или 100%/none в зависимости от нужного эффекта */
  text-size-adjust: 100%;
}
body{
  padding-top: var(--nav-h);
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

.nav{
  position: fixed;           /* было sticky */
  top: 0; left: 0; right: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  min-height: var(--nav-h);
  display: flex;
  align-items: flex-end;
}
.nav-inner{
  width: 100%;
  max-width: 1200px;
  margin:0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px 10px 16px; /* отступ только снизу! */
  min-height: 56px;
}
.brand{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 200px;
  height: 62px;
}
.brand a{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #e7eef7;
}
.brand-img{
  width: 105px;
  height:auto; display:block;
  opacity: 0;
  transition: opacity .2s ease;
}
.brand-labels{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin-left: 12px;
  min-width: 122px;
}
.brand-title{
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  font-size: 36px; /*24*/
  letter-spacing: 0.34em;
  text-transform: uppercase;
  line-height: 1.08;
  color: #fff;
  margin-bottom: 2px;
  margin-top: 2px;
  text-align: left;
  white-space: nowrap;
  user-select: none;
}
.brand-sub{
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 22px; /*18*/
  letter-spacing: 0.11em;
  color: #b3c2d6;
  margin: 0;
  text-align: left;
  user-select: none;
  white-space: nowrap;
}
.menu{
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 41px;
}
.menu a{
  text-decoration: none; color: #e7eef7; padding: 8px 10px; border-radius:8px;
  font-weight: 600; font-size: 18px; line-height: 1;
  transition: transform .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
  margin-bottom: 0;
}
.menu a:hover{ background: rgba(255,255,255,0.06); transform: translateY(-2px); color:#fff; }
.menu a.cta{ border:1px solid rgba(255,255,255,0.18); }

.content{ max-width:1000px; margin:0 auto; padding:28px 16px 64px; white-space: pre-line;}
.content h1{ margin: 0px 0 5px; font-size: 36px; letter-spacing: 0.02em;} /*18*/
.content p{ margin:0 0 0px; color:#cfe0f5; line-height:1.6; max-width:100ch; font-size: 17px;} /*13*/
.content p b {
  color: #f1f7ff;
  font-weight: 500;
  font-size: 18px;
}
.link{ color:var(--accent); text-decoration:none; } .link:hover{ text-decoration:underline; }

.content h1::after{
  content: "";
  display: block;
  width: 346px;
  height: 2px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: .6;
}

.logo-fly{
  position:fixed; top:0; left:0; z-index:1000; pointer-events:none;
  /* стартовые значения выставим из JS в пикселях */
  transform: translate(0,0) scale(1);
  transform-origin: top left; /* чтобы translate задавал «левый-верхний» угол */
  will-change: transform;
}
#page-blur {
  position: fixed;
  inset: 0;
  z-index: 999; /* выше всего, кроме летуна */
  background: rgba(16,24,36,0.24); /* чуть затемнить */
  backdrop-filter: blur(8px);
  transition: opacity 0.4s;
  pointer-events: all;
}
#page-blur.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.container-badge {
  position: fixed;
  top: calc(var(--nav-h) + var(--badge-gap));
  left: 0;
  width: 100%;
  max-width: 1455px;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  justify-content: flex-end;
  z-index: 25;  /* ниже, чем шапка */
}

/* ====== Основной брейкпоинт: складываем шапку в колонку ====== */
@media (max-width: 1300px) {
  :root { --nav-h: 240px; }
  .nav {
    align-items: center;            /* выравниваем весь блок по центру */
    min-height: 230;
  }
  .nav-inner{
    flex-direction: column;         /* СТАНОВИМСЯ В КОЛОНКУ */
    align-items: center;            /* центрируем содержимое */
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 16px 12px;         /* немного меняем отступы */
    min-height: auto;               /* высоту можно отпустить */
  }

  .brand{
    width: 100%;
    height: auto;
    min-width: 0;
    justify-content: center;        /* центрируем блок бренда */
  }
  .brand a{
    flex-direction: column;         /* картинка сверху, подписи под ней */
    align-items: center;
    gap: 8px;
  }
  .brand-labels{
    margin-left: 0;                 /* убираем левый отступ */
    align-items: center;            /* центрируем подписи */
  }

  .menu{
    width: 100%;
    justify-content: center;        /* меню под логотипом, по центру */
    align-items: center;
    gap: 10px;
    min-height: 0;
  }
  .menu a{
    margin-bottom: 0;
  }

  .container-badge {
    max-width: 885px;
    top: 240px;
  }
}

@media (max-width: 762px) {
  :root { --nav-h: 270px; }

  .container-badge {
    max-width: 885px;
    top: 275px;
  }
}

@media (max-width: 540px) {
  :root { --nav-h: 335px; }

  .container-badge {
    max-width: 885px;
    top: 335px;
  }
}

@media (max-width:2px){
  :root { --nav-h: 280px; }
  .nav-inner{
    gap:6px;
    flex-direction:column;
    align-items:stretch;
  }
  .brand{ min-width:auto; gap:8px; }
  .brand-labels{ margin-left:8px; }
  .brand-title{
    font-size: 30px; /*24*/
  }
  .brand-sub{
    font-size: 20px; /*18*/
  }
  .menu{ min-height: 38px; }
  .menu a{
    margin-bottom: 0;
    font-size: 15px;
  }
  .content h1{font-size: 20px; } /*18*/
  .content p{ font-size: 15px;} /*13*/
}

/* ====== Очень узкие экраны: ещё компактнее ====== */
@media (max-width: 1px) {
  .brand-title{
    letter-spacing: 0.22em;
  }
  .brand-sub{
    letter-spacing: 0.08em;
  }
  .menu{
    gap: 8px;
  }
  .menu a{
    padding: 7px 9px;
  }
  /* Если текст рядом с логотипом мешает — можно скрыть на совсем узких */
  /* .brand-labels{ display:none; } */
}

a {
  text-decoration: none;
}
