/* TundraLabs · общая оболочка сайта: единый логотип + единый фон на всех страницах.
   Подключается одной строкой рядом с tundra-shell.js. Самодостаточен: не требует
   motion-system.css (нужные правила атмосферы продублированы ниже). */

/* ───────────────────────────── ЛОГОТИП ─────────────────────────────
   Один знак на весь сайт: контурный гексагон с «T» + слово TundraLabs.
   !important на размерах — страницы имеют собственные .brand svg/.logo,
   которые иначе перебивают инжектируемый знак. */
.tsh-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.tsh-brand svg.tsh-mark {
  width: 27px !important;
  height: 27px !important;
  flex: none;
  display: block;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  transition: filter .32s cubic-bezier(.22, .61, .36, 1),
              transform .32s cubic-bezier(.22, .61, .36, 1);
}

.tsh-brand .tsh-word {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.012em;
  color: var(--cream, #F6EFE4);
  white-space: nowrap;
  text-transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .tsh-brand:hover svg.tsh-mark {
    transform: translateY(-1px);
    filter: drop-shadow(0 5px 16px rgba(255, 122, 41, .45));
  }
  .tsh-brand:hover .tsh-word { color: var(--amber, #FFB25C); }
}

.tsh-brand:focus-visible {
  outline: 2px solid var(--accent, #FF8A3C);
  outline-offset: 4px;
  border-radius: 9px;
}

/* крупный знак — экраны входа (hub) */
.tsh-brand.tsh-lg svg.tsh-mark { width: 46px !important; height: 46px !important; }
.tsh-brand.tsh-lg .tsh-word { font-size: 19px; }

/* знак без подписи — там, где рядом уже есть заголовок.
   Гасим родную заливку блока (hub рисовал знак белым по оранжевому квадрату). */
.tsh-brand.tsh-markonly .tsh-word { display: none; }
.tsh-brand.tsh-markonly {
  background: none !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  place-items: start !important;
}

@media (max-width: 460px) {
  .tsh-brand { gap: 8px; }
  .tsh-brand svg.tsh-mark { width: 24px !important; height: 24px !important; }
  .tsh-brand .tsh-word { font-size: 14px; }
}

/* ─────────────────────── МОБИЛЬНОЕ МЕНЮ ───────────────────────
   На узких экранах вёрстка главной прячет .nav-links целиком — вместе с ними
   пропадали Новости, Документация и Поддержка. Кнопка появляется только тогда,
   когда меню действительно скрыто (проверяет tundra-shell.js). */
.tsh-burger { display: none; }

.nav-bar.tsh-has-menu .tsh-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 38px;
  padding: 0 12px;
  margin-left: 6px;
  border: 1px solid var(--line, rgba(255,214,170,.09));
  border-radius: 999px;
  background: rgba(255, 214, 170, .04);
  color: var(--cream, #F6EFE4);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tsh-burger svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.tsh-sheet {
  position: fixed;
  inset: 0;
  /* Точно между двумя соседями: виджет чата (.tsw-root) сидит на 2147483000 и
     при равном z-index выигрывал по порядку в DOM, а баннер согласия
     (.tcc-root, 2147483100) перекрывать нельзя — это юридический элемент. */
  z-index: 2147483050;
  display: none;
  background: rgba(8, 7, 5, .62);
  backdrop-filter: blur(6px);
}

.tsh-sheet[open] { display: block; }

.tsh-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 86vh;
  overflow-y: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line, rgba(255,214,170,.12));
  background: var(--panel, #151210);
  animation: tshSheetUp .28s cubic-bezier(.16, 1, .3, 1);
}

@keyframes tshSheetUp { from { transform: translateY(14%); opacity: .4; } }

.tsh-sheet-grip {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--line, rgba(255,214,170,.18));
}

.tsh-sheet-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  color: var(--text, #F3ECE1);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.tsh-sheet-panel a + a { margin-top: 2px; }
.tsh-sheet-panel a:active { background: rgba(255, 214, 170, .07); }

.tsh-sheet-panel a:after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--soft, #7C7061);
  border-top: 2px solid var(--soft, #7C7061);
  transform: rotate(45deg);
  opacity: .8;
}

.tsh-sheet-close {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 1px solid var(--line, rgba(255,214,170,.12));
  border-radius: 13px;
  background: none;
  color: var(--muted, #B2A493);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .tsh-sheet-panel { animation: none; }
}

/* ───────────────────────────── ФОН ─────────────────────────────
   Тот же слой, что на главной: аврора + зерно + (на мощных устройствах)
   жидкий WebGL-эфир. Здесь только статика; canvas поднимает tundra-shell.js. */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
}

.aurora-bg i {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  will-change: transform;
}

.aurora-bg .a1 {
  width: 45vw; height: 35vh; left: -5%; top: 5%;
  background: radial-gradient(closest-side, rgba(255,138,60,.3), transparent 70%);
  animation: tshDrift1 22s cubic-bezier(.22,.61,.36,1) infinite alternate;
}

.aurora-bg .a2 {
  width: 38vw; height: 30vh; right: -8%; top: 25%;
  background: radial-gradient(closest-side, rgba(255,77,28,.18), transparent 70%);
  animation: tshDrift2 28s cubic-bezier(.22,.61,.36,1) infinite alternate;
}

.aurora-bg .a3 {
  width: 40vw; height: 32vh; left: 30%; bottom: 5%;
  background: radial-gradient(closest-side, rgba(217,119,87,.12), transparent 70%);
  animation: tshDrift3 25s cubic-bezier(.22,.61,.36,1) infinite alternate;
}

@keyframes tshDrift1 { to { transform: translate3d(8vw, 10vh, 0) scale(1.15); } }
@keyframes tshDrift2 { to { transform: translate3d(-6vw, -8vh, 0) scale(.9); } }
@keyframes tshDrift3 { to { transform: translate3d(-4vw, 6vh, 0) scale(1.1); } }

.tsh-grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 22px 28px, rgba(255,255,255,.85) 0 1px, transparent 1.4px),
    radial-gradient(circle at 92px 78px, rgba(255,255,255,.6) 0 1px, transparent 1.5px);
  background-size: 190px 190px, 240px 240px;
}

/* атмосфера: страница просвечивает фон вместо собственной заливки */
html.tundra-atmosphere {
  background-color: var(--bg, #0B0A08);
  background-image:
    linear-gradient(112deg, rgba(255,138,60,.045) -10%, rgba(255,138,60,.018) 42%, rgba(255,77,28,.032) 110%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,214,170,.015) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(255,214,170,.011) 80px);
  background-attachment: fixed;
  background-size: 160% 100%, 80px 80px, 80px 80px;
  scrollbar-color: rgba(255,138,60,.42) rgba(18,14,10,.72);
}

html.tundra-atmosphere body {
  isolation: isolate;
  background-color: transparent;
}

html.tundra-atmosphere .aurora-bg { z-index: -2; }

#tundra-liquid-ether {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
}

#tundra-liquid-ether canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 720px) {
  .aurora-bg i { filter: blur(70px); animation: none; }
  .tsh-grain { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-bg i { animation: none; }
  .tsh-brand svg.tsh-mark { transition: none; }
}
