/* ============================================================
   Beatix Documentation — Stylesheet
   ============================================================ */

:root {
	--bg:           #0e0e0e;
	--bg-elev:      #131313;
	--bg-elev-2:    #1a1a1a;
	--surface:      #131313;
	--border:       #2a2a2a;
	--border-soft:  #222222;
	--text:         #f3f7fb;
	--text-dim:     #8ea2b8;
	--text-mute:    #5e7084;

	--accent:        #20d7e8;
	--accent-2:      #a78bfa;
	--accent-3:      #33d17a;
	--accent-warn:   #ffb020;
	--accent-danger: #ff5c7a;

	--tag-bg:     rgba(32, 215, 232, 0.10);
	--tag-border: rgba(32, 215, 232, 0.30);

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.65);

	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 16px;

	--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;

	--sidebar-w: 280px;
}

/* Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
}
body {
	margin: 0;
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--text);
	line-height: 1.65;
	font-size: 15px;
	-webkit-font-smoothing: antialiased;
}

/* Layout */
.layout {
	display: grid;
	grid-template-columns: var(--sidebar-w) 1fr;
	min-height: 100vh;
}

.sidebar {
	background: var(--bg-elev);
	border-right: 1px solid var(--border-soft);
	padding: 28px 22px;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 28px;
	text-decoration: none;
	color: var(--text);
}
.brand .logo {
	width: 36px;
	height: 36px;
	border-radius: 9px;
	object-fit: contain;
	flex-shrink: 0;
}
.brand .name {
	font-weight: 700;
	letter-spacing: 0.3px;
}
.brand .subname {
	display: block;
	font-size: 11px;
	color: var(--text-mute);
	text-transform: uppercase;
	letter-spacing: 1.4px;
	font-weight: 500;
	margin-top: 2px;
}

.nav-section {
	margin-bottom: 22px;
}
.nav-section-title {
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 1.4px;
	color: var(--text-mute);
	font-weight: 600;
	margin-bottom: 10px;
	padding-left: 4px;
}
.nav-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.nav-list a {
	display: block;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	color: var(--text-dim);
	text-decoration: none;
	font-size: 14px;
	transition: all 0.15s ease;
	border-left: 2px solid transparent;
}
.nav-list a:hover {
	background: var(--bg-elev-2);
	color: var(--text);
}
.nav-list a.active {
	background: var(--bg-elev-2);
	color: var(--accent);
	border-left-color: var(--accent);
	font-weight: 500;
}
.nav-list .nav-sub {
	margin-left: 12px;
	margin-top: 4px;
	border-left: 1px solid var(--border-soft);
	padding-left: 8px;
}
.nav-list .nav-sub a {
	font-size: 13px;
	padding: 5px 10px;
	color: var(--text-mute);
}
.nav-list .nav-sub a:hover {
	color: var(--text-dim);
}

/* Main content */
.main {
	padding: 48px 60px 96px;
	max-width: 1100px;
	width: 100%;
}

.breadcrumbs {
	font-size: 13px;
	color: var(--text-mute);
	margin-bottom: 18px;
}
.breadcrumbs a {
	color: var(--text-dim);
	text-decoration: none;
}
.breadcrumbs a:hover {
	color: var(--accent);
}
.breadcrumbs .sep {
	margin: 0 8px;
	opacity: 0.5;
}

