/* ============================================================
   On-Policy Distillation Survey — minimal academic stylesheet
   Palette: #111 ink / #2563eb accent / #f5f5f5 bg-soft / #fff bg
   ============================================================ */

:root {
  --font-sans: Inter, 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --c-ink:      #111111;
  --c-text:     #222222;
  --c-muted:    #666666;
  --c-faint:    #aaaaaa;
  --c-rule:     #e5e5e5;
  --c-bg:       #ffffff;
  --c-bg-soft:  #f5f5f5;

  --c-accent:   #2563eb;
  --c-accent-h: #1d4ed8;

  --rad-sm: 3px;
  --rad-md: 6px;
}

/* ---------- Reset / Base ---------- */

html {
  background: var(--c-bg);
}

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background: var(--c-bg);
}

p { margin-bottom: 0.75em; }

a {
  color: var(--c-accent);
  text-decoration: none;
}

a:hover {
  color: var(--c-accent-h);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.container {
  max-width: 1080px;
}

/* ---------- Hero ---------- */

.hero {
  background: var(--c-bg);
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--c-rule);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 1rem;
}

/* "OPDHub" wordmark — plain, no decoration */
.hero-wordmark {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin-bottom: 0.9rem;
}

.hero-wordmark .wordmark-glyph {
  color: var(--c-accent);
}

.hero-wordmark .wordmark-tail {
  color: var(--c-ink);
  font-weight: 600;
}

.publication-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--c-ink);
  margin: 0;
}

/* ---------- Sections ---------- */

.section {
  padding: 3rem 1.5rem;
}

.section-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--c-ink);
  margin-bottom: 1.4rem;
  text-align: center;
  letter-spacing: -0.01em;
}

/* no decorative underline */
.section-title::after { content: none; }

/* ---------- Monthly stat band ---------- */

.section-stat {
  background: var(--c-bg-soft);
  padding: 1.5rem 1.5rem 2rem;
  border-bottom: 1px solid var(--c-rule);
}

.section-stat .container {
  text-align: center;
}

.monthly-chart {
  display: block;
  width: 100%;
  max-width: 820px;
  height: auto;
  margin: 0 auto;
}

.monthly-chart-caption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.monthly-chart-caption .muted { color: var(--c-faint); }

/* ---------- Paper Atlas ---------- */

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

/* Search box */

.search-wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto 1.8rem;
}

.search-wrap input {
  width: 100%;
  padding: 0.7rem 3.6rem 0.7rem 2.6rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--c-ink);
  background: var(--c-bg);
  border: 1px solid var(--c-rule);
  border-radius: var(--rad-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search-wrap input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.search-wrap input::placeholder {
  color: var(--c-faint);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-faint);
  font-size: 0.85rem;
}

.search-count {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-faint);
}

/* Filter grid */

.filter-grid {
  max-width: 900px;
  margin: 0 auto 2.5rem;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.35rem 0;
}

.filter-label {
  flex: 0 0 5rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-faint);
  padding-top: 0.4rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--c-rule);
  background: var(--c-bg);
  color: var(--c-muted);
  transition: all 0.12s ease;
}

.chip:hover {
  border-color: #999;
  color: var(--c-ink);
}

.chip.is-active {
  background: var(--c-ink);
  color: #fff;
  border-color: var(--c-ink);
}

/* All loss chips use the same black active state — no per-category color */
.chip[data-value].is-active {
  background: var(--c-ink);
  color: #fff;
  border-color: var(--c-ink);
}

.chip .chip-count {
  margin-left: 0.35rem;
  opacity: 0.5;
  font-size: 0.72rem;
}

.filter-actions { margin-top: 0.3rem; }

.clear-btn {
  background: transparent;
  border: 1px solid var(--c-rule);
  color: var(--c-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .12s;
}

.clear-btn:hover {
  border-color: #999;
  color: var(--c-ink);
}

/* Paper list */

#paper-list {
  max-width: 960px;
  margin: 0 auto;
}

