/**
 * Consepo chrome + Scalar theme overrides for /v1/docs.
 * Colors align with src/views/index.css so the API reference matches the app.
 */
:root {
	--color-white: #fff;
	--color-brand-blue: #3fc1d0;
	--color-brand-blue-light: #7ee9f5;
	--color-brand-blue-dark: #1b4475;
	--color-brand-magenta: #c900ae;
	--color-brand-magenta-light: #f24cde;
	--font-family-brand: "mozaic-geo-variable", ui-sans-serif, system-ui, sans-serif;
	--font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
		"Liberation Mono", monospace;
	--font-weight-medium: 450;
	--font-weight-bold: 700;
	--cf-bg: oklch(0.145 0.015 260);
	--cf-fg: oklch(0.985 0 0);
	--cf-card: oklch(0.19 0.015 260);
	--cf-muted-bg: oklch(0.27 0.015 260);
	--cf-border: oklch(1 0 0 / 10%);
	--cf-muted: oklch(0.65 0.01 250);
}

/**
 * Scalar theme variable overrides.
 * Scalar scopes its palette under .light-mode / .dark-mode, so we mirror that
 * — higher specificity than :root — to actually override the defaults.
 * See: https://scalar.com/products/api-references/themes
 */
.light-mode,
.dark-mode {
	--scalar-font: var(--font-family-brand);
	--scalar-font-code: var(--font-family-mono);

	--scalar-radius: 0.5rem;
	--scalar-radius-lg: 0.625rem;
	--scalar-radius-xl: 0.75rem;

	--scalar-color-accent: var(--color-brand-blue);
	--scalar-link-color: var(--color-brand-blue);
	--scalar-link-color-hover: var(--color-brand-blue-light);

	--scalar-button-1: var(--color-brand-blue);
	--scalar-button-1-hover: var(--color-brand-blue-light);
	--scalar-button-1-color: oklch(0.145 0.015 260);
}

.dark-mode {
	--scalar-background-1: var(--cf-bg);
	--scalar-background-2: var(--cf-card);
	--scalar-background-3: var(--cf-muted-bg);
	--scalar-background-accent: color-mix(in srgb, var(--color-brand-blue) 14%, transparent);

	--scalar-color-1: var(--cf-fg);
	--scalar-color-2: oklch(0.82 0.01 250);
	--scalar-color-3: var(--cf-muted);

	--scalar-border-color: var(--cf-border);

	--scalar-sidebar-background-1: var(--cf-card);
	--scalar-sidebar-color-1: var(--cf-fg);
	--scalar-sidebar-color-2: var(--cf-muted);
	--scalar-sidebar-border-color: var(--cf-border);
	--scalar-sidebar-item-hover-background: color-mix(in srgb, var(--color-brand-blue) 10%, transparent);
	--scalar-sidebar-item-hover-color: var(--color-brand-blue);
	--scalar-sidebar-item-active-background: color-mix(in srgb, var(--color-brand-blue) 14%, transparent);
	--scalar-sidebar-color-active: var(--color-brand-blue);
	--scalar-sidebar-search-background: var(--cf-bg);
	--scalar-sidebar-search-color: var(--cf-muted);
	--scalar-sidebar-search-border-color: var(--cf-border);
}

.light-mode {
	--scalar-background-1: #fff;
	--scalar-background-2: #f7f8fa;
	--scalar-background-3: #eef0f4;
	--scalar-background-accent: color-mix(in srgb, var(--color-brand-blue) 12%, transparent);

	--scalar-color-1: #111;
	--scalar-color-2: #4b5563;
	--scalar-color-3: #6b7280;

	--scalar-border-color: #e2e4ea;

	--scalar-sidebar-background-1: #f7f8fa;
	--scalar-sidebar-color-1: #111;
	--scalar-sidebar-color-2: #6b7280;
	--scalar-sidebar-border-color: #e2e4ea;
	--scalar-sidebar-item-hover-background: color-mix(in srgb, var(--color-brand-blue) 10%, transparent);
	--scalar-sidebar-item-hover-color: var(--color-brand-blue-dark);
	--scalar-sidebar-item-active-background: color-mix(in srgb, var(--color-brand-blue) 14%, transparent);
	--scalar-sidebar-color-active: var(--color-brand-blue-dark);
	--scalar-sidebar-search-background: #fff;
	--scalar-sidebar-search-color: #6b7280;
	--scalar-sidebar-search-border-color: #e2e4ea;
}

