/* The demo page. Same visual language as the portfolio page it is linked from:
   paper and ink, one typeface, rules instead of boxes. Nothing is loaded from
   another host: the typeface is a file beside the page. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/SchibstedGrotesk-wght.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f6f7;
  --ink: #132030;
  --muted: #566474;
  --rule: #d3dbe1;
  --link: #1d5a8c;
  /* the track of a control, and the chosen option on it */
  --tint: #e5ebee;
  --raised: #fff;
  /* the three bands of the heading: subtractive on paper, so aligned they print dark */
  --band-1: #1496dc;
  --band-2: #dc3ca0;
  --band-3: #f0d23c;
  --band-blend: multiply;
  --shift: 0.05em;
  /* the curve: the two models as in the published figure, blue and orange */
  --c-large: #1d5a8c;
  --c-small: #a8500a;
  --c-ref: #566474;
  /* drawn over an image, whatever the theme */
  --changed: #e6007e;
  --arrow: #ffe14a;
  /* the two columns most rows of the page share */
  --cols: minmax(0, 5fr) minmax(0, 7fr);
  --gap: clamp(2rem, 4.5vw, 4rem);
  /* the slider's picture: as large as the first screen lets the whole of it show */
  --picture: min(clamp(20rem, 100svh - 22.25rem, 36rem), 52vw);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f161e;
    --ink: #e6edf2;
    --muted: #97a6b4;
    --rule: #26333f;
    --link: #8cc4f2;
    --tint: #18222d;
    --raised: #263442;
    /* additive on a dark ground, so aligned they add up to light */
    --band-1: #ff3b30;
    --band-2: #30d158;
    --band-3: #2f8cff;
    --band-blend: screen;
    --c-large: #8cc4f2;
    --c-small: #f0a860;
    --c-ref: #97a6b4;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; }
p, dd, li, figcaption { text-wrap: pretty; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
q { overflow-wrap: anywhere; }
.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 720px) { .wrap { padding: 0 2.5rem; } }

/* opening: what the project is, the one claim, and what to do */
.opening { display: grid; gap: 1rem; padding: 1rem 0 1.5rem; }
.masthead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1.5rem; margin-bottom: 0.5rem; }
.project { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.project span { margin-left: 0.5rem; font-weight: 500; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; font-weight: 500; }
.links a { display: inline-block; padding: 0.5rem 0; }
.title {
  position: relative;
  isolation: isolate;
  font-weight: 800;
  font-size: clamp(2.1rem, 4.2vw, 2.875rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--band-1);
}
.title::before, .title::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  mix-blend-mode: var(--band-blend);
  pointer-events: none;
}
.title::before { color: var(--band-2); transform: translate(calc(var(--shift) * 1.1), calc(var(--shift) * -0.5)); animation: register 1.5s cubic-bezier(.2,.7,.1,1) 0.5s forwards; }
.title::after  { color: var(--band-3); transform: translate(calc(var(--shift) * 0.4), calc(var(--shift) * 0.9)); animation: register 1.5s cubic-bezier(.2,.7,.1,1) 0.65s forwards; }
.title > span { display: block; mix-blend-mode: var(--band-blend); transform: translate(calc(var(--shift) * -0.9), calc(var(--shift) * 0.2)); animation: register 1.5s cubic-bezier(.2,.7,.1,1) 0.35s forwards; }
@keyframes register { to { transform: translate(0, 0); } }
@media (prefers-reduced-motion: reduce) {
  .title::before, .title::after, .title > span { animation: none; transform: none; }
}
.lede { margin: 0; max-width: 34rem; font-size: 1.125rem; line-height: 1.5; }
.lede strong { font-weight: 650; }
@media (min-width: 900px) {
  /* the heading over the picture, the sentence over what is read off it */
  .opening { grid-template-columns: var(--picture) minmax(0, 1fr); column-gap: var(--gap); align-items: end; }
  .masthead { grid-column: 1 / -1; }
}

