/* 
 * Classic Academic Style
 * Old-fashioned, professional, simple
 */

:root {
  --color-bg: #fdfbf7;
  --color-text: #2c2c2c;
  --color-text-muted: #5a5a5a;
  --color-accent: #8b4513;
  --color-link: #6b4423;
  --color-link-hover: #4a2f18;
  --color-border: #d4c4a8;
  --color-rule: #c9b896;
  
  --font-serif: "Georgia", "Times New Roman", "Noto Serif", serif;
  --font-mono: "Consolas", "Monaco", monospace;
  
  --max-width: 720px;
  --spacing: 1.5rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-text: #e0e0e0;
    --color-text-muted: #a0a0a0;
    --color-accent: #c4956a;
    --color-link: #d4a574;
    --color-link-hover: #e8c9a8;
    --color-border: #3a3a3a;
    --color-rule: #404040;
  }
}

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

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--spacing) 4rem;
}

/* Section cards */
section, .section {
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

@media (prefers-color-scheme: dark) {
  section, .section {
    background: rgba(255,255,255,0.02);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
}

section h2:first-child,
.section h2:first-child {
  margin-top: 0;
}

section:first-of-type {
  text-align: center;
}

section .pub-list,
section .bio-list,
section .contact-list {
  margin-bottom: 0;
}

/* Navigation */
nav.site-nav {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
  padding: 0.75rem 0;
  margin: -3rem calc(-1 * var(--spacing)) 2rem;
  padding-left: var(--spacing);
  padding-right: var(--spacing);
  z-index: 100;
}

nav.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

nav.site-nav a {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: none;
}

nav.site-nav a:hover {
  color: var(--color-link);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-rule);
}

header h1 {
  font-size: 2rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

header .tagline {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

h1 { font-size: 1.75rem; }
h2 { 
  font-size: 1.25rem; 
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 0.5rem;
}
h3 { 
  font-size: 1.1rem;
  margin-top: 1.5rem;
  color: var(--color-text-muted);
}

p {
  margin: 0 0 1.25rem;
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

a:hover {
  color: var(--color-link-hover);
  border-bottom-color: var(--color-link-hover);
}

/* Lists */
ul, ol {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

li::marker {
  color: var(--color-text-muted);
}

/* Profile image */
.profile {
  text-align: center;
  margin-bottom: 2rem;
}

.profile img {
  max-width: 180px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  .profile img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
}

/* Intro paragraph */
.intro {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Research overview */
.research-overview {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

/* Contact icons */
.contact-icons {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.contact-icons li {
  margin: 0;
}

.contact-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--color-rule);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
  border-bottom: none;
  transition: background 0.2s ease;
}

.contact-icons a:hover {
  background: var(--color-link);
  color: var(--color-bg);
}

/* Bio timeline */
.bio-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bio-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.25rem 1rem;
  padding: 0.4rem 0;
}

.bio-list .year {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.bio-list .info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bio-list .title {
  font-weight: 500;
}

.bio-list .place {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Fix anchor scroll offset for sticky nav */
section[id] {
  scroll-margin-top: 4rem;
}

/* Publications */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  margin-bottom: 1.5rem;
  padding-left: 0;
  text-indent: 0;
  line-height: 1.5;
}

.pub-list li a:first-child {
  font-weight: 500;
}

.pub-list .authors {
  font-size: 0.95rem;
  color: var(--color-text);
}

/* Highlight my name in author lists */
.pub-list .authors .me {
  font-weight: 600;
}

.pub-list .venue {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.pub-list .links {
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.pub-list .links a {
  color: var(--color-text-muted);
}

/* View all link */
.view-all {
  text-align: center;
  margin-top: 1.5rem;
}

.view-all a {
  font-size: 0.95rem;
}

/* Collapsible year sections */
details.year-section {
  margin-bottom: 0.5rem;
}

details.year-section summary {
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  padding: 0.5rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

details.year-section summary::-webkit-details-marker {
  display: none;
}

details.year-section summary::before {
  content: "▸";
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

details.year-section[open] summary::before {
  transform: rotate(90deg);
}

details.year-section summary:hover {
  color: var(--color-link);
}

details.year-section .pub-list {
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-rule);
}

/* Code / email */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-text-muted);
  background: rgba(0,0,0,0.03);
  padding: 0.15em 0.3em;
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  code {
    background: rgba(255,255,255,0.08);
  }
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-rule);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Back link */
.back-link {
  margin-bottom: 2rem;
}

.back-link a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }
  
  .container {
    padding: 2rem 1.25rem 3rem;
  }
  
  nav.site-nav {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  
  nav.site-nav ul {
    gap: 1rem;
  }
  
  header h1 {
    font-size: 1.6rem;
  }
  
  .contact-list {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .bio-list li {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .bio-list .year {
    width: auto;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    font-size: 11pt;
    color: black;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  nav.site-nav {
    display: none;
  }
  
  a {
    color: inherit;
    border: none;
  }
  
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  details.year-section {
    display: block;
  }
  
  details.year-section[open] summary::before,
  details.year-section summary::before {
    display: none;
  }
}
