/*
 * Nexcus Technologies LLC
 *
 * nexcus20261031.css
 *
 * Header base color #0051e0
 *
 * Laid out like the old site -- grey column on the left with the logo,
 * contact details and company blurb, the services beside it -- and set like
 * an engineering datasheet: the content sits on graph paper (the idea behind
 * img/graph_paper.png), the solutions and the team are numbered, ruled rows
 * rather than cards, and the section headings are flat blue bars with white
 * condensed type, which is what the old sliced header images were.
 *
 * Everything sits on the paper's grid, which is 8px fine lines under 40px
 * heavy ones, anchored to the top left of the page:
 *
 *   - Every line height, margin, padding and fixed height is a multiple of
 *     8px, so whatever comes next starts on a line.  Rules are painted with
 *     box-shadow rather than borders, because a 1px border would push
 *     everything below it a pixel off.
 *   - The content column starts on a heavy line: the grey column is 320px
 *     (280px below 1100px) and the gutter 40px.  Widths are rounded down to
 *     whole 40px cells, so right-hand edges land on lines too.
 *   - Each text style is nudged with position:relative so its baseline sits
 *     on a line.  The offsets were measured for IBM Plex in Chromium; they
 *     move the glyphs and nothing else.  Before the fonts load, or without
 *     them, text sits a pixel or two off, which is harmless.
 *
 * Type is IBM Plex, served from fonts/ (SIL Open Font License, fonts/OFL.txt).
 */

@font-face {
	font-family: "IBM Plex Sans";
	font-weight: 400;
	font-display: swap;
	src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
	font-family: "IBM Plex Sans";
	font-weight: 600;
	font-display: swap;
	src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
	font-family: "IBM Plex Sans Condensed";
	font-weight: 600;
	font-display: swap;
	src: url("fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2");
}
@font-face {
	font-family: "IBM Plex Sans Condensed";
	font-weight: 700;
	font-display: swap;
	src: url("fonts/ibm-plex-sans-condensed-latin-700-normal.woff2") format("woff2");
}
@font-face {
	font-family: "IBM Plex Mono";
	font-weight: 400;
	font-display: swap;
	src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
	font-family: "IBM Plex Mono";
	font-weight: 500;
	font-display: swap;
	src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
	--blue: #0051e0;
	--blue-dark: #003a9e;
	--navy: #0b1f44;
	--text: #2b3445;
	--muted: #5b6577;
	--line: #cfd6e1;
	--field: #b7c0ce;
	--column-bg: #f5f7fa;
	--paper: #fcfbf7;

	/* graph paper: a fine 8px grid under a 40px one */
	--grid-minor: rgba(0, 81, 224, .03);
	--grid-major: rgba(0, 81, 224, .075);
	/* where a heavy line falls horizontally; the content column starts on it */
	--grid-x: 0px;

	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--cond: "IBM Plex Sans Condensed", "Arial Narrow", "Liberation Sans Narrow", var(--sans);
	--mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

	--sidebar: 320px;
	--gutter: 40px;
	--bar-bleed: 16px;
	/* content widths round down to this, so right edges land on a line */
	--snap: 40px;
}

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

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

body {
	margin: 0;
	font: 16px/24px var(--sans);
	color: var(--text);
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid-major) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
		linear-gradient(var(--grid-minor) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
	background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
	background-position: var(--grid-x) 0;
	-webkit-font-smoothing: antialiased;
}

/* the blue edge along the top of every page, laid over it so it takes no
   room and the page below starts on the grid */
body::before {
	content: "";
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--blue);
}

