/* База знаний. Использует токены и компоненты style.css */

.nav-links a.cur {
  color: #fff;
}

/* ---- верх ---- */
.kb-hero {
  padding: 150px 0 0;
  text-align: center;
}
.kb-hero .h2 {
  max-width: 820px;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}
.kb-lead {
  max-width: 520px;
  margin: 20px auto 0;
  color: var(--gray);
  font-size: 19px;
}

/* поиск */
.search {
  position: relative;
  max-width: 640px;
  margin: 36px auto 0;
}
.search > .ic {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  color: var(--gray);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 60px;
  padding: 0 64px 0 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  font: 500 17px var(--font);
  outline: none;
  transition:
    border-color 0.25s,
    background-color 0.25s,
    box-shadow 0.25s;
}
.search input::placeholder {
  color: var(--gray);
  font-weight: 400;
}
.search input::-webkit-search-cancel-button {
  display: none;
}
.search input:hover {
  border-color: rgba(106, 98, 232, 0.3);
}
.search input:focus {
  border-color: var(--ac);
  background: var(--bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ac) 16%, transparent);
}
.search kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--gray);
  font: 600 15px var(--font);
  transition: opacity 0.2s;
}
.search kbd.off {
  opacity: 0;
}
.found {
  min-height: 26px;
  margin-top: 14px;
  color: var(--gray);
  font-size: 15px;
}

/* ---- карточки разделов ---- */
.cats-sec {
  padding-top: 56px;
}
.cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  transition:
    opacity 0.4s,
    max-height 0.5s;
}
.cats.collapsed {
  opacity: 0.35;
}
.cat {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 24px;
  border-radius: 24px;
  background: var(--card);
  text-align: left;
  transition: background-color 0.3s;
}
.cat .ic {
  width: 32px;
  height: 32px;
  color: var(--ac);
  transform-origin: 30% 60%;
  transition:
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    color 0.3s;
}
.cat:hover .ic {
  color: var(--ac-2);
  transform: scale(1.3) rotate(-6deg);
}
.cat h3 {
  margin-top: 26px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.cat p {
  margin-top: 6px;
  color: var(--gray);
  font-size: 15px;
  line-height: 1.5;
}
.cat .cnt {
  margin-top: auto;
  padding-top: 16px;
  color: var(--ac);
  font-size: 15px;
  font-weight: 600;
}

/* ---- статьи ---- */
.kb-main {
  padding-top: 110px;
}
.kb-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.kb-side {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-h {
  margin: 0 0 10px 14px;
  color: var(--gray);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kb-side a {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--gray);
  font-size: 16px;
  font-weight: 500;
  transition:
    color 0.2s,
    background-color 0.2s;
}
.kb-side a:hover {
  color: var(--ink);
  background: var(--card);
}
.kb-side a.on {
  color: var(--ink);
  background: var(--card);
}
.kb-side a.dim {
  opacity: 0.35;
}

.kb-sec {
  padding-top: 0;
  margin-bottom: 56px;
  scroll-margin-top: 100px;
}
.kb-sec[hidden],
.art[hidden] {
  display: none;
}
.kb-sec h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.kb-sec h2 .tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--card);
  color: var(--ac);
}
.kb-sec h2 .ic {
  width: 24px;
  height: 24px;
}

.art {
  margin-bottom: 10px;
  border-radius: 18px;
  background: var(--card);
  transition:
    background-color 0.3s,
    box-shadow 0.3s;
}
.art:hover {
  background: color-mix(in srgb, var(--card) 88%, var(--ac));
}
.art[open] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 25%, transparent);
}
.art summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}
.art summary::-webkit-details-marker {
  display: none;
}
.art summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-right: 2px solid var(--gray);
  border-bottom: 2px solid var(--gray);
  transform: rotate(45deg);
  transition: transform 0.35s var(--out);
}
.art[open] summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}
.art-body {
  padding: 0 24px 24px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
  animation: open 0.5s var(--out);
}
@keyframes open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.art-body p + p,
.art-body p + ol,
.art-body ol + p {
  margin-top: 14px;
}
.art-body code {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--card-2);
  color: var(--ink);
  font: 500 15px ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.steps,
.plain {
  list-style: none;
}
.steps {
  counter-reset: s;
  display: grid;
  gap: 12px;
}
.steps li {
  counter-increment: s;
  position: relative;
  min-height: 30px;
  padding-left: 46px;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--ac-soft);
  color: var(--ac);
  font-size: 15px;
  font-weight: 700;
}
.plain {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.plain li {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card-2);
}
.plain b {
  color: var(--ink);
}
.tip {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--ac-soft);
  color: var(--ink);
  font-size: 15px;
}
:root[data-theme="dark"] .art-body code {
  background: #23232a;
}

.empty {
  padding: 64px 24px;
  border-radius: 24px;
  background: var(--card);
  text-align: center;
}
.empty[hidden] {
  display: none;
}
.empty .ic {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  color: var(--ac);
}
.empty h3 {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 600;
}
.empty p {
  margin-top: 6px;
  color: var(--gray);
}

/* ---- блок помощи ---- */
.kb-help {
  padding-top: 40px;
}
.help-card {
  padding: 72px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  text-align: center;
}
.help-card img {
  width: 72px;
  height: 72px;
  margin: 0 auto 26px;
  border-radius: 20px;
}
.help-card .h2 {
  max-width: 560px;
}
.help-card p {
  margin-top: 16px;
  color: var(--gray);
  font-size: 18px;
}
.help-card .cta {
  margin-top: 32px;
}

@media (max-width: 960px) {
  .cats {
    grid-template-columns: repeat(2, 1fr);
  }
  .kb-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .kb-side {
    position: static;
    flex-direction: row;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
  }
  .side-h {
    display: none;
  }
  .kb-side a {
    flex: none;
    background: var(--card);
    white-space: nowrap;
  }
}
@media (max-width: 640px) {
  .kb-hero {
    padding-top: 118px;
  }
  .kb-lead {
    font-size: 17px;
  }
  .cats {
    grid-template-columns: 1fr;
  }
  .cat {
    min-height: 0;
  }
  .art summary {
    padding: 18px 18px;
  }
  .art-body {
    padding: 0 18px 20px;
  }
  .kb-sec h2 {
    font-size: 24px;
  }
  .help-card {
    padding: 48px 20px;
  }
}
