/* trouge.net: one small stylesheet, no frameworks */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --text: #1d2125;
  --strong: #0b0d0f;        /* bold text and headings */
  --muted: #5b6570;
  --line: #e1e5ea;
  --link: #0b5cad;
  --accent: #1565c0;
  --bar: #2f353b;
  --bar-text: #f3f5f7;
  --tag-bg: #e8f0fb;
  --tag-text: #0d4a8f;
  --award: #8a5a00;
  --banner-bg: #fff4e0;
  --banner-line: #e3a13a;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* Dark mode: the saved choice (data-theme on <html>) wins; otherwise follow the system setting */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #16191c; --bg-soft: #1e2226; --text: #c9d0d7; --strong: #ffffff; --muted: #9aa4ae; --line: #2c3238;
    --link: #ffb34d; --accent: #ffb34d; --bar: #0f1113; --bar-text: #f3f5f7;
    --tag-bg: #2a2f35; --tag-text: #ffcf8a; --award: #ffcf8a;
    --banner-bg: #2a2417; --banner-line: #c98a2a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #16191c; --bg-soft: #1e2226; --text: #c9d0d7; --strong: #ffffff; --muted: #9aa4ae; --line: #2c3238;
      --link: #ffb34d; --accent: #ffb34d; --bar: #0f1113; --bar-text: #f3f5f7;
      --tag-bg: #2a2f35; --tag-text: #ffcf8a; --award: #ffcf8a;
    --banner-bg: #2a2417; --banner-line: #c98a2a;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }  /* same column position on short and long pages */
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
/* Emphasis by brightness as well as weight: on dark backgrounds light text already looks heavy,
   so body text is a soft off-white and bold text / headings are pure white. */
strong, b, h1, h2, h3, h4, .pub-title { color: var(--strong); }
a strong, a b, a h3 { color: inherit; }
:root[data-theme="dark"] body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
/* one column for header, page and footer: 820px of content + 20px padding on each side */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---------- top bar & menu ---------- */
.topbar { background: var(--bar); color: var(--bar-text); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 56px; flex-wrap: wrap; }
.brand { color: var(--bar-text); text-decoration: none; font-weight: 650; font-size: 1.05rem; display: flex; flex-direction: column; line-height: 1.2; padding: 8px 0; }
.brand span { font-weight: 400; font-size: .78rem; opacity: .7; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.menu > li { position: relative; }
.menu a, .menu span { display: block; padding: 16px 11px; color: var(--bar-text); text-decoration: none; font-size: .92rem; cursor: pointer; opacity: .85; }
.menu a:hover, .menu span:hover, .menu .active > a, .menu .active > span, .menu a[aria-current] { opacity: 1; }
.menu .active > a, .menu .active > span { box-shadow: inset 0 -3px 0 var(--accent); }
/* drop-down chevron: points down, flips up while the menu is open */
.has-sub > span { display: flex; align-items: center; gap: 8px; }
.has-sub > span::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
                         transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.has-sub:hover > span::after, .has-sub:focus-within > span::after { transform: translateY(2px) rotate(-135deg); }
.sub { list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; top: 100%; min-width: 200px;
       background: var(--bar); border-radius: 0 0 var(--radius) var(--radius); display: none; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.sub a { padding: 8px 16px; }
.has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
/* desktop: name on the left; menu items and the light/dark button grouped on the right */
.topbar nav { order: 1; margin-left: auto; }
.tools { order: 2; display: none; align-items: center; }
.theme-item { display: flex; align-items: center; margin-left: 10px; }
.menu .theme-item span.theme-label { display: none; padding: 0; opacity: 1; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
                border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: transparent; color: var(--bar-text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--bar-text); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; }
}
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 860px) {
  .tools { display: flex; }
  /* the button folds into the menu: a full-width row with a text label */
  .theme-item { margin: 4px 0 0; }
  .theme-toggle { width: auto; height: auto; padding: 8px 0; gap: 8px; border: 0; border-radius: 0; font: inherit; font-size: .92rem; opacity: .85; }
  .theme-toggle:hover { opacity: 1; }
  .menu .theme-item span.theme-label.i-moon { display: inline; }
  :root[data-theme="dark"] .menu .theme-item span.theme-label.i-moon { display: none; }
  :root[data-theme="dark"] .menu .theme-item span.theme-label.i-sun { display: inline; }
  .nav-burger { display: block; color: var(--bar-text); padding: 8px 0; cursor: pointer; font-size: .92rem; }
  .topbar nav { display: none; width: 100%; padding-bottom: 10px; order: 3; }
  .nav-toggle:checked ~ nav { display: block; }
  .menu { flex-direction: column; }
  .menu a, .menu span { padding: 8px 0; }
  .menu .active > a, .menu .active > span { box-shadow: none; }
  .sub { display: block; position: static; box-shadow: none; padding: 0 0 0 16px; }
  .has-sub > span::after { display: none; }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .menu .theme-item span.theme-label.i-moon { display: none; }
  :root:not([data-theme="light"]) .menu .theme-item span.theme-label.i-sun { display: inline; }
}