body.docs-chrome {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--font-family-brand);
	font-weight: var(--font-weight-medium);
	font-synthesis-weight: none;
	background: var(--cf-bg);
	color: var(--cf-fg);
}

.docs-chrome-header {
	flex-shrink: 0;
	position: sticky;
	top: 0;
	z-index: 40;
	border-bottom: 1px solid var(--cf-border);
	background: color-mix(in oklab, var(--cf-card) 30%, transparent);
	backdrop-filter: blur(8px);
}

.docs-chrome-header__inner {
	position: relative;
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 1.5rem;
	min-height: 3.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.docs-chrome-header__brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
}

.docs-chrome-header__brand img {
	display: block;
	height: 2rem;
	width: auto;
}

.docs-chrome-header__nav {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.875rem;
	font-weight: var(--font-weight-medium);
}

@media (min-width: 640px) {
	.docs-chrome-header__nav {
		gap: 0.5rem;
	}
}

.docs-chrome-header__nav a {
	color: var(--cf-muted);
	text-decoration: none;
	padding: 0.5rem 0.75rem;
	border-radius: 0.375rem;
	transition: color 0.2s ease;
}

.docs-chrome-header__nav a:hover,
.docs-chrome-header__nav a:focus-visible {
	color: var(--color-brand-blue);
}

.docs-chrome-header__nav a.is-accent {
	color: var(--color-brand-blue);
}

.docs-chrome-header__nav a.is-accent:hover,
.docs-chrome-header__nav a.is-accent:focus-visible {
	color: color-mix(in srgb, var(--color-brand-blue) 80%, transparent);
}

.docs-chrome-header__nav .is-hide-sm {
	display: none;
}

@media (min-width: 640px) {
	.docs-chrome-header__nav .is-hide-sm {
		display: inline-flex;
	}
}

/* Features/Tools dropdown triggers — mirror navigationMenuTriggerStyle. */
.docs-chrome-header__menu {
	position: static;
}

.docs-chrome-header__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2.25rem;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: 0.375rem;
	background: transparent;
	color: var(--cf-muted);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: var(--font-weight-medium);
	line-height: 1;
	cursor: pointer;
	transition: color 0.2s ease;
	font-synthesis-weight: none;
}

.docs-chrome-header__trigger:hover,
.docs-chrome-header__trigger:focus-visible,
.docs-chrome-header__trigger[aria-expanded="true"] {
	color: var(--color-brand-blue);
	outline: none;
}

.docs-chrome-header__chevron {
	position: relative;
	top: 1px;
	margin-left: 0.25rem;
	width: 0.75rem;
	height: 0.75rem;
	transition: transform 0.2s ease;
}

.docs-chrome-header__trigger[aria-expanded="true"] .docs-chrome-header__chevron {
	transform: rotate(180deg);
}

.docs-chrome-header__panel {
	position: absolute;
	left: 1.5rem;
	right: 1.5rem;
	top: 100%;
	z-index: 50;
	margin-top: 0.375rem;
	display: grid;
	gap: 0.75rem;
	padding: 1rem;
	border-radius: 0.75rem;
	border: 1px solid var(--cf-border);
	background: var(--cf-card);
	color: var(--cf-fg);
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
	animation: docs-chrome-panel-in 150ms ease-out;
}

@media (min-width: 768px) {
	.docs-chrome-header__panel {
		gap: 0.75rem;
		padding: 1.25rem;
	}
}

.docs-chrome-header__panel[hidden] {
	display: none;
}

.docs-chrome-header__panel--2 {
	grid-template-columns: 1fr;
}

