* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #fff;
  --font-color: #000;
  --font-muted: #444;
  --navbar-link-color: #000;
  --navbar-hover-link-color: #333;
  --time-color: #444;
  --link-color: #000;
  --hover-link-color: #333;
  --accent: #000;
  --border-color: #000;
  --font-main: "Source Serif Pro", Georgia, serif;
}

html {
  font-size: 14pt;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--font-color);
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
}

a,
a:visited {
  text-decoration: none;
  color: var(--link-color);
}

a:hover,
a:visited:hover {
  color: var(--hover-link-color);
}

p {
  margin-bottom: 1rem;
}

p:first-of-type {
  margin-top: 1em;
}

p:last-of-type {
  margin-bottom: 0em;
}

section {
  border-image: linear-gradient(
    to right,
    var(--bg-color),
    var(--font-color),
    var(--bg-color)
  ) 10 0 10 0;
  border-top-width: 2px;
  border-top-style: solid;
  padding-top: 1em;
  padding-bottom: 1em;
}

section:first-of-type {
  border-top-width: 0;
}

.page {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  margin-top: 60px;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-main);
  text-align: center;
  font-variant: small-caps;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--font-color);
}

.my-name {
  font-size: 2.5em;
  margin-top: 10px;
  margin-bottom: 0;
}

.headshot-figure {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem 0;
}

