/* Written by store/build.py: format/themes/neutral/theme.css, then theme/.store.css. Edit those. */


/* Fallbacks for the palette contract (light). */
:where(:root) {
  --paper: #ffffff; --surface: #f5f5f7; --ink: #1d1d1f; --ink-2: #6e6e73; --rule: #d2d2d7;
  --brand: #0070dc; --brand-2: #74bff8;
  --data-1: #0070dc; --data-2: #d55e00; --data-3: #00916b; --data-4: #c4508f; --data-5: #7b5cc4; --data-6: #3e9fe0;
  --seq-0: #dcebfb; --seq-1: #a9d0f7; --seq-2: #74bff8; --seq-3: #2e8be6; --seq-4: #0057ad;
}
/* Fallbacks (dark), by the reader's setting or by data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) {
    --paper: #000000; --surface: #1c1c1e; --ink: #f5f5f7; --ink-2: #a1a1a6; --rule: #38383a;
    --brand: #74bff8;
    --data-1: #4ba3ff; --data-2: #ff8a3d; --data-3: #2ec49a; --data-4: #ec8cc1; --data-5: #a98bf0; --data-6: #74bff8;
    --seq-0: #12263d; --seq-1: #18406b; --seq-2: #1f62a8; --seq-3: #4a96e6; --seq-4: #9ccbfa;
  }
}
:where(:root[data-theme="dark"]) {
  --paper: #000000; --surface: #1c1c1e; --ink: #f5f5f7; --ink-2: #a1a1a6; --rule: #38383a;
  --brand: #74bff8;
  --data-1: #4ba3ff; --data-2: #ff8a3d; --data-3: #2ec49a; --data-4: #ec8cc1; --data-5: #a98bf0; --data-6: #74bff8;
  --seq-0: #12263d; --seq-1: #18406b; --seq-2: #1f62a8; --seq-3: #4a96e6; --seq-4: #9ccbfa;
}

/* The format's tokens, from the palette's. */
:root {
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--ink-2);
  --accent: var(--brand);
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 41rem;
  --wide: 1000px;
  --card-radius: 24px;
  --card-shadow: none;
  --control-track: color-mix(in srgb, var(--ink) 7%, var(--paper));   /* on the page */
  --control-thumb: var(--paper);
  --panel-control: var(--paper);                                       /* a control on a grey panel */
  --control-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .06);
  /* figures */
  --fig-1: var(--data-1); --fig-2: var(--data-2); --fig-3: var(--data-3);
  --fig-4: var(--data-4); --fig-5: var(--data-5); --fig-6: var(--data-6);
  --fig-seq-0: var(--seq-0); --fig-seq-1: var(--seq-1); --fig-seq-2: var(--seq-2);
  --fig-seq-3: var(--seq-3); --fig-seq-4: var(--seq-4);
  --fig-a: var(--fig-1);
  --fig-b: var(--fig-2);
  --fig-b-edge: var(--fig-2);
  --fig-ink: var(--ink);
  --fig-muted: var(--ink-2);
  --fig-axis: color-mix(in srgb, var(--ink-2) 75%, var(--surface));
  --fig-grid: color-mix(in srgb, var(--ink) 9%, var(--surface));
  --fig-band: color-mix(in srgb, var(--ink) 8%, var(--surface));
  --fig-bg: var(--surface);
  --fig-font: var(--font-text);
  --fig-radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --control-track: color-mix(in srgb, var(--ink) 14%, var(--paper));
    --control-thumb: color-mix(in srgb, var(--ink) 26%, var(--paper));
    --panel-control: color-mix(in srgb, var(--ink) 12%, var(--surface));
    --control-shadow: none;
    --fig-grid: color-mix(in srgb, var(--ink) 12%, var(--surface));
    --fig-band: color-mix(in srgb, var(--ink) 11%, var(--surface));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --control-track: color-mix(in srgb, var(--ink) 14%, var(--paper));
  --control-thumb: color-mix(in srgb, var(--ink) 26%, var(--paper));
  --panel-control: color-mix(in srgb, var(--ink) 12%, var(--surface));
  --control-shadow: none;
  --fig-grid: color-mix(in srgb, var(--ink) 12%, var(--surface));
  --fig-band: color-mix(in srgb, var(--ink) 11%, var(--surface));
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0 16px 96px; background: var(--bg); color: var(--fg); font-family: var(--font-text);
  font-size: 19px; line-height: 1.6; letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
/* Links: --brand on the white page; on a grey figure panel --brand is under 4.5:1, so a link
   there is ink with a brand underline. */
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.figure a { color: var(--fg); text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; border-radius: 8px; z-index: 3; }

/* Header: one large title, quiet lines under it. */
.article-header { padding: 88px 0 28px; }
.article-title { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.06; font-weight: 650; letter-spacing: -.024em;
  margin: 0 0 20px; text-wrap: balance; }
