/*
 * Brand kit for oliverjwroberts.com. Adapted from the CV's base.css for a dark
 * ground: same typefaces and structure, lighter accent and muted so text passes
 * AA on #191c23. Tokens live on :root so a light scheme can be added later.
 */

@font-face {
	font-family: "Newsreader";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/newsreader.woff2") format("woff2");
}

@font-face {
	font-family: "Newsreader";
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/newsreader-italic.woff2") format("woff2");
}

@font-face {
	font-family: "Public Sans";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/public-sans.woff2") format("woff2");
}

@font-face {
	font-family: "Public Sans";
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/public-sans-italic.woff2") format("woff2");
}

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/ibm-plex-mono.woff2") format("woff2");
}

:root {
	color-scheme: dark;

	/* Colour */
	--colour-ground: #191c23;
	--colour-surface: #20242c;
	--colour-ink: #e6e8ec;
	--colour-muted: #9aa0ab;
	--colour-accent: #5aa886;
	--colour-rule: rgba(90, 168, 134, 0.35);
	--colour-hairline: rgba(154, 160, 171, 0.2);

	/* Type */
	--font-serif: "Newsreader", Georgia, "Times New Roman", serif;
	--font-sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
	--font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
	--text-name: 44px;
	--text-title: 40px;
	--text-heading: 24px;
	--text-lede: 19px;
	--text-body: 17px;
	--text-small: 16px;
	--text-mono: 13px;
	--leading: 1.55;

	/* Space */
	--space-xs: 4px;
	--space-s: 8px;
	--space-m: 16px;
	--space-l: 24px;
	--space-xl: 56px;

	/* Page */
	--column: 680px;
	--gutter: 20px;
}

html {
	font-family: var(--font-sans);
	font-size: var(--text-body);
	line-height: var(--leading);
	color: var(--colour-ink);
	background: var(--colour-ground);
	-webkit-font-smoothing: antialiased;
}

body {
	margin: 0;
	padding: 40px var(--gutter) 64px;
}

h1,
h2,
h3,
p,
ul {
	margin: 0;
}

p {
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--colour-rule);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--colour-accent);
	text-decoration-color: var(--colour-accent);
}

img {
	max-width: 100%;
}

.mono {
	font-family: var(--font-mono);
	font-size: var(--text-mono);
	letter-spacing: 0.01em;
}

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

/* One column, centred. Every page uses it. .sections is the main content
 * between the hero and the footer; .post is one article's header and body. */
.page {
	max-width: var(--column);
	margin: 0 auto;
}

.page,
.sections {
	display: flex;
	flex-direction: column;
	gap: var(--space-xl);
}

.post {
	display: flex;
	flex-direction: column;
	gap: 48px;
}

/* Links that underline only on hover. */
.nav a,
.log-fields a,
.entry-title a {
	text-decoration: none;
}

.nav a:hover,
.log-fields a:hover,
.entry-title a:hover {
	text-decoration: underline;
}

