/* ═══ Variables ═══ */
:root {
  --bg: #ffffff;
  --text: #1a1200;
  --muted: #7a6a3a;
  --accent: #b8860b;
  --accent-dark: #8a6308;
  --gold: #c8a84b;
  --gold-light: #f5e6a3;
  --gold-pale: #fffdf0;
  --hero-bg-from: #1a1200;
  --hero-bg-to: #2e2000;
  --hero-text: #fdf6e3;
  --hero-muted: #c8a84b;
  --section-alt: #fffdf0;
  --border: #e8d8a0;
  --card-bg: #ffffff;
  --shadow: 0 2px 12px rgba(120,80,0,0.10);
  --max-width: 960px;
  --radius: 12px;

  /* bias colors */
  --bias-strong: #b8860b;
  --bias-weak: #c0392b;
  --bias-neutral: #c8b87a;
  --bias-male: #b8860b;
  --bias-female: #c0392b;
}

/* ═══ Reset ═══ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
sup { font-size: 0.65em; }

/* ═══ Container ═══ */
.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══ HERO ═══ */
.hero {
  background: linear-gradient(145deg, var(--hero-bg-from) 0%, var(--hero-bg-to) 100%);
  padding: 80px 24px 72px;
  text-align: center;
  color: var(--hero-text);
}

.paper-nickname {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.venue-badge {
  display: inline-block;
  padding: 4px 14px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #ffffff;
}

.subtitle {
  margin: 16px auto 0;
  max-width: 720px;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--hero-muted);
}

.authors {
  margin-top: 28px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--hero-text);
}
.authors p { margin: 0; }
.authors a { color: var(--gold-light); }
.authors a:hover { color: #ffffff; text-decoration: underline; }

.affiliations {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--hero-muted);
}

.equal-contrib {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--hero-muted);
  font-style: italic;
}

.button-row {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(200,168,75,0.12);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  backdrop-filter: blur(4px);
}
.action-button:hover {
  background: rgba(200,168,75,0.25);
  border-color: #f5e6a3;
  text-decoration: none;
  color: #f5e6a3;
}
.icon { display: inline-flex; align-items: center; width: 1em; }

/* ═══ Sections ═══ */
.section {
  padding: 72px 0;
}
.section-alt {
  background: var(--section-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  text-align: center;
}
.section-desc {
  text-align: center;
  color: var(--muted);
  max-width: 680px;
  margin: -12px auto 36px;
  font-size: 0.97rem;
}

/* ═══ Abstract ═══ */
.abstract-text {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.02rem;
  line-height: 1.8;
  color: #374151;
  text-align: justify;
}

/* ═══ Key Findings ═══ */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.finding-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.finding-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 12px;
}
.finding-stat {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.finding-label {
  font-size: 0.88rem;
  color: #374151;
  margin-top: 8px;
  line-height: 1.5;
}
.finding-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
  font-style: italic;
}

/* ═══ Tabs ═══ */
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 36px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ═══ Chart header ═══ */
.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}
.chart-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  max-width: 580px;
}
.split-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.split-legend span { display: flex; align-items: center; gap: 6px; }
.split-legend span::before { content:''; display:inline-block; width:12px; height:12px; border-radius:2px; }
.leg-win::before  { background: var(--bias-strong); }
.leg-tie::before  { background: var(--bias-neutral); }
.leg-lose::before { background: var(--bias-female); }

.chart-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 16px;
  font-style: italic;
}

/* ═══ Bar Chart ═══ */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 52px;
  align-items: center;
  gap: 12px;
}
.bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 28px;
  background: #f0e8c8;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.bar-fill.positive { background: var(--bias-strong); }
.bar-fill.negative { background: var(--bias-female); }
.bar-fill.neutral  { background: var(--bias-neutral); }

.bar-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

/* Gender chart: split bar */
.bar-track.split {
  display: flex;
}
.bar-fill.male   { background: var(--bias-male); }
.bar-fill.female { background: var(--bias-female); }
.bar-fill.tie    { background: var(--bias-neutral); }

/* ═══ Heatmap ═══ */
.heatmap-section {
  margin-top: 56px;
}
.heatmap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.heatmap-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.heatmap-controls label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}
.dropdown {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--card-bg);
  cursor: pointer;
  outline: none;
}
.dropdown:focus { border-color: var(--accent); }

.heatmap-img-container {
  text-align: center;
  background: var(--gold-pale);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.heatmap-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.heatmap-table-container {
  overflow-x: auto;
  background: #fffdf5;
  border: 1px solid #f0e0a0;
  border-radius: var(--radius);
  padding: 16px;
}

.heatmap-container {
  overflow-x: auto;
}
.heatmap-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 620px;
  width: 100%;
}
.heatmap-table th,
.heatmap-table td {
  padding: 0;
  text-align: center;
}
.heatmap-table th {
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 80px;
}
.heatmap-table .row-header {
  text-align: right;
  padding-right: 10px;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heatmap-cell {
  width: 80px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 4px;
  margin: 2px;
  cursor: default;
  transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.08); z-index: 1; position: relative; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  justify-content: flex-end;
}
.legend-gradient {
  width: 120px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #dbe4ff, #4361ee);
}

/* ═══ Setup section ═══ */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.setup-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.setup-icon {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.setup-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.setup-card p {
  font-size: 0.88rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.6;
}

.model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.model-tag {
  display: inline-block;
  padding: 3px 8px;
  background: #eef0f8;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
}

.dim-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  color: #4b5563;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dim-list li { line-height: 1.4; }

/* ═══ Footer ═══ */
.footer {
  background: var(--hero-bg-from);
  color: var(--hero-muted);
  padding: 56px 0 40px;
  text-align: center;
}
.footer .container { display: flex; flex-direction: column; align-items: center; gap: 32px; }

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 1.5rem;
}
.footer-links a { color: var(--hero-muted); transition: color 0.15s; }
.footer-links a:hover { color: #ffffff; text-decoration: none; }

.bibtex-section { width: 100%; max-width: 640px; text-align: left; }
.bibtex-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 12px;
}
.bibtex-wrapper {
  position: relative;
}
.bibtex-code {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 16px 48px 16px 16px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #c9d1e0;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: var(--hero-muted);
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #ffffff; }
.copy-btn.copied { color: #6ee7b7; }

.footer-license {
  font-size: 0.85rem;
  color: var(--hero-muted);
  margin: 0;
}
.footer-license a { color: #a5c8ff; }

.footer-credit {
  font-size: 0.8rem;
  color: rgba(155,175,212,0.5);
  margin: 0;
}
.footer-credit a { color: rgba(165,200,255,0.5); }

/* ═══ Responsive ═══ */
@media (max-width: 640px) {
  .hero { padding: 56px 20px 52px; }
  .section { padding: 48px 0; }
  .bar-row { grid-template-columns: 120px 1fr 46px; }
  .bar-label { font-size: 0.78rem; }
  .tab-btn { padding: 10px 14px; font-size: 0.84rem; }
  .setup-grid { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .findings-grid { grid-template-columns: 1fr; }
}
