/* ---------------------------------------------------------------
   K. Dana Chadwick — personal site
   Lightweight, dependency-free stylesheet. No JS framework required.
   --------------------------------------------------------------- */

/* ---- Tokens -------------------------------------------------- */

:root {
	--bg:            #fbfaf7;
	--bg-alt:        #f2efe9;
	--surface:       #ffffff;
	--text:          #1b2426;
	--muted:         #5a686c;
	--border:        #e2ded6;
	--accent:        #0d6b74;
	--accent-hover:  #0a5057;
	--accent-soft:   #e3f0f1;
	--warm:          #b4551d;
	--shadow:        0 1px 2px rgba(27, 36, 38, .05), 0 8px 24px rgba(27, 36, 38, .06);

	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;

	--measure: 68ch;
	--wide: 1140px;
	--radius: 10px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:           #0e1416;
		--bg-alt:       #131b1e;
		--surface:      #161e21;
		--text:         #e7edee;
		--muted:        #9aa8ac;
		--border:       #253034;
		--accent:       #5cc2cc;
		--accent-hover: #8ad8e0;
		--accent-soft:  #14282b;
		--warm:         #e59461;
		--shadow:       0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
	}
}

/* ---- Reset --------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

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

figure, blockquote { margin: 0; }

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

h1, h2, h3, h4 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 .5em;
	letter-spacing: -.01em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-family: var(--sans); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.2em; }
li { margin-bottom: .4em; }

hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 3px;
}

/* ---- Layout -------------------------------------------------- */

.wrap {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0 1.5rem;
}

.narrow { max-width: var(--measure); }

section.band {
	padding: 3.5rem 0;
	border-top: 1px solid var(--border);
}

section.band.alt { background: var(--bg-alt); }
section.band:first-of-type { border-top: 0; }

.eyebrow {
	font-family: var(--sans);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 .6rem;
}

.lede { font-size: 1.15rem; color: var(--muted); }

.skip {
	position: absolute;
	left: -9999px;
}
.skip:focus {
	left: 1rem; top: 1rem;
	position: fixed;
	z-index: 100;
	background: var(--surface);
	padding: .6rem 1rem;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

/* ---- Header / nav -------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.site-header { background: var(--bg); }
}

.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
	padding-top: .85rem;
	padding-bottom: .85rem;
}

.brand {
	font-family: var(--serif);
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -.01em;
	white-space: nowrap;
}
.brand:hover { color: var(--accent); text-decoration: none; }

.site-nav ul {
	display: flex;
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}
.site-nav li { margin: 0; }

.site-nav a {
	font-size: .93rem;
	font-weight: 500;
	color: var(--muted);
	padding: .2rem 0;
	border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--border); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---- Hero ---------------------------------------------------- */

.hero {
	border-bottom: 1px solid var(--border);
	background: var(--bg-alt);
}

.hero .wrap {
	display: grid;
	grid-template-columns: 1.05fr .95fr;
	gap: 3rem;
	align-items: center;
	padding-top: 4rem;
	padding-bottom: 4rem;
}

.hero h1 { margin-bottom: .35em; }

.hero .tagline {
	font-size: 1.2rem;
	color: var(--muted);
	margin-bottom: 1.2em;
}

.hero-figure img {
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	width: 100%;
}

.hero-figure figcaption {
	font-size: .82rem;
	color: var(--muted);
	margin-top: .7rem;
	line-height: 1.5;
}

.affil {
	list-style: none;
	padding: 0;
	margin: 0 0 1.6rem;
	font-size: .95rem;
	color: var(--muted);
}
.affil li { margin-bottom: .15em; }
.affil strong { color: var(--text); font-weight: 600; }

/* ---- About block (text + portrait) ---------------------------- */

.about {
	display: grid;
	grid-template-columns: minmax(0, var(--measure)) 300px;
	gap: 3rem;
	align-items: start;
}

.about-portrait img {
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	width: 100%;
}

.about-portrait figcaption {
	font-size: .82rem;
	color: var(--muted);
	margin-top: .7rem;
	line-height: 1.5;
}

@media (max-width: 900px) {
	.about { grid-template-columns: 1fr; gap: 1.75rem; }
	.about-portrait { max-width: 320px; }
}

/* ---- Buttons ------------------------------------------------- */

.actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.btn {
	display: inline-block;
	font-size: .92rem;
	font-weight: 600;
	padding: .6rem 1.15rem;
	border-radius: 999px;
	border: 1px solid var(--accent);
	background: var(--accent);
	color: var(--bg);
	transition: background .15s ease, color .15s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg); text-decoration: none; }

.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* ---- Cards --------------------------------------------------- */

.grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
}

@media (min-width: 860px) {
	.grid.two { grid-template-columns: repeat(2, 1fr); }
}

.card h3 { margin-bottom: .4em; }
.card p { font-size: .95rem; color: var(--muted); }
.card p strong { color: var(--text); }

/* ---- Roles table --------------------------------------------- */