.docs-chrome-header__panel--5 {
	grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
	.docs-chrome-header__panel--2 {
		grid-template-columns: repeat(2, 1fr);
	}
	.docs-chrome-header__panel--5 {
		grid-template-columns: repeat(5, 1fr);
	}
}

.docs-chrome-header__card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem;
	border-radius: 0.5rem;
	border: 1px solid transparent;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.docs-chrome-header__card:hover,
.docs-chrome-header__card:focus-visible {
	border-color: var(--cf-border);
	background: color-mix(in srgb, var(--cf-muted-bg) 50%, transparent);
	outline: none;
}

.docs-chrome-header__card-head {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

.docs-chrome-header__card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	flex-shrink: 0;
	border-radius: 0.375rem;
	border: 1px solid color-mix(in srgb, var(--card-accent, var(--color-brand-blue)) 20%, transparent);
	background: color-mix(in srgb, var(--card-accent, var(--color-brand-blue)) 10%, transparent);
	color: var(--card-accent, var(--color-brand-blue));
}

.docs-chrome-header__card-icon svg {
	width: 1rem;
	height: 1rem;
}

.docs-chrome-header__card-title {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--cf-fg);
}

.docs-chrome-header__card-desc {
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--cf-muted);
}

@keyframes docs-chrome-panel-in {
	from {
		opacity: 0;
		transform: scale(0.97);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Matches Button variant="outline" size="sm" (src/views/shared/components/ui/button.tsx):
   rounded-4xl → --radius-4xl (calc(0.625rem * 2.6) = 1.625rem). */
.docs-chrome-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2rem;
	padding: 0 0.75rem;
	border-radius: 1.625rem;
	border: 1px solid color-mix(in srgb, var(--color-brand-blue) 40%, transparent);
	background: var(--cf-bg);
	color: var(--cf-fg);
	font-size: 0.75rem;
	font-weight: var(--font-weight-medium);
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.docs-chrome-header__cta:hover,
.docs-chrome-header__cta:focus-visible {
	border-color: color-mix(in srgb, var(--color-brand-blue) 60%, transparent);
	background: color-mix(in srgb, var(--color-brand-blue) 10%, transparent);
	color: var(--cf-fg);
}

.docs-chrome-header__cta[hidden] {
	display: none;
}

#app {
	flex: 1 1 auto;
	min-height: 0;
}

/* --- SiteFooter-equivalent (see site-footer.tsx) --- */
.cf-site-footer {
	flex-shrink: 0;
	margin-top: auto;
	padding: 4rem 1.5rem;
}

@media (min-width: 768px) {
	.cf-site-footer {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.cf-site-footer__inner {
	max-width: 80rem;
	margin: 0 auto;
}

.cf-site-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 3rem;
}

@media (min-width: 1024px) {
	.cf-site-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: 6rem;
	}
}

.cf-site-footer__lead {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* Flex default stretch widens the <a>; pill ::before/::after use inset:0 → full-width bars */
.cf-site-footer__lead .lp-pill-button {
	align-self: flex-start;
}

.cf-site-footer__logo {
	width: 16rem;
	margin: 0;
}

.cf-site-footer__logo img {
	display: block;
	width: 100%;
	height: auto;
}

.cf-site-footer__slogan {
	margin: 0;
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	font-weight: 700;
	font-variation-settings: "wght" var(--font-weight-bold);
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-align: left;
	color: var(--cf-fg);
}

.cf-site-footer__blurb {
	margin: 0;
	max-width: 42rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--cf-muted);
}

.cf-text-accent {
	color: var(--color-brand-blue);
}

.cf-site-footer__columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	text-align: left;
}

@media (min-width: 640px) {
	.cf-site-footer__columns {
		grid-template-columns: repeat(3, 1fr);
	}
}

.cf-site-footer__col h3 {
	margin: 0 0 1rem;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--cf-fg);
}

.cf-site-footer__col ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: var(--cf-muted);
}

.cf-site-footer__col a {
	color: inherit;
	text-decoration: none;
}

