/* ---------- CSS Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; display: block; }
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover { border-bottom-color: var(--accent); }

/* ---------- Theme Variables ---------- */
:root {
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-subtle: #78716c;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --accent: #0f766e;          /* teal-700 */
  --accent-soft: #ccfbf1;     /* teal-100 */
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

html[data-theme="dark"] {
  --bg: #0c0a09;
  --bg-elev: #1c1917;
  --text: #f5f5f4;
  --text-muted: #a8a29e;
  --text-subtle: #78716c;
  --border: #292524;
  --border-strong: #44403c;
  --accent: #5eead4;         /* teal-300 */
  --accent-soft: #134e4a;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.25);
}

/* ---------- Layout ---------- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px 64px;
}

@media (max-width: 600px) {
  .container { padding: 48px 20px 40px; }
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  margin-bottom: 56px;
}

.hero-text { max-width: 60ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  line-height: 1.1;
}

.lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 24px;
  max-width: 60ch;
}

.lead a {
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
}
.lead a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Buttons ---------- */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Sections ---------- */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.section-body p {
  margin: 0 0 16px;
}
.section-body p:last-child { margin-bottom: 0; }

/* ---------- Experience / Timeline ---------- */
.timeline-item {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-meta {
  flex-shrink: 0;
  width: 90px;
  padding-top: 2px;
}
.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

.timeline-content h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.timeline-content .org {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 14px;
}
.timeline-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

@media (max-width: 600px) {
  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-meta { width: auto; }
}

/* ---------- Publications ---------- */
.pub {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }

.pub h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.45;
}
.pub h3 a {
  color: var(--text);
  border-bottom: none;
}
.pub h3 a:hover {
  color: var(--accent);
}
.pub-authors {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.pub-authors strong {
  color: var(--text);
  font-weight: 600;
}
.pub-venue {
  margin: 0;
}
.venue-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}
html[data-theme="dark"] .venue-tag {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Service list ---------- */
.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.service-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
}
.service-role {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
}
.service-venue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-subtle);
  font-weight: 400;
}

/* ---------- Footer ---------- */
.footer {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
}
.footer p { margin: 0; }

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Print styles ---------- */
@media print {
  .theme-toggle { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  .container { max-width: 100%; padding: 0; }
  a { color: black; text-decoration: underline; }
  .section { margin-bottom: 24px; page-break-inside: avoid; }
  .btn { border: 1px solid #ccc; background: white; color: black; }
}
