:root {
  --bg: #12100d;
  --bg-2: #1b1813;
  --panel: #221e18;
  --line: #3a3228;
  --text: #e8dfcf;
  --muted: #a89a84;
  --accent: #d9a23a;
  --accent-2: #ac891e;
  --rust: #b4552d;
  --ok: #8fae5b;
  --radius: 10px;
  --wrap: 1120px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Bahnschrift", "Arial Narrow", "Roboto Condensed", var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: #f0c066; }
img { max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 16, 13, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.logo {
  font: 700 20px/1 var(--font-head); letter-spacing: .06em; text-transform: uppercase;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 15px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--panel); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn.main { background: var(--accent); border-color: var(--accent); color: #1a1408; }
.btn.main:hover { background: #f0b850; color: #1a1408; }
.btn.small { padding: 7px 12px; font-size: 14px; }

/* Главная */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 70% 0%, rgba(217, 162, 58, .22), transparent 60%),
    radial-gradient(ellipse at 10% 100%, rgba(180, 85, 45, .18), transparent 55%),
    linear-gradient(180deg, #1d1912, var(--bg));
}
.hero .wrap { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 72px; }
/* Нарезка из записей 27.10, без звука, крутится как гифка под затемнением. */
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; opacity: .9;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 16, 13, .85) 0%, rgba(18, 16, 13, .45) 50%, rgba(18, 16, 13, .05) 100%),
    linear-gradient(180deg, transparent 60%, var(--bg));
}
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
.hero h1 {
  font: 700 clamp(40px, 8vw, 84px)/1 var(--font-head);
  letter-spacing: .03em; text-transform: uppercase; margin: 0 0 18px;
}
.hero p.lead { font-size: clamp(17px, 2.2vw, 21px); max-width: 640px; color: #d6cbb8; margin: 0 0 28px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tag {
  display: inline-block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(217, 162, 58, .4); border-radius: 99px; padding: 3px 12px; margin-bottom: 18px;
}

section.block { padding: 56px 0; border-bottom: 1px solid var(--line); }
section.block h2 { font: 700 30px/1.15 var(--font-head); margin: 0 0 8px; letter-spacing: .02em; }
section.block > .wrap > p.sub { color: var(--muted); margin: 0 0 28px; max-width: 680px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; counter-reset: step; }
.step {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.step::before {
  counter-increment: step; content: counter(step);
  font: 700 28px/1 var(--font-head); color: var(--accent);
}
.step h3 { margin: 0; font-size: 18px; }
.step p { margin: 0; color: #cfc4b1; flex: 1; }
.step .row { display: flex; gap: 8px; flex-wrap: wrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; color: var(--text); text-decoration: none;
}
a.card:hover { border-color: var(--accent); color: var(--text); }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.note {
  background: var(--bg-2); border-left: 3px solid var(--accent-2); padding: 14px 18px; border-radius: 0 8px 8px 0;
  color: #d4c9b6; margin: 22px 0 0;
}
.foot { padding: 30px 0 40px; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--muted); }

/* Вики */
.wiki { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 60px; }
.side { position: sticky; top: 74px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; padding-right: 4px; }
.search {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; margin-bottom: 14px;
}
.search:focus { outline: none; border-color: var(--accent); }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 15px;
}
.toc a:hover { color: var(--text); background: var(--panel); }
.toc a.on { color: var(--text); background: var(--panel); box-shadow: inset 2px 0 0 var(--accent); }
.toc .n { float: right; color: #6f6455; font-size: 13px; }

.article h1 { font: 700 34px/1.1 var(--font-head); margin: 0 0 6px; }
.article .intro { color: var(--muted); margin: 0 0 24px; }
.entry {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 14px; scroll-margin-top: 80px;
}
.entry h2 { font-size: 20px; margin: 0 0 4px; }
.entry h2 a { color: var(--text); text-decoration: none; }
.entry h2 a:hover::after { content: " #"; color: var(--accent); }
.entry .lead { color: #e2d6c2; margin: 0 0 10px; font-weight: 500; }
.entry p { margin: 0 0 8px; color: #cdc2af; }
.entry ul { margin: 0 0 8px; padding-left: 20px; color: #cdc2af; }
.entry li { margin-bottom: 4px; }
.keys {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 14px; color: var(--muted);
}
.keys b { color: var(--accent); font-weight: 600; }
kbd {
  font: 600 13px/1 var(--font); padding: 3px 6px; border-radius: 4px; border: 1px solid #4a4134;
  background: #2b251d; color: var(--text); white-space: nowrap;
}
mark { background: rgba(217, 162, 58, .35); color: inherit; border-radius: 2px; }
.empty { color: var(--muted); padding: 30px 0; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .wiki { grid-template-columns: 1fr; gap: 0; padding-top: 16px; }
  .side { position: static; max-height: none; overflow: visible; margin-bottom: 18px; }
  .toc { display: none; }
  .toc.open { display: block; margin-bottom: 8px; }
  .menu-btn { display: inline-flex; width: 100%; margin-bottom: 10px; }
  .hero .wrap { padding-top: 48px; padding-bottom: 48px; }
  .entry { padding: 16px; }
  .nav a { padding: 6px 8px; }
}
