/* jacobsaunders.xyz — editorial/print-inspired, deliberately not the usual
   flat-card look. No external fonts, no JS, no frameworks.

   To restyle, change the custom properties in :root. Everything else derives
   from them. Layout is a two-column rail + column on wide screens, stacking
   to one column on narrow ones.

   NOTE: the CSP forbids inline styles (style-src 'self'), so all styling
   must live in this file — do not add style="" attributes to the HTML. */

:root {
	--paper: #f4f1ea;
	--ink: #191714;
	--muted: #6d675e;
	--rule: #d6cfc2;
	--accent: #9c4a24;
	--accent-soft: #b8683f;

	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
		"Times New Roman", serif;
	--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;

	--measure: 34rem;
	--rail: 13rem;
	--gap: 3.5rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #14130f;
		--ink: #e9e4d8;
		--muted: #9c9485;
		--rule: #33302a;
		--accent: #d9895a;
		--accent-soft: #e8a179;
	}
}

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

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

body {
	margin: 0;
	background-color: var(--paper);
	/* Very faint paper grain. Inline SVG so there is no external request. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
	color: var(--ink);
	font-family: var(--serif);
	line-height: 1.62;
	text-rendering: optimizeLegibility;
}

.page {
	max-width: 62rem;
	margin: 0 auto;
	padding: 3.5rem 1.6rem 5rem;
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	gap: var(--gap);
	align-items: start;
}

/* ---------- left rail ---------- */

.rail {
	position: sticky;
	top: 3.5rem;
}

.wordmark {
	display: block;
	font-size: 1.32rem;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--ink);
	text-decoration: none;
	font-weight: 600;
}

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

.wordmark::after {
	content: "";
	display: block;
	width: 2.4rem;
	height: 2px;
	margin-top: 0.85rem;
	background: var(--accent);
}

.tagline {
	margin: 0.85rem 0 0;
	font-family: var(--sans);
	font-size: 0.76rem;
	letter-spacing: 0.02em;
	color: var(--muted);
	max-width: 11rem;
}

.nav {
	margin-top: 2.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.nav a {
	font-family: var(--sans);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.13em;
	color: var(--muted);
	text-decoration: none;
	width: fit-content;
	padding-bottom: 2px;
	border-bottom: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.nav a:hover,
.nav a:focus-visible {
	color: var(--ink);
	border-bottom-color: var(--accent);
}

.nav a[aria-current="page"] {
	color: var(--ink);
	border-bottom-color: var(--accent);
}

/* External links (the map) get a small mark rather than an emoji. */
.nav a.ext::after {
	content: " ↗";
	color: var(--accent);
	letter-spacing: 0;
}

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

.content {
	max-width: var(--measure);
	border-left: 1px solid var(--rule);
	padding-left: var(--gap);
	margin-left: calc(var(--gap) * -1 + var(--gap));
}

.lede {
	font-size: 1.28rem;
	line-height: 1.5;
	margin: 0 0 2.6rem;
	color: var(--ink);
}

section {
	margin: 0 0 3rem;
}

/* Margin markers: a numbered label sitting to the left of each heading.
   This is what stops the page reading like a generic template. */
section > h2 {
	font-family: var(--sans);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--muted);
	font-weight: 600;
	margin: 0 0 0.9rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--rule);
	position: relative;
}

section > h2::before {
	content: counter(sec, decimal-leading-zero);
	counter-increment: sec;
	position: absolute;
	top: 0.9rem;
	left: -3.1rem;
	color: var(--accent);
	letter-spacing: 0;
}

.content {
	counter-reset: sec;
}

h3 {
	font-size: 1.06rem;
	margin: 0 0 0.3rem;
	font-weight: 600;
}

p {
	margin: 0 0 1.1rem;
}

a {
	color: var(--accent);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

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

.placeholder {
	color: var(--muted);
	font-style: italic;
}

/* Simple list of entries — projects, clips, posts. Add <li> items. */
.entries {
	list-style: none;
	margin: 0;
	padding: 0;
}

.entries li {
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--rule);
}

.entries li:first-child {
	border-top: 1px solid var(--rule);
}

.entries .meta {
	font-family: var(--sans);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	color: var(--muted);
}

.foot {
	grid-column: 2;
	margin-top: 1rem;
	padding-left: var(--gap);
	font-family: var(--sans);
	font-size: 0.72rem;
	color: var(--muted);
}

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

@media (max-width: 44rem) {
	.page {
		grid-template-columns: 1fr;
		gap: 2.4rem;
		padding: 2.4rem 1.3rem 3.5rem;
	}

	.rail {
		position: static;
	}

	.nav {
		margin-top: 1.4rem;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.9rem 1.4rem;
	}

	.content {
		border-left: 0;
		padding-left: 0;
		margin-left: 0;
	}

	section > h2::before {
		position: static;
		display: inline;
		margin-right: 0.6rem;
	}

	.foot {
		grid-column: 1;
		padding-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
