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

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f4f3ef;
  --border: #e8e6e0;
  --text: #1a1a18;
  --text-muted: #6b6860;
  --accent: #154a73;
  --accent-light: #e3ecf3;
  --accent-hover: #0d3656;
  --nav-bg: #ffffff;
  --header-h: 64px;
  --content-max: 900px;
  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

/* ===== Typography ===== */
h1 { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--accent); }
h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
p { margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }

/* ===== Top Header / Navigation ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.site-header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}
.site-header .site-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.site-header .site-name:hover { text-decoration: none; }

.topnav {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  flex-wrap: wrap;
}
.topnav a {
  padding: 0.45rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.15s;
  white-space: nowrap;
}
.topnav a:hover {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
.topnav a.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius);
  flex-direction: column; gap: 5px;
  margin-left: auto;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ===== Main Content ===== */
.layout { display: block; }
.main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ===== Cards / Sections ===== */
.card {
  padding: 0.5rem 0 2rem;
  margin-bottom: 1.5rem;
}
.card + .card { 
  padding-top: 3rem;
}
.page-title {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-title h1 { margin-bottom: 0.25rem; }
.page-title .subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Home Page ===== */
.profile-hero {
  display: flex; gap: 2.5rem; align-items: stretch;
  padding: 0.5rem 0 2rem;
  margin-bottom: 1.5rem;
}
.profile-hero img {
  width: 240px; height: 240px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  align-self: flex-start;
}
.profile-info { display: flex; flex-direction: column; justify-content: center; }
.profile-info h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.profile-info .role { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; }
.profile-info address { font-style: normal; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); }
.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.social-links a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.85rem; padding: 0.3rem 0.75rem;
  border: 1px solid var(--border); border-radius: 20px;
  color: var(--text-muted); transition: all 0.15s;
}
.social-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ===== Publications ===== */
.pub-entry {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.pub-entry:last-child { border-bottom: none; }
.pub-entry p { margin-bottom: 0.25rem; font-size: 0.92rem; }
.pub-entry .pub-pdf { font-size: 0.82rem; font-weight: 600; }
.pub-year-group { margin-bottom: 2rem; }
.pub-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.pub-nav a { font-size: 0.85rem; font-weight: 600; padding: 0.35rem 0.85rem; border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); text-decoration: none; transition: all 0.15s; }
.pub-nav a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ===== Tutoring/Team Entries ===== */
.person-entry {
  display: flex; flex-direction: column;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.person-entry:last-child { border-bottom: none; }
.person-entry .name { font-weight: 700; font-size: 0.95rem; }
.person-entry .meta { font-size: 0.87rem; color: var(--text-muted); }
.award-badge {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700;
  padding: 0.15rem 0.5rem;
  background: #fff8e1; border: 1px solid #f0c040;
  color: #6b4c00; border-radius: 20px; margin-top: 0.3rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .site-header-inner { padding: 0 1rem; }
  .hamburger { display: flex; }
  .topnav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 0.75rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid var(--border);
  }
  .topnav.open { display: flex; }
  .topnav a {
    padding: 0.7rem 1.5rem;
    border-radius: 0;
  }
  .main { padding: 1.5rem 1.25rem 3rem; }
  .profile-hero { flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; }
  .profile-hero img { width: 200px; height: 200px; align-self: center; }
  .profile-info { align-items: center; }
  .profile-info address { text-align: center; }
  .social-links { justify-content: center; }
  h1 { font-size: 1.6rem; }
}

/* ===== Misc ===== */
.tag { display: inline-block; font-size: 0.8rem; background: var(--accent-light); color: var(--accent); padding: 0.15rem 0.5rem; border-radius: 20px; margin-bottom: 0.5rem; }
.media-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.media-item:last-child { border-bottom: none; }
.btn {
  display: inline-block; padding: 0.45rem 1rem;
  background: var(--accent); color: white;
  border-radius: var(--radius); font-size: 0.88rem; font-weight: 600;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); color: white; text-decoration: none; }
.btn-outline {
  background: none; border: 1px solid var(--accent); color: var(--accent);
}
.btn-outline:hover { background: var(--accent-light); }
