/* ─────────────────────────────────────────
   CSS CUSTOM PROPERTIES
───────────────────────────────────────── */
:root {
  --bg:          #f7f6f3;
  --surface:     #ffffff;
  --border:      #e2e0db;
  --text:        #2a2a2a;
  --text-muted:  #6b6760;
  --accent:      #4a6b5e;       /* muted sage-teal: scholarly, calm */
  --accent-dim:  #3d5a4f;
  --card-left:   #f0eeea;
  --card-right:  #f7f6f3;
  --font-serif:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:   'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --radius:      6px;
  --shadow:      0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --max-w:       960px;
  --transition:  .2s ease;
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
a:hover {
  color: var(--accent-dim);
  border-bottom-color: var(--accent-dim);
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  /* Subtle shadow on scroll added via JS */
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────── */
nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background-color var(--transition), color var(--transition);
}
.nav-link:hover {
  background-color: var(--card-left);
  color: var(--text);
  border-bottom-color: transparent;
}
.nav-link.active {
  color: var(--accent);
  background-color: #edf2f0;
}

/* ─────────────────────────────────────────
   MAIN
───────────────────────────────────────── */
main {
  flex: 1 0 auto;
  width: 100%;
}

/* ─────────────────────────────────────────
   SECTIONS
───────────────────────────────────────── */
.content-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 64px;
  animation: fadeIn .3s ease both;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ─────────────────────────────────────────
   HOME — TWO-COLUMN GRID
───────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* Profile card (left) */
.profile-card {
  background-color: var(--card-left);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.full-name {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -.01em;
}

.divider {
  width: 36px;
  height: 2px;
  background-color: var(--accent);
  margin: 16px 0;
  border-radius: 1px;
}

.affil {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.email {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 20px;
}

.email .at {
  display: inline-block;
  padding: 0 2px;
  font-style: italic;
  color: var(--text-muted);
}

.profile-links a {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: none;
}

/* Bio card (right) */
.bio-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 32px;
}

.card-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: .01em;
}

.bio-card p + p {
  margin-top: 14px;
}

/* ─────────────────────────────────────────
   RESEARCH SECTION
───────────────────────────────────────── */
.research-inner {
  max-width: 720px;
}

.research-intro {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

#research h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 56px;
  margin-bottom: 16px;
  letter-spacing: .01em;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

#research p {
  font-size: 0.9625rem;
  color: var(--text);
  line-height: 1.7;
}

/* Paper list */
.paper-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.paper-item {
  padding: 24px 0;
  border-bottom: 1px solid #c8c5be;
}

.paper-item:first-child {
  border-top: 1px solid #c8c5be;
}

.paper-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.paper-title {
  font-family: var(--font-serif);
  font-size: 1.075rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  border-bottom: none;
  /* When it's a link */
}

a.paper-title:hover {
  color: var(--accent);
  border-bottom: none;
}

.paper-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background-color: #edf2f0;
  border: 1px solid #cdddd8;
  border-radius: 3px;
  padding: 1px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

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

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
footer {
  flex-shrink: 0;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────
   RESPONSIVE — TABLET  (≤ 768px)
───────────────────────────────────────── */
@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-card,
  .bio-card {
    padding: 24px 20px;
  }

  .content-section {
    padding: 32px 16px 48px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .site-name {
    font-size: 1.1rem;
  }

  .full-name {
    font-size: 1.75rem;
  }

  .research-inner {
    max-width: 100%;
  }
}

/* ─────────────────────────────────────────
   RESPONSIVE — MOBILE  (≤ 480px)
───────────────────────────────────────── */
@media (max-width: 480px) {
  body {
  }

  .site-name {
    font-size: 1rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 5px 9px;
  }

  .header-inner {
    height: 50px;
  }

  .full-name {
    font-size: 1.6rem;
  }

  .card-heading {
    font-size: 1.2rem;
  }

  .paper-title {
    font-size: 1rem;
  }
}
