:root {
	--bg-color: #ffffff;
	--surface-color: #f6f5f2;
	--text-color: #16181d;
	--text-muted: #52586b;
	--text-faint: #8a8f9c;
	--accent-color: #1f3a5f;
	--border-color: #e2e1db;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	width: 100%;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border-color);
}

.header-inner {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 1.5rem;
}

.header-logo img {
	height: 30px;
	width: auto;
	display: block;
}

.site-nav-links {
	display: flex;
	gap: 1.75rem;
	list-style: none;
}

.site-nav-links a,
.footer-links a {
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.92rem;
	font-weight: 500;
	transition: color 0.15s ease;
}

.site-nav-links a:hover,
.footer-links a:hover {
	color: var(--accent-color);
}

.cta-btn {
	display: inline-flex;
	background: var(--accent-color);
	color: #fff;
	padding: 0.55rem 1.15rem;
	border-radius: 4px;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.cta-btn:hover {
	background: #16283f;
}

/* main */

main {
	width: 100%;
	max-width: 760px;
	padding: 3rem 1.5rem;
	line-height: 1.7;
}

main.listing {
	max-width: 1000px;
}

.back-link {
	display: inline-block;
	margin-bottom: 2rem;
	font-size: 0.88rem;
	color: var(--text-muted);
	text-decoration: none;
}

.back-link:hover {
	color: var(--accent-color);
}

h1 {
	font-size: clamp(1.6rem, 4.5vw, 2.3rem);
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin-bottom: 1rem;
}

.intro {
	color: var(--text-muted);
	font-size: 1.05rem;
	margin-bottom: 2.5rem;
}

/* index: project cards */

.projects {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.25rem;
}

.project {
	display: flex;
	flex-direction: column;
	background: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.project:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(22, 24, 29, 0.08);
	border-color: #c9c8c0;
}

.project img {
	display: block;
	width: 100%;
	height: auto;	/* the height attribute would otherwise override aspect-ratio */
	aspect-ratio: 16 / 10;
	object-fit: contain;
	background: #fff;
	border-bottom: 1px solid var(--border-color);
}

.project-body {
	padding: 1.25rem 1.5rem 1.5rem;
}

.project time {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--text-faint);
	margin-bottom: 0.4rem;
}

.project h2 {
	font-size: 1.05rem;
	line-height: 1.35;
	color: var(--accent-color);
	margin-bottom: 0.5rem;
}

.project p {
	font-size: 0.92rem;
	line-height: 1.6;
	color: var(--text-muted);
}

/* page: report */

.report h1 {
	margin-bottom: 2rem;
}

.report h2 {
	font-size: 1.1rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--accent-color);
	margin: 2.5rem 0 0.85rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border-color);
}

.report p,
.report ul,
.report ol {
	margin-bottom: 1rem;
}

.report ul,
.report ol {
	padding-left: 1.5rem;
}

.report a {
	color: var(--accent-color);
	overflow-wrap: anywhere;
}

.report img,
.report video {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1.5rem auto 0.75rem;
	background: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 1rem;
}

.report table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0 1.5rem;
	font-size: 0.9rem;
	display: block;
	overflow-x: auto;
}

.report th,
.report td {
	padding: 0.45rem 0.75rem;
	border-bottom: 1px solid var(--border-color);
	text-align: left;
	white-space: nowrap;
}

.report th {
	background: var(--surface-color);
	font-weight: 600;
}

/* display equations: scroll horizontally inside their own box, like tables,
   instead of widening the page on narrow screens */
.report mjx-container[display="true"] {
	display: block;
	max-width: 100%;
	min-width: 0 !important;	/* override MathJax's inline min-width on numbered equations */
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0.25rem 0;
}

/* inline math: never wider than the text column */
.report mjx-container:not([display="true"]) {
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	vertical-align: middle;
}

/* answer-first line under the title */
.report h1 + p {
	padding: 1rem 1.25rem;
	background: var(--surface-color);
	border-left: 3px solid var(--accent-color);
	border-radius: 4px;
}

.report h3 {
	font-size: 1.05rem;
	line-height: 1.4;
	margin: 1.75rem 0 0.75rem;
}

/* call to action after a case study */
.case-cta {
	margin-top: 3rem;
	padding: 1.5rem;
	background: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
}

.case-cta h2 {
	font-size: 1.1rem;
	letter-spacing: 0;
	text-transform: none;
	color: var(--accent-color);
	margin: 0 0 0.5rem;
	padding-top: 0;
	border-top: 0;
}

.case-cta p {
	color: var(--text-muted);
	margin-bottom: 1rem;
}

.case-cta .cta-btn {
	color: #fff;
	overflow-wrap: normal;
}

.report p:has(> img) + p,
.report p:has(> video) + p {
	font-size: 0.9rem;
	color: var(--text-muted);
}

/* breadcrumbs (service and about pages) */

