/* =========================================================================
   ASB docs — Liquid Glass
   Общие стили: публичный хелп-центр + админка
   ========================================================================= */

:root {
  --bg: #050506;
  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.56);
  --text-faint: rgba(255, 255, 255, 0.34);

  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --highlight: rgba(255, 255, 255, 0.22);

  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;

  --blur: 22px;
  --sidebar-w: 300px;
  --content-max: 760px;

  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7), 0 4px 16px -6px rgba(0, 0, 0, 0.5);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Фон: медленный монохромный mesh ---------- */
.bg-mesh {
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  filter: blur(60px) saturate(110%);
  opacity: 0.9;
}
.bg-mesh span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
}
.bg-mesh span:nth-child(1) {
  width: 46vw; height: 46vw; left: -6vw; top: -8vw;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 62%);
  animation-duration: 30s;
}
.bg-mesh span:nth-child(2) {
  width: 38vw; height: 38vw; right: -4vw; top: 6vw;
  background: radial-gradient(circle, rgba(150,170,210,0.13), transparent 62%);
  animation-duration: 38s; animation-delay: -6s;
}
.bg-mesh span:nth-child(3) {
  width: 40vw; height: 40vw; left: 18vw; bottom: -12vw;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 60%);
  animation-duration: 34s; animation-delay: -12s;
}
.bg-mesh span:nth-child(4) {
  width: 30vw; height: 30vw; right: 10vw; bottom: -6vw;
  background: radial-gradient(circle, rgba(120,140,180,0.10), transparent 60%);
  animation-duration: 42s; animation-delay: -3s;
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(4vw,3vw,0) scale(1.15); }
}

/* ---------- Стеклянная поверхность (миксин через класс) ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 0 var(--highlight);
}

/* ---------- Логотип-треугольник A ---------- */
.logo-mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  color: var(--text);
}
.logo-mark svg { width: 100%; height: 100%; display: block; }

.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand-sub { color: var(--text-faint); font-size: 12px; font-weight: 500; margin-top: 1px; }

/* ---------- Кнопки ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--glass-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.45s var(--spring), background 0.2s var(--ease), border-color 0.2s var(--ease);
  backdrop-filter: blur(10px);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--glass-strong); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 2px; }
.btn.primary { background: #fff; color: #0a0a0a; border-color: #fff; font-weight: 600; }
.btn.primary:hover { background: rgba(255,255,255,0.88); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--glass); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.icon { padding: 9px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.icon-svg { width: 16px; height: 16px; flex: none; }

/* ---------- Утилиты ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.hidden { display: none !important; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: rgba(255,255,255,0.22); }

/* Полосы прокрутки */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); background-clip: content-box; }

/* =========================================================================
   ПУБЛИЧНАЯ ЧАСТЬ
   ========================================================================= */
.layout { display: flex; min-height: 100vh; }

/* --- Сайдбар --- */
.sidebar {
  width: var(--sidebar-w); flex: none;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  gap: 16px;
}
.sidebar-inner {
  display: flex; flex-direction: column; gap: 16px;
  height: 100%; min-height: 0;
}
.sidebar .brand-row { padding: 4px 8px; }

.search-box { position: relative; }
.search-box .icon-svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 10px 12px 10px 36px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  font-family: inherit; font-size: 13.5px;
  transition: border-color 0.2s, background 0.2s;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus { outline: none; border-color: var(--border-strong); background: var(--glass-2); }

.nav { overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; margin: 0 -4px; padding-left: 4px; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); padding: 14px 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-xs);
  color: var(--text-dim); text-decoration: none;
  font-size: 14px; cursor: pointer;
  transition: color 0.18s, background 0.18s;
  border: 1px solid transparent;
}
.nav-link .nav-ico { width: 17px; height: 17px; flex: none; opacity: 0.8; }
.nav-link:hover { color: var(--text); background: var(--glass); }
.nav-link.active {
  color: var(--text); background: var(--glass-2);
  border-color: var(--border); box-shadow: inset 0 1px 0 0 var(--highlight);
}
.nav-link.active .nav-ico { opacity: 1; }

.sidebar-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.foot-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-xs);
  color: var(--text-dim); text-decoration: none; font-size: 13.5px;
  border: 1px solid var(--border); background: var(--glass);
  transition: color 0.18s, background 0.18s, transform 0.4s var(--spring);
}
.foot-link:hover { color: var(--text); background: var(--glass-2); transform: translateY(-1px); }
.lang-toggle { display: flex; gap: 4px; padding: 4px; }
.lang-toggle button {
  flex: 1; padding: 7px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  background: transparent; border: none; color: var(--text-faint);
  border-radius: 8px; cursor: pointer; transition: color 0.18s, background 0.18s;
}
.lang-toggle button.active { color: var(--text); background: var(--glass-strong); }

