/* Modern static site — Minesh Mathew */
:root {
  --bg: #f8f9fc;
  --bg-elevated: #ffffff;
  --text: #1c1e26;
  --text-muted: #5c6370;
  --border: #e4e7ee;
  --accent: #3b5bdb;
  --accent-hover: #2f4ac0;
  --accent-soft: rgba(59, 91, 219, 0.1);
  --shadow: 0 1px 3px rgba(28, 30, 38, 0.06), 0 8px 24px rgba(28, 30, 38, 0.06);
  --radius: 12px;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --max-width: 1100px;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-elevated: #181b24;
  --text: #e8eaef;
  --text-muted: #9aa3b2;
  --border: #2a2f3d;
  --accent: #748ffc;
  --accent-hover: #91a7ff;
  --accent-soft: rgba(116, 143, 252, 0.15);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.25rem;
}

/* Main layout */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.page-lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 2rem;
  max-width: 42rem;
}

/* Hero (home) */
.hero {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero .subtitle {
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 0.25rem;
}

.hero .location {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.hero .bio {
  margin: 0 0 1.25rem;
  color: var(--text);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
}

.social-links a:hover {
  background: var(--accent);
  color: white;
  text-decoration: none;
}

/* Sections */
.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-soft);
}

.section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-muted);
}

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

.news-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 5.5rem;
}

/* Cards */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.card .meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-style: italic;
}

.card .authors {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.card p {
  margin: 0 0 0.75rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.card-links a {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
}

.card-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* Publications page */
.publications-page .page-lead {
  max-width: 40rem;
}

.pub-year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: calc(var(--nav-height) + 0.5rem);
  z-index: 10;
  box-shadow: var(--shadow);
}

.pub-year-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-muted);
}

.pub-year-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.pub-year-block {
  margin-bottom: 2.5rem;
}

.pub-year-label {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid var(--accent);
  color: var(--text);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pub-item:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 4px 20px rgba(28, 30, 38, 0.08);
}

[data-theme="dark"] .pub-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.pub-title {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.pub-authors {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pub-venue {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  text-decoration: none !important;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pub-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.pub-link-pdf {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  color: var(--accent);
}

.pub-link-pdf:hover,
.pub-link-paper:hover,
.pub-link-project:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pub-link-scholar {
  font-weight: 500;
  color: var(--text-muted);
}

/* Timeline (career) */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
}

.timeline > li {
  padding: 0 0 1.75rem 1.5rem;
  position: relative;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text);
}

.timeline .period {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.timeline p,
.timeline ul {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.timeline ul {
  padding-left: 1.25rem;
}

/* Simple lists */
.content-list {
  padding-left: 1.25rem;
}

.content-list li {
  margin-bottom: 0.5rem;
}

.content-list ul {
  margin-top: 0.5rem;
}

/* Resources grouped */
.resource-group {
  margin-bottom: 2rem;
}

.resource-group h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

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

.resource-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.resource-list li:last-child {
  border-bottom: none;
}

.resource-year {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  font-weight: 500;
}

/* Utility */
.scholar-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--accent);
  color: white !important;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none !important;
}

.scholar-cta:hover {
  background: var(--accent-hover);
  color: white !important;
}

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

  .site-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    margin: 0 auto;
  }

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

  .news-list li {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 1.5rem 1rem 3rem;
  }

  .hero {
    padding: 1.25rem;
  }
}
