/* ── Variables ───────────────────────────────────────────────── */
:root {
  --bg:         #ffffff;
  --bg-alt:     #f8f8f8;
  --text:       #0a0a0a;
  --muted:      #6b7280;
  --subtle:     #d1d5db;
  --border:     #e5e7eb;
  --surface:    #ffffff;
  --nav-h:      60px;
  --max-w:      1020px;
  --ease:       cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:         #0a0a0a;
  --bg-alt:     #111111;
  --text:       #f5f5f5;
  --muted:      #9ca3af;
  --subtle:     #374151;
  --border:     #1f1f1f;
  --surface:    #111111;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

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

.section        { padding: 100px 0; }
.section-alt    { background: var(--bg-alt); }

/* ── Navigation ──────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}

.navbar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--text);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0;
  flex: 1;
}

.nav-links a {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: .4rem .7rem;
  border-radius: 4px;
  transition: color .2s var(--ease);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: .7rem;
  right: .7rem;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform .25s var(--ease);
  transform-origin: left;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.lang-switch {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: .25rem .6rem;
  border-radius: 4px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.lang-switch:hover { color: var(--text); border-color: var(--text); }

/* ── Theme Toggle ────────────────────────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  width: 52px;
  height: 26px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 4px;
  gap: 4px;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform .3s var(--ease), background .3s var(--ease);
  z-index: 1;
}

[data-theme="dark"] .toggle-thumb { transform: translateX(26px); }

.toggle-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--muted);
  line-height: 1;
  z-index: 0;
}
.light-label { margin-left: auto; }
.dark-label  { margin-right: 2px; }

/* ── Hamburger ───────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Scroll reveal ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Section Header ──────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-num {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: 120px 0 100px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 5rem;
  align-items: center;
}

.hero-eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.hero-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -2px;
  margin-bottom: 1.75rem;
}
.hero-name em {
  font-style: italic;
  color: var(--muted);
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 2.25rem;
  line-height: 1.8;
}
.hero-bio strong { color: var(--text); font-weight: 500; }

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .75rem 1.75rem;
  border-radius: 2px;
  transition: opacity .2s var(--ease);
}
.btn-primary:hover { opacity: .75; color: var(--bg); }

.btn-ghost {
  display: inline-block;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .75rem 1.75rem;
  border-radius: 2px;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

.social-list {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}
.social-list a {
  color: var(--muted);
  display: flex;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.social-list a:hover { color: var(--text); transform: translateY(-2px); }
.social-list svg { width: 20px; height: 20px; }

.hero-right { display: flex; flex-direction: column; align-items: center; }

.photo-frame {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ── Entry List (Education / Experience) ─────────────────────── */
.entry-list { display: flex; flex-direction: column; }

.entry {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.entry:last-child { border-bottom: 1px solid var(--border); }

.entry-year {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .4px;
  padding-top: .15rem;
}

.entry-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .2rem;
}

.entry-place {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .5rem;
}

.entry-desc {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.7;
}

.entry-bullets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.entry-bullets li {
  font-size: .92rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
}
.entry-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--subtle);
  font-size: .8rem;
}

/* ── Publications ────────────────────────────────────────────── */
.section-note {
  font-size: .88rem;
  color: var(--muted);
  margin-top: -.5rem;
  margin-bottom: 2.5rem;
}
.section-note a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.section-note a:hover { opacity: .7; }

.pub-list { display: flex; flex-direction: column; }

.pub-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.pub-entry:last-child { border-bottom: 1px solid var(--border); }

.pub-venue {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .25rem;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .3rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .4rem;
}
.pub-authors strong { color: var(--text); font-weight: 500; }

.pub-desc {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .75rem;
  line-height: 1.6;
}

.pub-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.pub-links a {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .3px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.pub-links a:hover { color: var(--text); }

/* ── Projects ────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 0;
}

.project-card {
  display: block;
  background: var(--bg-alt);
  transition: background .2s var(--ease);
  text-decoration: none;
  color: var(--text);
}
.project-card:hover { background: var(--bg); color: var(--text); }

.project-card-inner {
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-top h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-arrow {
  font-size: 1.1rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s var(--ease), color .2s var(--ease);
  margin-top: -.1rem;
}
.project-card:hover .project-arrow {
  transform: translate(3px, -3px);
  color: var(--text);
}

.project-card p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: auto;
  padding-top: .5rem;
}
.tag-row span {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: .15rem .5rem;
  border-radius: 2px;
}

/* ── Skills ──────────────────────────────────────────────────── */
.skills-table { display: flex; flex-direction: column; }

.skill-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.skill-row:last-child { border-bottom: 1px solid var(--border); }

.skill-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .15rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.skill-tags span {
  font-size: .88rem;
  color: var(--text);
  border: 1px solid var(--border);
  padding: .25rem .7rem;
  border-radius: 2px;
  transition: border-color .2s var(--ease);
}
.skill-tags span:hover { border-color: var(--text); }

/* ── Contact ─────────────────────────────────────────────────── */
.contact-inner { max-width: 580px; }
.contact-lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.8;
}
.contact-lead a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contact-lead a:hover { opacity: .65; }

.contact-email {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-style: italic;
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  margin-bottom: 2rem;
  transition: opacity .2s var(--ease);
}
.contact-email:hover { opacity: .6; color: var(--text); }

.contact-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.contact-links a {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.contact-links a:hover { color: var(--text); }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: var(--muted);
}

.to-top {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.to-top:hover { color: var(--text); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-right { align-items: flex-start; flex-direction: row; gap: 2rem; }
  .photo-frame { width: 180px; height: 180px; border-radius: 50%; }
  .social-list { margin-top: 0; flex-direction: column; }

  .projects-grid { grid-template-columns: 1fr; }

  .entry, .pub-entry, .skill-row {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  .entry-year, .pub-venue, .skill-label { padding-top: 0; }
}

@media (max-width: 640px) {
  .section { padding: 70px 0; }
  .hero { padding: 80px 0 70px; }
  .container { padding: 0 1.25rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem .5rem; }

  .hamburger { display: flex; }

  .hero-right { flex-direction: column; align-items: center; }
  .photo-frame { width: 160px; height: 160px; border-radius: 50%; }
  .social-list { flex-direction: row; }
}
