/* CSS Reset: http://meyerweb.com/eric/tools/css/reset */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/**************************************************/
/* Theme variables (dark is the default). */

:root {
  --bg: #0f0f12;
  --text: #e4e4e7;
  --text-secondary: #8b8b9b;
  --muted: #6b6b7b;
  --accent: #60a5fa;
  --border: #26262c;
  --surface: #17171c;
}

[data-theme="light"] {
  --bg: #ffffff;
  --text: #1f2937;
  --text-secondary: #4b5563;
  --muted: #9ca3af;
  --accent: #2563eb;
  --border: #e5e7eb;
  --surface: #f6f7f9;
}

/**************************************************/

#body{
  font-family: 'Asap', roboto, sans-serif;
  font-size: 1em;
  line-height: 1.5em;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

#main {
  width: 54em;
  margin: 0px auto;
  position: relative;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

i {
  font-style: italic;
}

b {
  font-weight: 700;
}

h1 {
  font-size: 2.4em;
  line-height: 2.4em;
  font-weight: 500;
}

/**************************************************/
/* Dark/light mode toggle. */

#theme-toggle {
  position: fixed;
  top: 1.5em;
  right: 1.5em;
  z-index: 100;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.2s ease;
}

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

/**************************************************/
/* Profile image and description. */

#intro {
  padding-top: 6em;
  display: flex;
}

#intro-text {
  width: 40em;
  float: left;
}

#intro-image {
  margin: 3em 0 0 2em;
  width: 12em;
  height: 12em;
  float: left;
  overflow: hidden;
  border-radius: 1em;
}

#intro-image img {
  width: 12em;
}

/**************************************************/
/* News section. */

#news {
  margin-top: 2em;
  display: flex;
  gap: 1.5em;
}

.news-col {
  flex: 1;
  min-width: 0;
}

#news h2 {
  color: var(--text);
  font-size: 1.4em;
  line-height: 1.8em;
  margin-top: 0;
  margin-bottom: 0.25em;
}

.news-list {
  max-height: 15em;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 0.5em;
  background-color: var(--surface);
  padding: 0.75em 1em;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.news-list::-webkit-scrollbar {
  width: 6px;
}

.news-list::-webkit-scrollbar-thumb {
  background-color: var(--muted);
  border-radius: 3px;
}

.news-item {
  line-height: 1.5em;
  margin: 0.5em 0;
  color: var(--text-secondary);
}

.news-item .news-date {
  display: inline-block;
  width: 4.5em;
  vertical-align: top;
  color: var(--muted);
  font-weight: 500;
}

.news-item .news-text {
  display: inline-block;
  width: calc(100% - 5em);
  vertical-align: top;
}

/**************************************************/
/* Research interests. */

#research {
  margin-top: 2.5em;
}

#research h2 {
  color: var(--text);
  font-size: 1.4em;
  line-height: 1.8em;
  margin-top: 0;
  margin-bottom: 0.35em;
}

.research-intro {
  color: var(--text-secondary);
  line-height: 1.5em;
  margin-bottom: 1em;
}

.research-item {
  color: var(--text-secondary);
  line-height: 1.5em;
  margin-bottom: 0.9em;
  padding-left: 1em;
  border-left: 2px solid var(--border);
}

.research-item b {
  color: var(--text);
}

.research-links {
  display: block;
  margin-top: 0.2em;
  font-size: 0.9em;
  color: var(--muted);
}

.research-collab {
  color: var(--text-secondary);
  line-height: 1.5em;
  margin-top: 0.5em;
}

/**************************************************/
/* Section buttons. */

#menu {
  display: flex;
}

.menu-item {
  float: left;
  margin-right: 2em;
}

h2 {
  font-size: 1.6em;
  line-height: 2.4em;
  margin-top: 0.5em;
  color: var(--muted);
}

.selected h2 {
  color: var(--text);
}

.button {
  display: inline-block;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.6em;
  line-height: 2.4em;
  margin-top: 0.5em;
  margin-right: 1em;
  float: left;
  padding: 0;
}

.button:hover {
  color: var(--text);
}

.button:active,
.button.is-checked {
  color: var(--text);
}

.button-group:after {
  content: '';
  display: block;
  clear: both;
}

