/* ═══════════════════════════════════════════════════════════
   µFlow Project Page — Minimalist White + Bright Blue
   ═══════════════════════════════════════════════════════════ */

:root {
  --blue:       #0ea5e9;
  --blue-dark:  #0284c7;
  --blue-light: #e0f2fe;
  --github:     #24292e;
  --github-hover: #3a4046;
  --text:       #111827;
  --text-soft:  #4b5563;
  --text-muted: #9ca3af;
  --bg:         #ffffff;
  --bg-tint:    #f8faff;
  --border:     #e5e7eb;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.07);
}

/* ── Reset / Base ─────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* Wider content area (override Bulma's is-max-desktop 960px) */
.container.is-max-desktop {
  max-width: 1140px !important;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-top: 56px;
}

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

/* ── Top accent line ─────────────────────────────────────── */
body::before {
  content: '';
  display: block;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #60a5fa, var(--blue));
  z-index: 9999;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue) !important;
  letter-spacing: -0.3px;
}

.nav-link {
  color: var(--text-soft) !important;
  font-size: 0.91rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover  { color: var(--blue) !important; }
.is-active-nav   { color: var(--blue) !important; border-bottom: 2px solid var(--blue); }

.navbar-burger span { background-color: var(--text-soft); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  padding: 6rem 1.5rem 4.5rem;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(155deg, #ffffff 0%, #eef4ff 45%, #d4e4fd 100%);
}

/* Dot-grid texture */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(29,110,245,0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Soft vignette to keep center readable */
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 40%,
              rgba(255,255,255,0.55) 0%,
              rgba(255,255,255,0) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-section > * { position: relative; z-index: 2; }

.paper-venue {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 1.6rem;
  border: 1px solid rgba(29,110,245,0.2);
}

.paper-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 800;
  line-height: 1.18;
  color: var(--text);
  letter-spacing: -1.5px;
  max-width: 100%;
  margin: 0 auto 1.6rem;
}

.authors {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
}

.author-block {
  display: inline-block;
  margin: 2px 6px;
}
.author-block a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}
.author-block a:hover { text-decoration: underline; }

.affiliations {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 2.2rem;
}

/* ── Hero buttons ─────────────────────────────────────────── */
.hero-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--blue);
  color: #ffffff;
  border: none;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(29,110,245,0.25);
}
.hero-btn:hover {
  background: var(--blue-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(29,110,245,0.35);
}
.hero-btn i { font-size: 1rem; }

/* GitHub-specific button */
.hero-btn--github {
  background: var(--github);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.hero-btn--github:hover {
  background: var(--github-hover);
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

/* Paper button */
.hero-btn--paper {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.hero-btn--paper:hover {
  background: #b91c1c;
  box-shadow: 0 6px 18px rgba(220,38,38,0.35);
}

/* ── Page sections ────────────────────────────────────────── */
.page-section {
  padding: 5rem 1.5rem;
}

.section-tinted { background: #fafafa; }

/* ── Section headings ─────────────────────────────────────── */
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-rule {
  width: 40px;
  height: 3px;
  background: var(--blue);
  border-radius: 2px;
  margin: 0 auto 2.5rem;
}

/* ── Keywords ─────────────────────────────────────────────── */
.keywords {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.8rem;
}
.kw-tag {
  background: var(--bg-tint);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 13px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

/* ── Abstract ─────────────────────────────────────────────── */
.abstract-layout {
  display: flex;
  gap: 2.8rem;
  align-items: flex-start;
}

.abstract-visual {
  flex: 0 0 42%;
}
.abstract-visual img {
  width: 100%;
  border-radius: var(--radius);
  border: none;
  box-shadow: none;
  display: block;
}

.abstract-content { flex: 1; }

.abstract-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.85;
  color: #374151;
  text-align: justify;
  hyphens: auto;
}

/* ── Figures ──────────────────────────────────────────────── */
.paper-figure {
  margin: 0;
  background: linear-gradient(180deg, #f7f8fa 0%, #ffffff 18%);
  border: none;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 6px 32px rgba(0,0,0,0.05);
}

.paper-figure img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.paper-figure figcaption {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-soft);
  text-align: center;
  padding: 0 0.5rem;
}

/* ── Results: scrollable AUC panels ──────────────────────────── */
.rt-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--blue);
  margin-top: 0.4rem;
}
.results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.rt-tab {
  border: 1px solid #d8dde3;
  background: #fff;
  color: var(--text-soft);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rt-tab:hover { border-color: var(--blue); color: var(--blue); }
.rt-tab.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

.results-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.results-track::-webkit-scrollbar { height: 6px; }
.results-track::-webkit-scrollbar-thumb { background: #d8dde3; border-radius: 3px; }
.results-panel {
  min-width: 100%;
  scroll-snap-align: start;
  padding: 0 0.15rem;
}

.auc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.auc-table th,
.auc-table td {
  padding: 0.5rem 0.45rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.auc-table thead th {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.auc-table thead tr:first-child th { border-bottom: 1px solid rgba(255,255,255,0.28); }
.auc-table thead tr:nth-child(2) th {   /* AUC / AP sub-row */
  font-weight: 500;
  font-size: 0.82rem;
  opacity: 0.9;
}
.auc-table thead th.method-col {
  font-size: 1.1rem;
  vertical-align: middle;
  border-top-left-radius: 8px;
}
.auc-table thead tr:first-child th:last-child { border-top-right-radius: 8px; }
.auc-table td { border-bottom: 1px solid #eef0f3; }
.auc-table td:first-child { text-align: left; color: var(--text); }
/* vertical separators between family groups */
.auc-table .grp { border-left: 1px solid #e3e7ec; }
.auc-table thead .grp { border-left: 1px solid rgba(255,255,255,0.3); }
.auc-table td.best   { font-weight: 700; color: var(--blue-dark); }
.auc-table td.second { text-decoration: underline; }
.auc-table .ours-row { background: var(--blue-light); font-weight: 600; }
.auc-table .ours-row td:first-child { font-weight: 700; }
.rt-venue {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-soft);
  background: #f0f2f5;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}

/* ── Results ──────────────────────────────────────────────── */
.results-intro {
  text-align: center;
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.metrics-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  text-align: center;
  min-width: 170px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

.metric-value {
  font-family: 'Inter', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  letter-spacing: -1px;
}
.metric-unit {
  font-size: 1.4rem;
  font-weight: 600;
}
.metric-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.4rem;
}
.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.results-note {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--blue-light);
  border: 1px solid rgba(29,110,245,0.15);
  border-radius: 8px;
  padding: 0.9rem 1.4rem;
  max-width: 600px;
  margin: 0 auto;
}
.results-note a { color: var(--blue); font-weight: 500; }

/* ── Robustness table ─────────────────────────────────────── */
.robustness-section {
  margin-top: 3.5rem;
}

.subsection-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.3px;
  margin-bottom: 0.4rem;
}

.subsection-intro {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
}

.robustness-table-wrapper {
  overflow-x: auto;
  max-width: 620px;
  margin: 0 auto;
}

.robustness-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.93rem;
  border: 1px solid var(--border);
}

.robustness-table thead tr {
  background: var(--blue);
  color: #ffffff;
}

.robustness-table th {
  padding: 0.85rem 1.3rem;
  font-weight: 600;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.robustness-table th:first-child { text-align: left; }

.robustness-table td {
  padding: 0.7rem 1.3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.robustness-table td:first-child {
  text-align: left;
  color: var(--text-soft);
  font-weight: 500;
}

.robustness-table tbody tr:hover { background: var(--blue-light); }

.robustness-table .avg-row {
  background: #eef3ff;
  border-top: 2px solid rgba(29,110,245,0.25);
}

.robustness-table .avg-row td {
  font-weight: 700;
  color: var(--blue);
}

.robustness-table .avg-row td:first-child {
  color: var(--text);
}

/* ── BibTeX ───────────────────────────────────────────────── */
.bibtex-intro {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  text-align: center;
}

.bibtex-wrapper { position: relative; }

.bibtex-box {
  background: #3a3a3a;
  color: #d4d4d4;
  border-radius: var(--radius);
  padding: 32px 32px 28px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.87rem;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid #4a4a4a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #4a4a4a;
  color: #a8a8a8;
  border: 1px solid #5a5a5a;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.copy-btn:hover {
  background: #5a5a5a;
  color: #d4d4d4;
}

/* ── Affiliation logos ────────────────────────────────────── */
.logos-section {
  padding: 3rem 1.5rem;
  background: var(--bg);
}

.logos-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.logos-row img {
  flex: 1 1 0;
  max-width: 32%;
  height: 120px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s;
  filter: grayscale(15%);
}

.logos-row img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* ── Footer ───────────────────────────────────────────────── */
.page-footer {
  padding: 2.5rem 1.5rem;
  background: #f9fafb;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}
.footer-sub {
  margin-top: 0.4rem;
  font-size: 0.82rem;
}
.page-footer a { color: var(--blue); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .paper-title { font-size: 1.45rem; }
  .author-block { display: inline; }
  .abstract-layout { flex-direction: column; }
  .abstract-visual { flex: unset; width: 100%; max-width: 320px; margin: 0 auto; }
  .abstract-text { font-size: 0.97rem; }
  .metrics-grid { gap: 1rem; }
  .metric-card { min-width: 140px; padding: 1.2rem 1rem; }
  .metric-value { font-size: 2rem; }
  .bibtex-box { font-size: 0.78rem; padding: 20px 16px; }
  .paper-figure { padding: 1rem; }
  .logos-row { flex-wrap: nowrap; gap: 1rem; }
  .logos-row img { max-width: none; height: 60px; }
  .auc-table { font-size: 0.8rem; }
  .auc-table th, .auc-table td { padding: 0.4rem 0.3rem; }
  .rt-venue { display: none; }
}
