/* =================================================================
   nua site — user guide
   Matches the nuasite.com design language:
   Inter · white surfaces · electric blue · soft rounded cards
   ================================================================= */

:root {
	--font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

	--bg: #ffffff;
	--bg-paper: #fafafa;
	--bg-soft: #f7f7f8;
	--border: #f0f0f1;
	--border-strong: #e4e4e7;

	--text-primary: #0a0a0a;
	--text-secondary: #525252;
	--text-tertiary: #a3a3a3;

	--brand: #005ae0;
	--brand-hover: #0048b8;
	--brand-light: #eef2ff;

	--zinc-50: #fafafa;
	--zinc-100: #f4f4f5;
	--zinc-200: #e4e4e7;
	--zinc-400: #a1a1aa;
	--zinc-500: #71717a;
	--zinc-600: #52525b;
	--zinc-700: #3f3f46;
	--zinc-800: #27272a;
	--zinc-900: #18181b;
	--zinc-950: #09090b;

	--radius-card: 1.25rem;
	--radius-btn: 0.75rem;

	--sidebar-w: 290px;
	--topbar-h: 72px;
	--measure: 50rem;

	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-sans);
	color: var(--text-primary);
	background: var(--bg);
	font-size: 16px;
	line-height: 1.6;
	letter-spacing: -0.011em;
	font-feature-settings: 'cv11', 'ss01';
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
	letter-spacing: -0.035em;
	line-height: 1.12;
	font-feature-settings: 'cv11', 'ss01';
}

a {
	color: var(--brand);
	text-decoration: none;
}

::selection {
	background: rgba(0, 90, 224, 0.15);
	color: var(--zinc-950);
}

/* Shared brand bits */
.text-gradient {
	background: linear-gradient(120deg, #005ae0 0%, #2563eb 55%, #3b82f6 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.eyebrow {
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--brand);
	margin: 0 0 1rem;
}

.btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.25rem;
	border-radius: var(--radius-btn);
	background: var(--brand);
	color: #fff !important;
	font-weight: 600;
	font-size: 0.9375rem;
	letter-spacing: -0.01em;
	border: 1px solid var(--brand);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px -6px rgba(0, 90, 224, 0.35);
	transition: background 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-primary:hover {
	background: var(--brand-hover);
	border-color: var(--brand-hover);
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 14px 32px -6px rgba(0, 90, 224, 0.42);
	text-decoration: none;
}
.btn-primary:active {
	transform: translateY(0) scale(0.99);
}

.btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.25rem;
	border-radius: var(--radius-btn);
	background: #fff;
	border: 1px solid var(--border-strong);
	color: var(--text-primary) !important;
	font-weight: 600;
	font-size: 0.9375rem;
	transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn-secondary:hover {
	border-color: var(--zinc-300, #d4d4d8);
	background: var(--bg-paper);
	transform: translateY(-1px);
	text-decoration: none;
}

/* =================================================================
   Topbar
   ================================================================= */
.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(12px) saturate(160%);
	border-bottom: 1px solid var(--border);
}
.topbar-inner {
	height: var(--topbar-h);
	max-width: 90rem;
	margin: 0 auto;
	padding: 0 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: var(--brand);
}
.brand:hover {
	opacity: 0.85;
	text-decoration: none;
}
.brand-logo {
	height: 22px;
	width: auto;
	display: block;
	color: #0066ff;
}
.brand-tag {
	font-size: 12px;
	font-weight: 600;
	color: var(--text-tertiary);
	padding-left: 11px;
	border-left: 1px solid var(--border-strong);
	letter-spacing: 0;
}
.topbar-nav {
	display: flex;
	align-items: center;
	gap: 22px;
}
.topbar-link {
	font-size: 14px;
	font-weight: 500;
	color: var(--zinc-600);
	transition: color 0.15s var(--ease);
}
.topbar-link:hover {
	color: var(--text-primary);
	text-decoration: none;
}
.topbar .btn-primary {
	padding: 0.55rem 1.05rem;
	font-size: 14px;
}

/* =================================================================
   Shell
   ================================================================= */
.shell {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	max-width: 90rem;
	margin: 0 auto;
}

/* =================================================================
   Sidebar
   ================================================================= */