.headshot {
  width: 35%;
  max-width: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.icons {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.icons li {
  padding-right: 20px;
  list-style: none;
}

.icons li:last-of-type {
  padding-right: 0px;
}

.icons li a {
  text-decoration: none;
  color: var(--font-muted);
  font-size: 1.4rem;
  transition: color 0.2s ease;
}

.icons li a:hover,
.icons li a:visited:hover {
  color: var(--accent);
}

.nav-div {
  z-index: 1;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

.nav-background {
  z-index: 1;
  background-color: var(--bg-color);
  border-image: linear-gradient(
    to right,
    var(--bg-color),
    var(--font-color),
    var(--bg-color)
  ) 10 0 10 0;
  border-bottom-width: 2px;
  border-bottom-style: solid;
}

.nav-bar {
  padding-top: 12pt;
  padding-bottom: 12pt;
  padding-left: 20px;
  padding-right: 20px;
  position: relative;
  max-width: 100%;
  margin: 0 auto;
}

.nav-bar ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
}

.nav-bar li {
  list-style: none;
  padding-right: 28px;
}

.nav-bar li a,
.nav-bar li a:visited {
  text-decoration: none;
  color: var(--navbar-link-color);
  font-family: var(--font-main);
  font-variant: small-caps;
  transition: color 0.2s ease;
}

.nav-bar li a:hover,
.nav-bar li a:visited:hover {
  color: var(--navbar-hover-link-color);
}

/* Dark mode toggle button */
.dark-mode-toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--font-color);
  background: var(--bg-color);
  color: var(--font-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dark-mode-toggle:hover {
  background: var(--font-color);
  color: var(--bg-color);
}

.dark-mode-toggle .icon-moon {
  display: none;
}

.dark-mode-toggle .icon-sun {
  display: inline;
}

/* Dark mode: show moon when dark, sun when light */
body.dark .dark-mode-toggle .icon-sun {
  display: none;
}

body.dark .dark-mode-toggle .icon-moon {
  display: inline;
}

/* Dark theme */
body.dark {
  --bg-color: #1a1a1a;
  --font-color: #e8e8e8;
  --font-muted: #a0a0a0;
  --navbar-link-color: #e8e8e8;
  --navbar-hover-link-color: #fff;
  --time-color: #a0a0a0;
  --link-color: #e8e8e8;
  --hover-link-color: #fff;
  --accent: #e8e8e8;
  --border-color: #333;
}

.row-experience {
  display: flex;
}

.row-experience > * {
  padding-top: 25px;
  padding-bottom: 25px;
}

.timespan {
  font-size: 10pt;
  border-right: 2px solid var(--accent);
  width: 20%;
  min-width: 120px;
  text-align: center;
  position: relative;
  padding-right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timespan time {
  margin-top: 10px;
  color: var(--time-color);
  font-family: var(--font-main);
}

.timespan .timespan-text {
  color: var(--time-color);
  margin-top: 10px;
  font-family: var(--font-main);
}

.timespan:before {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
}

.row-experience:first-of-type .timespan {
  border-image: linear-gradient(to top, var(--accent), var(--bg-color)) 0 20 0 0;
  border-right-width: 2px;
  border-right-style: solid;
}

.row-experience:last-of-type .timespan {
  border-image: linear-gradient(to bottom, var(--accent), var(--bg-color)) 0 20 0 0;
  border-right-width: 2px;
  border-right-style: solid;
}

.experience-desc {
  margin-left: 20px;
  flex: 1;
  width: 80%;
  padding-left: 10px;
}

.experience-desc ul {
  margin: 0.5em 0 0 1.2em;
  padding: 0;
}

.experience-desc li {
  margin-bottom: 0.4em;
}

.experience-desc .related-coursework {
  margin-top: 0.6em;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--font-muted);
}

.related-coursework-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.related-coursework-block .related-coursework {
  margin-top: 0.25em;
  margin-bottom: 0;
}

.related-coursework-block .related-coursework:first-child {
  margin-top: 0;
}

.logo-img {
  width: 100%;
}

.logo-img:hover {
  transform: scale(1.1);
}

.experience-logo {
  max-width: 80px;
  height: auto;
  margin: 0 auto 8px;
  display: block;
}

/* Projects */
.row-publication {
  margin-bottom: 3rem;
}

.row-publication:last-of-type {
  margin-bottom: 0rem;
}

.publication-header {
  display: flex;
  margin-bottom: 1rem;
}

.pub-img {
  width: 30%;
  flex: initial;
  align-items: center;
  justify-content: center;
}

.pub-img img {
  width: 100%;
}

.pub-meta {
  flex: 1;
  margin-left: 25px;
  display: flex;
  align-items: center;
}

.paper-title {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
  line-height: 1.3;
  text-align: left;
  font-variant: normal;
  font-family: var(--font-main);
  font-weight: 600;
  color: var(--font-color);
}

.paper-authors {
  font-variant: none;
  font-weight: normal;
  font-size: 0.9rem;
  margin-bottom: 0.5em;
  text-align: left;
}

.paper-journal {
  font-variant: none;
  font-weight: normal;
  text-align: left;
  font-size: 0.9rem;
  margin-bottom: 0px;
  color: var(--font-muted);
  font-family: var(--font-main);
}

.publication-summary {
  margin-top: 0.5em;
  color: var(--font-color);
}

.pub-meta ul {
  display: flex;
  justify-content: left;
  margin-bottom: 0.5em;
}

.pub-meta ul li {
  list-style: none;
  padding-right: 20px;
}

.pub-meta ul li a {
  text-decoration: none;
  color: var(--font-muted);
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.pub-meta ul li a:hover,
.pub-meta ul li a:visited:hover {
  color: var(--accent);
}

/* Skills list */
.skills-list {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.skills-list li {
  margin-bottom: 0.6em;
  padding-left: 1.5em;
  position: relative;
}

.skills-list li:before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.skills-list strong {
  font-variant: normal;
}

/* Blog */
.blog-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.blog-entry {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.blog-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.blog-date {
  display: block;
  font-size: 0.9rem;
  color: var(--font-muted);
  margin-bottom: 0.25rem;
}

.blog-title {
  font-variant: normal;
  font-size: 1.1rem;
}

.blog-excerpt {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--font-color);
  line-height: 1.55;
}

.website-footer {
  border-image: linear-gradient(
    to right,
    var(--bg-color),
    var(--font-color),
    var(--bg-color)
  ) 10 0 0 0;
  border-top-width: 2px;
  border-top-style: solid;
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-top: 30px;
}

.website-footer .author {
  font-size: 0.8rem;
  color: var(--font-muted);
}

.footer-content {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5em;
  padding-left: 20px;
  padding-right: 20px;
}

.footer-content a {
  text-decoration: none;
  color: var(--font-muted);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: color 0.2s ease;
}

.footer-content a:hover,
.footer-content a:visited:hover {
  color: var(--accent);
}

@media only screen and (max-width: 720px) {
  .page {
    padding-left: 26px;
    padding-right: 26px;
  }

  html {
    font-size: 12pt;
  }
}

@media only screen and (max-width: 500px) {
  .publication-header {
    flex-direction: column-reverse;
  }

  .pub-img {
    width: 60%;
    margin: 0 auto;
  }

  .pub-meta {
    width: 100%;
    margin-left: 0;
    margin-bottom: 1.5rem;
  }

  .page {
    margin-bottom: 70px;
  }

  .row-experience {
    flex-direction: column;
  }

  .timespan {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 2px solid var(--accent);
    padding-right: 0;
    padding-bottom: 10px;
    justify-content: flex-start;
  }

  .timespan:before {
    display: none;
  }

  .row-experience:first-of-type .timespan,
  .row-experience:last-of-type .timespan {
    border-image: none;
    border-right: none;
  }

  .experience-desc {
    margin-left: 0;
    width: 100%;
    padding-left: 0;
  }
}

/* Blog index and post pages */
.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-entry {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.blog-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.blog-date {
  display: block;
  font-size: 0.9rem;
  color: var(--font-muted);
  margin-bottom: 0.25rem;
}

.blog-title {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.blog-excerpt {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--font-muted);
}

.blog-post {
  margin-top: 0.5rem;
}

.blog-back {
  margin-bottom: 1rem;
}

.blog-post-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  margin-top: 0.25rem;
}

.blog-post-body p {
  margin-bottom: 1rem;
}
.blog-post-body p:last-of-type {
  margin-bottom: 0;
}
