/* Pulsar — портал. Палитра согласована с лендингом: пустотный чёрный,
   электрический синий #2B2BFF, фиалковый #8A6CFF. Всё работает без JS. */
:root {
  /* поверхности */
  --void:    #06060a;
  --panel:   #0c0d15;
  --panel2:  #11121c;
  --panel3:  #161829;
  --line:    #1e2033;
  --line-soft: rgba(236, 236, 242, 0.075);

  /* текст */
  --text:    #ececf2;
  --muted:   #868bab;
  --dim:     #5a5f7a;

  /* акценты */
  --blue:    #2b2bff;
  --violet:  #8a6cff;
  --accent:  #6c5cff;
  --accent-2:#9d8cff;
  --accent-ink: #ffffff;
  --grad:    linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);
  --glow:    0 0 0 1px rgba(138, 108, 255, .28), 0 8px 28px -10px rgba(43, 43, 255, .55);

  /* состояния */
  --ok:      #6be3c4;
  --err:     #ff4d6a;
  --warn:    #ffb86b;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scrollbar-color: var(--panel3) var(--void); }

body {
  margin: 0; color: var(--text); background: var(--void);
  font: 15px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Два мягких пятна света сверху — глубина без картинок.
   Именно отдельный фиксированный слой, а НЕ background-attachment: fixed на body:
   вместе с backdrop-filter на залипающей шапке последний роняет композитинг
   в Chromium, и страница уходит в чёрное при скролле. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 12% -6%, rgba(43, 43, 255, .16), transparent 70%),
    radial-gradient(760px 380px at 88% -10%, rgba(138, 108, 255, .13), transparent 72%);
}
body.gate { display: grid; place-items: center; min-height: 100vh; }
body.gate::before {
  background:
    radial-gradient(760px 520px at 50% 12%, rgba(43, 43, 255, .20), transparent 68%),
    radial-gradient(620px 460px at 50% 44%, rgba(138, 108, 255, .13), transparent 72%);
}

a { color: var(--accent-2); text-decoration-color: rgba(157, 140, 255, .35); text-underline-offset: 3px; }
a:hover { color: #b9adff; }

code, pre, .key-input, .lic, .stamp { font-family: var(--mono); }
code {
  background: rgba(108, 92, 255, .11); color: #cfc6ff;
  border: 1px solid rgba(138, 108, 255, .16);
  padding: .5px 5px; border-radius: 5px; font-size: .9em;
}
pre {
  background: #05050b; border: 1px solid var(--line); border-radius: 10px;
  padding: 15px 16px; overflow-x: auto; font-size: 13px; line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(236, 236, 242, .04);
}
pre code { background: none; border: 0; padding: 0; color: #d7d9e8; }

h1 { font-size: 23px; margin: 0 0 10px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 24px 0 9px; font-weight: 600; letter-spacing: -.012em; }
h3 { font-size: 12px; margin: 20px 0 7px; font-weight: 600; color: var(--muted);
     text-transform: uppercase; letter-spacing: .1em; }
.muted { color: var(--muted); }
.fine { color: var(--dim); font-size: 12px; margin-top: 14px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 30px 20px 72px; }
.wrap.wide { max-width: 1260px; }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, #0a0b12 100%);
  border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin: 16px 0;
  box-shadow: inset 0 1px 0 rgba(236, 236, 242, .045), 0 14px 40px -28px rgba(0, 0, 0, .9);
}
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }

/* ---------- шапка ---------- */
.top {
  display: flex; align-items: center; gap: 24px; padding: 11px 24px;
  border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 5;
  /* База почти непрозрачная: без backdrop-filter сквозь шапку не должен
     просвечивать текст статьи. Прозрачнее делаем только там, где блюр реально есть. */
  background: rgba(6, 6, 10, .97);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top {
    background: rgba(6, 6, 10, .82);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font: 700 14px/1 var(--mono); letter-spacing: .3em; text-decoration: none;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--violet);
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--violet); box-shadow: 0 0 0 0 rgba(138, 108, 255, .7);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(138, 108, 255, .55); opacity: 1; }
  70%  { box-shadow: 0 0 0 9px rgba(138, 108, 255, 0); opacity: .75; }
  100% { box-shadow: 0 0 0 0 rgba(138, 108, 255, 0); opacity: 1; }
}
.brand.big { font-size: 19px; margin-bottom: 20px; letter-spacing: .26em; }
.brand.big .dot { width: 9px; height: 9px; }

