/* ============================================================
   Base & Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: #2d2d2d;
  background: #ffffff;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: #1a5276;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: #1a5276;
  border-bottom-color: #1a5276;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.35rem;
}

blockquote {
  border-left: 3px solid #d0d0d0;
  padding-left: 1rem;
  color: #666;
  margin: 1.5rem 0;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f5f5f5;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 2rem 0;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid #e8e8e8;
  padding: 1rem 0;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
  border-bottom: none;
  letter-spacing: -0.02em;
}

.site-title:hover {
  color: #1a5276;
  border-bottom: none;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.925rem;
  color: #555;
  border-bottom: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: #1a5276;
  border-bottom-color: #1a5276;
}

/* ============================================================
   Main Content
   ============================================================ */
.site-main {
  flex: 1;
  padding: 3rem 0;
}

/* ============================================================
   About / Home Page
   ============================================================ */
.profile {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.profile-photo {
  flex-shrink: 0;
}

.profile-photo img,
.profile-photo .avatar-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #e8e8e8;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: #aaa;
  border-radius: 50%;
}

.profile-info h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.profile-tagline {
  color: #555;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.profile-affiliation {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.contact-links a {
  font-size: 0.875rem;
  color: #1a5276;
  border-bottom: none;
  padding: 0.2rem 0.6rem;
  border: 1px solid #c0d4e8;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.contact-links a:hover {
  background: #eef4fa;
  border-bottom: none;
}

.about-section {
  margin-bottom: 2rem;
}

.about-section h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
  border-bottom: 1px solid #ebebeb;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

/* ============================================================
   Publications Page
   ============================================================ */
.page-title {
  font-size: 1.75rem;
  margin-bottom: 1.75rem;
}

.pub-section {
  margin-bottom: 2.5rem;
}

.pub-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
  border-bottom: 1px solid #ebebeb;
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

.pub-list {
  list-style: none;
  padding-left: 0;
}

.pub-list li {
  margin-bottom: 1.25rem;
  padding-left: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Publications rendered from bibliography.md */
#publications-content ol {
  list-style: decimal;
  padding-left: 1.5rem;
}

#publications-content ol li {
  margin-bottom: 1.25rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

#publications-content h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
  border-bottom: 1px solid #ebebeb;
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
  margin-top: 2rem;
}

#publications-content h2:first-child {
  margin-top: 0;
}

/* ============================================================
   Blog Listing
   ============================================================ */
.post-list {
  margin-top: 1rem;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.post-item:last-child {
  border-bottom: none;
}

.post-date-label {
  font-size: 0.8rem;
  color: #999;
  white-space: nowrap;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
}

.post-item-info {
  flex: 1;
}

.post-item-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0;
  display: block;
  border-bottom: none;
  color: #1a5276;
}

.post-item-title:hover {
  border-bottom: none;
  color: #1a3a5c;
}

.post-item-excerpt {
  font-size: 0.875rem;
  color: #777;
  margin-top: 0.2rem;
  margin-bottom: 0;
}

.no-posts {
  color: #999;
  font-style: italic;
}

/* ============================================================
   Blog Post
   ============================================================ */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e8e8;
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  color: #888;
  font-size: 0.875rem;
}

.post-category {
  background: #eef4fa;
  color: #1a5276;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.post-status {
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-status--draft {
  background: #fff8e1;
  color: #b45309;
}

.post-content {
  font-size: 1rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8e8e8;
  font-size: 0.875rem;
}

.post-nav .next {
  margin-left: auto;
}

/* ============================================================
   Page
   ============================================================ */
.page {
  max-width: 100%;
}

/* ============================================================
   Site Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid #e8e8e8;
  padding: 1.5rem 0;
  margin-top: auto;
}

.site-footer p {
  font-size: 0.825rem;
  color: #aaa;
  margin-bottom: 0;
}

.site-footer a {
  color: #999;
  border-bottom: none;
}

.site-footer a:hover {
  color: #1a5276;
}

/* ============================================================
   Syntax Highlighting (Rouge)
   ============================================================ */
.highlight { background: #f5f5f5; border-radius: 6px; }
.highlight .c  { color: #998; font-style: italic }
.highlight .k  { color: #333; font-weight: bold }
.highlight .n  { color: #333 }
.highlight .o  { color: #555 }
.highlight .s  { color: #d14 }
.highlight .na { color: #008080 }
.highlight .nb { color: #0086B3 }
.highlight .nc { color: #458; font-weight: bold }
.highlight .no { color: #008080 }
.highlight .ni { color: #800080 }
.highlight .ne { color: #900; font-weight: bold }
.highlight .nf { color: #900; font-weight: bold }
.highlight .nn { color: #555 }
.highlight .nt { color: #000080 }
.highlight .nv { color: #008080 }
.highlight .w  { color: #bbb }
.highlight .mf { color: #099 }
.highlight .mh { color: #099 }
.highlight .mi { color: #099 }
.highlight .mo { color: #099 }
.highlight .sb { color: #d14 }
.highlight .sc { color: #d14 }
.highlight .sd { color: #d14 }
.highlight .s2 { color: #d14 }
.highlight .se { color: #d14 }
.highlight .sh { color: #d14 }
.highlight .si { color: #d14 }
.highlight .sx { color: #d14 }
.highlight .sr { color: #009926 }
.highlight .s1 { color: #d14 }
.highlight .ss { color: #990073 }
.highlight .bp { color: #999 }
.highlight .vc { color: #008080 }
.highlight .vg { color: #008080 }
.highlight .vi { color: #008080 }
.highlight .il { color: #099 }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .contact-links {
    justify-content: center;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-nav {
    gap: 1.25rem;
  }

  .post-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post-date-label {
    min-width: unset;
  }
}
