:root {
  --bg: #F4F3EF;
  --ink: #121417;
  --body: #3A3F45;
  --muted: #5A5F66;
  --rule: #D6D4CE;
  --underline: #B9B6AE;
  --card: #FFFFFF;
  --accent: #2340FF;
  --ok: #0B7A4B;
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration-color: var(--underline);
  text-underline-offset: 4px;
  transition: text-decoration-color .15s ease;
}
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, p { margin: 0; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 40px 80px;
}

.accent { color: var(--accent); }
.muted { color: var(--muted); }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 32px;
}
.brand { font-size: 20px; font-weight: 600; padding: 12px 0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 16px; }
.nav a { padding: 12px 0; text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* Hero */
.hero {
  margin: 72px 0 128px;
  padding-bottom: 72px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.id { display: flex; align-items: center; gap: 20px; }
.id img {
  width: 88px; height: 88px;
  border-radius: 18px;
  display: block;
  object-fit: cover;
}
.id p { font-size: 18px; line-height: 1.4; }
.hero h1 {
  font-size: clamp(56px, 9vw, 136px);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: -0.045em;
}
.lede { font-size: 20px; line-height: 1.55; color: var(--body); max-width: 560px; }

/* Section headings */
h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.spaced { margin-top: 128px; }

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.timeline li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 40px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.timeline li.last { border-bottom: 2px solid var(--ink); }
.org {
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.desc { font-size: 18px; line-height: 1.5; color: var(--body); max-width: 440px; }

/* Publications */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}
.meta { font-size: 16px; color: var(--body); margin-bottom: 24px; }
.pubs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 48px;
  border-top: 2px solid var(--ink);
}
.pubs a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.pubs .title { font-size: 22px; font-weight: 600; line-height: 1.3; }
.pubs a:hover .title { text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 4px; }
.pubs .muted { font-size: 15px; }

/* Visa */
.visa {
  background: var(--ink);
  color: var(--bg);
  border-radius: 16px;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.visa h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
}
.visa p { font-size: 19px; line-height: 1.55; color: #C3C7CC; max-width: 640px; }

/* Projects */
.project {
  background: var(--card);
  border-radius: 16px;
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 56px;
}
.project + .project { margin-top: 16px; }
.project-copy {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project h3 {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-decoration-color: var(--underline); }
.project p { font-size: 18px; line-height: 1.55; color: var(--body); }
.term {
  flex: 1 1 320px;
  min-width: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.8;
  background: var(--bg);
  border-radius: 10px;
  padding: 18px 20px;
  color: var(--body);
  white-space: pre;
  overflow-x: auto;
}
.ok { color: var(--ok); }

/* Footer */
.site-footer {
  margin-top: 128px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 28px;
  font-size: 15px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .wrap { padding: 16px 16px 56px; }
  .hero { margin: 48px 0 80px; padding-bottom: 48px; gap: 32px; }
  .spaced, .site-footer { margin-top: 88px; }
  .lede { font-size: 18px; }
  .project h3 { font-size: 36px; }
  .pubs { grid-template-columns: 1fr; }
}
