/* ============================================================
   VeriEnv — academic project page
   Visual language: Noto Serif titles, Roboto body,
   generous whitespace, centered column, inspired by
   WebArena / Mind2Web / InfoSeek.
   ============================================================ */

:root {
  --fg: #1f2328;
  --muted: #5c6670;
  --bg: #fbfbfa;
  --card-bg: #ffffff;
  --accent: #0f4c81;          /* deep academic blue */
  --accent-soft: #e7eff7;
  --border: #e2e5e9;
  --code-bg: #0f1115;
  --code-fg: #e6edf3;
  --easy: #2e7d32;
  --easy-bg: #e7f6e7;
  --medium: #b26a00;
  --medium-bg: #fff4e0;
  --hard: #b3261e;
  --hard-bg: #fcebe9;
  --shadow: 0 1px 2px rgba(15,25,40,.04), 0 4px 14px rgba(15,25,40,.06);
  --radius: 10px;
  --max-width: 980px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 28px 96px;
}

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

h1, h2, h3 {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  color: #111;
  line-height: 1.25;
}

code, pre, .bibtex {
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ===================== HEADER ===================== */

.paper-header {
  text-align: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.paper-title {
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}
.authors {
  font-size: 18px;
  margin-bottom: 8px;
}
.authors .author { margin: 0 10px; }
.authors sup { font-size: 0.75em; color: var(--accent); }
.affiliations {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 10px;
}
.affiliations span { margin: 0 10px; }
.affiliations sup { color: var(--accent); }
.venue {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 24px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #111;
  color: #fff !important;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn svg { display: block; }

/* ===================== HERO ===================== */

.hero { margin: 0 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 1fr;
  gap: 5px;
  padding: 6px;
  background: #0b0d10;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.grid-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 3px;
  background: #1a1d22;
  transition: transform .2s ease, box-shadow .2s ease;
}
.grid-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform .35s ease;
}
.grid-tile:hover {
  transform: scale(1.06);
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.grid-tile:hover img { transform: scale(1.04); }

.hero-caption {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

/* ===================== SECTIONS ===================== */

.section {
  margin: 0 0 64px;
}
.section h2 {
  font-size: 26px;
  margin: 0 0 18px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--fg);
  display: inline-block;
}
.section h3 {
  font-size: 22px;
  margin: 40px 0 12px;
  color: var(--accent);
}

.abstract {
  font-size: 17px;
  line-height: 1.8;
  color: #2a2f36;
}

figure {
  margin: 56px auto;
  text-align: center;
}
figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
}
figcaption + p, figure + p { margin-top: 28px; }
p + figure { margin-top: 56px; }
/* Size tiers: default is comfortably smaller than the page width
   so paper figures don't feel like they dominate the column. */
figure           { --fig-w: 720px; }
figure.wide      { --fig-w: 880px; }   /* pipeline / banner diagrams */
figure.narrow    { --fig-w: 520px; }   /* small diagrams */
figure.portrait  { --fig-w: 440px; }   /* tall / portrait figures */
figure img { max-width: min(100%, var(--fig-w)); }
figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.two-col figure { margin: 0; }

/* ===================== SITES GRID ===================== */

.sites-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 24px;
}
.gallery-card .site-head { gap: 10px; }
.origin-link {
  margin-left: auto;
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.origin-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.site-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.site-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.site-head h3 {
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 20px;
  color: #111;
}
.domain-badge {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.compare-col { position: relative; }
.compare-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.compare-label.clone { color: var(--accent); }
.compare-col img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
}
.placeholder-shot {
  width: 100%;
  aspect-ratio: 16/10;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  background: #fafbfc;
}
.site-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--muted);
}
.link { font-weight: 500; }

/* ===================== TASK BROWSER ===================== */

.task-browser {
  margin-top: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.task-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #f5f6f7;
  overflow-x: auto;
}
.task-tab {
  flex: 1;
  min-width: 110px;
  padding: 12px 18px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.task-tab:hover { color: var(--fg); background: #eef0f2; }
.task-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--card-bg);
}