.cf-site-footer__col a:hover,
.cf-site-footer__col a:focus-visible {
	color: var(--color-brand-blue);
}

.cf-site-footer__find-row {
	margin-top: 1rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--cf-muted);
}

.cf-site-footer__rooted {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	white-space: nowrap;
}

.cf-site-footer__ri {
	display: inline-block;
	width: auto;
	height: 1em;
	color: var(--color-brand-blue);
}

.cf-site-footer__rule {
	height: 1px;
	width: 100%;
	margin: 3rem 0;
	background: var(--cf-border);
	border: 0;
}

.cf-site-footer__legal {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.875rem;
	color: var(--cf-muted);
	text-align: center;
}

.cf-site-footer__legal p {
	margin: 0;
}

.cf-site-footer__legal-note {
	margin-top: 0.25rem;
}

/* Same as SiteFooter <Link> — legal row is outside __col, so it needs its own reset */
.cf-site-footer__legal-links a {
	color: var(--cf-muted);
	text-decoration: none;
	font-weight: inherit;
}

.cf-site-footer__legal-links a:hover,
.cf-site-footer__legal-links a:focus-visible {
	color: var(--color-brand-blue);
}

@media (min-width: 768px) {
	.cf-site-footer__legal {
		flex-direction: row;
		text-align: left;
	}
}

.cf-site-footer__legal-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5rem;
}

@media (min-width: 768px) {
	.cf-site-footer__legal-links {
		justify-content: flex-end;
	}
}

/* Linchpin pill — keep in sync with src/views/index.css */
.lp-pill-button {
	--lp-pill-bg: rgba(255, 255, 255, 1);
	--lp-pill-text: var(--color-brand-blue-dark);
	--lp-pill-shadow-a: var(--color-brand-blue);
	--lp-pill-shadow-b: var(--color-brand-magenta);
	--lp-pill-radius: 50px;
	--lp-pill-offset: 4px;
	--lp-pill-cursor-x: 50%;
	--lp-pill-cursor-y: 50%;
	--lp-pill-fill-opacity: 0;
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--lp-pill-text);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--font-family-brand);
	font-size: 0.9375rem;
	font-style: normal;
	font-variation-settings: "wght" var(--font-weight-medium);
	justify-content: center;
	padding: 0;
	position: relative;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.2s ease;
	white-space: nowrap;
}

.lp-pill-button::before {
	background: var(--lp-pill-shadow-b);
	border-radius: var(--lp-pill-radius);
	content: "";
	inset: 0;
	opacity: 1;
	pointer-events: none;
	position: absolute;
	transform: translate(var(--lp-pill-offset), var(--lp-pill-offset));
	transition: transform 0.2s ease;
	z-index: 0;
}

.lp-pill-button::after {
	background: var(--lp-pill-shadow-a);
	border-radius: var(--lp-pill-radius);
	content: "";
	inset: 0;
	opacity: 1;
	pointer-events: none;
	position: absolute;
	transform: translate(
		calc(var(--lp-pill-offset) * -1),
		calc(var(--lp-pill-offset) * -1)
	);
	transition: transform 0.2s ease;
	z-index: 1;
}

.lp-pill-button .lp-pill-button__face {
	align-items: center;
	background:
		radial-gradient(
			circle at var(--lp-pill-cursor-x) var(--lp-pill-cursor-y),
			rgba(63, 193, 208, calc(0.06 + (var(--lp-pill-fill-opacity) * 0.3))),
			rgba(63, 193, 208, 0) 42%
		),
		radial-gradient(
			circle at calc(var(--lp-pill-cursor-x) + 18%)
				calc(var(--lp-pill-cursor-y) - 24%),
			rgba(201, 0, 174, calc(0.04 + (var(--lp-pill-fill-opacity) * 0.22))),
			rgba(201, 0, 174, 0) 46%
		),
		radial-gradient(
			circle at calc(var(--lp-pill-cursor-x) - 28%)
				calc(var(--lp-pill-cursor-y) + 30%),
			rgba(27, 68, 117, calc(0.04 + (var(--lp-pill-fill-opacity) * 0.2))),
			rgba(27, 68, 117, 0) 52%
		),
		linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.96));
	border-radius: var(--lp-pill-radius);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	display: inline-flex;
	gap: 4px;
	justify-content: center;
	line-height: 24px;
	min-height: 2.75rem;
	padding: 4px 20px;
	position: relative;
	transition:
		background-position 0.14s ease-out,
		filter 0.2s ease,
		box-shadow 0.2s ease;
	will-change: background-position;
	z-index: 2;
}

