/* ── Fonts ─────────────────────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;1,500;1,600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap");

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: #fafaf8;
  padding: 0;
  font: 16px/1.5 "Crimson Pro", serif;
  color: #595959;
  font-weight: 400;
  margin: 0;
}

a { color: #2774AE; text-decoration: none; transition: color 0.2s; }
a:hover { color: #FFD100; }

h1, h2, h3, h4, h5, h6 { color: #1a3a5c; margin: 0 0 20px; }
h1 { font-weight: 500; font-size: 28px; }
h2 { font-weight: 500; font-size: 157%; margin: 2px 0 15px; }
h3, h4, h5, h6 { font-weight: 600; }
h1, h2, h3 { line-height: 1.2; }

p, ul, ol, table, pre, dl { margin: 0 0 18px; }
strong { color: #1a1a1a; font-weight: 600; }
small { font-size: 11px; }
img { max-width: 100%; }

email {
  font-size: 14px;
  font-family: "Ubuntu Mono", monospace;
}

autocolor { color: #2774AE; }

/* ── Top Navigation ───────────────────────────────────────────────────────── */
.topnav {
  background: linear-gradient(135deg, #1a3a5c 0%, #2774AE 100%);
  overflow: hidden;
  position: fixed;
  z-index: 999;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.topnav #myLinks { display: inline; }
.topnav a.icon { display: none; }

.topnav img {
  margin-bottom: -16.5pt;
  margin-top: -12.5pt;
  margin-left: 30%;
}

.topnav a.normal {
  float: right;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 15px;
  font-family: "Crimson Pro", serif;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.25s;
}

.topnav a.normal:hover {
  background-color: rgba(255, 209, 0, 0.15);
  color: #FFD100;
}

.topnav a.right { margin-right: 30%; }

/* ── Wrapper / Layout ─────────────────────────────────────────────────────── */
.wrapper {
  width: 980px;
  margin: 0 auto;
}

/* ── Sidebar Header ───────────────────────────────────────────────────────── */
header {
  width: 260px;
  float: left;
  position: fixed;
  -webkit-font-smoothing: subpixel-antialiased;
  padding-top: 5.5em;
  text-align: center;
}

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.image.avatar { border-radius: 100%; margin: 0 0 1.2em 0; width: 15em; display: inline-block; }

.image.avatar img {
  border-radius: 20%;
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
  box-shadow: 0 -1px 5px 1px rgba(200, 200, 200, 0.3);
}

/* ── Social Icons ─────────────────────────────────────────────────────────── */
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.4rem;
  width: 2.4rem;
  background-color: #f0ede6;
  color: #1a3a5c !important;
  border-radius: 50%;
  font-size: 1.1rem;
  margin-right: 0.6rem;
  transition: all 0.25s;
}
.social-icons a:last-child { margin-right: 0; }
.social-icons a:hover {
  background-color: #2774AE;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 116, 174, 0.3);
}

/* ── Position / Affiliation ───────────────────────────────────────────────── */
position {
  font-size: 1.05rem;
  font-family: "Crimson Pro", serif;
  color: #5a5a5a;
  font-weight: 500;
}

/* ── Content Section ──────────────────────────────────────────────────────── */
section {
  width: 650px;
  float: right;
  padding-top: 1.2em;
  padding-bottom: 50px;
}

/* ── Section headings with gold accent ────────────────────────────────────── */
section h2 {
  padding-bottom: 10px;
  border-bottom: 3px solid #FFD100;
  display: inline-block;
}

section ul { list-style: disc; margin-left: 24px; padding-left: 0; }

section ul li {
  margin-bottom: 10px;
}

/* ── Paper cards ──────────────────────────────────────────────────────────── */
.paper-card {
  background: #fff;
  border: 1px solid #e8e5dd;
  border-left: 4px solid #2774AE;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.25s, transform 0.25s;
  list-style: none;
}

.paper-card::before { display: none; }

.paper-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.paper-title {
  font-family: "Crimson Pro", serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: #1a3a5c;
}

.paper-title a { color: #1a3a5c; }
.paper-title a:hover { color: #2774AE; }

.paper-authors {
  color: #666;
  font-size: 0.93rem;
  margin-top: 4px;
}

.paper-detail {
  color: #777;
  font-size: 0.88rem;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── News items ───────────────────────────────────────────────────────────── */
.news-item {
  padding-left: 16px;
  position: relative;
  margin-bottom: 10px;
}

.news-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: #FFD100;
  border-radius: 50%;
}

.news-date {
  font-family: "Crimson Pro", serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #2774AE;
}

/* ── Teaching cards ───────────────────────────────────────────────────────── */
.teach-card {
  background: #fff;
  border: 1px solid #e8e5dd;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
  list-style: none;
  transition: box-shadow 0.25s;
}

.teach-card::before { display: none; }

.teach-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.teach-rating {
  display: inline-block;
  background: linear-gradient(135deg, #FFD100, #f5c518);
  color: #1a3a5c;
  font-family: "Crimson Pro", serif;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 6px;
}

/* ── Contact section ──────────────────────────────────────────────────────── */
.contact-box {
  background: #fff;
  border: 1px solid #e8e5dd;
  border-radius: 8px;
  padding: 24px 28px;
  display: block;
  max-width: 100%;
  word-wrap: break-word;
}

/* ── Back to Top ──────────────────────────────────────────────────────────── */
#back-to-top {
  border: 1px solid #d0cdc5;
  border-radius: 4px;
  font-size: 13px;
  font-family: "Crimson Pro", serif;
  width: 100px;
  text-align: center;
  line-height: 30px;
  height: 30px;
  transition: all 0.25s;
}

#back-to-top:hover {
  border-color: #2774AE;
  color: #2774AE !important;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  width: 260px;
  float: left;
  position: fixed;
  bottom: 30px;
  -webkit-font-smoothing: subpixel-antialiased;
  text-align: center;
}

footer p { font: 12px/1.2 "Crimson Pro", serif; color: #999; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media print, screen and (max-width: 980px) {
  div.wrapper { width: auto; margin: 0; padding: 0 20px; }
  header, section, footer { float: none; position: static; width: auto; }
  header { padding-top: 80px; }
  section { border-top: 1px solid #e8e5dd; padding: 20px 0; margin: 0 0 20px; }
  .image.avatar img { border-radius: 50%; width: 140px; }

  /* collapse the desktop-only top gap so content starts cleanly on phones */
  section h1#about-me { margin: 0; }
  section > p:first-of-type { margin-top: 24px !important; }

  .topnav img { margin-left: 3%; }
  .topnav a.right { margin-right: 3%; }
  .topnav a.normal { padding: 10px 5px; }
}

@media print, screen and (max-width: 960px) {
  body { word-wrap: break-word; padding: 0; }

  /* Flex-centered bar: logo and hamburger vertically centered and never
     clipped; menu is an absolute dropdown below the bar. Replaces the
     desktop negative-margin logo trick, which clipped on mobile. */
  .topnav {
    display: flex;
    align-items: center;
    min-height: 52px;
    overflow: visible;
    padding: 8px 16px;
  }
  .topnav img {
    height: 30px;
    width: auto;
    margin: 0 !important;
  }

  .topnav a.icon {
    color: white;
    display: flex;
    align-items: center;
    position: absolute;
    right: 16px;
    top: 0;
    height: 100%;
    margin: 0;
    padding: 0 6px;
    font-size: 22px;
  }

  .topnav #myLinks {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1a3a5c;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  }

  .topnav a.normal,
  .topnav a.right {
    color: white;
    float: none;
    padding: 15px 20px;
    font-size: 16px;
    display: block;
    text-transform: none;
    margin-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .topnav a.normal:active,
  .topnav a.right:active {
    background-color: rgba(255, 209, 0, 0.15);
  }
}

@media print, screen and (max-width: 480px) {
  .topnav #myLinks { display: none; }
  .image.avatar img { border-radius: 50%; width: 180px; padding: 3px; }
}

@media print, screen and (max-width: 1200px) and (min-width: 1001px) {
  .topnav img { margin-left: 6%; }
  .topnav a.right { margin-right: 6%; }
}

@media print, screen and (max-width: 1400px) and (min-width: 1201px) {
  .topnav img { margin-left: 12%; }
  .topnav a.right { margin-right: 12%; }
}

@media print, screen and (max-width: 1600px) and (min-width: 1401px) {
  .topnav img { margin-left: 16%; }
  .topnav a.right { margin-right: 16%; }
}

@media print, screen and (max-width: 1800px) and (min-width: 1601px) {
  .topnav img { margin-left: 19%; }
  .topnav a.right { margin-right: 19%; }
}

@media print, screen and (max-width: 2000px) and (min-width: 1801px) {
  .topnav img { margin-left: 22%; }
  .topnav a.right { margin-right: 22%; }
}
