/* ==========================================================================
   Premium academic refinement layer (light theme only)
   Loaded after main.css (see _includes/head/custom.html) so it overrides the
   compiled Minimal-Mistakes styles. Pure CSS — no SCSS compilation needed.
   ========================================================================== */

:root {
  --accent:        #2f5fe0;
  --accent-strong: #1e46c0;
  --accent-soft:   #eef3fe;
  --accent-line:   linear-gradient(135deg, #2f5fe0 0%, #6f8bf2 100%);

  --bg:        #f5f7fb;   /* soft page tint so white cards pop */
  --card:      #ffffff;
  --ink:       #1b2430;   /* headings */
  --text:      #38414c;   /* body */
  --muted:     #6b7480;
  --border:    #e7ebf2;
  --border-2:  #eef1f6;

  --shadow-sm: 0 1px 2px rgba(20, 32, 56, 0.05), 0 1px 3px rgba(20, 32, 56, 0.04);
  --shadow-md: 0 8px 20px rgba(20, 32, 56, 0.07), 0 2px 6px rgba(20, 32, 56, 0.05);
  --shadow-lg: 0 20px 44px rgba(20, 32, 56, 0.12), 0 8px 16px rgba(20, 32, 56, 0.07);

  --radius:    16px;
  --radius-sm: 11px;
  --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----- Base ------------------------------------------------------------ */
html { background-color: var(--bg); scroll-behavior: smooth; }

body {
  font-family: "Inter", "Trebuchet MS", Helvetica, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: 0.1px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", "Trebuchet MS", Helvetica, sans-serif;
  color: var(--ink);
  letter-spacing: -0.012em;
}

.page__content { color: var(--text); }
.page__content p,
.page__content li,
.page__content dl { color: var(--text); line-height: 1.74; }

/* Intro paragraph reads as a lead */
.page__content > p:first-of-type {
  font-size: 1.06em;
  line-height: 1.8;
  color: #313a45;
}

::selection { background: var(--accent-soft); color: var(--accent-strong); }

/* ----- Section headers (markdown "# Title") ---------------------------- */
.page__content h1 {
  position: relative;
  margin-top: 1.9em;
  margin-bottom: 0.7em;
  padding: 0 0 0.4em 0.7em;
  font-size: 1.5em;
  font-weight: 750;
  border-bottom: 1px solid var(--border);
}
.page__content h1::before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.46em;
  height: auto;       /* override the theme's h1:before anchor-offset hack */
  margin: 0;          /* (it sets height:2em; margin-top:-2em) */
  width: 5px;
  border-radius: 4px;
  background: var(--accent-line);
}
.page__content h1 a { color: var(--accent); text-decoration: none; font-weight: 600; }
.page__content h1, .anchor { scroll-margin-top: 5em; }

/* ----- Links ----------------------------------------------------------- */
.page__content a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease), color 0.2s var(--ease);
}
.page__content a:hover {
  color: var(--accent-strong);
  background-size: 100% 1.5px;
  text-decoration: none;
}

/* ----- Sticky frosted navbar ------------------------------------------ */
.masthead {
  background-color: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.greedy-nav,
.greedy-nav .visible-links { background: transparent; }
.greedy-nav a,
.masthead__menu-item a { color: var(--muted); font-weight: 600; }
.greedy-nav a:hover,
.masthead__menu-item a:hover { color: var(--accent); }
.masthead__menu-home-item a { color: var(--ink); }
.greedy-nav .visible-links a::before { background: var(--accent); height: 2px; }

/* ----- Sidebar author card -------------------------------------------- */
.sidebar.sticky { overflow: visible; }
@media (min-width: 925px) {
  .author__profile,
  .sidebar > .author__profile { /* fallback */ }
  .sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6em 1.3em;
    box-shadow: var(--shadow-md);
    text-align: center;
  }
  .profile_box { display: block; }
  .author__avatar { margin: 0 auto 0.4em; }
  .author__urls-wrapper { display: block; }
}

/* Mobile: same centered profile card (avatar + name + bio + tidy icon list)
   instead of the theme's cramped table-cell row with edge-stacked icons */
@media (max-width: 924px) {
  .sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4em 1.2em;
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 1.6em;
  }
  .profile_box { display: block; }
  .author__avatar { display: block; width: auto; margin: 0 auto 0.3em; }
  .author__avatar img { max-width: 132px; min-width: 110px; }
  .author__content { display: block; width: 100%; padding: 0; text-align: center; line-height: 1.4; }
  .author__urls-wrapper { display: block; width: 100%; }
  .author__urls {
    display: inline-block !important;
    position: relative !important;
    right: auto;
    margin: 0.6em auto 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left;
  }
  .author__urls::before, .author__urls::after { display: none !important; }
  .author__urls_sm { display: none !important; }
}