a {
	color: var(--blue);
	text-decoration: none;
}
a:hover {
	color: var(--blue-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
}
a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

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

h1,
h2,
h3 {
	margin: 0;
	color: var(--navy);
}

p {
	margin: 0 0 16px;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ------------------------------------------------------------------ layout */

/*
 * The grey column is two cells, #intro on top and #linkList under it, so it
 * runs the full height of the page however long the content gets.
 */
#container {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr);
	grid-template-rows: auto 1fr auto;
	grid-template-areas:
		"intro main"
		"links main"
		"links footer";
	min-height: 100vh;
	/* a whole number of rows, so the footer at the bottom is on the grid */
	min-height: round(down, 100vh, 8px);
}

#intro {
	grid-area: intro;
}
#details {
	grid-area: main;
}
#linkList {
	grid-area: links;
}
#footer {
	grid-area: footer;
}

#intro,
#linkList {
	background: var(--column-bg);
	box-shadow: inset -1px 0 var(--line);
	padding-left: 32px;
	padding-right: 32px;
}
#intro {
	padding-top: 32px;
}
#linkList {
	padding-bottom: 40px;
}

/* the rows below rearrange on the width of this column, not the window */
#details {
	container-type: inline-size;
	max-width: 1040px;
	padding: 40px var(--gutter);
}
#details > section {
	width: round(down, 100%, var(--snap));
}

/* --------------------------------------------------------------- the logo */

/* 120px high with the 118px logo inside, so what follows starts on a line */
#pageHeader h1 {
	height: 120px;
	margin: 0 0 24px -6px;
	line-height: 0;
}
#pageHeader img {
	width: 200px;
}

/* ------------------------------------------------------ the grey column */

/* a small label with a hairline running out to the right */
#intro h2,
#linkList h2 {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font: 500 12px/16px var(--mono);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--blue);
}
#intro h2::after,
#linkList h2::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

#contact {
	margin-bottom: 32px;
}
#contact address {
	font-style: normal;
}
#contact li {
	display: flex;
	gap: 12px;
	margin: 0 0 8px;
	font-size: 15px;
	color: var(--navy);
}
#contact li svg {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 3px;
	color: var(--blue);
}
#contact .org {
	font-weight: 600;
}

#company {
	padding-bottom: 32px;
}
#company p {
	font-size: 15px;
}

#linkList > div + div {
	margin-top: 32px;
}
#linkList li {
	margin: 0 0 8px;
	font-size: 15px;
}

/* ----------------------------------------------------- the section bars */

/*
 * Solid #0051e0, exactly one heavy cell high, with the heading in white
 * condensed type.  It hangs 16px left of the text column, the way the old
 * bar images did; a heading that wraps makes it two cells.
 */
.bar {
	margin: 0 0 24px calc(-1 * var(--bar-bleed));
	padding: 0 var(--bar-bleed);
	background: var(--blue);
	color: #fff;
	font: 700 30px/40px var(--cond);
	letter-spacing: .005em;
}
.bar span {
	position: relative;
	top: 1px;
}

/* ------------------------------------------------------------ the content */

#services .lead {
	max-width: 70ch;
	margin-bottom: 24px;
	font-size: 18px;
	line-height: 32px;
	color: var(--navy);
}
#solutions > p {
	max-width: 70ch;
	margin: 0;
}

/*
 * A ruled table of rows: a number (or initials) in the margin, the heading
 * and its blurb, then the detail.  Heavy rules top and bottom, light ones
 * between, like a datasheet.  The detail column starts on a heavy line.
 */
.sheet {
	margin-top: 32px;
	box-shadow: inset 0 2px var(--navy), 0 2px var(--navy);
}
.bar + .sheet {
	margin-top: 0;
}
.sheet > li {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr);
	grid-template-columns: 40px round(down, calc((100% - 40px) / 2), 40px) minmax(0, 1fr);
	padding: 24px 0;
}
.sheet > li + li {
	box-shadow: inset 0 1px var(--line);
}
.sheet > li > div {
	padding-right: 24px;
}

.sheet .mark {
	font: 500 14px/32px var(--mono);
	color: var(--blue);
}
.sheet h3 {
	font: 600 19px/32px var(--sans);
}
.sheet > li > div p {
	margin: 0;
	font-size: 15px;
	color: var(--muted);
}

