/* ============================================================
   Minimal Light — Academic Personal Website
   A clean, serif-first theme for researchers
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors – light mode */
  --color-bg: #ffffff;
  --color-bg-alt: #f8f8f8;
  --color-text: #1a1a1a;
  --color-text-secondary: #666666;
  --color-accent: #2c5282;
  --color-accent-light: #ebf0f7;
  --color-border: #e2e2e2;
  --color-code-bg: #f5f5f5;
  --color-shadow: rgba(0, 0, 0, 0.08);

  /* Typography — uncomment ONE line and comment out the other */
  /* --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif; */
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-size-base: 18px;
  /* --font-size-base: 20px; Slightly larger base font size */
  --line-height: 1.6;
  /* --line-height: 1.75; More generous line spacing for better readability */

  /* Layout */
  --max-width: 700px;
  --nav-height: 60px;
  --spacing: 1.5rem;
}

/* Dark mode */
[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-bg-alt: #242424;
  --color-text: #e0e0e0;
  --color-text-secondary: #999999;
  --color-accent: #6b9edd;
  --color-accent-light: #1e2d3d;
  --color-border: #333333;
  --color-code-bg: #2a2a2a;
  --color-shadow: rgba(0, 0, 0, 0.32);
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Links --- */
a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

a:hover,
a:focus {
  border-bottom-color: var(--color-accent);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem;   }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1.25rem;
}

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

li {
  margin-bottom: 0.35rem;
}

blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin: 1.5rem 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--color-code-bg);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  padding: 0;
}

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

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem var(--spacing);
  min-height: calc(100vh - var(--nav-height) - 80px);
}

/* --- Header / Nav --- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-text);
  border-bottom: none;
  white-space: nowrap;
  margin-right: 2rem;
  align-items: center;
}

.site-name:hover {
  color: var(--color-accent);
  border-bottom: none;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  border-bottom: none;
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
  border-bottom: none;
}

.nav-links a.active {
  font-weight: 500;
}

/* Hamburger (mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s ease;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  border-radius: 4px;
}

.theme-toggle:hover {
  color: var(--color-text);
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

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

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.home-intro h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: 2rem;
}

.home-intro .subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.1rem;
}

.home-intro .affiliation {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

.home-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.home-links li {
  margin: 0;
}

.home-links a {
  font-size: 0.95rem;
}

/* --- Page --- */
.page-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* --- Research --- */
.research-area {
  margin-bottom: 2.25rem;
}

.research-area h3 {
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

/* --- Publications --- */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-item {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border);
}

.pub-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.pub-authors {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.pub-venue {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
}

.pub-links {
  display: flex;
  gap: 1rem;
  font-size: 0.88rem;
  margin-top: 0.4rem;
}

.pub-links a {
  padding: 0.15rem 0.5rem;
  background: var(--color-accent-light);
  border-radius: 3px;
  border-bottom: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.pub-links a:hover {
  background: var(--color-accent);
  color: #ffffff;
  border-bottom: none;
}

/* --- CV --- */
.cv-section {
  margin-bottom: 2.5rem;
}

.cv-section h2 {
  font-size: 1.3rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.cv-entry {
  margin-bottom: 1.25rem;
}

.cv-entry-title {
  font-weight: 600;
}

.cv-entry-meta {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

/* --- Contact --- */
.contact-info {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.contact-info li {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.contact-info strong {
  display: inline-block;
  width: 5rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

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

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.site-footer a {
  color: var(--color-text-secondary);
}

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

/* --- Responsive --- */
@media (max-width: 640px) {
  :root {
    --font-size-base: 17px;
  }

  .home-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

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

  .nav-container {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px var(--color-shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }

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

  .nav-links a {
    display: block;
    padding: 0.65rem 0;
    color: var(--color-text);
    font-weight: 500;
  }

  .pub-links {
    flex-wrap: wrap;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}

/* --- Print --- */
@media print {
  .site-header,
  .site-footer,
  .theme-toggle,
  .menu-toggle {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    border-bottom: none;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}
