/* InSync project page.
 * Palette: off-white page, near-black ink, warm neutral rules, one accent (the orange of the paper's figures).
 * One light theme: surfaces are the warm off-whites below, never dark. Text on any surface keeps 4.5:1 or more.
 */

:root {
  color-scheme: light;

  --bg: #F4F3EF;
  --surface: #FBFAF7;
  --card: #FFFFFF;
  --ink: #1B1A17;
  --ink-soft: #4A463F;
  --muted: #6E6960;
  --faint: #9A958A;
  --rule: #E3E0D7;
  --rule-strong: #D3CFC4;

  --accent: #E66B2D;
  --accent-ink: #B4470F;
  --accent-wash: #FBE9DC;

  --hero: #121315;
  --hero-ink: #F3F1EC;
  --hero-muted: #A7A297;
  --hero-accent: #F2853F;
  --hero-bad: #EC5B52;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --face-display: "Outfit", "Avenir Next", "Century Gothic", "Segoe UI", system-ui, sans-serif;

  --col-text: 58rem;
  --col-wide: 58rem;
  --radius: 14px;
}

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

[hidden] { display: none !important; }

/* Without JavaScript the drawn parts are absent: hide their empty frames and labels. */
.no-js .sync, .no-js .gains, .no-js .gains-note, .no-js .tiles { display: none; }
.no-js .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.chart-fallback { margin: 0; font-size: 0.9rem; color: var(--muted); }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }

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

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50; padding: 8px 14px; border-radius: 8px;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-strong); text-decoration: none; font-size: 0.9rem;
}
.skip:focus { top: 12px; color: var(--ink); box-shadow: 0 12px 28px -16px rgba(27, 26, 23, 0.45); }

/* ------------------------------------------------------------------ top bar */

.topbar { position: relative; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: auto; }
.brand span { font-family: var(--face-display); font-weight: 400; font-size: 1.45rem; letter-spacing: 0.005em; color: var(--ink); }

.topnav { display: flex; gap: 28px; }
.topnav a { font-size: 0.95rem; color: var(--ink-soft); text-decoration: none; }
.topnav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

.contents-menu { display: none; }

/* --------------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  color: var(--hero-ink);
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(230, 107, 45, 0.20), transparent 62%),
    radial-gradient(700px 500px at -5% 110%, rgba(230, 107, 45, 0.08), transparent 60%),
    linear-gradient(180deg, #17181B 0%, var(--hero) 100%);
  box-shadow: 0 30px 60px -40px rgba(27, 26, 23, 0.55);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 56px;
  padding: 56px;
  min-height: 600px;
}

.hero-text { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-width: 0; }

.eyebrow {
  margin: 0; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--hero-muted);
}
.eyebrow b { color: var(--hero-accent); font-weight: 500; }

.hero h1 { margin: 0; font-family: var(--face-display); font-weight: 300; letter-spacing: -0.012em; }
.hero h1 .name { display: block; font-size: clamp(3.4rem, 6.2vw, 5.4rem); line-height: 1; margin-bottom: 0.26em; }
.hero h1 .name i { font-style: normal; color: var(--hero-accent); }
.hero h1 .rest { display: block; font-size: clamp(1.55rem, 2.55vw, 2.2rem); line-height: 1.18; color: #E9E6DF; }

.pitch { margin: 1.5rem 0 0; max-width: 31rem; font-size: 1.02rem; line-height: 1.6; color: var(--hero-muted); }
.pitch strong { color: var(--hero-ink); font-weight: 500; }

/* The hero illustration */

.sync { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-width: 0; }