.sidebar {
	position: sticky;
	top: var(--topbar-h);
	align-self: start;
	height: calc(100vh - var(--topbar-h));
	overflow-y: auto;
	padding: 32px 18px 80px;
	border-right: 1px solid var(--border);
	scrollbar-width: thin;
	scrollbar-color: var(--zinc-200) transparent;
}
.sidebar::-webkit-scrollbar {
	width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
	background: var(--zinc-200);
	border-radius: 8px;
}
.sidebar-group {
	margin-bottom: 26px;
}
.sidebar-group-title {
	margin: 0 0 8px;
	padding: 0 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-tertiary);
}
.sidebar-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sidebar-link {
	display: block;
	padding: 7px 12px;
	border-radius: 9px;
	color: var(--zinc-700);
	font-size: 14px;
	font-weight: 500;
	transition: color 0.13s var(--ease), background 0.13s var(--ease);
}
.sidebar-link:hover {
	background: var(--bg-soft);
	color: var(--text-primary);
	text-decoration: none;
}
.sidebar-link.active {
	background: var(--brand-light);
	color: var(--brand);
	font-weight: 600;
}

/* =================================================================
   Content
   ================================================================= */
.content {
	padding: 56px 64px 40px;
	min-width: 0;
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	max-width: var(--measure);
	padding-bottom: 8px;
	margin-bottom: 56px;
}
.hero-swoosh {
	position: absolute;
	top: -120px;
	left: -160px;
	width: 620px;
	height: 460px;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.16;
	pointer-events: none;
	z-index: -1;
	background: radial-gradient(circle at 50% 50%, #005ae0, #2563eb, #60a5fa, transparent 72%);
}
.hero-title {
	font-size: clamp(2.4rem, 4.4vw, 3.6rem);
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1.04;
	margin: 0 0 22px;
}
.hero-lead {
	font-size: 1.18rem;
	line-height: 1.6;
	color: var(--text-secondary);
	max-width: 40ch;
	margin: 0 0 30px;
}
.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* ---------- Card grid ---------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 18px;
}
.card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: var(--radius-card);
	padding: 24px 22px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 32px -10px rgba(0, 0, 0, 0.08);
	transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.card:hover {
	transform: translateY(-3px);
	border-color: rgba(0, 90, 224, 0.25);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 20px 44px -16px rgba(0, 90, 224, 0.28);
}
.card h2 {
	font-size: 1.2rem;
	font-weight: 650;
	margin: 0 0 7px;
}
.card-summary {
	color: var(--text-secondary);
	font-size: 14.5px;
	line-height: 1.55;
	margin: 0 0 16px;
}
.card-links {
	list-style: none;
	margin: 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--border);
}
.card-links li {
	margin: 1px 0;
}
.card-links a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 6px 8px;
	margin: 0 -8px;
	border-radius: 8px;
	color: var(--zinc-700);
	font-size: 14px;
	font-weight: 500;
	transition: background 0.13s var(--ease), color 0.13s var(--ease);
}
.card-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--zinc-300, #d4d4d8);
	flex: none;
	transition: background 0.13s var(--ease);
}
.card-link-label {
	flex: 1;
}
.card-link-arrow {
	opacity: 0;
	transform: translateX(-4px);
	color: var(--brand);
	transition: opacity 0.13s var(--ease), transform 0.13s var(--ease);
}
.card-links a:hover {
	background: var(--bg-soft);
	color: var(--text-primary);
	text-decoration: none;
}
.card-links a:hover .card-dot {
	background: var(--brand);
}
.card-links a:hover .card-link-arrow {
	opacity: 1;
	transform: translateX(0);
}

/* =================================================================
   Document page
   ================================================================= */
.doc {
	max-width: var(--measure);
}
.doc-eyebrow {
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--brand);
	margin-bottom: 12px;
	text-transform: capitalize;
}
.doc h1 {
	font-size: clamp(2rem, 3.6vw, 2.9rem);
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1.05;
	margin: 0 0 16px;
}
.doc-lead {
	font-size: 1.2rem;
	line-height: 1.55;
	color: var(--text-secondary);
	margin: 0 0 24px;
}
.doc-divider {
	border: none;
	border-top: 1px solid var(--border-strong);
	margin: 0 0 36px;
}

/* Markdown body */
.doc-body {
	font-size: 1rem;
	color: var(--zinc-800);
}
.doc-body h2 {
	font-size: 1.55rem;
	font-weight: 680;
	letter-spacing: -0.03em;
	margin: 44px 0 14px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
}
.doc-body h3 {
	font-size: 1.2rem;
	font-weight: 650;
	letter-spacing: -0.02em;
	margin: 30px 0 10px;
}
.doc-body p,
.doc-body li {
	color: var(--zinc-700);
}
.doc-body a {
	color: var(--brand);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: rgba(0, 90, 224, 0.35);
	text-decoration-thickness: 1px;
}
.doc-body a:hover {
	color: var(--brand-hover);
	text-decoration-color: var(--brand-hover);
}
.doc-body strong {
	font-weight: 650;
	color: var(--text-primary);
}
.doc-body ul,
.doc-body ol {
	padding-left: 20px;
}
.doc-body li {
	margin: 6px 0;
}
.doc-body li::marker {
	color: var(--zinc-400);
}
.doc-body img {
	max-width: 100%;
	border: 1px solid var(--border-strong);
	border-radius: 12px;
}
.doc-body video {
	display: block;
	width: 100%;
	margin: 22px 0;
	border: 1px solid var(--border-strong);
	border-radius: 14px;
	background: #0a0a0a;
	box-shadow: 0 18px 50px -24px rgba(9, 9, 11, 0.5);
}
.doc-body figure.tutorial-video {
	position: relative;
	margin: 26px 0;
}
.doc-body figure.tutorial-video video {
	margin: 0;
	background: var(--bg-soft);
}
/* Clean poster with a single play button — no native control bar over the
   poster. Controls are switched on (via a small script) once it starts. */
