/* RingDotNet documentation */
:root {
	--bg: #fbfbfd;
	--panel: #ffffff;
	--soft: #f1f2f8;
	--text: #1e2030;
	--muted: #5f6480;
	--line: #e3e5ef;
	--accent: #5b3fd1;
	--accent-2: #00a3b4;
	--accent-soft: #ece8fc;
	--code-bg: #14162b;
	--code-text: #e6e8f5;
	--code-line: #262a4a;
	--k: #c792ea; --s: #c3e88d; --c: #697098; --n: #f78c6c; --f: #82aaff; --t: #ffcb6b; --o: #89ddff;
	--note: #e8f1ff; --note-line: #3b82f6;
	--warn: #fff5e0; --warn-line: #f59e0b;
	--tip: #e6f7ee; --tip-line: #10b981;
	--shadow: 0 1px 2px rgba(20, 22, 43, .06), 0 8px 24px rgba(20, 22, 43, .08);
	--radius: 12px;
	--side: 292px;
}
:root[data-theme="dark"] {
	--bg: #0f1020;
	--panel: #171935;
	--soft: #1d2042;
	--text: #e8eaf8;
	--muted: #a2a7cc;
	--line: #2a2e57;
	--accent: #9d86ff;
	--accent-2: #36d1e0;
	--accent-soft: #272256;
	--code-bg: #0a0b18;
	--code-line: #23274a;
	--note: #14233f; --warn: #33260d; --tip: #0e2c22;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font: 16px/1.7 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace;
  /* code is shown as it is written: != and >= must not turn into one sign */
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

/* ---- top bar */
.topbar {
	position: fixed; inset: 0 0 auto 0; height: 60px; z-index: 30;
	display: flex; align-items: center; gap: 16px; padding: 0 20px;
	background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .logo {
	width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
	background: linear-gradient(135deg, #5b3fd1, #00a3b4);
}
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 2px; }
.spacer { flex: 1; }
.search { position: relative; width: min(360px, 40vw); }
.search input {
	width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); color: var(--text);
	padding: 0 12px 0 36px; font: inherit; font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.results {
	position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
	border-radius: 12px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; display: none;
}
.results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.results a:last-child { border: 0; }
.results a:hover, .results a.on { background: var(--accent-soft); text-decoration: none; }
.results b { display: block; font-size: 14px; }
.results span { color: var(--muted); font-size: 12.5px; }
.iconbtn {
	width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); color: var(--text);
	cursor: pointer; display: grid; place-items: center; font-size: 17px;
}
.iconbtn:hover { border-color: var(--accent); }
#menu { display: none; }

/* ---- sidebar */
.sidebar {
	position: fixed; top: 60px; bottom: 0; left: 0; width: var(--side); overflow-y: auto; padding: 20px 14px 40px;
	background: var(--panel); border-right: 1px solid var(--line);
}
.sidebar h4 { margin: 20px 10px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.sidebar h4:first-child { margin-top: 0; }
.sidebar a {
	display: block; padding: 6px 12px; border-radius: 8px; color: var(--text); font-size: 14.5px; line-height: 1.4; margin: 1px 0;
}
.sidebar a:hover { background: var(--soft); text-decoration: none; }
.sidebar a.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---- layout */
main { margin: 60px 0 0 var(--side); padding: 40px 32px 80px; display: flex; gap: 40px; justify-content: center; }
article { width: 100%; max-width: 860px; min-width: 0; }
.toc { width: 210px; flex: none; position: sticky; top: 100px; align-self: flex-start; max-height: calc(100vh - 130px); overflow: auto; font-size: 13.5px; }
.toc h5 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.toc a { display: block; color: var(--muted); padding: 3px 0 3px 12px; border-left: 2px solid var(--line); line-height: 1.4; }
.toc a.l3 { padding-left: 24px; font-size: 12.8px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 1280px) { .toc { display: none; } }
@media (max-width: 900px) {
	:root { --side: 0px; }
	.sidebar { transform: translateX(-100%); transition: transform .2s; width: 292px; z-index: 40; box-shadow: var(--shadow); }
	body.open .sidebar { transform: none; }
	#menu { display: grid; }
	main { padding: 28px 18px 60px; }
	.search { width: 46vw; }
	.brand small { display: none; }
}

/* ---- typography */
article h1 { font-size: 2.4rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
article .lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; }
article h2 { font-size: 1.65rem; margin: 52px 0 12px; letter-spacing: -.01em; padding-top: 6px; }
article h2::before { content: ""; display: block; height: 1px; background: var(--line); margin-bottom: 28px; }
article h2:first-of-type::before { display: none; }
article h3 { font-size: 1.2rem; margin: 32px 0 6px; }
article h4 { font-size: 1rem; margin: 22px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
article p { margin: 12px 0; }
article ul, article ol { padding-left: 24px; }
article li { margin: 5px 0; }
article hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
article :not(pre) > code {
	background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 6px; font-size: .88em;
}
.anchor { color: var(--line); margin-left: 6px; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ---- code */
.code { position: relative; margin: 18px 0; border-radius: var(--radius); background: var(--code-bg); border: 1px solid var(--code-line); box-shadow: var(--shadow); overflow: hidden; }
.code .bar {
	display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-bottom: 1px solid var(--code-line);
	font-size: 11.5px; color: #8b91bf; letter-spacing: .06em; text-transform: uppercase;
}
.code .dots { display: flex; gap: 6px; }
.code .dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f6b; display: block; }
.code .dots i:nth-child(1) { background: #ff5f57; } .code .dots i:nth-child(2) { background: #febc2e; } .code .dots i:nth-child(3) { background: #28c840; }
.code .copy { background: none; border: 1px solid #3a3f6b; color: #b4b9e0; border-radius: 6px; font: inherit; font-size: 11px; padding: 2px 8px; cursor: pointer; }
.code .copy:hover { color: #fff; border-color: #7f86c8; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--code-text); font-size: 13.6px; line-height: 1.6; tab-size: 4; }
.code .k { color: var(--k); } .code .s { color: var(--s); } .code .c { color: var(--c); font-style: italic; }
.code .n { color: var(--n); } .code .f { color: var(--f); } .code .t { color: var(--t); } .code .o { color: var(--o); }
.code.out .bar { color: #6fd6a0; }
.code.out pre { color: #b8f2d4; }
details.src { margin: 14px 0; }
details.src > summary {
	cursor: pointer; list-style: none; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; user-select: none;
}
details.src > summary::before { content: "▸ "; } details.src[open] > summary::before { content: "▾ "; }
details.src .code { margin-top: 6px; }

/* ---- callouts, tables */
.callout { margin: 20px 0; padding: 14px 18px; border-radius: 10px; border-left: 4px solid; }
.callout p:first-child { margin-top: 0; } .callout p:last-child { margin-bottom: 0; }
.callout.note { background: var(--note); border-color: var(--note-line); }
.callout.warn { background: var(--warn); border-color: var(--warn-line); }
.callout.tip { background: var(--tip); border-color: var(--tip-line); }
.callout .t { display: block; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.tablewrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* ---- figures and screenshots */
figure.shot { margin: 22px 0; text-align: center; }
figure.shot img { max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 16px 40px rgba(0,0,0,.18); cursor: zoom-in; background: #fff; }
figure.shot figcaption { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 22, .86); display: none; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox.on { display: grid; }

/* ---- landing */
.hero {
	margin: -8px 0 40px; padding: 44px 40px; border-radius: 20px; position: relative; overflow: hidden; color: #fff;
	background: radial-gradient(900px 400px at 100% 0, rgba(0,163,180,.55), transparent 60%), linear-gradient(135deg, #3b2a9c, #5b3fd1 55%, #7a5cf0);
	box-shadow: var(--shadow);
}
.hero h1 { color: #fff; font-size: 3rem; margin: 0; }
.hero p { color: rgba(255,255,255,.88); font-size: 1.2rem; max-width: 640px; margin: 12px 0 22px; }
.hero .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.btn.primary { background: #fff; color: #3b2a9c; } .btn.primary:hover { text-decoration: none; transform: translateY(-1px); }
.btn.ghost { border: 1px solid rgba(255,255,255,.5); color: #fff; } .btn.ghost:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 22px 0; }
.card {
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; color: var(--text);
	box-shadow: var(--shadow); transition: transform .12s, border-color .12s; display: block;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); margin-bottom: 10px; }
.card b { display: block; font-size: 16.5px; margin-bottom: 3px; }
.card span { color: var(--muted); font-size: 14px; line-height: 1.5; display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 26px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: center; }
.stat b { display: block; font-size: 28px; color: var(--accent); letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }

/* ---- galleries */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin: 22px 0; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.item .pic { background: linear-gradient(135deg, var(--soft), var(--accent-soft)); padding: 18px; display: grid; place-items: center; min-height: 200px; }
.item .pic img { max-width: 100%; max-height: 300px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 10px 24px rgba(0,0,0,.2); cursor: zoom-in; }
.item .info { padding: 14px 16px 16px; }
.item h3 { margin: 0 0 4px; font-size: 16px; }
.item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.item .run { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.item details { margin-top: 8px; }
.item details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.item .code { margin: 8px 0 0; box-shadow: none; }
.item .code pre { font-size: 12.3px; max-height: 360px; overflow: auto; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; }
.pager a { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--panel); color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.pager .next { text-align: right; }
footer.site { margin: 70px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
kbd { background: var(--soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: .85em; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; vertical-align: middle; }

/* ---- class reference */
details.cls { margin: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
details.cls > summary { cursor: pointer; padding: 11px 16px; list-style: none; font-size: 15.5px; user-select: none; }
details.cls > summary::before { content: "▸ "; color: var(--accent); } details.cls[open] > summary::before { content: "▾ "; }
details.cls[open] > summary { border-bottom: 1px solid var(--line); background: var(--soft); border-radius: var(--radius) var(--radius) 0 0; }
.muted { color: var(--muted); font-weight: 400; font-size: .88em; }
.clsbody { padding: 4px 16px 14px; }
.clsbody h4 { margin: 18px 0 6px; }
p.net { margin: 10px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 12px 0 22px; font-size: 13px; line-height: 1.7; }
.chips a { background: var(--soft); padding: 1px 8px; border-radius: 6px; color: var(--text); }
.chips a:hover { background: var(--accent-soft); text-decoration: none; }
table.api td, table.api th { padding: 6px 10px; font-size: 13.3px; }
table.api code { white-space: pre-wrap; word-break: break-word; }
.results small { font-weight: 400; color: var(--accent); margin-left: 6px; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
