/* Editorial oxblood. Every text colour pair here passes WCAG AAA (7:1). */

@font-face {
	font-family: "Inter";
	src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Inter";
	src: url("/assets/fonts/inter-latin-400-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Inter";
	src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Inter Tight";
	src: url("/assets/fonts/inter-tight-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Mono";
	src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Mono";
	src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Rubik Doodle Shadow";
	src: url("/assets/fonts/rubik-doodle-shadow-latin-400-normal.woff2")
		format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Light (bone) areas */
	--paper: #f4efe8;
	--paper-deep: #e6dccd;
	--ink: #1d1a1f;
	--ink-muted: #3e3439;
	--oxblood: #6e1423;
	--oxblood-deep: #5a0f1c;

	/* Dark (wine) areas */
	--wine: #3d0c15;
	--wine-rule: #8a3a47;
	--on-wine: #f3e9dc;
	--on-wine-muted: #d4bfc0;
	--rose: #f0a8b1;
	/* International Klein Blue. Cream and rose both read on it; next to wine it needs a cream edge. */
	--klein: #002fa7;

	--font-display: "Inter Tight", "Inter", system-ui, sans-serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--font-doodle: "Rubik Doodle Shadow", "Inter Tight", system-ui, sans-serif;

	--rule: 1px;
	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;
	--space-5: 4rem;
	--gutter: clamp(1rem, 5vw, 3rem);
	--page: 72rem;
	--measure: 68ch;

	color-scheme: light;
}

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

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: max(1.125rem, 18px);
	line-height: 1.6;
}

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

.doodle-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

main {
	flex: 1;
	padding-block: var(--space-4) var(--space-5);
}

/* Page width. The home page uses full-width bands with their own containers. */
.page,
.paths {
	max-width: var(--page);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

main:focus {
	outline: none;
}

main p,
main li,
main dd,
main blockquote {
	max-width: var(--measure);
}

h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--ink);
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.5rem, 6vw + 1rem, 4.75rem);
	letter-spacing: -0.025em;
	margin: 0 0 var(--space-2);
}

h2 {
	font-size: clamp(1.6rem, 2vw + 1rem, 2.25rem);
	margin: var(--space-4) 0 var(--space-2);
}

h3 {
	font-size: 1.35rem;
	margin: var(--space-3) 0 var(--space-1);
}

a {
	color: var(--oxblood);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--oxblood);
	outline-offset: 3px;
}

/* Skip link: off-screen until focused. */
.skip-link {
	position: absolute;
	left: var(--space-2);
	top: -10rem;
	z-index: 10;
	padding: var(--space-1) var(--space-2);
	background: var(--paper);
	color: var(--oxblood-deep);
	font-weight: 500;
}

.skip-link:focus {
	top: var(--space-2);
	outline-color: var(--paper);
}

/* Header: a wine-red bar on every page. */
.site-header {
	background: var(--wine);
	color: var(--on-wine);
	padding: var(--space-3) var(--gutter) var(--space-2);
}

.site-header :focus-visible,
.hero :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible {
	outline-color: var(--rose);
}

.nav-list {
	list-style: none;
	max-width: calc(var(--page) - 2 * var(--gutter));
	margin: 0 auto;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--space-1) var(--space-3);
	font-family: var(--font-mono);
	font-size: 0.95rem;
}

.nav-list a {
	color: var(--rose);
	text-decoration: none;
	display: inline-block;
	min-height: 24px;
	padding-block: 0.15em;
}

.nav-home {
	margin-right: auto;
}

.nav-home a {
	color: var(--on-wine);
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
	text-decoration-line: underline;
	text-decoration-thickness: 2px;
}

/* Home hero: continues the header band. */
.page-home main {
	padding-top: 0;
}

.hero {
	background: var(--wine);
	color: var(--on-wine);
}

