/* PIVOTSBench project page
   Palette: diverging red<->blue with a gray midpoint, validated for CVD
   separation on a white surface. Every colored cell also carries its number,
   so color never has to carry the value alone. */

:root {
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --hairline: rgba(11, 11, 11, .10);
  --surface: #ffffff;
  --plane: #f9f9f7;

  --s-neg2: #c53b39;
  --s-neg1: #e8817d;
  --s-zero: #eceae5;
  --s-pos1: #86b6ef;
  --s-pos2: #256abf;

  --measure: 34rem;
  --gutter: 1.5rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 3.75rem; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 60rem; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.narrow { max-width: var(--measure); }

a { color: inherit; }
p a, li a, dd a { text-underline-offset: .18em; text-decoration-thickness: 1px; }

/* ---------- nav ---------- */

.nav {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
             padding-top: .9rem; padding-bottom: .9rem; }
.nav .mark { font-weight: 650; letter-spacing: -.01em; text-decoration: none; font-size: .95rem; }
.nav ul { display: flex; gap: 1.35rem; list-style: none; font-size: .875rem;
          flex-wrap: nowrap; min-width: 0; overflow-x: auto;
          -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav li { flex: none; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 550; }

/* ---------- type ---------- */

h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); line-height: 1.15;
     letter-spacing: -.022em; font-weight: 680; }
h2 { font-size: 1.3rem; letter-spacing: -.014em; font-weight: 640; }
h3 { font-size: 1rem; font-weight: 600; }
h4 { font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
     color: var(--muted); }
.lede { font-size: 1.1rem; line-height: 1.55; color: var(--ink); }
.sub { color: var(--ink-2); }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .84em; }

section { padding-top: 3.5rem; padding-bottom: 3.5rem; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }

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

header.hero { padding-top: 4.5rem; padding-bottom: 3rem; }
header.hero h1 { max-width: 24ch; }
.byline { margin-top: 1.4rem; font-size: .98rem; line-height: 1.75; }
.byline sup { color: var(--muted); font-size: .68em; }
.affil { margin-top: .35rem; font-size: .85rem; color: var(--muted); }
.affil + .affil { margin-top: .1rem; }
.eyebrow { color: var(--muted); font-size: .8rem; letter-spacing: .07em;
           text-transform: uppercase; font-weight: 600; margin-bottom: 1.1rem; }
.actions { margin-top: 1.75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.actions a {
  display: inline-block; padding: .42rem .95rem; border: 1px solid var(--ink);
  border-radius: 2px; font-size: .875rem; font-weight: 500; text-decoration: none;
  transition: background .12s, color .12s;
}
.actions a:hover { background: var(--ink); color: var(--surface); }
.actions a[aria-disabled="true"] { border-color: var(--line); color: var(--muted); pointer-events: none; }

/* ---------- key numbers ---------- */

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
           gap: 1.5rem 2rem; margin-top: 2rem; }
.figures div b { display: block; font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em;
                 font-variant-numeric: tabular-nums; line-height: 1.1; }