h1,
h2,
h3,
h4 {
	color: var(--text);
	font-weight: 700;
	line-height: 1.25;
}
h1 {
	font-size: 36px;
	margin: 0 0 8px;
	background: linear-gradient(120deg, var(--text), var(--accent));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.subtitle {
	color: var(--text-dim);
	font-size: 17px;
	margin: 0 0 36px;
	max-width: 720px;
}
h2 {
	font-size: 24px;
	margin: 48px 0 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border-soft);
	display: flex;
	align-items: center;
	gap: 10px;
}
h2 .anchor-num {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--bg-elev-2);
	border: 1px solid var(--border);
	font-size: 13px;
	color: var(--accent);
	font-weight: 600;
}
h3 {
	font-size: 18px;
	margin: 32px 0 12px;
	color: var(--text);
}
h4 {
	font-size: 15px;
	margin: 20px 0 8px;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

p {
	margin: 0 0 14px;
	color: var(--text-dim);
}
strong {
	color: var(--text);
	font-weight: 600;
}
a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

/* Code */
code {
	font-family: var(--font-mono);
	font-size: 13px;
	background: var(--bg-elev-2);
	padding: 2px 6px;
	border-radius: 4px;
	color: var(--accent);
	border: 1px solid var(--border-soft);
}
pre {
	background: var(--bg);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	padding: 18px 20px;
	overflow-x: auto;
	margin: 16px 0;
	font-size: 13px;
	line-height: 1.6;
	position: relative;
}
pre code {
	background: transparent;
	border: none;
	padding: 0;
	color: var(--text);
	font-size: 13px;
}
pre .kw  { color: #c084fc; }
pre .ty  { color: #20d7e8; }
pre .str { color: #33d17a; }
pre .num { color: #ffb020; }
pre .com { color: #5e7084; font-style: italic; }
pre .fn  { color: #f0abfc; }

/* Cards */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	margin: 24px 0;
}
.card {
	background: var(--surface);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	padding: 20px;
	transition: all 0.2s ease;
	text-decoration: none;
	color: inherit;
	display: block;
}
.card:hover {
	border-color: var(--accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	text-decoration: none;
}
.card h3 {
	margin: 0 0 8px;
	color: var(--text);
	font-size: 16px;
}
.card p {
	margin: 0;
	color: var(--text-mute);
	font-size: 13px;
}
.card .card-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--bg-elev-2);
	display: grid;
	place-items: center;
	margin-bottom: 14px;
	font-size: 18px;
	color: var(--accent);
	border: 1px solid var(--border);
}

/* Tables */
.table-wrap {
	overflow-x: auto;
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	margin: 20px 0;
}
table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}
thead {
	background: var(--bg-elev-2);
}
th {
	text-align: left;
	padding: 12px 14px;
	font-weight: 600;
	color: var(--text);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	border-bottom: 1px solid var(--border);
}
td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border-soft);
	color: var(--text-dim);
	vertical-align: top;
}
tr:last-child td {
	border-bottom: none;
}
tr:hover td {
	background: rgba(32, 215, 232, 0.03);
}
td code {
	font-size: 12px;
}

/* Field cards (audio feature reference) */
.field {
	background: var(--surface);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	padding: 22px 24px;
	margin: 14px 0;
	position: relative;
}
.field-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}
.field-name {
	font-family: var(--font-mono);
	font-size: 16px;
	font-weight: 600;
	color: var(--accent);
}
.field-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.tag {
	display: inline-block;
	padding: 3px 9px;
	font-size: 11px;
	border-radius: 999px;
	background: var(--tag-bg);
	border: 1px solid var(--tag-border);
	color: var(--accent);
	font-weight: 500;
	letter-spacing: 0.3px;
}
.tag.violet {
	background: rgba(167, 139, 250, 0.10);
	border-color: rgba(167, 139, 250, 0.30);
	color: var(--accent-2);
}
.tag.green {
	background: rgba(51, 209, 122, 0.10);
	border-color: rgba(51, 209, 122, 0.30);
	color: var(--accent-3);
}
.tag.amber {
	background: rgba(255, 176, 32, 0.10);
	border-color: rgba(255, 176, 32, 0.30);
	color: var(--accent-warn);
}
.tag.red {
	background: rgba(255, 92, 122, 0.10);
	border-color: rgba(255, 92, 122, 0.30);
	color: var(--accent-danger);
}
.tag.muted {
	background: rgba(94, 112, 132, 0.12);
	border-color: rgba(94, 112, 132, 0.30);
	color: var(--text-mute);
}

.field-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px 24px;
	margin: 12px 0 16px;
	padding: 12px 16px;
	background: var(--bg-elev-2);
	border-radius: var(--radius-sm);
	font-size: 13px;
}
.field-meta dt {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--text-mute);
	font-weight: 600;
}
.field-meta dd {
	margin: 2px 0 0;
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 13px;
}
.field-body p:last-child { margin-bottom: 0; }
.field-body h5 {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--text-mute);
	margin: 16px 0 6px;
}
.field-body ul {
	margin: 4px 0 8px 0;
	padding-left: 22px;
}
.field-body li {
	color: var(--text-dim);
	margin-bottom: 4px;
}