.roles {
	list-style: none;
	padding: 0;
	margin: 0;
	border-top: 1px solid var(--border);
}

.roles li {
	display: grid;
	grid-template-columns: 8.5rem 1fr;
	gap: 1.5rem;
	padding: .9rem 0;
	border-bottom: 1px solid var(--border);
	margin: 0;
	align-items: baseline;
}

.roles .when {
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
	font-weight: 600;
	letter-spacing: .02em;
}

.roles .what { font-size: .97rem; }
.roles .what span { display: block; color: var(--muted); font-size: .9rem; }

/* ---- News ---------------------------------------------------- */

.news { display: grid; gap: 1.75rem; }

.news-item {
	display: grid;
	grid-template-columns: 9rem 1fr;
	gap: 1.75rem;
	align-items: start;
}

.news-item .when {
	font-size: .85rem;
	color: var(--muted);
	font-weight: 600;
	letter-spacing: .02em;
	padding-top: .25rem;
}

.news-item h3 { font-size: 1.08rem; margin-bottom: .3em; }
.news-item p { font-size: .95rem; color: var(--muted); margin: 0; }

/* ---- Project blocks ------------------------------------------ */

.project {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.5rem;
	align-items: center;
	margin-bottom: 3.5rem;
}
.project:last-child { margin-bottom: 0; }

.project.flip .project-media { order: 2; }

.project-media img {
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	width: 100%;
}

/* Logos ship on a white background; give them their own plate so they don't
   float on a dark card in dark mode. */
.project-media.logo img {
	background: #fff;
	padding: 1.5rem;
	border: 1px solid var(--border);
}

.project-media figcaption {
	font-size: .8rem;
	color: var(--muted);
	margin-top: .6rem;
}

.project h3 { font-size: 1.45rem; }

/* ---- Full-width banner figure -------------------------------- */

.banner {
	margin-top: 2.5rem;
}

.banner img {
	width: 100%;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	max-height: 420px;
	object-fit: cover;
	object-position: center 40%;
}

.banner figcaption {
	font-size: .82rem;
	color: var(--muted);
	margin-top: .7rem;
}

/* ---- Publications -------------------------------------------- */

.pub-year {
	font-family: var(--sans);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 2.5rem 0 .9rem;
	padding-bottom: .4rem;
	border-bottom: 1px solid var(--border);
}
.pub-year:first-of-type { margin-top: 1rem; }

.pubs { list-style: none; padding: 0; margin: 0; }

.pubs li {
	margin-bottom: 1.1rem;
	font-size: .95rem;
	line-height: 1.55;
	padding-left: 1.1rem;
	text-indent: -1.1rem;
}

.pubs .venue { font-style: italic; }
.pubs .me { font-weight: 600; }

.note {
	font-size: .88rem;
	color: var(--muted);
	background: var(--accent-soft);
	border-left: 3px solid var(--accent);
	padding: .9rem 1.1rem;
	border-radius: 0 var(--radius) var(--radius) 0;
	margin-bottom: 2rem;
}

details.more {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem 1.25rem;
	background: var(--surface);
	margin-bottom: 1.5rem;
}
details.more summary {
	cursor: pointer;
	font-weight: 600;
	font-size: .95rem;
	color: var(--accent);
}
details.more[open] summary { margin-bottom: 1rem; }

/* ---- Two column list ----------------------------------------- */

.cols-2 {
	columns: 2;
	column-gap: 2.5rem;
	font-size: .95rem;
}
.cols-2 li { break-inside: avoid; }

/* ---- Footer -------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--border);
	background: var(--bg-alt);
	padding: 3rem 0 2rem;
	font-size: .93rem;
}

.footer-grid {
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	margin-bottom: 2.5rem;
}

.site-footer h2 {
	font-family: var(--sans);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: .9rem;
}

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35em; }

.colophon {
	border-top: 1px solid var(--border);
	padding-top: 1.5rem;
	font-size: .82rem;
	color: var(--muted);
}
.colophon p { margin-bottom: .3em; }

/* ---- Responsive ---------------------------------------------- */

@media (max-width: 900px) {
	.hero .wrap { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
	.project, .project.flip { grid-template-columns: 1fr; gap: 1.5rem; }
	.project.flip .project-media { order: 0; }
	.cols-2 { columns: 1; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	h1 { font-size: 2rem; }
	h2 { font-size: 1.5rem; }
	.site-header .wrap { gap: .6rem; }
	.site-nav ul { gap: 1.1rem; }
	.roles li, .news-item { grid-template-columns: 1fr; gap: .3rem; }
	.news-item .when { padding-top: 0; }
	section.band { padding: 2.5rem 0; }

	/* The nav wraps to two lines at this width; a sticky two-line bar would
	   eat a third of the viewport, so let the header scroll away instead. */
	.site-header { position: static; backdrop-filter: none; }
}

@media print {
	.site-header, .site-footer, .hero-figure, .actions { display: none; }
	body { background: #fff; color: #000; font-size: 11pt; }
}