.hero-inner {
	position: relative;
	max-width: var(--page);
	margin-inline: auto;
	padding: var(--space-4) var(--gutter) var(--space-5);
}

.hero h1 {
	color: var(--on-wine);
	max-width: 12ch;
}

.doodle {
	font-family: var(--font-doodle);
	font-weight: 400;
	letter-spacing: 0;
	color: var(--rose);
	white-space: nowrap;
}

.lede {
	font-size: 1.2rem;
	color: var(--on-wine-muted);
	max-width: 44ch;
	margin: 0;
}

.deco {
	position: absolute;
	pointer-events: none;
}

/* The doodle sky: beside the text on wide screens, below it on narrow ones. */
.hero-sky {
	position: relative;
	height: 18rem;
	margin-top: var(--space-3);
	pointer-events: none;
}

@media (min-width: 64em) {
	.hero-inner {
		min-height: 30rem;
	}
	.hero-sky {
		position: absolute;
		top: var(--space-2);
		bottom: var(--space-2);
		right: var(--gutter);
		width: 46%;
		height: auto;
		margin: 0;
	}
}

.sky {
	position: absolute;
	color: var(--on-wine);
}

.sky-disco-big {
	width: clamp(8.5rem, 22vw, 15rem);
	aspect-ratio: 1;
	right: 10%;
	top: 4%;
	color: var(--rose);
	transform: rotate(6deg);
}

.sky-disco-left {
	width: clamp(3.5rem, 8vw, 5.5rem);
	aspect-ratio: 1;
	left: 4%;
	top: 0;
	transform: rotate(-12deg);
}

.sky-disco-low {
	width: clamp(3rem, 6vw, 4.25rem);
	aspect-ratio: 1;
	left: 34%;
	bottom: 4%;
	color: var(--rose);
	transform: rotate(16deg);
}

.sky-planet {
	width: clamp(8rem, 19vw, 13.5rem);
	aspect-ratio: 1;
	right: -2%;
	bottom: -4%;
}

.sky-blackhole {
	width: clamp(4.5rem, 10vw, 7rem);
	aspect-ratio: 1;
	left: 2%;
	bottom: 18%;
	color: var(--rose);
}

.sky-star-1 {
	width: 2.25rem;
	aspect-ratio: 1;
	right: 0;
	top: 0;
	transform: rotate(-14deg);
}

.sky-star-2 {
	width: 1.6rem;
	aspect-ratio: 1;
	left: 36%;
	top: 30%;
	color: var(--rose);
	transform: rotate(18deg);
}

.sky-star-3 {
	width: 1.4rem;
	aspect-ratio: 1;
	left: 47%;
	top: 64%;
	transform: rotate(-8deg);
}

.sky-star-4 {
	width: 1.2rem;
	aspect-ratio: 1;
	left: 0;
	top: 30%;
	color: var(--rose);
	transform: rotate(24deg);
}

.sky-moon {
	width: clamp(3.5rem, 8vw, 5.5rem);
	aspect-ratio: 1;
	left: 7%;
	top: 26%;
	transform: rotate(-10deg);
}

.sky-comet {
	width: clamp(4.25rem, 10vw, 7rem);
	aspect-ratio: 1;
	left: 22%;
	top: 11%;
	color: var(--rose);
}

.sky-moonlet {
	width: clamp(3rem, 6.5vw, 4.75rem);
	aspect-ratio: 1;
	right: 37%;
	bottom: 1%;
}

.sky-constellation {
	width: clamp(4.25rem, 10vw, 6.5rem);
	aspect-ratio: 1;
	left: 27%;
	top: 44%;
}

.sky-spark {
	aspect-ratio: 1;
}

