/* mojibake.wtf, option E: a plain test report. Black on white, Tinos and Roboto Mono, blue
   underlined links, real tables. Hierarchy comes from size and weight only. Vertical spacing is
   a multiple of --u, one body line. */
:root {
  --bg: #fff;
  --ink: #000;
  --ink-2: #333;
  --muted: #595959;
  --rule: #000;
  --hair: #b3b3b3;
  --link: #0000ee;
  --visited: #551a8b;
  --mark: #fff3a0;
  --serif: "Tinos", "Times New Roman", Times, serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --u: 1.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111; --ink: #e6e6e6; --ink-2: #c4c4c4; --muted: #9a9a9a; --rule: #e2e2e2; --hair: #4d4d4d;
    --link: #8ab4ff; --visited: #c9a3ff; --mark: #4a4300; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111; --ink: #e6e6e6; --ink-2: #c4c4c4; --muted: #9a9a9a; --rule: #e2e2e2; --hair: #4d4d4d;
  --link: #8ab4ff; --visited: #c9a3ff; --mark: #4a4300; color-scheme: dark;
}

html { font-size: 20px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/var(--u) var(--serif);
  font-variant-numeric: tabular-nums;
}
a { color: var(--link); text-decoration: underline; text-underline-offset: 0.12em; }
a:visited { color: var(--visited); }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
pre { font-family: var(--mono); }
pre { margin: 0; }
h1, h2, h3 { font-weight: 700; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 0.8rem; line-height: calc(var(--u) * 0.8); color: var(--muted); }

.top, main, .foot { max-width: 1120px; padding: 0 64px; }
.top { padding-top: calc(var(--u) / 2); }
.top nav { display: flex; flex-wrap: wrap; gap: 0 1.1em; font-size: 0.9rem; }

hr { max-width: 1120px; margin: calc(var(--u) * 2) 64px; border: 0; border-top: 1px solid var(--rule); }
main hr { margin-left: 0; margin-right: 0; }

section { scroll-margin-top: var(--u); }
h1 { font-size: 2.6rem; line-height: calc(var(--u) * 2); margin-top: calc(var(--u) / 2); }
h2 { font-size: 1.6rem; line-height: calc(var(--u) * 1.5); margin-bottom: var(--u); }
h3 { font-size: 1.1rem; margin: calc(var(--u) * 1.5) 0 calc(var(--u) / 2); }
.intro { max-width: 40em; margin-bottom: var(--u); }
.intro:last-child { margin-bottom: 0; }

.unavailable { margin: var(--u) 0; padding: calc(var(--u) / 2) 0; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); font-weight: 700; }

/* ---------- the lead: what this is and how to use it ---------- */
.lead-more { max-width: 46em; margin-bottom: var(--u); }
.use { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--u) 2.5em; align-items: start; }
.endpoints { margin: 0; }
.endpoints div + div { margin-top: var(--u); }
.endpoints dt { font-size: 1.1rem; }
.endpoints dt code { font-size: 0.85em; }
.endpoints dd { margin: calc(var(--u) / 4) 0 0; }
.code-lead { margin: 0; }
.code-lead .small { margin-top: calc(var(--u) / 2); }
.example h2 a { font-family: var(--mono); font-size: 0.8em; }
.lead-sentence { font-size: 1.5rem; line-height: calc(var(--u) * 1.5); max-width: 34em; margin-bottom: calc(var(--u) / 2); }

