/* Bastion Circuit Designer: a drawing board. Dark drafting paper with a faint grid, the blue of the app, copper for the parts, and the
   numbering of a schematic: every heading is a part (U1, U2, ...), every list item a resistor, the footer a title block. */

:root:has(.page) {
	color-scheme: dark;
	--background: #0a0e14;
	--surface: #0f151d;
	--surface-hover: #151d28;
	--sunken: #080b10;
	--line: #1d2937;
	--line-strong: #2e4258;
	--text: #dbe6f2;
	--muted: #8fa5bb;
	--subtle: #5f7790;
	--on-primary: #05101c;
	--accent: #3b9eff;
	--copper: #e0a050;
	--trace: #2ecc71;
	--radius: 2px;
	--colour-text: #dbe6f2;
	--colour-line: #1d2937;
	--navbar-background-colour: #080b10;
	--navbar-text-colour: #8fa5bb;
	--onhover-background-colour: #151d28;
	--onhover-text-colour: #ffffff;
	--onactive-text-colour: #ffffff;
	--onclick-background-colour: #1d2937;
	--onclick-text-colour: #ffffff;
	--bs-body-bg: #0a0e14;
	--bs-body-color: #dbe6f2;
	--bs-border-color: #1d2937;
}

body:has(.page) {
	background: #0a0e14;
}

/* The paper: a small grid and a larger one, like drafting sheets */
.page {
	background:
		linear-gradient(rgba(59, 158, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 120px,
		linear-gradient(90deg, rgba(59, 158, 255, 0.06) 1px, transparent 1px) 0 0 / 120px 100%,
		linear-gradient(rgba(59, 158, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 24px,
		linear-gradient(90deg, rgba(59, 158, 255, 0.035) 1px, transparent 1px) 0 0 / 24px 100%,
		var(--background);
	color: var(--text);
	font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
}

::selection {
	background: var(--accent);
	color: #05101c;
}

.page h1,
.page h2,
.page h3,
.page .eyebrow,
.page .main-nav a,
.page main a.button,
.page .badge,
.page footer.site-footer,
.page .menu-brand h1 {
	font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

.page h1,
.page h2,
.page h3 {
	color: #fff;
}

/* The top bar: a sheet header, a copper line beneath */
.page .main-nav {
	border-bottom: 1px solid var(--copper);
	background: rgba(8, 11, 16, 0.92);
}

.page .main-nav a {
	border-radius: 0;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.page .main-nav a.active {
	background: transparent;
	box-shadow: inset 0 -2px 0 var(--accent);
	border-radius: 0;
}

.page .menu-brand h1 {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.95rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
}

.page .menu-brand h1::before {
	content: "";
	width: 2rem;
	height: 0.75rem;
	background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2012'%3E%3Cpath%20d='M0%206h6l2-5%204%2010%204-10%204%2010%204-10%202%205h6'%20fill='none'%20stroke='%23e0a050'%20stroke-width='1.6'%20stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Home: a part number as the small line, a big name, a copper dimension line under it */
.eyebrow {
	color: var(--copper);
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.eyebrow::before {
	content: "REF ";
	color: var(--subtle);
}

.hero h1 {
	padding-bottom: 0.8rem;
	font-size: clamp(2rem, 6vw, 3.4rem);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.hero h1::after {
	content: "";
	display: block;
	width: min(20rem, 70%);
	height: 9px;
	margin-top: 0.8rem;
	border-left: 1px solid var(--copper);
	border-right: 1px solid var(--copper);
	background: linear-gradient(var(--copper), var(--copper)) center / 100% 1px no-repeat;
}

.page .lead {
	color: var(--muted);
}

/* Every heading below the first is a numbered part */
.page article {
	counter-reset: part;
}

.page h2 {
	counter-increment: part;
	border-bottom: 1px solid var(--line-strong);
}

.page h2::before {
	content: "U" counter(part) "  ";
	color: var(--copper);
	font-weight: 400;
}

/* A list is a row of resistors */
.prose ul {
	list-style: none;
	padding-left: 2.6rem;
}

.prose ul li {
	margin: 0.4rem 0;
}

.prose ul li::before {
	content: "";
	display: inline-block;
	width: 1.7rem;
	height: 0.6rem;
	margin: 0 0.8rem 0 -2.5rem;
	vertical-align: -0.05em;
	background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2012'%3E%3Cpath%20d='M0%206h6l2-5%204%2010%204-10%204%2010%204-10%202%205h6'%20fill='none'%20stroke='%23e0a050'%20stroke-width='1.6'%20stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.prose a,
.lead a {
	color: var(--accent);
	text-underline-offset: 3px;
}

.prose code {
	padding: 0.1rem 0.35rem;
	background: var(--surface);
	color: var(--copper);
}

/* Buttons are pads: solid blue, a copper ring */
.page main a.button,
.page main a.button:visited {
	border: 1px solid var(--accent);
	border-radius: 2px;
	background: var(--accent);
	color: #05101c;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.page main a.button:hover {
	background: #fff;
	border-color: #fff;
	color: #05101c;
}

.page main a.button.secondary,
.page main a.button.secondary:visited {
	background: transparent;
	border-color: var(--copper);
	color: var(--copper);
}

.page main a.button.secondary:hover {
	background: var(--copper);
	color: #05101c;
}

/* Boxes: thin blue frames with a corner mark */
.page .project-card,
.page .banner,
.page .download-card,
.page .platform-card,
.page .bug-panel,
.page .feedback-box {
	border: 1px solid var(--line-strong);
	border-radius: 2px;
	background: rgba(15, 21, 29, 0.9);
}

.page .project-card:hover {
	border-color: var(--accent);
}

.page .badge {
	border-radius: 2px;
}

.page input,
.page textarea,
.page select {
	border-radius: 2px;
	background: var(--sunken);
	color: var(--text);
	border-color: var(--line-strong);
}

/* The bottom is the title block of the drawing */
.page footer.site-footer {
	max-width: none;
	margin: 3rem 0 0;
	padding: 0.7rem 1.5rem;
	border-top: 1px solid var(--copper);
	background: rgba(8, 11, 16, 0.95);
	color: var(--subtle);
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.page footer.site-footer a {
	color: var(--muted);
}

.page .site-notice,
.page .cookie-notice {
	border-radius: 2px;
}