.doc-body .tutorial-play {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	aspect-ratio: 1440 / 900;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	border-radius: 14px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.doc-body .tutorial-play::before {
	content: '';
	width: 74px;
	height: 74px;
	border-radius: 999px;
	background-color: rgba(0, 90, 224, 0.94);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 54% center;
	background-size: 30px;
	box-shadow: 0 10px 34px -6px rgba(0, 90, 224, 0.65);
	transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}
.doc-body .tutorial-play:hover::before {
	transform: scale(1.07);
	background-color: var(--brand);
}
.doc-body figure.tutorial-video.is-playing .tutorial-play {
	display: none;
}
.doc-body figure.tutorial-video figcaption {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-top: 11px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--text-secondary);
}
.doc-body figure.tutorial-video figcaption::before {
	content: '▶';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding-left: 2px;
	font-size: 9px;
	color: #fff;
	background: var(--brand);
	border-radius: 999px;
	box-shadow: 0 2px 8px -2px rgba(0, 90, 224, 0.6);
}

/* Code */
.doc-body code {
	font-family: var(--font-mono);
	font-size: 0.85em;
	background: var(--bg-soft);
	border: 1px solid var(--border-strong);
	padding: 1.5px 6px;
	border-radius: 6px;
	color: var(--zinc-800);
}
.doc-body pre {
	background: var(--zinc-950);
	color: #e4e4e7;
	padding: 18px 20px;
	border-radius: 14px;
	overflow-x: auto;
	font-size: 0.86rem;
	line-height: 1.6;
	margin: 22px 0;
	box-shadow: 0 18px 40px -22px rgba(9, 9, 11, 0.55);
}
.doc-body pre code {
	background: none;
	border: none;
	padding: 0;
	color: inherit;
	font-size: inherit;
}

/* Callouts */
.doc-body blockquote {
	margin: 22px 0;
	padding: 14px 18px;
	background: var(--brand-light);
	border: 1px solid rgba(0, 90, 224, 0.14);
	border-left: 3px solid var(--brand);
	border-radius: 12px;
	color: #243056;
}
.doc-body blockquote p {
	margin: 5px 0;
	color: inherit;
}
.doc-body blockquote strong:first-child {
	color: var(--brand-hover);
}

/* Tables */
.doc-body table {
	width: 100%;
	border-collapse: collapse;
	margin: 22px 0;
	font-size: 0.92rem;
	border: 1px solid var(--border-strong);
	border-radius: 12px;
	overflow: hidden;
}
.doc-body thead th {
	background: var(--bg-soft);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--zinc-600);
	text-align: left;
	padding: 11px 14px;
	border-bottom: 1px solid var(--border-strong);
}
.doc-body tbody td {
	padding: 11px 14px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}
.doc-body tbody tr:last-child td {
	border-bottom: none;
}
.doc-body tbody tr:hover {
	background: var(--bg-paper);
}
.doc-body hr {
	border: none;
	border-top: 1px solid var(--border);
	margin: 40px 0;
}

/* =================================================================
   Footer
   ================================================================= */
.site-foot {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	max-width: var(--measure);
	margin-top: 72px;
	padding-top: 22px;
	border-top: 1px solid var(--border);
	font-size: 13px;
	color: var(--text-tertiary);
}
.foot-logo {
	height: 16px;
	width: auto;
	color: var(--zinc-400);
}
.site-foot a {
	margin-left: auto;
	color: var(--zinc-500);
	font-weight: 500;
}
.site-foot a:hover {
	color: var(--brand);
	text-decoration: none;
}

