:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --accent: #009de0;
  --muted: #46555f;
  --muted-2: #6b8088;
  --glass: rgba(70, 85, 95, 0.06);
  --radius: 12px;
  --max-width: 980px;
  --gap: 20px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
    "Helvetica Neue", monospace;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  background: linear-gradient(180deg, var(--bg), #ffffff 60%);
  color: var(--muted);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--gap);
  align-items: start;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 6px 18px rgba(70, 85, 95, 0.08);
  position: sticky;
  top: 28px;
  height: fit-content;
}

/* Avatar: image + initials fallback */
.avatar {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, var(--muted) 10%, var(--accent));
  color: white;
  font-weight: 700;
  font-size: 36px;
}

/* real image: cover and be responsive */
.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* important to crop nicely */
}

/* initials fallback centered on top of background */
.avatar .initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  /* default visible — JS will hide on successful image load */
}

/* Meta */
.name {
  margin: 14px 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}
.affil {
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 12px;
}

/* Icon buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--glass);
  text-decoration: none;
  color: var(--muted-2); /* icons inherit this via currentColor */
  transition: background 0.18s ease, color 0.18s ease, transform 0.06s ease;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: currentColor; /* some icons use fill for small circles */
}

/* hover/focus visuals */
.icon-btn:hover,
.icon-btn:focus {
  background: rgba(0, 157, 224, 0.12);
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}
.icon-btn:active {
  transform: translateY(0);
}

/* Top nav inside main content */
.main {
  min-height: 320px;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.breadcrumbs {
  display: flex;
  gap: 12px;
  align-items: center;
}
.navlink {
  text-decoration: none;
  color: var(--muted-2);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
}
.navlink:hover {
  background: var(--glass);
  color: var(--muted);
}

/* Section cards */
section.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(70, 85, 95, 0.05);
}
.card h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 18px;
}
.lead {
  color: var(--muted-2);
  margin-bottom: 12px;
}

/* Teaching & publications list */
.list {
  display: grid;
  gap: 10px;
}
.course {
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.01), transparent);
}
.course h3 {
  margin: 0;
  font-size: 15px;
}
.course p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted-2);
}

.pub {
  padding: 12px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: rgba(0, 157, 224, 0.03);
}
.pub .meta {
  font-size: 13px;
  color: var(--muted-2);
}
.pub .title {
  font-weight: 600;
  margin-top: 6px;
  color: var(--muted);
}

footer {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted-2);
}

/* Responsive */
@media (max-width: 880px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
  }
}

/* Utility */
a.inline {
  color: var(--accent);
  text-decoration: none;
}
a.inline:hover {
  text-decoration: underline;
}
