/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #F7F8FA;
  color: #1F2933;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 600;
  line-height: 1.3;
  color: #1F2933;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

small, .small {
  font-size: 0.875rem;
}

/* Links */
a {
  color: #2F5DA8;
  text-decoration: none;
}

a:hover {
  color: #1E4A8A;
  text-decoration: underline;
}

a:visited {
  color: #4A5568;
}

/* Layout */
.page-container {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.content {
  max-width: 65ch;
  margin: 0 auto;
  padding: 2rem 0;
}

main {
  flex: 1;
}

/* Navigation */
.nav {
  padding: 1.5rem 0;
  border-bottom: 1px solid #E5E7EB;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.5rem;
}

.nav-name {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1F2933;
  text-decoration: none;
  margin-right: auto;
}

.nav-name:hover {
  color: #1F2933;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: #525E6A;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover {
  color: #2F5DA8;
  text-decoration: underline;
}

.nav-links a.active {
  color: #2F5DA8;
}

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid #E5E7EB;
  margin-top: auto;
}

.footer-inner {
  color: #525E6A;
  font-size: 0.875rem;
  text-align: center;
}

/* Home Page */
.home-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.home-text {
  flex: 1;
  min-width: 280px;
}

.portrait {
  width: 16rem;
  height: 16rem;
  background-color: #E5E7EB;
  flex-shrink: 0;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bibliography Entries */
.bib-entry {
  padding-left: 2rem;
  text-indent: -2rem;
  margin-bottom: 0.75rem;
}

.bib-entry .title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  color: #2F5DA8;
}

.bib-entry .title:hover {
  text-decoration: underline;
}

.bib-entry .venue {
  font-style: italic;
}

.bib-entry .authors {
  color: #525E6A;
}

.bib-entry .year {
  color: #525E6A;
}

.bib-entry .links {
  display: inline;
  margin-left: 0.5rem;
}

.bib-entry .links a {
  font-size: 0.875rem;
  margin-right: 0.5rem;
}

/* Section Headers */
.section-header {
  margin-bottom: 2rem;
}

.filter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #525E6A;
}

.filter-links a {
  color: #525E6A;
}

.filter-links a:hover {
  color: #2F5DA8;
}

/* Year Groups */
.year-group {
  margin-bottom: 2rem;
}

.year-group h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #E5E7EB;
}

/* Publication/Talk Detail Pages */
.detail-meta {
  color: #525E6A;
  margin-bottom: 1.5rem;
}

.detail-meta p {
  margin-bottom: 0.25rem;
}

.action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.action-links a {
  padding: 0.5rem 1rem;
  background-color: #2F5DA8;
  color: white;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.action-links a:hover {
  background-color: #1E4A8A;
  text-decoration: none;
  color: white;
}

.action-links a:visited {
  color: white;
}

/* BibTeX Block */
.bibtex-container {
  position: relative;
  margin: 1.5rem 0;
}

.bibtex-block {
  background-color: #F0F2F5;
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.bibtex-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.75rem;
  background-color: #E5E7EB;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: #525E6A;
}

.bibtex-copy:hover {
  background-color: #D1D5DB;
}

/* Projects */
.project-card {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.project-card:last-child {
  border-bottom: none;
}

.project-card h3 {
  margin-top: 0;
}

.project-meta {
  font-size: 0.875rem;
  color: #525E6A;
  margin-bottom: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background-color: #D1FAE5;
  color: #065F46;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

/* Contact Page */
.contact-info {
  margin-bottom: 2rem;
}

.contact-info dt {
  font-weight: 500;
  color: #525E6A;
  margin-top: 1rem;
}

.contact-info dd {
  margin-left: 0;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* 404 Page */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .content {
    max-width: 55ch;
  }

  .home-intro {
    flex-direction: column-reverse;
  }

  .portrait {
    width: 100%;
    max-width: 14rem;
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
  }

  .nav-inner {
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .content {
    max-width: 40ch;
  }

  .page-container {
    padding: 0 1rem;
  }
}
