/* ==========================================================================
   AI Native Digest — Docs theme
   Stripe-docs-inspired, light mode only.
   ========================================================================== */

:root {
	--aind-bg: #ffffff;
	--aind-sidebar-bg: #f6f9fc;
	--aind-border: #e3e8ee;
	--aind-text: #1a1f36;
	--aind-text-muted: #697386;
	--aind-accent: #635bff;
	--aind-accent-bg: #f5f4ff;
	--aind-header-h: 56px;
	--aind-sidebar-w: 280px;
	--aind-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--aind-font);
	color: var(--aind-text);
	background: var(--aind-bg);
	font-size: 16px;
	line-height: 1.6;
}

a { color: var(--aind-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------------- Header ---------------- */

.aind-header {
	position: sticky;
	top: 0;
	z-index: 40;
	height: var(--aind-header-h);
	background: var(--aind-bg);
	border-bottom: 1px solid var(--aind-border);
}

.aind-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	height: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 20px;
}

.aind-logo {
	font-weight: 600;
	font-size: 16px;
	color: var(--aind-text);
}
.aind-logo:hover { text-decoration: none; color: var(--aind-accent); }

.aind-primary-nav {
	margin-left: auto;
}
.aind-primary-nav-list {
	display: flex;
	align-items: center;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.aind-primary-nav-list a {
	font-size: 14px;
	font-weight: 500;
	color: var(--aind-text-muted);
}
.aind-primary-nav-list a:hover {
	color: var(--aind-accent);
	text-decoration: none;
}

.aind-sidebar-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 32px;
	height: 32px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
}
.aind-sidebar-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--aind-text);
	border-radius: 2px;
}

/* ---------------- Docs shell layout ---------------- */

.aind-docs-shell {
	display: flex;
	max-width: 1200px;
	margin: 0 auto;
	align-items: flex-start;
}

.aind-sidebar {
	width: var(--aind-sidebar-w);
	flex: 0 0 var(--aind-sidebar-w);
	position: sticky;
	top: var(--aind-header-h);
	height: calc(100vh - var(--aind-header-h));
	overflow-y: auto;
	background: var(--aind-sidebar-bg);
	border-right: 1px solid var(--aind-border);
	padding: 20px 12px 40px;
}

.aind-docs-content {
	flex: 1 1 auto;
	min-width: 0;
	padding: 40px 40px 80px;
}

.aind-plain-content {
	max-width: 760px;
	margin: 0 auto;
	padding: 60px 20px 100px;
}

/* ---------------- Breadcrumb ---------------- */

.aind-breadcrumb {
	font-size: 13px;
	color: var(--aind-text-muted);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}
.aind-breadcrumb a { color: var(--aind-text-muted); }
.aind-breadcrumb a:hover { color: var(--aind-accent); text-decoration: none; }
.aind-breadcrumb-sep { color: #c7d0e0; }
.aind-breadcrumb-current { color: var(--aind-text); font-weight: 500; }

/* ---------------- Page toolbar (copy / download) ---------------- */

.aind-page-toolbar {
	display: flex;
	gap: 8px;
	margin: 4px 0 28px;
	position: relative;
}

.aind-toolbar-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--aind-font);
	font-size: 13px;
	font-weight: 500;
	color: var(--aind-text);
	background: var(--aind-bg);
	border: 1px solid var(--aind-border);
	border-radius: 6px;
	padding: 6px 12px;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
}
.aind-toolbar-btn:hover {
	background: var(--aind-accent-bg);
	border-color: var(--aind-accent);
	color: var(--aind-accent);
}
.aind-toolbar-btn.is-copied {
	background: var(--aind-accent-bg);
	border-color: var(--aind-accent);
	color: var(--aind-accent);
}

.aind-toolbar-btn i { font-size: 13px; }
.aind-toolbar-chevron { font-size: 9px; margin-left: 2px; }

.aind-download-dropdown { position: relative; }

.aind-download-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 170px;
	background: var(--aind-bg);
	border: 1px solid var(--aind-border);
	border-radius: 8px;
	box-shadow: 0 8px 20px rgba(10, 37, 64, 0.12);
	z-index: 20;
	overflow: hidden;
}
.aind-download-option {
	display: block;
	width: 100%;
	text-align: left;
	font-family: var(--aind-font);
	font-size: 13px;
	color: var(--aind-text);
	background: var(--aind-bg);
	border: none;
	padding: 9px 14px;
	cursor: pointer;
}
.aind-download-option:hover {
	background: var(--aind-accent-bg);
	color: var(--aind-accent);
}

