/* MOEvo — Clean academic project page */
/* Modeled on Meta-Harness: Source Serif + Source Sans, white bg, red/blue accent, justified prose */

@font-face { font-family: "Source Serif 4"; src: url("https://fonts.gstatic.com/s/sourceserif4/v8/vEFy2_tTDB4M7-auWDN0ahZJW3IX2ih5nk3AucvUHf6OAVIJmeUDygwjihdqrhxXD-wGvjU.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("https://fonts.gstatic.com/s/sourceserif4/v8/vEFy2_tTDB4M7-auWDN0ahZJW3IX2ih5nk3AucvUHf6OAVIJmeUDygwjihdqrhxXD-wGvjU.woff2") format("woff2"); font-weight: 600; font-display: swap; }

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600&family=Source+Code+Pro:wght@400;500&display=swap');

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

:root {
  --text: #262626;
  --text-light: #666;
  --accent: #1a5fb4;
  --bg: #fff;
  --border: rgba(38,38,38,0.12);
  --code-bg: rgba(26,100,180,0.05);
  --serif: "Source Serif 4", Charter, "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container { max-width: 960px; margin: 0 auto; padding: 0 2rem; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* ─── Header ─── */
header { text-align: center; padding: 4rem 0 2rem; }

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.authors { font-size: 1.1rem; margin-bottom: 0.25rem; }

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

.links a {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}

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

/* ─── Sections ─── */
section { margin: 2.5rem 0; }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
}

p {
  margin-bottom: 1rem;
  text-align: justify;
  hyphens: auto;
}

/* ─── Callout ─── */
.callout {
  background: rgba(26,95,180,0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1.2rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}
.callout strong { color: var(--accent); }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }

table.rt {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  line-height: 1.4;
  font-variant-numeric: lining-nums tabular-nums;
}

table.rt th {
  font-family: var(--serif);
  font-weight: 600;
  text-align: right;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--text);
  background: #f8f8f8;
  white-space: nowrap;
}

table.rt th:first-child { text-align: left; }
table.rt td { text-align: right; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }
table.rt td:first-child { text-align: left; }
table.rt tbody tr:hover { background: #fafafa; }
table.rt tr.ours td { background: #f0f4ff; }
table.rt tr.ours td:first-child { border-left: 3px solid var(--accent); }
table.rt tr.bad td { background: #fff5f5; }

.table-caption {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ─── Figures ─── */
.figure { margin: 2rem 0; text-align: center; }
.figure img { max-width: 100%; height: auto; }

.figure-caption {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  text-align: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Evo stepper ─── */
.evo-section { margin: 3rem 0; }
.evo-chart-wrap { position: relative; width: 100%; }
.evo-chart-wrap canvas { width: 100%; height: auto; display: block; cursor: pointer; }
.evo-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-bottom: 1rem; user-select: none;
}
.evo-controls button {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.35rem 0.9rem; font-family: var(--sans); font-size: 0.9rem;
  cursor: pointer; color: var(--text); transition: border-color 0.2s, color 0.2s;
}
.evo-controls button:hover { border-color: var(--accent); color: var(--accent); }
.evo-controls button:disabled { opacity: 0.3; pointer-events: none; }
.evo-step-label {
  font-size: 0.9rem; color: var(--text-light);
  min-width: 10ch; text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
}
.evo-card {
  background: #f8f8f8; border: 1px solid var(--border); border-radius: 8px;
  padding: 1.25rem 1.5rem; min-height: 7rem;
}
.evo-card-header {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin-bottom: 0.5rem; flex-wrap: wrap;
}
.evo-card-title { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.evo-badge {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  padding: 0.1rem 0.5rem; border-radius: 4px;
  font-variant-numeric: lining-nums tabular-nums;
}
.evo-badge.up { background: #dcfce7; color: #166534; }
.evo-badge.down { background: #fee2e2; color: #991b1b; }
.evo-card-body { font-size: 0.92rem; line-height: 1.55; color: var(--text); text-align: left; }
.evo-card-body .front-info { margin-top: 0.5rem; }
.evo-card-body .front-pt {
  display: inline-block; margin-right: 0.75rem; font-size: 0.82rem;
  padding: 0.15rem 0.5rem; background: #eef2ff; border-radius: 4px; margin-bottom: 0.25rem;
}
.evo-card-body .fb {
  margin-top: 0.6rem; font-family: var(--mono); font-size: 0.78rem;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.6rem 0.8rem; max-height: 160px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.5; color: #555;
}

/* ─── Code ─── */
code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); padding: 0.15em 0.35em; border-radius: 3px; }

/* ─── BibTeX ─── */
.bibtex-block { position: relative; }
pre {
  background: #f8f8f8; border: 1px solid var(--border); border-radius: 6px;
  padding: 1rem 1.25rem; white-space: pre-wrap; word-wrap: break-word;
  font-size: 0.85rem; line-height: 1.5;
}
pre code { background: none; padding: 0; }
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 0.25rem 0.6rem; font-size: 0.8rem; cursor: pointer; color: var(--text-light);
}
.copy-btn:hover { color: var(--text); }


/* ─── Footer ─── */
.section-rule { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }
footer {
  margin-top: 3rem; padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 0.85rem; color: var(--text-light);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