/* =================================================================
   Motion (subtle)
   ================================================================= */
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.hero > *:not(.hero-swoosh),
.card,
.doc > * {
	animation: rise 0.6s var(--ease) both;
}
.hero .eyebrow {
	animation-delay: 0.02s;
}
.hero-title {
	animation-delay: 0.08s;
}
.hero-lead {
	animation-delay: 0.16s;
}
.hero-actions {
	animation-delay: 0.24s;
}
.card:nth-child(1) {
	animation-delay: 0.28s;
}
.card:nth-child(2) {
	animation-delay: 0.34s;
}
.card:nth-child(3) {
	animation-delay: 0.4s;
}
.card:nth-child(4) {
	animation-delay: 0.46s;
}
.card:nth-child(5) {
	animation-delay: 0.52s;
}
.card:nth-child(6) {
	animation-delay: 0.58s;
}
.card:nth-child(7) {
	animation-delay: 0.64s;
}
.doc h1 {
	animation-delay: 0.06s;
}
.doc-lead {
	animation-delay: 0.14s;
}
.doc-divider {
	animation-delay: 0.2s;
}
.doc-body {
	animation-delay: 0.26s;
}

/* =================================================================
   Search — ⌘K trigger + modal
   ================================================================= */
.search-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 10px 0 12px;
	font-family: var(--font-sans);
	font-size: 13.5px;
	color: var(--zinc-500);
	background: var(--bg-soft);
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.search-trigger:hover {
	border-color: #d4d4d8;
	background: #fff;
	color: var(--text-primary);
}
.search-trigger-icon {
	color: var(--zinc-400);
}
.search-trigger-label {
	font-weight: 500;
}
.search-trigger-kbd {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--zinc-500);
	background: #fff;
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	padding: 1px 6px;
	line-height: 1.4;
}

.search-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 12vh 20px 20px;
	background: rgba(10, 10, 14, 0.42);
	backdrop-filter: blur(4px);
	animation: fade 0.16s var(--ease);
}
.search-overlay[hidden] {
	display: none;
}
@keyframes fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.search-modal {
	width: 100%;
	max-width: 580px;
	background: #fff;
	border: 1px solid var(--border-strong);
	border-radius: 16px;
	box-shadow: 0 24px 64px -16px rgba(9, 9, 11, 0.4), 0 8px 20px -12px rgba(9, 9, 11, 0.3);
	overflow: hidden;
	animation: pop 0.18s var(--ease);
}
@keyframes pop {
	from {
		opacity: 0;
		transform: translateY(-8px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.search-input-row {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 0 16px;
	border-bottom: 1px solid var(--border);
}
.search-input-icon {
	color: var(--zinc-400);
	flex: none;
}
#search-input {
	flex: 1;
	border: none;
	outline: none;
	background: none;
	font-family: var(--font-sans);
	font-size: 1.05rem;
	color: var(--text-primary);
	padding: 17px 0;
	letter-spacing: -0.01em;
}
#search-input::placeholder {
	color: var(--zinc-400);
}
#search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}
.search-input-esc {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--zinc-500);
	background: var(--bg-soft);
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	padding: 2px 7px;
	flex: none;
}
.search-results {
	max-height: 56vh;
	overflow-y: auto;
	padding: 8px;
	scrollbar-width: thin;
	scrollbar-color: var(--zinc-200) transparent;
}
.search-hint {
	color: var(--zinc-400);
	font-size: 14px;
	text-align: center;
	padding: 28px 16px;
	margin: 0;
}
.search-result {
	display: block;
	padding: 11px 14px;
	border-radius: 10px;
	color: var(--text-primary);
	border: 1px solid transparent;
}
.search-result:hover {
	text-decoration: none;
}
.search-result.is-active {
	background: var(--brand-light);
	border-color: rgba(0, 90, 224, 0.14);
}
.search-result-title {
	display: block;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-bottom: 2px;
}
.search-result.is-active .search-result-title {
	color: var(--brand);
}
.search-result-excerpt {
	display: block;
	font-size: 13px;
	line-height: 1.5;
	color: var(--zinc-500);
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.search-result-excerpt mark {
	background: rgba(0, 90, 224, 0.16);
	color: inherit;
	border-radius: 3px;
	padding: 0 1px;
	font-weight: 600;
}
.search-foot {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 16px;
	border-top: 1px solid var(--border);
	background: var(--bg-paper);
	font-size: 11.5px;
	color: var(--zinc-500);
}
.search-foot kbd {
	font-family: var(--font-mono);
	font-size: 10.5px;
	background: #fff;
	border: 1px solid var(--border-strong);
	border-radius: 5px;
	padding: 1px 5px;
	margin-right: 2px;
}
.search-foot-by {
	margin-left: auto;
	color: var(--zinc-400);
}

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 900px) {
	.shell {
		grid-template-columns: 1fr;
	}
	.sidebar {
		position: static;
		height: auto;
		border-right: none;
		border-bottom: 1px solid var(--border);
	}
	.content {
		padding: 36px 22px 40px;
	}
}

@media (max-width: 620px) {
	.search-trigger-label,
	.search-trigger-kbd {
		display: none;
	}
	.search-trigger {
		padding: 0 9px;
	}
	.topbar-nav {
		gap: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		scroll-behavior: auto;
	}
}
