/* Navbar copied from the sci-compiler site (sci-compiler-site-porto-hugo:
   sci-compiler/content/en/css/navbar.css, markup in layouts/partials/header.html).
   Keep the two in sync: same classes, same tokens. Differences here:
   - !important on link colours/weights, which doxygen-awesome.css forces on every <a>;
   - inline SVG chevron instead of Font Awesome;
   - the dark tokens (the site's .sc-nav--dark) are applied by doxygen-awesome's dark mode,
     not by a class on the header;
   - no site toolbar (search/login): Doxygen has its own search;
   - .sc-nav div re-inherits the font, which Doxygen's stylesheets set on every div.
   Transitions (timing included) are the site's, unchanged. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300..700&display=swap");

/* GitLab only */
.header-message {
	position: fixed !important;
	z-index: 1032;
}

body {
	height: 100vh;
}

.sc-nav {
	--sc-nav-h: 50px;
	--sc-nav-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--sc-nav-ink: #0b1e2a;
	--sc-nav-text: #4a5b66;
	--sc-nav-muted: #8a99a3;
	--sc-nav-line: rgba(11, 30, 42, 0.08);
	--sc-nav-soft: rgba(0, 116, 199, 0.07);
	--sc-nav-accent: #0074C7; /* same blue as the logo wordmark */
	--sc-nav-bg: #fff;
	--sc-nav-panel: #fff;
	--sc-nav-divider: rgba(11, 30, 42, 0.22);
	--sc-nav-shadow: rgba(11, 30, 42, 0.25);
	--sc-nav-overlay: rgba(11, 30, 42, 0.2);

	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1031 !important;
	background: var(--sc-nav-bg);
	border-bottom: 1px solid var(--sc-nav-line);
	font-family: var(--sc-nav-font);
	font-size: 0.875rem;
	font-feature-settings: "cv11", "ss01";
	letter-spacing: -0.011em;
	line-height: 1.2;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.sc-nav-inner {
	position: relative;
	/* logo left, links centered, actions right */
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 2rem;
	height: var(--sc-nav-h);
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.sc-nav-brand,
.sc-nav-actions {
	position: relative;
	z-index: 2;
}

/* doxygen.css and doxygen-awesome.css set font-family, size (15.6px), weight and line-height
   directly on every div (`body, table, div, p, dl { ... }`), so .sc-nav-inner did not inherit
   the navbar's Inter 0.875rem: the whole bar was drawn in Doxygen's font. */
.sc-nav div {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

/* doxygen-awesome.css forces every link's color/weight with !important and underlines on hover */
.sc-nav a:hover,
.sc-nav a:focus {
	text-decoration: none;
}

.sc-nav-toggle {
	display: none;
}

/* Brand */

.sc-nav-brand {
	display: flex;
	align-items: center;
	justify-self: start;
	gap: 7px;
	flex-shrink: 0;
	color: var(--sc-nav-ink);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: -0.025em;
	white-space: nowrap;
	text-decoration: none;
}

.sc-nav-brand:hover {
	color: var(--sc-nav-ink) !important;
	text-decoration: none;
}

.sc-nav-wheel {
	width: 26px;
	height: 26px;
	transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sc-nav-brand:hover .sc-nav-wheel {
	transform: rotate(-120deg);
}

/* proportions of the logo in the old ecosystem bar, slightly smaller:
   wheel 26px, 7px gap, wordmark 12px tall */
.sc-nav-wordmark {
	width: auto;
	height: 12px;
}

/* Dark theme: same tokens and logo colours as the site's .sc-nav--dark, applied when
   doxygen-awesome is in dark mode (toggle -> html.dark-mode, otherwise the OS preference
   unless html.light-mode). */

html.dark-mode .sc-nav {
	--sc-nav-ink: #ececef;
	--sc-nav-text: #bfbfc3;
	--sc-nav-muted: #89888d;
	--sc-nav-line: #333238;
	--sc-nav-soft: rgba(255, 255, 255, 0.06);
	--sc-nav-accent: #38BDF8; /* bright sky blue for the dark bar */
	--sc-nav-bg: #18171d;
	--sc-nav-panel: #28272d;
	--sc-nav-divider: #4c4b51;
	--sc-nav-shadow: rgba(0, 0, 0, 0.6);
	--sc-nav-overlay: rgba(0, 0, 0, 0.5);
}

/* the blue logo has too little contrast on the dark bar: wheel in the accent, wordmark white.
   The wheel is recoloured with a mask (its own PNG as the shape, the accent as the fill);
   the url is relative to this stylesheet, which Doxygen copies next to the image in html/. */
html.dark-mode .sc-nav-wheel {
	object-position: -9999px 0;
	background: var(--sc-nav-accent);
	-webkit-mask: url("sci-compiler-wheel.png") center / contain no-repeat;
	mask: url("sci-compiler-wheel.png") center / contain no-repeat;
}

html.dark-mode .sc-nav-wordmark {
	filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: dark) {
	html:not(.light-mode) .sc-nav {
		--sc-nav-ink: #ececef;
		--sc-nav-text: #bfbfc3;
		--sc-nav-muted: #89888d;
		--sc-nav-line: #333238;
		--sc-nav-soft: rgba(255, 255, 255, 0.06);
		--sc-nav-accent: #38BDF8; /* bright sky blue for the dark bar */
		--sc-nav-bg: #18171d;
		--sc-nav-panel: #28272d;
		--sc-nav-divider: #4c4b51;
		--sc-nav-shadow: rgba(0, 0, 0, 0.6);
		--sc-nav-overlay: rgba(0, 0, 0, 0.5);
	}

	html:not(.light-mode) .sc-nav-wheel {
		object-position: -9999px 0;
		background: var(--sc-nav-accent);
		-webkit-mask: url("sci-compiler-wheel.png") center / contain no-repeat;
		mask: url("sci-compiler-wheel.png") center / contain no-repeat;
	}

	html:not(.light-mode) .sc-nav-wordmark {
		filter: brightness(0) invert(1);
	}
}

/* Links */

.sc-nav-menu {
	display: flex;
	align-items: center;
	height: 100%;
}

.sc-nav-links {
	display: flex;
	align-items: center;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sc-nav-links > li {
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
}

.sc-nav-link {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	height: 100%;
	padding: 0 0.7rem;
	border: 0;
	background: none;
	color: var(--sc-nav-text) !important;
	font: inherit;
	font-weight: 450 !important;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease;
}

.sc-nav-link:hover,
.sc-nav-link:focus-visible,
.sc-nav-dropdown:hover > .sc-nav-link,
.sc-nav-dropdown:focus-within > .sc-nav-link {
	color: var(--sc-nav-accent) !important;
	text-decoration: none;
	outline: 0;
}

.sc-nav-link.active {
	color: var(--sc-nav-accent) !important;
	font-weight: 500 !important;
}

/* the site uses Font Awesome's fa-chevron-down; here an inline SVG of the same size */
.sc-nav-chevron {
	width: 8px;
	height: 5px;
	color: var(--sc-nav-muted);
}

.sc-nav-divider {
	width: 1px;
	height: 20px;
	margin: 0 0.75rem;
	background: var(--sc-nav-divider);
}

/* Dropdowns: open on hover or keyboard focus */

.sc-nav-submenu {
	position: absolute;
	top: calc(100% - 2px);
	left: 0.2rem;
	min-width: 210px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--sc-nav-panel);
	border-radius: 12px;
	box-shadow: 0 0 0 1px var(--sc-nav-line), 0 16px 40px -12px var(--sc-nav-shadow);
	opacity: 0;
	visibility: hidden;
	/* closes at once (no fade out), so two submenus never overlap; the bridge below
	   lets the pointer reach the submenu */
	transition: none;
}

/* invisible bridge over the gap between link and submenu */
.sc-nav-submenu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -10px;
	height: 10px;
}

.sc-nav-dropdown:hover > .sc-nav-submenu,
.sc-nav-dropdown:focus-within > .sc-nav-submenu {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.12s ease, visibility 0s;
}

/* a dropdown kept open by keyboard focus closes as soon as the pointer is on another entry */
@media (min-width: 1024px) {
	.sc-nav-menu:hover .sc-nav-dropdown:not(:hover) > .sc-nav-submenu {
		opacity: 0;
		visibility: hidden;
		transition: none;
	}
}

.sc-nav-submenu a {
	display: block;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	color: var(--sc-nav-text) !important;
	font-weight: 450 !important;
	white-space: nowrap;
	text-decoration: none;
	transition: color 0.12s ease;
}

.sc-nav-submenu a:hover,
.sc-nav-submenu a:focus-visible,
.sc-nav-submenu a.active {
	color: var(--sc-nav-accent) !important;
	text-decoration: none;
	outline: 0;
}

/* Actions */

.sc-nav-actions {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 0.35rem;
}

.sc-nav-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--sc-nav-text);
	font-size: 0.9rem;
	cursor: pointer;
	user-select: none;
	transition: color 0.15s ease;
}

.sc-nav-icon:hover {
	color: var(--sc-nav-ink);
}

/* Hamburger */

.sc-nav-burger {
	display: none;
	flex-direction: column;
	gap: 4px;
}

.sc-nav-burger span {
	display: block;
	width: 16px;
	height: 1.5px;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.sc-nav-toggle:checked ~ .sc-nav-actions .sc-nav-burger span:nth-child(1) {
	transform: translateY(5.5px) rotate(45deg);
}

.sc-nav-toggle:checked ~ .sc-nav-actions .sc-nav-burger span:nth-child(2) {
	opacity: 0;
}

.sc-nav-toggle:checked ~ .sc-nav-actions .sc-nav-burger span:nth-child(3) {
	transform: translateY(-5.5px) rotate(-45deg);
}

.sc-nav-backdrop {
	display: none;
}

/* Mobile: one hamburger, floating card under the bar */

@media (max-width: 1023px) {
	.sc-nav-inner {
		display: flex;
		justify-content: space-between;
	}

	.sc-nav-burger {
		display: inline-flex;
	}

	.sc-nav-menu {
		position: fixed;
		top: calc(var(--sc-nav-h) + 8px);
		left: 8px;
		right: 8px;
		z-index: 2;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 0.25rem 1rem;
		height: auto;
		max-height: calc(100vh - var(--sc-nav-h) - 16px);
		overflow-y: auto;
		padding: 0.75rem;
		border-radius: 16px;
		background: var(--sc-nav-panel);
		box-shadow: 0 0 0 1px var(--sc-nav-line), 0 24px 48px -16px var(--sc-nav-shadow);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-4px);
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	}

	.sc-nav-toggle:checked ~ .sc-nav-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.sc-nav-toggle:checked ~ .sc-nav-backdrop {
		display: block;
		position: fixed;
		inset: var(--sc-nav-h) 0 0 0;
		z-index: 1;
		margin: 0;
		background: var(--sc-nav-overlay);
		cursor: pointer;
	}

	/* every li becomes a cell of the card grid */
	.sc-nav-links {
		display: contents;
	}

	.sc-nav-divider {
		display: none;
	}

	.sc-nav-links > li {
		display: block;
		height: auto;
	}

	/* plain links: full-width rows on top */
	.sc-nav-links > li:not(.sc-nav-dropdown) {
		grid-column: 1 / -1;
		order: -1;
	}

	.sc-nav-link {
		height: 42px;
		padding: 0 0.75rem;
		border-radius: 10px;
		color: var(--sc-nav-ink) !important;
		font-size: 0.95rem;
	}

	.sc-nav-links > li:not(.sc-nav-dropdown) > .sc-nav-link:hover {
		background: var(--sc-nav-soft);
	}

	/* groups (Resources, Docs, Community): small heading + links */
	.sc-nav-dropdown {
		margin-top: 0.5rem;
		padding-top: 0.75rem;
		border-top: 1px solid var(--sc-nav-line);
	}

	.sc-nav-dropdown > .sc-nav-link,
	.sc-nav-dropdown:hover > .sc-nav-link,
	.sc-nav-dropdown:focus-within > .sc-nav-link {
		height: auto;
		padding: 0 0.75rem 0.4rem;
		color: var(--sc-nav-muted) !important;
		font-size: 0.75rem;
		font-weight: 600 !important;
		pointer-events: none;
	}

	.sc-nav-dropdown > .sc-nav-link .sc-nav-chevron {
		display: none;
	}

	.sc-nav-submenu,
	.sc-nav-dropdown:hover > .sc-nav-submenu,
	.sc-nav-dropdown:focus-within > .sc-nav-submenu {
		position: static;
		min-width: 0;
		padding: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: inherit;
		transform: none;
		transition: none;
	}

	.sc-nav-submenu::before {
		display: none;
	}

	.sc-nav-submenu a {
		padding: 0.5rem 0.75rem;
		color: var(--sc-nav-ink) !important;
		white-space: normal;
	}

	.sc-nav-submenu a:hover {
		background: var(--sc-nav-soft);
	}
}

@media (max-width: 419px) {
	.sc-nav-inner {
		gap: 1rem;
		padding: 0 1rem;
	}

	.sc-nav-wordmark {
		display: none;
	}
}

/* doxygen-awesome.css: `a:link, a:visited, ... { color: var(--link-color) !important }` is more
   specific than `.sc-nav-link`, so the plain <a> links (FAQs, Features, Download) took the doc's
   link colour. These selectors outrank it; the <button> entries never had the problem. */

.sc-nav a.sc-nav-link:link,
.sc-nav a.sc-nav-link:visited {
	color: var(--sc-nav-text) !important;
	font-weight: 450 !important;
}

.sc-nav a.sc-nav-link:hover,
.sc-nav a.sc-nav-link:focus-visible,
.sc-nav a.sc-nav-link.active {
	color: var(--sc-nav-accent) !important;
}

.sc-nav a.sc-nav-link.active {
	font-weight: 500 !important;
}

@media (max-width: 1023px) {
	.sc-nav a.sc-nav-link:link,
	.sc-nav a.sc-nav-link:visited {
		color: var(--sc-nav-ink) !important;
	}

	.sc-nav a.sc-nav-link:hover,
	.sc-nav a.sc-nav-link:focus-visible,
	.sc-nav a.sc-nav-link.active {
		color: var(--sc-nav-accent) !important;
	}
}
