@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Libre+Baskerville:ital,wght@0,700;1,400&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

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

:root {
	--red: #df815a;
	--yellow: #e7ca52;
	--green: #7dbf94;
	--blue: #639bb4;
	--purple: #9487B1;
	--text: #2d2d2d;
	--text-light: #555;
	--bg: #fafaf8;
	--card-bg: #fff;
	--border: #e0ddd8;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--text);
	background: var(--bg);
	line-height: 1.7;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--blue);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.2s, border-color 0.2s;
}
a:hover {
	color: #3a7a96;
	border-bottom-color: #3a7a96;
}


/* ---- Header ---- */
.site-header {
	max-width: 820px;
	margin: 0 auto;
	padding: 48px 24px 0;
	display: flex;
	align-items: center;
	gap: 28px;
}

.site-header img {
	width: 140px;
	height: auto;
}

.site-header .title-block h1 {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 2.2rem;
	font-weight: 400;
	font-style: italic;
	letter-spacing: 0.02em;
	line-height: 1.2;
	color: var(--text);
}

.site-header .title-block p {
	font-size: 1.05rem;
	color: var(--text-light);
	margin-top: 4px;
	letter-spacing: 0.01em;
}


/* ---- Navigation ---- */
nav {
	max-width: 820px;
	margin: 32px auto 0;
	padding: 0 24px;
}

nav ul {
	list-style: none;
	display: flex;
	gap: 4px;
	border-bottom: 2px solid var(--border);
	padding-bottom: 0;
}

nav li a {
	display: block;
	padding: 10px 20px;
	font-size: 0.82rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #888;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 0.2s, border-color 0.2s;
}

nav li a:hover {
	color: var(--text);
	border-bottom-color: #ccc;
}

nav li.active a {
	color: var(--text);
}

/* color accents */
nav li.c-red a:hover,    nav li.c-red.active a    { border-bottom-color: var(--red); }
nav li.c-yellow a:hover, nav li.c-yellow.active a { border-bottom-color: var(--yellow); }
nav li.c-green a:hover,  nav li.c-green.active a  { border-bottom-color: var(--green); }
nav li.c-blue a:hover,   nav li.c-blue.active a   { border-bottom-color: var(--blue); }
nav li.c-purple a:hover, nav li.c-purple.active a { border-bottom-color: var(--purple); }


/* ---- Main content ---- */
main {
	max-width: 820px;
	margin: 0 auto;
	padding: 40px 24px 48px;
}

main p {
	margin-bottom: 18px;
	color: var(--text-light);
	font-size: 1rem;
	line-height: 1.8;
	text-align: justify;
}

main p i, main li i {
	font-style: normal;
	font-weight: 500;
	color: var(--text);
}


/* ---- Section labels ---- */
.section-label {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #fff;
	padding: 4px 14px;
	border-radius: 4px;
	margin-bottom: 20px;
	margin-top: 32px;
}

.section-label:first-child {
	margin-top: 0;
}

.section-label a {
	color: #fff;
	border: none;
}
.section-label a:hover {
	color: #fff;
	border: none;
}
.section-label.yellow a,
.section-label.yellow a:hover {
	color: var(--text);
}

.section-label.red    { background: var(--red); }
.section-label.yellow { background: var(--yellow); color: var(--text); }
.section-label.green  { background: var(--green); }
.section-label.blue   { background: var(--blue); }
.section-label.purple { background: var(--purple); }


/* ---- Headings inside content ---- */
main h2 {
	font-size: 1.05rem;
	font-weight: 600;
	margin-top: 20px;
	margin-bottom: 6px;
	color: var(--text);
}

main h3 {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 6px;
}


/* ---- Feature cards ---- */
.features {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin: 32px 0;
}

.feature-card {
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 24px;
	transition: box-shadow 0.2s;
}

.feature-card:hover {
	box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.feature-card .card-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	margin-bottom: 12px;
}

.feature-card h3 {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 6px;
}

.feature-card p {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--text-light);
	margin: 0;
}