.task-stage { padding: 26px 24px 22px; }
.task-quote {
  margin: 0 0 18px;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 20px;
  line-height: 1.55;
  color: #111;
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 18px;
  min-height: 64px;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.difficulty-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
}
.difficulty-badge[data-d="easy"]   { color: var(--easy);   background: var(--easy-bg); }
.difficulty-badge[data-d="medium"] { color: var(--medium); background: var(--medium-bg); }
.difficulty-badge[data-d="hard"]   { color: var(--hard);   background: var(--hard-bg); }
.task-counter { font-size: 13px; color: var(--muted); }
.task-controls { display: flex; gap: 8px; justify-content: flex-end; }
.task-btn {
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.task-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ===================== RESULTS TABLES ===================== */

.results-table {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 14.5px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.results-table caption {
  caption-side: bottom;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.results-table th,
.results-table td {
  padding: 9px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.results-table thead th {
  background: #f5f6f7;
  color: #111;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--fg);
}
.results-table tbody th {
  text-align: left;
  font-weight: 500;
  color: #2a2f36;
}
.results-table .text-l { text-align: left; }
.results-table td {
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 13.5px;
  color: #1f2328;
  font-variant-numeric: tabular-nums;
}
.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td { border-bottom: 0; }

/* Section divider rows (e.g. "Backbone: Qwen3-4B") */
.results-table tr.row-group th {
  background: #fafbfc;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px 8px;
  border-top: 1px solid var(--border);
}

/* Highlight VeriEnv (our) rows */
.results-table tr.is-ours {
  background: var(--accent-soft);
}
.results-table tr.is-ours th,
.results-table tr.is-ours td {
  color: var(--accent);
  font-weight: 600;
}

/* Indented sub-rows in Table 3 */
.results-table th.indent { padding-left: 32px; font-weight: 400; color: var(--muted); }

/* Δ column coloring */
.results-table .delta-pos { color: var(--easy);   font-weight: 600; }
.results-table .delta-neg { color: var(--hard);   font-weight: 600; }

/* Check / cross marks in comparison table */
.results-table .ok { color: var(--easy); font-size: 16px; font-weight: 700; }
.results-table .no { color: #b3b8c0;     font-size: 16px; font-weight: 700; }

/* Two side-by-side small tables (Tables 2 + 3) */
.two-col-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 32px 0 8px;
}
.two-col-tables figure { margin: 0; }
.two-col-tables .results-table { font-size: 14px; }

/* Smaller padding when tables get narrow */
@media (max-width: 720px) {
  .two-col-tables { grid-template-columns: 1fr; }
  .results-table th, .results-table td { padding: 7px 8px; font-size: 13px; }
  .results-table.benchmark { font-size: 12.5px; }
  .results-table.benchmark th, .results-table.benchmark td { padding: 6px 5px; }
}

/* ===================== BIBTEX ===================== */

.bibtex {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 20px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  box-shadow: var(--shadow);
  white-space: pre;
}
.bibtex code { background: transparent; color: inherit; padding: 0; }
.copy-btn {
  margin-top: 10px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}
.copy-btn:hover { background: var(--accent); color: #fff; }

/* ===================== FOOTER ===================== */

.page-footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.page-footer p { margin: 6px 0; }
.page-footer .muted { font-size: 12.5px; opacity: .85; }

/* ===================== RESPONSIVE ===================== */

@media (max-width: 720px) {
  .paper-title { font-size: 26px; }
  .authors { font-size: 16px; }
  .authors .author, .affiliations span { display: inline-block; margin: 2px 8px; }
  .compare { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  main { padding: 36px 18px 64px; }
  figure.narrow img { max-width: 100%; }
  .task-quote { font-size: 17px; }
  .hero-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 720px) and (max-width: 1100px) {
  .hero-grid { grid-template-columns: repeat(6, 1fr); }
}