.notice, .failure { margin: 0; padding: 0.75rem 1rem; border: 1px solid var(--ink); border-radius: 6px; background: var(--tint); max-width: 46rem; font-size: 0.9375rem; line-height: 1.5; }
.notice { margin: 0 0 1.5rem; }

/* the three choices: they stay in view while the two sections they drive scroll */
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.5rem; padding: 0.7rem 0 0.8rem; border-block: 1px solid var(--rule); background: var(--paper); }
.choice:last-child { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .controls { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.5fr); }
  .choice:last-child { grid-column: auto; }
}
/* on a phone the bar is two rows, too much of the screen to keep */
@media (min-width: 560px) and (min-height: 600px) {
  .controls { position: sticky; top: 0; z-index: 5; }
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .pick > span { display: block; padding: 0; margin-bottom: 0.3rem; font-size: 0.8125rem; font-weight: 600; line-height: 1.3; color: var(--muted); }
.chips { display: none; }
.pick { position: relative; display: block; }
.pick::after { content: ""; position: absolute; right: 0.85rem; bottom: 1.15rem; width: 0.45rem; height: 0.45rem; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
select {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%; min-height: 2.75rem; margin: 0; padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--tint); color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 550; text-overflow: ellipsis; cursor: pointer;
}
@media (min-width: 1180px) {
  .controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; }
  .chips { display: block; }
  .pick { display: none; }
  .controls .seg span { font-size: 0.8125rem; padding: 0 0.65rem; }
}
@media (min-width: 1320px) {
  .controls .seg span { font-size: 0.875rem; padding: 0 0.75rem; }
}

/* a choice among a few: a track, and the chosen option raised on it */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9px; background: var(--tint); }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.75rem; border-radius: 6px;
  font-size: 0.875rem; font-weight: 550; color: var(--muted); white-space: nowrap;
}
.seg input:hover + span { color: var(--ink); }
.seg input:checked + span { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
fieldset:disabled .seg { opacity: 0.45; }
fieldset:disabled .seg input { cursor: default; }
@media (pointer: coarse) { .seg span { min-height: 2.75rem; } }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.5rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }

/* the slider and what to read off it */
.stage { display: grid; gap: 1.75rem; padding: 1.25rem 0 3.5rem; }
.compare { width: 100%; max-width: 36rem; }
@media (min-width: 900px) {
  .stage { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--gap); align-items: start; }
  .compare { width: var(--picture); }
}
.frame {
  --split: 50%; --zoom: 1; --tx: 0%; --ty: 0%; --bar: 0.2;
  position: relative; width: 100%; aspect-ratio: 1; container-type: inline-size;
  overflow: hidden; border-radius: 4px; background: #000;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.frame.zoomed { touch-action: none; cursor: grab; }
.frame.zoomed.moving { cursor: grabbing; }
.pane { position: absolute; inset: 0; overflow: hidden; }
.pane-a { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.pane-b { clip-path: inset(0 0 0 var(--split)); }
.pane img {
  position: absolute; left: var(--tx); top: var(--ty);
  width: calc(var(--zoom) * 100%); height: calc(var(--zoom) * 100%); max-width: none;
  pointer-events: none;
}
/* 10 m pixels enlarged four or five times read as blocks: smoothed until 4×, where the squares are the point */
.frame.sharp .pane img { image-rendering: pixelated; }
.tag {
  position: absolute; top: 0.6rem; max-width: 46%; padding: 0.2rem 0.55rem; border-radius: 4px;
  background: rgba(15, 22, 30, 0.82); color: #fff; font-size: 0.8125rem; font-weight: 600; line-height: 1.35;
}
.pane-a .tag { left: 0.6rem; }
.pane-b .tag { right: 0.6rem; text-align: right; }
/* a map's scale bar: its length is the ground it stands for, at the zoom shown */
.scale {
  position: absolute; left: 0.6rem; bottom: 0.6rem; display: flex; align-items: flex-end; gap: 0.45rem;
  padding: 0.3rem 0.5rem 0.35rem; border-radius: 4px; background: rgba(15, 22, 30, 0.82);
  color: #fff; font-size: 0.75rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; pointer-events: none;
}
.scale i { display: block; width: calc(var(--bar) * 100cqw); height: 0.4rem; border: 1.5px solid #fff; border-top: 0; }
/* the keyboard's way to the divider: a range the handle stands for */
.split { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.divider { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(15, 22, 30, 0.7); pointer-events: none; }
.divider span {
  position: absolute; top: 50%; left: 50%; width: 2.75rem; height: 2.75rem; transform: translate(-50%, -50%);
  display: grid; place-items: center; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px rgba(15, 22, 30, 0.7), 0 2px 6px rgba(15, 22, 30, 0.35);
}
.divider svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: #132030; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.split:focus-visible ~ .divider span { outline: 3px solid #8cc4f2; outline-offset: 2px; }
.frame:focus-visible { outline-offset: 3px; }

/* where a method gave nothing to draw */
.missing { margin: 0; display: grid; place-items: center; padding: 1.25rem; text-align: center; font-size: 0.9375rem; line-height: 1.45; color: var(--ink); }
/* the note keeps its place and its width: the divider uncovers it, as it does a picture */
.pane .missing { position: absolute; inset: 0; padding-left: 54%; background: var(--tint); }
.overlay .missing { position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 88%, transparent); }

.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; list-style: none; padding: 0; margin: 0.7rem 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.4rem; vertical-align: -0.05rem; }
.swatch-changed { background: var(--changed); }
.swatch-veil { background: #5d6165; }
.credit { margin: 0.7rem 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.credit + .credit { margin-top: 0.25rem; }

.readout { display: grid; gap: 1.5rem; align-content: start; max-width: 34rem; }
.method h3 { font-size: clamp(1.5rem, 2.4vw, 1.875rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.method p { margin: 0.5rem 0 0; }
.view { display: grid; gap: 0.75rem; }

/* figures set like the lines of a data sheet */
.facts { margin: 0; border-bottom: 1px solid var(--rule); }
.facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; padding: 0.65rem 0 0.8rem; border-top: 1px solid var(--rule); }
.facts dt { font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; }
.facts .value { font-size: 1.375rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.facts .ground { margin-left: 0.5rem; font-size: 0.875rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.facts .note { flex: 0 0 100%; margin-top: 0.15rem; font-size: 0.9375rem; line-height: 1.5; }
.facts .detail { display: block; margin-top: 0.15rem; font-size: 0.8125rem; color: var(--muted); }

/* sections under the slider: a rule, a heading beside its sentence, the figure under them */
.block { border-top: 1px solid var(--rule); padding: 3rem 0 3.5rem; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
.head { display: grid; gap: 0.9rem; margin-bottom: 2rem; }
.head p { margin: 0; max-width: 44rem; }
.head p + p { margin-top: 0.75rem; }
@media (min-width: 900px) {
  .block { padding: 4rem 0 4.5rem; }
  .head { grid-template-columns: var(--cols); column-gap: var(--gap); margin-bottom: 2.5rem; }
}
.block > .failure { margin-bottom: 1.5rem; }
.plain { margin: 1.5rem 0 0; max-width: 44rem; }

/* arrows */
.fields { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.field { margin: 0; max-width: 28rem; }
figcaption { margin-top: 0.6rem; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.overlay { position: relative; overflow: hidden; border-radius: 4px; background: #000; }
.overlay img { width: 100%; aspect-ratio: 1; }
.overlay svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.arrows-under { fill: none; stroke: rgba(15, 22, 30, 0.85); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.arrows-over { fill: none; stroke: var(--arrow); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.arrows-hidden { fill: none; stroke: #fff; stroke-width: 0.8; opacity: 0.85; }
.under { display: grid; gap: 1.75rem; margin-top: 2rem; }
.under .toolbar { align-content: start; }
.under .toolbar .meta { flex: 1 1 100%; max-width: 34rem; }
@media (min-width: 900px) {
  .under { grid-template-columns: var(--cols); column-gap: var(--gap); align-items: start; }
  .under .facts { order: 2; max-width: 44rem; }
}

/* curve: the main chart, and two smaller ones beside it */
.block > .toolbar { margin-bottom: 1.75rem; }
.block > .toolbar .meta { flex: 1 1 20rem; max-width: 46rem; }
.charts { position: relative; display: grid; gap: 2rem 1.5rem; }
.chart { margin: 0; min-width: 0; }
.chart svg { display: block; width: 100%; height: 15rem; overflow: visible; }
.chart-main svg { height: 19rem; }
@media (min-width: 900px) {
  .charts { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); column-gap: var(--gap); }
  .chart-main { grid-row: span 2; }
  .chart svg { height: 12.5rem; }
  .chart-main svg { height: 29.5rem; }
}
.chart text { font-family: inherit; font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .axis-title { fill: var(--ink); font-weight: 600; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.c-large { --c: var(--c-large); }
.c-small { --c: var(--c-small); }
.c-ref { --c: var(--c-ref); }
.c-ink { --c: var(--ink); }
.line { fill: none; stroke: var(--c); stroke-width: 1.5; }
.line.dashed { stroke-dasharray: 4 3; }
.mark { stroke: var(--c); stroke-width: 1.5; }
.mark.solid { fill: var(--c); }
.mark.hollow { fill: var(--paper); }
.mark.cross { fill: none; stroke-width: 1.9; stroke-linecap: round; }
.point { outline: none; }
.point .hit { fill: transparent; }
.point text { fill: var(--c); font-weight: 600; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.point.on .mark { stroke-width: 3.2; }
.tip {
  position: absolute; z-index: 4; width: max-content; max-width: min(18rem, 90%); padding: 0.6rem 0.75rem; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-size: 0.8125rem; line-height: 1.45; pointer-events: none;
}
.tip strong { display: block; margin-bottom: 0.15rem; }
.tip span { display: block; font-variant-numeric: tabular-nums; }
.keys { margin-top: 1.75rem; gap: 0.4rem 1.5rem; }
.keys li { display: inline-flex; align-items: center; gap: 0.4rem; }
.keys svg { flex: none; height: 1rem; width: auto; overflow: visible; }

/* what is folded away: how a figure was read, and the table */
.more { margin-top: 2rem; border-bottom: 1px solid var(--rule); }
details { border-top: 1px solid var(--rule); }
summary { display: flex; align-items: center; gap: 0.65rem; min-height: 3rem; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; flex: none; width: 1rem; font-size: 1.25rem; font-weight: 400; line-height: 1; text-align: center; color: var(--muted); }
details[open] > summary::before { content: "−"; }
summary:hover { color: var(--link); }
details > p { margin: 0 0 1rem 1.65rem; max-width: 44rem; }
details > p:last-child, details > .scroll { margin-bottom: 1.5rem; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 46rem; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; text-align: left; padding-top: 0.75rem; color: var(--muted); max-width: 46rem; }
th, td { text-align: left; padding: 0.45rem 0.75rem 0.45rem 0; border-top: 1px solid var(--rule); vertical-align: top; }
thead th { border-top: 0; color: var(--muted); font-weight: 600; line-height: 1.3; vertical-align: bottom; }
tbody th { font-weight: 500; }
.num { text-align: right; padding-right: 0; padding-left: 0.75rem; }

/* what the page is, one claim a row */
.claims { margin: 0; border-bottom: 1px solid var(--rule); }
.claims > div { display: grid; gap: 0.4rem; padding: 1.25rem 0 1.4rem; border-top: 1px solid var(--rule); }
.claims dt { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.claims dd { margin: 0; max-width: 44rem; }
@media (min-width: 900px) {
  .claims > div { grid-template-columns: var(--cols); column-gap: var(--gap); }
}

footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; border-top: 1px solid var(--rule); padding: 1.5rem 0 3rem; color: var(--muted); font-size: 0.875rem; }
footer .links { flex: 1 1 100%; color: var(--ink); }
footer p { margin: 0; }