/**************************************************/
/* Isotope grid list of items. */

.grid {
  padding-bottom: 6em;
}

/* clear fix */
.grid:after {
  content: '';
  display: block;
  clear: both;
}

.description {
  margin-bottom: 1em;
  padding-bottom: 0.5em;
}

.list-item {
  width: 100%;
  line-height: 1em;
  margin-top: 1em;
}

.list-item p.date {
  display: inline-block;
  width: 3em;
  color: var(--muted);
}

/**************************************************/
/* Gallery of 3 preview videos. */

.previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  grid-auto-rows: minmax(100px, auto);
  height: 12.5em;
}

.previews video {
  border-radius: 5px;
}

.previews a:hover {
  border: none;
}

.preview1 {
  grid-column: 1;
  width: 100%;
}
.preview2 {
  grid-column: 2;
  width: 100%;
}
.preview3 {
  grid-column: 3;
  width: 100%;
}

/**************************************************/
/* Buttons for showing more or less highlights. */

.toggle-button {
  margin-top: 1em;
}

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

.toggle-button a:hover {
  color: var(--accent);
}

/**************************************************/
/* Publication details (thumbnail media, title, and description). */

.thumbnail {
/*  width: 21%;*/
  width: 18%;
  float: left;
  margin-right: 2%;
}

.thumbnail:hover {
  border-bottom: none;
}

.thumbnail img {
  margin-top: 0.4em;
  border-radius: 5px;
  width: 100%;
  height: 100%;
}

.thumbnail video {
  margin-top: 0.4em;
  border-radius: 5px;
  width: 100%;
  height: 100%;
}

h3 {
  font-size: 1em;
  line-height: 1.5em;
}

h3 a {
  color: var(--text);
}

h3 a:hover {
  color: var(--accent);
}

.publication {
  margin-bottom: 0.5em;
}

.publication p {
  font-size: 1em;
  line-height: 1.5em;
  color: var(--text-secondary);
}

.project-description {
  width: 80%;
  float: left;
}

/* Publications without a video/image thumbnail span the full width. */
.publication.no-thumb .project-description {
  width: 100%;
}

.award {
  color: #d3a13c;
}

/**************************************************/
/* Subtle footer at the bottom of the page. */

#footer {
  color: var(--muted);
  position: absolute;
  bottom: 0;
  line-height: 2.5em;
}

/**************************************************/
/* Blog posts (posts/*.html). */

.post {
  max-width: 54em;
  margin: 0 auto;
  padding: 5em 1.25em 6em;
}

.post-back {
  display: inline-block;
  margin-bottom: 2em;
  color: var(--muted);
}

