/* =================================================================
   Erica L. McCormick: shared stylesheet for every page.
   Plain CSS, no framework. Colors and fonts are set once in :root.
   ================================================================= */

/* IBM Plex Sans, hosted on this site (one variable-weight file covers 400–700) */
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
}

:root {
	--bg: #ffffff;
	--bg-soft: #f4f6f7;
	--text: #1e2a32;        /* dark slate */
	--muted: #5d6b74;
	--rule: #dde3e6;
	--accent: #1f4e79;      /* water blue: links, buttons */
	--accent-dark: #163a5b;
	--hover: #9a4f1d;       /* ochre: link hover (dark enough for 4.5:1 contrast) */
	--sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--wrap: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
section { padding-block: 2.5rem; scroll-margin-top: 1rem; }
main { padding-bottom: 1rem; }

/* Accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--bg); padding: .6rem 1rem; border: 2px solid var(--accent); border-radius: 6px; }

/* Section heading with a thin rule underneath */
h2.sec { padding-bottom: .4rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.4rem; }
.page-title { padding-block: 2.5rem 0; }
.page-title h1 { margin: 0; }

/* ---------- Header: name left, menu right ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.1rem; }
.brand { font-size: 1.6rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1.2; }
.brand:hover { color: var(--text); text-decoration: none; }
/* Home page only: bigger name (the name is the page's h1 there) */
.home-name { margin: 0; font-size: inherit; letter-spacing: normal; }
.home-header .wrap { padding-block: 1.75rem 1.25rem; }
.home-header .brand { font-size: 2.6rem; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .1rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-block; color: var(--muted); font-weight: 500; font-size: .98rem; padding: .5rem 0; } /* ~44px tap target */
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }   /* current page in blue */

/* ---------- Buttons (rounded) ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.btn { display: inline-block; padding: .6rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
       background: var(--accent); color: #fff; border: 1.5px solid var(--accent); }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn.outline { background: transparent; color: var(--accent); }
.btn.outline:hover { background: var(--bg-soft); color: var(--accent-dark); }

/* ---------- Home: About ---------- */
.about { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 2.75rem; align-items: start; }   /* photo top lines up with the first line of text */
.about img { width: 320px; height: 320px; object-fit: cover; border-radius: 14px; }
.about .contact { font-size: .95rem; color: var(--muted); }
.about .contact a, .about .contact .nowrap { white-space: nowrap; }
.about .bio p:first-child { margin-top: -.3rem; }   /* lifts the first line level with the top of the photo */
.about p { max-width: 64ch; }

/* ---------- Projects ----------
   One <article class="project"> block is used on both pages.
   Inside <div class="cards"> (home) it shows as a grid card;
   inside <div class="rows"> (research.html) it shows as a full-width row.
   So a block can be cut from one page and pasted into the other unchanged. */
.project img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
.project figure { margin: 0; }
.project figcaption { font-size: .8rem; color: var(--muted); margin-top: .35rem; line-height: 1.4; }
.project h3 a { color: var(--text); }
.project h3 a:hover { color: var(--accent); }
.project p { color: var(--muted); margin: 0; }
/* "McCormick et al. (2021) Nature →" button that opens the paper */
.paper-btn { display: inline-block; align-self: flex-start; margin-top: 1rem; padding: .4rem .95rem; border: 1.5px solid var(--accent);
             border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--accent); line-height: 1.35; white-space: nowrap; }
.paper-btn:hover { background: var(--bg-soft); color: var(--accent-dark); text-decoration: none; }

.cards { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards .project img { aspect-ratio: 4 / 3; }   /* a little taller than on the Research page */
.cards .project h3 { margin: .9rem 0 .35rem; }
.cards .project p { font-size: .93rem; }
.cards .project .more { display: none; }   /* longer text only shows on the Research page */
.cards .project { display: flex; flex-direction: column; }            /* lets the paper buttons line up */
.cards .project > div { display: flex; flex-direction: column; flex: 1; }
.cards .project .paper-btn { display: none; }   /* home page uses a small arrow on the title instead */
.cards .project h3 a::after { content: "\2197" / ""; display: inline-block; margin-left: .3em; font-size: .8em; color: var(--accent); }   /* ↗, hidden from screen readers */
.cards .project h3 a:hover::after { color: var(--hover); }
.cards .project p.summary { margin-bottom: 1rem; }

.rows .project { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 2rem; align-items: center;
                 padding-block: 1.75rem; border-bottom: 1px solid var(--rule); }
.rows .project:first-child { padding-top: 0; }
.rows .project p { max-width: 65ch; }
.rows .project p + p { margin-top: .7rem; }
.rows .project .summary { display: none; } /* short summary only shows on the home page */

/* ---------- Publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: .9rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.pubs li:first-child { padding-top: 0; }
/* Numbered journal articles: browser counts down from the newest */
ol.pubs.numbered { list-style: decimal; padding-left: 2.2rem; }
ol.pubs.numbered li { padding-left: .4rem; }
ol.pubs.numbered li::marker { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.page-note { color: var(--muted); margin: .6rem 0 0; }
.pubs .me { font-weight: 600; color: var(--text); }
.pubs .links { display: inline-flex; flex-wrap: wrap; gap: .2rem .8rem; margin-left: .3rem; font-weight: 600; font-size: .92rem; }
.pubs .links a { display: inline-block; padding: .2rem 0; }
.pubs .note { color: var(--muted); font-size: .92rem; }
h3.year { font-size: 1rem; color: var(--muted); margin: 1.8rem 0 .4rem; letter-spacing: .02em; }
h3.year:first-of-type { margin-top: 0; }

/* ---------- Simple dated lists: Datasets & Code, Press ---------- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 1.25rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.list .when { color: var(--muted); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; padding-top: .05rem; }
.list .sub { display: block; color: var(--muted); font-size: .92rem; }
.list .item-links { display: flex; flex-wrap: wrap; gap: .1rem 1rem; font-size: .92rem; font-weight: 600; margin-top: .15rem; }

/* ---------- Footer ---------- */
.site-footer .wrap { border-top: 1px solid var(--rule); padding-block: 1.6rem 2.5rem; color: var(--muted); font-size: .9rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .3rem 1.3rem; list-style: none; padding: 0; margin: 0 0 .6rem; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 760px) {
	body { font-size: 16.5px; }
	h1 { font-size: 1.7rem; }
	.brand { font-size: 1.4rem; }
	.site-header .wrap { display: block; text-align: center; }   /* name and menu centred on phones only */
	.site-nav ul { justify-content: center; }
	.site-nav { margin-top: .2rem; }
	.home-header .brand { font-size: 2rem; }
	.about { grid-template-columns: 1fr; gap: 1.25rem; }
	.about img { width: 240px; height: 240px; justify-self: center; }   /* centred on phones only */
	.rows .project { grid-template-columns: 1fr; gap: 1rem; }
	section { padding-block: 1.75rem; }
	.cards .project p { font-size: 1rem; }
	ol.pubs.numbered { padding-left: 1.6rem; }
	ol.pubs.numbered li { padding-left: .2rem; }
	.pubs .links a { padding: .45rem 0; }   /* ~44px tall tap targets on phones */
	.list li { grid-template-columns: 1fr; gap: .1rem; }
}

/* A list directly under a section heading doesn't need its own top line */
h2.sec + .list { border-top: 0; }