.author__avatar img {
  border-radius: 50%;
  border: none !important;
  padding: 0 !important;
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--border), var(--shadow-md);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.author__avatar img:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--accent), var(--shadow-lg);
}
.author__name { color: var(--ink); font-weight: 770; letter-spacing: -0.015em; }
.author__bio  {
  margin: 0.4em auto 0.2em;
  font-size: 0.9em;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* Social / contact links — clean rows with icon chips (desktop list).
   Reset the theme's z-index:-1 (used for its mobile dropdown) so the links
   sit above the sidebar card and stay clickable. */
.author__urls-wrapper { position: relative; z-index: 2; }
.author__urls {
  position: relative;
  z-index: 2;
  text-align: left;
  display: inline-block;
  margin: 0.5em auto 0;
}
.author__urls li { white-space: nowrap; }
.author__urls li > div { color: var(--muted); }

/* the location row (icon + text, no link) — match the link rows' padding so
   its icon lines up exactly with the social icons below it */
.author__urls > li {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: var(--muted);
  font-size: 0.9em;
}
.author__urls > li:has(> .fa-map-marker) {
  padding: 0.28em 0.55em 0.28em 0.28em;
  margin-bottom: 3px;
}

.author__urls a {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 3px;
  padding: 0.28em 0.55em 0.28em 0.28em;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.author__urls a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
  transform: translateX(2px);
}

/* icon chips — soft square that fills with accent on hover */
.author__urls a .fa, .author__urls a .fab,
.author__urls a .fas, .author__urls a .ai,
.author__urls > li > .fa, .author__urls > li > .fas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85em;
  height: 1.85em;
  flex: 0 0 auto;
  font-size: 0.92em;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.author__urls a:hover .fa, .author__urls a:hover .fab,
.author__urls a:hover .fas, .author__urls a:hover .ai {
  background: var(--accent);
  color: #fff;
  transform: scale(1.06);
}
.author__urls > li > .fa-map-marker { background: #eef1f6; color: var(--muted); }

/* Mobile icon row */
.author__urls_sm { text-align: center; }
.author__urls_sm a { color: var(--muted); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.author__urls_sm a:hover { color: var(--accent); transform: translateY(-2px); }

/* ----- Visitor map (ClustrMaps) in the sidebar ------------------------ */
.visitor-map {
  margin-top: 1em;
  padding-top: 0.9em;
  border-top: 1px solid var(--border);
  text-align: center;
}
.visitor-map .vm-label {
  margin-bottom: 0.5em;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.visitor-map .vm-label .fa-globe-asia { color: var(--accent); margin-right: 0.3em; }
.visitor-map > #clustrmaps,
.visitor-map .map-container {
  max-width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
}

/* ----- Publication / project cards ------------------------------------ */
.paper-box {
  position: relative;
  border-bottom: none;
  margin: 1.4em 0;
  padding: 1.6em 1.7em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              border-color 0.35s var(--ease);
}
/* left accent strip — inset so it respects the rounded corners (no overflow:hidden,
   which would clip the venue badge) */
.paper-box::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.paper-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cdd9f6;
}
.paper-box:hover::before { transform: scaleX(1); }

/* anchor the badge to the image so it sits on the image corner and never
   collides with surrounding text */
.paper-box .paper-box-image > div { position: relative; display: inline-block; }
.paper-box .paper-box-image img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.35s var(--ease);
}
.page__content .paper-box a:hover img { box-shadow: var(--shadow-lg); }
.paper-box-text strong { color: var(--ink); }

/* ----- Venue badge (overlay on image top-left) ------------------------- */
.badge {
  position: absolute;
  top: 0.6em;
  left: 0.6em;
  margin: 0;
  z-index: 3;            /* stay above the image */
  padding: 0.34em 0.85em;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--accent-line);
  box-shadow: 0 3px 10px rgba(47, 95, 224, 0.45);
}

/* ----- News / awards / services lists --------------------------------- */
.page__content ul { list-style: none; padding-left: 1.1em; }
.page__content ul > li { position: relative; line-height: 1.85; }
.page__content ul > li::before {
  content: "";
  position: absolute;
  left: -1.1em;
  top: 0.72em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-line);
}
.page__content ul > li em { color: var(--accent-strong); font-style: normal; font-weight: 650; }

/* keep nested lists tidy */
.page__content ul ul { margin-top: 0.2em; }