.aind-page-title {
	font-size: 32px;
	font-weight: 700;
	margin: 0 0 20px;
	line-height: 1.25;
	color: #0a2540;
}

.aind-quick-answer {
	background: var(--aind-accent-bg);
	border-left: 3px solid var(--aind-accent);
	border-radius: 8px;
	padding: 16px 20px 18px;
	margin: 0 0 32px;
	max-width: 760px;
}
.aind-quick-answer-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--aind-accent);
	margin-bottom: 8px;
}
.aind-quick-answer p {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: var(--aind-text);
}

.aind-page-body { max-width: 760px; }
.aind-page-body p { margin: 0 0 16px; }
.aind-page-body h2 { margin: 40px 0 16px; font-size: 22px; }
.aind-page-body h3 { margin: 28px 0 12px; font-size: 18px; }
.aind-page-body pre {
	background: #0a2540;
	color: #e3e8ee;
	padding: 16px 20px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 1.6;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.aind-page-body code {
	background: var(--aind-accent-bg);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.aind-page-body pre code {
	background: none;
	padding: 0;
	border-radius: 0;
	font-size: 1em;
	color: inherit;
	white-space: pre;
}

/* ---------------- Summary slideshow ---------------- */

.aind-summary-slides {
	max-width: 760px;
	margin: 0 0 36px;
}
.aind-summary-slides-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--aind-text-muted);
	margin-bottom: 12px;
}
.aind-summary-slides-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
}
.aind-summary-slide-card {
	margin: 0;
	border: 1px solid var(--aind-border);
	border-radius: 8px;
	overflow: hidden;
	background: var(--aind-bg);
}
.aind-summary-slide-open {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
}
.aind-summary-slide-open img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: var(--aind-sidebar-bg);
}
.aind-summary-slide-card:hover {
	border-color: var(--aind-accent);
}
.aind-summary-slide-card figcaption {
	padding: 8px 9px 10px;
	font-size: 11px;
	line-height: 1.35;
	color: var(--aind-text-muted);
	border-top: 1px solid var(--aind-border);
}

.aind-slideshow[hidden] { display: none !important; }
.aind-slideshow {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.aind-slideshow-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 37, 64, 0.55);
}
.aind-slideshow-dialog {
	position: relative;
	width: min(920px, 100%);
	background: var(--aind-bg);
	border: 1px solid var(--aind-border);
	border-radius: 12px;
	box-shadow: 0 24px 48px rgba(10, 37, 64, 0.22);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.aind-slideshow-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--aind-border);
}
.aind-slideshow-kicker {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--aind-accent);
}
.aind-slideshow-title {
	margin: 2px 0 0;
	font-size: 15px;
	font-weight: 600;
	color: #0a2540;
}
.aind-slideshow-close {
	width: 34px;
	height: 34px;
	border-radius: 6px;
	border: 1px solid var(--aind-border);
	background: var(--aind-bg);
	color: var(--aind-text);
	cursor: pointer;
}
.aind-slideshow-close:hover {
	background: var(--aind-accent-bg);
	border-color: var(--aind-accent);
	color: var(--aind-accent);
}
.aind-slideshow-stage {
	display: grid;
	grid-template-columns: 48px 1fr 48px;
	gap: 8px;
	align-items: center;
	padding: 18px 12px 16px;
}
.aind-slideshow-nav {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	border: 1px solid var(--aind-border);
	background: var(--aind-bg);
	color: var(--aind-text);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.aind-slideshow-nav:hover {
	background: var(--aind-accent-bg);
	border-color: var(--aind-accent);
	color: var(--aind-accent);
}
.aind-slideshow-nav:disabled {
	opacity: 0.35;
	cursor: default;
}
.aind-slide-frame {
	margin: 0;
	border: 1px solid var(--aind-border);
	border-radius: 10px;
	overflow: hidden;
	background: var(--aind-sidebar-bg);
}
.aind-slide-frame img {
	display: block;
	width: 100%;
	height: auto;
}
.aind-slideshow-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 18px 16px;
	border-top: 1px solid var(--aind-border);
}
.aind-slide-dots {
	display: flex;
	gap: 8px;
	align-items: center;
}
.aind-slide-dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	border: none;
	background: #c7d0e0;
	padding: 0;
	cursor: pointer;
}
.aind-slide-dot.is-active {
	background: var(--aind-accent);
	width: 18px;
}

