/* Heterra site. Colours are tokens; dark mode redefines them. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f3;
  --text: #2e2d29;
  --heading: #1a1a1a;
  --muted: #66655f;
  --line: #e2e1dc;
  --accent: #2563c9;
  --accent-text: #ffffff;
  --shadow: 0 12px 40px rgba(26, 26, 26, 0.14);
  --heterogeneity: #c96200;
  --pattern: #2f6fa6;
  --prediction: #2f8a2d;
  --evaluation: #8a4495;
  --data: #94502a;
  --serif: "Fraunces", Georgia, "Times New Roman", "Songti SC", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a;
    --bg-soft: #202124;
    --text: #dcdcd7;
    --heading: #f4f4f0;
    --muted: #a3a29c;
    --line: #35363a;
    --accent: #6ea1f2;
    --accent-text: #10141c;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --heterogeneity: #f09a45;
    --pattern: #74aede;
    --prediction: #72c56f;
    --evaluation: #c58cd0;
    --data: #cf9169;
  }
}
:root[data-theme="dark"] {
  --bg: #17181a;
  --bg-soft: #202124;
  --text: #dcdcd7;
  --heading: #f4f4f0;
  --muted: #a3a29c;
  --line: #35363a;
  --accent: #6ea1f2;
  --accent-text: #10141c;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --heterogeneity: #f09a45;
  --pattern: #74aede;
  --prediction: #72c56f;
  --evaluation: #c58cd0;
  --data: #cf9169;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* one language at a time; without scripts English shows */
html[data-lang="en"] [lang="zh"], html[data-lang="zh"] [lang="en"] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--heading); font: 600 19px var(--serif); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.top nav { display: flex; gap: 20px; margin-left: auto; font-size: 15px; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--heading); text-decoration: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.lang button {
  border: 0; background: none; color: var(--muted);
  font: 500 13px var(--sans); padding: 3px 9px; cursor: pointer;
}
html[data-lang="en"] .lang button[data-set="en"],
html[data-lang="zh"] .lang button[data-set="zh"] { background: var(--bg-soft); color: var(--heading); }

/* first screen */
.hero { padding: 64px 0 56px; text-align: center; }
/* the name and the title share one size; the title fits one line on a wide screen */
.hero-name, h1 {
  color: var(--heading);
  font: 600 clamp(26px, 3.7vw, 38px)/1.2 var(--serif);
  letter-spacing: -0.015em;
}
.hero-name { display: flex; justify-content: center; align-items: center; gap: 0.3em; margin: 0 0 10px; }
.hero-name img { width: 1.25em; height: 1.25em; }
h1 { margin: 0 auto 16px; white-space: nowrap; }
.lead { margin: 0 auto 28px; max-width: 640px; font-size: 19px; color: var(--muted); }
.button {
  display: inline-block; padding: 11px 26px; border-radius: 8px;
  background: var(--accent); color: var(--accent-text);
  font-weight: 600; font-size: 16px;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.off { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); cursor: default; }
.button.off:hover { filter: none; }
.small { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.shot { border-radius: 10px; box-shadow: var(--shadow); }
.hero .shot { margin-top: 48px; width: 100%; }

/* sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
h2 { margin: 0 0 28px; color: var(--heading); font: 600 28px/1.25 var(--serif); letter-spacing: -0.01em; }
h3 { margin: 0 0 6px; color: var(--heading); font: 600 17px/1.35 var(--sans); }
p { margin: 0; }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.three p { color: var(--muted); font-size: 16px; }

.split { display: grid; grid-template-columns: 5fr 7fr; gap: 44px; align-items: center; }
.split ul { margin: 0; padding: 0; list-style: none; }
.split li { margin-bottom: 18px; }
.split li p { color: var(--muted); font-size: 16px; }
.split li:last-child { margin-bottom: 0; }

/* methods */
.group { margin-bottom: 30px; }
.group:last-child { margin-bottom: 0; }
.group-name { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.heterogeneity { color: var(--heterogeneity); }
.pattern { color: var(--pattern); }
.prediction { color: var(--prediction); }
.evaluation { color: var(--evaluation); }
.data { color: var(--data); }
.method {
  display: grid; grid-template-columns: 70px 1fr 190px; gap: 16px;
  padding: 13px 0; border-top: 1px solid var(--line);
  align-items: baseline;
}
.method abbr { color: var(--heading); font-weight: 600; text-decoration: none; }
.method strong { display: block; color: var(--heading); font-weight: 600; }
.method span.about { display: block; color: var(--muted); font-size: 16px; }
.method .papers { font-size: 14px; line-height: 1.5; }
.tools { padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }

/* download */
.download { display: grid; grid-template-columns: 5fr 7fr; gap: 44px; }
.notes { margin: 0; padding: 0; list-style: none; }
.notes li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.notes li:first-child { padding-top: 0; border-top: 0; }
.notes b { color: var(--heading); font-weight: 600; }

/* cite and footer */
.cite { padding: 16px 18px; background: var(--bg-soft); border-radius: 8px; font-size: 16px; overflow-wrap: anywhere; }
.after-cite { margin-top: 14px; color: var(--muted); font-size: 16px; }
footer { padding: 32px 0 44px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
footer p + p { margin-top: 6px; }

@media (max-width: 820px) {
  body { font-size: 16px; }
  .top nav { display: none; }
  .lang { margin-left: auto; }
  .hero { padding: 40px 0 36px; }
  h1 { white-space: normal; }
  .hero .shot { margin-top: 32px; }
  section { padding: 40px 0; }
  .wrap { padding: 0 16px; }
  .three, .split, .download { grid-template-columns: 1fr; gap: 26px; }
  .method { grid-template-columns: 56px 1fr; gap: 4px 10px; }
  .method .papers { grid-column: 2; }
}