/* Publications full list (ordered) */
.page__content ol { padding-left: 1.7em; }
.page__content ol > li {
  margin-bottom: 0.35em;
  padding: 0.7em 0.85em;
  border-radius: 11px;
  line-height: 1.7;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.page__content ol > li:hover { background: #f3f6fc; box-shadow: var(--shadow-sm); }
.page__content ol > li::marker { color: var(--accent); font-weight: 700; }
.page__content ol > li > p { margin-bottom: 0; }
/* paper title (direct strong child of the entry paragraph) */
.page__content ol > li > p > strong:first-child { color: var(--ink); font-weight: 700; }

/* venue tag (direct <em> child) rendered as a chip */
.page__content ol > li > p > em {
  display: inline-block;
  font-style: normal;
  font-size: 0.8em;
  font-weight: 650;
  color: var(--muted);
  background: #eef1f6;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.08em 0.55em;
  margin: 0.18em 0.15em 0.18em 0;
}
.page__content ol > li:hover > p > em { background: #fff; }

/* Paper / Code links as pill buttons */
.page__content ol > li a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin: 0.18em 0.15em 0 0;
  padding: 0.13em 0.65em;
  font-size: 0.84em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #dbe4fb;
  border-radius: 7px;
  background-image: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.page__content ol > li a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.page__content ol > li a em { font-style: normal; }

/* highlight the author's own name with the refined accent (not raw blue) */
.page__content span[style*="color:blue"],
.page__content span[style*="color: blue"] { color: var(--accent) !important; }

/* Year / section sub-headers (## 2026, ## Pre-print, ## Leading Projects ...) */
.page__content h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 1.7em;
  margin-bottom: 0.7em;
  padding-bottom: 0.35em;
  font-size: 1.05em;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-strong);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5em;
}
.page__content h2::before {
  content: "";
  display: inline-block;
  width: 0.7em; height: 0.7em;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--accent-line);
}
.page__content h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 2.6em; height: 2px;
  background: var(--accent);
}

/* ----- Code & tables --------------------------------------------------- */
.page__content code {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}
table { box-shadow: var(--shadow-sm); border-radius: var(--radius-sm); overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ----- Custom scrollbar ------------------------------------------------ */
* { scrollbar-width: thin; scrollbar-color: #c8d0dd transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: #cbd3df;
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #aab4c4; }

/* ----- Research-interest chips (hero) --------------------------------- */
.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55em;
  margin: 1.1em 0 0.4em;
}
.research-tags span {
  display: inline-flex;
  align-items: center;
  padding: 0.34em 0.85em;
  font-size: 0.84em;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #dbe4fb;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background 0.2s var(--ease);
}
.research-tags span:hover {
  transform: translateY(-2px);
  background: #e4ecfe;
  box-shadow: var(--shadow-sm);
}

/* ----- "Open to Work" callout ----------------------------------------- */
.open-callout {
  position: relative;
  margin: 1.3em 0 0.4em;
  padding: 1.05em 1.25em 1.05em 1.4em;
  background: linear-gradient(135deg, #eef3fe 0%, #f3f0fe 100%);
  border: 1px solid #d8e0fb;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.open-callout::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-line);
}
.open-callout p {
  margin: 0.5em 0 0;
  font-size: 0.96em;
  line-height: 1.65;
  color: var(--text);
}
.open-callout p strong { color: var(--ink); }
.oc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3em 0.8em;
  font-size: 0.78em;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f8a4d;
  background: #e3f7ec;
  border: 1px solid #bfead2;
  border-radius: 999px;
}
.oc-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #16b364;
  box-shadow: 0 0 0 0 rgba(22, 179, 100, 0.6);
  animation: oc-pulse 2s infinite;
}
@keyframes oc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 179, 100, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(22, 179, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 179, 100, 0); }
}
@media (prefers-reduced-motion: reduce) { .oc-dot { animation: none; } }

/* Google Scholar citations chip (revealed by JS once data is available) */
.cite-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  margin: 0.2em 0 0.2em;
  padding: 0.32em 0.85em;
  font-size: 0.86em;
  font-weight: 600;
  color: var(--accent-strong) !important;
  background: var(--accent-soft);
  border: 1px solid #dbe4fb;
  border-radius: 999px;
  background-image: none !important;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cite-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cite-chip .fa-quote-right { color: var(--accent); }
.cite-chip strong { color: var(--accent-strong); font-weight: 750; }

/* Venue tag inside publication cards (e.g. "ICSE 2025, Research Track") */
.paper-box-text p > em {
  display: inline-block;
  font-style: normal;
  font-size: 0.82em;
  font-weight: 650;
  color: var(--muted);
  background: #f1f3f7;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.1em 0.6em;
  margin: 0.1em 0.15em 0.1em 0;
}

/* ----- Paper / code links as pill buttons ----------------------------- */
.paper-box-text a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin: 0.15em 0.15em 0 0;
  padding: 0.16em 0.7em;
  font-size: 0.86em;
  line-height: 1.5;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #dbe4fb;
  border-radius: 7px;
  background-image: none;          /* cancel the underline-grow animation */
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.paper-box-text a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.paper-box-text a em { font-style: normal; }

/* ----- Reading progress bar ------------------------------------------- */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 30;             /* above the sticky masthead */
  background: var(--accent-line);
  box-shadow: 0 0 8px rgba(47, 95, 224, 0.5);
  transition: width 0.1s linear;
}

/* ----- Back-to-top button --------------------------------------------- */
#back-to-top {
  position: fixed;
  right: 1.4em;
  bottom: 1.4em;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25em;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  box-shadow: var(--shadow-md);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              background 0.2s var(--ease);
}
#back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
#back-to-top:hover { background: var(--accent-strong); transform: translateY(-3px); }

/* hide the SEO description duplicated into the sidebar (kept only in <meta>) */
.author__urls li > div { display: none; }

@media (prefers-reduced-motion: reduce) {
  .research-tags span, .paper-box-text a, #back-to-top { transition: none; }
}