.figures div span { display: block; font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* ---------- definition lists ---------- */

.dims { margin-top: 1.5rem; }
.dims > div { display: grid; grid-template-columns: 1.6rem 8rem 1fr; gap: 0 1rem;
              padding: .85rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.dims .key { font-weight: 660; }
.dims .name { font-weight: 550; }
.dims .axis { color: var(--ink-2); font-size: .92rem; }
.dims .axis em { font-style: normal; color: var(--muted); }
@media (max-width: 40rem) {
  .dims > div { grid-template-columns: 1.6rem 1fr; }
  .dims .axis { grid-column: 2; }
}

.tasks { margin-top: 1.5rem; counter-reset: t; }
.tasks > div { padding: 1.1rem 0; border-top: 1px solid var(--line); display: grid;
               grid-template-columns: 3.5rem 1fr; gap: 0 1rem; }
.tasks > div::before { counter-increment: t; content: "Task " counter(t);
                       color: var(--muted); font-size: .78rem; letter-spacing: .04em;
                       text-transform: uppercase; padding-top: .18rem; }
.tasks p { color: var(--ink-2); font-size: .95rem; margin-top: .2rem; max-width: 60ch; }

/* ---------- tables ---------- */

.tablewrap { overflow-x: auto; margin-top: 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem;
        font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: .5rem .55rem; font-weight: 400; white-space: nowrap; }
th { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
     font-weight: 600; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr + tr td { border-top: 1px solid var(--plane); }
td.strong { font-weight: 620; }
tbody tr.group td { padding-top: 1.1rem; color: var(--muted); font-size: .75rem;
                    letter-spacing: .04em; text-transform: uppercase; }
caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: .82rem;
          padding-top: .75rem; line-height: 1.5; }

/* magnitude bar behind an average, one hue, single series */
.bar { position: relative; display: inline-block; min-width: 3.2rem; }
.bar i { position: absolute; left: 0; bottom: -.28rem; height: 2px; background: var(--s-pos2);
         border-radius: 1px; }

/* ---------- score cells ---------- */

.matrix { display: grid; gap: 2px; margin-top: .5rem;
          grid-template-columns: minmax(0, max-content) repeat(6, minmax(1.9rem, 1fr)); }
.matrix .h { font-size: .72rem; letter-spacing: .06em; color: var(--muted); font-weight: 600;
             text-align: center; padding-bottom: .1rem; }
.matrix .rowlabel { font-size: .82rem; color: var(--ink-2); display: flex; align-items: center;
                    padding-right: .6rem; line-height: 1.25; }
.cell { display: flex; align-items: center; justify-content: center; height: 1.85rem;
        border-radius: 2px; font-size: .82rem; font-weight: 600;
        font-variant-numeric: tabular-nums; background: var(--s-zero); color: var(--ink); }
.cell.v-2 { background: var(--s-neg2); color: #fff; }
.cell.v-1 { background: var(--s-neg1); color: #2a0f0e; }
.cell.v1  { background: var(--s-pos1); color: #0a1b2e; }
.cell.v2  { background: var(--s-pos2); color: #fff; }
.cell.vnull { background: repeating-linear-gradient(45deg, var(--plane), var(--plane) 3px,
              var(--surface) 3px, var(--surface) 6px); color: var(--muted); }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 1rem;
          font-size: .78rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: .7rem; height: .7rem; border-radius: 2px; display: inline-block; }

/* ---------- samples ---------- */

.sample { padding: 2.75rem 0; border-top: 1px solid var(--line); }
.sample:first-of-type { border-top: none; padding-top: 1.5rem; }
.sample .kicker { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
                  color: var(--muted); font-weight: 600; }
.sample h3 { margin-top: .35rem; font-size: 1.12rem; font-weight: 620; letter-spacing: -.01em; }
.sample .summary { margin-top: .5rem; color: var(--ink-2); font-size: .95rem; max-width: 62ch; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
         gap: 1.75rem; margin-top: 1.4rem; align-items: start; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

.video { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--plane);
         border-radius: 3px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .none { position: absolute; inset: 0; display: flex; align-items: center;
               justify-content: center; text-align: center; padding: 1.5rem;
               color: var(--muted); font-size: .82rem; line-height: 1.5; }

.dialogue { margin-top: 1rem; font-size: .92rem; line-height: 1.7; color: var(--ink-2); }
.dialogue p + p { margin-top: .35rem; }
.dialogue b { color: var(--ink); font-weight: 600; }
.dialogue .t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .5rem; }

.evidence { margin-top: 1.25rem; font-size: .87rem; }
.evidence > div { padding: .6rem 0; border-top: 1px solid var(--line); display: grid;
                  grid-template-columns: 1.4rem 1fr; gap: 0 .75rem; }
.evidence .d { font-weight: 660; color: var(--ink); }
.evidence .r { color: var(--ink-2); }
.evidence .tags { color: var(--muted); font-size: .8rem; margin-top: .15rem; }

.aux { margin-top: 1.25rem; font-size: .87rem; color: var(--ink-2); }
.aux ol { margin: .4rem 0 0 1.1rem; }
.aux .correct { color: var(--ink); font-weight: 600; }

/* ---------- distribution chart ---------- */

.dist { margin-top: 1.5rem; }
.dist .row { display: grid; grid-template-columns: 1.5rem 1fr 3.2rem; align-items: center;
             gap: .75rem; padding: .3rem 0; }
.dist .lab { font-weight: 620; font-size: .85rem; }
.dist .track { display: flex; gap: 2px; height: 1.1rem; }
.dist .seg { border-radius: 2px; min-width: 2px; }
.dist .tot { font-size: .78rem; color: var(--muted); text-align: right;
             font-variant-numeric: tabular-nums; }

.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink);
       color: #fff; font-size: .76rem; padding: .3rem .5rem; border-radius: 3px;
       opacity: 0; transition: opacity .1s; white-space: nowrap; }
.tip.on { opacity: 1; }

/* ---------- misc ---------- */

pre { background: var(--plane); border-radius: 3px; padding: 1rem 1.1rem; overflow-x: auto;
      font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8rem;
      line-height: 1.6; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em;
       background: var(--plane); padding: .1em .35em; border-radius: 2px; }
pre code { background: none; padding: 0; }

.copy { margin-top: .6rem; background: none; border: 1px solid var(--line); border-radius: 2px;
        padding: .3rem .8rem; font: inherit; font-size: .8rem; color: var(--ink-2);
        cursor: pointer; }
.copy:hover { border-color: var(--ink); color: var(--ink); }

dl.facts { margin-top: 1.25rem; }
dl.facts > div { display: grid; grid-template-columns: minmax(9rem, 12rem) 1fr; gap: 0 1.5rem;
                 padding: .7rem 0; border-top: 1px solid var(--line); }
dl.facts dt { color: var(--muted); font-size: .85rem; }
dl.facts dd { font-size: .92rem; }
@media (max-width: 40rem) { dl.facts > div { grid-template-columns: 1fr; gap: .15rem; } }

.note { border-left: 2px solid var(--line); padding-left: 1rem; color: var(--ink-2);
        font-size: .9rem; }

footer { border-top: 1px solid var(--line); padding-top: 2.5rem; padding-bottom: 4rem; color: var(--muted);
         font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem;
         flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* ---------- bidirectional diagram ---------- */

.bidir { margin-top: 2.5rem; max-width: 36rem; }
.bidir svg { display: block; width: 100%; height: auto; }
.bidir .legend { margin-top: .9rem; }

/* ---------- headline figure ---------- */

.headline { max-width: var(--measure); }
.headline .hrow { display: grid; grid-template-columns: minmax(7.5rem, 11rem) 1fr 2.8rem;
                  gap: 1rem; align-items: center; padding: .42rem 0; font-size: .85rem; }
.headline .hl { color: var(--ink-2); line-height: 1.35; }
.headline .track { position: relative; height: 9px; background: var(--plane); border-radius: 2px; }
.headline .track i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 2px;
                     background: var(--s-pos2); }
.headline .track i.ref { background: var(--muted); }
.headline .track::after { content: ""; position: absolute; left: 20%; top: -4px; bottom: -4px;
                          width: 1px; background: var(--ink); opacity: .3; }
.headline b { font-weight: 620; font-variant-numeric: tabular-nums; text-align: right;
              font-size: .85rem; }
.headline figcaption { margin-top: .5rem; }

/* ---------- table variants ---------- */

table.fit { width: auto; }
table.fit th:not(:first-child), table.fit td:not(:first-child) { padding-left: 1.7rem; }
th.span { text-align: center; }
th.div, td.div { border-left: 1px solid var(--line); padding-left: 1.1rem; }

/* ---------- small screens ---------- */

@media (max-width: 40rem) {
  section { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .matrix { grid-template-columns: repeat(6, 1fr); }
  .matrix > div:first-child { display: none; }
  .matrix .rowlabel { grid-column: 1 / -1; padding-top: .55rem; }
  .headline .hrow { grid-template-columns: 1fr 2.8rem; grid-template-areas: "label value" "track track"; row-gap: .3rem; }
  .headline .hl { grid-area: label; }
  .headline .track { grid-area: track; }
  .headline b { grid-area: value; }
  header.hero { padding-top: 2.75rem; }
  .nav .wrap { gap: .85rem; }
  .nav ul { gap: 1.05rem; }
  .figures { gap: 1.25rem 1.5rem; }
}
