/* =========================================================
   a1ex.cc — Hub chrome bar (injected into landings/projects)
   Self-contained, id-scoped so it never inherits/leaks
   into the host page's styles. Always dark glass chrome.
   ========================================================= */

/* Reserve space so the fixed bar never covers page content.
   Scoped with :has() — this file is also loaded by the hub and the
   catalogues, which draw their own header and have no #a1ex-hubbar, and the
   unconditional rule was pushing 46px of dead space onto every one of them.
   The @supports fallback keeps the previous behaviour on engines without
   :has(), where over-reserving is the safer failure. */
body:has(#a1ex-hubbar) { padding-top: 46px !important; }
html:has(#a1ex-hubbar) { scroll-padding-top: 46px; }

@supports not selector(:has(*)) {
  html { scroll-padding-top: 46px; }
  body { padding-top: 46px !important; }
  @media (max-width: 560px) {
    html { scroll-padding-top: 44px; }
    body { padding-top: 44px !important; }
  }
}

#a1ex-hubbar,
#a1ex-hubbar * { box-sizing: border-box; }

#a1ex-hubbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2147483000;              /* above any host header */
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(12px, 3vw, 22px);
  /* System stack on purpose: this file is injected into 468 pages that each
     ship their own fonts, and pulling Inter in here would add a webfont
     download to all of them for one 46px strip. */
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  /* Always dark: these pages are authored with wildly different palettes and
     a themed bar would land unreadable on half of them. */
  color: #F5F7FA;
  background: rgba(9, 11, 16, 0.86);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid rgba(245, 247, 250, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding-top: env(safe-area-inset-top, 0);
}

/* ---- Brand (left, links home) ---- */
#a1ex-hubbar .a1ex-hb__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
#a1ex-hubbar .a1ex-hb__mark {
  width: 24px; height: 24px;
  display: block;
  object-fit: contain;
  filter: invert(1);
}
#a1ex-hubbar .a1ex-hb__word {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: #F5F7FA;
}
#a1ex-hubbar .a1ex-hb__word b {
  font-weight: 700;
  color: #3B82F6;
}

