/* ja.mesbrown.com — built from mockup 2 "Intro + highlights" (design/mockup-2-intro.dc.html).
   Space Grotesk for headings, Inter for text; slate ink on a cool off-white; one burnt-orange accent for links. */

@font-face {
	font-family: "Inter";
	src: url("/fonts/inter-latin-var.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Space Grotesk";
	src: url("/fonts/space-grotesk-latin-var.woff2") format("woff2");
	font-weight: 300 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--ink: #0f172a;
	--text: #334155;
	--muted: #5b6b80;    /* mockup used #64748b; darkened to pass 4.5:1 on the page background */
	--line: #e2e8f0;
	--line-strong: #cbd5e1;
	--page: #f4f6f8;
	--panel: #ffffff;
	--card: #f8fafc;
	--accent: #c2410c;
	--accent-hover: #9a3412;
	--display: "Space Grotesk", system-ui, sans-serif;
	--body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	--wrap: 65rem;      /* 1040px */
	--narrow: 45rem;    /* 720px reading column */
	--gutter: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--page);
	color: var(--ink);
	font-family: var(--body);
	font-size: 1rem;
	line-height: 1.6;
	font-feature-settings: "cv11", "ss01";
	text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: #fff; padding: 0.5rem 1rem; border-radius: 6px; z-index: 10; }
.skip:focus { left: 0.5rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 1.75rem; }

h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; }

/* ---------- header / footer ---------- */
.site-header {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
	padding-block: 1.75rem;
}
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ink); letter-spacing: -0.01em; }
.wordmark:hover { color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.9375rem; font-weight: 500; }
.site-header nav a { color: var(--text); padding-block: 0.25rem; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); text-decoration: none; }

.site-footer {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
	padding-block: 1.5rem 3rem; margin-top: 4rem;
	font-size: 0.875rem; color: var(--muted);
}
.footer-links { display: flex; gap: 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* ---------- home ---------- */
.intro {
	display: flex; flex-wrap: wrap; align-items: center; gap: 3rem;
	padding-block: 3rem 4.5rem;
}
.intro-text { flex: 999 1 30rem; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.intro .hello { margin: 0; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.intro h1 { margin: 0; font-size: clamp(2.75rem, 7vw, 4rem); line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.intro .tagline { margin: 0; font-size: 1.25rem; line-height: 1.55; color: var(--text); max-width: 35rem; }
.intro-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; padding-top: 0.5rem; }
.button {
	display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.25rem;
	border-radius: 8px; font-weight: 600; font-size: 0.9375rem;
}
.button:hover { text-decoration: none; }
.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: #1e293b; color: #fff; }
.button-light { background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); }
.button-light:hover { border-color: var(--muted); color: var(--ink); }
.intro picture { flex: 1 1 15rem; max-width: 20rem; width: 100%; }
.portrait { flex: 1 1 15rem; display: block; max-width: 20rem; width: 100%; height: auto; aspect-ratio: 1; border-radius: 24px; object-fit: cover; }

.band { background: var(--panel); border-block: 1px solid var(--line); }
.band > .wrap { padding-block: 4rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.section-head h2 { margin: 0; font-size: 2rem; font-weight: 700; }
.section-head a { font-size: 0.9375rem; font-weight: 600; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr)); gap: 1.25rem; }
.card {
	display: flex; flex-direction: column; gap: 0.75rem; height: 100%;
	padding: 1.5rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink);
}
.card:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.card:hover span { color: var(--accent); }
.card time { font-size: 0.8125rem; color: var(--muted); }
.card span { font-family: var(--display); font-size: 1.25rem; line-height: 1.3; font-weight: 500; }

.talks-section { padding-block: 4rem; }
.talks { list-style: none; margin: 0; padding: 0; }
.talks li {
	display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem;
	padding-block: 1rem; border-bottom: 1px solid var(--line); line-height: 1.45;
}
.talks time { flex: 0 0 6rem; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; padding-top: 0.1rem; }
.talk-event { flex: 0 0 12.5rem; font-weight: 600; }
.talk-title { flex: 1 1 16rem; color: var(--text); }