.card-icon.red    { background: #fdf0eb; color: #c06030; }
.card-icon.green  { background: #edf7f0; color: #4a8c60; }
.card-icon.blue   { background: #eaf2f6; color: #4a7f96; }
.card-icon.purple { background: #f0eef5; color: #6b5d8e; }
.card-icon.yellow { background: #fdf8e8; color: #9e8a20; }


/* ---- CTA buttons ---- */
.cta-row {
	display: flex;
	gap: 12px;
	margin-top: 28px;
	flex-wrap: wrap;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	border: none;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.2s;
}

.btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary {
	background: var(--text);
	color: #fff;
}
.btn-primary:hover {
	color: #fff;
	border-bottom-color: transparent;
}

.btn-secondary {
	background: var(--card-bg);
	color: var(--text);
	border: 1px solid var(--border);
}
.btn-secondary:hover {
	border-bottom-color: transparent;
}


/* ---- Code blocks ---- */
code {
	font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
	font-size: 0.88rem;
	background: #f3f2ef;
	padding: 2px 6px;
	border-radius: 4px;
}

blockquote {
	background: #f3f2ef;
	border-left: 3px solid var(--border);
	padding: 16px 20px;
	border-radius: 0 8px 8px 0;
	margin: 16px 0;
	overflow-x: auto;
}

blockquote code {
	background: none;
	padding: 0;
	font-size: 0.85rem;
	line-height: 1.9;
}


/* ---- Tables ---- */
table.gridtable {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	margin: 16px 0 24px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--border);
}

table.gridtable th {
	background: #f3f2ef;
	padding: 12px 14px;
	text-align: justify;
	font-weight: 600;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-light);
	border-bottom: 2px solid var(--border);
}

table.gridtable td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
	line-height: 1.6;
	color: var(--text-light);
}

table.gridtable tr:last-child td {
	border-bottom: none;
}

table.gridtable .right {
	text-align: right;
}

/* Plain tables (education, employment, etc.) */
table.plain {
	width: 100%;
	border-collapse: collapse;
	margin: 8px 0 16px;
}

table.plain td {
	padding: 10px 16px 10px 0;
	vertical-align: top;
	line-height: 1.7;
	color: var(--text-light);
	border-bottom: 1px solid var(--border);
}

table.plain td:first-child {
	font-weight: 500;
	color: var(--text);
	white-space: nowrap;
	width: 130px;
}

table.plain tr:last-child td {
	border-bottom: none;
}


/* ---- Hanging-indent publication lists ---- */
.hangingindent {
	padding-left: 38px;
}

.hangingindent li {
	list-style-type: none;
	text-indent: -38px;
	margin-right: 0;
	margin-top: 2px;
	margin-bottom: 6px;
	line-height: 1.7;
	color: var(--text-light);
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
}

.hangingindent li:last-child {
	border-bottom: none;
}


/* ---- Image grids ---- */
.image-grid {
	display: grid;
	gap: 12px;
	justify-content: center;
}

.image-grid-3 {
	grid-template-columns: repeat(3, 200px);
}

@media screen and (max-width: 640px) {
	.image-grid-3 {
		grid-template-columns: 1fr;
		max-width: 200px;
		margin: 0 auto;
	}
}


/* ---- Figures / media ---- */
figure {
	margin: 24px 0;
	text-align: center;
}

figure img {
	border-radius: 8px;
	border: 1px solid var(--border);
	max-width: 100%;
	height: auto;
}

figcaption {
	text-align: center;
	margin-top: 10px;
	font-size: 0.88rem;
	line-height: 1.6;
	color: #888;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

video {
	display: block;
	margin: 16px auto;
	border-radius: 8px;
	border: 1px solid var(--border);
	max-width: 100%;
	height: auto;
}

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

img.alignleft {
	float: left;
	margin-right: 18px;
	margin-bottom: 12px;
}

img.alignright {
	float: right;
	margin-left: 20px;
	margin-bottom: 4px;
}

img.aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 12px;
}


/* ---- Unordered lists ---- */
main ul {
	padding-left: 20px;
	margin-bottom: 18px;
}

main ul li {
	margin-bottom: 6px;
	line-height: 1.7;
	color: var(--text-light);
}


/* ---- Note / callout boxes ---- */
.note {
	background: #eaf2f6;
	border: 1px solid #c8dce6;
	border-radius: 8px;
	padding: 16px 20px;
	margin: 20px 0;
	font-size: 0.92rem;
	line-height: 1.7;
	color: var(--text-light);
}


/* ---- Layout helpers ---- */
.row {
	display: flex;
	gap: 20px;
}

.column {
	flex: 50%;
}

table.center {
	margin-left: auto;
	margin-right: auto;
}

table td {
	vertical-align: top;
}


/* ---- Footer ---- */
footer {
	max-width: 820px;
	margin: 0 auto;
	padding: 32px 24px 48px;
	border-top: 1px solid var(--border);
	display: flex;
	gap: 20px;
	align-items: flex-start;
	font-size: 0.88rem;
	line-height: 1.7;
	color: var(--text-light);
}

footer img {
	width: 80px;
	height: auto;
	flex-shrink: 0;
	opacity: 0.85;
}

footer p {
	margin: 0;
}


/* ---- MathJax ---- */
mjx-container {
	overflow-x: auto;
	overflow-y: hidden;
	padding: 8px 0;
}


/* ---- Responsive ---- */
@media screen and (max-width: 640px) {
	.site-header {
		flex-direction: column;
		text-align: center;
		padding-top: 32px;
	}

	.site-header .title-block h1 {
		font-size: 1.7rem;
	}

	nav ul {
		flex-wrap: wrap;
		justify-content: center;
	}

	nav li a {
		padding: 8px 14px;
		font-size: 0.75rem;
	}

	.features {
		grid-template-columns: 1fr;
	}

	footer {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.row {
		flex-direction: column;
	}

	.column {
		flex: 100%;
	}

	table.gridtable {
		font-size: 0.8rem;
	}

	table.gridtable th,
	table.gridtable td {
		padding: 8px 10px;
	}

	/* Unfloat images so they don't squeeze text */
	img.alignleft,
	img.alignright {
		float: none;
		display: block;
		margin: 12px auto;
	}

	/* Reduce hanging indent on narrow screens */
	.hangingindent {
		padding-left: 20px;
	}

	.hangingindent li {
		text-indent: -20px;
	}
}