.sync-head, .sync-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--hero-muted);
}
.sync-keys { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sync-key { display: inline-flex; align-items: center; gap: 8px; }
.sync-key i { display: inline-block; width: 22px; height: 0; border-top: 2.5px solid var(--hero-ink); border-radius: 2px; }
.sync-key.p i { border-top-color: var(--hero-accent); }

.lane {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 16px;
  padding: 14px 16px 12px;
}
.lane-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.lane-name { margin: 0; font-weight: 600; font-size: 0.98rem; color: var(--hero-ink); }
.lane.in .lane-name { color: var(--hero-accent); }
.lane-sub { margin: 0; font-size: 0.82rem; color: var(--hero-muted); }
.lane svg { display: block; width: 100%; height: auto; overflow: visible; }

.lane-say {
  margin: 6px 0 0; min-height: 3em; font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; color: var(--hero-ink);
}
.lane-say .t { color: var(--hero-muted); margin-right: 10px; }
.lane-say .st { display: block; color: var(--hero-muted); }
.lane-say .st.bad { color: var(--hero-bad); }
.lane-say .st.ok b { color: var(--hero-accent); font-weight: 500; }
.lane-say .st.bad b { font-weight: 500; }

.lane .seg { opacity: 0; transition: opacity 0.5s ease; }
.lane .seg.on { opacity: 1; }
.lane .cursor { transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.4s ease; }
.lane .hit { cursor: pointer; }

.sync-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; color: var(--hero-muted); background: transparent; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; padding: 4px 12px 4px 10px;
}
.sync-btn:hover { color: var(--hero-ink); border-color: rgba(255, 255, 255, 0.34); }
.sync-btn svg { width: 10px; height: 10px; }

/* ------------------------------------------------------------------- byline */

