/* NOVA RP Вики */

:root {
  --bg: #1b1b1b;
  --card: #1f1f1f;
  --hover: #262626;
  --line: #303030;
  --line-2: #3d3d3d;
  --text: #f2f2f2;
  --text-2: #c4c4c4;
  --muted: #8b8b8b;
  --accent: #f0a63a;
  --accent-soft: rgba(240, 166, 58, .12);
  --link: #6ea8ff;
  --radius: 10px;
  --top-h: 64px;
  --side-w: 230px;
  --toc-w: 240px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --card: #fff;
  --hover: #f0f0f0;
  --line: #e4e4e4;
  --line-2: #d2d2d2;
  --text: #171717;
  --text-2: #3a3a3a;
  --muted: #777;
  --accent: #c27400;
  --accent-soft: rgba(194, 116, 0, .1);
  --link: #1f63d6;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--top-h) + 20px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 700; }
kbd {
  font: 600 11px/1 var(--font);
  padding: 4px 6px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: var(--muted);
}

.ic { width: 18px; height: 18px; flex: none; }
.ic.sm { width: 14px; height: 14px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: #111;
  padding: 6px 10px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  background: var(--bg);
}
.top-in {
  max-width: 1320px; height: 100%;
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
}

.logo { display: flex; align-items: center; gap: 6px; font-size: 21px; letter-spacing: -.02em; white-space: nowrap; }
.logo b { font-weight: 800; }
.logo span { font-weight: 800; color: var(--accent); }
.logo em {
  font: 700 11px/1 var(--font);
  font-style: normal;
  padding: 4px 6px;
  margin-left: 4px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}

.top-nav a { color: var(--muted); font-weight: 600; font-size: 14px; }
.top-nav a:hover { color: var(--text); }

.search-btn {
  flex: 1; max-width: 460px;
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  height: 40px;
  padding: 0 8px 0 14px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--muted); font-size: 14px;
}
.search-btn:hover { border-color: var(--muted); }
.search-btn span { flex: 1; text-align: left; }

.icon-btn, .burger {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: none; border: 0; border-radius: var(--radius);
  color: var(--muted);
}
.icon-btn:hover, .burger:hover { color: var(--text); }
.burger { display: none; margin-left: -8px; }

.icon-btn .sun { display: none; }
[data-theme="light"] .icon-btn .sun { display: block; }
[data-theme="light"] .icon-btn .moon { display: none; }

/* ---------- главная ---------- */

.home { max-width: 1040px; margin: 0 auto; padding: 0 24px 80px; }

.hero { text-align: center; padding: 56px 0 52px; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.hero p { max-width: 440px; margin: 12px auto 26px; color: var(--muted); font-size: 15px; }

.hero-search {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 560px; height: 48px;
  margin: 0 auto; padding: 0 10px 0 16px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--muted); font-size: 15px;
}
.hero-search:hover { border-color: var(--muted); }
.hero-search span { flex: 1; text-align: left; }

.quick {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  max-width: 560px; margin: 14px auto 0;
  font-size: 13px;
}
.quick a { color: var(--muted); }
.quick a:hover { color: var(--text); }

.home-h {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 20px; margin: 0 0 16px;
  scroll-margin-top: 90px;
}
.home-h span { font-size: 14px; font-weight: 500; color: var(--muted); }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cat {
  display: flex; flex-direction: column;
  padding: 18px 20px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cat-head { display: flex; align-items: flex-start; gap: 12px; }
.cat-head .ic { margin-top: 2px; color: var(--accent); }
.cat-head b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-head > span { min-width: 0; }
.cat-head small { display: block; color: var(--muted); font-size: 13px; }
.cat-head:hover b { color: var(--accent); }

.cat ul { list-style: none; margin: 14px 0 14px; padding: 0 0 0 30px; }
.cat li a {
  display: block;
  padding: 3px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; font-weight: 600;
  color: var(--text-2);
}
.cat li a:hover { color: var(--accent); }
.cat ul:has(+ .cat-more) { margin-bottom: 0; }
.cat-more {
  display: grid;
  grid-template-rows: 0fr;
  margin-bottom: 14px;
  transition: grid-template-rows .4s cubic-bezier(.3, .8, .2, 1);
}
.cat-more > ul { min-height: 0; overflow: hidden; margin: 0; }
.cat.open .cat-more { grid-template-rows: 1fr; }
.cat-more li {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s;
}
.cat.open .cat-more li {
  opacity: 1;
  transform: none;
  transition: opacity .3s calc(var(--j, 0) * 25ms + .08s), transform .3s calc(var(--j, 0) * 25ms + .08s);
}

.expand {
  align-self: flex-start;
  margin-top: auto;
  margin-left: 30px; padding: 0;
  background: none; border: 0;
  color: var(--link); font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px;
}
.expand:hover { color: var(--text); }

.home-note { margin: 40px auto 0; max-width: 640px; text-align: center; color: var(--muted); font-size: 13px; }

.notfound { text-align: center; padding-top: 90px; }
.notfound h1 { font-size: 30px; }
.notfound p { color: var(--muted); }
.notfound a { color: var(--link); }
.notfound .hero-search { max-width: 420px; }

/* ---------- раскладка с меню ---------- */

.layout {
  max-width: 1320px; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: 56px;
  padding: 0 24px;
}
.layout.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); }