.breadcrumbs {
	margin-bottom: 2rem;
	font-size: 0.88rem;
	color: var(--text-faint);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.breadcrumbs li + li::before {
	content: "\203A";
	margin-right: 0.4rem;
}

.breadcrumbs a {
	color: var(--text-muted);
	text-decoration: none;
}

.breadcrumbs a:hover {
	color: var(--accent-color);
}

/* service pages: FAQ, as on the homepage */

.faq-item {
	border-bottom: 1px solid var(--border-color);
	padding: 0.85rem 0;
}

.faq-item summary {
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.faq-item summary::-webkit-details-marker {
	display: none;
}

.faq-item summary::before {
	content: '+';
	display: inline-block;
	width: 1.2em;
	color: var(--accent-color);
	font-weight: 700;
}

.faq-item[open] summary::before {
	content: '\2212';
}

.faq-item p {
	margin: 0.6rem 0 0;
	padding-left: 1.2em;
	color: var(--text-muted);
}

/* services hub: one card per service */

.service-list {
	display: grid;
	gap: 1rem;
	margin: 1rem 0 2rem;
}

.service-list a {
	display: block;
	padding: 1.25rem 1.5rem;
	background: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.service-list a:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(22, 24, 29, 0.08);
	border-color: #c9c8c0;
}

.service-list strong {
	display: block;
	color: var(--accent-color);
	margin-bottom: 0.3rem;
}

.service-list span {
	display: block;
	font-size: 0.92rem;
	color: var(--text-muted);
	line-height: 1.6;
}

/* footer */

footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	margin-top: auto;
	padding: 2rem 1rem 1rem;
	font-size: 0.85rem;
	color: var(--text-faint);
	text-align: center;
}

footer a {
	color: var(--text-muted);
}

.footer-links {
	display: flex;
	gap: 1.5rem;
}

@media (max-width: 640px) {
	.site-nav-links {
		display: none;
	}
	main {
		padding: 2rem 1rem;
	}
}

/* scoping request form */
.form-note {
	font-size: 0.92rem;
	color: var(--text-muted);
}

.scoping-form {
	margin-top: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.scoping-form fieldset {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.1rem 1.25rem;
	margin: 0;
	padding: 1.5rem;
	background: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	min-width: 0;
}

.scoping-form legend {
	float: left;	/* keeps the legend inside the card, on its own row */
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	padding: 0;
	margin-bottom: 0.25rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--accent-color);
}

.scoping-form .step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: var(--accent-color);
	color: #fff;
	font-size: 0.8rem;
}

.form-row {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.scoping-form fieldset > .form-row:has(textarea),
.scoping-form fieldset > .form-row:has(input[type="email"]) {
	grid-column: 1 / -1;
}

.form-row label {
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.3;
}

.form-row .optional {
	font-weight: 400;
	font-size: 0.8rem;
	color: var(--text-faint);
	margin-left: 0.3rem;
}

.form-hint {
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--text-muted);
}

.scoping-form input,
.scoping-form select,
.scoping-form textarea {
	font: inherit;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--text-color);
	background-color: var(--bg-color);
	border: 1px solid #c9c8c0;
	border-radius: 6px;
	padding: 0.65rem 0.8rem;
	width: 100%;
	min-height: 2.9rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.scoping-form select {
	appearance: none;
	padding-right: 2.4rem;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2352586b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
}

/* "Choose one" reads as a placeholder until something is picked */
.scoping-form select:has(option[value=""]:checked) {
	color: var(--text-faint);
}

.scoping-form select option {
	color: var(--text-color);
}

.scoping-form textarea {
	min-height: 9rem;
	resize: vertical;
	line-height: 1.55;
}

.scoping-form input::placeholder {
	color: var(--text-faint);
}

.scoping-form input:hover,
.scoping-form select:hover,
.scoping-form textarea:hover {
	border-color: #9fa3ad;
}

.scoping-form input:focus,
.scoping-form select:focus,
.scoping-form textarea:focus {
	outline: none;
	border-color: var(--accent-color);
	box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.18);
}

/* only after the visitor has touched the field or tried to submit */
.scoping-form :user-invalid {
	border-color: #b42318;
}

.scoping-form :user-invalid:focus {
	box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15);
}

.form-row:has(:user-invalid) label {
	color: #b42318;
}

.form-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	margin-top: 0.25rem;
}

.form-submit p {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--text-muted);
	flex: 1 1 14rem;
}

.scoping-form .cta-btn {
	border: 0;
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	padding: 0.85rem 1.6rem;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.scoping-form .cta-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(31, 58, 95, 0.28);
}

.scoping-form .cta-btn:focus-visible {
	outline: 3px solid rgba(31, 58, 95, 0.35);
	outline-offset: 2px;
}

/* honeypot: hidden from people, filled by bots */
.form-hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 640px) {
	.scoping-form fieldset {
		grid-template-columns: 1fr;
		padding: 1.15rem;
	}

	.scoping-form .cta-btn {
		width: 100%;
		white-space: normal;
		text-align: center;
	}
}
