/* MobileLLM-R2 project page: self-contained styles, no external fonts or frameworks. */
:root {
  --text: #1f2328;
  --muted: #59636e;
  --accent: #5b3c9e;
  --accent-soft: #f2edfb;
  --rule: #d8dee4;
  --code-bg: #f6f8fa;
  --max: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

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

.draft-banner {
  background: #fff8c5;
  border-bottom: 1px solid #e3d26f;
  color: #4d3d00;
  font-size: 14px;
  padding: 8px 16px;
  text-align: center;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

header.hero { padding: 48px 0 18px; text-align: center; }

h1.title {
  font-size: 2.35rem;
  line-height: 1.22;
  margin: 0 auto 18px;
  max-width: 900px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1.title .model { color: var(--accent); }

.authors { font-size: 1.12rem; margin: 0 0 6px; }
.authors span { display: inline-block; margin: 0 9px; white-space: nowrap; }
.authors sup, .affiliation sup, .notes sup { font-size: 0.7em; }
.affiliation { font-size: 1.05rem; color: var(--muted); margin: 2px 0 8px; }
.notes { font-size: 0.86rem; color: var(--muted); margin: 0 0 22px; }
.notes span { margin: 0 8px; white-space: nowrap; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #24292f;
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 600;
}
.btn:hover { background: #3b434b; text-decoration: none; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.btn.todo { background: #8c959f; }

section { padding: 26px 0 8px; border-top: 1px solid var(--rule); }
section.first { border-top: 0; }

h2 { font-size: 1.65rem; text-align: center; margin: 4px 0 18px; }
h3 { font-size: 1.22rem; margin: 26px 0 10px; }

p { margin: 0 0 14px; }
p.justify { text-align: justify; hyphens: auto; }

.tldr {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 14px 20px 6px;
  margin: 8px 0 18px;
}
.tldr ul { margin: 0 0 8px; padding-left: 20px; }
.tldr li { margin: 0 0 6px; }

figure { margin: 14px 0 22px; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 4px; }
figure img[src$=".svg"] { width: 100%; }
figure.narrow img { max-width: 72%; }
figure.medium img { max-width: 86%; }
figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: left;
  margin: 8px auto 0;
  max-width: 900px;
}
figcaption b { color: var(--text); }

.table-wrap { overflow-x: auto; margin: 10px 0 6px; }
table { border-collapse: collapse; margin: 0 auto; font-size: 0.92rem; }
th, td { padding: 6px 10px; border-bottom: 1px solid #eaeef2; text-align: center; white-space: nowrap; }
thead th { border-bottom: 2px solid #8c959f; font-weight: 600; vertical-align: bottom; }
tbody tr:last-child td { border-bottom: 2px solid #8c959f; }
td.left, th.left { text-align: left; }
td.cat { color: var(--muted); font-weight: 600; text-align: left; }
tr.group-start td { border-top: 1px solid #afb8c1; }
.ours { background: var(--accent-soft); }
th.ours { color: var(--accent); }
.best { text-decoration: underline; text-underline-offset: 3px; }
.table-caption { font-size: 0.9rem; color: var(--muted); max-width: 900px; margin: 8px auto 22px; }
.table-caption b { color: var(--text); }
th .sub { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; }

.pipeline { display: flex; align-items: stretch; justify-content: center; gap: 6px; margin: 12px 0 8px; }
.stage { border: 2px solid #1f2328; border-radius: 12px; padding: 10px 12px; text-align: left; flex: 1 1 0; min-width: 0; }
.stage h4 { margin: 0 0 4px; font-size: 0.95rem; line-height: 1.25; }
.stage p { margin: 0; font-size: 0.88rem; line-height: 1.45; }
.stage.pre { background: #fde7a6; }
.stage.mid { background: #f3b2a2; }
.stage.post { background: #e2b9cf; }
.arrow { align-self: center; font-size: 1.4rem; color: #57606a; flex: 0 0 auto; }

table.compact { font-size: 0.84rem; }
table.compact th, table.compact td { padding: 5px 7px; }
table.compact thead th { white-space: normal; line-height: 1.3; }
td.wrap { white-space: normal; min-width: 190px; }

.eq {
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.08rem;
  text-align: center;
  margin: 10px 0 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 6px; }
.templates h4 { margin: 0 0 6px; font-size: 0.95rem; text-align: center; }

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 8px 0 16px;
}
.templates pre { font-size: 0.72rem; margin: 0; height: 100%; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.9em; }

footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; padding: 18px 0 40px; text-align: center; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  h1.title { font-size: 1.7rem; }
  .templates { grid-template-columns: 1fr; }
  figure.narrow img, figure.medium img { max-width: 100%; }
  .pipeline { flex-direction: column; }
  .arrow { transform: rotate(90deg); width: 100%; text-align: center; }
  .stage { width: 100%; flex: 0 0 auto; }
}