.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 7px 13px; border-radius: 8px;
  font-size: 14px; border: 1px solid transparent; transition: .18s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--panel2); }
.nav a.active {
  color: var(--text); background: linear-gradient(180deg, rgba(108, 92, 255, .20), rgba(108, 92, 255, .07));
  border-color: rgba(138, 108, 255, .3);
  box-shadow: inset 0 1px 0 rgba(236, 236, 242, .07);
}
.who { display: flex; align-items: center; gap: 12px; }
.lic { font-size: 11.5px; color: var(--dim); letter-spacing: .02em; }
.foot {
  max-width: 1260px; margin: 0 auto; padding: 20px 20px 44px;
  color: var(--dim); font-size: 11.5px; text-align: center;
  border-top: 1px solid var(--line-soft);
}

/* ---------- кнопки ---------- */
button, .button {
  font: 600 14px/1 inherit; border-radius: 9px; cursor: pointer; border: 1px solid transparent;
  padding: 11px 19px; background: var(--grad); color: var(--accent-ink);
  text-decoration: none; display: inline-block; transition: .18s var(--ease);
  box-shadow: 0 1px 0 rgba(236, 236, 242, .12) inset, 0 8px 22px -12px rgba(43, 43, 255, .8);
}
button:hover, .button:hover { transform: translateY(-1px); filter: brightness(1.1); }
button:active, .button:active { transform: translateY(0); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.ghost {
  background: transparent; color: var(--muted); border-color: var(--line);
  padding: 7px 13px; box-shadow: none;
}
.ghost:hover { color: var(--text); border-color: rgba(138, 108, 255, .4); background: var(--panel2); filter: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }

/* ---------- вход ---------- */
.gatecard { max-width: 540px; margin: 0 auto; text-align: left; box-shadow: var(--glow), 0 40px 80px -40px #000; }
.gateform { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.key-input {
  flex: 1 1 290px; min-width: 0; padding: 13px 15px; background: #05050b; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 14.5px; letter-spacing: .11em; text-transform: uppercase; transition: .18s var(--ease);
}
.key-input::placeholder { color: #3b3f55; letter-spacing: .08em; }
.key-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 92, 255, .16); }
.key-input.good { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(107, 227, 196, .13); }
.key-input.bad  { border-color: var(--err); box-shadow: 0 0 0 3px rgba(255, 77, 106, .13); }

.hint { min-height: 20px; font-size: 13px; margin: 14px 0 0; }
.hint.err { color: var(--err); }
.hint.ok  { color: var(--ok); }
.errors { margin: 12px 0 0; padding-left: 20px; color: var(--err); font-size: 13px; }

/* ---------- плитки ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 18px 0; }
.tile {
  position: relative; display: block; text-decoration: none; color: inherit;
  background: linear-gradient(180deg, var(--panel) 0%, #0a0b12 100%);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  transition: .22s var(--ease); overflow: hidden;
}
.tile::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0; transition: opacity .22s var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -26px rgba(43, 43, 255, .5); }
.tile:hover::before { opacity: 1; }
.tile h2 { margin: 0 0 7px; font-size: 16px; }
.tile p { margin: 0; color: var(--muted); font-size: 13.5px; }
.cta { display: inline-block; margin-top: 14px; color: var(--accent-2); font-size: 13px; font-weight: 600; }
.tile:hover .cta { color: #c3b8ff; }

/* ---------- таблицы ---------- */
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .07em; background: var(--panel2); }
tbody tr:last-child td { border-bottom: 0; }
.kv th { color: var(--muted); font-weight: 500; width: 38%; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.list { margin: 8px 0 0; padding-left: 20px; }
.list li { margin: 5px 0; }

/* ---------- база знаний ---------- */
.kb { display: grid; grid-template-columns: 266px minmax(0, 1fr); gap: 30px; align-items: start; }
.tree { position: sticky; top: 74px; max-height: calc(100vh - 100px); overflow-y: auto;
  padding-right: 6px; border-right: 1px solid var(--line-soft); }
.cat { margin-bottom: 20px; }
.cat h3 { margin: 0 0 7px; color: var(--dim); }
.cat ul { list-style: none; margin: 0; padding: 0; }
.cat li { margin: 1px 0; }
.cat a {
  display: block; padding: 6px 11px; border-radius: 7px; font-size: 13.5px;
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
  transition: .16s var(--ease);
}
.cat a:hover { color: var(--text); background: var(--panel2); }
.cat a.active {
  color: var(--text); background: linear-gradient(90deg, rgba(108, 92, 255, .18), transparent);
  border-left-color: var(--violet); font-weight: 500;
}
.doc { min-width: 0; max-width: 76ch; }
.doc h1 { font-size: 27px; margin: 2px 0 16px; letter-spacing: -.025em; }
.doc h2 { font-size: 19px; margin: 32px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.doc h3 { font-size: 14px; color: var(--accent-2); text-transform: none; letter-spacing: 0; margin: 22px 0 6px; }
.doc p, .doc li { color: #d3d6e4; }
.doc > p:first-of-type { font-size: 16px; color: var(--text); }
.doc table { margin: 16px 0; }
.doc blockquote {
  margin: 16px 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--violet);
  color: var(--muted); font-style: italic;
}
.doc hr { border: 0; border-top: 1px solid var(--line-soft); margin: 28px 0; }
.crumbs { color: var(--dim); font-size: 12px; margin: 0 0 14px; letter-spacing: .02em; }
.pager {
  display: flex; justify-content: space-between; gap: 16px; margin: 36px 0 0;
  padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 13px;
}
.stamp { margin: 26px 0 0; color: #343850; font-size: 10.5px; word-break: break-all; user-select: all; }

/* ---------- инструменты ---------- */
.tool { display: grid; gap: 16px; }
.field { margin-bottom: 15px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.field .req { color: var(--violet); }
.field small { display: block; margin-top: 5px; font-size: 12px; }
input[type=text], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; background: #05050b; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px;
  transition: .18s var(--ease);
}
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 92, 255, .15);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result { border-color: rgba(138, 108, 255, .26); }
.result.ok { box-shadow: inset 3px 0 0 var(--ok), inset 0 1px 0 rgba(236, 236, 242, .04); }
.result.fail { box-shadow: inset 3px 0 0 var(--err), inset 0 1px 0 rgba(236, 236, 242, .04); }
.result h2 { display: flex; align-items: baseline; gap: 10px; }
.result h2 small { font-size: 11.5px; font-weight: 400; font-family: var(--mono); }
.summary { margin: 0 0 14px; font-size: 14.5px; }
.findings { list-style: none; margin: 10px 0 0; padding: 0; }
.findings li {
  padding: 9px 13px; margin-bottom: 7px; border-radius: 9px;
  background: var(--panel2); border-left: 2px solid var(--dim); font-size: 13.5px;
}
.findings li b { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; margin-right: 7px; }
.sev-error   { border-left-color: var(--err); }
.sev-error b { color: var(--err); }
.sev-warn, .sev-warning   { border-left-color: var(--warn); }
.sev-warn b, .sev-warning b { color: var(--warn); }
.sev-info   { border-left-color: var(--accent-2); }
.sev-info b { color: var(--accent-2); }

/* ---------- память ---------- */
.memory { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .memory { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } }

/* ---------- адаптив и доступность ---------- */
@media (max-width: 860px) {
  .kb { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tree { position: static; max-height: none; border-right: 0;
          border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; }
  .top { gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
  .wrap { padding: 22px 14px 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
  .tile:hover, button:hover { transform: none; }
}
::selection { background: rgba(108, 92, 255, .32); color: #fff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--panel3); border-radius: 6px; border: 2px solid var(--void); }
::-webkit-scrollbar-thumb:hover { background: #22253c; }

/* ---------- выдача архива ---------- */
.download { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-color: rgba(138, 108, 255, .3);
  background: linear-gradient(135deg, rgba(43,43,255,.14), rgba(138,108,255,.08)), linear-gradient(180deg, var(--panel), #0a0b12); }
.download h2 { margin: 0 0 6px; }
.download p { margin: 0; font-size: 13.5px; }
.dl-text { min-width: 220px; flex: 1; }
.dl-btn { white-space: nowrap; padding: 14px 24px; font-size: 15px; }
