:root {
  --bg: #ffffff;
  --text: #374151;
  --heading: #111827;
  --accent: #1d4ed8;
  --muted: #6b7280;
  --border: #e5e7eb;
  --max-w: 760px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

a:hover {
  text-decoration: underline;
}

/* ── Navigation ─────────────────────────────── */
header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  padding: 0 2rem;
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-name {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--heading);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  align-self: stretch; /* fill nav height so top:100% on dropdown lands below header */
}

.nav-links > li {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links > li > a {
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--heading);
  text-decoration: none;
}

/* ── Dropdown ───────────────────────────────── */
.has-dropdown > a::after {
  content: ' ▾';
  font-size: 0.95em;
  opacity: 0.6;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  list-style: none;
  padding: 0.35rem 0;
  display: none;
  z-index: 20;
}

.nav-links li:hover .dropdown,
.nav-links li:focus-within .dropdown {
  display: block;
}

.dropdown a {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
}

.dropdown a:hover,
.dropdown a.active {
  color: var(--heading);
  background: #f9fafb;
  text-decoration: none;
}

/* ── Main content ───────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Profile ────────────────────────────────── */
.profile {
  display: flex;
  gap: 2.5rem;
}

.profile-photo {
  width: 275px;
  border-radius: 6px;
  flex-shrink: 0;
  background-color: var(--border);
  background-size: cover;
  background-position: center;
}

.profile-text h1 {
  font-size: 1.875rem;
  color: var(--heading);
  margin-bottom: 0.2rem;
}

.profile-text .role {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.profile-text p {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 1.25rem;
}

.contact-links a {
  font-size: 0.875rem;
  color: var(--muted);
}

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

/* ── Publication / Talk entries ─────────────── */
.group {
  margin-bottom: 3rem;
}

.group-heading {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.25rem;
}

.group-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.25rem;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.entry {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.entry-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--heading);
  margin-bottom: 0.2rem;
}

.entry-meta {
  font-size: 0.825rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.entry-authors {
  font-size: 0.825rem;
  margin-bottom: 0.4rem;
}

.entry-authors .self {
  font-weight: 700;
}

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

.badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent);
  line-height: 1.6;
  transition: background 0.15s, color 0.15s;
}

.badge:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── Service table ──────────────────────────── */
.service-table {
  width: 100%;
  border-collapse: collapse;
}

.service-table th,
.service-table td {
  text-align: left;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.service-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-table td:first-child {
  font-weight: 600;
  color: var(--muted);
  width: 5rem;
}

/* ── Hobbies landing ────────────────────────── */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.hobby-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  color: var(--text);
  transition: border-color 0.15s;
}

.hobby-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.hobby-card h3 {
  color: var(--heading);
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.hobby-card p {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Coming soon ────────────────────────────── */
.coming-soon {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 0 1rem; }
  main { padding: 2rem 1rem; }

  .nav-name { font-size: 1.05rem; }
  .nav-links { gap: 1rem; }
  .has-dropdown > a::after { display: none; }

  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

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