/* 01 — Classic: minimal academic homepage */

:root {
  --text: #222;
  --muted: #666;
  --link: #1772d0;
  --link-hover: #f09228;
  --rule: #e6e6e6;
  --box-bg: #fafafa;
  --placeholder: #eeeeee;
  --todo-bg: #fff4c2;
  --todo-text: #7a5a00;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); }

strong, b { font-weight: 700; }

img { max-width: 100%; display: block; }

.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 24px;
}

/* ---------- TODO markers ---------- */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.92em;
  white-space: nowrap;
}
.todo-wrap { white-space: normal; }

/* ---------- Header ---------- */
.intro {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 32px;
  align-items: center;
  padding-bottom: 8px;
}

.name {
  font-size: 34px;
  font-weight: 400;
  margin: 0 0 4px;
  letter-spacing: 0.2px;
}

.title-line {
  margin: 0 0 14px;
  color: var(--muted);
}

.intro p { margin: 0 0 12px; }

.links {
  text-align: center;
  margin-top: 16px;
}
.links a, .links span.todo { white-space: nowrap; }
.links .sep { color: #bbb; margin: 0 6px; }
.links i { margin-right: 4px; }

.interests { color: var(--muted); font-size: 14px; }

.photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
}

/* ---------- Sections ---------- */
section { margin-top: 36px; }

h2 {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.section-intro { margin: -6px 0 14px; color: var(--muted); }

/* ---------- Boxes: shared by experience timeline + education ---------- */
.box {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--box-bg);
  padding: 12px 14px 14px;
  font-size: 13.5px;
  line-height: 1.45;
}
.box .date {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.now-pill {
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--link);
  border: 1px solid #b9d4f1;
  background: #eef5fd;
}
.box h3 {
  margin: 6px 0 2px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}
.box p { margin: 0; }
.box .org { color: var(--text); }
.box .loc,
.box .note { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.box .loc i { width: 12px; margin-right: 4px; color: #aaa; }

/* ---------- Education: plain row of boxes ---------- */
.box-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.box-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Experience: horizontal timeline ---------- */
.timeline {
  --gap: 14px;
  --dot: 12px;
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  column-gap: var(--gap);
}
/* connecting line: runs from the centre of the first dot to the centre of the last */
.timeline::before {
  content: "";
  position: absolute;
  top: calc(4px + var(--dot) / 2 - 1px);
  height: 2px;
  background: linear-gradient(90deg, var(--link), #b9d4f1);
  left: calc((100% - (var(--n, 4) - 1) * var(--gap)) / var(--n, 4) / 2);
  right: calc((100% - (var(--n, 4) - 1) * var(--gap)) / var(--n, 4) / 2);
}
.tl-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tl-dot {
  position: relative;
  z-index: 1;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--link);
}
.tl-item.current .tl-dot {
  background: var(--link);
  box-shadow: 0 0 0 4px #e3eefb;
}
.tl-item .box {
  position: relative;
  width: 100%;
  flex: 1;
  margin-top: 14px;
}
/* small caret pointing up toward the dot */
.tl-item .box::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--box-bg);
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  transform: translateX(-50%) rotate(45deg);
}
.tl-item.current .box { border-top: 2px solid var(--link); }
.tl-item.current .box::before { top: -7px; background: var(--link); border-color: var(--link); }

/* ---------- Publications / patents ---------- */
.pubs { width: 100%; }

.pub {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 14px 0;
  align-items: start;
}
.pub + .pub { border-top: 1px solid #f2f2f2; }

.teaser {
  width: 160px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--placeholder);
}
.teaser img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* first page of the paper: show the top (title + teaser figure) like a sheet of paper */
.teaser.paper-thumb {
  display: block;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.teaser.paper-thumb img { object-position: top; }
.teaser.paper-thumb:hover,
.teaser.paper-thumb:focus-visible {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}
.teaser.placeholder {
  display: grid;
  place-items: center;
  color: #999;
  font-size: 13px;
  text-align: center;
  padding: 8px;
  border: 1px dashed #d6d6d6;
}

.pub-title {
  font-weight: 700;
  font-size: 15.5px;
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}
a.pub-title { color: var(--link); }
a.pub-title:hover { color: var(--link-hover); }

.pub .authors,
.pub .venue,
.pub .pub-links,
.pub .summary { display: block; }
.pub .venue { font-style: italic; }
.pub .pub-links { margin: 2px 0 4px; }
.pub .summary { color: #444; }

/* ---------- Compact lists ---------- */
.compact {
  list-style: none;
  margin: 0;
  padding: 0;
}
.compact li {
  padding: 6px 0 6px 16px;
  position: relative;
}
.compact li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bbb;
}
.compact .meta { color: var(--muted); }

/* ---------- Footer ---------- */
footer {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .photo { order: -1; justify-self: center; }
  .photo img { width: 160px; height: 160px; }
  .name { text-align: center; }
  .title-line { text-align: center; }

  .box-row.cols-3 { grid-template-columns: 1fr; }

  /* timeline turns vertical: line on the left, dots beside each box */
  .timeline {
    grid-template-columns: 1fr;
    row-gap: 12px;
    padding: 0 0 0 24px;
  }
  .timeline::before {
    top: 8px;
    bottom: 8px;
    left: 5px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--link), #b9d4f1);
  }
  .tl-item { align-items: stretch; }
  .tl-dot { position: absolute; left: -24px; top: 16px; }
  .tl-item .box { margin-top: 0; }
  .tl-item .box::before { top: 17px; left: -6px; transform: rotate(-45deg); }
  .tl-item.current .box { border-top: 1px solid var(--rule); border-left: 2px solid var(--link); }
  .tl-item.current .box::before { top: 17px; left: -7px; }
}

@media (max-width: 520px) {
  .page { padding: 24px 16px 20px; }
  .name { font-size: 28px; }

  .pub {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .teaser { width: 100%; max-width: 320px; }
}

@media (max-width: 380px) {
  .box { padding: 10px 12px 12px; }
}
