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

:root {
  --bg-light: #fdfbf9;
  --bg-card: #fff8f0;
  --bg-white: #ffffff;
  --bg-footer: #f8fafc;
  --accent-warm: #e67e22;
  --accent-warm-dim: #d35400;
  --accent-blue: #1e3a8a;
  --accent-blue-light: #3b82f6;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --border: #f0e6dc;
  --border-blue: #dbeafe;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-blue-sm: 0 2px 8px rgba(30, 58, 138, 0.1);
  --shadow-blue-md: 0 4px 16px rgba(30, 58, 138, 0.15);
  --shadow-warm-sm: 0 4px 12px rgba(230, 126, 34, 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
}

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


/* ===== Focus & Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--accent-blue-light);
  outline-offset: 2px;
  border-radius: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
header {
  padding: 60px 0 40px;
  border-bottom: 2px solid var(--accent-blue);
  background: linear-gradient(to bottom, var(--bg-footer) 0%, var(--bg-light) 100%);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-blue);
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.profile-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.25);
}

.header-text h1 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

.header-text .tagline {
  font-size: 19px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.01em;
  font-style: italic;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}
nav {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
  letter-spacing: 0.01em;
  background: var(--bg-white);
  display: inline-block;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

nav a:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue-sm);
}

nav a.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}


/* ===== Main Content ===== */
main {
  padding: 48px 0;
  flex: 1;
}

/* ===== Section Headers (h2) ===== */
h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  position: relative;
  padding-left: 16px;
  color: var(--accent-blue);
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--accent-warm);
  border-radius: 2px;
}

/* ===== Intro Paragraph ===== */
.intro {
  font-size: 19px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 56px;
  max-width: 900px;
  font-style: italic;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

/* ===== Timeline (Career) ===== */
.timeline {
  margin-bottom: 56px;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px 16px;
}

.timeline-item {
  position: relative;
}

.timeline-content {
  background: var(--bg-white);
  border: 2px solid var(--border-blue);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.timeline-item:hover .timeline-content {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-blue-md);
  transform: translateY(-4px);
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background: var(--bg-white);
  border: 3px solid var(--accent-blue);
  border-radius: 50%;
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  transition: all var(--transition);
  z-index: 2;
}

.timeline-item:hover .timeline-dot {
  background: var(--accent-blue);
  box-shadow: 0 0 16px rgba(30, 58, 138, 0.4);
}

.timeline-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 6px;
  line-height: 1.3;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

.timeline-company {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.3;
  font-style: italic;
  flex-grow: 1;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.timeline-date {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  color: var(--text-tertiary);
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ===== Publication Cards (index + publications) ===== */
.publication {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.publication:hover {
  border-color: var(--accent-warm);
  box-shadow: var(--shadow-warm-sm);
  transform: translateY(-2px);
}

.pub-badge {
  display: inline-block;
  background: var(--accent-warm);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

.pub-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.5;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

.pub-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  font-style: italic;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.pub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-link {
  color: var(--accent-blue-light);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--accent-blue-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: inline-block;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

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


/* ===== About Page ===== */
.about-content {
  max-width: 900px;
}

.about-content h2 {
  margin-top: 48px;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-content p em {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 17px;
}

.about-content code {
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  color: var(--accent-warm);
  font-size: 14px;
  border: 1px solid var(--border);
  word-break: break-word;
}

.about-content a {
  color: var(--accent-blue-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.about-content a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* ===== Publications Page ===== */
.publications-content {
  max-width: 1000px;
}

.publications-content .intro {
  padding: 20px 24px;
  background: var(--bg-white);
  border-left: 4px solid var(--accent-warm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 17px;
  margin-bottom: 48px;
  max-width: none;
}

.publications-content .intro a {
  color: var(--accent-blue-light);
  text-decoration: none;
  font-weight: 500;
}

.publications-content .intro a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.publications-content h4 {
  font-size: 28px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-top: 48px;
  margin-bottom: 24px;
  padding-left: 16px;
  position: relative;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

.publications-content h4:first-of-type {
  margin-top: 0;
}

.publications-content h4::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--accent-warm);
  border-radius: 2px;
}

.publications-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
}

.publications-content li {
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.publications-content li:hover {
  border-color: var(--accent-warm);
  box-shadow: var(--shadow-warm-sm);
  transform: translateX(4px);
}

.publications-content li b,
.publications-content li strong {
  color: var(--accent-blue);
  font-weight: 700;
}

.publications-content li em {
  color: var(--text-primary);
  font-style: italic;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 15px;
}

.publications-content li a {
  color: var(--accent-blue-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.publications-content li a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.highlight {
  background: var(--accent-warm);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

/* ===== Footer ===== */
footer {
  border-top: 2px solid var(--accent-blue);
  padding: 32px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  background: var(--bg-footer);
  margin-top: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .header-text h1 {
    font-size: 32px;
  }

  .header-text .tagline {
    font-size: 15px;
  }

  nav {
    position: static; /* don't stick on small screens — takes too much space */
  }

  nav ul {
    justify-content: center;
  }

  main {
    padding: 32px 0;
  }

  h2 {
    font-size: 22px;
  }

  .intro {
    font-size: 15px;
    margin-bottom: 36px;
  }

  /* Timeline mobile: vertical layout */
  .timeline-track {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-left: 32px;
  }

  .timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 0;
    bottom: -24px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--border-blue) 100%);
  }

  .timeline-item:last-child::before {
    bottom: 50%;
  }

  .timeline-dot {
    position: absolute;
    left: -32px;
    top: 20px;
    transform: none;
  }

  .timeline-content {
    text-align: left;
  }

  /* About page */
  .about-content p {
    font-size: 15px;
  }

  /* Publications page */
  .publications-content h4 {
    font-size: 20px;
    margin-top: 36px;
  }

  .publications-content li {
    font-size: 13px;
    padding: 14px 16px;
  }

  .publication {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  header {
    padding: 40px 0 28px;
  }

  .profile-photo {
    width: 96px;
    height: 96px;
  }

  .header-text h1 {
    font-size: 26px;
  }

  nav a {
    padding: 8px 14px;
    font-size: 13px;
  }

  .publication {
    padding: 16px;
  }

  .pub-title {
    font-size: 16px;
  }

  .pub-description {
    font-size: 14px;
  }
}

/* ===== Print ===== */
@media print {
  nav, footer { display: none; }
  body { background: #fff; }
  .publication, .publications-content li {
    break-inside: avoid;
    box-shadow: none;
    border-color: #ccc;
  }
  a { color: var(--text-primary); text-decoration: underline; }
}