/* ---------- content ---------- */
main.wrap { padding-top: 32px; padding-bottom: 56px; }
.prose { max-width: none; }
.page-title { font-size: 2rem; line-height: 1.2; margin: 0 0 .6em; }
/* home: "on this page" links */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.jump a { font-size: .85rem; line-height: 1.6; padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px;
          color: var(--text); text-decoration: none; background: var(--bg-soft); }
.jump a:hover { border-color: var(--link); color: var(--link); }
.prose [id] { scroll-margin-top: 76px; }

/* callout: a quieter note inside a page (lighter than the banner) */
.callout { margin: 1em 0 1.4em; padding: 10px 16px; background: var(--bg-soft); border-left: 3px solid var(--accent);
           border-radius: 0 var(--radius) var(--radius) 0; }
.callout p { margin: .2em 0; }

/* banner: a highlighted box placed on top of a page (e.g. "I am hiring!") */
.banner { background: var(--banner-bg); border: 1px solid var(--banner-line); border-left-width: 5px; border-radius: var(--radius);
          padding: 14px 20px 6px; margin: 4px 0 28px; }
.banner .banner-label { margin: 0 0 2px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prose .banner h2 { margin: 0 0 .35em; padding: 0; border: 0; font-size: 1.25rem; }
.banner p { margin: 0 0 .8em; }
.prose h2, .people h2, .pub-year h2 { font-size: 1.35rem; margin: 2em 0 .5em; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.1rem; margin: 1.6em 0 .4em; }
.prose h4 { font-size: 1rem; margin: 1.2em 0 .3em; }
.prose li { margin: .2em 0; }
.prose blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--line); padding: 4px 8px; }
.subtitle, .meta, .crumb { color: var(--muted); margin-top: -.3em; }
.crumb { margin: 0 0 .5em; font-size: .9rem; } .crumb a { color: var(--muted); }
.links a { margin-right: 14px; font-size: .92rem; }

/* home */
.hero { display: flex; gap: 28px; align-items: center; padding: 8px 0 12px; }
.hero h1 { margin: 0; font-size: 2.1rem; line-height: 1.15; }
.hero-role { margin: .3em 0 .5em; color: var(--muted); }
.hero-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; flex: none; }
@media (max-width: 600px) { .hero { flex-direction: column; align-items: flex-start; } .hero-photo { width: 120px; height: 120px; } }

/* people & scienceware: one-column lists, image left, text right */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 20px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-media { flex: none; display: block; }
.row-body { min-width: 0; }
.row h3 { margin: 0 0 .25em; font-size: 1.05rem; line-height: 1.35; }
.row .role { font-weight: 400; color: var(--muted); font-size: .92rem; margin-left: 4px; }
.row .bio { margin: 0 0 .35em; }
.row .links { margin: 0; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.thumb { width: 168px; aspect-ratio: 16/9; height: auto; object-fit: cover; border-radius: 4px;
         border: 1px solid var(--line); background: var(--bg-soft); }
.sw { margin-top: .5em; }
@media (max-width: 560px) {
  .row { gap: 14px; }
  .avatar { width: 64px; height: 64px; }
  .thumb { width: 96px; }
}
.kws { display: flex; flex-wrap: wrap; gap: 6px; margin: .1em 0 .45em; }
.kw { font-size: .8rem; line-height: 1.5; padding: 0 8px; border-radius: 4px; background: var(--tag-bg); color: var(--tag-text); }
.plist { padding-left: 1.1em; } .plist li { margin: .35em 0; }

/* past members: a faint panel set apart from the current team, with a quieter timeline list */
.past-members { margin: 3.5em 0 0; padding: 4px 24px 18px; background: var(--bg-soft); border-radius: var(--radius);
                border-top: 1px solid var(--line); }
.past-members .people h3 { margin-top: 1.2em; }
.tlist { list-style: none; padding: 0; margin: .4em 0 0; font-size: .93rem; }
.tlist li { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; padding: .25em 0; }
.tlist .years { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: .08em; }
.tlist .who { color: var(--muted); }
.tlist .who strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .past-members { padding: 2px 14px 14px; } .tlist li { grid-template-columns: 4em 1fr; gap: 8px; } }
.now { display: inline-block; font-size: .8rem; line-height: 1.5; padding: 0 8px; margin-left: 4px; border-radius: 4px;
       background: var(--tag-bg); color: var(--tag-text); font-weight: 600; }
