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

:root {
  --red:       #e63222;
  --black:     #0f0f0f;
  --gray-700:  #333333;
  --gray-500:  #6b6b6b;
  --gray-300:  #d4d4d4;
  --gray-100:  #f7f7f7;
  --white:     #ffffff;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w:     820px;
  --header-h:  60px;
}

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 1px 0 var(--gray-300);
  height: var(--header-h);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  height: 100%;
}

.site-logo-link { display: flex; align-items: center; }
.site-logo {
  height: 28px;
  width: auto;
  display: block;
  transition: opacity 0.2s ease;
}


/* ── Nav ──────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-700);
  padding: 0.25rem;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0;
  align-items: center;
}

.nav-list a {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

.nav-list a:hover { color: var(--black); }
.nav-list a.active { color: var(--red); }

/* ── Main ─────────────────────────────────────────────────── */
.site-main {
  min-height: calc(100vh - var(--header-h) - 120px);
  padding: 3.5rem 0 5rem;
}

/* ── Home hero (centered logo) ────────────────────────────── */
.home-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.home-logo {
  height: 250px;
  width: auto;
  display: inline-block;
}

/* ── Person cards ─────────────────────────────────────────── */
.person-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.person-photo {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.person-photo.photo-placeholder::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gray-300);
  border-radius: 50%;
}

.person-photo a {
  display: block;
  width: 100%;
  height: 100%;
}

.person-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.person-info h3 {
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.person-info p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ── Easter egg details ───────────────────────────────────── */
.easter-egg {
  margin-top: 2rem;
  border-top: 1px solid var(--gray-300);
  padding-top: 1.5rem;
}

.easter-egg summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-500);
  user-select: none;
  list-style: none;
}

.easter-egg summary::-webkit-details-marker { display: none; }

.easter-egg summary::before {
  content: '+ ';
  font-weight: 600;
}

details[open].easter-egg summary::before {
  content: '− ';
}

.easter-egg > *:not(summary) {
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* Hero easter egg — must come after base .easter-egg rules */
.hero-easter-egg {
  margin-top: 0.5rem;
  border-top: none;
  padding-top: 0;
}
.hero-easter-egg summary {
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.home-hero:hover .hero-easter-egg summary { opacity: 1; }
.hero-easter-egg[open] summary { opacity: 1; }
.hero-easter-egg[open] { margin-top: 0.5rem; }
.hero-easter-egg > *:not(summary) {
  text-align: left;
}
.easter-egg-body {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 0.5rem;
}
.easter-egg-body p:last-child { margin-bottom: 0; }

/* ── Page content / Markdown ──────────────────────────────── */
.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-content h2 {
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--black);
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.page-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin-top: 2rem;
  margin-bottom: 0.4rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content a {
  color: var(--red);
  text-decoration: none;
}
.page-content a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-content ul, .page-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
}
.page-content li { margin-bottom: 0.25rem; }

.page-content strong { font-weight: 600; color: var(--black); }

.page-content em { font-style: italic; }

.page-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.page-content pre {
  background: var(--gray-100);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border-radius: 6px;
  margin: 1.25rem 0;
}
.page-content pre code {
  background: none;
  padding: 0;
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--gray-300);
  margin: 2.5rem 0;
}

.page-content blockquote {
  padding-left: 1.25rem;
  color: var(--gray-500);
  font-style: italic;
  margin: 1.25rem 0;
}

/* ── News list ────────────────────────────────────────────── */
.news-section { margin-top: 3rem; }

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

.news-item {
  display: flex;
  gap: 1.25rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--gray-300);
  font-size: 0.9rem;
  line-height: 1.5;
}

.news-date {
  flex-shrink: 0;
  width: 5rem;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
  padding-top: 0.05em;
}

.news-body a { color: var(--red); text-decoration: none; }
.news-body a:hover { text-decoration: underline; text-underline-offset: 3px; }

.news-more { margin-top: 0.75rem; font-size: 0.9rem; }
.news-more a { color: var(--red); text-decoration: none; }
.news-more a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Publications list ────────────────────────────────────── */
.pub-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.pub-entry {
  padding: 0.75rem 0;
  border-top: 1px solid var(--gray-300);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pub-authors {
  color: var(--gray-500);
  margin-bottom: 0.15rem;
}

.pub-title {
  font-weight: 500;
  color: var(--black);
  margin-bottom: 0.15rem;
}

.pub-title a { color: var(--black); text-decoration: none; }
.pub-title a:hover { color: var(--red); }

.pub-meta {
  color: var(--gray-500);
  font-size: 0.85rem;
}

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

.pub-award {
  color: #b07800;
  font-weight: 600;
  margin-left: 0.4rem;
}

.pub-links { margin-top: 0.2rem; font-size: 0.82rem; }
.pub-links a {
  color: var(--red);
  text-decoration: none;
  margin-right: 0.75rem;
}
.pub-links a:hover { text-decoration: underline; }

/* ── People / Alumni lists ────────────────────────────────── */
.section-note {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.people-list, .alumni-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.people-list li, .alumni-list li {
  padding: 0.35rem 0;
  border-top: 1px solid var(--gray-300);
  font-size: 0.9rem;
}

.person-role {
  color: var(--gray-500);
  margin-left: 0.5rem;
}

.alumni-position { color: var(--gray-500); margin: 0 !important; font-size: 0.9rem; }
.alumni-year { color: var(--gray-500); font-size: 0.85rem; margin-left: 0.25rem; }
.alumni-thesis { font-size: 0.85rem; color: var(--gray-500); margin: 0 !important; font-style: italic; }
.alumni-thesis a { color: var(--gray-500); text-decoration: none; }
.alumni-thesis a:hover { color: var(--red); }

/* ── Contact page ─────────────────────────────────────── */
.contact-block {
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ── Course list ──────────────────────────────────────────── */
.course-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.course-list li {
  display: flex;
  gap: 1.25rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--gray-300);
  font-size: 0.9rem;
}

.course-term {
  flex-shrink: 0;
  width: 8rem;
  color: var(--gray-500);
}

/* ── Map embed ────────────────────────────────────────────── */
.map-container {
  margin: 1.5rem 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gray-300);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #f0f0f0;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: #555555;
  text-align: center;
  line-height: 1.9;
}

.site-footer a {
  color: #555555;
  text-decoration: none;
}
.site-footer a:hover { color: var(--black); }

.footer-links { margin-top: 0.2rem; }
.footer-directions { margin-top: 0.2rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --header-h: 52px; }

  .site-logo { height: 22px; }
  .home-logo { height: 180px; }

  .nav-toggle { display: block; }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--white);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0;
  }
  .nav-list.open { display: flex; }
  .nav-list li { width: 100%; }
  .nav-list a { padding: 0.6rem 0.5rem; font-size: 1rem; }

  .site-main { padding: 2rem 0 3rem; }
  .page-content h1 { font-size: 1.6rem; }
  .page-content h2 { font-size: 1.1rem; }
}
