/* James Skon — academic site */
:root {
  --ink: #1d1b19;
  --muted: #5d5850;
  --faint: #8a8378;
  --paper: #fcfbf8;
  --rule: #e2ddd3;
  --panel: #f4f1ea;
  --accent: #4b2a6e;   /* Kenyon purple, used sparingly */
  --accent-soft: #ece6f2;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --measure: 46rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 2.1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; margin-top: 2.2em; }
h3 { font-size: 1.12rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.5rem; z-index: 10; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; font-family: var(--sans); font-size: 0.95rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Layout */
main { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
.prose { max-width: var(--measure); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }

/* Home profile */
.profile {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.portrait {
  width: 13rem;
  aspect-ratio: 4 / 5;
  background: var(--panel);
  border: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait .monogram {
  position: absolute; inset: 0;
  display: none; place-items: center;
  font-size: 3rem; color: var(--faint); letter-spacing: 0.05em;
}
.portrait.no-photo img { display: none; }
.portrait.no-photo .monogram { display: grid; }

.profile h1 { margin-bottom: 0.3rem; }
.roles { list-style: none; padding: 0; margin: 0 0 1.2rem; font-size: 1.05rem; }
.roles li { margin-bottom: 0.15rem; }
.roles .org { color: var(--muted); }
.contact {
  font-family: var(--sans);
  font-size: 0.92rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem;
  margin: 0 0 1.4rem; padding: 0; list-style: none;
}
.bio { max-width: var(--measure); }

/* Areas of work */
.areas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.area { padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.area h3 { margin-top: 0; }
.area p { margin-bottom: 0.6rem; color: var(--ink); }
.more { font-family: var(--sans); font-size: 0.9rem; }

.section-head {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2.6rem 0 0.4rem;
}

/* Two-column pages with a side index */
.with-toc { display: grid; grid-template-columns: 1fr 13rem; gap: 3rem; align-items: start; }
.toc {
  position: sticky; top: 1.5rem;
  font-family: var(--sans); font-size: 0.9rem;
  border-left: 1px solid var(--rule); padding-left: 1rem;
}
.toc p { font-weight: 600; color: var(--faint); margin-bottom: 0.4rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.3rem 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.research-area { max-width: var(--measure); }
.research-area + .research-area { border-top: 1px solid var(--rule); margin-top: 2.5rem; }
.research-area h2 { margin-top: 2.2rem; }
.related { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.pubs li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.pubs .title { font-weight: 600; }
.pubs .venue { font-style: italic; }
.pubs .me { font-weight: 600; }
.pubs .meta { font-family: var(--sans); font-size: 0.82rem; color: var(--faint); margin-top: 0.25rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.tag { color: var(--muted); }
.year { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--muted); margin: 1.8rem 0 0.2rem; }

.filters { font-family: var(--sans); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0 0.6rem; }
.filters button {
  font: inherit; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--rule); padding: 0.2rem 0.7rem; border-radius: 2px;
}
.filters button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: #cdbfdc; }

/* Link list (CoLearn-AI) */
.resource-list { list-style: none; padding: 0; margin: 0.6rem 0 0; max-width: var(--measure); }
.resource-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.resource-list a { font-weight: 600; }
.resource-list span { display: block; color: var(--muted); font-size: 0.98rem; }

.aside-box {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  max-width: var(--measure);
  margin: 1.5rem 0;
}
.aside-box p:last-child { margin-bottom: 0; }

/* People */
.people { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.people li { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.people h3 { margin: 0 0 0.15rem; }
.people .affil { font-family: var(--sans); font-size: 0.92rem; color: var(--muted); margin-bottom: 0.4rem; }
.people p { margin-bottom: 0.4rem; }
.people .links { font-family: var(--sans); font-size: 0.88rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.coauthors { columns: 2; max-width: var(--measure); padding-left: 1.1rem; }
.coauthors li { break-inside: avoid; margin-bottom: 0.3rem; }

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 0.85rem; color: var(--faint);
}
footer .inner { max-width: 64rem; margin: 0 auto; padding: 1.4rem 1rem 2rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.7rem; }
  main { padding-top: 1.6rem; }
  .profile { grid-template-columns: 1fr; gap: 1.4rem; }
  .portrait { width: 10rem; }
  .areas { grid-template-columns: 1fr; }
  .with-toc { grid-template-columns: 1fr; }
  .toc { display: none; }
  .coauthors { columns: 1; }
}

@media print {
  .site-nav, .toc, .filters, footer { display: none; }
  body { background: #fff; }
}
