/* =============================================
   CSS Custom Properties
   ============================================= */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-accent: #2563eb;
  --color-border: #e5e7eb;
  --color-alt-bg: #f8f9fa;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Crimson Pro', Georgia, serif;
  --max-width: 860px;
  --nav-height: 60px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

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

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

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

.section-lg { padding: 72px 0; }
.section-sm { padding: 40px 0; }
.alt-bg { background: var(--color-alt-bg); }

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
}

.section-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 28px;
}

/* =============================================
   Navigation
   ============================================= */
#nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
}
.nav-name:hover { text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
  text-decoration: none;
}

/* =============================================
   About
   ============================================= */
#about {
  padding-top: calc(var(--nav-height) + 64px);
  padding-bottom: 64px;
}

.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: start;
}

.about-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
}

.about-text h1 {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 4px;
}

.last-name { color: var(--color-text-muted); }

.title {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.bio {
  margin-bottom: 12px;
  font-size: 0.975rem;
}

.contact-email {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.contact-links {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

.sep { color: var(--color-border); }

/* =============================================
   News
   ============================================= */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-list li {
  font-size: 0.9rem;
  display: flex;
  gap: 16px;
}

.news-date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 90px;
  flex-shrink: 0;
}

/* =============================================
   Research themes
   ============================================= */
.research-intro {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 14px;
}

.research-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 18px;
}

.research-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: baseline;
}

.research-icon {
  font-size: 1.15rem;
}

.research-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
  margin-bottom: 3px;
}

.research-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.research-ref {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* =============================================
   Publications
   ============================================= */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pub-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 16px;
  align-items: start;
}

.pub-info {
  min-width: 0;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

.pub-number {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* left-hand number column (journals / conferences) */
.pub-item > .pub-number {
  padding-top: 4px;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.pub-venue {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 8px;
}

.pub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-links a {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 2px 10px;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  transition: background 0.15s, color 0.15s;
}
.pub-links a:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

.doi-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: normal;
}

.pub-press {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.press-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}

.pub-press a {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}

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

/* =============================================
   Projects
   ============================================= */
.project-list {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.project-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.project-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 4px;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.project-links a {
  font-size: 0.8rem;
  font-weight: 500;
}

/* =============================================
   CV
   ============================================= */
.cv-block {
  margin-bottom: 36px;
}

.cv-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin-bottom: 16px;
  margin-top: 28px;
}

.cv-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.cv-year {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding-top: 2px;
}

.cv-role {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.cv-org {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.btn {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.15s;
}
.btn:hover {
  opacity: 0.88;
  text-decoration: none;
}

/* =============================================
   Publication year headings
   ============================================= */
/* Submitted / Journal Articles / Conferences / Patents */
.pub-group {
  padding: 36px 0;
}

.pub-group-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

/* collapsible groups */
.pub-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

/* chevron: points right when closed, down when open */
.pub-details > summary::before {
  content: '';
  flex: none;
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-text-muted);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s ease;
}

.pub-details[open] > summary::before {
  transform: rotate(90deg);
}

.pub-details > summary:hover {
  color: var(--color-accent);
}

.pub-details > summary:hover::before {
  border-left-color: var(--color-accent);
}

.pub-year-heading {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 36px 0 16px;
}

/* first year sits right under its group heading */
.pub-group-heading + .pub-year-heading {
  margin-top: 20px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 7px;
}

/* Under review / compact pub items */
.pub-list.under-review {
  gap: 0;
}

.pub-item.compact {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.pub-item.compact:first-child {
  padding-top: 0;
}

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

/* =============================================
   Projects
   ============================================= */
.project-funder {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 7px;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: middle;
}

.role-pi {
  background: #dbeafe;
  color: #1d4ed8;
}

.role-co {
  background: #f1f5f9;
  color: #475569;
}

/* =============================================
   CV extras
   ============================================= */
.cv-detail {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  margin-top: 8px;
}

.skill-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.skill-items {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Sub-page first section (clears fixed nav)
   ============================================= */
.section-first {
  padding-top: calc(var(--nav-height) + 48px);
}

/* =============================================
   Footer
   ============================================= */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

footer p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 640px) {
  .nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    gap: 24px;
  }

  .nav-inner::-webkit-scrollbar {
    display: none;
  }

  .nav-name {
    flex-shrink: 0;
  }

  .nav-links {
    flex-shrink: 0;
    gap: 16px;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-photo img {
    width: 120px;
    height: 120px;
  }

  .pub-item {
    grid-template-columns: 28px 1fr;
    column-gap: 12px;
  }

  .cv-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .nav-links {
    gap: 16px;
  }
}