#paper-list h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--c-ink);
  margin: 2.8rem 0 0.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--c-ink);
  letter-spacing: -0.01em;
}

#paper-list h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  font-style: normal;
  color: var(--c-muted);
  margin: 1.6rem 0 0.5rem;
}

#paper-list h3 em,
#paper-list h3 .leaf-blurb {
  color: var(--c-faint);
  font-weight: 400;
  font-style: normal;
}

#paper-list ul.paper-group {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

li.paper-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title meta"
    "desc  desc";
  gap: 0.25rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--c-rule);
}

li.paper-card:last-child {
  border-bottom: none;
}

li.paper-card.is-hidden {
  display: none;
}

li.paper-card .paper-title {
  grid-area: title;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-ink);
  line-height: 1.4;
}

li.paper-card .paper-meta {
  grid-area: meta;
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-shrink: 0;
}

li.paper-card .paper-desc {
  grid-area: desc;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.5;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--rad-sm);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.badge-arxiv {
  background: #b31b1b;
  color: #fff;
}

.badge-arxiv:hover {
  background: #8e1515;
  color: #fff;
  text-decoration: none;
}

/* Section badge — subtle */
.badge-section {
  background: transparent;
  color: var(--c-faint);
  border: 1px solid var(--c-rule);
}

/* Loss badges — all same neutral style */
.badge-loss-FKL,
.badge-loss-RKL,
.badge-loss-Symmetric,
.badge-loss-f-Divergence,
.badge-loss-KL\+RL,
.badge-loss-Preference,
.badge-loss-Other {
  background: var(--c-bg-soft);
  color: var(--c-muted);
  border: 1px solid var(--c-rule);
}

/* Code badge */
.badge-code {
  background: var(--c-ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
}
.badge-code:hover {
  background: #333;
  color: #fff;
  text-decoration: none;
}
.badge-code i { margin-right: 0.2rem; }

/* Cite badge */
.badge-cite {
  background: transparent;
  color: var(--c-faint);
  border: 1px solid var(--c-rule);
  cursor: pointer;
  transition: all .12s;
}

.badge-cite:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  text-decoration: none;
}

.badge-cite.is-copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 3rem 0;
  color: var(--c-faint);
  font-size: 0.9rem;
}

.empty-state i {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  display: block;
}

.is-hidden { display: none !important; }

/* ---------- BibTeX section ---------- */

.section-bibtex {
  background: var(--c-bg-soft);
  border-top: 1px solid var(--c-rule);
}

.bibtex-wrap { position: relative; }

.bibtex-wrap pre {
  background: var(--c-bg);
  border: 1px solid var(--c-rule);
  border-radius: var(--rad-md);
  padding: 1.2rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--c-ink);
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: var(--c-bg);
  color: var(--c-muted);
  border: 1px solid var(--c-rule);
  border-radius: var(--rad-sm);
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all .12s;
}

.copy-btn:hover {
  border-color: #999;
  color: var(--c-ink);
}

.copy-btn.is-copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

/* Export button */

.export-btn {
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all .12s;
  white-space: nowrap;
}

.export-btn:hover {
  border-color: #999;
  color: var(--c-ink);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem 1rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-faint);
  background: var(--c-bg-soft);
  border-top: 1px solid var(--c-rule);
}

.site-footer a {
  color: var(--c-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.site-footer a:hover { color: var(--c-accent); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 14px; }

  .publication-title {
    font-size: 1rem;
    line-height: 1.35;
  }

  .hero-wordmark { font-size: 1.3rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .section { padding: 2rem 1rem; }
  .section-title { font-size: 1.1rem; }

  .filter-row {
    flex-direction: column;
    gap: 0.3rem;
  }
  .filter-label {
    text-align: left;
    flex: none;
    padding-top: 0;
  }

  li.paper-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "meta"
      "desc";
  }
  li.paper-card .paper-meta { margin-top: 0.2rem; }

  .search-count { display: none; }
}
