:root {
  --bg: #111111;
  --surface: #181a1b;
  --surface-2: #1f2123;
  --border: #2a2d30;
  --fg: #f5f5f5;
  --fg-muted: #a1a1aa;
  --fg-dim: #71717a;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-soft: #fbbf24;
  --java: #52525b;
  --radius: 8px;
  --nav-h: 69px;
  --font-body: "Poppins", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

.nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.25rem; }
.brand svg { width: 13px; height: 26px; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { padding: 8px 14px; border-radius: 6px; color: var(--fg-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); background: var(--surface); }
.nav-links .gh { display: inline-flex; gap: 8px; align-items: center; color: var(--fg); }
.nav-links .gh svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .nav-links a:not(.gh) { display: none; } }
@media (max-width: 520px) { .nav-links .gh { font-size: 0; gap: 0; padding: 10px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 24px; border-radius: 6px; font-weight: 500; font-size: 1rem;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.btn[hidden] { display: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { border-color: var(--border); color: var(--fg); }
.btn-outline:hover { background: var(--surface); border-color: #3f4347; }
.btn svg { width: 18px; height: 18px; }

.code { position: relative; font-family: var(--font-mono); font-size: 0.88rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px; overflow-x: auto; white-space: pre; }
.code .p { color: var(--accent); user-select: none; }

footer { border-top: 1px solid var(--border); padding: 48px 0 56px; color: var(--fg-dim); font-size: 0.88rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
footer .brand { color: var(--fg); font-size: 1.05rem; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer nav a:hover { color: var(--fg); }

.rise { opacity: 0; transform: translateY(12px); animation: rise .6s ease-out forwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; transform: none; }
}

.docs-head { padding: 64px 0 36px; border-bottom: 1px solid var(--border); }
.docs-wrap { width: min(1064px, 100% - 32px); margin-inline: auto; }
.docs-head h1 { font-weight: 500; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.2; margin: 0; }

.docs { display: grid; grid-template-columns: 240px minmax(0, 760px); justify-content: center; gap: 64px; padding: 48px 0 96px; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; } }

.toc { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; max-height: calc(100vh - var(--nav-h) - 64px); overflow-y: auto; font-size: 0.9rem; }
.toc summary { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > details > ol > li + li { margin-top: 18px; }
.toc a { display: block; padding: 4px 0 4px 14px; border-left: 1px solid var(--border); color: var(--fg-muted); transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--fg); border-color: var(--accent); }
.toc > details > ol > li > a { padding-left: 0; border: 0; margin-bottom: 6px; color: var(--fg); font-weight: 600; }
.toc .n { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; color: var(--accent); margin-right: 10px; }
@media (max-width: 900px) {
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
  .toc summary { display: block; padding: 12px 18px; font-weight: 600; cursor: pointer; }
  .toc details > ol { padding: 4px 18px 18px; }
}

.doc { max-width: 760px; }
.doc + .doc { margin-top: 72px; padding-top: 56px; border-top: 1px solid var(--border); }
.doc h1, .doc h2, .doc h3, .doc h4 { line-height: 1.3; }
.doc h1 { font-weight: 600; font-size: clamp(1.8rem, 3.6vw, 2.4rem); margin: 0 0 20px; }
.doc h2 { font-weight: 600; font-size: 1.45rem; margin: 48px 0 12px; }
.doc h3 { font-weight: 600; font-size: 1.12rem; margin: 32px 0 8px; }
.doc h4 { font-weight: 600; font-size: 1rem; margin: 24px 0 6px; color: var(--fg-muted); }
.doc .anchor { margin-left: 10px; font-family: var(--font-mono); font-weight: 400; color: var(--fg-dim); opacity: 0; transition: opacity .15s, color .15s; }
.doc :is(h1, h2, h3, h4):hover .anchor, .doc .anchor:focus-visible { opacity: 1; }
.doc .anchor:hover { color: var(--accent); }
.doc p, .doc ul, .doc ol, .doc table, .doc .code, .doc blockquote, .doc .callout, .doc details { margin: 0 0 18px; }
.doc p, .doc li { color: #d4d4d8; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li + li, .doc li > ul, .doc li > ol { margin-top: 6px; }
.doc li > ul, .doc li > ol { margin-bottom: 0; }
.doc li::marker { color: var(--fg-dim); }
.doc ol > li::marker { font-family: var(--font-mono); font-size: 0.85em; }
.doc p a, .doc li a, .doc td a { color: var(--accent); font-weight: 500; }
.doc p a:hover, .doc li a:hover, .doc td a:hover { text-decoration: underline; }
.doc strong { color: var(--fg); font-weight: 600; }
.doc :not(pre) > code { font-family: var(--font-mono); font-size: 0.86em; color: var(--fg); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.doc .code { line-height: 1.55; }
.doc .code[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 12px; font-size: 0.72rem; color: var(--fg-dim); }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.doc img { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.doc blockquote { padding: 2px 0 2px 18px; border-left: 2px solid var(--border); }
.doc blockquote p { color: var(--fg-muted); }
.doc .callout { padding: 14px 18px; border: 1px solid var(--border); border-left: 3px solid var(--fg-dim); border-radius: 6px; background: var(--surface); }
.doc .callout > :last-child { margin-bottom: 0; }
.doc .callout .label { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); }
.doc .callout.warning, .doc .callout.caution { border-left-color: var(--accent); }
.doc .callout.warning .label, .doc .callout.caution .label { color: var(--accent); }
.doc .callout.tip .label, .doc .callout.important .label { color: var(--accent-soft); }
.doc .table { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 6px; }
.doc table { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.9rem; }
.doc th, .doc td { padding: 10px 14px; text-align: left; vertical-align: top; }
.doc th { font-weight: 600; background: var(--surface); border-bottom: 1px solid var(--border); }
.doc td { color: #d4d4d8; }
.doc tr + tr td { border-top: 1px solid var(--border); }
.doc del { color: var(--fg-dim); }
.doc li.task { list-style: none; margin-left: -22px; }
.doc li.task > input, .doc li.task > p > input { accent-color: var(--accent); margin: 0 8px 0 0; vertical-align: -1px; }
.doc h5, .doc h6 { font-size: 0.92rem; font-weight: 600; margin: 20px 0 6px; color: var(--fg-muted); }