.sky-spark-1 {
	width: 1.9rem;
	left: 20%;
	top: 1%;
	color: var(--rose);
}
.sky-spark-2 {
	width: 1.3rem;
	left: 20%;
	top: 46%;
}
.sky-spark-3 {
	width: 1.7rem;
	right: 34%;
	bottom: 22%;
	color: var(--rose);
}
.sky-spark-4 {
	width: 1.2rem;
	right: 4%;
	top: 52%;
}
.sky-spark-5 {
	width: 1.5rem;
	left: 54%;
	bottom: 0;
}
.sky-spark-6 {
	width: 1.1rem;
	left: 12%;
	bottom: 2%;
	color: var(--rose);
}
.sky-spark-7 {
	width: 1.4rem;
	right: 2%;
	top: 26%;
	color: var(--rose);
}
.sky-spark-8 {
	width: 1.1rem;
	left: 46%;
	top: 2%;
}

/* Home: the paths (case studies, blog, speaking, services) */
.paths {
	position: relative;
	display: grid;
	gap: var(--space-4);
	padding-top: var(--space-4);
}

@media (min-width: 48em) {
	.paths {
		grid-template-columns: 1fr 1fr;
	}
}

.deco-stray {
	width: 1.75rem;
	height: 1.75rem;
	right: var(--gutter);
	top: var(--space-2);
	color: var(--oxblood);
	transform: rotate(10deg);
}

.section-label {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: lowercase;
	color: var(--oxblood);
	margin: 0 0 var(--space-2);
}

.study-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-3);
}

.study-card {
	border-top: var(--rule) solid var(--ink);
	padding-top: var(--space-2);
}

.thumb {
	aspect-ratio: 4 / 3;
	background: var(--klein);
	color: var(--on-wine);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-1);
	overflow: hidden;
}

.thumb svg {
	width: 40%;
	height: auto;
	aspect-ratio: 1;
}

.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.study-type {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	text-transform: lowercase;
	color: var(--oxblood);
	margin: 0 0 0.15rem;
}

.study-card a {
	color: var(--ink);
	font-weight: 500;
}

.row-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.row-list li {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	padding-block: 0.6rem;
	border-top: var(--rule) solid var(--ink);
}

.row-list svg {
	width: 0.75rem;
	height: 0.75rem;
	flex: none;
	color: var(--oxblood);
}

.row-list a {
	color: var(--ink);
}

.more {
	margin-top: var(--space-2);
	font-family: var(--font-mono);
	font-size: 0.9rem;
}

/* Footer */
.site-footer {
	background: var(--wine);
	color: var(--on-wine);
	padding: var(--space-3) var(--gutter);
	font-size: 1rem;
}

.site-footer p {
	max-width: calc(var(--page) - 2 * var(--gutter));
	margin: 0 auto var(--space-1);
}

.site-footer a {
	color: var(--on-wine);
}

.footer-name {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--on-wine-muted);
}

.muted {
	color: var(--ink-muted);
}

pre,
table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

/* Lists of work and blog posts */
.study-list,
.post-list {
	list-style: none;
	padding: 0;
	margin: 0 0 var(--space-2);
}

.post-list li {
	padding-block: var(--space-2);
	border-top: var(--rule) solid var(--ink);
}

/* Work index: a grid of cards, image above each title. */
.study-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
	gap: var(--space-4) var(--space-3);
	margin-top: var(--space-4);
}

.study-item {
	border-top: var(--rule) solid var(--ink);
	padding-top: var(--space-2);
}

.study-item .thumb {
	aspect-ratio: 16 / 9;
}

.study-item .thumb svg {
	width: 22%;
}

.study-list h2 {
	margin: 0.15rem 0 var(--space-1);
	font-size: 1.6rem;
}

.study-list h2 a {
	color: var(--ink);
}

.post-list p {
	margin: var(--space-1) 0 0;
}

/* Case studies */
.summary {
	font-size: 1.25rem;
}

.at-a-glance dl,
.entry-facts {
	display: grid;
	gap: var(--space-1);
	margin: 0;
}

