:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1d232a;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #3157d5;
  --accent-soft: #eef2ff;
  --max: 1120px;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(16, 24, 40, .08);
}

[data-theme="dark"] {
  --bg: #101317;
  --surface: #171b21;
  --text: #f3f4f6;
  --muted: #aab2bf;
  --line: #2a313a;
  --accent: #8ea7ff;
  --accent-soft: #202947;
  --shadow: 0 12px 35px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-size: .92em; }

.container { width: min(calc(100% - 36px), var(--max)); margin-inline: auto; }
.section { padding: 50px 0; scroll-margin-top: 72px; }
.alt { background: var(--surface); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 5.6rem); line-height: .98; letter-spacing: -.05em; margin-bottom: 22px; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; margin-bottom: 28px; }
h3 { letter-spacing: -.02em; }
.lead { font-size: clamp(1.15rem, 2vw, 1.45rem); max-width: 760px; color: var(--muted); }
.eyebrow { letter-spacing: .1em; font-size: 1rem; font-weight: 800; color: var(--accent); }
.muted { color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { height: 68px; display: flex; align-items: center; gap: 22px; }
.brand { color: var(--text); font-weight: 800; margin-right: auto; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); font-size: .94rem; font-weight: 650; }
.theme-toggle, .nav-toggle {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
}
.nav-toggle { display: none; }

.hero { min-height: 40vh; display: grid; place-items: center; }
.hero-grid { display: grid; grid-template-columns: 0.5fr 1fr 1fr 0.5fr; gap: 0px; align-items: center; }
.portrait-wrap { display: flex; justify-content: center; }
.portrait {
  width: min(200px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px;
  font-weight: 700; color: var(--text); background: var(--bg);
}
.btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.two-col { display: grid; grid-template-columns: 1.4fr .6fr; gap: 60px; }
.card, .contact-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 28px; box-shadow: var(--shadow);
}
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; list-style: none; }
.tag-list li {
  padding: 7px 11px; background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-size: .86rem; font-weight: 700;
}

.stack { display: grid; gap: 16px; }
.item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
}
.item:last-child { border-bottom: 0; }
.item-date { color: var(--muted); font-weight: 700; font-size: .92rem; }
.item-title { font-size: 1.08rem; font-weight: 800; margin-bottom: 4px; }

.timeline { border-left: 2px solid var(--line); margin-left: 8px; }
.timeline-item { position: relative; padding: 0 0 24px 26px; }
.timeline-item::before {
  content: ""; position: absolute; left: -7px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
}
.timeline-item time { display: block; font-weight: 750; color: var(--muted); font-size: .9rem; }

.section-heading.split { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 7px 12px; font-weight: 700;
}
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.publication-list { display: grid; gap: 20px; }
.publication {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.pub-title { font-weight: 850; font-size: 1.08rem; margin-bottom: 6px; }
.pub-meta { color: var(--muted); margin-bottom: 10px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: .92rem; font-weight: 750; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--bg);
}
.project-card p { color: var(--muted); }

.contact-card { display: flex; justify-content: space-between; gap: 32px; align-items: center; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-wrap { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 820px) {
  .section { padding: 66px 0; }
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .portrait-wrap { justify-content: flex-start; }
  .portrait { width: 220px; }
  .card-grid { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; gap: 3px; }
  .section-heading.split, .contact-card, .footer-wrap { align-items: flex-start; flex-direction: column; }
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none; position: absolute; left: 18px; right: 18px; top: 60px;
    flex-direction: column; background: var(--bg); padding: 18px; border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
}
