/* Site design shared by the index, research, publications, software, teaching and teaching statement pages.
   statement.html keeps the Strata template (main.css, theme.css).
   Dark mode applies when <html data-theme="dark"> (set by assets/js/theme.js). */

:root {
  --ink: #1d1d1f;
  --muted: #5d5d66;
  --faint: #6e717a;
  --link: #1b6f80;
  --accent: #369aae;
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-2: #eceef1;
  --line: #e3e5e8;
  --badge-bg: #e3f2f5;
  --badge-ink: #165a68;
  --code-bg: #101216;
  --hover: linear-gradient(180deg, #f6f7f9 0%, #e9ecef 100%);
  --hover-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  --font-display: "Google Sans", "Google Sans Text", Roboto, Arial, sans-serif;
  --font-text: "Google Sans Text", "Google Sans", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 56px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6e6e6;
  --muted: #a3a8b3;
  --faint: #868b95;
  --link: #6fc3df;
  --accent: #6fc3df;
  --bg: #0b0c0f;
  --surface: #14161a;
  --surface-2: #1b1e23;
  --line: #262a31;
  --badge-bg: #15313a;
  --badge-ink: #8fd3ea;
  --code-bg: #0b0c0f;
  --hover: radial-gradient(120% 75% at 50% 0%, #4a4e57 0%, #2c3037 55%, #23262c 100%);
  --hover-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
}

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

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

main { padding-top: var(--nav-h); }

/* Navigation bar. The right padding leaves room for the theme toggle */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 40px;
  height: var(--nav-h);
  padding: 0 128px 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  position: relative;
  padding: 6px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--ink); }

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-toggle { display: none; }

@media (max-width: 767px) {
  .main-nav { padding: 0 112px 0 16px; gap: 12px; }

  .menu-toggle {
    display: block;
    margin-left: auto;
    padding: 4px 8px;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .nav-links.active { display: flex; }
  .nav-link { padding: 14px 20px; border-top: 1px solid var(--line); }
  .nav-link[aria-current="page"]::after { display: none; }
}

/* Theme toggle (the button is created by assets/js/theme.js) */
.theme-toggle {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 2000;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--accent); }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-title { font-size: 32px; line-height: 1.2; }
.section-lead { max-width: 62ch; margin: 12px 0 0; color: var(--muted); }
.more { font-size: 15px; font-weight: 500; white-space: nowrap; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* Buttons and icon links */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .86; }

.icon-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 24px; font-size: 21px; }
.icon-links a { color: var(--muted); }
.icon-links a:hover { color: var(--ink); text-decoration: none; }

/* Home: hero */
.hero { padding: 80px 0 64px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 72px;
  align-items: start;
}

.hero h1 { font-size: 52px; line-height: 1.08; letter-spacing: -0.02em; }
.hero .role { margin: 14px 0 32px; font-size: 18px; color: var(--muted); }

.hero .lead {
  max-width: 30em;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.35;
  color: var(--ink);
}

.hero .affil { max-width: 62ch; margin: 0; font-size: 16px; color: var(--muted); }

.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
}

/* Home: four recent papers in a row */
.highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 64px;
}

.highlight {
  display: block;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  color: inherit;
}

.highlight:hover { text-decoration: none; }
.highlight:hover .what { color: var(--ink); }
.highlight .venue { font-family: var(--font-display); font-size: 20px; line-height: 1.3; color: var(--ink); }
.highlight .what { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.highlight .who { margin-top: 6px; font-size: 13px; color: var(--faint); }

/* Cards with a 16:9 image, like the software cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
}

.card { position: relative; isolation: isolate; cursor: pointer; }

.card::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 36px;
  background: var(--hover);
  box-shadow: var(--hover-shadow);
  opacity: 0;
  transition: opacity .35s ease;
}

.card:hover::before, .card:focus-within::before { opacity: 1; }

.card-media {
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  background: #000 center / cover no-repeat;
}

.card h3 { margin: 20px 0 6px; font-size: 20px; line-height: 1.3; }
.card h3 a { color: var(--ink); }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card h3 a:hover { text-decoration: none; }
.card:hover h3 a { color: var(--accent); }
.card p { margin: 0 0 12px; font-size: 16px; color: var(--muted); }
.card .meta { font-size: 14px; color: var(--faint); }

/* Citing papers: one factual sentence each */
.cites { margin: 0; padding: 0; list-style: none; }

.cites li {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.cites .source { font-size: 14px; color: var(--muted); }
.cites .source a { display: block; font-size: 15px; font-weight: 500; color: var(--ink); }
.cites .what { color: var(--ink); }
.cited-in { margin: 24px 0 0; font-size: 15px; color: var(--muted); }

/* Home: industry experience */
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 48px;
  padding: 48px;
  border-radius: 24px;
  background: var(--surface);
}

.panel h2 { font-size: 30px; line-height: 1.2; }
.panel .role { margin: 12px 0 0; color: var(--muted); }
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { padding: 14px 0; border-top: 1px solid var(--line); }
.facts li:first-child { padding-top: 0; border-top: 0; }

/* Home: research direction */
.direction .statement {
  max-width: 34em;
  margin-top: 24px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink);
}