.article-authors { margin: 0 0 4px; font-size: 17px; font-weight: 500; }
.article-authors--pending { color: var(--muted); font-weight: 400; }
.article-meta { margin: 0; color: var(--muted); font-size: 15px; }
.article-status { font-weight: 600; color: var(--fg); }

/* The depth switch: a segmented control on a translucent bar. */
/* The bar's background spans the whole window (a shadow 100vmax wide, clipped to its height), so
   a figure card scrolling under it never shows at its sides. */
.depth-bar { box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--bg) 84%, transparent); clip-path: inset(0 -100vmax);
  background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px); padding: 12px 0; margin-bottom: 8px; }
.depth-switch { border: 0; margin: 0; padding: 0; display: flex; align-items: center; }
.depth-switch legend { float: left; margin-right: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.depth-switch label { position: relative; display: inline-block; cursor: pointer; background: var(--control-track); padding: 3px; }
.depth-switch label:first-of-type { border-radius: 999px 0 0 999px; padding-right: 0; }
.depth-switch label:last-of-type { border-radius: 0 999px 999px 0; padding-left: 0; }
.depth-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.depth-switch span { display: inline-block; padding: 5px 18px; font-size: 15px; font-weight: 500; color: var(--fg); border-radius: 999px; }
.depth-switch input:checked + span { background: var(--control-thumb); color: var(--fg); font-weight: 600; box-shadow: var(--control-shadow); }
.depth-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Text. */
h2 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; font-weight: 650; letter-spacing: -.016em; margin: 76px 0 16px; text-wrap: balance; }
.article-body > h2:first-child { margin-top: 44px; }
h3 { font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -.008em; margin: 40px 0 8px; }
p { margin: 0 0 18px; }
ul, ol { padding-left: 1.3em; margin: 0 0 18px; }
li { margin: 0 0 8px; }
code { font-family: var(--font-mono); font-size: .84em; overflow-wrap: anywhere; }
pre { background: var(--surface); border-radius: 14px; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
pre code { overflow-wrap: normal; font-size: inherit; }
.cite { white-space: nowrap; }

/* Figures and tables: white cards on the grey page. */
.figure { margin-top: 44px; margin-bottom: 44px; background: var(--surface); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow); padding: 28px 28px 22px; }
figcaption { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 18px 0 0; max-width: 78ch; }
figcaption p { margin: 0 0 8px; }
.figure-label, .figure-title { color: var(--fg); }
.figure-label { font-weight: 600; }
.figure-sources, .figure-gap { font-size: 14px; }
.figure-still { margin-bottom: 20px; }
.figure-panel { margin: 0 0 8px; font-weight: 600; color: var(--fg); font-size: 15px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
.figure--table .table-scroll { --bg: var(--surface); }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.fig text { font-variant-numeric: tabular-nums; }

/* Interactive figures: controls inside the card. */
.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.chart-segments { border: 0; padding: 0; }
/* A tall figure keeps its control in view while the reader scrolls through it (below the depth bar). */
.chart-segments { position: sticky; top: 62px; z-index: 1; background: var(--surface); padding: 8px 0; margin-top: -8px; }
.chart-segments legend { float: left; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 6px 0 0; padding: 0; line-height: 34px; }
.chart-segments label { position: relative; display: inline-block; cursor: pointer; }
.chart-segments input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chart-segments span { display: inline-block; min-height: 34px; padding: 6px 14px; font-size: 14px; font-weight: 500; line-height: 22px;
  color: var(--fg); background: var(--panel-control); border-radius: 999px; }
.chart-segments input:checked + span { background: var(--fg); color: var(--surface); font-weight: 600; }
.chart-segments input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-focus { border-radius: 12px; }
.chart-focus:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.chart-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.chart-steps { margin: 0 0 10px; }
.chart-paddle { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--panel-control); color: var(--fg);
  font: inherit; font-size: 22px; line-height: 34px; padding: 0 0 3px; cursor: pointer; }
