/* Shared styles for index.html and papers.htm */

:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --text: #1c2326;
  --muted: #5c676e;
  --line: #e3e6e4;
  --accent: #006666;
  --accent-hover: #004c4c;
  --accent-soft: #e5f1f0;
  --award-bg: #fdf1d3;
  --award-text: #74510a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111618;
    --surface: #182023;
    --text: #e4e8e9;
    --muted: #9ba7ac;
    --line: #273236;
    --accent: #5fc4bb;
    --accent-hover: #8adbd3;
    --accent-soft: #15302e;
    --award-bg: #3a2f12;
    --award-text: #f2cd72;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 0.18em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: 54rem; margin: 0 auto; padding: 0 1.25rem; }

/* Top navigation */

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 3.25rem;
}
.topnav .home {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.topnav ul {
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 0.9rem;
}
.topnav ul::-webkit-scrollbar { display: none; }
.topnav ul a { color: var(--muted); white-space: nowrap; }
.topnav ul a:hover { color: var(--accent); text-decoration: none; }

/* Header */

.hero {
  display: grid;
  grid-template-columns: 13.5rem 1fr;
  gap: 2.25rem;
  align-items: center;
  padding: 3rem 0 2.5rem;
}
.portrait {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
}
.hero h1 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.hero .affil { margin: 0 0 1rem; color: var(--muted); line-height: 1.5; }
.hero .affil strong { color: var(--text); font-weight: 600; }
.hero.simple { display: block; padding: 2.5rem 0 0.75rem; }
.hero.simple h1 { font-size: 2.2rem; }

.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1rem;
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
}
.contact dt { color: var(--muted); }
.contact dd { margin: 0; }

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.pills a {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
}
.pills a:hover { border-color: var(--accent); text-decoration: none; }

.intro { margin: 0 0 1.25rem; font-size: 1.05rem; line-height: 1.65; }

.news {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: var(--accent-soft);
}
.news .tag {
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Sections */

section { padding: 2.25rem 0 0.5rem; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
h2 .aside { font-family: var(--sans); font-size: 0.9rem; font-weight: 500; }

h3 {
  margin: 1.75rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h2 + h3 { margin-top: 0; }

.list { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.list > li { padding: 0.45rem 0; }
.list .note { color: var(--muted); }

.cols { columns: 2 18rem; column-gap: 2.5rem; }

.years { color: var(--muted); white-space: nowrap; }
.cols > li { break-inside: avoid; }
.alumni .thesis { margin-top: 0.1rem; color: var(--muted); font-size: 0.9rem; }

/* Award cards */

.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.awards li {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  line-height: 1.45;
}
.awards .what { display: block; margin-bottom: 0.3rem; color: var(--award-text); font-size: 0.8rem; font-weight: 650; letter-spacing: 0.02em; }
.awards .with { display: block; margin-top: 0.3rem; font-size: 0.9rem; }
.awards .when { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.85rem; }

/* Publications */

.pubs { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.pubs > li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.pubs > li:last-child { border-bottom: 0; }
.pubs > li > a:first-child, .pubs .title { font-weight: 550; line-height: 1.4; }
.pubs .title { color: var(--text); }
.pubs .authors { margin-top: 0.1rem; font-size: 0.9rem; line-height: 1.45; }
.cites > li { display: grid; grid-template-columns: 8rem 1fr; gap: 0 1.25rem; }
.cites .tag { padding-top: 0.15rem; color: var(--muted); font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cites .body > a:first-child { font-weight: 550; line-height: 1.4; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.55rem;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.meta a {
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.6;
}
.meta a:hover { border-color: var(--accent); text-decoration: none; }
.meta a.inline { padding: 0; border: 0; font-size: inherit; line-height: inherit; }
.meta a.inline:hover { text-decoration: underline; }
.award {
  padding: 0 0.5rem;
  border-radius: 6px;
  background: var(--award-bg);
  color: var(--award-text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.6;
}
.pubs .more { margin-top: 0.3rem; color: var(--muted); font-size: 0.875rem; }

.paperlinks { color: var(--muted); font-size: 0.9rem; }

.projects { margin: 0 0 0.5rem; padding: 0; list-style: none; }
.projects > li { display: grid; grid-template-columns: 4rem 1fr; gap: 1.1rem; align-items: start; padding: 0.6rem 0; }
.projects img { width: 4rem; height: 4rem; border-radius: 12px; object-fit: cover; }
.projects .pname { font-weight: 550; }
.projects p { margin: 0.25rem 0 0.2rem; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }

footer { margin-top: 2rem; padding: 1.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Small screens */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topnav .home { display: none; }
  .topnav ul { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 2rem; }
  .hero { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 2rem; }
  .portrait { width: 11rem; }
  .hero h1 { font-size: 2.1rem; }
  .cites > li { grid-template-columns: 1fr; }
  .cites .tag { padding: 0 0 0.1rem; }
  h2 { font-size: 1.4rem; }
}

@media print {
  .topnav { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  section { break-inside: auto; }
}