.aind-slide-count {
	font-size: 13px;
	color: var(--aind-text-muted);
}

/* ---------------- Sidebar search ---------------- */

.aind-sidebar-search { margin-bottom: 16px; }
#aind-search-input {
	width: 100%;
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid var(--aind-border);
	border-radius: 6px;
	background: var(--aind-bg);
	color: var(--aind-text);
	font-family: var(--aind-font);
}
#aind-search-input:focus {
	outline: none;
	border-color: var(--aind-accent);
	box-shadow: 0 0 0 3px var(--aind-accent-bg);
}

/* ---------------- Sidebar tree ---------------- */

.aind-tree {
	list-style: none;
	margin: 0;
	padding: 0;
}
.aind-tree[data-depth="0"] { padding-bottom: 8px; }

.aind-tree-item { margin: 1px 0; }

.aind-tree-link {
	display: block;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 14px;
	color: var(--aind-text);
	line-height: 1.4;
}
.aind-tree-link:hover {
	background: var(--aind-accent-bg);
	text-decoration: none;
}

.aind-tree[data-depth="0"] > .aind-tree-item > .aind-tree-toggle > .aind-tree-link,
.aind-tree[data-depth="0"] > .aind-tree-item > .aind-tree-link {
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--aind-text-muted);
}

.aind-tree-item.is-current > .aind-tree-link,
.aind-tree-item.is-current > .aind-tree-toggle > .aind-tree-link {
	background: var(--aind-accent-bg);
	color: var(--aind-accent);
	font-weight: 600;
}

.aind-tree-toggle {
	display: flex;
	align-items: center;
	width: 100%;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	text-align: left;
	font-family: var(--aind-font);
}
.aind-tree-toggle .aind-tree-link { flex: 1 1 auto; }

.aind-tree-chevron {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-left: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}
.aind-tree-chevron::before {
	content: "";
	display: block;
	width: 0;
	height: 0;
	border-left: 5px solid var(--aind-text-muted);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
}
.aind-tree-item.is-open > .aind-tree-toggle .aind-tree-chevron { transform: rotate(90deg); }

.aind-tree-item > .aind-tree {
	display: none;
	margin-left: 14px;
	padding-left: 10px;
	border-left: 1px solid var(--aind-border);
}
.aind-tree-item.is-open > .aind-tree { display: block; }

.aind-tree-item.aind-search-hidden { display: none; }

/* ---------------- Knowledge hub ---------------- */

.aind-hub {
	max-width: 1100px;
	margin: 0 auto;
	padding: 60px 20px 100px;
}

.aind-hub-intro {
	text-align: center;
	margin-bottom: 32px;
}
.aind-hub-title {
	font-size: 40px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #0a2540;
}
.aind-hub-description {
	color: var(--aind-text-muted);
	font-size: 17px;
	max-width: 560px;
	margin: 0 auto;
}

.aind-hub-search {
	position: relative;
	max-width: 480px;
	margin: 0 auto 48px;
}
#aind-hub-search-input {
	width: 100%;
	padding: 14px 18px;
	font-size: 16px;
	border: 1px solid var(--aind-border);
	border-radius: 10px;
	background: var(--aind-bg);
	color: var(--aind-text);
	font-family: var(--aind-font);
	box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);
}
#aind-hub-search-input:focus {
	outline: none;
	border-color: var(--aind-accent);
	box-shadow: 0 0 0 4px var(--aind-accent-bg);
}

.aind-hub-search-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--aind-bg);
	border: 1px solid var(--aind-border);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(10, 37, 64, 0.12);
	max-height: 360px;
	overflow-y: auto;
	z-index: 30;
}
.aind-hub-search-result {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	color: var(--aind-text);
	border-bottom: 1px solid var(--aind-border);
}
.aind-hub-search-result:last-child { border-bottom: none; }
.aind-hub-search-result:hover {
	background: var(--aind-accent-bg);
	text-decoration: none;
}
.aind-hub-search-title { font-size: 14px; }
.aind-hub-search-meta {
	font-size: 12px;
	color: var(--aind-text-muted);
	flex: 0 0 auto;
}
.aind-hub-search-empty {
	padding: 16px;
	color: var(--aind-text-muted);
	font-size: 14px;
	text-align: center;
}

