:root {
  --primary: #1a6bff;
  --primary-dark: #0f4fc7;
  --secondary: #ff6b35;
  --bg-soft: #f5f8ff;
  --bg-alt: #f7f9fc;
  --border: #dbe3f0;
  --text: #1f2a44;
  --muted: #5f6b85;
  --light-pill-text: #5f6b85;
  --light-pill: #ebedf0;
  --good: #1f9d55;
  --good-bg: #e8f7ef;
  --medium: #d68a00;
  --medium-bg: #fff5dd;
  --bad: #dc3d43;
  --bad-bg: #fdebec;

  --distraction: #0083E6;
  --ground-truth: #E96C00;
  --forgery-localization: #E96C00;
  --masked-convolution: #B30BA3;
  --masked-convolution-light: #eef4ff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans', sans-serif;
  color: var(--text);
  background: #fff;
}

body,
button,
input,
select,
textarea {
  font-family: 'Noto Sans', sans-serif;
}

h1,
h2,
h3,
.navbar-item,
.button,
.title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}
.title-smaller {
  font-size: 2.5rem;
}

.top-nav {
  box-shadow: 0 6px 20px rgba(20, 35, 90, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.top-nav .navbar-item {
  color: var(--text);
  font-weight: 500;
}

.top-nav .navbar-item:hover,
.top-nav .navbar-item:focus {
  color: var(--primary);
}

.nav-brand {
  font-weight: 700;
}

.paper-hero {
  padding-top: 4.5rem;
  background: linear-gradient(180deg, #f9fbff 0%, #fff 100%);
}

.publication-venue {
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.venue-pill {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(26, 107, 255, 0.1);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.publication-title {
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 1.4rem !important;
}

.publication-authors {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.publication-authors a {
  color: var(--text);
}

.publication-authors a:hover {
  color: var(--primary);
}

.publication-links {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-figure-section {
  padding-top: 0.5rem;
}

.hero-figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hero-panel,
.comparison-card,
.method-card,
.visual-table img,
.bibtex-block {
  border-radius: 18px;
}

.hero-panel {
  margin: 0;
  padding: 0.8rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(25, 45, 95, 0.08);
  border: 1px solid rgba(219, 227, 240, 0.9);
}

.hero-panel img,
.comparison-card img,
.visual-table img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.hero-panel figcaption,
.figure-caption,
.table-footnote,
.section-note {
  color: var(--muted);
}

.hero-panel figcaption {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  text-align: center;
}

.figure-caption {
  margin: 1rem auto 0;
  max-width: 920px;
  text-align: center;
}

.scatter-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.scatter-card > div {
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}

.scatter-card > img {
  margin-bottom:-15px
}

.section-title {
  margin-bottom: 1rem !important;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-lead {
  max-width: 880px;
  margin: 0 auto;
  color: var(--muted);
}

.abstract-box {
  padding: 1.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.alt-section {
  background: var(--bg-alt);
}

.distraction-text {
  color: var(--distraction);
  font-weight: 700;
}

.distraction {
  color: var(--distraction);
}

.ground-truth {
  color: var(--ground-truth);
}

.forgery-localization {
  color: var(--forgery-localization);
}

.masked-convolution {
  color: var(--masked-convolution);
}

.comparison-group,
.content-block {
  margin-top: 2.25rem;
}

.model-divider a {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

.model-divider a:hover {
  opacity: 0.75;
}

.model-divider {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  margin: 0 0 1rem;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.12);
  color: var(--secondary);
  font-weight: 700;
}

.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.eight-col-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.6rem;
}

.six-col-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
}

.card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  align-items: center;
  justify-content: space-around;
}

.mask-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  color: var(--primary);
  background: rgba(26, 107, 255, 0.1);
  border: 1px solid rgba(26, 107, 255, 0.25);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.mask-pill:hover,
.mask-pill.active {
  background: var(--primary);
  color: #fff;
}

.grid-header {
  margin-bottom: 0.75rem;
}

.grid-header > div {
  padding: 0.7rem 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.eight-col-grid.grid-header > div {
  padding: 0.5rem 0.3rem;
  font-size: 0.78rem;
  line-height: 1.3;
}

.figure-table-header {
  display: flex;
  justify-content: center;
  align-items: center;
}

.example-row {
  margin-bottom: 1rem;
}

.comparison-card {
  position: relative;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(25, 45, 95, 0.06);
}

.score-badge,
.delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
}

.score-badge {
  padding: 0.32rem 0.7rem;
}

.score-badge.good,
.delta.good,
.delta.positive {
  color: var(--good);
  background: var(--good-bg);
}

.score-badge.medium,
.delta.medium {
  color: var(--medium);
  background: var(--medium-bg);
}

.score-badge.bad,
.delta.severe {
  color: var(--bad);
  background: var(--bad-bg);
}

.method-card {
  height: 100%;
  padding: 1.4rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(25, 45, 95, 0.07);
}

.method-card p {
  color: var(--muted);
}

.pdf-embed {
  width: 100%;
  min-height: 360px;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.scatter-embed {
  min-height: 420px;
}

.table-breakout {
  width: min(1200px, calc(100vw - 4rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.figure-breakout {
  width: min(1200px, calc(100vw - 4rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.table-scroll,
.wide-scroll {
  overflow-x: auto;
}

.results-table,
.visual-table {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.results-table th,
.results-table td,
.visual-table th,
.visual-table td {
  vertical-align: top;
  border-color: #edf1f7 !important;
}

.results-table thead th,
.visual-table thead th {
  background: #eef4ff;
  color: var(--text);
  text-align: center !important;
}

.results-table td:first-child,
.visual-table td:first-child,
.results-table th:first-child {
  font-weight: 700;
}

.results-table td {
  text-align: center;
  white-space: nowrap;
}

.results-table td:first-child {
  text-align: left;
  white-space: nowrap;
}

.highlight-row-masked td:first-child {
  color: var(--masked-convolution);
}

.best-row {
  background: var(--masked-convolution-light);
}

.results-table .delta {
  margin-left: 0.35rem;
  padding: 0.18rem 0.45rem;
  color: var(--light-pill-text);
  background: var(--light-pill);
}

.table-footnote,
.section-note {
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.visual-table {
  min-width: 1220px;
}

.visual-table th,
.visual-table td {
  text-align: center;
  min-width: 145px;
}

.visual-table td {
  padding: 0.8rem;
}

.row-label td {
  background: #f9fbff;
  color: var(--primary-dark);
  text-align: left;
  font-weight: 700;
}

.visual-table .score-badge {
  margin-top: 0.55rem;
}

.bibtex-block {
  padding: 1.4rem;
  background: #10172a;
  color: #eff4ff;
  overflow-x: auto;
}

.acknowledgments {
  color: var(--muted);
}

.footer-small {
  padding: 2rem 1.5rem 2.5rem;
  background: #fff;
}

/* F1* tooltip / popover */
.f1star-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed var(--primary);
  white-space: nowrap;
}

.score-badge.f1star-trigger {
  cursor: default;
  border-bottom: none;
}

.f1star-popup {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  z-index: 9999;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  padding: 0.9rem 1rem;
  background: #10172a;
  color: #eff4ff;
  border-radius: 12px;
  font-size: 0.88rem;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 400;
  line-height: 1.55;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  text-align: left;
  white-space: normal;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.f1star-popup strong {
  color: #ffffff;
}

.f1star-popup code {
  background: rgba(255,255,255,0.12);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
  color: #b8d4ff;
}

.f1star-popup em {
  color: #8ba4cc;
}

/* Arrow pointing down */
.f1star-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #10172a;
}

/* Show after hover-delay via CSS animation trick */
.f1star-trigger:hover .f1star-popup {
  visibility: visible;
  opacity: 1;
  animation: popover-delay 0.6s;
}

@keyframes popover-delay {
  0%   { opacity: 0; visibility: hidden; }
  66%  { opacity: 0; visibility: hidden; }
  100% { opacity: 1; visibility: visible; }
}

@media screen and (max-width: 1023px) {
  .top-nav .navbar-menu {
    display: block;
  }

  .top-nav .navbar-end {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 768px) {
  .paper-hero {
    padding-top: 5.2rem;
  }

  .publication-title {
    font-size: 2rem !important;
  }

  .hero-figure-grid,
  .three-col-grid {
    grid-template-columns: 1fr;
  }

  .pdf-embed,
  .scatter-embed {
    min-height: 300px;
  }
}