/* --- Контент --- */
.content { flex: 1; min-width: 0; display: flex; justify-content: center; padding: 0 40px; }
.article {
  width: 100%; max-width: var(--content-max);
  padding: 64px 0 120px;
  animation: rise 0.5s var(--spring) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); margin-bottom: 20px; flex-wrap: wrap; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: 0.5; }

.article h1 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 40px; line-height: 1.08;
  letter-spacing: -0.03em; margin: 0 0 12px;
}
.article .lead { font-size: 17px; color: var(--text-dim); margin: 0 0 36px; line-height: 1.55; }

/* блоки статьи */
.blocks { display: flex; flex-direction: column; gap: 26px; }
.blocks h2 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 22px; letter-spacing: -0.02em;
  margin: 14px 0 -8px;
}
.blocks p { margin: 0; font-size: 15.5px; line-height: 1.66; color: rgba(255,255,255,0.84); }
.blocks a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3); transition: border-color 0.2s; }
.blocks a:hover { border-color: #fff; }
.blocks strong { color: #fff; font-weight: 600; }

/* шаг */
.step { display: flex; gap: 18px; }
.step-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  background: var(--glass-2); border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 0 var(--highlight); color: #fff;
}
.step-body { flex: 1; min-width: 0; padding-top: 3px; }
.step-body p { margin: 0 0 14px; }
.step-body .shots:last-child, .step-body p:last-child { margin-bottom: 0; }

/* изображения */
.shots { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.shot {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: rgba(0,0,0,0.25);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6);
  cursor: zoom-in; transition: transform 0.4s var(--spring), border-color 0.2s;
  max-width: 100%;
}
.shot:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.shot img { display: block; width: 100%; height: auto; }
.shot.phone { max-width: 230px; }
.shot.wide { width: 100%; }
.shot-cap { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; text-align: center; }

/* callout */
.callout {
  display: flex; gap: 13px; padding: 16px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--glass); box-shadow: inset 0 1px 0 0 var(--highlight);
}
.callout .c-ico { flex: none; width: 20px; height: 20px; margin-top: 1px; opacity: 0.9; }
.callout p { font-size: 14.5px; color: rgba(255,255,255,0.82); }
.callout.warn { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.07); }
.callout.tip { background: rgba(120,150,200,0.10); border-color: rgba(140,165,210,0.28); }

/* кнопка-ссылка внутри статьи */
.block-btn { display: flex; }

/* код */
.codeblock {
  position: relative; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(0,0,0,0.35);
  overflow: hidden;
}
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.codeblock code { font-family: var(--font-mono); font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.6; }
.code-copy {
  position: absolute; top: 10px; right: 10px;
  padding: 6px 10px; font-size: 12px;
}

/* home grid */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 8px; }
.plat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 0 var(--highlight);
  text-decoration: none; color: var(--text); cursor: pointer;
  transition: transform 0.45s var(--spring), background 0.2s, border-color 0.2s;
}
.plat-card:hover { transform: translateY(-3px); background: var(--glass-2); border-color: var(--border-strong); }
.plat-card .nav-ico { width: 26px; height: 26px; flex: none; }
.plat-card .pc-title { font-weight: 600; font-size: 15px; }
.plat-card .pc-sub { font-size: 12.5px; color: var(--text-faint); }
.plat-card .pc-arrow { margin-left: auto; color: var(--text-faint); transition: transform 0.4s var(--spring); }
.plat-card:hover .pc-arrow { transform: translateX(3px); }

/* пустое состояние */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-state .es-ico { width: 48px; height: 48px; margin: 0 auto 18px; opacity: 0.4; }

/* --- мобильный топбар --- */
.topbar {
  display: none; position: sticky; top: 0; z-index: 40;
  align-items: center; justify-content: space-between;
  padding: 12px 16px; margin: 10px; border-radius: var(--radius);
}
.scrim { display: none; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }

/* лайтбокс */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(14px);
  animation: fade 0.25s var(--ease);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); box-shadow: 0 30px 80px -20px rgba(0,0,0,0.9); }
.lightbox .lb-close { position: absolute; top: 20px; right: 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================================
   АДАПТИВ публичной части
   ========================================================================= */
@media (max-width: 920px) {
  .topbar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    height: 100vh; width: 84vw; max-width: 340px;
    margin: 0; border-radius: 0 var(--radius) var(--radius) 0;
    transform: translateX(-103%); transition: transform 0.4s var(--spring);
    padding-top: 18px;
  }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; }
  .content { padding: 0 20px; }
  .article { padding: 28px 0 100px; }
  .article h1 { font-size: 30px; }
}

@media (max-width: 560px) {
  .content { padding: 0 16px; }
  .shot.phone { max-width: calc(50% - 6px); }
  .home-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
