/* Мини-wiki – оформление поверх Material for MkDocs */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:root {
  --lh-navy: #0b1b3f;
  --lh-navy-2: #13295c;
  --lh-blue: #2f5bea;
  --lh-orange: #ff8a3d;
  --lh-amber: #ffb547;
  --lh-radius: 12px;
  --lh-border: rgba(15, 23, 42, 0.08);
  --lh-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--lh-navy);
  --md-primary-fg-color--light: var(--lh-navy-2);
  --md-primary-fg-color--dark: #07122b;
  --md-accent-fg-color: var(--lh-orange);
  --md-typeset-a-color: var(--lh-blue);
  --md-default-bg-color: #ffffff;
  --lh-surface: #f6f8fc;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #0a1530;
  --md-primary-fg-color--light: #13295c;
  --md-primary-fg-color--dark: #050b1a;
  --md-accent-fg-color: var(--lh-amber);
  --md-typeset-a-color: #7aa2ff;
  --md-default-bg-color: #0d1424;
  --lh-surface: #121b30;
  --lh-border: rgba(255, 255, 255, 0.08);
}

/* ---------- Шапка и вкладки ---------- */
.md-header {
  background: linear-gradient(90deg, var(--lh-navy) 0%, var(--lh-navy-2) 100%);
  box-shadow: none;
}
.md-tabs {
  background: var(--lh-navy-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.md-tabs__link { font-weight: 500; opacity: 0.8; }
.md-tabs__link--active, .md-tabs__link:hover { opacity: 1; color: var(--lh-amber); }
.md-header__button.md-logo img { height: 1.9rem; }
.md-header__topic:first-child { font-weight: 700; letter-spacing: -0.01em; }
.md-search__form { border-radius: 8px; }

/* ---------- Типографика ---------- */
.md-typeset { font-size: 0.8rem; line-height: 1.7; }
.md-typeset h1 {
  font-weight: 800; letter-spacing: -0.02em; color: var(--md-default-fg-color);
  margin-bottom: 1rem;
}
.md-typeset h2 {
  font-weight: 700; letter-spacing: -0.01em; margin-top: 2.2em;
  padding-bottom: 0.35em; border-bottom: 1px solid var(--lh-border);
}
.md-typeset h2::before {
  content: ""; display: inline-block; width: 0.32em; height: 0.9em; margin-right: 0.5em;
  border-radius: 2px; vertical-align: -0.08em;
  background: linear-gradient(180deg, var(--lh-amber), var(--lh-orange));
}
.md-typeset h3 { font-weight: 650; }
.md-typeset blockquote {
  border-left: 4px solid var(--lh-orange); background: var(--lh-surface);
  border-radius: 0 var(--lh-radius) var(--lh-radius) 0; padding: 0.6em 1.1em;
  color: var(--md-default-fg-color); font-size: 0.95rem;
}

/* ---------- Таблицы ---------- */
.md-typeset table:not([class]) {
  font-size: 0.72rem; border: 1px solid var(--lh-border); border-radius: var(--lh-radius);
  overflow: hidden; box-shadow: var(--lh-shadow); border-collapse: separate;
}
.md-typeset table:not([class]) th {
  background: var(--lh-surface); color: var(--md-default-fg-color); font-weight: 700;
  text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--lh-border);
}
.md-typeset table:not([class]) td { border-top: 1px solid var(--lh-border); vertical-align: top; }
.md-typeset table:not([class]) tbody tr:hover { background: rgba(47, 91, 234, 0.04); box-shadow: none; }

/* ---------- Изображения, диаграммы, код ---------- */
.md-typeset img:not(.twemoji) {
  border-radius: var(--lh-radius); border: 1px solid var(--lh-border); box-shadow: var(--lh-shadow);
  background: #fff;
}
.md-typeset .mermaid {
  background: var(--lh-surface); border: 1px solid var(--lh-border); border-radius: var(--lh-radius);
  padding: 1.2rem; text-align: center;
}
.md-typeset pre > code { border-radius: var(--lh-radius); }

/* ---------- Карточки, вкладки, заметки ---------- */
.md-typeset .grid.cards > ul > li, .md-typeset .grid > .card {
  border: 1px solid var(--lh-border); border-radius: 14px; box-shadow: var(--lh-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-3px); border-color: rgba(255, 138, 61, 0.55);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
.md-typeset .grid.cards .lg { color: var(--lh-orange); }
.md-typeset .admonition, .md-typeset details {
  border-radius: var(--lh-radius); border-width: 0 0 0 4px; box-shadow: var(--lh-shadow);
  font-size: 0.76rem;
}
.md-typeset .tabbed-labels > label { font-weight: 600; }
.md-typeset .md-button { border-radius: 10px; font-weight: 600; padding: 0.55em 1.4em; }
.md-typeset .md-button--primary {
  background: linear-gradient(90deg, var(--lh-amber), var(--lh-orange)); border: 0; color: #1b1300;
}
.md-typeset .md-button--primary:hover { filter: brightness(1.05); color: #1b1300; }

/* ---------- Навигация и подвал ---------- */
.md-nav__link--active { font-weight: 700; }
.md-nav__item--section > .md-nav__link { text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.06em; opacity: 0.7; }
.md-footer { background: var(--lh-navy); }
.md-footer-meta { background: #07122b; }

/* ---------- Главная: hero ---------- */
.lh-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 138, 61, 0.35), transparent 60%),
    radial-gradient(700px 380px at 0% 120%, rgba(47, 91, 234, 0.45), transparent 60%),
    linear-gradient(135deg, #0b1b3f 0%, #13295c 100%);
}
.lh-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.lh-hero__grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 1fr; gap: 2.5rem;
  align-items: center; padding: 3.2rem 0.8rem 3.6rem;
}
.lh-badge {
  display: inline-block; padding: 0.3em 0.9em; border-radius: 999px; font-size: 0.62rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); letter-spacing: 0.02em;
}
.lh-hero h1 { margin: 0.7rem 0 0.9rem; font-size: 2.1rem; line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; color: #fff; }
.lh-hero h1 span {
  background: linear-gradient(90deg, var(--lh-amber), var(--lh-orange));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lh-hero p { font-size: 0.86rem; line-height: 1.7; color: rgba(255, 255, 255, 0.78); max-width: 34rem; }
.lh-hero__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.lh-hero .md-button { border-radius: 10px; font-weight: 600; padding: 0.7em 1.6em; font-size: 0.8rem; }
.lh-hero .md-button--primary { background: linear-gradient(90deg, var(--lh-amber), var(--lh-orange)); color: #1b1300; border: 0; }
.lh-button--ghost { color: #fff !important; border: 1px solid rgba(255, 255, 255, 0.35) !important; }
.lh-button--ghost:hover { background: rgba(255, 255, 255, 0.08); }

.lh-hero__panel { display: grid; gap: 0.8rem; }
.lh-kpi {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px; padding: 0.9rem 1.1rem; backdrop-filter: blur(6px);
}
.lh-kpi__label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.6); }
.lh-kpi__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.lh-kpi__value small { font-size: 0.55em; font-weight: 600; margin-left: 0.15em; color: rgba(255, 255, 255, 0.7); }
.lh-kpi--main .lh-kpi__value { font-size: 3rem; color: var(--lh-amber); }
.lh-kpi__bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); margin: 0.5rem 0 0.4rem; overflow: hidden; }
.lh-kpi__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lh-amber), var(--lh-orange)); }
.lh-kpi__hint { font-size: 0.62rem; color: rgba(255, 255, 255, 0.6); }
.lh-kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }

@media screen and (max-width: 76.1875em) {
  .lh-hero__grid { grid-template-columns: 1fr; padding: 2.2rem 0.8rem; }
  .lh-hero h1 { font-size: 1.6rem; }
}

/* Ссылки на источники на страницах нотаций: номер общего списка вместо маркера */
.md-typeset .lh-refs ul { list-style: none; margin-left: 0; padding-left: 0; }
.md-typeset .lh-refs ul li { margin-left: 0; padding-left: 2.6em; text-indent: -2.6em; }
.md-typeset .lh-refs ul li > a:first-child { display: inline-block; min-width: 2.4em; text-indent: 0; font-weight: 600; }
