/* SHARP project page
   Palette follows the paper's figures: fine / medium / coarse voxels
   (Okabe-Ito pink, amber, sky blue) and the purple used to mark SHARP. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/inter-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }

:root {
  --ink: #1f2328;
  --ink-2: #3d444d;
  --muted: #656d76;
  --faint: #8c959f;
  --line: #e3e6ea;
  --line-strong: #d0d5db;
  --panel: #f6f7f9;
  --bg: #ffffff;

  --link: #1976d2;
  --link-hover: #0f5cb0;

  --accent: #4527a0;
  --accent-hover: #5b3cc4;
  --accent-soft: #f4f1fc;

  --fine: #cc79a7;
  --medium: #e69f00;
  --coarse: #56b4e9;
  --good: #1a7f37;
  --bad: #d62728;

  /* One column: text, figures, tables and video all share the same width and edges. */
  --wide: 880px;
  --text: 880px;
  --gutter: 24px;
  --radius: 12px;
  --nav-h: 56px;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(25, 118, 210, .35); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

p { margin: 0 0 1.1em; text-wrap: pretty; }
em { font-style: italic; }
strong, b { font-weight: 600; }
sub { font-size: .72em; line-height: 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 8px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 500; font-size: 15px;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ───────────── Layout ───────────── */

.wrap { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--text); margin-left: auto; margin-right: auto; }
.wrap.narrow { max-width: calc(var(--text) + 2 * var(--gutter)); }

.section { padding: 72px 0 0; scroll-margin-top: calc(var(--nav-h) - 24px); }
.section:last-of-type { padding-bottom: 88px; }

h2 {
  margin: 0 0 18px;
  font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em;
  text-wrap: balance;
}
h3 { margin: 0 0 8px; font-size: 1.0625rem; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; }

.subhead {
  margin: 64px 0 12px;
  font-size: 1.25rem; font-weight: 600; letter-spacing: -.012em;
}

.lead { font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); margin-bottom: 28px; }

/* ───────────── Navigation ───────────── */

/* Hidden on the first screen; slides in once the title block has scrolled away. */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.nav.is-visible { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }

.nav-inner {
  height: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.brand {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: .01em;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 22px; height: 22px; flex: none; }

.nav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 6px 11px; border-radius: 8px; white-space: nowrap;
  color: var(--muted); text-decoration: none; font-size: .9375rem; font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); }
.nav-links a.is-current { color: var(--ink); }

/* ───────────── Title block ───────────── */

.hero { padding: 60px 0 40px; text-align: center; }

.title { margin: 0 auto 24px; font-weight: 700; }
.title-name {
  display: block;
  font-size: clamp(3rem, 11vw, 4.5rem); line-height: 1; letter-spacing: -.035em;
}
.title-sub {
  display: block; margin-top: 12px;
  font-size: clamp(1.25rem, 4.6vw, 2rem); line-height: 1.2; font-weight: 600; letter-spacing: -.02em;
  text-wrap: balance;
}

.authors { margin: 0 auto; max-width: 940px; font-size: 1.25rem; line-height: 1.6; text-wrap: balance; }
.author { white-space: nowrap; }
.author .name, .author a { color: var(--link); text-decoration: none; }
.author a:hover { color: var(--link-hover); text-decoration: underline; }
.author sup, .equal sup { font-size: .68em; line-height: 0; margin-left: 1px; }

.affiliation { margin: 2px 0 0; font-size: 1.25rem; line-height: 1.6; color: var(--ink-2); }
.equal { margin: 4px 0 0; font-size: .9375rem; color: var(--muted); }
.venue { margin: 8px 0 0; font-size: 1.125rem; font-weight: 600; color: var(--ink-2); }

