/* ===== CSS RESET & VARIABLES ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f3f0;
  --text: #1a1a1a;
  --text-muted: #555;
  --accent: #2c2c2c;
  --link: #1a1a1a;
  --link-hover: #666;
  --nav-bg: rgba(245, 243, 240, 0.92);
  --border: #ccc;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  /* Fixed background image — replace background.png with your file */
  background-image: url('images/background.png');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

a:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

/* ===== NAVIGATION BAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar .site-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.navbar nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.navbar nav a {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  border-bottom: none;
  position: relative;
  padding-bottom: 2px;
}

.navbar nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.navbar nav a:hover::after,
.navbar nav a.active::after {
  width: 100%;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== MAIN CONTENT AREA ===== */
.page-body {
  margin-top: 60px; /* clear the navbar */
}

/* ===== HOMEPAGE LAYOUT ===== */
.home-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 50px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 40px 80px;
  align-items: start;
}

/* --- Left sidebar: photo + links --- */
.sidebar {
  position: sticky;
  top: 80px;
}

.portrait-wrapper {
  width: 100%;
  max-width: 300px;
}

.portrait-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 30px 15px rgba(245, 243, 240, 0.9);
}

.sidebar-links {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-links .sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: none;
  color: var(--text);
}

.sidebar-links .sidebar-link img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.sidebar-links .sidebar-link:hover {
  color: var(--link-hover);
}

/* --- Right: biography content --- */
.bio-content {
  padding-top: 10px;
}

.epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.6;
}

.epigraph .attribution {
  display: block;
  text-align: right;
  font-style: normal;
  font-size: 0.85rem;
  margin-top: 4px;
}

.bio-content h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.bio-content p {
  margin-bottom: 20px;
  max-width: 680px;
}

.bio-content h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 30px;
  margin-bottom: 12px;
}

.bio-content ul {
  list-style: disc;
  padding-left: 24px;
  max-width: 680px;
}

.bio-content ul li {
  margin-bottom: 8px;
}

/* ===== GENERIC PAGE (Research, Publications, etc.) ===== */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 40px 100px;
}

.page-container h1 {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 20px;
}

.page-container .under-construction {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 12px;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 24px 60px;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .portrait-wrapper {
    max-width: 240px;
  }

  .sidebar-links {
    align-items: center;
  }

  .bio-content {
    padding-top: 0;
  }

  .navbar {
    padding: 12px 20px;
  }

  .navbar nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .navbar nav.open {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .page-container {
    padding: 40px 24px 60px;
  }
}