/* Callouts */
.callout {
	border-left: 3px solid var(--accent);
	background: rgba(32, 215, 232, 0.05);
	padding: 14px 18px;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	margin: 18px 0;
}
.callout.warn {
	border-color: var(--accent-warn);
	background: rgba(255, 176, 32, 0.05);
}
.callout.danger {
	border-color: var(--accent-danger);
	background: rgba(255, 92, 122, 0.05);
}
.callout.success {
	border-color: var(--accent-3);
	background: rgba(51, 209, 122, 0.05);
}
.callout-title {
	font-weight: 600;
	color: var(--text);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	margin-bottom: 4px;
}
.callout p {
	margin: 0;
	color: var(--text-dim);
}

/* File reference */
.file-ref {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-mono);
	font-size: 12px;
	background: var(--bg-elev-2);
	border: 1px solid var(--border-soft);
	padding: 4px 10px;
	border-radius: 6px;
	color: var(--text-dim);
}
.file-ref::before {
	content: "📄";
	opacity: 0.5;
}

/* Hero */
.hero {
	background: linear-gradient(135deg, rgba(32, 215, 232, 0.07), rgba(167, 139, 250, 0.04));
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-lg);
	padding: 36px 40px;
	margin-bottom: 40px;
	position: relative;
	overflow: hidden;
}
.hero::before {
	content: "";
	position: absolute;
	top: -50%;
	right: -10%;
	width: 360px;
	height: 360px;
	background: radial-gradient(circle, rgba(32, 215, 232, 0.12), transparent 70%);
	pointer-events: none;
}
.hero h1 { margin-top: 0; }
.hero .stats {
	display: flex;
	gap: 32px;
	margin-top: 24px;
	flex-wrap: wrap;
}
.hero .stat .value {
	font-size: 28px;
	font-weight: 700;
	color: var(--accent);
	font-family: var(--font-mono);
}
.hero .stat .label {
	font-size: 12px;
	color: var(--text-mute);
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* Diagrams */
.diagram {
	background: var(--surface);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	padding: 24px;
	margin: 20px 0;
	overflow-x: auto;
}
.mermaid {
	background: transparent !important;
}

/* Two-column */
.two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin: 18px 0;
}
@media (max-width: 900px) {
	.two-col { grid-template-columns: 1fr; }
	.layout { grid-template-columns: 1fr; }
	.sidebar { position: relative; height: auto; }
	.main { padding: 32px 22px; }
}

/* Pipeline step blocks */
.steps {
	display: grid;
	gap: 14px;
	margin: 20px 0;
}
.step {
	background: var(--surface);
	border: 1px solid var(--border-soft);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-md);
	padding: 18px 22px;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 18px;
	align-items: start;
}
.step-num {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #0a0e1a;
	font-weight: 700;
	font-family: var(--font-mono);
}
.step h3 { margin: 0 0 6px; font-size: 15px; }
.step p  { margin: 0 0 8px; font-size: 13.5px; }
.step .step-meta {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-mute);
}

/* Badge inline */
.badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: 11px;
	border-radius: 4px;
	background: var(--bg-elev-2);
	color: var(--text-dim);
	border: 1px solid var(--border-soft);
	font-family: var(--font-mono);
	font-weight: 500;
}

/* Footer */
.docs-footer {
	margin-top: 64px;
	padding: 24px 0;
	border-top: 1px solid var(--border-soft);
	color: var(--text-mute);
	font-size: 13px;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}
.docs-footer a { color: var(--text-dim); }

/* ToC right rail */
.toc-rail {
	position: fixed;
	right: 24px;
	top: 80px;
	width: 220px;
	font-size: 12.5px;
	display: none;
}
@media (min-width: 1400px) {
	.toc-rail { display: block; }
	.main { margin-right: 240px; }
}
.toc-rail .toc-title {
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 1.2px;
	color: var(--text-mute);
	margin-bottom: 10px;
	font-weight: 600;
}
.toc-rail ul {
	list-style: none;
	padding: 0;
	margin: 0;
	border-left: 1px solid var(--border-soft);
}
.toc-rail li a {
	display: block;
	padding: 4px 12px;
	color: var(--text-mute);
	text-decoration: none;
	border-left: 2px solid transparent;
	margin-left: -1px;
}
.toc-rail li a:hover {
	color: var(--accent);
	border-left-color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-soft); }

/* Anchor scroll offset */
:target { scroll-margin-top: 24px; }

/* Print */
@media print {
	.sidebar, .toc-rail { display: none; }
	.layout { grid-template-columns: 1fr; }
	body { background: white; color: black; }
}
