:root {
  --bg: #120818;
  --surface: #1f102a;
  --surface-2: #2b1738;
  --text: #f8f1ff;
  --muted: #d5c2dd;
  --accent: #f1b944;
  --accent-2: #49d1b5;
  --line: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --wrap: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(73, 209, 181, 0.18), transparent 32rem),
    linear-gradient(180deg, #15091d 0%, #21102d 45%, #120818 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 8, 24, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  max-width: var(--wrap);
  min-height: 76px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand picture {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 156px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
}

.nav-toggle {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.burger span,
.burger span::before,
.burger span::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  content: "";
}

.burger span {
  position: relative;
}

.burger span::before,
.burger span::after {
  position: absolute;
  left: 0;
}

.burger span::before {
  top: -7px;
}

.burger span::after {
  top: 7px;
}

.main-nav {
  margin-left: auto;
}

.main-nav ul,
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a,
.footer-nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}

.main-nav a:hover,
.footer-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.btn,
main section > a,
.hero-content > a,
.header-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 8px;
  color: #160b0f;
  background: linear-gradient(135deg, var(--accent), #ffd978);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(241, 185, 68, 0.22);
}

.btn.secondary,
.header-actions a:first-child {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.breadcrumbs {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 22px 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.42);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 22px 56px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 26px;
  border-radius: 8px;
  background: #0e0714;
  box-shadow: var(--shadow);
}

.hero picture,
.hero img {
  display: block;
  width: 100%;
}

.hero img {
  aspect-ratio: 1774 / 887;
  object-fit: contain;
  background: #0e0714;
}

.hero-content {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(44%, 480px);
  padding: clamp(16px, 2.4vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(90deg, rgba(18, 8, 24, 0.88), rgba(18, 8, 24, 0.58), transparent);
}

.hero h1 {
  margin: 0 0 10px;
  max-width: 12em;
  font-size: clamp(1.65rem, 3.2vw, 3rem);
  line-height: 1.02;
}

.hero p {
  max-width: 30rem;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: clamp(0.86rem, 1.05vw, 0.94rem);
  line-height: 1.38;
}

section:not(.hero) {
  margin: 22px 0;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 16, 42, 0.74);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

h2,
h3 {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

h3 {
  margin: 22px 0 8px;
  font-size: 1.2rem;
}

p {
  margin: 0 0 16px;
}

p:last-child,
section > *:last-child {
  margin-bottom: 0;
}

section.toc {
  padding: 0;
  margin-top: 18px;
  margin-bottom: 22px;
}

.toc summary {
  min-height: 0;
  padding: 13px 18px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.toc summary::marker {
  color: var(--accent);
}

.toc nav {
  border-top: 1px solid var(--line);
  padding: 14px 18px 16px;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
}

.toc li {
  break-inside: avoid;
  margin: 0 0 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

caption {
  caption-side: top;
  padding: 0 0 10px;
  color: var(--muted);
  text-align: left;
}

th,
td {
  padding: 14px 16px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  color: #fff7d7;
  background: rgba(241, 185, 68, 0.10);
}

article {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

article:first-of-type {
  border-top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(18, 8, 24, 0.92);
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .header-inner {
    min-height: 66px;
    padding: 8px 14px;
    gap: 8px;
  }

  .brand img {
    width: 70px;
    height: 36px;
  }

  .burger {
    display: inline-flex;
    order: 0;
  }

  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    margin: 0;
    padding: 10px 14px 16px;
    background: rgba(18, 8, 24, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .main-nav ul {
    display: grid;
    gap: 6px;
  }

  .main-nav a {
    min-height: 44px;
    padding-inline: 10px;
  }

  .nav-toggle:checked ~ .main-nav {
    display: block;
  }

  .header-actions {
    margin-left: auto;
    gap: 5px;
    order: 1;
  }

  .header-actions a {
    min-height: 36px;
    padding: 6px;
    font-size: 0.72rem;
  }

  .breadcrumbs,
  main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero {
    display: flex;
    flex-direction: column;
  }

  .hero-content {
    position: static;
    width: 100%;
    padding: 20px;
    background: linear-gradient(180deg, #23122f, #160a20);
    min-width: 0;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.55rem, 6vw, 1.9rem);
    overflow-wrap: anywhere;
  }

  .hero p {
    overflow-wrap: anywhere;
  }

  section:not(.hero):not(.toc) {
    padding: 18px;
  }

  section.toc {
    margin-top: 14px;
    margin-bottom: 18px;
    padding: 0;
  }

  .toc summary {
    padding: 10px 14px;
    font-size: 1rem;
    line-height: 1.25;
  }

  .toc nav {
    padding: 12px 14px 14px;
  }

  .toc ol {
    columns: 1;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-nav ul {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .brand img {
    width: 64px;
  }

  .header-actions a {
    min-height: 36px;
    padding-inline: 5px;
    font-size: 0.68rem;
  }

  .burger {
    width: 36px;
    height: 36px;
  }
}
