/* ===========================
   CSS Variables & Design System
   =========================== */
:root {
  /* Primary Colors - From figure palette */
  --color-primary: #4169E1;
  --color-primary-light: #6B8FE8;
  --color-accent: #5B8DEF;

  /* Highlight Colors - From figure palette */
  --color-highlight: #FF8C42;
  --color-success: #8BC34A;
  --color-new: #9C88DB;

  /* Neutral Colors - Clean backgrounds */
  --color-bg: #ffffff;
  --color-bg-alt: #ffffff;
  --color-surface: #F5F7FA;
  --color-bg-purple: #F3F0FF;
  --color-bg-cyan: #E8F9F9;
  --color-bg-card: #ffffff;
  --color-border: #D1D5DB;

  /* Text Colors */
  --color-text-primary: #2C3E50;
  --color-text-secondary: #5A6C7D;
  --color-text-muted: #8B95A5;

  /* Spacing */
  --spacing-unit: 8px;
  --container-max-width: 1100px;

  /* Typography */
  --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* ===========================
   CSS Reset & Base Styles
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.875rem;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.0625rem;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

strong {
  font-weight: 600;
}

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

li {
  margin-bottom: 0.5rem;
}

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

.section {
  padding: 1.75rem 0;
}

/* ===========================
   Navigation
   =========================== */
.main-nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  padding: 1rem 0;
}

.main-nav .container {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.main-nav a {
  color: var(--color-text-secondary);
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  background-color: var(--color-bg-alt);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  padding: 2rem 0 1.5rem;
  background-color: var(--color-bg-alt);
}

.hero-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.profile-photo {
  width: 130px;
  height: 130px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  margin-bottom: 0.375rem;
  color: var(--color-text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.pronouns {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0;
}

.hero-about {
  margin-top: 0.875rem;
  margin-bottom: 0;
}

.hero-about p {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin-bottom: 0.625rem;
  text-align: justify;
  hyphens: auto;
}

.hero-about p:last-child {
  margin-bottom: 0;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  font-size: 0.9375rem;
}

.hero-links .btn {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 0 0 1px 0;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.hero-links .btn:hover {
  color: var(--color-highlight);
  border-bottom-color: var(--color-highlight);
}

.hero-links .sep {
  color: var(--color-text-muted);
  user-select: none;
}

/* ===========================
   News Section
   =========================== */
.news {
  background-color: var(--color-bg-alt);
}

.news-list {
  list-style: none;
  margin-left: 0;
}

.news-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

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

.news-list strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* ===========================
   Publications Section
   =========================== */
.publications {
  background-color: var(--color-bg);
}

.section-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
  margin-bottom: 0.875rem;
}

.section-collapse > summary::-webkit-details-marker {
  display: none;
}

.section-collapse > summary > h2 {
  margin: 0;
  display: inline;
}

.section-collapse > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease, border-color 0.2s ease;
  margin-bottom: 4px;
}

.section-collapse > summary:hover::after {
  border-color: var(--color-primary);
}

.section-collapse[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
  margin-bottom: 0;
}

.pub-group {
  background: var(--color-surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pub-group:hover {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
}

.pub-group[open] {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
}

.pub-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  border-radius: 12px;
}

.pub-group > summary::-webkit-details-marker {
  display: none;
}

.pub-group > summary > h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  font-size: 1.0625rem;
  color: var(--color-text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
}

.pub-count {
  display: inline-flex;
  align-items: center;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0;
}

.pub-group > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease, border-color 0.2s ease;
  margin-right: 4px;
  margin-bottom: 4px;
}

.pub-group > summary:hover::after {
  border-color: var(--color-primary);
}

.pub-group[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
  margin-bottom: 0;
}

.pub-group > .publication-item {
  margin: 0;
  border: none;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0;
  padding: 1.25rem 1.5rem;
  background: transparent;
}

.pub-group > .publication-item:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.publication-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.publication-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0;
  line-height: 1.4;
  flex: 1;
}

.publication-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge-new {
  background-color: var(--color-new);
  color: white;
  border-color: transparent;
}

.badge-venue {
  background-color: var(--color-new);
  color: white;
  border-color: transparent;
}

.badge-spotlight,
.badge-award {
  background-color: var(--color-highlight);
  color: white;
  border-color: transparent;
}

.citation-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: var(--color-success);
  color: white;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.citation-badge.high-impact {
  background: var(--color-highlight);
}

.publication-authors {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin: 0.375rem 0 0.25rem 0;
  line-height: 1.5;
}

.publication-venue {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.venue-name {
  font-style: italic;
}

.publication-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.pub-link {
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.pub-link:hover {
  color: var(--color-highlight);
  text-decoration: underline;
}

/* ===========================
   Contact Section
   =========================== */
.contact {
  background-color: var(--color-bg);
}

.contact-content {
  max-width: 600px;
}

.contact-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

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

.social-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-bg-alt);
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-normal);
}

.social-link:hover {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background-color: var(--color-bg-alt);
  color: var(--color-text-secondary);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.site-footer a {
  color: var(--color-primary);
  text-decoration: underline;
}

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

.site-footer small {
  font-size: 0.9rem;
}

/* ===========================
   Responsive Design
   =========================== */

/* Mobile (0 - 640px) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .container {
    padding: 0 1.5rem;
  }

  .section {
    padding: 3rem 0;
  }

  .main-nav .container {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .main-nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-content {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .profile-photo {
    width: 150px;
    height: 150px;
  }

  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .hero-text h1 {
    justify-content: center;
    order: 1;
    margin-bottom: 0.5rem;
  }

  .hero-about {
    order: 2;
    margin-top: 0.25rem;
  }

  .hero-links {
    order: 3;
    justify-content: center;
    margin-top: 0.75rem;
    gap: 0.5rem 0.75rem;
  }

  .publication-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .publication-item {
    padding: 1.25rem;
  }
}

/* Small mobile (0 - 480px) */
@media (max-width: 480px) {
  .hero-links {
    font-size: 0.875rem;
    gap: 0.4rem 0.6rem;
  }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
  .main-nav,
  .hero-links,
  .site-footer {
    display: none;
  }

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

  .section {
    padding: 1rem 0;
  }

  .publication-item {
    page-break-inside: avoid;
  }
}

/* ===========================
   Utilities
   =========================== */
.hidden {
  display: none;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