/* the detail: down one row, so its first line shares the heading's line */
.sheet > li > ul,
.sheet > li > .detail {
	padding-top: 8px;
}
.sheet ul li {
	position: relative;
	padding-left: 20px;
	font: 400 14px/24px var(--mono);
	color: var(--navy);
}
.sheet ul li::before {
	content: "\2013";
	position: absolute;
	left: 0;
	color: var(--blue);
}
/* a team member's responsibilities, then the same kind of list */
.sheet .detail p {
	color: var(--text);
}
.sheet .detail ul {
	margin-top: 8px;
}

/* the team: the role reads like a part number */
.sheet .role {
	margin: 0;
	font: 500 12px/24px var(--mono);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--blue);
}

#team {
	margin-top: 64px;
}

/* too narrow for three columns: the detail drops under the heading */
@container (max-width: 620px) {
	.sheet > li {
		grid-template-columns: 40px minmax(0, 1fr);
	}
	.sheet > li > :last-child {
		grid-column: 2;
		padding-top: 16px;
	}
}

/* ----------------------------------------------------------------- footer */

#footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	width: round(down, calc(100% - 2 * var(--gutter)), var(--snap));
	max-width: calc(1040px - 2 * var(--gutter));
	margin: 0 var(--gutter);
	padding: 16px 0 24px;
	box-shadow: inset 0 1px var(--line);
	font: 400 13px/24px var(--mono);
	color: var(--muted);
}

/* -------------------------------------------- privacy, SMS and other pages */

/*
 * One column, the logo on top, and no grey column: there is nothing to put
 * in one.  Centred, but only to a whole number of heavy cells, so the text
 * still starts on a line.
 */
.subpage #container {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: auto 1fr auto;
	grid-template-areas:
		"intro"
		"main"
		"footer";
	max-width: 880px;
	margin-left: max(0px, round(down, calc((100% - 880px) / 2), 40px));
}
.subpage #intro {
	background: none;
	box-shadow: none;
	padding: 32px var(--gutter) 0;
}
.subpage #pageHeader h1 {
	height: 96px;
	margin-bottom: 0;
}
.subpage #pageHeader img {
	width: 150px;
}
.subpage #details {
	max-width: none;
	padding: 24px var(--gutter) 40px;
}
.subpage #footer {
	max-width: none;
}

.doc h3 {
	margin: 32px 0 8px;
	font: 600 19px/32px var(--sans);
}
.doc p {
	max-width: 72ch;
}

.doc .contact-card {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0 32px;
	margin: 0 0 40px;
	padding: 16px 0;
	box-shadow: inset 0 2px var(--navy), 0 1px var(--line);
}
.doc .contact-card p {
	margin: 0;
	font-size: 15px;
}

/* the badge is 4:1; a width in 32px steps keeps its height in 8px steps */
.doc .badge {
	margin-top: 40px;
}
.doc .badge img {
	display: block;	/* inline, it sits on a text line and gains its descender */
	width: min(384px, round(down, 100%, 32px));
}

/* ------------------------------------------------------------------- forms */

/* a label row and a 40px field: 64px, then a row of space */
form {
	max-width: 520px;
}
.field {
	margin: 0 0 24px;
}
.field > label {
	display: block;
	font: 500 12px/24px var(--mono);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--navy);
}
input[type="text"],
input[type="email"],
input[type="tel"] {
	width: 100%;
	/* 5px over and 9px under, not 7 and 7, puts the typed text's baseline on
	   the line through the middle of the field */
	padding: 5px 12px 9px;
	font: 16px/24px var(--sans);
	color: var(--navy);
	background: #fff;
	border: 1px solid var(--field);
	border-radius: 2px;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
	outline: 2px solid var(--blue);
	outline-offset: -1px;
	border-color: var(--blue);
}
input::placeholder {
	color: #98a1b0;
}

