/* ========================================
   Vincent MacKay - Personal Website
   Clean, minimal academic style
   ======================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: #111;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2rem; margin-bottom: 0.25rem; }
h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  padding-bottom: 0.25rem;
/*  border-bottom: 2px solid #6666ff; */
}
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #666;
}

em { font-style: italic; }

/* --- Layout --- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  display: none;
  padding: 4rem 0;
}

section.active {
  display: block;
}

section + section {
  border-top: 1px solid #eee;
}

.section-intro {
  margin-bottom: 2.5rem;
  max-width: 680px;
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand:hover {
  color: #111;
  text-decoration: none;
}

.nav-logo {
  width: 1.4rem;
  height: 1.4rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #555;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
  color: #111;
  border-bottom-color: #999;
}

.nav-links a.active {
  color: #111;
  border-bottom-color: #6666ff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #222;
  padding: 0.25rem;
  line-height: 1;
}

/* --- About Section --- */
.about-grid {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.about-photo {
  flex-shrink: 0;
}

.about-photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.about-text h1 {
  margin-bottom: 0.15rem;
}

.about-subtitle {
  color: #555;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.social-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  color: #555;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.social-links a:hover {
  color: #111;
}

.social-links i {
  font-size: 1.05rem;
  width: 1.1rem;
  text-align: center;
}

/* --- Project Cards (Research & Teaching) --- */
.projects {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project {
  display: flex;
  gap: 2rem;
  align-items: center;
}


.project:nth-child(even) {
  flex-direction: row-reverse;
}

.project-text {
  flex: 1;
  min-width: 0;
}

.project-text h3 {
  margin-bottom: 0.5rem;
}

.project-text p {
  color: #444;
  font-size: 0.95rem;
}

.project-image {
  flex-shrink: 0;
  width: 200px;
}

.project-image img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.project-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f3f3f3;
  border-radius: 4px;
}

/* --- Teaching Section --- */
.teaching-items {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.teaching-item h3 {
  margin-bottom: 0.15rem;
}

.teaching-meta {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.teaching-item p {
  color: #444;
  font-size: 0.95rem;
}

/* --- CV Section --- */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.cv-subsection {
  margin-bottom: 2.5rem;
}

.cv-subsection:last-child {
  margin-bottom: 0;
}

.cv-subsection h3 {
  font-size: 1.1rem;
  border-bottom: 2px solid #111;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

.cv-subsection h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: #333;
}

.cv-entry {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cv-entry-main {
  flex: 1;
  min-width: 0;
}

.cv-entry-date {
  color: #555;
  font-style: italic;
  white-space: nowrap;
  text-align: right;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.cv-entry-title {
  font-weight: 600;
}

.cv-entry-detail {
  color: #555;
  font-size: 0.9rem;
  padding-left: 1rem;
}

.cv-entry-amount {
  color: #555;
  font-size: 0.9rem;
  padding-left: 1rem;
  margin-bottom: 0.75rem;
}

/* Publications */
.publications-list {
  list-style: none;
  counter-reset: pub-counter;
}

.publications-list li {
  counter-increment: pub-counter;
  margin-bottom: 0.85rem;
  padding-left: 2.5rem;
  position: relative;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
}

.publications-list li::before {
  content: "[" counter(pub-counter) "]";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: #222;
}

.author-highlight {
  font-weight: 700;
  color: #111;
}

/* Talks */
.talks-list {
  list-style: none;
  counter-reset: talk-counter;
}

.talks-list li {
  counter-increment: talk-counter;
  margin-bottom: 0.85rem;
  padding-left: 2rem;
  position: relative;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
}

.talks-list li::before {
  content: counter(talk-counter) ".";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: #222;
}

.talk-venue {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.talk-location {
  color: #555;
  font-style: italic;
  white-space: nowrap;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.talk-title {
  display: block;
  color: #555;
  font-size: 0.85rem;
  padding-left: 0.25rem;
}

/* CV course table */
.cv-course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.cv-course-table td {
  padding: 0.2rem 0;
  color: #444;
  vertical-align: top;
}

.cv-course-table td:first-child {
  font-weight: 500;
  white-space: nowrap;
  padding-right: 1rem;
  color: #333;
}

.cv-course-table td:last-child {
  text-align: right;
  color: #777;
  font-style: italic;
  white-space: nowrap;
}

/* Community list */
.community-list {
  list-style: none;
}

.community-list > li {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.community-list > li > strong {
  display: block;
  color: #222;
}

.community-detail {
  color: #555;
  padding-left: 1rem;
  font-size: 0.85rem;
}

/* --- Footer --- */
footer {
  border-top: 1px solid #eee;
  padding: 2rem 0;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
}

footer a {
  color: #777;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    gap: 0.5rem;
  }

  .nav-links.open {
    display: flex;
  }

  .about-grid {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

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

  .social-links {
    justify-content: center;
  }

  .project,
  .project:nth-child(even) {
    flex-direction: column;
  }

  .project-image {
    width: 100%;
    max-width: 320px;
  }

  section {
    padding: 3rem 0;
  }

  .cv-entry {
    flex-direction: column;
    gap: 0.15rem;
  }

  .cv-entry-date {
    text-align: left;
  }

  .talk-venue {
    flex-direction: column;
    gap: 0.15rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  section {
    padding: 2rem 0;
  }

  .container {
    padding: 0 1rem;
  }

  .nav-links {
    padding: 1rem;
  }
}