/* ---- Right cluster: nav + landing name ---- */
#a1ex-hubbar .a1ex-hb__right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;                     /* allow title to truncate */
}
#a1ex-hubbar .a1ex-hb__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#a1ex-hubbar .a1ex-hb__nav a {
  text-decoration: none;
  color: #8B93A7;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: color .18s ease, background .18s ease;
  white-space: nowrap;
}
#a1ex-hubbar .a1ex-hb__nav a:hover {
  color: #F5F7FA;
  background: rgba(245, 247, 250, 0.06);
}
#a1ex-hubbar .a1ex-hb__nav a:focus-visible,
#a1ex-hubbar .a1ex-hb__brand:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}
#a1ex-hubbar .a1ex-hb__sep {
  width: 1px; height: 18px;
  background: rgba(245, 247, 250, 0.14);
  flex-shrink: 0;
}
#a1ex-hubbar .a1ex-hb__title {
  font-weight: 500;
  font-size: 13.5px;
  color: rgba(245, 247, 250, 0.86);
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Mobile ---- */
@media (max-width: 560px) {
  #a1ex-hubbar { height: 44px; font-size: 13px; }
  /* Same :has() scoping as above — an unscoped rule here re-introduced the
     phantom gap on the hub and the catalogues at phone widths. */
  html:has(#a1ex-hubbar) { scroll-padding-top: 44px; }
  body:has(#a1ex-hubbar) { padding-top: 44px !important; }
  #a1ex-hubbar .a1ex-hb__word { font-size: 15px; }
  /* logo already links home → drop the redundant "Главная" text link */
  #a1ex-hubbar .a1ex-hb__nav a[data-home] { display: none; }
  #a1ex-hubbar .a1ex-hb__sep { display: none; }
  #a1ex-hubbar .a1ex-hb__title { max-width: 46vw; }
  #a1ex-hubbar .a1ex-hb__right { gap: 8px; }
}
@media (max-width: 360px) {
  #a1ex-hubbar .a1ex-hb__title { display: none; }  /* keep only nav on tiny screens */
}

/* Touch: fill the bar's height rather than leaving a 25px strip to hit. */
@media (pointer: coarse) {
  #a1ex-hubbar .a1ex-hb__nav a { min-height: 40px; display: inline-flex; align-items: center; }
  #a1ex-hubbar .a1ex-hb__brand { min-height: 40px; }
}

@media print { #a1ex-hubbar { display: none; } body { padding-top: 0 !important; } }

/* =====================================================================
   a1ex.cc signature — the "made with love" lockup that closes every page.
   Injected by scripts/inject-header.mjs (landings, /db/) and written into
   the generated catalogues directly.

   Everything is drawn in currentColor: the landings were authored with wildly
   different footers — some near-black, some white — and inheriting the colour
   is the only way one block reads correctly on all of them without per-page
   overrides.

   The toning-down lives on the individual parts, never on .a1ex-sig itself.
   Opacity on the container would also fade the background overlay.js paints
   onto it, which turned a dark navy footer strip into flat grey.
   ===================================================================== */
.a1ex-sig {
  --sig-gap: clamp(14px, 3vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sig-gap);
  width: min(880px, 92%);
  margin: 0 auto;
  padding: 30px 0 34px;
  color: inherit;
  text-decoration: none;
}
.a1ex-sig__rule {
  flex: 1 1 auto;
  min-width: 12px;
  height: 1px;
  background: currentColor;
  opacity: .26;
  transition: opacity .35s ease;
}
.a1ex-sig__made,
.a1ex-sig__name {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  opacity: .62;
  transition: opacity .35s ease, letter-spacing .35s ease;
}
.a1ex-sig__made { letter-spacing: .04em; }
.a1ex-sig__name { letter-spacing: .16em; font-weight: 500; }
.a1ex-sig__mark {
  flex: 0 0 auto;
  display: block;
  width: clamp(30px, 4.4vw, 42px);
  height: auto;
  fill: currentColor;
  opacity: .68;
  transition: transform .35s cubic-bezier(.34, 1.4, .64, 1), opacity .35s ease;
}

/* Hover / keyboard focus: the lockup comes up to full strength and the mark
   is the only part that moves, so the rules and wordmark stay aligned. */
.a1ex-sig:hover .a1ex-sig__made,
.a1ex-sig:hover .a1ex-sig__name,
.a1ex-sig:focus-visible .a1ex-sig__made,
.a1ex-sig:focus-visible .a1ex-sig__name { opacity: 1; }
.a1ex-sig:hover .a1ex-sig__mark,
.a1ex-sig:focus-visible .a1ex-sig__mark { opacity: 1; transform: scale(1.12) rotate(-4deg); }
.a1ex-sig:hover .a1ex-sig__rule,
.a1ex-sig:focus-visible .a1ex-sig__rule { opacity: .5; }
.a1ex-sig:hover .a1ex-sig__name,
.a1ex-sig:focus-visible .a1ex-sig__name { letter-spacing: .22em; }
.a1ex-sig:hover .a1ex-sig__made,
.a1ex-sig:focus-visible .a1ex-sig__made { letter-spacing: .08em; }
.a1ex-sig:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  /* The rules collapse before the words do — losing "made with love" would
     lose the point of the block. */
  .a1ex-sig { width: 94%; padding: 22px 0 26px; }
  .a1ex-sig__rule { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .a1ex-sig, .a1ex-sig * { transition: none; }
  .a1ex-sig:hover .a1ex-sig__mark { transform: none; }
}
@media print { .a1ex-sig { display: none; } }

/* uTools look (02.11) */
#a1ex-hubbar{background:#f5f2ea!important;color:#14213d!important;border-bottom:1px solid #d9d4c6!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:none!important;gap:20px}
#a1ex-hubbar .a1ex-hb__word{color:#14213d;font-weight:700;font-size:13px;letter-spacing:.1em;white-space:nowrap}
#a1ex-hubbar .a1ex-hb__word b{color:inherit;font-weight:700}
#a1ex-hubbar .a1ex-hb__right{min-width:0}
#a1ex-hubbar .a1ex-hb__nav{overflow-x:auto;scrollbar-width:none;gap:2px}
#a1ex-hubbar .a1ex-hb__nav::-webkit-scrollbar{display:none}
#a1ex-hubbar .a1ex-hb__nav a{color:#14213d;white-space:nowrap;padding:6px 10px;border-radius:6px;transition:transform 160ms cubic-bezier(.23,1,.32,1),background-color 150ms ease}
#a1ex-hubbar .a1ex-hb__nav a:hover{color:#14213d;background:transparent}
#a1ex-hubbar .a1ex-hb__nav a:active{transform:scale(.97)}
#a1ex-hubbar .a1ex-hb__nav a[aria-current],#a1ex-hubbar .a1ex-hb__nav a[aria-current]:hover{background:#14213d;color:#f5f2ea}
@media (hover:hover) and (pointer:fine){#a1ex-hubbar .a1ex-hb__nav a:not([aria-current]):hover{background:#ebe6da}}
@media (prefers-reduced-motion:reduce){#a1ex-hubbar .a1ex-hb__nav a{transition:background-color 150ms ease}#a1ex-hubbar .a1ex-hb__nav a:active{transform:none}}
@media (max-width:640px){#a1ex-hubbar .a1ex-hb__word{display:none}}
/* Related in other databases, under a record's page */
.db-links{max-width:1200px;margin:0 auto;padding:32px 16px;background:#f5f2ea;color:#14213d;font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif}
.db-links-title{font-size:20px;font-weight:600;margin:0 0 12px}
.db-links-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px}
.db-links-item{padding:14px 16px;background:#fffdf7;border:1px solid #d9d4c6;border-radius:10px}
.db-links-name{font-weight:600;color:#14213d;text-decoration:underline;text-decoration-color:#d9d4c6;text-underline-offset:3px}
.db-links-name:focus-visible{outline:2px solid #2748c9;outline-offset:2px}
.db-links-db{margin-left:8px;font-size:13px;color:#4a5468}
.db-links-note{margin:6px 0 0;font-size:14px;color:#4a5468;overflow-wrap:anywhere}
