/* Minimal, clean styles with dark-mode support */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #555555;
  --accent: #1f6feb;
  --card: #f5f7fb;
  --border: #e6eaf0;
  /* adjust to your header height */
  --header-offset: 120px;
  /* For special badges in the publications */
  /* award + acceptance colors (light theme) */
  --award-gold-bg: #fff7d6;
  --award-gold-border: #f2c94c;
  --award-gold-text: #7a5d00;

  --award-silver-bg: #f4f6f8;
  --award-silver-border: #cfd8e3;
  --award-silver-text: #3a4756;

  --acc-bg: #eafaf1;
  --acc-border: #2ecc71;
  --acc-text: #145a32;

  --section-gap: 2rem;

  color-scheme: light;
}
section {
  padding-block: var(--section-gap);
}
/* smooth scrolling is optional */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

/* extra safety for older behavior and nested targets */
section, h1, h2, h3 {
  scroll-margin-top: var(--header-offset);
}
.dark {
  --bg: #0b0f14;
  --text: #e6edf3;
  --muted: #9aa7b2;
  --accent: #79c0ff;
  --card: #0f1621;
  --border: #1f2a37;
  /* tuned for dark mode contrast */
  --award-gold-bg: #2a2305;
  --award-gold-border: #d4af37;
  --award-gold-text: #f6e38f;

  --award-silver-bg: #1b2430;
  --award-silver-border: #8ea0b5;
  --award-silver-text: #d8e1ea;

  --acc-bg: #0f2a1a;
  --acc-border: #2ecc71;
  --acc-text: #9be7bd;

  color-scheme: dark;
}

/* badge variants */
.badge--best     { background: var(--award-gold-bg);   border-color: var(--award-gold-border);   color: var(--award-gold-text); }
.badge--runnerup { background: var(--award-silver-bg); border-color: var(--award-silver-border); color: var(--award-silver-text); }
.badge--accept   { background: var(--acc-bg);          border-color: var(--acc-border);          color: var(--acc-text); }

/* If we attach a numeric rate, show it neatly */
.badge--accept[data-rate]::after {
  content: " (" attr(data-rate) "%)";
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.container { max-width: 860px; margin: 0 auto; padding: 0 1rem; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
}
.identity { display: flex; align-items: center; gap: 1rem; }

.avatar {
  width: clamp(96px, 12vw, 160px);
  height: clamp(96px, 12vw, 160px);
  border-radius: 10%;
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: center;
  background: var(--card);
}

.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }

#themeToggle {
  font-size: 1.1rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

main { padding: 1rem 0 3rem; }
h1, h2 { line-height: 1.25; }
h1 { margin: 0; font-size: 1.6rem; }
h2 { margin-top: 2rem; font-size: 1.4rem; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  text-decoration: none;
  margin-right: 0.5rem;
  border: 1px solid transparent;
}
.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.highlights { padding-left: 1.2rem; }
.pub-list { counter-reset: pub; padding-left: 1.2rem; }
.pub-list > li { margin: 0.75rem 0; }
.pub-title { font-weight: 600; }
.pub-venue { color: var(--muted); }
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  margin-left: 0.4rem;
}
.filters { display: flex; gap: 1rem; align-items: center; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.wave-sep {
  position: relative;
  height: 56px;
  margin: 0 calc(50% - 50vw); /* full-bleed */
  background: none;
}
.wave-sep svg {
  display: block;
  width: 100%;
  height: 100%;
}
.wave-sep path {
  fill: var(--card);
}
.dark .wave-sep path {
  fill: #0c131d; /* tune for dark mode */
}

.pub-list > li {
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  margin: .6rem 0;
}

.section-title { font-size: clamp(1.25rem, 1.6vw, 1.5rem); }

/* Subtle gradient rule between sections */
section + section {
  position: relative;
}
section + section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  transform: translateY(-1.25rem);
}

/* Headings with accent underline */
.section-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  line-height: 1.25;
  margin: 0 0 1rem 0;
  position: relative;
  padding-bottom: .4rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 80px; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* Optional tiny icon styling next to the title */
.section-title .icon {
  font-size: 1.2em;
}

/* Keep anchor jumps below sticky header */
:root { --header-offset: 80px; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-offset); }
section, h1, h2, h3 { scroll-margin-top: var(--header-offset); }


/* Styling the filter selector in the publications */
* --- Publications filter bar --- */
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  padding: .6rem .8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: .75rem 0 1rem;
}

/* Each control group */
.filters label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  color: var(--muted);
}

/* Count pill on the right */
.filter-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: .85rem;
}

/* --- Pretty select --- */
.filters select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: .45rem .9rem .45rem .65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.2;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
  /* custom arrow (light) */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%231f6feb' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .55rem center;
  background-size: .8rem;
  padding-right: 2rem;
}
.filters select:hover { border-color: var(--accent); }
.filters select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(31 111 235 / 20%); }

.dark .filters select {
  background: #0b0f14;
  /* custom arrow (dark) */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2379c0ff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
}

/* --- Toggle-style checkbox for "Show preprints" (works with plain <input>) --- */
.filters input[type="checkbox"] {
  appearance: none;
  width: 40px; height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #dfe6ef;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.dark .filters input[type="checkbox"] { background: #1f2a37; }

.filters input[type="checkbox"]::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.filters input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.filters input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

/* Label text next to the switch (if you add a <span>) */
.filters .toggle-label {
  color: var(--text);
  font-size: .95rem;
}


/* Wrap the select so we can draw a custom chevron */
.filters .select {
  position: relative;
  display: inline-block;
  color: var(--muted); /* chevron uses currentColor */
}

/* Reset the select — kill native arrows and our old background-image arrow */
.filters .select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg) !important;
  background-image: none !important;   /* ensures no duplicated SVG */
  color: var(--text);
  -webkit-text-fill-color: var(--text); /* Safari dark quirk */
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem 2rem .45rem .65rem;   /* room for chevron */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.filters .select select:hover  { border-color: var(--accent); }
.filters .select select:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(31 111 235 / 20%); }

/* Old IE/Edge legacy arrow */
.filters .select select::-ms-expand { display: none; }

/* Draw the chevron via the wrapper (can’t duplicate) */
.filters .select::after {
  content: "";
  position: absolute;
  right: .55rem;
  top: 50%;
  width: .6rem;
  height: .6rem;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
  /* simple chevron using borders—stable in all themes/browsers */
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .9;
}

/* On focus, tint the chevron to accent for feedback */
.filters .select:has(select:focus)::after {
  color: var(--accent);
}

/* Dark mode: keep contrast consistent (no scaling issues) */
.dark .filters .select { color: var(--muted); }
.dark .filters .select select { background: #0b0f14 !important; }