.at-a-glance dl > div,
.entry-facts > div {
	display: grid;
	grid-template-columns: minmax(6rem, 10rem) 1fr;
	gap: var(--space-2);
}

@media (max-width: 30em) {
	.at-a-glance dl > div,
	.entry-facts > div {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.at-a-glance dt,
.entry-facts dt {
	font-family: var(--font-mono);
	font-size: 0.9rem;
	text-transform: lowercase;
	color: var(--oxblood);
}

.at-a-glance dd,
.entry-facts dd {
	margin: 0;
}

/* Speaking & Community */
.entry-facts {
	margin-top: var(--space-3);
}

.entry-media {
	margin-block: var(--space-4);
}

.video {
	aspect-ratio: 16 / 9;
	max-width: 48rem;
}

.video iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.entry-list {
	list-style: none;
	padding: 0;
	display: grid;
	gap: var(--space-3);
	max-width: 48rem;
}

.entry-list h3 {
	margin: 0;
}

.entry-list p {
	margin: var(--space-1) 0 0;
}

/* Services */
.services {
	list-style: none;
	padding: 0;
	margin-block: var(--space-4);
	display: grid;
	gap: var(--space-4) var(--space-5);
}

@media (min-width: 48em) {
	.services {
		grid-template-columns: 1fr 1fr;
	}
}

.service {
	border-top: 2px solid var(--oxblood);
	padding-top: var(--space-2);
}

.service h2 {
	margin-top: var(--space-1);
}

.service p {
	margin: var(--space-1) 0 0;
}

.service-label {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	text-transform: lowercase;
	color: var(--oxblood);
}

.service > p:last-child {
	margin-top: var(--space-2);
}

.cta-band {
	background: var(--klein);
	color: var(--on-wine);
	padding: var(--space-4) var(--space-3);
	margin-top: var(--space-5);
}

.cta-band h2 {
	color: var(--on-wine);
	margin-top: 0;
}

.cta-band p {
	color: var(--on-wine-muted);
	margin: var(--space-1) 0 0;
}

.cta-band a {
	color: var(--rose);
	font-weight: 500;
}

/* Unlock form */
.unlock {
	margin-top: var(--space-4);
	padding: var(--space-3);
	border: 2px solid var(--oxblood-deep);
	max-width: 40rem;
}

.unlock h2 {
	margin-top: 0;
}

.unlock-form label {
	display: block;
	font-weight: 500;
	margin-bottom: var(--space-1);
}

.password-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	margin-bottom: var(--space-2);
}

.unlock-form input {
	font: inherit;
	min-height: 2.75rem;
	padding: 0.4rem 0.6rem;
	border: 2px solid var(--ink);
	background: #fff;
	color: var(--ink);
	flex: 1 1 14rem;
}

.unlock-form input[aria-invalid="true"] {
	border-color: var(--oxblood);
	border-width: 3px;
}

button {
	font: inherit;
	min-height: 2.75rem;
	padding: 0.4rem 1rem;
	border: 2px solid var(--oxblood-deep);
	background: var(--oxblood-deep);
	color: var(--on-wine);
	cursor: pointer;
}

button.show-password {
	background: transparent;
	color: var(--oxblood-deep);
}

#password-error {
	color: var(--oxblood);
	font-weight: 500;
	border-left: 4px solid var(--oxblood);
	padding-left: var(--space-1);
}

#unlocked:focus {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		/* biome-ignore lint/complexity/noImportantStyles: reduced motion must win over every other rule */
		animation: none !important;
		/* biome-ignore lint/complexity/noImportantStyles: reduced motion must win over every other rule */
		transition: none !important;
		/* biome-ignore lint/complexity/noImportantStyles: reduced motion must win over every other rule */
		scroll-behavior: auto !important;
	}
}

@media (prefers-contrast: more) {
	:root {
		--rule: 2px;
		--wine-rule: var(--on-wine);
	}
	a {
		text-decoration-thickness: 2px;
	}
}