.actions { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: #363636; color: #fff;
  font: inherit; font-size: 1rem; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn svg.logo-color { width: 21px; height: 19.5px; margin: 0 -1px; }
/* Brand marks keep their own colours on the grey "soon" pills and turn white on dark pills. */
.btn .logo-arxiv, .btn .logo-github { color: #fff; }
.btn.is-pending .logo-arxiv { color: #b31b1b; }
.btn.is-pending .logo-github { color: #181717; }
.btn svg.logo-arxiv { width: 18px; height: 18px; }
.btn:hover { background: #1f2328; color: #fff; }
.btn.is-pending { background: #e3e6ea; color: #57606a; cursor: default; }
.btn.is-pending:hover { background: #e3e6ea; color: #57606a; }
.btn .tag {
  margin-left: 1px; padding: 3px 7px; border-radius: 999px;
  background: #fff; color: #57606a;
  font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}

/* ───────────── Figures ───────────── */

.figure { margin: 0; }
.figure + .figure, .table-figure + .figure, .figure + .table-figure { margin-top: 48px; }
.figure > a { display: block; border-radius: var(--radius); }
.figure img { width: 100%; border-radius: 6px; }

figcaption {
  max-width: var(--text); margin: 16px auto 0;
  font-size: .9375rem; line-height: 1.6; color: var(--muted);
}
figcaption strong { color: var(--ink); }

.teaser { padding-bottom: 8px; }
.tagline {
  max-width: 820px; margin: 18px auto 0; text-align: center;
  font-size: 1.25rem; line-height: 1.45; color: var(--ink-2); text-wrap: balance;
}

/* ───────────── Abstract ───────────── */

.abstract { margin: 0; color: var(--ink-2); }

/* ───────────── Video ───────────── */

.player {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
  box-shadow: 0 1px 2px rgba(31, 35, 40, .04), 0 12px 32px -12px rgba(31, 35, 40, .14);
}
.player video { width: 100%; aspect-ratio: 16 / 9; background: #fff; }

/* ───────────── Results ───────────── */

/* The main result: one large, centred plot. */
.figure.plot { max-width: 880px; margin: 28px auto 0; }
.figure.plot img { border-radius: 0; }
.figure.plot + .narrow { margin-top: 44px; }
.table-figure.wide + .figure { margin-top: 56px; }

.more { color: var(--muted); }

/* ───────────── Tables ───────────── */

.table-figure { margin: 0; }
.table-figure.wide { max-width: var(--text); margin: 24px auto 0; }
.table-figure.wide + .narrow { margin-top: 40px; }

.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  /* Edge shadows that appear only while there is more table to scroll to. */
  background:
    linear-gradient(to right, #fff 35%, rgba(255, 255, 255, 0)) left center / 36px 100% no-repeat local,
    linear-gradient(to left, #fff 35%, rgba(255, 255, 255, 0)) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(31, 35, 40, .18), rgba(31, 35, 40, 0)) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(31, 35, 40, .18), rgba(31, 35, 40, 0)) right center / 10px 100% no-repeat scroll;
}

table.data {
  width: 100%; border-collapse: collapse;
  font-size: .9375rem; line-height: 1.35; font-variant-numeric: tabular-nums;
}
.data th, .data td { padding: 8px 10px; text-align: right; white-space: nowrap; }
.data thead th {
  font-size: .8125rem; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line-strong); vertical-align: bottom;
}
.data thead tr:first-child th { border-top: 2px solid var(--ink); padding-top: 10px; }
.data tbody th { text-align: left; font-weight: 400; color: var(--ink); }
.data tbody tr + tr > * { border-top: 1px solid var(--line); }
.data tbody tr:last-child > * { border-bottom: 2px solid var(--ink); }
.data thead th.c { white-space: normal; min-width: 4.5em; }
.data .l { text-align: left; }
.data .c { text-align: center; }
.data th:first-child, .data td:first-child { padding-left: 12px; }
.data th:last-child, .data td:last-child { padding-right: 12px; }

.data .over > * { color: var(--faint); }
.data .over .no { color: var(--faint); }
.data .ours > * { background: var(--accent-soft); font-weight: 600; color: var(--ink); }
.data .ours > th { color: var(--accent); }
.data .ref > * { color: var(--muted); }
.data .best { font-weight: 700; color: var(--ink); }
.data .yes { color: var(--good); font-weight: 600; }
.data .no { color: var(--bad); font-weight: 600; }

.data.grouped thead tr:first-child th { border-bottom: 0; padding-bottom: 2px; }
.data.grouped .grp { text-align: center; color: var(--ink); font-size: .875rem; }
.data.grouped .grp .n { color: var(--faint); font-weight: 500; }
.data.grouped thead tr:nth-child(2) th { padding-top: 2px; }
.data.grouped .gs { padding-left: 26px; }

/* ───────────── BibTeX ───────────── */

.bibtex { position: relative; }
.bibtex pre {
  margin: 0; padding: 22px 24px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  font-family: var(--mono); font-size: .84375rem; line-height: 1.7; color: var(--ink);
  tab-size: 2;
}
.bibtex code { font-family: inherit; }
.copy {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink-2); cursor: pointer;
  font: inherit; font-size: .8125rem; font-weight: 500; line-height: 1;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.copy svg { width: 14px; height: 14px; }
.copy:hover { background: var(--panel); border-color: var(--faint); color: var(--ink); }
.copy.is-done { color: var(--good); border-color: rgba(26, 127, 55, .4); }

/* ───────────── Footer ───────────── */

.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; text-align: center; }
.footer p { margin: 0; font-size: .875rem; color: var(--faint); }

/* ───────────── Responsive ───────────── */

@media (max-width: 860px) {
  .btn { padding: 0 15px; }   /* keeps all five buttons on one row on tablets */
}

@media (max-width: 760px) {
  :root { --gutter: 18px; --nav-h: 52px; }
  body { font-size: 16px; }
  .section { padding-top: 56px; }
  .section:last-of-type { padding-bottom: 64px; }
  .hero { padding: 40px 0 28px; }
  .title { margin-bottom: 20px; }
  .title-sub { margin-top: 10px; }
  .authors, .affiliation { font-size: 1.0625rem; }
  .tagline { font-size: 1.0625rem; margin-top: 14px; }
  h2 { font-size: 1.5rem; }
  .subhead { margin-top: 48px; }
  .nav-links a { padding: 6px 8px; font-size: .875rem; }
  .nav-inner { gap: 12px; }
  table.data { font-size: .875rem; }
  .data th, .data td { padding: 7px 7px; }
  .data th:first-child, .data td:first-child { padding-left: 8px; }
  .data th:last-child, .data td:last-child { padding-right: 8px; }
  .data.grouped .gs { padding-left: 18px; }
  .bibtex pre { padding: 52px 16px 18px; font-size: .78125rem; }
  figcaption { font-size: .90625rem; }
}

@media (max-width: 480px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-links { flex: 1; justify-content: space-between; }
  .nav-links a { padding: 6px 6px; }
  .btn { height: 40px; padding: 0 16px; font-size: .9375rem; }
}

@media (max-width: 360px) {
  .actions { gap: 6px; }
  .btn { height: 38px; padding: 0 12px; gap: 6px; font-size: .875rem; }
  .btn .tag { padding: 2px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .nav, .actions, .player, .copy, .skip-link { display: none !important; }
  .section { padding-top: 32px; }
  body { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
  .figure, .table-figure { break-inside: avoid; }
}
