/* PhysAgentGym project page. Colors follow the paper's figures:
   orange = task, blue = agent, green = verifier, purple = results. */
:root {
  --ink: #212529;
  --text: #343a40;
  --muted: #6c757d;
  --line: #dee2e6;
  --paper: #ffffff;
  --tint: #f8f9fa;
  --blue: #1C7ED6;
  --orange: #F08C00;
  --green: #2B8A3E;
  --purple: #7A5BA8;
  --accent: var(--blue);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 17px/1.7 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
sup { font-size: 0.62em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.center { text-align: center; }
.narrow-text { max-width: 760px; margin-left: auto; margin-right: auto; }
.grad { color: var(--blue); }

/* ---------- nav + color stripe ---------- */
.topnav { position: sticky; top: 0; z-index: 50; background: #fff; }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { font: 700 1.15rem 'IBM Plex Mono', monospace; color: var(--ink); }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[href="#method"]:hover { color: var(--blue); }
.nav-links a[href="#results"]:hover { color: var(--purple); }
.nav-links a[href="#audit"]:hover { color: var(--green); }
.nav-links a[href="#harder"]:hover { color: var(--orange); }
.nav-cite { color: var(--ink) !important; font-weight: 600 !important; }
.stripe { display: grid; grid-template-columns: repeat(4, 1fr); height: 4px; position: sticky; top: 56px; z-index: 49; }
.stripe i:nth-child(1) { background: var(--orange); }
.stripe i:nth-child(2) { background: var(--blue); }
.stripe i:nth-child(3) { background: var(--green); }
.stripe i:nth-child(4) { background: var(--purple); }

/* ---------- hero on graph paper ---------- */
.hero {
  padding: 56px 0 60px; text-align: center; border-bottom: 1px solid var(--line);
  background-color: #fcfcfd;
  background-image:
    linear-gradient(rgba(28, 126, 214, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 126, 214, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.venue {
  display: inline-block; margin: 0 0 20px; padding: 4px 12px; border-radius: 4px;
  border: 1.5px solid var(--purple); color: var(--purple); background: #fff;
  font: 600 0.82rem 'IBM Plex Mono', monospace; letter-spacing: 0.04em;
}
.title { margin: 0 auto 26px; max-width: 940px; font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.15; }
.authors { margin: 0; font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; color: var(--ink); }
.affil { margin: 8px 0 0; display: inline-flex; }
.affil-logo { height: 64px; width: auto; }

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 6px;
  background: #fff; color: var(--ink); border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 1rem; transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn small { font-weight: 400; color: var(--muted); }
.btn.is-soon { border-style: dashed; border-color: #adb5bd; color: var(--muted); pointer-events: none; }
.btn-accent { background: var(--ink); color: #fff; }
.btn-accent:hover { background: var(--blue); border-color: var(--blue); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.figure { margin: 28px 0 0; padding: 18px; }
.figure img { width: 100%; height: auto; }
.figure figcaption { margin-top: 12px; color: var(--muted); font-size: 0.93rem; line-height: 1.6; text-align: left; }
.hero-figure { margin: 0 auto; }

.summary { margin-top: 36px; }
.pitch { max-width: 700px; margin: 0 auto 24px; font-size: 1.1rem; line-height: 1.6; }
.pitch em { font-style: normal; font-weight: 600; color: var(--green); }
.stats { display: grid; gap: 12px; max-width: 940px; margin: 0 auto; text-align: left; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--blue)); border-radius: 6px; }
.stat:nth-child(1) { --c: var(--orange); }
.stat:nth-child(2) { --c: var(--blue); }
.stat:nth-child(3) { --c: var(--green); }
.stat:nth-child(4) { --c: var(--purple); }
.stat-num { font: 700 1.3rem/1.25 'IBM Plex Mono', monospace; color: var(--ink); }
.stat-num .grad, .stat-num.grad { color: var(--c); }
.stat-label { margin-top: 4px; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }

/* ---------- sections, one accent color each ---------- */
.section { padding: 76px 0; }
.section.alt { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#abstract, #takeaways { --accent: var(--ink); }
#method { --accent: var(--blue); }
#results { --accent: var(--purple); }
#audit { --accent: var(--green); }
#harder { --accent: var(--orange); }
.kicker {
  display: inline-block; margin: 0 0 10px; padding: 2px 10px; border-radius: 4px;
  background: var(--accent); color: #fff; font: 600 0.78rem 'IBM Plex Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase;
}
.kicker.center { display: table; margin-left: auto; margin-right: auto; }
h2 { margin: 0 0 16px; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.lead { font-size: 1.07rem; }
.abstract p { margin: 0; text-align: justify; hyphens: auto; }

.steps { display: grid; gap: 16px; margin-top: 26px; }
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); border-top: 4px solid var(--c); }
.step-card p { margin: 0; font-size: 0.93rem; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; margin-bottom: 10px; display: grid; place-items: center;
  background: var(--c); color: #fff; font: 700 0.9rem 'IBM Plex Mono', monospace;
}
.c-orange { --c: var(--orange); } .c-blue { --c: var(--blue); }
.c-green { --c: var(--green); }   .c-purple { --c: var(--purple); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 4px; background: #fff; border: 1px solid var(--line); font-size: 0.9rem; color: var(--ink); }
.chip i { color: var(--accent); }

/* ---------- tables ---------- */
.tables { margin-top: 26px; }
.table-wrapper { overflow-x: auto; }
.results-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 7px 10px; text-align: center; white-space: nowrap; border-bottom: 1px solid #f1f3f5; }
.results-table th:first-child, .results-table td:first-child { text-align: left; }
.results-table thead th { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
.results-table .group-row td { font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 14px; }
.results-table .ours-row td { background: rgba(43, 138, 62, 0.09); }
.results-table .ours-row td:first-child { box-shadow: inset 3px 0 0 var(--green); font-weight: 600; }
.fine { margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- cards ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.mini-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.mini-card p { margin: 0; font-size: 0.94rem; }
#results .mini-card, #harder .mini-card { border-top: 3px solid var(--accent); }
.audit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.audit .mini-card { border-top: 4px solid var(--c); }
.mini-card .big { margin: 0 0 6px; font: 700 2rem/1.1 'IBM Plex Mono', monospace; color: var(--c); }
.callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; padding: 16px 20px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); }
.callout i { color: var(--green); margin-top: 6px; }
.callout p { margin: 0; color: var(--ink); }

.takeaways { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: tk; }
.takeaways li { position: relative; padding: 12px 0 12px 40px; border-top: 1px solid var(--line); counter-increment: tk; }
.takeaways li::before {
  content: counter(tk); position: absolute; left: 0; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font: 700 0.85rem 'IBM Plex Mono', monospace; background: var(--orange);
}
.takeaways li:nth-child(2)::before { background: var(--blue); }
.takeaways li:nth-child(3)::before { background: var(--green); }
.takeaways li:nth-child(4)::before { background: var(--purple); }

/* ---------- citation + footer ---------- */
.cite { padding: 56px 0; border-top: 1px solid var(--line); }
.cite-title { font-size: 1.3rem; margin-bottom: 12px; }
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 20px 22px; overflow-x: auto; border-radius: var(--radius);
  background: var(--tint); border: 1px solid var(--line); border-left: 4px solid var(--purple);
  color: var(--ink); font: 0.86rem/1.6 'IBM Plex Mono', monospace;
}
.copy {
  position: absolute; top: 10px; right: 10px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer;
  padding: 5px 10px; border-radius: 4px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 500 0.8rem 'IBM Plex Sans', sans-serif;
}
.copy:hover { border-color: var(--ink); }
.footer { padding: 28px 24px 36px; text-align: center; color: var(--muted); font-size: 0.86rem; background: var(--tint); border-top: 1px solid var(--line); }
.footer-logo { height: 38px; width: auto; margin: 0 auto 10px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .nav-links { gap: 16px; }
  .stats.four { grid-template-columns: repeat(2, 1fr); }
  .steps.four, .grid3, .audit { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 56px 0; }
  .wrap { padding: 0 16px; }
  .btn { padding: 9px 16px; }
  .stat-label br { display: none; }
  .abstract p { text-align: left; }
}
@media (max-width: 520px) {
  .nav-links a:not(.nav-cite) { display: none; }
}
