/* Featured Channels website: home, docs, API reference, privacy. Twitch-like palette, light and dark. */

:root {
	--bg: #0e0e10;
	--surface: #18181b;
	--raised: #1f1f23;
	--hover: #26262c;
	--border: #2f2f35;
	--text: #efeff1;
	--muted: #adadb8;
	--accent: #9147ff;
	--accent-hover: #772ce8;
	--accent-text: #ffffff;
	--accent-soft: rgba(145, 71, 255, .16);
	--live: #eb0400;
	--code-bg: #1f1f23;
	--radius: 6px;
	--radius-lg: 12px;
	--shadow: 0 8px 24px rgba(0, 0, 0, .35);
	--font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	color-scheme: dark;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) {
		--bg: #ffffff;
		--surface: #f7f7f8;
		--raised: #efeff1;
		--hover: #e6e6ea;
		--border: #dedee3;
		--text: #0e0e10;
		--muted: #53535f;
		--accent-soft: rgba(145, 71, 255, .1);
		--code-bg: #f2f2f4;
		--shadow: 0 8px 24px rgba(0, 0, 0, .08);
		color-scheme: light;
	}
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.6 var(--font);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h2 { margin: 0 0 .6em; font-size: 28px; }
h3 { margin: 1.6em 0 .5em; font-size: 18px; }
p { margin: 0 0 1em; }

code, kbd, pre { font-family: var(--mono); font-size: .9em; }
code { padding: .1em .35em; border-radius: 4px; background: var(--code-bg); }
pre { margin: 0 0 1.2em; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); }
pre code { padding: 0; background: none; }

.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }

/* Top bar */

.top {
	position: sticky;
	top: 0;
	z-index: 10;
	border-bottom: 1px solid var(--border);
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(10px);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--hover); color: var(--text); }
@media (max-width: 560px) {
	.brand span { display: none; }
	.top .wrap { gap: 8px; }
}

/* Buttons */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 0;
	border-radius: var(--radius);
	background: var(--raised);
	color: var(--text);
	font: 600 15px var(--font);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn svg { width: 18px; height: 18px; }

/* Home */

.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin: 0 0 16px; font-size: clamp(34px, 5vw, 52px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { max-width: 34em; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

/* A static mock of the panel, built from the same look as the extension. */
.demo {
	padding: 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.demo-head { padding: 4px 6px 12px; }
.demo-head strong { display: block; font-size: 17px; }
.demo-head span { color: var(--muted); font-size: 13px; }
.demo-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: var(--radius); }
.demo-row:hover { background: var(--hover); }
.demo-avatar { display: grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; }
.demo-avatar { overflow: hidden; }
.demo-avatar img { width: 100%; height: 100%; object-fit: cover; }
.demo-avatar.is-live { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--live); }
.demo-info { flex: 1; min-width: 0; line-height: 1.35; }
.demo-info b { display: block; font-size: 14px; }
.demo-info small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.demo-live { margin-left: 6px; padding: 0 4px; border-radius: 3px; background: var(--live); color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.demo-follow { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 30px; padding: 0 10px; border-radius: 15px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }
.demo-follow { text-decoration: none; }
.demo-follow svg { width: 14px; height: 14px; }
.demo-follow.is-following { background: var(--hover); color: var(--text); }
.demo-follow.is-following svg { color: var(--accent); fill: currentColor; }

.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section-lead { max-width: 44em; margin-bottom: 28px; color: var(--muted); font-size: 17px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.card-icon svg { width: 20px; height: 20px; }

.pro {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 24px;
	align-items: center;
	padding: 28px;
	border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
}
.pro ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.pro li { margin: 4px 0; }
@media (max-width: 720px) { .pro { grid-template-columns: 1fr; } }

.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 20px 20px 20px 64px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 20px; top: 18px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: 14px; }

/* Docs: sidebar + article */

.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 40px 0 80px; }
.toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc strong { display: block; margin: 0 0 6px; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.toc a { display: block; padding: 4px 10px; border-left: 2px solid var(--border); color: var(--muted); font-size: 14px; text-decoration: none; }
.toc a:hover, .toc a.is-current { border-left-color: var(--accent); color: var(--text); }
@media (max-width: 860px) {
	.docs { grid-template-columns: 1fr; gap: 24px; }
	.toc { position: static; max-height: none; }
}

.article h1 { margin: 0 0 12px; font-size: 36px; }
.article > p:first-of-type { color: var(--muted); font-size: 17px; }
.article section { padding-top: 28px; }
.article section + section { margin-top: 20px; border-top: 1px solid var(--border); }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 4px 0; }

.table { width: 100%; margin: 0 0 1.2em; border-collapse: collapse; font-size: 14px; }
.table-scroll { overflow-x: auto; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.table td:first-child { white-space: nowrap; }

.note { margin: 0 0 1.2em; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--accent-soft); }
.note.is-warn { border-left-color: #ffb31a; background: rgba(255, 179, 26, .12); }

/* API reference: Swagger UI sits on a light card in both themes, since its styles are light-only. */

.api-intro { padding: 40px 0 8px; }
.api-intro h1 { margin: 0 0 12px; font-size: 36px; }
.api-intro p { max-width: 50em; color: var(--muted); }
.swagger-shell { margin: 16px 0 80px; padding: 8px 0; border-radius: var(--radius-lg); background: #fff; color: #3b4151; box-shadow: var(--shadow); }
.swagger-shell .swagger-ui .topbar { display: none; }
.swagger-shell .swagger-ui .information-container { display: none; }
.swagger-fallback { padding: 24px; }

/* Footer */

.foot { padding: 32px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