.byline { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px 48px; padding: 30px 0 0; }
.authors { margin: 0; font-size: 1.02rem; line-height: 1.65; max-width: 46rem; }
.authors sup, .affiliations sup { font-size: 0.68em; line-height: 0; margin-left: 1px; }
.authors span { white-space: nowrap; }
.affiliations { margin: 6px 0 0; font-size: 0.9rem; color: var(--muted); }
.affiliations span { margin-right: 16px; white-space: nowrap; }
.affiliations.marks span { margin-right: 18px; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; flex: none; padding-top: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 20px 0 17px; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.pill:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.pill.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.pill.primary:hover { background: #DB6226; border-color: #DB6226; color: var(--ink); }
.pill.soon, .pill.soon:hover { cursor: default; transform: none; background: var(--accent); border-color: var(--accent); }
.pill svg { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 0 64px;
  padding-top: 104px;
  padding-bottom: 96px;
}

.toc { position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; padding-bottom: 8px; }
.toc-title { margin: 0 0 14px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule-strong); }
.toc a {
  display: grid; grid-template-columns: 1.35rem 1fr; gap: 0; padding: 5px 0 5px 14px; margin-left: -1px;
  border-left: 1px solid transparent; font-size: 0.875rem; line-height: 1.35; color: var(--ink-soft); text-decoration: none;
}
.toc a:hover { color: var(--ink); }
.toc a .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a.plain { grid-template-columns: 1fr; }
.toc li.sub a { grid-template-columns: 1fr; padding-left: calc(14px + 1.35rem); font-size: 0.83rem; color: var(--muted); }
.toc a[aria-current="true"] { color: var(--ink); font-weight: 500; border-left-color: var(--accent); }
.toc a[aria-current="true"] .n { color: var(--accent-ink); }

/* ------------------------------------------------------------------ article */

.article { min-width: 0; max-width: var(--col-wide); }
.article > section + section { margin-top: 96px; }
.article > section.tight { margin-top: 72px; }

.article p, .article ul, .article ol, .article h2, .article h3, .article .eq { max-width: var(--col-text); }
.article p { margin: 0 0 1.15em; }
.article strong { font-weight: 600; }

.article h2 { margin: 0 0 0.85em; font-size: 1.75rem; line-height: 1.22; font-weight: 600; letter-spacing: -0.012em; text-wrap: balance; }
.article h2 .num { color: var(--accent-ink); margin-right: 0.22em; font-variant-numeric: tabular-nums; }
.article h3 { margin: 2.6em 0 0.7em; font-size: 1.2rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }

.article ul { margin: 0 0 1.15em; padding-left: 1.15em; }
.article li { margin-bottom: 0.45em; }
.article li::marker { color: var(--faint); }

sub { font-size: 0.68em; line-height: 0; vertical-align: baseline; position: relative; bottom: -0.3em; }

code, .mono { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code { background: #ECEAE3; border-radius: 5px; padding: 0.12em 0.36em; }

.cite { font-size: 0.72em; color: var(--muted); margin-left: 0.15em; white-space: nowrap; vertical-align: 0.12em; }
.cite a { text-decoration: none; color: inherit; }
.cite a:hover { color: var(--accent-ink); text-decoration: underline; }

.note { margin-top: 10px; font-size: 0.83rem; color: var(--muted); }

/* TL;DR cards */

.gains { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 40px 0 0; }
.gain-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px 20px 16px; color: inherit; text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.gain-card:hover { border-color: var(--rule-strong); color: inherit; transform: translateY(-2px); }
.gain-card h3 { margin: 0; max-width: none; font-size: 1.12rem; font-weight: 500; line-height: 1.3; padding-right: 22px; }
.gain-card .sub { margin: 0; font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.gain-card .arrow { position: absolute; right: 18px; top: 22px; width: 16px; height: 16px; color: var(--faint); }
.gain-card:hover .arrow { color: var(--accent-ink); }
.gain-card .delta { margin: 14px 0 2px; font-family: var(--mono); font-weight: 500; font-size: 1.5rem; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; }
.gain-card .delta small { font-size: 0.72rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.gain-card svg.gain-track { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }

/* Figures */

.fig { margin: 2.3em 0 2.6em; max-width: var(--col-wide); }
.fig-frame { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.fig-frame.narrow { max-width: var(--col-text); }
.fig-frame img { width: 100%; }
.fig-frame a { display: block; cursor: zoom-in; }
.fig-frame a:focus-visible { outline-offset: 4px; }
.fig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fig figcaption, .chart-fig figcaption { margin-top: 14px; max-width: var(--col-text); font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.fig figcaption b, .chart-fig figcaption b { color: var(--ink); font-weight: 600; }
.swipe { display: none; margin: 0 0 8px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* Two checks */

.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 1.6em 0 1.8em; max-width: var(--col-wide); }
.check { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px 18px; }
.check .when { margin: 0 0 6px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.check h4 { margin: 0 0 8px; font-size: 1.06rem; font-weight: 600; line-height: 1.35; }
.check p { margin: 0 0 12px; font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); }
.article .ex { margin: 0; padding: 0; list-style: none; max-width: none; }
.ex li { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: baseline; margin: 0; padding: 9px 0 0; border-top: 1px solid var(--rule); font-size: 0.86rem; line-height: 1.5; }
.ex li + li { margin-top: 9px; }
.ex .k { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ex .v { font-family: var(--mono); font-size: 0.82rem; }
.ex .v.bad { color: #A8261C; }

.eq {
  margin: 1.3em 0 1.5em; padding: 16px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--mono); font-size: 0.92rem; line-height: 1.8; overflow-x: auto;
}
.eq .lhs { color: var(--accent-ink); font-weight: 500; }
.eq .c { color: var(--muted); }

.article .keypoints { list-style: none; padding: 0; margin: 1.3em 0 0; max-width: var(--col-text); }
.keypoints li { margin: 0; padding: 14px 0; border-top: 1px solid var(--rule); }
.keypoints li:last-child { border-bottom: 1px solid var(--rule); }

/* Tables */

.tbl-wrap { overflow-x: auto; max-width: var(--col-wide); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; line-height: 1.45; }
th, td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 500; font-size: 0.8rem; color: var(--muted); border-bottom-color: var(--rule-strong); white-space: nowrap; }
thead th.num { font-family: var(--sans); font-size: 0.8rem; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 0.86rem; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 14px; white-space: nowrap; }
tr.group-head th { padding-top: 16px; font-weight: 500; font-size: 0.78rem; color: var(--muted); font-style: italic; }
tr.muted td { color: var(--muted); }
tr.is-insync td { font-weight: 600; background: var(--accent-wash); }
tr.is-insync td:first-child { padding-left: 10px; box-shadow: inset 3px 0 0 var(--accent); }
tr.is-insync td.num:last-child { padding-right: 8px; }
table.rules td { font-size: 0.88rem; padding-top: 11px; padding-bottom: 11px; }
table.rules td:first-child { font-weight: 600; white-space: nowrap; }
table.rules .tags { display: flex; flex-wrap: wrap; gap: 6px; }
table.rules .tags span { font-family: var(--mono); font-size: 0.75rem; background: #ECEAE3; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }

/* Charts */

.chart-fig { margin: 2.3em 0 2.6em; max-width: var(--col-wide); }
.chart-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px 14px; }
.chart-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 14px; }
.article .legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; max-width: none; list-style: none; font-size: 0.82rem; color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .ref i { width: 18px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--ink-soft); }
.chart-note { font-size: 0.78rem; color: var(--muted); }

.panels { display: grid; gap: 22px 36px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.panels.single, .panels.rows { grid-template-columns: minmax(0, 1fr); }
.chart-card.narrow { max-width: var(--col-text); }
.chart-card-next { margin-top: 16px; }
.panel .panel-title { margin: 0; font-size: 0.98rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.panel .dir { margin: 1px 0 6px; font-size: 0.8rem; color: var(--muted); }
.panel svg { display: block; width: 100%; height: auto; overflow: visible; }
.panel svg text { font-family: var(--mono); }
.panel svg .xl { font-family: var(--sans); }
.panel svg .bar { transition: opacity 0.12s ease; }
.panel svg.hovering .bar:not(.hot) { opacity: 0.45; }

.chart-card details { margin-top: 12px; border-top: 1px solid var(--rule); }
.chart-card summary {
  position: relative; display: block; width: max-content; max-width: 100%; cursor: pointer;
  padding: 10px 0 2px 19px; font-size: 0.82rem; color: var(--muted);
}
.chart-card summary::marker { content: ""; }
.chart-card summary::-webkit-details-marker { display: none; }
.chart-card summary svg { position: absolute; left: 0; top: calc(10px + 0.85em - 5.5px); width: 11px; height: 11px; }
.chart-card summary svg .v { transform-origin: 50% 50%; transition: transform 0.18s ease; }
.chart-card details[open] summary svg .v { transform: scaleY(0); }
.chart-card summary:hover { color: var(--ink); }
.chart-card details .tbl-wrap { padding: 6px 0 8px; max-width: 40rem; }

.chart-tip {
  position: fixed; left: var(--tip-x, 0); top: var(--tip-y, 0); z-index: 60; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 12px));
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 8px; padding: 5px 9px;
  font-size: 0.78rem; line-height: 1.35; white-space: nowrap; box-shadow: 0 10px 24px -14px rgba(27, 26, 23, 0.5);
  transition: opacity 0.1s ease;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-family: var(--mono); font-weight: 500; }

/* Efficiency tiles */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 1.6em 0 0; max-width: var(--col-wide); border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.tile { padding: 18px 18px 16px 0; }
.tile + .tile { padding-left: 18px; border-left: 1px solid var(--rule); }
.tile .v { margin: 0; max-width: none; font-family: var(--mono); font-weight: 500; font-size: 1.9rem; line-height: 1.1; letter-spacing: -0.03em; }
.tile .w { margin: 6px 0 0; max-width: none; font-size: 0.9rem; font-weight: 600; line-height: 1.35; }
.tile .t { margin: 2px 0 0; max-width: none; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

/* Release */

.repo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 1.4em 0 1.6em; max-width: var(--col-wide); border-top: 1px solid var(--rule-strong); }
.repo div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.repo dt { font-family: var(--mono); font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }
.repo dd { margin: 3px 0 0; font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); }
.repo .res { display: block; margin-top: 3px; font-size: 0.86rem; color: var(--muted); }
dl.repo { padding: 0; }

.callout { max-width: var(--col-text); margin: 1.6em 0 0; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem; line-height: 1.65; }
.callout p:last-child { margin-bottom: 0; }

/* References, BibTeX */

.article .refs { margin: 0; padding-left: 2.1em; max-width: var(--col-text); font-size: 0.88rem; line-height: 1.55; color: var(--ink-soft); }
.refs li { margin-bottom: 0.5em; padding-left: 0.3em; }
.refs li::marker { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.refs li:target { background: var(--accent-wash); box-shadow: 0 0 0 4px var(--accent-wash); border-radius: 2px; }
.refs i { font-style: italic; }

.bibtex-box { position: relative; max-width: var(--col-wide); background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); }
.bibtex-box pre { margin: 0; padding: 23px 23px 21px; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.65; }
.copy-btn {
  position: absolute; top: 11px; right: 11px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-soft); background: var(--card);
  border: 1px solid var(--rule-strong); border-radius: 999px; padding: 5px 13px 5px 11px;
}
.copy-btn:hover { color: var(--ink); border-color: var(--ink); }
.copy-btn svg { width: 13px; height: 13px; }

.ack { font-size: 0.95rem; color: var(--ink-soft); }

/* Footer */

.site-footer { border-top: 1px solid var(--rule-strong); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 26px; padding-bottom: 40px; font-size: 0.85rem; color: var(--muted); }
.site-footer .brand img { width: 24px; }
.site-footer .brand span { font-size: 1.1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 44px; min-height: 0; }
  .hero-text { gap: 28px; }
  .byline { flex-direction: column; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 72px; }
  .toc { display: none; }
  .article { margin: 0 auto; width: 100%; }

  .topbar { position: sticky; top: 0; background: rgba(244, 243, 239, 0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .topbar .wrap { height: 60px; }
  .topnav { gap: 22px; margin-left: auto; margin-right: 22px; }
  .contents-menu { display: block; }
  .contents-menu > summary {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; cursor: pointer; list-style: none;
    border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); font-size: 0.9rem; font-weight: 500;
  }
  .contents-menu > summary::-webkit-details-marker { display: none; }
  .contents-menu > summary svg { width: 15px; height: 15px; }
  .contents-menu nav {
    position: absolute; left: 12px; right: 12px; top: 58px; max-height: calc(100vh - 80px); overflow-y: auto;
    background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 10px 8px;
    box-shadow: 0 24px 48px -24px rgba(27, 26, 23, 0.4);
  }
  .contents-menu ol { list-style: none; margin: 0; padding: 0; }
  .contents-menu a { display: grid; grid-template-columns: 1.5rem 1fr; padding: 9px 12px; border-radius: 8px; font-size: 0.95rem; line-height: 1.35; text-decoration: none; color: var(--ink); }
  .contents-menu a.plain { grid-template-columns: 1fr; }
  .contents-menu a .n { color: var(--accent-ink); }
  .contents-menu li.sub a { grid-template-columns: 1fr; padding-left: calc(12px + 1.5rem); color: var(--muted); font-size: 0.9rem; padding-top: 6px; padding-bottom: 6px; }
  .contents-menu a:hover { background: var(--bg); }
  .contents-menu a[aria-current="true"] { background: var(--accent-wash); font-weight: 500; }
  .contents-menu li.sub a[aria-current="true"] { color: var(--ink); }
  html { scroll-padding-top: 76px; }
}

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(3) { padding-left: 0; border-left: 0; }
  .tile:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 720px) {
  body { font-size: 1rem; line-height: 1.68; }
  .wrap { padding: 0 16px; }
  .brand img { width: 30px; }
  .brand span { font-size: 1.3rem; }
  .topnav { display: none; }
  .no-js .topnav { display: flex; gap: 14px; margin-right: 0; }
  .no-js .topnav a { font-size: 0.86rem; }

  .hero { border-radius: 22px; padding: 28px 18px 18px; gap: 28px; }
  .hero h1 .name { font-size: 3.3rem; }
  .hero h1 .rest { font-size: 1.5rem; }
  .pitch { font-size: 0.98rem; margin-top: 1.1rem; }
  .lane { padding: 12px 12px 10px; border-radius: 14px; }
  .lane-say { min-height: 4.5em; }

  .byline { padding-top: 22px; gap: 20px; }
  .authors { font-size: 0.98rem; }
  .pills { width: 100%; }
  .pill { height: 42px; padding: 0 16px 0 14px; font-size: 0.92rem; }

  .layout { padding-top: 56px; padding-bottom: 64px; }
  .article > section + section { margin-top: 72px; }
  .article h2 { font-size: 1.45rem; }
  .article h3 { font-size: 1.1rem; }

  .gains { grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
  .gain-card { padding: 16px 16px 12px; }
  .gain-card .delta { margin-top: 10px; }

  .checks { grid-template-columns: 1fr; }
  .repo { grid-template-columns: 1fr; }
  .fig-frame { padding: 12px; }
  .fig-frame.wide-img img { width: 760px; max-width: none; }
  .fig-frame.wide-img .swipe { display: block; }
  .chart-card { padding: 16px 14px 10px; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .bibtex-box pre { padding: 51px 15px 17px; font-size: 0.74rem; }
  table.rules thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.rules, table.rules tbody, table.rules tr, table.rules td { display: block; }
  table.rules tr { padding: 14px 0 12px; border-bottom: 1px solid var(--rule); }
  table.rules tr:first-child { border-top: 1px solid var(--rule-strong); }
  table.rules td { border: 0; padding: 0; }
  table.rules td:first-child { white-space: normal; font-size: 0.98rem; }
  table.rules td[data-label]::before { content: attr(data-label); display: block; margin: 10px 0 4px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
  table.rules .tags span { white-space: normal; }
  .fig-frame.wide-img.tall img { width: 920px; }
}

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

@media print {
  .topbar, .toc, .sync-btn, .copy-btn { display: none !important; }
  .layout { display: block; padding-top: 32px; }
  .hero { box-shadow: none; }
}

/* ---- light title block and the demo video (replaces the dark illustrated hero) ---- */
.hero2 { text-align: center; padding: 56px 0 8px; }
.hero2-title { margin: 0; display: inline-flex; align-items: center; gap: 22px; }
.hero2-logo { width: auto; height: clamp(56px, 7vw, 92px); display: inline-block; }
.hero2-name { font-family: var(--face-display); font-weight: 400; font-size: clamp(3.4rem, 7.4vw, 6rem); line-height: 1;
  letter-spacing: 0.005em; background: linear-gradient(90deg, #C2410C 0%, #D3801A 100%); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.hero2-rest { margin: 18px auto 0; max-width: 46rem; font-family: var(--face-display); font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.25; color: var(--ink); }
.byline { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.byline .authors { margin: 0 auto; }
.byline .pills { justify-content: center; }
.byline .authors a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.byline .authors a:hover { text-decoration-color: var(--accent); }
.demo { margin: 34px auto 10px; max-width: var(--col-text); }
.demo-video { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--surface);
  box-shadow: 0 18px 50px rgba(60,40,20,.16), 0 0 0 1px var(--rule); }

/* Figure 4 as an animated chart (static/js/fig4.js); the static image stays as the fallback */
.fig4-chart svg { display: block; width: 100%; height: auto; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.fig4-label { paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; }

/* chart motion (main.js, fig4.js): marks stay hidden until their plot scrolls into view, then play in */
.pre .bar-shape, .pre .bar-val, .pre .gain-fill, .pre .gain-dot, .fig4-wait .fig4-a { opacity: 0; }
.bar-shape { transform-box: fill-box; transform-origin: 50% 100%; }
.gain-fill { transform-box: fill-box; transform-origin: 0 50%; }

/* Comparison videos (static/js/cmp.js): the base planner next to the InSync planner, one tab per task */
.cmp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.cmp-tab { font: inherit; font-size: 0.9rem; line-height: 1.3; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--rule-strong);
  background: var(--card); color: var(--ink-soft); cursor: pointer; }
.cmp-tab:hover { border-color: var(--accent); color: var(--ink); }
.cmp-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.cmp-stage { border-radius: 16px; overflow: hidden; background: #FAF6EE; box-shadow: 0 18px 50px rgba(60,40,20,.12), 0 0 0 1px var(--rule); }
.cmp-video { display: block; width: 100%; height: auto; background: #FAF6EE; }
.cmp .swipe { display: none; }
.no-js .cmp-tabs { display: none; }
.no-js .cmp-video + .cmp-video { margin-top: 14px; }
@media (max-width: 720px) {
  /* a card per screen: the two planners sit side by side in a strip that scrolls sideways */
  .cmp-stage { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cmp-video { width: 200%; max-width: none; }
  .cmp .swipe { display: block; }
}

/* Expandable verifier rules */
.verifier-details { margin: 1.25rem 0; }
.verifier-details > summary { cursor: pointer; font-weight: 600; padding: .65rem 0; }
.verifier-details > summary:hover { color: var(--accent); }
.verifier-details > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Results navigation and grouped benchmarks */
.benchmark + .benchmark { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--rule); }
.article .benchmark > h3 { font-size: 1.45rem; }
.article .benchmark-subheading { margin: 2.6em 0 .7em; font-size: 1.1rem; line-height: 1.3; font-weight: 600; }
