@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #08090c;
  --surface: #0f1116;
  --surface-2: #151821;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #b9c1cd;
  --muted: #7b8595;
  --head: #f4f6fa;
  --accent: #3d7bff;
  --accent-2: #86b4ff;
  --accent-soft: rgba(61, 123, 255, .12);
  --r: 14px;
  --top: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 24px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.7 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
::selection { background: rgba(61, 123, 255, .4); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
kbd { font: 500 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface-2); }

.skip { position: absolute; left: -999px; top: 10px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 10px; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: 0 50%; transform: scaleX(0); }
.home .progress { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 15px; color: #fff; background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 20px -6px rgba(61,123,255,.6);
  transition: transform .15s, background .15s;
}
.btn:hover { color: #fff; background: #5189ff; transform: translateY(-1px); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 13px 22px; font-size: 15.5px; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); box-shadow: none; color: var(--head); }
.btn-ghost:hover { background: var(--surface-2); }
.icon-btn { display: none; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: none; color: var(--head); font-size: 16px; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); background: rgba(8, 9, 12, .78); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--head); flex-shrink: 0; }
.brand:hover { color: var(--head); }
.brand img { border-radius: 8px; background: #fff; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.brand em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.search-btn {
  display: flex; align-items: center; gap: 10px; width: 300px; margin-left: 40px; padding: 8px 10px 8px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: 14px var(--font); cursor: pointer; transition: border-color .15s;
}
.search-btn:hover { border-color: var(--line-2); color: var(--text); }
.search-btn span { flex: 1; text-align: left; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 24px; font-size: 14.5px; }
.top-links a:not(.btn) { color: var(--text); }
.top-links a:not(.btn):hover { color: #fff; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 26px 16px 48px 24px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: 11px; padding: 6.5px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; line-height: 1.4; transition: color .12s, background .12s; }
.sidebar a i { width: 16px; text-align: center; font-size: 13px; opacity: .8; }
.sidebar a:hover { color: var(--head); background: rgba(255,255,255,.035); }
.sidebar a[aria-current="page"] { color: var(--head); background: var(--accent-soft); font-weight: 500; }
.sidebar a[aria-current="page"] i { color: var(--accent-2); opacity: 1; }
.sidebar .lvl-1 a { margin-left: 18px; padding-left: 16px; border-radius: 0 8px 8px 0; border-left: 1px solid var(--line); }
.sidebar .lvl-1 a[aria-current="page"] { border-left-color: var(--accent); }
.nav-section { margin: 26px 10px 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: #5d6676; }

main { min-width: 0; padding: 0 56px 40px; overflow-x: clip; }

/* ---------- content page ---------- */
.page { display: grid; grid-template-columns: minmax(0, 760px) 210px; gap: 72px; justify-content: center; }
.page-head { padding: 52px 0 32px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--accent-2); }
.crumbs span { color: var(--muted); font-size: 9px; }
.page-head h1 { margin: 0; color: var(--head); font-size: clamp(32px, 4.2vw, 42px); line-height: 1.12; letter-spacing: -.028em; font-weight: 700; }
.lead { margin: 16px 0 0; font-size: 18px; line-height: 1.6; color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 20px; margin: 22px 0 0; font-size: 13.5px; color: var(--muted); }
.meta i { margin-right: 6px; color: var(--accent-2); }

.prose { font-size: 16.5px; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 18px; }
.prose h2, .prose h3, .prose h4 { color: var(--head); letter-spacing: -.015em; line-height: 1.3; }
.prose h2 { font-size: 24px; font-weight: 650; margin: 56px 0 16px; }
.prose h3 { font-size: 18.5px; font-weight: 600; margin: 36px 0 10px; }
.prose h4 { font-size: 16px; margin: 28px 0 8px; }
.anchor { margin-left: 10px; font-size: .62em; color: var(--muted); opacity: 0; transition: opacity .15s; vertical-align: middle; }
:is(h2, h3, h4):hover .anchor, .anchor:focus { opacity: 1; }
.prose strong { color: var(--head); font-weight: 600; }
.prose a { text-decoration: underline; text-decoration-color: rgba(134,180,255,.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 20px; }
.prose li { margin: 7px 0; padding-left: 4px; }
.prose li::marker { color: var(--accent); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }
.prose blockquote { margin: 24px 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose figure { margin: 28px 0; }
.prose figure img { border-radius: var(--r); display: block; }
.center { text-align: center; }
.center figure img { display: inline-block; border-radius: 20px; background: #fff; width: 96px; }

.table-wrap { overflow-x: auto; margin: 24px 0 28px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
th, td { text-align: left; padding: 13px 18px; vertical-align: top; }
td { border-top: 1px solid var(--line); }
th { background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
thead:not(:has(th:not(:empty))) { display: none; }
thead:not(:has(th:not(:empty))) + tbody tr:first-child td { border-top: 0; }
td:first-child { color: var(--head); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.02); }

.hint { display: flex; gap: 14px; margin: 26px 0; padding: 16px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent)); font-size: 15.5px; }
.hint > i { margin-top: 5px; color: var(--c, var(--accent)); }
.hint > div > :first-child { margin-top: 0; }
.hint > div > :last-child { margin-bottom: 0; }
.hint-warning { --c: #f5a524; }
.hint-success { --c: #22c55e; }
.hint-danger { --c: #f04f4f; }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 18px 4px; color: var(--head); font-weight: 550; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex-shrink: 0; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
details[open] summary::after { transform: rotate(-135deg); border-color: var(--accent-2); }
summary:hover { color: #fff; }
details > :not(summary) { margin: 0; padding: 0 4px 20px; color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 24px 0 40px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 22px 22px 20px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); text-decoration: none !important; transition: border-color .18s, transform .18s, background .18s;
}
.card:hover { color: var(--muted); border-color: rgba(61,123,255,.45); background: var(--surface-2); transform: translateY(-2px); }
.card strong { color: var(--head); font-size: 16px; font-weight: 600; }
.card-text { font-size: 14.5px; line-height: 1.55; }
.card-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); font-size: 15px; }
.card-go { position: absolute; top: 22px; right: 22px; font-size: 13px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: .18s; }
.card:hover .card-go { opacity: 1; transform: none; color: var(--accent-2); }

.help { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 64px 0 0; padding: 22px 24px; border-radius: var(--r); background: linear-gradient(135deg, rgba(61,123,255,.1), rgba(61,123,255,.02)); border: 1px solid rgba(61,123,255,.2); }
.help strong { color: var(--head); }
.help p { margin: 2px 0 0; font-size: 14.5px; color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 0; }
.pager a { display: flex; flex-direction: column; gap: 3px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, background .15s; }
.pager a:hover { border-color: rgba(61,123,255,.45); background: var(--surface); }
.pager small { color: var(--muted); font-size: 12.5px; }
.pager small i { font-size: 11px; }
.pager span { color: var(--head); font-weight: 600; font-size: 15px; }
.pager-next { text-align: right; grid-column: 2; }

.toc { position: sticky; top: calc(var(--top) + 52px); align-self: start; margin-top: 52px; font-size: 13.5px; max-height: calc(100vh - var(--top) - 80px); overflow-y: auto; scrollbar-width: none; }
.toc p { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--head); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; color: var(--muted); line-height: 1.4; border-left: 1px solid transparent; transition: color .12s, border-color .12s; }
.toc li a:hover { color: var(--head); }
.toc li a.active { color: var(--accent-2); border-left-color: var(--accent); }
.toc-top { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--muted); }

/* ---------- home ---------- */
.home main { padding-top: 0; }
.hero { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 84px 0 56px; }
.hero::before { content: ""; position: absolute; inset: -40px -120px auto auto; width: 620px; height: 420px; z-index: -1; background: radial-gradient(closest-side, rgba(61,123,255,.22), transparent); filter: blur(10px); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 22px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; color: var(--text); background: var(--surface); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.hero h1 { margin: 0; color: var(--head); font-size: clamp(38px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -.035em; font-weight: 750; }
.grad { background: linear-gradient(100deg, #fff 10%, var(--accent-2) 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 18px; color: var(--text); max-width: 520px; margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-art { perspective: 1200px; }
.hero-art img { display: block; border-radius: 18px; border: 1px solid var(--line-2); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.03), 0 0 80px -20px rgba(61,123,255,.45); transform: rotateY(-9deg) rotateX(3deg); transition: transform .5s; }
.hero-art:hover img { transform: none; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1080px; margin: 0 auto 72px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.fact { padding: 24px 22px; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-2); font-size: 14px; }
.fact strong { display: block; color: var(--head); font-size: 15px; font-weight: 600; }
.fact p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

.home-prose { max-width: 1080px; margin: 0 auto; }
.home-prose h2 { font-size: 28px; margin-top: 72px; letter-spacing: -.02em; }
.home-prose > h2:first-child { margin-top: 0; }
.home-prose details { max-width: 820px; }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; max-width: 1080px; margin: 80px auto 0; padding: 40px 44px; border-radius: 20px; border: 1px solid rgba(61,123,255,.28); background: radial-gradient(600px 200px at 0% 0%, rgba(61,123,255,.22), transparent), var(--surface); }
.cta-band h2 { margin: 0; color: var(--head); font-size: 24px; letter-spacing: -.02em; }
.cta-band p { margin: 6px 0 0; color: var(--muted); }

/* ---------- footer ---------- */
.footer { display: grid; grid-template-columns: auto 1fr; gap: 18px 32px; align-items: center; max-width: 1080px; margin: 88px auto 0; padding: 28px 0 8px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.doc .footer { max-width: 1042px; }
.footer-brand { display: flex; align-items: center; gap: 11px; color: var(--head); font-weight: 600; line-height: 1.25; }
.footer-brand img { border-radius: 7px; background: #fff; }
.footer-brand small { color: var(--muted); font-weight: 400; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; }
.footer nav a { color: var(--muted); }
.footer nav a:hover { color: var(--head); }
.footer p { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: #5d6676; }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(3, 4, 7, .7); backdrop-filter: blur(6px); }
.search[hidden] { display: none; }
.search-open { overflow: hidden; }
.search-box { width: 100%; max-width: 620px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; height: 58px; border: 0; outline: 0; background: none; color: var(--head); font: 16.5px var(--font); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; border-radius: 10px; color: var(--text); }
.search-results [aria-selected] a, .search-results a:hover { background: var(--accent-soft); }
.r-title { color: var(--head); font-weight: 600; font-size: 14.5px; }
.r-sep { color: var(--muted); }
.r-text { font-size: 13.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-text mark { background: none; color: var(--accent-2); font-weight: 600; }
.search-empty { margin: 0; padding: 22px 20px; color: var(--muted); font-size: 14.5px; }

.scrim { position: fixed; inset: var(--top) 0 0 0; z-index: 25; background: rgba(0,0,0,.6); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .page { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
  .search-btn { width: 240px; margin-left: 24px; }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; gap: 40px; }
  .hero-art img { transform: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .top-links a:not(.btn) { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .icon-btn { display: inline-grid; }
  .sidebar { position: fixed; z-index: 30; left: 0; width: min(300px, 86vw); padding-left: 16px; background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .25s; }
  .nav-open .sidebar { transform: none; }
  main { padding: 0 22px 32px; }
  .topbar-in { padding: 0 16px; gap: 12px; }
  .search-btn { width: auto; margin-left: auto; }
  .search-btn span, .search-btn kbd { display: none; }
  .top-links { margin-left: 0; }
}
@media (max-width: 560px) {
  .brand em { display: none; }
  .page-head { padding-top: 36px; }
  .facts { grid-template-columns: 1fr; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .cta-band { padding: 28px 24px; }
  .footer { grid-template-columns: 1fr; }
  .footer nav { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
