/* ===== CSS Variables ===== */
:root {
  --color-primary: #1e293b;    /* slate-800 */
  --color-primary-dark: #0f172a; /* slate-900 */
  --color-accent: #334155;     /* slate-700 */
  --color-text: #1e293b;
  --color-text-light: #64748b; /* slate-500 */
  --color-bg: #ffffff;
  --color-bg-subtle: #f8fafc;  /* slate-50 */
  --color-border: #e2e8f0;     /* slate-200 */
  --color-nav-hover: #f1f5f9;  /* slate-100 */
  --color-link: #2563eb;       /* blue-600 */
  --color-link-hover: #1d4ed8; /* blue-700 */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --max-content-width: 750px;
}

@media (min-width: 1200px) {
  :root {
    --max-content-width: 900px;
  }
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  padding-left: 1.5rem;
}

/* ===== Layout ===== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .site-content {
    flex-direction: row;
  }
}

/* ===== Header ===== */
.site-header {
  background: var(--color-primary-dark);
  color: white;
  padding: 1.5rem 2rem;
}

.site-header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.site-header a {
  color: white;
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: none;
  opacity: 0.9;
}

.site-header .subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #94a3b8; /* slate-400 */
  margin-top: 0.25rem;
  font-weight: 300;
}

/* ===== Navigation ===== */
.site-nav {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.site-nav a:hover {
  background: var(--color-nav-hover);
  text-decoration: none;
}

.site-nav a.active {
  background: var(--color-primary-dark);
  color: white;
}

@media (min-width: 768px) {
  .site-nav {
    width: 180px;
    min-width: 180px;
    border-bottom: none;
    border-right: 1px solid var(--color-border);
    padding: 1.5rem 1rem;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.125rem;
  }

  .site-nav a {
    padding: 0.5rem 0.75rem;
  }
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: var(--max-content-width);
}

@media (min-width: 768px) {
  .main-content {
    padding: 2rem 3rem;
  }
}

.main-content h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.main-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--color-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.main-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.main-content p {
  margin-bottom: 1rem;
}

/* ===== Home Page ===== */
.home-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .home-layout {
    flex-direction: row;
    gap: 2.5rem;
    align-items: flex-start;
  }
}

.home-headshot {
  max-width: 280px;
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .home-headshot {
    max-width: 220px;
  }
}

.home-intro p {
  margin-bottom: 1rem;
}

/* ===== Profile Links ===== */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.profile-link {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.profile-link:hover {
  background: var(--color-nav-hover);
  border-color: var(--color-text-light);
  color: var(--color-text);
  text-decoration: none;
}

/* ===== Featured Callout ===== */
.featured-callout {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
}

.featured-callout h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

/* ===== Publications ===== */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.pub-list li:last-child {
  border-bottom: none;
}

.pub-title {
  font-weight: 600;
}

.pub-authors {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.pub-journal {
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.pub-code {
  font-size: 0.85rem;
  margin-top: 0.35rem;
  color: var(--color-text-light);
}

.pub-code a {
  font-size: 0.85rem;
}

/* ===== Talks ===== */
.talks-list {
  list-style: none;
  padding: 0;
}

.talks-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.talks-list li:last-child {
  border-bottom: none;
}

.talk-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  background: var(--color-nav-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

.talk-date {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

/* ===== Teaching ===== */
.course-section h3 {
  margin-top: 1.25rem;
}

.course-list {
  list-style: none;
  padding: 0;
}

.course-list li {
  padding: 0.3rem 0;
}

/* ===== Contact ===== */
.contact-item {
  margin-bottom: 1.25rem;
}

.contact-item h3 {
  margin-bottom: 0.25rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-primary-dark);
  color: #94a3b8;
  text-align: center;
  padding: 1rem 2rem;
  font-size: 0.8rem;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.8rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

/* ===== Collapsible ===== */
.collapsible {
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  padding: 0.75rem 1rem;
  width: 100%;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-family: var(--font-body);
  border-radius: 4px;
  margin-top: 0.75rem;
  transition: background-color 0.15s;
}

.collapsible:hover,
.collapsible.active {
  background: var(--color-accent);
}

.collapsible-content {
  display: none;
  padding: 1rem 0 0.5rem;
  overflow: hidden;
}

/* ===== Utility ===== */
.cta-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.15s;
}

.cta-link:hover {
  background: var(--color-accent);
  color: white;
  text-decoration: none;
}
