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

:root {
  --accent:    #1d4e89;
  --accent-lt: #2563a8;
  --text:      #1a1a1a;
  --muted:     #5a5a5a;
  --border:    #e2e6ea;
  --bg-light:  #f7f8fa;
  --white:     #ffffff;
  --nav-h:     64px;
  --max-w:     960px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

em { font-style: italic; }

/* === Layout === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-light {
  background: var(--bg-light);
}

/* === Navigation === */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#navbar.scrolled {
  border-color: var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

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

.nav-name {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-name:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(29, 78, 137, 0.06);
  text-decoration: none;
}

.nav-cv {
  font-weight: 500 !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  padding: 0.3rem 0.75rem !important;
  border-radius: 4px !important;
}
.nav-cv:hover {
  background: var(--accent) !important;
  color: var(--white) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

/* === Hero === */
.hero {
  padding: 5rem 0 4.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.hero-photo {
  flex-shrink: 0;
}

.photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  display: block;
}

.hero-text h1 {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 0.975rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.hero-bio {
  font-size: 1rem;
  color: var(--text);
  max-width: 580px;
  margin-bottom: 1.5rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.hero-links a {
  color: var(--accent);
  font-weight: 500;
}

.sep { color: var(--border); }

.icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.icon-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(29, 78, 137, 0.06);
  text-decoration: none;
}
.icon-link-cv span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.icon-link .ai {
  font-size: 1.1rem;
  line-height: 1;
}

/* Tooltip */
.icon-link::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.icon-link:hover::after { opacity: 1; }

/* === Section titles === */
.section-title {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.subsection-title {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

/* === About section === */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3.5rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1rem;
  font-size: 0.975rem;
}

.about-interests h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.interests-list {
  list-style: none;
  padding: 0;
}
.interests-list li {
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.interests-list li::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* === Publications === */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.25rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.pub-item:first-child { border-top: 1px solid var(--border); }

.pub-year {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.15rem;
}

.pub-title {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.45;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.pub-venue {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

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

.pub-link {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.pub-link:hover {
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
}

/* === Work in Progress === */
.wip-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.wip-list li {
  font-size: 0.975rem;
  color: var(--text);
  padding-left: 1.25rem;
  position: relative;
}
.wip-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}

/* === Contact === */
.contact-inner { }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.referee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.referee {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
}
.referee strong { font-weight: 600; }

/* === Footer === */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  text-align: center;
}

footer a { color: rgba(255,255,255,0.85); }
footer a:hover { color: #fff; }

.footer-note {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

footer p { font-size: 0.875rem; }

/* === Responsive === */
@media (max-width: 700px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
    gap: 0.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.5rem 0.25rem; font-size: 0.95rem; }
  .nav-toggle { display: block; }

  .hero-inner { flex-direction: column; gap: 1.5rem; }
  .photo { width: 100px; height: 100px; }
  .hero-text h1 { font-size: 1.75rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .referee-grid { grid-template-columns: 1fr; }

  .pub-item { grid-template-columns: 42px 1fr; gap: 0.75rem; }
  .section { padding: 3.5rem 0; }
}