.result { border-collapse: collapse; width: 100%; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.result caption { text-align: left; caption-side: top; padding-bottom: calc(var(--u) / 4); font-size: 0.9rem; }
.result caption code { font-size: 0.9em; }
.cap-sel { color: var(--muted); margin-left: 1em; }
.result th, .result td { text-align: left; vertical-align: baseline; padding: calc(var(--u) / 3) 0; }
.result tr + tr th, .result tr + tr td { border-top: 1px solid var(--hair); }
.result th { width: 15em; font-weight: 400; font-size: 1.2rem; padding-right: 1.5em; }
.price { display: block; font-size: 96px; line-height: 120px; letter-spacing: -0.01em; }
.under { display: block; font-size: 0.9rem; color: var(--muted); }
.steps { display: grid; grid-template-columns: max-content max-content; column-gap: 2.5em; align-items: end; }
.step { display: block; min-width: 0; }
.step-label { display: block; font-size: 0.8rem; line-height: var(--u); color: var(--muted); }
.raw { overflow-wrap: anywhere; }
.result .under { max-width: 46em; }

.joke { font-style: italic; margin: calc(var(--u) / 2) 0 var(--u); }

.action { margin: var(--u) 0; }
.decl { margin: 0 0 calc(var(--u) / 2); min-width: 0; }
.decl figcaption { font-size: 0.8rem; color: var(--muted); }
.decl pre { font-size: 0.85rem; line-height: var(--u); overflow-x: auto; }
.buttons { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(var(--u) / 2) 1em; }
button { font: inherit; font-size: 0.9rem; cursor: pointer; }
button.big { font-size: 1.3rem; padding: 0.35em 1.1em; }

.repro { font-size: 0.85rem; line-height: var(--u); margin-top: 0; padding-left: 1em; border-left: 2px solid var(--rule); overflow-x: auto; }
#pip-note { max-width: 46em; margin-top: calc(var(--u) / 2); }

/* ---------- show why ---------- */
.why { margin: var(--u) 0; }
.bytes { border-collapse: collapse; width: 100%; table-layout: fixed; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.bytes caption { text-align: left; caption-side: top; font-size: 0.9rem; padding-bottom: calc(var(--u) / 4); }
.excerpt-note { display: none; }
.bytes th { text-align: left; font-weight: 400; width: 13em; font-size: 0.9rem; line-height: calc(var(--u) * 0.9); padding: calc(var(--u) / 2) 1em calc(var(--u) / 2) 0; vertical-align: top; }
.bytes th small { display: block; font-size: 0.8rem; line-height: calc(var(--u) * 0.8); color: var(--muted); }
.bytes th small code { overflow-wrap: anywhere; }
.bytes td { text-align: center; font: 400 28px/calc(var(--u) * 1.5) var(--mono); padding: calc(var(--u) / 2) 0; border-left: 1px solid var(--hair); overflow-wrap: anywhere; }
.bytes tr + tr th, .bytes tr + tr td { border-top: 1px solid var(--hair); }
.bytes tr.r-hex td { font-size: 24px; color: var(--ink-2); }
.bytes td.hit { background: var(--mark); }
.bytes td.span { font-weight: 500; }
.bytes td.gone { color: var(--muted); text-decoration: line-through; }
.bytes td.result-cell { font-weight: 500; }
.bytes tr.r-total th, .bytes tr.r-total td { border-top: 1px solid var(--rule); }
.bytes td.total { text-align: left; padding-left: 0.5em; font-weight: 500; }
.bytes tr.step-row { opacity: 1; transition: opacity 160ms ease; }
.bytes tr.step-row.is-pending { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .bytes tr.step-row { transition: none; } }
.dump { margin-top: calc(var(--u) / 2); font-size: 0.8rem; color: var(--muted); display: none; }
.why-prose { max-width: 40em; margin: var(--u) 0; }

/* invisible characters, in typographic notation */
.cp { font-family: var(--mono); font-size: 0.62em; font-weight: 500; letter-spacing: 0.02em; padding: 0 0.25em; border: 1px solid currentColor; vertical-align: 0.15em; white-space: nowrap; }
.nm { font-variant: small-caps; font-family: var(--serif); letter-spacing: 0.04em; white-space: nowrap; }
.bytes .cp { font-size: 0.6em; }
.price .cp, .price .nm { font-size: 0.3em; }
.none { font-style: italic; color: var(--muted); }
.refused { font-style: italic; }

/* ---------- reference tables ---------- */
.table-wrap { max-width: 100%; }
table.rules { border-collapse: collapse; width: 100%; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); margin-bottom: var(--u); }
table.rules caption { text-align: left; caption-side: top; padding-bottom: calc(var(--u) / 4); }
table.rules th, table.rules td { text-align: left; vertical-align: top; padding: calc(var(--u) / 4) 1em calc(var(--u) / 4) 0; overflow-wrap: anywhere; }
table.rules th:last-child, table.rules td:last-child { padding-right: 0; }
table.rules thead th { font-weight: 700; border-bottom: 1px solid var(--rule); font-size: 0.85rem; }
table.rules tbody tr + tr td, table.rules tbody tr + tr th { border-top: 1px solid var(--hair); }
table.rules tbody th { font-weight: 400; }
table.rules .num { text-align: right; white-space: nowrap; }
table.rules td.val { font-size: 0.95rem; }
table.rules sup { font-size: 0.65em; line-height: 0; }
table.dense { font-size: 0.85rem; line-height: calc(var(--u) * 0.85); }
table.dense td, table.dense th { padding-top: calc(var(--u) / 6); padding-bottom: calc(var(--u) / 6); }
.sub { display: block; font-size: 0.8em; color: var(--muted); }
meter { width: 9em; height: 0.7em; vertical-align: middle; }
tr.is-hidden { display: none; }
table.corpus tr.group th { font-weight: 700; padding-top: calc(var(--u) / 2); border-top: 1px solid var(--rule); }
table.corpus tbody:first-of-type tr.group th { border-top: 0; }
table.corpus th[scope="row"], table.corpus td.num, table.corpus .c-sha, table.corpus .c-type { white-space: nowrap; }
table.corpus .c-what { color: var(--ink-2); }
.muted { color: var(--muted); font-weight: 400; }

.notes { max-width: 44em; padding-left: 1.4em; margin: 0; font-size: 0.9rem; line-height: calc(var(--u) * 0.9); }
.notes li + li { margin-top: calc(var(--u) / 3); }

.filter { border: 0; padding: 0; margin: 0 0 calc(var(--u) / 2); display: flex; flex-wrap: wrap; gap: 0 1.2em; font-size: 0.9rem; }
.filter legend { float: left; margin-right: 1em; font-weight: 700; }

.code { margin: 0 0 var(--u); }
.code figcaption { font-weight: 700; font-size: 0.9rem; margin-bottom: calc(var(--u) / 4); }
.code pre { font-size: 0.8rem; line-height: calc(var(--u) * 0.9); padding: calc(var(--u) / 2) 0 calc(var(--u) / 2) 1em; border-left: 2px solid var(--rule); overflow-x: auto; }

.held { max-width: 44em; padding-left: 1.2em; margin: 0; }
.foot { padding-bottom: calc(var(--u) * 2); font-size: 0.85rem; line-height: calc(var(--u) * 0.9); color: var(--muted); }
.foot p + p { margin-top: calc(var(--u) / 2); }
.foot p, #provenance { max-width: 48em; }

/* ---------- phone ---------- */
@media (max-width: 700px) {
  html { font-size: 17px; }
  .top, main, .foot { padding: 0 16px; }
  hr { margin: calc(var(--u) * 1.5) 16px; }
  main hr { margin-left: 0; margin-right: 0; }
  h1 { font-size: 1.5rem; line-height: calc(var(--u) * 1.5); margin-top: calc(var(--u) / 2); }
  h2 { font-size: 1.35rem; line-height: calc(var(--u) * 1.25); }
  .lead-sentence { font-size: 1.15rem; line-height: calc(var(--u) * 1.1); margin-bottom: calc(var(--u) / 2); }
  .use { grid-template-columns: minmax(0, 1fr); }
  .result, .result tbody, .result tr, .result th, .result td { display: block; width: auto; }
  .result caption { display: block; }
  .cap-sel { display: block; margin-left: 0; }
  .result th { padding: calc(var(--u) / 2) 0 0; font-size: 0.9rem; }
  .result td { padding: 0 0 calc(var(--u) / 2); }
  .result tr + tr td { border-top: 0; }
  .price { font-size: 52px; line-height: 66px; }
  .raw { font-size: 17px; line-height: var(--u); }
  button.big { font-size: 1.15rem; width: 100%; }
  .action .buttons { display: block; }
  .bytes th { width: 6.5em; font-size: 0.8rem; }
  .bytes th small { display: none; }
  .bytes td { font-size: 20px; }
  .bytes tr.r-hex td { font-size: 18px; }
  .bytes td.outside { display: none; }
  .excerpt-note { display: inline; }
  .dump { display: block; overflow-wrap: anywhere; }
  .c-lang, .c-meter, .c-type, .c-size, .c-sha { display: none; }
  #agreement-table td.c-how, table.corpus td.c-what { display: block; font-size: 0.8rem; color: var(--muted); padding-top: 0; border-top: 0 !important; }
  #agreement-table th.c-how, table.corpus th.c-what { display: none; }
  #agreement-table tbody tr { display: grid; grid-template-columns: 1.8em minmax(0, 1fr) auto; column-gap: 0; border-top: 1px solid var(--hair); }
  #agreement-table th, #agreement-table td { border-top: 0 !important; }
  #agreement-table td.c-how { grid-column: 2 / -1; grid-row: 2; }
  table.corpus td.c-what { grid-column: 1 / -1; grid-row: 2; }
  #agreement-table tbody tr.is-hidden { display: none; }
  table.corpus thead tr, table.corpus tbody tr:not(.group) { display: grid; grid-template-columns: minmax(0, 1fr) 4.6em 4.6em; column-gap: 0; }
  table.corpus th, table.corpus td { border-top: 0 !important; border-bottom: 0 !important; }
  table.corpus tbody tr:not(.group) { border-top: 1px solid var(--hair); }
  table.corpus tr.group { border-top: 1px solid var(--rule); }
  table.corpus thead tr { border-bottom: 1px solid var(--rule); }
  table.corpus thead th.c-what { display: none; }
  table.corpus, table.corpus thead, table.corpus tbody, table.corpus tr.group, table.corpus tr.group th { display: block; width: auto; }
  meter { width: 5em; }
  table.rules th, table.rules td { padding-right: 0.6em; }
}
@media (max-width: 700px) {
  table.corpus th[scope="row"] { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 700px) {
  table.stackable thead { display: none; }
  table.stackable, table.stackable tbody, table.stackable tr, table.stackable th, table.stackable td { display: block; width: auto; }
  table.stackable tr { padding: calc(var(--u) / 2) 0; }
  table.stackable tbody tr + tr { border-top: 1px solid var(--hair); }
  table.stackable tbody tr + tr td, table.stackable tbody tr + tr th { border-top: 0; }
  table.stackable th, table.stackable td { padding: 0; text-align: left; }
  table.stackable td { margin-top: calc(var(--u) / 4); }
  table.stackable td::before { content: attr(data-label); display: block; font-size: 0.75rem; line-height: calc(var(--u) * 0.75); color: var(--muted); }
  table.stackable td.num { text-align: left; }
}
@media (max-width: 700px) {
  table.stackable caption { display: block; text-align: left; }
}
@media (max-width: 1000px) and (min-width: 701px) {
  table.corpus .c-sha, table.corpus .c-size { display: none; }
}
@media (max-width: 700px) {
  #agreement-table thead { display: none; }
}

/* removed characters in the byte table */
.bytes del { text-decoration: line-through; }

/* ?present: the same page, sized for a projector */
html.present { font-size: 26px; }
html.present .use { grid-template-columns: minmax(0, 1fr); }
html.present .top, html.present main, html.present .foot { max-width: none; }
html.present hr { max-width: none; }
html.present .price { font-size: 120px; line-height: 140px; }
html.present .bytes td { font-size: 36px; }