/* ---------- posts and pages ---------- */
.post-header { padding-block: 2.5rem 1.5rem; }
.post-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
.post-meta { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.9375rem; }
.old-note {
	margin: 1rem 0 0; padding: 0.625rem 0.875rem; border-left: 3px solid var(--accent);
	background: var(--panel); color: var(--text); font-size: 0.9375rem; border-radius: 0 6px 6px 0;
}

.prose { font-size: 1.125rem; line-height: 1.7; color: var(--text); overflow-wrap: break-word; }
.prose > * { margin-block: 0 1.25rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-block: 2.25rem 0.75rem; }
.prose h1 { font-size: 1.75rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.0625rem; }
.prose strong { color: var(--ink); }
.prose a { text-decoration: underline; text-decoration-color: rgb(194 65 12 / 0.35); text-underline-offset: 0.15em; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-block: 0.375rem; }
.prose li > p { margin: 0; }
.prose blockquote { margin-inline: 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--line-strong); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.75rem; text-align: left; }

.prose img, .page-image {
	display: block; height: auto;
	max-width: min(100%, var(--w, 100%));
	margin-inline: auto; border-radius: 8px;
}
.prose picture { display: block; }
.prose a:has(img) { display: block; text-decoration: none; }
.page-image { width: 100%; margin-bottom: 1.5rem; }
.prose figure { margin-inline: 0; }
.prose figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted); text-align: center; }

.prose code { font-family: var(--mono); font-size: 0.875em; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.35em; color: var(--ink); }
.prose pre {
	font-family: var(--mono); font-size: 0.875rem; line-height: 1.6;
	background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
	padding: 1rem 1.25rem; overflow-x: auto; tab-size: 4; color: var(--ink);
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--ink); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-wide { aspect-ratio: 4 / 3; background: var(--panel); border: 1px solid var(--line); }
.embed-gone, .img-gone { color: var(--muted); font-size: 0.9375rem; font-style: italic; }
.embed-gone { padding: 1rem 1.25rem; border: 1px dashed var(--line-strong); border-radius: 10px; }

.comments { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comments h2 { font-size: 1.375rem; margin: 0 0 1.25rem; }
.comments ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.comments li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; }
.comment-meta { margin: 0 0 0.375rem; font-size: 0.875rem; color: var(--muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.comment-meta strong { color: var(--ink); }
.comment-text { color: var(--text); }
.comment-text p { margin: 0 0 0.75rem; }
.comment-text p:last-child { margin-bottom: 0; }
.comments-closed { margin-top: 1.25rem; font-size: 0.9375rem; color: var(--muted); }
.comments-closed a, .old-note a { text-decoration: underline; text-underline-offset: 0.15em; }
.back { margin-top: 3rem; font-weight: 600; }

/* ---------- writing list ---------- */
.writing section { margin-top: 2rem; }
.writing h2 { font-size: 1.5rem; margin: 0 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line-strong); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1.5rem; padding-block: 0.75rem; border-bottom: 1px solid var(--line); }
.post-list a { color: var(--ink); font-weight: 500; flex: 1 1 22rem; }
.post-list a:hover { color: var(--accent); }
.post-list time { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- code highlighting (Prism tokens), light, in the site palette ---------- */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #64748b; font-style: italic; }
.token.punctuation { color: #475569; }
.token.tag, .token.keyword, .token.boolean, .token.important, .token.atrule { color: #9a3412; }
.token.attr-name, .token.property, .token.function, .token.class-name { color: #1d4ed8; }
.token.string, .token.attr-value, .token.char, .token.regex, .token.url { color: #15803d; }
.token.number, .token.constant, .token.symbol, .token.entity { color: #7c3aed; }
.token.operator, .token.variable { color: var(--ink); }

@media (max-width: 40rem) {
	.intro { padding-block: 1.5rem 3rem; gap: 2rem; }
	.portrait, .intro picture { max-width: 14rem; order: -1; }
	.band > .wrap, .talks-section { padding-block: 3rem; }
	.section-head h2 { font-size: 1.625rem; }
	.prose { font-size: 1.0625rem; }
	.talks time, .talk-event { flex-basis: auto; }
}

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