.inline-people { list-style: none; padding: 0; margin: .4em 0 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.inline-people li { white-space: nowrap; }
.years { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* publications */
.year-nav { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; font-size: .92rem; }
.pub-year { scroll-margin-top: 70px; }
.pub-year h2 { display: flex; align-items: baseline; justify-content: space-between; }
.to-top { font-size: .78rem; font-weight: 400; color: var(--muted); text-decoration: none; padding: 0 8px;
          border: 1px solid var(--line); border-radius: 4px; }
.to-top:hover { color: var(--link); border-color: var(--link); }
#top { scroll-margin-top: 80px; }
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.pub:last-child { border-bottom: 0; }
.pub:target { background: var(--bg-soft); }
.pub-title { font-weight: 620; line-height: 1.35; }
.pub-authors { font-size: .93rem; }
.pub-venue { font-size: .93rem; color: var(--muted); font-style: italic; }
.tag { display: inline-block; font-style: normal; font-size: .78rem; font-weight: 600; background: var(--tag-bg); color: var(--tag-text);
       padding: 0 7px; border-radius: 4px; margin-right: 6px; }
.pub-awards { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 1px; }
.award { font-size: .8rem; line-height: 1.6; font-weight: 600; padding: 0 8px; border-radius: 4px;
         background: var(--banner-bg); border: 1px solid var(--banner-line); color: var(--award); }
.pub-links { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.btn { display: inline-block; font-size: .8rem; line-height: 1.6; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px;
       color: var(--link); text-decoration: none; cursor: pointer; background: var(--bg); }
.btn:hover { border-color: var(--link); }
.bib { margin: 0; }
.bib summary { list-style: none; display: block; width: max-content; } .bib summary::-webkit-details-marker { display: none; }
.bib[open] { flex-basis: 100%; }
.bib pre { font: .78rem/1.45 var(--mono); background: var(--bg-soft); padding: 10px 12px; border-radius: var(--radius); overflow-x: auto; margin: 6px 0 0; }

/* teaching: academic year (h2) > semester (h3) > courses */
.teach-year h2 { margin-top: 1.6em; }
.teach-year:first-child h2 { margin-top: .4em; }
.teach-year h3 { font-size: 1rem; color: var(--muted); margin: 1.1em 0 .2em; }
.courses { list-style: none; padding: 0; margin: 0 0 .6em; }
.course { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 5px 0; }
.course-title { font-weight: 600; }
.course-logo { height: 16px; width: auto; }
.course-type { color: var(--muted); font-size: .9rem; }
.course-note { color: var(--muted); font-size: .9rem; font-style: italic; }
.course-note::before { content: "("; } .course-note::after { content: ")"; }
.course-cms { margin-left: auto; }

/* notes */
.note-list { list-style: none; padding: 0; } .note-list li { margin: .5em 0; } .note-list time { color: var(--muted); font-size: .9rem; margin-left: 6px; }

.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 360px)); gap: 8px 40px; }
.contact h3 { margin: .6em 0 .1em; font-size: 1rem; }
.contact .note { margin: 0 0 .3em; color: var(--muted); font-size: .9rem; }
.contact address { font-style: normal; margin: 0 0 .8em; }
.contact .reach { grid-column: 1 / -1; margin: .2em 0 0; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 18px 0 28px; }
.foot-items { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; }
.foot-items > span { display: inline-flex; align-items: center; gap: 4px; }
.foot-items > span + span::before { content: "|"; margin: 0 12px; opacity: .6; }
.foot-items img { display: block; width: 80px; height: 15px; }
