:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --color-text: #333;
  --color-text-light: #666;
  --color-accent: #2c3e50;
  --color-link: #3498db;
  --color-bg: #fdfdfd;
  --color-border: #eaeaea;
  --spacing-section: 3rem;
  --spacing-item: 1.5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
}

/* Layout Container */
body > main,
body > footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #f2f2f2;
  z-index: 1000;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  color: var(--color-accent);
}

header p {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-text-light);
  font-weight: 300;
}

.header-logo {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc(0.07 * (50vw - 11rem));
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

/* Push content down to avoid overlap with fixed header */
body > main {
  padding-top: 6.5rem;
}

/* Headings */
h2 {
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin-top: var(--spacing-section);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  scroll-margin-top: 7rem;
}

h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--color-text);
}

/* Remove top margin from the first heading to reduce whitespace */
main > h2:first-child {
  margin-top: 23px;
  scroll-margin-top: calc(7rem + 5px);
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Experience Section */
.job {
  margin-bottom: var(--spacing-item);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

.job-header h3 {
  margin-bottom: 0.2rem;
}

.date {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-family: monospace;
}

.company-info {
  font-style: italic;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

/* Education Section */
.edu-block {
  margin-bottom: var(--spacing-item);
}

.dissertation {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: var(--color-text-light);
}

/* Skills Section */
.skill-group {
  margin-bottom: 1rem;
}

.skill-group h3 {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1rem;
  color: var(--color-accent);
}

.skill-group p {
  display: inline;
}

/* Publications */
.pub-list {
  padding-left: 1.2rem;
}

.pub-list li {
  margin-bottom: 0.75rem;
}

/* Footer / Quote */
footer {
  margin-top: 4rem;
  padding-bottom: 4rem;
  text-align: center;
  color: var(--color-text-light);
}

blockquote {
  font-style: italic;
  margin: 0;
}

cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-style: normal;
}

/* Hamburger Menu */
.site-nav {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
}

#nav-trigger {
  display: none;
}

.menu-icon {
  display: block;
  cursor: pointer;
  width: 30px;
  height: 25px;
}

.menu-icon .bar {
  display: block;
  width: 100%;
  height: 4px;
  background-color: var(--color-accent);
  margin: 4px 0;
  transition: 0.4s;
}

.nav-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background-color: white;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 250px;
  text-align: left;
  border-radius: 4px;
}

/* TOC styles (generated by markdown) */
.nav-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu li {
  border-bottom: 1px solid var(--color-border);
}

.nav-menu li:last-child {
  border-bottom: none;
}

.nav-menu a {
  display: block;
  padding: 10px 15px;
  color: var(--color-text);
  text-decoration: none;
}

.nav-menu a:hover {
  background-color: #f9f9f9;
  color: var(--color-link);
}

#nav-trigger:checked ~ .nav-menu {
  display: block;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
}

/* The Close Button */
.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Responsive Header Adjustments */
@media (max-width: 768px) {
  body > main {
    padding-top: 5.5rem;
  }

  h2 {
    scroll-margin-top: 6rem;
  }

  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 1.1rem;
  }

  .header-logo {
    width: 3rem;
    height: 3rem;
    left: calc(0.07 * (50vw - 9rem));
    top: 50%;
  }

  main > h2:first-child {
    margin-top: 20px;
    scroll-margin-top: calc(6rem + 5px);
  }
}

@media (max-width: 480px) {
  body > main {
    padding-top: 4.5rem;
  }

  h2 {
    scroll-margin-top: 5rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 1rem;
  }

  .header-logo {
    width: 2.6rem;
    height: 2.6rem;
    left: calc(0.07 * (50vw - 7rem));
    top: 50%;
  }

  main > h2:first-child {
    margin-top: 17px;
    scroll-margin-top: calc(5rem + 5px);
  }
}