/* ===== Custom Properties ===== */
:root {
  --main-width: 780px;
  --main-padding: 1.4rem;
  --font-body: "Noto Serif", Georgia, ui-serif, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --h1-size: 2em;
  --h2-size: 1.6em;
  --h3-size: 1.3em;
  --body-size: 1em;
  --small-size: 0.875em;
  --caption-size: 0.8em;
  --line-height: 1.6;
  --text-primary: rgb(36, 36, 36);
  --text-secondary: rgb(117, 117, 117);
  --bg: rgb(255, 255, 255);
  --accent: #AB2317;
  --accent-hover: #8a1c12;
  --border: rgb(229, 229, 229);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
  padding: 0;
}

/* ===== Base ===== */
html {
  font-size: 18px;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

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

/* ===== Layout ===== */
.site-container {
  max-width: var(--main-width);
  margin: 0 auto;
  padding: 0 var(--main-padding);
}

/* ===== Navigation ===== */
.site-nav {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.nav-identity {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-nav .nav-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--h2-size);
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.2;
}

.site-nav .nav-name:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--caption-size);
}

.nav-email {
  color: var(--text-secondary);
}

.nav-meta-sep {
  color: var(--text-secondary);
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.social-icons a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.social-icons a:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav .nav-links {
  font-family: var(--font-mono);
  font-size: var(--small-size);
}

.site-nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav .nav-links a:hover {
  color: var(--accent);
}

.site-nav .nav-links a.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-sep {
  color: var(--border);
  margin: 0 0.3rem;
}

/* ===== Header ===== */
.site-header {
  margin-bottom: 2.5rem;
}

.header-intro {
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.profile-photo-wrap {
  float: right;
  width: 260px;
  height: 260px;
  position: relative;
  margin: 0 0 0.5rem 1rem;
}

.profile-photo {
  width: 260px;
  height: 260px;
  object-fit: cover;
}

.profile-photo-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.profile-photo-wrap:hover .profile-photo-hover {
  opacity: 1;
}

.bio {
  font-size: var(--body-size);
  line-height: var(--line-height);
}

/* ===== Bio List ===== */
.bio-section {
  margin-bottom: 2.5rem;
}

.bio-section h2 {
  font-size: var(--h3-size);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.bio-list {
  list-style: none;
  font-size: var(--small-size);
}

.bio-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.bio-date {
  font-family: var(--font-mono);
  font-size: var(--caption-size);
  color: var(--text-secondary);
  margin-right: 0.3rem;
}

.site-header > .note {
  font-size: var(--caption-size);
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 0.8rem;
}

.bio p {
  margin-bottom: 0.8rem;
}

.bio .note {
  font-size: var(--caption-size);
  color: var(--text-secondary);
}

/* ===== News ===== */
.news-section {
  margin-bottom: 2.5rem;
}

.news-section h2 {
  font-size: var(--h3-size);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.news-list {
  list-style: none;
  font-size: var(--small-size);
}

.news-list > li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.news-date {
  font-family: var(--font-mono);
  font-size: var(--caption-size);
  color: var(--text-secondary);
  margin-right: 0.3rem;
}

/* Older news details/summary */
.news-list details {
  margin: 0;
}

.news-list details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--small-size);
  color: var(--text-secondary);
  padding: 0.2rem 0;
}

.news-list details summary:hover {
  color: var(--accent);
}

.news-list details ul {
  list-style: none;
  margin-top: 0.3rem;
}

.news-list details li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.news-list details li:last-child {
  border-bottom: none;
}

/* ===== Publications ===== */
.publications-section {
  margin-bottom: 2.5rem;
}

.publications-section h2 {
  font-size: var(--h2-size);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.pub-subtitle {
  font-size: var(--small-size);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.publications-section h3 {
  font-size: var(--h3-size);
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1.5rem 0 0.8rem;
}

.pub-card {
  display: flex;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-thumb {
  width: 180px;
  flex-shrink: 0;
}

.pub-thumb img {
  width: 100%;
  border-radius: 3px;
}

.pub-details {
  flex: 1;
  min-width: 0;
}

.pub-title {
  font-weight: 600;
  font-size: var(--body-size);
  margin-bottom: 0.2rem;
}

.pub-authors {
  font-size: var(--small-size);
  margin-bottom: 0.15rem;
}

.pub-venue {
  font-size: var(--small-size);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pub-links a {
  font-family: var(--font-mono);
  font-size: var(--caption-size);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pub-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ===== Projects Grid ===== */
.projects-section {
  margin-bottom: 2.5rem;
}

.projects-section h1 {
  font-size: var(--h1-size);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s ease;
}

.project-card:hover {
  border-color: var(--accent);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-card-body {
  padding: 1rem;
}

.project-card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.project-card-body h3 a {
  color: var(--text-primary);
}

.project-card-body h3 a:hover {
  color: var(--accent);
}

.project-card-body p {
  font-size: var(--small-size);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: var(--caption-size);
  color: var(--text-secondary);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--caption-size);
  color: var(--text-secondary);
  margin-top: 2rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .profile-photo-wrap {
    float: none;
    margin: 0 auto 1rem;
  }

  .header-intro {
    text-align: center;
  }

  .pub-card {
    flex-direction: column;
  }

  .pub-thumb {
    width: 100%;
  }

  .site-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}
