@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Source+Sans+3:wght@400;600&display=swap');

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

:root {
  --red: #bf0040;
  --blue-fill: #f4fbfb;
  --blue-border: #1d7aa2;
  --brown: #9e3c0f;
  --orange: #b66d4a;
  --green-fill: #f2f9f5;
  --green-border: #15a05a;
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #fff;
  --border: #ddd;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --nav: #7a3520;
}

a { color: var(--blue-border); }

body { font-family: var(--serif); color: var(--text); background: var(--bg); line-height: 1.7; }

.site-wrap { max-width: 860px; margin: 0 auto; padding: 0 1.5rem 4rem; }

/* ── TOP BAR ── */
.topbar {
  border-bottom: 2px solid var(--red);
  padding: 1rem 0 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.topbar-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
.topbar-course {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.topbar-nav { display: flex; gap: 1.2rem; align-items: center; margin-top: -0.3rem;}
.topbar-nav a {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 420;
}
.topbar-nav a:hover { color: var(--red); text-decoration: underline; }

/* ── SECTION HEADINGS ── */
.section-head {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.section-head .sec-num {
  color: var(--red);
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--serif);
}
.section-divider {
  border: none;
  border-top: 1.5px solid var(--red);
  margin: 0 0 1.2rem;
  opacity: 0.25;
}

/* ── INTRO BLOCK ── */
.intro-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.8rem;
  align-items: start;
  margin-bottom: 2rem;
}
.avatar-box {
  width: 110px; height: 110px;
  border-radius: 4px;
  background: var(--blue-fill);
  border: 1.5px solid var(--blue-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--blue-border);
  font-weight: 600;
  flex-shrink: 0;
}
.intro-text h1 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.intro-text .position {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--brown);
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.intro-text .affil {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}
.intro-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: justify;
}
.link-row {
  display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.7rem;
}
.pill-link {
  font-family: var(--mono);
  font-size: 0.73rem;
  padding: 3px 10px;
  border: 1px solid var(--blue-border);
  border-radius: 2px;
  color: var(--blue-border);
  text-decoration: none;
  background: var(--blue-fill);
}
.pill-link:hover { background: var(--blue-border); color: #fff; }
.pill-link.green {
  border-color: var(--green-border);
  color: var(--green-border);
  background: var(--green-fill);
}
.pill-link.green:hover { background: var(--green-border); color: #fff; }

/* ── BLUE THEOREM/EXAMPLE BOXES ── */
.box {
  border: 1.5px solid var(--blue-border);
  border-radius: 2px;
  background: var(--blue-fill);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  position: relative;
}
.box-title {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue-border);
  margin-bottom: 0.4rem;
}
.box-title .box-label {
  font-style: italic;
  font-weight: 400;
  color: var(--blue-border);
}
.box p { font-size: 0.92rem; line-height: 1.65; color: var(--text); }
.box p + p { margin-top: 0.5rem; }

/* ── GREEN REMARK BOXES ── */
.box-green {
  border: 1.5px solid var(--green-border);
  border-radius: 2px;
  background: var(--green-fill);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.box-green .box-title { color: var(--green-border); }
.box-green .box-label { color: var(--green-border); }
.box-green p { font-size: 0.92rem; color: var(--text); }

/* ── BROWN LEFT-RULE REMARK ── */
.remark {
  border-left: 3px solid var(--orange);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1rem 0 1.2rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
}
.remark strong { color: var(--brown); font-style: normal; font-weight: 600; }

/* ── PUBLICATION / PAPER LIST ── */
.pub-list { list-style: none; padding: 0; }
.pub-item {
  border-left: 3px solid var(--border);
  padding: 0.4rem 0 0.4rem 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}
.pub-item:hover { border-left-color: var(--red); }
.pub-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
}
.pub-title:hover { color: var(--red); }
.pub-meta {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.pub-meta em { color: var(--brown); font-style: italic; }
.pub-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 1px 7px;
  border-radius: 2px;
  color: #666;
}

/* ── CV TABLE ── */
.cv-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.cv-table td {
  padding: 0.45rem 0;
  border-bottom: 0.5px solid #eee;
  vertical-align: top;
  font-size: 0.9rem;
}
.cv-table td:first-child {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  width: 5.5rem;
  padding-right: 1rem;
}
.cv-table td .place {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}
.cv-table .deg {
  font-weight: 600;
  font-family: var(--serif);
  color: var(--text);
}

/* ── NEWS ── */
.news-item {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 0.5px solid #eee;
  font-size: 0.88rem;
  align-items: baseline;
}
.news-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 5.5rem;
  flex-shrink: 0;
}

/* ── COURSE CARDS ── */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.course-card {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
  display: block;
}
.course-card:hover { border-color: var(--blue-border); background: var(--blue-fill); }
.course-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.course-name {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.course-role {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── FOOTER ── */
.site-footer {
  margin-top: 3rem;
  border-top: 1.5px solid var(--red);
  padding-top: 0.6rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.site-footer span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .intro-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; gap: 0.4rem; }
}