/* ---------------------------------------------------------------------------
   Plain static stylesheet. No framework, no build step.
   --------------------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --fg: #1b2125;
  --muted: #6d7880;
  --accent: #0a6ebd;
  --rule: #e6e8ea;
  --bar: #1b2125;
  --bar-fg: #f2f2f2;
  --award: #9b2226;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191c;
    --fg: #dfe3e6;
    --muted: #9aa3a9;
    --accent: #5cb3ea;
    --rule: #2b3236;
    --bar: #0d1113;
    --bar-fg: #dfe3e6;
    --award: #e06c75;
  }
}

html {
  font-family: -apple-system, "Noto Sans", BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 60px; /* height of the fixed navbar */
}

body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  background: var(--bg);
}

/* --- navigation ---------------------------------------------------------- */

div.navbar {
  background: var(--bar);
  position: fixed;
  top: 0;
  width: 100%;
  max-width: inherit;
  display: flex;
  flex-wrap: wrap;          /* wrap rather than hide items off the right edge */
  white-space: nowrap;
  z-index: 10;
}

div.navbar a {
  display: block;
  color: var(--bar-fg);
  text-align: center;
  padding: 10px 12px;
  text-decoration: none;
}

div.navbar a:hover {
  background: #ddd;
  color: #1b2125;
  text-decoration: none;
}

div.main {
  margin-top: 56px;
  padding: 0 16px 48px;
}

/* --- header -------------------------------------------------------------- */

header.profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  margin: 16px 0 8px;
}

header.profile img {
  object-fit: contain;
  height: 210px;
  border-radius: 2px;
}

header.profile h1 {
  font-size: 180%;
  font-weight: 600;
  margin: 4px 0 0;
}

header.profile h3 {
  font-size: 100%;
  font-style: italic;
  font-weight: 400;
  margin: 0;
}

header.profile h3 a {
  color: var(--fg);
}

header.profile table {
  border-collapse: collapse;
  margin-top: 10px;
}

header.profile td {
  padding: 1px 6px 1px 0;
  vertical-align: top;
}

header.profile td:first-child {
  color: var(--muted);
  width: 20px;
  text-align: center;
}

/* --- typography ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 4px;
  line-height: 1.25;
  font-weight: 600;
}

h1 { font-size: 160%; }
h2 { font-size: 130%; }
h3 { font-size: 112%; }
h4, h5, h6 { font-size: 104%; }

p {
  margin: 8px 0;
}

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

a:hover {
  text-decoration: underline;
}

b, strong { font-weight: 600; }

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

ul, ol {
  padding-left: 1.3rem;
  margin-top: 6px;
}

li:not(:first-child) {
  margin-top: 0.4rem;
}

li p { margin: 0; }

code, pre {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 90%;
}

/* --- publications -------------------------------------------------------- */

h3.pub-year {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 105%;
  letter-spacing: 0.04em;
}

ul.pub-list li:not(:first-child) {
  margin-top: 0.9rem;
}

.paper-title { font-weight: 600; }
.paper-authors { font-weight: 400; }
.paper-venue { font-style: italic; }
.paper-year { font-weight: 600; }
.paper-award { font-weight: 600; color: var(--award); }

.paper-links {
  color: var(--muted);
}

/* keep a short group like [pdf | code] from splitting across lines, but let
   long citation groups wrap -- they overflow narrow screens otherwise */
.paper-links a {
  white-space: nowrap;
}

/* --- tables (rejections page) -------------------------------------------- */

table.data {
  border-collapse: collapse;
  margin: 12px 0 20px;
  width: 100%;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--rule);
  padding: 6px 10px 6px 0;
  text-align: left;
}

table.data th {
  font-weight: 600;
  border-bottom: 2px solid var(--rule);
}

table.data td.num,
table.data th.num {
  text-align: center;
  padding-right: 10px;
}

/* --- misc ---------------------------------------------------------------- */

.note {
  color: var(--muted);
}

footer {
  margin-top: 2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 88%;
}

footer a { color: var(--muted); }

/* --- narrow screens ------------------------------------------------------ */

@media (max-width: 620px) {
  header.profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  header.profile img { height: 180px; }

  /* A wrapped bar has no fixed height to offset against, so let it scroll
     away with the page instead of pinning it. */
  div.navbar {
    position: static;
  }
  div.main {
    margin-top: 16px;
  }
  html {
    scroll-padding-top: 8px;
  }
}

/* --- awards -------------------------------------------------------------- */

ul.award-list li:not(:first-child) {
  margin-top: 0.7rem;
}

ul.award-list .paper-authors {
  color: var(--muted);
}

.paper-note {
  font-style: italic;
  color: var(--muted);
}

/* --- teaching ------------------------------------------------------------ */

.course-level {
  font-weight: 400;
  font-size: 85%;
  font-style: italic;
  color: var(--muted);
}

h3 + ul.terms {
  margin-top: 4px;
}

ul.terms > li:not(:first-child) {
  margin-top: 0.45rem;
}

ul.lectures {
  margin-top: 3px;
  list-style: circle;
}

ul.lectures li:not(:first-child) {
  margin-top: 0.15rem;
}

h2.subhead {
  font-size: 112%;
  color: var(--muted);
  margin-top: 1.6rem;
}

p.course-desc {
  margin: 3px 0 6px;
  color: var(--muted);
}

.paper-artifact {
  color: var(--muted);
  font-style: italic;
}

/* --- short bio ----------------------------------------------------------- */

blockquote.bio-text {
  margin: 8px 0 16px;
  padding: 10px 14px;
  border-left: 3px solid var(--rule);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}

blockquote.bio-text p {
  margin: 0;
}