.aind-hub-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.aind-hub-card {
	border: 1px solid var(--aind-border);
	border-radius: 12px;
	padding: 20px;
	background: var(--aind-bg);
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.aind-hub-card:hover {
	box-shadow: 0 4px 16px rgba(10, 37, 64, 0.08);
	border-color: #c7d0e0;
}

.aind-hub-card-title {
	font-size: 17px;
	font-weight: 600;
	color: #0a2540;
	margin-bottom: 4px;
}
.aind-hub-card-title:hover { color: var(--aind-accent); text-decoration: none; }

.aind-hub-card-count {
	font-size: 12px;
	color: var(--aind-text-muted);
	margin-bottom: 14px;
}

.aind-hub-card-links {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	flex: 1 1 auto;
}
.aind-hub-card-links li { margin-bottom: 6px; }
.aind-hub-card-links a {
	font-size: 14px;
	color: var(--aind-text);
}
.aind-hub-card-links a:hover { color: var(--aind-accent); }

.aind-hub-card-more {
	font-size: 13px;
	font-weight: 600;
	color: var(--aind-accent);
	margin-top: auto;
}

@media (max-width: 900px) {
	.aind-hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.aind-hub-grid { grid-template-columns: 1fr; }
	.aind-hub-title { font-size: 30px; }
}

/* ---------------- Footer ---------------- */

.aind-footer {
	border-top: 1px solid var(--aind-border);
	padding: 24px 20px;
	margin-top: 40px;
}
.aind-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	color: var(--aind-text-muted);
	font-size: 13px;
}

/* ---------------- Mobile ---------------- */

.aind-sidebar-overlay {
	display: none;
}

@media (max-width: 768px) {
	.aind-sidebar-toggle { display: flex; }

	.aind-docs-shell { display: block; }

	.aind-sidebar {
		position: fixed;
		top: var(--aind-header-h);
		left: 0;
		height: calc(100vh - var(--aind-header-h));
		z-index: 50;
		transform: translateX(-100%);
		transition: transform 0.2s ease;
		box-shadow: 2px 0 12px rgba(10, 37, 64, 0.08);
	}
	.aind-sidebar.is-open {
		transform: translateX(0);
	}

	.aind-sidebar-overlay {
		display: block;
		position: fixed;
		inset: var(--aind-header-h) 0 0 0;
		background: rgba(10, 37, 64, 0.35);
		z-index: 45;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s ease;
	}
	.aind-sidebar-overlay.is-open {
		opacity: 1;
		pointer-events: auto;
	}

	.aind-docs-content { padding: 24px 20px 60px; }
	.aind-page-title { font-size: 26px; }
	.aind-summary-slides-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.aind-slideshow-stage { grid-template-columns: 36px 1fr 36px; }
}

/* ---------------- Footer ---------------- */

.aind-footer {
	background: #0a0e17;
	color: #9aa4b8;
	margin-top: 64px;
}
.aind-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 56px 20px 32px;
}
.aind-footer-top {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 40px;
}
.aind-footer-brand {
	max-width: 320px;
}
.aind-footer-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}
.aind-footer-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: #ffffff;
	color: #0a0e17;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
}
.aind-footer-logo strong {
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
}
.aind-footer-tagline {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #9aa4b8;
}
.aind-footer-col {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.aind-footer-col-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7488;
	margin-bottom: 4px;
}
.aind-footer-col a {
	font-size: 14px;
	color: #b9c1d1;
}
.aind-footer-col a:hover {
	color: #ffffff;
	text-decoration: none;
}
.aind-footer-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 13px;
	color: #6b7488;
	flex-wrap: wrap;
}
.aind-footer-bottom a {
	color: #9aa4b8;
}
.aind-footer-bottom a:hover {
	color: #ffffff;
	text-decoration: none;
}

@media (max-width: 720px) {
	.aind-footer-top {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.aind-footer-brand { max-width: none; }
}

/* ---------------- Homepage intro ---------------- */

.aind-intro {
	max-width: 760px;
	margin: 0 auto 48px;
	padding: 0 20px;
}
.aind-intro-title {
	font-size: 30px;
	font-weight: 700;
	margin: 0 0 12px;
	color: var(--aind-text);
}
.aind-intro-body {
	margin: 0;
	font-size: 16px;
	line-height: 1.7;
	color: var(--aind-text-muted);
}