.post-kicker {
  color: var(--accent);
  font-size: 0.85em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post h1 {
  font-size: 2.2em;
  font-weight: 500;
  line-height: 1.25em;
  margin: 0.3em 0 0.5em;
}

.post-lead {
  font-size: 1.15em;
  line-height: 1.55em;
  color: var(--text-secondary);
}

.post-meta {
  color: var(--muted);
  font-size: 0.9em;
  margin: 1em 0 2em;
}

.post h2 {
  color: var(--text);
  font-size: 1.4em;
  line-height: 1.35em;
  margin: 2.2em 0 0.5em;
}

.post h3 {
  font-weight: 600;
  margin: 1.6em 0 0.3em;
}

.post p {
  margin: 0.8em 0;
  color: var(--text-secondary);
}

.post em {
  font-style: italic;
}

.post figure {
  margin: 1.5em 0;
}

.post figcaption {
  margin-top: 0.5em;
  font-size: 0.9em;
  color: var(--muted);
}

.post img,
.post video {
  max-width: 100%;
  border-radius: 0.5em;
}

/* Responsive 16:9 YouTube embed. */
.post-video {
  aspect-ratio: 16 / 9;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5em;
  overflow: hidden;
}

.post-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Numbered step list. */
.post ol.steps {
  counter-reset: step;
  margin: 1em 0;
}

.post ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.55em 0 0.55em 2.6em;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.post ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.post ol.steps b,
.post p b,
.post td b {
  color: var(--text);
  font-weight: 600;
}

.post-scroll {
  overflow-x: auto;
}

.post table {
  width: 100%;
  margin: 1em 0;
  font-size: 0.95em;
}

.post th,
.post td {
  text-align: left;
  vertical-align: top;
  padding: 0.5em 0.6em;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.post th {
  color: var(--muted);
  font-size: 0.8em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Small labels saying where a result was measured. */
.tag {
  display: inline-block;
  font-size: 0.7em;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.5em;
  padding: 0 0.5em;
  border: 1px solid currentColor;
  border-radius: 3px;
  vertical-align: 0.15em;
  white-space: nowrap;
}

.tag.sim { color: var(--accent); }
.tag.hw { color: #d3a13c; }
.tag.open { color: var(--muted); }

.post-note {
  margin: 1.6em 0;
  padding: 0.8em 1em;
  border-left: 2px solid var(--accent);
  background-color: var(--surface);
  border-radius: 0 0.5em 0.5em 0;
  color: var(--text-secondary);
}

.post-chart svg {
  width: 100%;
  min-width: 30em;
  height: auto;
}

.post-chart svg text {
  font-size: 11px;
  fill: var(--muted);
}

/* Simple bar chart: one <div style="height:NN%"> per bar. */
.post-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.7em;
  align-items: end;
  height: 10em;
  margin-top: 2em;
  border-bottom: 1px solid var(--muted);
}

.post-bars div {
  position: relative;
  min-height: 2px;
  background-color: var(--accent);
  border-radius: 3px 3px 0 0;
}

.post-bars div span {
  position: absolute;
  top: -1.5em;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.85em;
  color: var(--text);
}

.post-bars-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.7em;
  margin-top: 0.4em;
  text-align: center;
  font-size: 0.8em;
  color: var(--muted);
}

.post-footer {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  font-size: 0.9em;
  color: var(--muted);
}

/**************************************************/
/* Project-page layout for posts: centered title block, link buttons,
   wide video, key numbers, then a centered reading column. */

.post-hero {
  text-align: center;
  margin-bottom: 2em;
}

.post-hero h1 {
  max-width: 22em;
  margin-left: auto;
  margin-right: auto;
}

.post-hero .post-lead {
  max-width: 40em;
  margin-left: auto;
  margin-right: auto;
}

.post-authors {
  margin-top: 1.2em;
  font-size: 1.1em;
  color: var(--text);
}

.post-affil {
  color: var(--muted);
  font-size: 0.95em;
}

.post-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em;
  margin-top: 1.4em;
}

.post-buttons a {
  padding: 0.35em 1.1em;
  border: 1px solid var(--border);
  border-radius: 2em;
  background-color: var(--surface);
  color: var(--text);
}

.post-buttons a:hover {
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* Row of key numbers under the video. */
.post-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9em, 1fr));
  gap: 0.8em;
  margin: 1.5em 0 1em;
}

.post-stats div {
  padding: 0.9em 0.8em;
  border: 1px solid var(--border);
  border-radius: 0.5em;
  background-color: var(--surface);
  text-align: center;
  color: var(--muted);
  font-size: 0.9em;
  line-height: 1.4em;
}

.post-stats b {
  display: block;
  font-size: 1.7em;
  line-height: 1.3em;
  font-weight: 600;
  color: var(--text);
}

/* Reading column: narrower than the video so lines stay short. */
.post-body {
  max-width: 44em;
  margin: 0 auto;
}

.post-body h2 {
  text-align: center;
  margin-top: 2.6em;
  padding-top: 1.6em;
  border-top: 1px solid var(--border);
}

/* Charts sit in a card. */
.post-card {
  padding: 1.2em 1.2em 0.8em;
  border: 1px solid var(--border);
  border-radius: 0.5em;
  background-color: var(--surface);
}

.post-body figcaption {
  text-align: center;
}

/* Display equations and diagrams in posts. */
.post-eq {
  margin: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--text);
}

.post-diagram svg {
  width: 100%;
  min-width: 30em;
  height: auto;
}

.post-diagram svg text {
  font-size: 11px;
  fill: var(--muted);
}

/**************************************************/
/* Tutorial notes tab on the homepage (same look as publications). */

.tnote {
  margin-bottom: 0.5em;
}

.tnote p {
  font-size: 1em;
  line-height: 1.5em;
  color: var(--text-secondary);
}