/* Nav: home link left, section links right. */
.nav {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.nav-home {
	font-family: var(--font-mono);
	font-size: 14px;
	color: var(--colour-muted);
}

.nav-links {
	display: flex;
	gap: var(--space-l);
	font-size: 15px;
}

/* Hero: photo beside name and pitch, then the log block. */
.hero {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.hero-title {
	display: flex;
	align-items: center;
	gap: var(--space-l);
}

.hero-photo {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.hero-text {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.name {
	font-family: var(--font-serif);
	font-size: var(--text-name);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.01em;
}

.pitch {
	font-size: var(--text-lede);
	line-height: 1.45;
}

/* Log block: one fact per line as level, event, key=value pairs. */
.log {
	font-family: var(--font-mono);
	font-size: 13.5px;
	line-height: 1.75;
	background: var(--colour-surface);
	border-radius: 4px;
	padding: 18px 22px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.log-line {
	display: grid;
	grid-template-columns: 48px 172px minmax(0, 1fr);
	column-gap: var(--space-m);
}

.log-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--space-m);
}

.log-level {
	color: var(--colour-accent);
}

.log-key,
.log-quote {
	color: var(--colour-muted);
}

/* Sections. Post body headings share the section heading style. */
.section {
	display: flex;
	flex-direction: column;
	gap: var(--space-m);
}

.section-heading,
.prose h2 {
	font-family: var(--font-serif);
	font-size: var(--text-heading);
	font-weight: 600;
	line-height: 1.2;
	color: var(--colour-accent);
	padding-bottom: 6px;
	border-bottom: 1px solid var(--colour-rule);
}

/* Entries: posts and projects share one shape. */
.entries {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.entry {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.entry-meta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.entry-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.entry-title {
	font-family: var(--font-serif);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.25;
}

.entry-summary {
	font-size: var(--text-small);
}

.tags {
	display: flex;
	gap: 6px;
}

.tag {
	font-family: var(--font-mono);
	font-size: 12.5px;
	color: var(--colour-muted);
	padding: 2px 8px;
	border: 1px solid rgba(154, 160, 171, 0.35);
	border-radius: 3px;
}

.status {
	font-family: var(--font-mono);
	font-size: 12.5px;
	color: var(--colour-accent);
}

.section-link {
	align-self: flex-start;
}

/* Work: job title and employer left, years right. */
.jobs {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.job {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-m);
}

.job-title {
	font-weight: 600;
}

.job-years {
	white-space: nowrap;
}

/* Post page */
.post-header {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.post-title {
	font-family: var(--font-serif);
	font-size: var(--text-title);
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: -0.01em;
}

.post-standfirst {
	font-size: 18px;
	line-height: 1.45;
}

.prose {
	display: flex;
	flex-direction: column;
	gap: 22px;
	font-size: 18px;
	line-height: 1.6;
}

.prose h2 {
	margin-top: var(--space-s);
}

.prose ul,
.prose ol {
	margin: 0;
	padding-left: 24px;
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.prose li::marker {
	color: var(--colour-muted);
}

.prose code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	background: var(--colour-surface);
	padding: 1px 5px;
	border-radius: 3px;
}

.prose pre {
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 1.6;
	background: var(--colour-surface);
	padding: var(--space-m) 20px;
	border-radius: 4px;
	overflow-x: auto;
	margin: 0;
}

.prose pre code {
	font-size: inherit;
	background: none;
	padding: 0;
}

.prose blockquote {
	margin: 0;
	padding-left: var(--space-m);
	border-left: 2px solid var(--colour-rule);
	color: var(--colour-muted);
}

.post-footer {
	display: flex;
	flex-direction: column;
	gap: var(--space-l);
	padding-top: var(--space-l);
	border-top: 1px solid var(--colour-hairline);
}

/* Footer */
.footer {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: var(--space-s) var(--space-m);
	padding-top: var(--space-l);
	border-top: 1px solid var(--colour-hairline);
}

.post-footer .footer {
	padding-top: 0;
	border-top: none;
}

.footer-links {
	display: flex;
	gap: 18px;
}

/* Narrow screens: tighter type, and the log block stacks each line's fields. */
@media (max-width: 720px) {
	:root {
		--text-name: 34px;
		--text-title: 32px;
		--text-heading: 22px;
		--text-lede: 17px;
		--text-body: 16px;
		--text-small: 15px;
		--space-xl: 40px;
	}

	body {
		padding-top: 24px;
	}

	.hero-title {
		gap: var(--space-m);
	}

	.hero-photo {
		width: 56px;
		height: 56px;
	}

	.log {
		padding: 14px 16px;
		font-size: 12.5px;
	}

	.log-line {
		grid-template-columns: 40px minmax(0, 1fr);
	}

	.log-fields {
		grid-column: 2;
		flex-direction: column;
	}

	.job {
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
	}
}