.phone {
	display: flex;
}
.phone span {
	padding: 5px 14px 9px;
	font: 16px/24px var(--mono);
	color: var(--muted);
	background: var(--column-bg);
	border: 1px solid var(--field);
	border-right: 0;
	border-radius: 2px 0 0 2px;
}
.phone input[type="tel"] {
	border-radius: 0 2px 2px 0;
}

/* .field > so it outranks the plain field label above */
.field > .consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font: 400 14px/24px var(--sans);
	letter-spacing: normal;
	text-transform: none;
	color: var(--muted);
}
.consent input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 3px 0 0;
	accent-color: var(--blue);
}

button {
	padding: 6px 24px 10px;
	font: 700 17px/24px var(--cond);
	letter-spacing: .02em;
	color: #fff;
	background: var(--blue);
	border: 0;
	border-radius: 2px;
	cursor: pointer;
}
button:hover {
	background: var(--blue-dark);
}

/* ------------------------------------------------------ baseline offsets */

/*
 * Measured: where each style's baseline falls in its line, and how far that
 * is from the nearest grid line.
 */
#solutions > p,
.doc p {
	position: relative;
	top: -2px;	/* 16/24: baseline 18 -> 16 */
}
#services .lead {
	position: relative;
	top: 2px;	/* 18/32: 22 -> 24 */
}
.sheet h3,
.doc h3 {
	position: relative;
	top: 1px;	/* 19/32: 23 -> 24 */
}
.sheet .mark {
	position: relative;
	top: 3px;	/* mono 14/32: 21 -> 24, level with the heading */
}
.sheet > li > div p,
.doc .contact-card p,
.consent span {
	position: relative;
	top: -1px;	/* 15/24 and 14/24: 17 -> 16 */
}
.sheet ul li {
	top: -1px;	/* mono 14/24: 17 -> 16 */
}
/* mono 12/24 (the roles, field labels) and 13/24 (the footer) already sit
   on 16, and the badge is an image; they are matched above, so put back */
.sheet .role,
.doc .badge {
	top: 0;
}
/* the bars are nudged in their own rule above */

/* ---------------------------------------------------------- narrow screens */

@media (max-width: 1100px) {
	:root {
		--sidebar: 280px;
	}
}

/* one column: logo, contact and company on top, links after the content */
@media (max-width: 860px) {
	:root {
		--gutter: 24px;
		--grid-x: 24px;
		--snap: 8px;
	}

	#container {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto;
		grid-template-areas:
			"intro"
			"main"
			"links"
			"footer";
	}

	#intro,
	#linkList {
		padding-left: var(--gutter);
		padding-right: var(--gutter);
	}
	#intro {
		padding-top: 24px;
		box-shadow: inset 0 -1px var(--line);
	}
	#linkList {
		padding-top: 32px;
		padding-bottom: 32px;
		box-shadow: inset 0 1px var(--line);
	}

	#details {
		padding-top: 32px;
	}

	#footer {
		box-shadow: none;
	}

	/* the bars run edge to edge rather than hanging into the margin */
	.bar {
		margin-left: calc(-1 * var(--gutter));
		margin-right: calc(-1 * var(--gutter));
		padding-left: var(--gutter);
		padding-right: var(--gutter);
		font-size: 24px;
	}
	.bar span {
		top: 3px;	/* cond 24/40: 29 -> 32 */
	}
	#details > section {
		/* edge to edge bars need the section full width */
		width: auto;
	}
}

/* wide enough for contact and company side by side, and the two link lists */
@media (min-width: 600px) and (max-width: 860px) {
	#intro {
		display: grid;
		grid-template-columns: 1fr 1.6fr;
		gap: 0 32px;
	}
	#pageHeader {
		grid-column: 1 / -1;
	}
	#linkList {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0 32px;
	}
	#linkList > div + div {
		margin-top: 0;
	}
}