/* Inner pages */
.page-head { padding: 72px 0 40px; }
.page-head h1 { font-size: 46px; line-height: 1.1; letter-spacing: -0.02em; }
.page-head p { max-width: 62ch; margin: 18px 0 0; font-size: 19px; color: var(--muted); }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.pill {
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.pill:hover { text-decoration: none; background: var(--line); }

.eyebrow a { color: var(--muted); }

/* Long-form text (teaching statement): a readable measure, left-aligned with the page heading */
.prose { padding-bottom: 80px; }
.prose > * { max-width: 720px; }
.prose p, .prose li { font-size: 18px; line-height: 1.7; }
.prose .intro { font-family: var(--font-display); font-size: 22px; line-height: 1.55; }
.prose h2 { margin: 52px 0 16px; font-size: 26px; line-height: 1.25; }
.prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--faint); }
.prose li strong { font-weight: 500; }

/* Research page: one story per project */
.story { padding: 72px 0; border-top: 1px solid var(--line); }
.story h2 { margin-bottom: 16px; font-size: 36px; line-height: 1.15; }

.question {
  max-width: 34em;
  margin-bottom: 40px;
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.4;
  color: var(--muted);
}

/* Paper figures keep their white background in both themes */
.figure { margin: 0 0 24px; }
.figure-frame { padding: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.figure img { width: 100%; }
.figure figcaption { max-width: 75ch; margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.figures { margin-bottom: 48px; }

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.label {
  margin: 0 0 8px;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}

.story-body > div + div { margin-top: 28px; }
.story-body p { margin: 0 0 .8em; }
.story-body p:last-child { margin-bottom: 0; }

.aside { display: flex; flex-direction: column; gap: 24px; }
.box { padding: 24px; border-radius: 20px; background: var(--surface); }
.box p { font-size: 15px; color: var(--muted); }

.code {
  margin: 12px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--code-bg);
  color: #e6e6e6;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.code .c { color: #8a93a0; }

.link-list { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.link-list li { padding: 5px 0; }
.link-list span { color: var(--muted); }

.story .cites { margin-top: 8px; }
.story .cites li { grid-template-columns: 210px minmax(0, 1fr); }
.story .cited-in { margin-top: 16px; font-size: 14px; }

.subsequent { margin-top: 48px; }

.earlier { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 28px; }
.earlier h3 { margin-bottom: 8px; font-size: 20px; }
.earlier p { font-size: 16px; color: var(--muted); }

/* Publications */
.pub-group { margin-bottom: 56px; }
.pub-group h2 { margin-bottom: 12px; font-size: 26px; }
.pubs { margin: 0; padding: 0; list-style: none; }

.pub {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.pub .year { font-family: var(--font-display); font-size: 17px; color: var(--faint); }
.pub .title { font-family: var(--font-display); font-size: 19px; line-height: 1.35; color: var(--ink); }
.pub .authors { margin-top: 6px; font-size: 15px; color: var(--muted); }
.pub .me { color: var(--ink); font-weight: 500; }
.pub .venue { margin-top: 2px; font-size: 15px; color: var(--ink); }
.pub .links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; font-weight: 500; }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 10px;
  border-radius: 99px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  vertical-align: 2px;
  white-space: nowrap;
}

.compact { margin: 0; padding: 0; list-style: none; }
.compact li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.compact li strong { font-weight: 500; color: var(--ink); }
.note { font-size: 14px; color: var(--muted); }

/* Teaching */
.entries { margin: 0; padding: 0; list-style: none; }

.entry {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.entry .when { font-family: var(--font-display); color: var(--faint); }
.entry .what { color: var(--ink); }
.entry .where { margin-top: 2px; font-size: 15px; color: var(--muted); }

/* Footer */
.site-footer { padding: 40px 0 56px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* Narrower screens */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { order: -1; }
  .hero-photo img { width: 128px; aspect-ratio: 1; border-radius: 50%; object-position: 50% 20%; }
  .hero h1 { font-size: 40px; }
  .hero .lead { font-size: 22px; }
  .earlier { grid-template-columns: 1fr; gap: 28px; }
  .panel { grid-template-columns: 1fr; gap: 28px; padding: 32px; }
  .story-grid { grid-template-columns: 1fr; gap: 36px; }
  .cites li, .story .cites li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .section, .story { padding: 56px 0; }
  .page-head { padding: 48px 0 28px; }
  .page-head h1 { font-size: 36px; }
  .section-title { font-size: 28px; }
  .story h2 { font-size: 29px; }
  .question { font-size: 20px; }
  .prose .intro { font-size: 19px; }
  .cards, .highlights { grid-template-columns: 1fr; }
  .figure-frame { padding: 12px; border-radius: 14px; }
  .figure-frame img { min-width: 600px; }   /* wide figures pan inside their frame */
  .pub, .entry { grid-template-columns: 1fr; gap: 4px; }
  .section-head { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .card::before { transition: none; }
}