.chart-paddle:disabled { opacity: .35; cursor: default; }
.chart-paddle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-steps-label { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.chart-readout { font-size: 16px; line-height: 1.5; color: var(--fg); min-height: 3em; margin: 0; }
.chart-more { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 6px 0 0; }
.chart-link { font-size: 15px; font-weight: 500; text-decoration: none; }
.chart-link:hover { text-decoration: underline; }
.chart-card { margin-top: 4px; }
.chart-card[hidden] { display: none; }
.chart-card-title { display: none; }
.chart-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--key); margin-right: 8px; vertical-align: -1px; }
.chart-key--square { border-radius: 2px; }
.chart-key--hollow { background: transparent; box-shadow: inset 0 0 0 2px var(--key); }
.chart-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 24px; margin: 10px 0 16px; }
.chart-facts dt { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.chart-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.chart-bits-title { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.chart-bits { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.chart-bits li { display: grid; grid-template-columns: 11.5rem minmax(60px, 1fr) 15.5rem; align-items: center; gap: 12px; margin: 0; font-size: 14px; }
.chart-bits-name { color: var(--fg); }
.chart-bits-bar { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.chart-bits-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--key); }
.chart-bits-val { color: var(--muted); font-variant-numeric: tabular-nums; }

.repro-source, .repro-commands { font-size: 15px; }
.repro-source-name { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
code.hash { font-size: 12px; overflow-wrap: anywhere; word-break: break-all; }
ol.references { font-size: 15px; }
ol.references li { overflow-wrap: anywhere; }
.article-end { border-top: 1px solid var(--rule); margin-top: 72px; padding-top: 8px; font-size: 15px; }
.article-end h2 { font-size: 19px; margin: 32px 0 8px; }
.change-list { list-style: none; padding: 0; }
.change-kind { font-weight: 600; margin: 0 6px; }
.bibtex { font-size: 13px; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .article-header { padding-top: 40px; }
  h2 { margin-top: 56px; }
  /* Figures run edge to edge on a phone, so a drawing keeps its full layout width
     (figure text never falls below 12 px). */
  .figure { margin-inline: -16px; width: auto; max-width: none; border-radius: 0; padding: 22px 14px 18px; }
  .chart-bits li { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .chart-bits-bar { grid-column: 1 / -1; grid-row: 2; }
  .repro table, .repro tbody, .repro tr, .repro td { display: block; }
  .repro thead { display: none; }
  .repro tr { padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .repro td { border: 0; padding: 2px 0; }
}
@media print {
  body { font-size: 10.5pt; padding: 0; background: #fff; color: #000; }
  a { color: inherit; text-decoration: none; }
  .article-header { padding-top: 0; }
  .figure { box-shadow: none; padding: 0; border-radius: 0; background: none; }
}


:root {
  --font-text: var(--sans);
  --font-mono: var(--mono);
  --fig-font: var(--sans);
  --card-radius: 16px;
  --card-shadow: var(--shadow);
}
body { padding: 0 0 0; background: var(--paper); font-family: var(--sans); }
.article { padding-inline: 16px; }
.bar { background: var(--paper); }
.foot { margin-top: 72px; }
.crumb { max-width: var(--measure); margin: 0 auto; padding-top: clamp(40px, 6vw, 72px); font-size: 15px; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.article-header { padding-top: 16px; }
.article-title, h2, h3 { font-weight: 600; }
.article-authors--pending { display: none; }

/* Figures use a smaller editorial frame. */
.figure { padding: 28px; }

/* Controls, matched to the storefront: pill segments, 36 px round paddles, quiet links. */
.chart-segments span { border-radius: 999px; background: var(--control-track); }
.chart-paddle { width: 36px; height: 36px; background: color-mix(in srgb, var(--rule) 70%, transparent); color: var(--ink); }
.chart-paddle:hover:not(:disabled) { background: var(--rule); }
.chart-link { font-size: 15px; font-weight: 500; color: var(--link); text-decoration: underline; }
.chart-link::after { content: " \203A"; }
.figure-sources a { color: var(--link); text-decoration: underline; font-weight: 500; }
.figure-sources a:hover { text-decoration: underline; }
.chart-bits-bar { background: var(--rule); }

@media (max-width: 600px) {
  .figure { padding: 28px 14px; }
}

:root { --measure: 656px; --card-radius: 16px; }
.article { font-size: 19px; line-height: 30px; }
.article-title { font-size: 52px; line-height: 56px; letter-spacing: -.02em; }
.article h2 { font-size: 30px; line-height: 36px; font-weight: 600; margin-top: 64px; }
.article-body > h2:first-child { margin-top: 64px; }
.figure { padding: 28px; border-radius: 16px; }
.depth-switch label { min-height: 44px; }
.depth-switch span { min-height: 38px; display: inline-flex; align-items: center; }
.chart-segments span { border: 1px solid var(--rule); }
.chart-segments input:checked + span { border-color: var(--fg); }
.figure .chart-link, .figure-sources a { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.foot { margin-top: 64px; }
@media (max-width: 600px) {
  .article-title { font-size: 36px; line-height: 40px; }
  .figure { padding: 28px 14px; }
}

/* The neutral article theme also styles global headings and paragraphs. */
.site-footer p { margin: 0; }

/* Accessibility. axe link-in-text-block: site.css removes underlines from
   links, so a link inside article text (a citation, a cross-reference in a caption) was told
   apart by colour alone. Links in the article's text are underlined, as the format intends. */
.article-body a, .article-end a, .figure figcaption a { text-decoration-line: underline; }

/* The draft label at the top of the article, in the reading column; plain, not an alert. */
/* Its left edge on the column's (a fit-content pill with auto margins would centre). */
.draft-flag--article { max-width: var(--measure); margin: 16px 0 0 max(0px, calc((100% - var(--measure)) / 2)); }
