:root {
	--paper: #f5f5f2;
	--ink: #111111;
	--muted: #686864;
	--line: #c7c7c0;
	--panel: #ecece7;
	--max: 1240px;
}

:root[data-theme="dark"] {
	--paper: #0d0d0d;
	--ink: #f3f3ef;
	--muted: #aaa9a2;
	--line: #383835;
	--panel: #171716;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	transition: background-color 180ms ease, color 180ms ease;
}

a { color: inherit; }

.skip-link {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 20;
	padding: 8px 12px;
	background: var(--ink);
	color: var(--paper);
	transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header,
main,
footer {
	width: min(calc(100% - 48px), var(--max));
	margin-inline: auto;
}

.site-header {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	column-gap: clamp(24px, 4vw, 64px);
	align-items: center;
	min-height: 76px;
	border-bottom: 1px solid var(--ink);
}

.wordmark {
	width: fit-content;
	font-weight: 800;
	letter-spacing: -0.05em;
	text-decoration: none;
}

nav {
	display: flex;
	justify-self: center;
	gap: clamp(15px, 1.8vw, 26px);
}

nav a,
.resume-nav,
.theme-toggle,
.profile-links a,
.text-link,
footer a {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

nav a { text-decoration: none; }
nav a:hover, nav a:focus-visible { text-decoration: underline; text-underline-offset: 5px; }

.header-actions {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 18px;
	white-space: nowrap;
}

.resume-nav,
.theme-toggle {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	border-bottom: 1px solid currentColor;
	padding: 2px 0 1px;
	line-height: 1;
}

.resume-nav {
	text-decoration: none;
}

.theme-toggle {
	border: 0;
	border-bottom: 1px solid currentColor;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.hero {
	min-height: 680px;
	padding: 70px 0 54px;
	border-bottom: 1px solid var(--ink);
}

.kicker,
.section-label,
.section-index {
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

h1 {
	max-width: 1080px;
	margin: 38px 0 72px;
	font-size: clamp(68px, 12vw, 166px);
	font-weight: 700;
	letter-spacing: -0.075em;
	line-height: 0.78;
}

.hero-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: clamp(48px, 10vw, 150px);
	max-width: 900px;
	margin-left: auto;
}

.hero-grid p { margin: 0; }
.hero-grid .intro { font-size: clamp(20px, 2.2vw, 29px); line-height: 1.32; letter-spacing: -0.025em; }

.research-note {
	max-width: 540px;
	margin: 48px 0 0 auto;
	color: var(--muted);
}

.hero-quote {
	max-width: 900px;
	margin: 72px 0 0;
	font-size: clamp(32px, 5vw, 68px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.055em;
}

.profile-links {
	display: flex;
	gap: 22px;
	margin-top: 52px;
	justify-content: flex-end;
}

.profile-links a,
.text-link { text-underline-offset: 5px; }

.feature {
	display: grid;
	grid-template-columns: 1fr 3fr;
	gap: 32px;
	padding: 64px 0;
	border-bottom: 1px solid var(--ink);
}

.feature > div {
	display: grid;
	grid-template-columns: 0.35fr 1.25fr 1fr;
	gap: 32px;
	align-items: start;
}

.feature-number {
	margin: -12px 0 0;
	font-size: clamp(58px, 7vw, 100px);
	font-weight: 700;
	letter-spacing: -0.07em;
	line-height: 1;
}

.feature h2 {
	margin: 0;
	font-size: clamp(28px, 4vw, 55px);
	line-height: 1;
	letter-spacing: -0.055em;
}

.feature > div > p:not(.feature-number) { margin: 0; color: var(--muted); }
.feature .text-link { grid-column: 3; }

.section {
	display: grid;
	grid-template-columns: 1fr 3fr;
	gap: 32px;
	padding: 88px 0;
	border-bottom: 1px solid var(--ink);
}

.section-heading { padding-right: 24px; }
.section-heading h2 { margin: 22px 0 0; font-size: clamp(24px, 3vw, 42px); line-height: 1.06; letter-spacing: -0.045em; }

.project-list { min-width: 0; }
.project { position: relative; background: var(--panel); padding: 32px; }
.featured-project { padding: clamp(30px, 5vw, 64px); margin-bottom: 16px; }
.project-topline { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.project h3 { margin: 50px 0 20px; font-size: clamp(36px, 5vw, 72px); letter-spacing: -0.055em; line-height: 0.95; }
.project p { max-width: 760px; }
.project-lede { font-size: clamp(20px, 2vw, 27px); line-height: 1.3; letter-spacing: -0.02em; }
.project .text-link { display: inline-block; margin-top: 24px; }

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project-grid .project { min-height: 450px; display: flex; flex-direction: column; }
.project-grid .project h3 { margin-top: 44px; font-size: clamp(32px, 3.2vw, 48px); }
.project-grid .project p { margin-bottom: auto; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 32px 0 0; list-style: none; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }


.experience-list { min-width: 0; }
.experience-card { display: flex; flex-direction: column; background: var(--panel); padding: 32px; min-width: 0; }
.experience-featured { padding: clamp(30px, 5vw, 64px); margin-bottom: 16px; }
.experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.experience-grid .experience-card { min-height: 380px; }
.experience-card h3 { margin: 46px 0 10px; font-size: clamp(30px, 3.2vw, 48px); line-height: 1; letter-spacing: -0.055em; }
.experience-featured h3 { font-size: clamp(38px, 5vw, 70px); }
.experience-company { margin: 0 0 22px; font-size: clamp(19px, 2vw, 25px); font-weight: 700; letter-spacing: -0.025em; }
.experience-card > p:not(.experience-company) { margin: 0; max-width: 740px; }
.experience-card .tags { margin-top: auto; padding-top: 30px; }
.experience-featured .tags { margin-top: 30px; padding-top: 0; }

.link-rows,
.writing-list { border-top: 1px solid var(--line); }

.link-rows a,
.writing-list a {
	display: grid;
	grid-template-columns: 0.8fr 2fr auto;
	gap: 24px;
	align-items: baseline;
	padding: 22px 0;
	border-bottom: 1px solid var(--line);
	text-decoration: none;
}

.link-rows span,
.writing-list span,
.link-rows small,
.writing-list small { color: var(--muted); font-size: 12px; }
.link-rows strong,
.writing-list strong { font-size: 18px; letter-spacing: -0.015em; }
.link-rows a:hover strong,
.writing-list a:hover strong { text-decoration: underline; text-underline-offset: 5px; }

.books-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.books-grid h3 { margin: 0 0 26px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.book-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.book-list li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.book-list strong, .book-list span { display: block; }
.book-list strong { font-size: 19px; letter-spacing: -0.02em; }
.book-list span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.closing {
	display: grid;
	grid-template-columns: 1fr 3fr;
	gap: 32px;
	padding: 100px 0;
}

.closing > p:last-child { max-width: 900px; margin: 0; font-size: clamp(38px, 6vw, 82px); line-height: 0.98; letter-spacing: -0.06em; }

footer {
	display: grid;
	grid-template-columns: 1fr auto;
	padding: 24px 0 42px;
	border-top: 1px solid var(--ink);
	font-size: 12px;
}

footer p { margin: 0; }
footer a { text-underline-offset: 4px; }

@media (max-width: 900px) {
	.site-header { grid-template-columns: 1fr auto; }
	.site-header nav { display: none; }
	.hero { min-height: 0; }
	.hero-grid, .feature, .section, .closing { grid-template-columns: 1fr; }
	.hero-grid { margin-left: 0; gap: 28px; }
	.profile-links { justify-content: flex-start; }
	.feature > div { grid-template-columns: 0.35fr 1.2fr; }
	.feature > div > p:not(.feature-number), .feature .text-link { grid-column: 2; }
	.project-grid, .experience-grid { grid-template-columns: 1fr; }
	.project-grid .project { min-height: 360px; }
	.section-heading { display: grid; grid-template-columns: 50px 1fr; align-items: start; }
	.section-heading h2 { margin: 0; }
}

@media (max-width: 620px) {
	.experience-grid { grid-template-columns: 1fr; }
	.experience-grid .experience-card { min-height: 0; }
	.experience-card, .experience-featured { padding: 24px; }
	.site-header, main, footer { width: min(calc(100% - 28px), var(--max)); }
	.site-header { min-height: 62px; }
	h1 { margin: 42px 0 60px; }
	.hero { padding-top: 52px; }
	.feature, .section { padding: 62px 0; }
	.feature > div { grid-template-columns: 1fr; gap: 22px; }
	.feature > div > *, .feature > div > p:not(.feature-number), .feature .text-link { grid-column: 1; }
	.project, .featured-project { padding: 24px; }
	.project-grid .project { min-height: 0; }
	.link-rows a, .writing-list a { grid-template-columns: 1fr auto; gap: 7px 16px; }
	.link-rows span, .writing-list span { grid-column: 1 / -1; }
	.link-rows strong, .writing-list strong { font-size: 16px; }
	.books-grid { grid-template-columns: 1fr; gap: 52px; }
	.closing { padding: 72px 0; }
	footer { grid-template-columns: 1fr auto; gap: 7px 20px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	body { transition: none; }
}