.side { position: relative; }
.side-in {
  position: sticky; top: var(--top-h);
  max-height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 24px 6px 40px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.side-sec summary {
  padding: 6px 0;
  list-style: none; cursor: pointer;
  color: var(--muted); font-size: 14px;
  user-select: none;
}
.side-sec summary::-webkit-details-marker { display: none; }
.side-sec summary:hover { color: var(--text); }
.side-sec[open] summary { color: var(--text-2); }
.side-sec ul { list-style: none; margin: 2px 0 12px; padding: 0 0 0 10px; }
.side-sec li a {
  display: block;
  padding: 4px 0;
  font-size: 14px; font-weight: 600; line-height: 1.35;
  color: var(--text);
}
.side-sec li a:hover { color: var(--accent); }
.side-sec li a[aria-current] { color: var(--accent); }

.content { padding: 24px 0 80px; min-width: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumbs a:hover { color: var(--text); }
.crumbs span { opacity: .5; }

/* ---------- страница раздела ---------- */

.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.sec-head > .ic {
  width: 44px; height: 44px; padding: 11px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--accent);
}
.sec-head h1 { font-size: 28px; letter-spacing: -.02em; }
.sec-head p { margin: 0; color: var(--muted); font-size: 14px; }

.art-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.art-card {
  display: block;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.art-card b { display: block; font-size: 15px; margin-bottom: 4px; }
.art-card span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: 13.5px; line-height: 1.5;
}
.art-card:hover { border-color: var(--line-2); }
.art-card:hover b { color: var(--accent); }

/* ---------- статья ---------- */

.article { max-width: 720px; }
.article h1 { font-size: clamp(26px, 3.2vw, 32px); letter-spacing: -.02em; font-weight: 800; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tags a, .tags span {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
.tags span { background: var(--hover); color: var(--muted); }

.lead { font-size: 15.5px; color: var(--text-2); margin: 16px 0 0; }

.block { margin: 0; padding: 28px 0; border-top: 1px solid var(--line); }
.article > .lead + .block { margin-top: 28px; }
.block h2 { font-size: 22px; margin: 0 0 14px; letter-spacing: -.01em; }
.block h3 { font-size: 16px; margin: 18px 0 8px; }

.article p { margin: 0 0 12px; }
.article ul, .article ol { margin: 0 0 12px; padding-left: 20px; }
.article li { margin: 4px 0; }
.article li::marker { color: var(--muted); }
.article li ul { margin: 6px 0 4px; }
.block a:not(.rel), .lead a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.block a:not(.rel):hover, .lead a:hover { color: var(--text); }
.article strong { font-weight: 700; }

.caption { font-weight: 700; margin-top: 18px !important; }

/* пометка «уточнить» */
.todo { color: var(--muted); font-style: italic; cursor: help; }

/* ключ — значение */
.kv {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.kv > div { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv dt { padding: 10px 16px; color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; padding: 10px 16px; font-weight: 600; }

/* шаги */
.steps-list { list-style: none; padding: 0 !important; counter-reset: step; }
.steps-list > li {
  position: relative;
  counter-increment: step;
  padding-left: 36px;
  margin: 0 0 10px !important;
}
.steps-list > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 700;
  color: var(--text-2);
}

/* таблицы */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 16px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { border-top: 1px solid var(--line); }
tbody tr:first-child td { border-top: 0; }
td:first-child { font-weight: 600; }

/* FAQ */
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.faq summary {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer; list-style: none;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 7px; height: 7px; margin: 0 4px 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  flex: none;
}
.faq[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq > div { padding: 0 16px 6px; color: var(--text-2); }

/* связанные */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rel {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rel span { display: block; font-weight: 600; font-size: 14px; }
.rel small { color: var(--muted); font-size: 12px; }
.rel:hover { border-color: var(--line-2); }
.rel:hover span { color: var(--accent); }

/* назад / дальше */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 720px; margin-top: 16px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.pager a {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 700; font-size: 15px; line-height: 1.35;
}
.pager a span { min-width: 0; }
.pager small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.pager .chev { color: var(--muted); transition: transform .25s cubic-bezier(.2, .7, .2, 1), color .2s; }
.pager .prev .chev { transform: rotate(180deg); }
.pager .next { grid-column: 2; justify-content: flex-end; text-align: right; }
.pager a:hover .chev { color: var(--accent); }
.pager .prev:hover .chev { transform: rotate(180deg) translateX(3px); }
.pager .next:hover .chev { transform: translateX(3px); }

/* похожие материалы */
.similar { max-width: 720px; margin-top: 28px; }
.similar h2 { font-size: 15px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.sim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sim {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  transition: border-color .2s, transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.cover {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0) 0 0 / 14px 14px,
    var(--hover);
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.cover-ic {
  width: 52px; height: 52px; padding: 13px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--accent);
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1);
}
.sim-body { padding: 14px 16px 16px; }
.sim-body b { display: block; font-size: 16px; line-height: 1.3; }
.sim-body small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.sim:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .5); }
.sim:hover b { color: var(--accent); }
.sim:hover .cover img { transform: scale(1.04); }
.sim:hover .cover-ic { transform: scale(1.1) rotate(-6deg); }

/* подразделы */
.side-group {
  margin: 10px 0 2px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.side-group:first-child { margin-top: 4px; }

.group-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 28px; }
.group-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  transition: border-color .2s, color .2s;
}
.group-nav a i { font-style: normal; color: var(--muted); font-weight: 500; }
.group-nav a:hover { border-color: var(--accent); color: var(--accent); }

.group { margin-bottom: 36px; scroll-margin-top: 80px; }
.group h2 { font-size: 18px; margin-bottom: 14px; }
.group h2 span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* правая колонка */
.toc-in {
  position: sticky; top: var(--top-h);
  padding: 24px 0;
  max-height: calc(100vh - var(--top-h));
  overflow-y: auto;
}
.box {
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.box small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.meta a, .meta b { display: block; font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.meta b:last-child { margin-bottom: 0; }
.meta a:hover { color: var(--accent); }
.box ul { list-style: none; margin: 6px 0 0; padding: 0; }
.box li a { display: block; padding: 3px 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.box li a:hover { color: var(--text); }
.box li a.on { color: var(--accent); }
.toc-top { display: block; text-align: center; font-size: 13px; color: var(--muted); }
.toc-top:hover { color: var(--text); }

/* ---------- подвал ---------- */

.foot { border-top: 1px solid var(--line); }
.foot-in {
  max-width: 1320px; margin: 0 auto; padding: 20px 24px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px;
}

/* ---------- поиск ---------- */

.search {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .6);
  padding: 12vh 16px 16px;
}
[data-theme="light"] .search { background: rgba(0, 0, 0, .3); }
.search[hidden] { display: none; }
.search-panel {
  max-width: 620px; margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
}
.search-field {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.search-field input {
  flex: 1; height: 52px;
  background: none; border: 0; outline: 0;
  color: var(--text); font: 15px var(--font);
}
.search-field input::-webkit-search-cancel-button { display: none; }
.search-res { max-height: min(60vh, 480px); overflow-y: auto; padding: 6px; }
.search-res:empty { display: none; }
.sr { display: block; padding: 9px 12px; border-radius: 8px; }
.sr b { font-weight: 700; }
.sr small { color: var(--muted); font-size: 12px; margin-left: 8px; }
.sr span { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.sr mark { background: none; color: var(--accent); }
.sr.on { background: var(--hover); }
.search-empty { padding: 16px 12px; color: var(--muted); font-size: 14px; }

/* ---------- адаптив ---------- */

@media (max-width: 1200px) {
  .layout.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --top-h: 56px; }
  .top { border-bottom: 1px solid var(--line); }
  .top-in { padding: 0 16px; gap: 12px; }
  .top-nav { display: none; }
  .burger { display: grid; }
  .search-btn kbd { display: none; }

  .layout, .layout.has-toc { display: block; padding: 0 16px; }
  .side {
    position: fixed; z-index: 40;
    top: var(--top-h); left: 0; bottom: 0;
    width: min(300px, 86vw);
    background: var(--bg);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .side-in { position: static; max-height: 100%; height: 100%; padding: 14px 16px 40px; }
  body.menu-open .side { transform: none; }
  body.menu-open { overflow: hidden; }

  .home { padding: 0 16px 56px; }
  .hero { padding: 40px 0 36px; }
  .art-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .cat-grid { grid-template-columns: 1fr; }
  .logo em { display: none; }
  .search-btn span { display: none; }
  .search-btn { flex: none; width: 38px; padding: 0; justify-content: center; border: 0; }
  .kv > div { grid-template-columns: 1fr; }
  .kv dt { padding-bottom: 0; font-size: 13px; }
  .kv dd { padding-top: 2px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
  .sim-grid { grid-template-columns: 1fr; }
}


/* ---------- анимации ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* появление страницы */
.hero > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.hero > :nth-child(2) { animation-delay: .05s; }
.hero > :nth-child(3) { animation-delay: .1s; }
.hero > :nth-child(4) { animation-delay: .15s; }
.home-h { animation: fade .5s .15s both; }
.cat, .art-card { animation: rise .45s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 35ms + .12s); }
.article, .sec-head, .crumbs { animation: rise .4s cubic-bezier(.2, .7, .2, 1) backwards; }
.toc-in > * { animation: fade .5s .15s both; }

/* карточки: приподнимаются при наведении */
.cat, .art-card, .rel, .pager a, .faq, .sim {
  transition: border-color .2s, background-color .2s, transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.cat:hover, .art-card:hover, .rel:hover, .pager a:hover, .sim:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .5);
}
[data-theme="light"] .cat:hover, [data-theme="light"] .art-card:hover,
[data-theme="light"] .rel:hover, [data-theme="light"] .pager a:hover { box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .18); }

.cat-head .ic { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.cat:hover .cat-head .ic { transform: scale(1.15) rotate(-6deg); }

/* ссылки и текст */
.cat li a, .cat-head b, .art-card b, .rel span, .side-sec li a, .side-sec summary,
.box li a, .quick a, .crumbs a, .top-nav a, .faq summary, .expand, .meta a {
  transition: color .15s, padding-left .2s;
}
.cat li a:hover { padding-left: 4px; }
.side-sec li a:hover { padding-left: 4px; }

.search-btn, .hero-search, .icon-btn, .burger { transition: border-color .2s, color .15s, background-color .15s, box-shadow .2s; }
.hero-search:hover { box-shadow: 0 0 0 4px var(--accent-soft); border-color: var(--accent); }

/* переключатель темы */
.icon-btn .ic { transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.icon-btn:hover .ic { transform: rotate(-20deg); }
.icon-btn:active .ic { transform: rotate(-90deg) scale(.85); }
html.theme-anim, html.theme-anim * { transition: background-color .3s, border-color .3s, color .3s !important; }


/* меню слева */
.side-sec[open] ul { animation: drop .25s ease both; }

/* FAQ */
.faq[open] > div { animation: drop .25s ease both; }
.faq summary::after { transition: transform .25s ease; }

/* оглавление */
.box li a { position: relative; }
.box li a.on { padding-left: 10px; }
.box li a::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform .2s;
}
.box li a.on::before { transform: scale(1); }

/* поиск */
.search:not([hidden]) { animation: fade .18s ease both; }
.search:not([hidden]) .search-panel { animation: pop .22s cubic-bezier(.2, .7, .2, 1) both; }
.search.closing { animation: fade .15s ease reverse both; }
.search.closing .search-panel { animation: pop .15s ease reverse both; }
.sr { transition: background-color .12s; }
.search-res .sr { animation: drop .2s ease both; }

/* мобильное меню: затемнение фона */
@media (max-width: 900px) {
  .side { transition: transform .28s cubic-bezier(.2, .7, .2, 1), box-shadow .28s; }
  body.menu-open .side { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- вход ---------- */

.login-page { min-height: 100vh; display: flex; }
.login {
  margin: auto;
  width: 100%; max-width: 400px;
  padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center;
}
.login .logo { margin-bottom: 28px; animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.login-card {
  width: 100%;
  padding: 28px 26px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  animation: rise .5s .06s cubic-bezier(.2, .7, .2, 1) both;
}
.login-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.login-card > p { margin: 6px 0 20px; color: var(--muted); font-size: 14px; }

.login-field {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 6px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.login-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.login-field input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: 0;
  color: var(--text); font: 15px var(--font);
  letter-spacing: .02em;
}
.eye {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  background: none; border: 0; border-radius: 6px;
  color: var(--muted);
  transition: color .15s;
}
.eye:hover { color: var(--text); }

.login-err { min-height: 20px; margin: 8px 2px 10px; color: #ef6461; font-size: 13px; }
[data-theme="light"] .login-err { color: #c9403d; }

.login-btn {
  position: relative;
  width: 100%; height: 46px;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: #141008;
  font-weight: 700; font-size: 15px;
  transition: filter .15s, transform .1s;
}
[data-theme="light"] .login-btn { color: #fff; }
.login-btn:hover { filter: brightness(1.07); }
.login-btn:active { transform: scale(.99); }
.login-btn:disabled { cursor: default; }
.busy .login-btn span { opacity: 0; }
.busy .login-btn::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.done .login-btn { filter: brightness(1.1); }

.login-foot { margin-top: 22px; color: var(--muted); font-size: 12px; animation: fade .5s .2s both; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.login-card.shake { animation: shake .35s ease; }