.lp-pill-button .lp-pill-button__text {
	border: 0;
	position: relative;
	z-index: 3;
}

.lp-pill-button:hover,
.lp-pill-button:focus-visible {
	color: var(--color-white);
}

.lp-pill-button:hover .lp-pill-button__face,
.lp-pill-button:focus-visible .lp-pill-button__face {
	background:
		radial-gradient(
			circle at var(--lp-pill-cursor-x) var(--lp-pill-cursor-y),
			rgba(63, 193, 208, calc(0.14 + (var(--lp-pill-fill-opacity) * 0.34))),
			rgba(63, 193, 208, 0) 44%
		),
		radial-gradient(
			circle at calc(var(--lp-pill-cursor-x) + 18%)
				calc(var(--lp-pill-cursor-y) - 24%),
			rgba(201, 0, 174, calc(0.12 + (var(--lp-pill-fill-opacity) * 0.26))),
			rgba(201, 0, 174, 0) 48%
		),
		radial-gradient(
			circle at calc(var(--lp-pill-cursor-x) - 28%)
				calc(var(--lp-pill-cursor-y) + 30%),
			rgba(27, 68, 117, calc(0.1 + (var(--lp-pill-fill-opacity) * 0.24))),
			rgba(27, 68, 117, 0) 56%
		),
		linear-gradient(115deg, rgba(27, 68, 117, 0.98), rgba(18, 48, 84, 0.98));
	filter: saturate(1.14);
}

.lp-pill-button:hover .lp-pill-button__text,
.lp-pill-button:focus-visible .lp-pill-button__text {
	color: var(--color-white);
}

.lp-pill-button:hover::before,
.lp-pill-button:focus-visible::before {
	animation: lp-pill-gradient-flow 2.8s linear infinite;
	background: linear-gradient(
		120deg,
		var(--color-brand-magenta),
		var(--color-brand-magenta-light),
		var(--color-brand-blue),
		var(--color-brand-blue-light),
		var(--color-brand-magenta)
	);
	background-size: 300% 300%;
	transform: translate(calc(var(--lp-pill-offset) + 2px), calc(var(--lp-pill-offset) + 2px));
}

.lp-pill-button:hover::after,
.lp-pill-button:focus-visible::after {
	animation: lp-pill-gradient-flow-reverse 2.8s linear infinite;
	background: linear-gradient(
		120deg,
		var(--color-brand-blue),
		var(--color-brand-blue-light),
		var(--color-brand-magenta),
		var(--color-brand-magenta-light),
		var(--color-brand-blue)
	);
	background-size: 300% 300%;
	transform: translate(
		calc((var(--lp-pill-offset) + 2px) * -1),
		calc((var(--lp-pill-offset) + 2px) * -1)
	);
}

.lp-pill-button:active {
	color: var(--lp-pill-text);
}

.lp-pill-button:active::before {
	animation: none;
	background: var(--lp-pill-shadow-b);
	transform: translate(2px, 2px);
}

.lp-pill-button:active::after {
	animation: none;
	background: var(--lp-pill-shadow-a);
	transform: translate(-2px, -2px);
}

@keyframes lp-pill-gradient-flow {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

@keyframes lp-pill-gradient-flow-reverse {
	0% {
		background-position: 100% 50%;
	}
	50% {
		background-position: 0% 50%;
	}
	100% {
		background-position: 100% 50%;
	}
}
