/* One stylesheet for every page.

   The page is paper. A band or a panel with the class "dark" is night: it
   resets the handful of surface variables below, and everything inside it
   follows. Every figure that carries data sits on night, which is the surface
   its colours were checked against.

   Layout: one reading column of about 75 characters; figures and bands break
   out to 1080px. */

@font-face {
  font-family: "Doto";
  src: url("fonts/doto.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/atkinson-mono.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* the six colours everything is made from */
  --ground: #0e1a3a; /* night, and ink on paper */
  --paper: #f3eee2;  /* the page, and text on night */
  --mist: #a9b4d0;   /* quiet text on night */
  --amber: #d28e05;  /* marks that mean protected */
  --slate: #7f8db3;  /* marks that mean not, and rules on night */
  --threat: #e24d8b; /* the attacker, and what breaks */

  /* made from the six */
  --raised: #132247;
  --sunk: #0a1430;
  --gold: #ffd166;   /* amber, lightened until it can be read on night */
  --ochre: #8a5200;  /* amber, darkened until it can be read on paper */
  --dusk: #46507a;   /* quiet text on paper */
  --sheet: #fbf8f1;  /* a card lying on the paper */

  /* what a surface provides; .dark provides the other set */
  --bg: var(--paper);
  --fg: var(--ground);
  --quiet: var(--dusk);
  --line: rgba(14, 26, 58, 0.17);
  --edge: rgba(14, 26, 58, 0.55);
  --accent: var(--ochre);
  --link-line: #c08410;
  --focus: var(--ground);
  --panel: var(--sheet);
  --code-bg: rgba(14, 26, 58, 0.075);
  --go-bg: var(--ground);
  --go-fg: var(--paper);

  --display: "Doto", "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --text: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --measure: 39rem;  /* about 75 characters of the text face */
  --wide: 1080px;
  --gutter: 1.5rem;
}

.dark {
  color-scheme: dark;
  --bg: var(--ground);
  --fg: var(--paper);
  --quiet: var(--mist);
  --line: rgba(127, 141, 179, 0.3);
  --edge: var(--slate);
  --accent: var(--gold);
  --link-line: currentColor;
  --focus: var(--gold);
  --panel: var(--raised);
  --code-bg: rgba(169, 180, 208, 0.16);
  --go-bg: var(--gold);
  --go-fg: var(--ground);
  background-color: var(--bg);
  color: var(--fg);
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

::selection { background: var(--gold); color: var(--ground); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--link-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: currentColor; }
.dark a { color: var(--gold); text-decoration-thickness: 1px; }
.dark a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 { text-wrap: balance; }
code, pre, kbd, output, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-size: 0.9em; padding: 0.08em 0.32em; border-radius: 5px; background: var(--code-bg); }
pre code, .chip, code.dh-how { padding: 0; background: none; }
sup { font-size: 0.7em; line-height: 0; }

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--ground);
  font-weight: 700;
  border-radius: 8px;
}
.skip:focus { top: 0.75rem; }

/* The line over the bar: where to report a mistake. It scrolls away, and the
   bar under it stays. */
.notice { padding: 0.5rem var(--gutter); background-color: var(--sunk); border-bottom: 1px solid var(--line); color: var(--mist); font-size: 0.9rem; line-height: 1.45; text-align: center; }
.notice p { max-width: none; margin: 0; }

/* ------------------------------------------------------------------ the bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.4rem 1.5rem;
  padding: 0.7rem var(--gutter);
  background-color: rgba(14, 26, 58, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark, .dark a.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.mark-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(210, 142, 5, 0.22); }
.bar nav { margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bar nav::-webkit-scrollbar { display: none; }
.bar ul { display: flex; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.bar li a {
  display: block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  color: var(--mist);
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.bar li a:hover { color: var(--paper); }
/* The way to the checker. It stays in the bar at every width. */
.bar a.bar-go { flex: none; padding: 0.34rem 0.95rem; border-radius: 999px; background: var(--go-bg); color: var(--go-fg); font-size: 0.95rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.bar a.bar-go:hover { background: var(--paper); }
/* The same invitation on the front page, under the opening. */
.spot { padding: clamp(1.4rem, 3vw, 2rem) var(--gutter); border-top: 1px solid var(--line); border-bottom: 3px solid var(--gold); background: var(--sunk); }
.spot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2.5rem; max-width: var(--wide); margin: 0 auto; }
.spot-text { flex: 1 1 26rem; max-width: 44rem; }
.spot h2 { margin: 0 0 0.4rem; font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.2; }
.spot p { margin: 0; color: var(--mist); }
.bar li a[aria-current="page"] { color: var(--ground); background: var(--paper); font-weight: 700; }

/* The button that folds the links away on a small screen. It is in the page
   hidden; core.js shows it. Wider screens never show it. */
.menu-button { display: none; }
.menu-button:focus-visible { border-radius: 999px; }

@supports (animation-timeline: scroll()) {
  .bar::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 100%;
    background: var(--amber);
    transform-origin: 0 50%;
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ------------------------------------------------------- the top of a page */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4.75rem) var(--gutter) clamp(3rem, 6vw, 4.75rem);
  background: linear-gradient(180deg, var(--sunk), var(--ground));
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 20, 48, 0.94) 0%, rgba(10, 20, 48, 0.78) 42%, rgba(10, 20, 48, 0.12) 78%, rgba(10, 20, 48, 0) 100%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: var(--wide); margin: 0 auto; }
.kicker {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.kicker a { color: inherit; }
.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 10.5vw, 6.75rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.lede {
  max-width: 33rem;
  margin: 1.8rem 0 0;
  font-size: clamp(1.12rem, 1.6vw, 1.3rem);
  line-height: 1.55;
}
.hero-links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 2.2rem 0 0; }
.note { color: var(--quiet); font-size: 0.95rem; }

.page-head {
  position: relative;
  overflow: hidden;
  padding: 0 var(--gutter);
  background-image: radial-gradient(circle at 1px 1px, rgba(127, 141, 179, 0.2) 1px, transparent 1.6px);
  background-size: 26px 26px;
}
.page-head-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(2.2rem, 5vw, 3.4rem);
}
.page-head-text { position: relative; z-index: 1; max-width: var(--wide); margin: 0 auto; }
.page-head h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(2.2rem, 5.6vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.page-sub { max-width: 31rem; margin: 0.9rem 0 0; color: var(--mist); font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.45; text-wrap: balance; }

/* The picture in the band. It is as tall as the band and fades away to the
   left, where the words are. On a narrow screen it is not fetched at all. */
.head-art { display: none; }
@media (min-width: 800px) {
  .page-head.has-art { background-image: none; }
  .head-art {
    display: block;
    position: absolute;
    top: 0;
    right: -2.5rem;
    height: 100%;
    aspect-ratio: 16 / 9;
    max-width: 72%;
    -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 46%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 4%, #000 46%, #000 88%, transparent 100%);
  }
  .head-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 100% 50%; }
  canvas.head-art { width: 56%; aspect-ratio: auto; -webkit-mask-image: none; mask-image: none; }
  .has-art .page-head-text h1, .has-art .page-sub { max-width: min(17ch, 58%); }
  .has-art .page-sub { max-width: min(31rem, 52%); }
}

.lesson-steps { display: flex; gap: 0.5rem; margin: 1.7rem 0 0; padding: 0; list-style: none; }
.lesson-steps a {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--slate);
  border-radius: 50%;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.98rem;
  text-decoration: none;
}
.lesson-steps a:hover { border-color: var(--paper); }
.lesson-steps a[aria-current="step"] { background: var(--gold); border-color: var(--gold); color: var(--ground); font-weight: 700; }

/* --------------------------------------------------------------- reading */

.prose, .steps { max-width: var(--measure); margin-inline: auto; }
section, .section { padding: 0 var(--gutter); }
section section, .fig section, .band section { padding: 0; }
.first, .space { padding-top: clamp(2.4rem, 5vw, 3.6rem); }
.last { padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.prose p { margin: 0 0 1.15rem; }
.prose h2 { margin: 3.2rem 0 0.9rem; font-size: clamp(1.6rem, 3.4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.015em; }
.prose h3 { margin: 2.4rem 0 0.7rem; font-size: 1.32rem; line-height: 1.25; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--accent); }

h2.band-title, .section-title {
  max-width: var(--wide);
  margin: 0 auto 0.5rem;
  font-size: clamp(1.7rem, 3.8vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.section-sub { max-width: var(--wide); margin: 0 auto 1.8rem; color: var(--quiet); font-size: 1.1rem; }
.section-sub.narrow { max-width: var(--measure); }
.section-title.narrow { max-width: var(--measure); margin-bottom: 1.2rem; }

/* A lesson in one sentence, set apart at its top. */
.gist {
  max-width: var(--measure);
  margin: 0 auto 2rem;
  padding: 1.15rem 1.3rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ground);
  border-radius: 4px 14px 14px 4px;
  background: var(--panel);
}
.gist .label, .recap .label, .try b {
  display: block;
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gist p { margin: 0; font-size: 1.22rem; line-height: 1.45; text-wrap: pretty; }

/* What to keep from a lesson, at its end. */
.recap {
  max-width: var(--measure);
  margin: 2.8rem auto 0;
  padding: 1.3rem 1.4rem 0.6rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ground);
  border-radius: 4px 4px 14px 14px;
  background: var(--panel);
}
.recap h2 { margin: 0 0 0.8rem; font-size: 1.35rem; }
.recap ul { margin: 0; padding-left: 1.25rem; }
.recap li { margin-bottom: 0.7rem; }
.recap li::marker { color: var(--accent); }
.words { max-width: var(--measure); margin: 1.4rem auto 0; color: var(--quiet); font-size: 0.98rem; }

.lesson-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 2.6rem auto 0;
  padding: 0 var(--gutter) clamp(3rem, 6vw, 4.5rem);
}
.lesson-link {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 1.2rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 14px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.lesson-link .dir { color: var(--quiet); font-family: var(--mono); font-size: 0.86rem; }
.lesson-link .name { font-size: 1.12rem; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.lesson-link.next { text-align: right; background: var(--ground); border-color: var(--ground); color: var(--paper); }
.lesson-link.next .dir { color: var(--gold); }
.lesson-link.prev:hover { background: var(--panel); }
.lesson-link.next:hover { background: var(--raised); }

blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 4px solid var(--threat);
}
blockquote p { margin: 0 0 0.6rem !important; font-size: 1.3rem; line-height: 1.4; font-style: italic; text-wrap: balance; }
blockquote footer { color: var(--quiet); font-size: 0.95rem; }

/* ------------------------------------------------------------------- bands */

.band {
  margin: clamp(2.6rem, 5vw, 3.6rem) 0;
  padding: clamp(2.6rem, 6vw, 4rem) var(--gutter);
  background-image: radial-gradient(circle at 1px 1px, rgba(127, 141, 179, 0.16) 1px, transparent 1.6px);
  background-size: 26px 26px;
}
.band > * { max-width: var(--wide); margin-inline: auto; }
.band > .prose { max-width: var(--measure); }
.band.flush { margin-bottom: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
  margin-bottom: 0;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(19, 34, 71, 0.9);
}
.stat dd {
  margin: 0;
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat dd small { font-size: 0.45em; font-weight: 400; color: var(--mist); letter-spacing: 0; }
.stat dt { color: var(--mist); font-size: 0.98rem; line-height: 1.4; }
.band-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; margin-top: 1.6rem; color: var(--mist); font-size: 0.98rem; }
.band-foot p { margin: 0; flex: 1 1 22rem; }

/* ------------------------------------------------------------------- cards */

.tiles { display: grid; gap: 1rem; max-width: var(--wide); margin: 0 auto; padding: 0; list-style: none; }
.tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
a.tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(14, 26, 58, 0.16); }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ground); }
.tile-body { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; padding: 0.95rem 1.05rem 1.1rem; }
.tile-n { color: var(--accent); font-family: var(--mono); font-size: 0.86rem; font-weight: 700; letter-spacing: 0.06em; }
.tile-title { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.22; text-wrap: balance; }
.tile-text { margin: 0; color: var(--quiet); font-size: 0.97rem; line-height: 1.45; }
.tile-go { margin-top: auto; padding-top: 0.5rem; font-size: 0.95rem; font-weight: 700; text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.tiles.three .tile-title { font-size: 1.3rem; }
.tiles.three .tile-text { font-size: 1.02rem; }

/* The lessons as a list, one to a row. */
.rows { display: grid; gap: 1rem; max-width: 52rem; margin: 0 auto; padding: 0; list-style: none; }
.row {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.row:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(14, 26, 58, 0.16); }
.row img { display: block; width: 100%; height: 100%; min-height: 9.5rem; object-fit: cover; background: var(--ground); }
.row-body { display: grid; align-content: center; gap: 0.3rem; padding: 1.1rem 1.3rem 1.2rem; }
.row-body .tile-title { font-size: 1.35rem; }
.row-body .tile-text { font-size: 1.04rem; }
.prose + .rows { margin-top: 1.9rem; }
.rows + .prose { margin-top: 2.8rem; }

/* Questions, each opened by its own line. */
.faq { max-width: var(--measure); margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.2rem;
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--accent); font-family: var(--mono); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0.2rem 1.1rem; }

.glossary { max-width: var(--measure); margin: 0 auto; }
.glossary dt { margin: 1.7rem 0 0.25rem; font-size: 1.2rem; font-weight: 700; scroll-margin-top: 5.5rem; }
.glossary dt:target { background: linear-gradient(transparent 55%, rgba(255, 209, 102, 0.75) 55%); width: fit-content; }
.glossary dd { margin: 0; }
.glossary dd p { margin: 0 0 0.6rem; }
.glossary .also { color: var(--quiet); font-size: 0.97rem; }
.az { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; max-width: var(--measure); margin: 0 auto 0.6rem; padding: 0; list-style: none; font-size: 0.98rem; }
.az a { display: block; padding: 0.15rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); text-decoration: none; }
.az a:hover { border-color: var(--edge); }

/* ------------------------------------------------------------------- figures */

.fig {
  max-width: var(--wide);
  margin: 2.6rem auto;
  padding: clamp(1rem, 2.6vw, 1.75rem);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(14, 26, 58, 0.18);
}
.band .fig, .fig .fig { box-shadow: none; }
.fig figcaption {
  max-width: 40rem;
  margin-top: 1.1rem;
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.5;
}
.fig h3, .fig-title { margin: 0 0 0.6rem; font-size: 1.05rem; line-height: 1.3; }
.plot-title { color: var(--mist); font-weight: 400; font-size: 0.95rem; }
.try { max-width: 42rem; margin: 0 0 1.3rem; padding: 0 0 1.1rem; border-bottom: 1px solid var(--line); font-size: 1.02rem; line-height: 1.5; }
.try b { display: inline; margin-right: 0.5rem; }

.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem 1.4rem; margin-bottom: 1.2rem; }
.controls.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: end; }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field.grow { flex: 1 1 16rem; }
.field label { color: var(--mist); font-size: 0.95rem; line-height: 1.35; }
.field output { color: var(--paper); font-weight: 700; white-space: nowrap; }
.field .ask { display: block; }

input[type="range"] { width: 100%; margin: 0; accent-color: var(--amber); height: 1.6rem; }
select, input[type="search"] {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--slate);
  border-radius: 9px;
  background: var(--sunk);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
}
input[type="search"]::placeholder { color: var(--slate); }

.button, .dark a.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { border-color: var(--fg); }
.button.primary, .dark a.button.primary { background: var(--go-bg); border-color: var(--go-bg); color: var(--go-fg); font-weight: 700; }
.dark .button.primary:hover { background: var(--paper); border-color: var(--paper); }
.button.primary:hover { background: var(--raised); border-color: var(--raised); }
.button.toggle[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--ground); font-weight: 700; }
.button.danger[aria-pressed="true"] { background: var(--threat); border-color: var(--threat); color: #1b0612; }
.button:disabled { opacity: 0.55; cursor: default; }
.button.big { padding: 0.75rem 1.4rem; font-size: 1.06rem; }

.readout { min-height: 3.3em; margin: 1rem 0 0; max-width: 42rem; }
.readout b, .readout strong { color: var(--gold); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0.9rem 0 0; padding: 0; list-style: none; color: var(--mist); font-size: 0.95rem; }
.legend li { display: inline-flex; align-items: center; gap: 0.5rem; }
.key { display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 50%; flex: none; }
.key-yes, .key-near { background: var(--amber); }
.key-no { border: 2px solid var(--slate); }
.key-old { border: 2px dotted var(--slate); }
.key-target { background: var(--threat); }
.key-round { border: 2px solid var(--gold); }

.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot text { fill: var(--mist); font-family: var(--text); font-size: 12px; }
.plot .strong { fill: var(--paper); font-weight: 700; }
.plot .halo { paint-order: stroke; stroke: var(--raised); stroke-width: 6px; stroke-linejoin: round; }
.plot .axis { stroke: rgba(127, 141, 179, 0.3); stroke-width: 1; }
.plot .grid { stroke: rgba(127, 141, 179, 0.16); stroke-width: 1; }

.stage {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: var(--sunk);
}
/* The picture scrolls with the page under a finger. Only the handle that sits
   on the movable point takes a drag for itself. */
.stage-wrap { position: relative; }
#bb-canvas { aspect-ratio: 16 / 9; cursor: crosshair; }
.handle {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.handle:active { cursor: grabbing; }
.handle:focus-visible { outline-offset: -6px; border-radius: 50%; }

/* ------------------------------------------------------------ the exchange */

.dh { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; }
.dh-col { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(14, 26, 58, 0.55); }
.dh-wire { border-style: dashed; border-color: var(--slate); background: var(--sunk); }
.dh-col h3 { margin-bottom: 0.9rem; }
.dh-wire h3 { color: var(--mist); font-weight: 400; }
.dh-line { display: flex; align-items: center; gap: 0.75rem; margin: 0.8rem 0 0; min-height: 2.6rem; line-height: 1.35; }
.dh-line.result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.dh-line.absent { color: var(--mist); }
.dh-line > span:last-child { min-width: 0; }
.dh-line b { font-family: var(--mono); }
.dh-how { display: block; color: var(--mist); font-size: 0.86rem; line-height: 1.35; }
span.dh-how { text-wrap: balance; }
.pot {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--slate);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), 0 0 0 2px var(--sunk);
  transition: background-color 0.2s;
}
.pot.big { width: 2.6rem; height: 2.6rem; }
.pot.hollow { background: transparent; box-shadow: none; border: 2px dashed var(--slate); }
.eve { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 1rem 1.4rem; margin-top: 1.4rem; }
.eve .readout { margin: 0; min-height: 4.9em; }

/* ---------------------------------------------------------- period finding */

.plot-pair { display: grid; gap: 1.4rem; }

/* -------------------------------------------------------------- dimensions */

.dims { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
#dm-canvas { aspect-ratio: 4 / 3; }
.big-number {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.big-number sup { font-size: 0.5em; }
.scale { position: relative; height: 12px; margin: 2.6rem 0 1.4rem; border-radius: 6px; background: var(--sunk); }
.scale-fill { height: 100%; width: 0; border-radius: 6px 4px 4px 6px; background: var(--amber); transition: width 0.3s; }
.scale-mark { position: absolute; top: -8px; bottom: -8px; left: 0; border-left: 2px solid var(--threat); }
.scale-mark span { position: absolute; bottom: 100%; left: -2px; padding-bottom: 2px; white-space: nowrap; color: var(--mist); font-size: 0.82rem; }

/* ------------------------------------------------------------------- locks */

.locks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.lock {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(14, 26, 58, 0.55);
  transition: border-color 0.2s, background-color 0.2s;
}
.lock h3 { margin: 0; grid-column: 2; }
.lock p { margin: 0; grid-column: 2; color: var(--mist); font-size: 0.95rem; }
.lock .lock-state { color: var(--paper); font-family: var(--mono); font-size: 0.95rem; }
.lock-icon {
  grid-row: 1 / span 3;
  position: relative;
  width: 34px;
  height: 26px;
  margin-top: 16px;
  border-radius: 6px;
  background: var(--amber);
  transition: background-color 0.2s;
}
.lock-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 100%;
  width: 20px;
  height: 16px;
  border: 4px solid var(--amber);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  transform-origin: 100% 100%;
  transition: transform 0.25s, border-color 0.2s;
}
.lock.broken { border-color: var(--threat); }
.lock.broken .lock-icon { background: var(--threat); }
.lock.broken .lock-icon::before { border-color: var(--threat); transform: rotate(38deg) translateY(-3px); }
.lock.broken .lock-state { color: var(--threat); }
.lock-join {
  grid-column: 1 / -1;
  height: 2.2rem;
  margin: 0 25%;
  border: 2px solid var(--slate);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  position: relative;
}
.lock-join::after { content: ""; position: absolute; left: 50%; top: 100%; height: 1rem; border-left: 2px solid var(--slate); }
.lock.session { grid-column: 1 / -1; grid-template-columns: 1fr; justify-self: center; min-width: min(100%, 22rem); margin-top: 1rem; text-align: center; border-color: var(--amber); }
.lock.session h3, .lock.session p { grid-column: 1; }
.lock.session.broken { border-color: var(--threat); background: rgba(226, 77, 139, 0.12); }

.bytes { display: grid; gap: 1.1rem; }
.bytes-row { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 0.3rem 1.2rem; align-items: start; }
.bytes-row p { margin: 0; line-height: 1.3; }
.bytes-row .what { font-weight: 700; }
.bytes-row .size { color: var(--mist); font-family: var(--mono); font-size: 0.92rem; }
.squares { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 0.25rem; }
.sq { width: 9px; height: 9px; border-radius: 2px; background: var(--slate); }
.sq.pq { background: var(--amber); }

/* ------------------------------------------------------------------- probe */

.controls.wrap { align-items: stretch; gap: 0.5rem; }
.probe { margin-top: 0.4rem; }
.probe-ends { display: flex; justify-content: space-between; margin-bottom: 0.6rem; color: var(--mist); font-family: var(--mono); font-size: 0.92rem; }
.probe-steps { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.probe-steps li {
  position: relative;
  display: grid;
  gap: 0.05rem;
  padding: 0.5rem 0 0.95rem;
  animation: arrive 0.35s both;
  animation-delay: calc(var(--i, 0) * 0.22s);
}
.probe-steps .msg { font-family: var(--mono); font-weight: 700; font-size: 0.98rem; }
.probe-steps .detail { color: var(--mist); font-size: 0.95rem; line-height: 1.35; }
.probe-steps li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.38rem;
  height: 2px;
  background: var(--slate);
}
.probe-steps li::before {
  content: "";
  position: absolute;
  bottom: calc(0.38rem - 4px);
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--slate);
  border-right: 2px solid var(--slate);
}
.probe-steps .out::before { right: 1px; transform: rotate(45deg); }
.probe-steps .in { text-align: right; justify-items: end; }
.probe-steps .in::before { left: 1px; transform: rotate(-135deg); }
.probe-steps .in.yes::after { background: var(--amber); }
.probe-steps .in.yes::before { border-color: var(--amber); }
.probe-steps .none { text-align: right; justify-items: end; }
.probe-steps .none .msg { color: var(--mist); font-weight: 400; }
.probe-steps .none::after { left: 55%; background: none; border-top: 2px dashed var(--slate); height: 0; }
.probe-steps .none::before { left: calc(55% - 12px); bottom: calc(0.38rem - 6px); width: 12px; height: 12px; border: 0; background:
  linear-gradient(45deg, transparent 43%, var(--threat) 43%, var(--threat) 57%, transparent 57%),
  linear-gradient(-45deg, transparent 43%, var(--threat) 43%, var(--threat) 57%, transparent 57%); }
.probe-steps .think { padding: 0.55rem 0.9rem; border-left: 3px solid var(--gold); background: rgba(14, 26, 58, 0.6); border-radius: 0 10px 10px 0; margin: 0.3rem 0; }
.probe-steps .think::before, .probe-steps .think::after { content: none; }
.probe-steps .think .msg { font-family: var(--text); font-weight: 400; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.verdict {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--slate);
  border-radius: 12px;
  background: var(--sunk);
}
.verdict.yes { border-left-color: var(--amber); }
.verdict.unknown { border-left-style: dashed; }
.verdict h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.verdict p { margin: 0; color: var(--mist); }
.verdict .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.chip { padding: 0.15rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--paper); font-family: var(--mono); font-size: 0.88rem; }

/* ----------------------------------------------------------------- results */


.dots svg circle { transition: cx 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), cy 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.dots .yes { fill: var(--amber); }
.dots .no { fill: none; stroke: var(--slate); stroke-width: 1.4; }
.dots .old { fill: none; stroke: var(--slate); stroke-width: 1.4; stroke-dasharray: 1.6 1.6; }
.dots circle.lit { stroke: var(--paper); stroke-width: 2; }
.dots .group-label { fill: var(--paper); font-size: 13px; font-weight: 700; }
.dots .group-note { fill: var(--mist); font-size: 12px; }

.bars-plot .track { fill: var(--sunk); }
.bars-plot .fill { fill: var(--amber); }
.bars-plot .whisker { stroke: var(--paper); stroke-width: 1.5; }
.bars-plot .value { fill: var(--paper); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.bars-plot .label { fill: var(--paper); font-size: 13px; }

.table-wrap { max-width: var(--measure); margin: 2rem auto; overflow-x: auto; }
.fig .table-wrap { max-width: none; margin: 0; }
.table-wrap.twin { margin-top: 1.2rem; }
.table-wrap.tall { max-height: 30rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; line-height: 1.35; }
caption { padding-bottom: 0.6rem; color: var(--quiet); font-size: 0.92rem; text-align: left; }
th, td { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: var(--quiet); font-family: var(--text); font-weight: 400; font-size: 0.9rem; white-space: nowrap; }
tbody th { font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

table.bars td.meter { width: 52%; min-width: 9rem; }
.bar-cell { display: grid; grid-template-columns: minmax(0, 1fr) 3.6rem; align-items: center; gap: 0.6rem; }
.bar-track { display: block; height: 12px; border-radius: 4px; background: var(--sunk); }
.bar-fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--amber); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; }

/* Who has to act, said above a table that names providers beside results. */
.fig-note { max-width: 46rem; margin: 0 0 1.4rem; padding: 0.85rem 1.1rem; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: var(--sunk); color: var(--paper); font-size: 0.97rem; line-height: 1.55; }
.lookup thead th { position: sticky; top: 0; z-index: 1; padding: 0.6rem 0.75rem; background: var(--sunk); }
.lookup td, .lookup tbody th { padding-left: 0.75rem; }
.lookup .host { font-family: var(--mono); font-weight: 400; white-space: nowrap; }
.lookup .via { display: block; color: var(--mist); font-size: 0.86rem; }
.lookup .folded { display: none; font-family: var(--text); }
.result { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.result .key { width: 0.75rem; height: 0.75rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1.8rem; }
.card { padding: 1.25rem 1.3rem 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
.card h3 { margin: 0 0 0.7rem; font-size: 1.08rem; line-height: 1.3; }
.card p { margin: 0; color: var(--mist); font-size: 0.98rem; line-height: 1.5; }
.card p .n { color: var(--paper); font-variant-numeric: tabular-nums; }
.card .card-figure { margin-bottom: 0.6rem; color: var(--paper); font-size: 2.3rem; font-weight: 700; line-height: 1.1; }
.card .card-figure small { color: var(--mist); font-size: 0.48em; font-weight: 400; }
.card .card-figure small span { color: var(--mist); }
.split { display: flex; gap: 2px; height: 14px; margin: 0.2rem 0 0.9rem; }
.split span { display: block; min-width: 4px; border-radius: 3px; }
.swatch { display: inline-block; width: 0.72em; height: 0.72em; margin-right: 0.35em; border-radius: 2px; }
.s-refused { background: var(--slate); }
.s-tls12 { border: 2px dashed var(--slate); }
.s-passed { background: var(--paper); }

/* ---------------------------------------------------------- the tool's page */

.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: var(--wide); margin: 0 auto; padding: 0; list-style: none; }
.dl {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  padding: 1.2rem 1.25rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.dl.yours { border: 2px solid var(--ground); padding: calc(1.2rem - 1px) calc(1.25rem - 1px) calc(1.3rem - 1px); }
.dl h3 { margin: 0; font-size: 1.3rem; }
.dl .yours-note { margin: 0; color: var(--accent); font-family: var(--mono); font-size: 0.84rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.dl p { margin: 0; color: var(--quiet); font-size: 0.97rem; line-height: 1.45; }
/* The buttons sit on the bottom edge, so they line up across the three cards
   however long the text above them is. */
.dl ul { display: grid; gap: 0.5rem; margin: auto 0 0; padding: 0.4rem 0 0; list-style: none; }
.dl .button { justify-content: space-between; width: 100%; border-radius: 12px; }
.dl .button small { font-family: var(--mono); font-size: 0.8rem; font-weight: 400; opacity: 0.85; }
.dl .file { display: block; padding: 0.5rem 0.8rem; border: 1px dashed var(--edge); border-radius: 12px; font-family: var(--mono); font-size: 0.84rem; overflow-wrap: anywhere; }
.dl .file b { display: block; font-family: var(--text); font-size: 0.97rem; }
.under { max-width: var(--wide); margin: 1.1rem auto 0; color: var(--quiet); font-size: 0.97rem; }

.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
.step { min-width: 0; }
.step h2 { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 0.9rem; font-size: 1.5rem; line-height: 1.2; }
.step h3 { margin: 1.5rem 0 0.5rem; font-size: 1.1rem; }
.step-n {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--ground);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
}
.step p { margin: 0 0 1rem; }
.step ol, .step ul { margin: 0 0 1rem; padding-left: 1.3rem; }
.step li { margin-bottom: 0.5rem; }
.os { margin: 0 0 0.7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.os summary { padding: 0.75rem 1rem; font-weight: 700; cursor: pointer; }
.os[open] summary { border-bottom: 1px solid var(--line); }
.os-body { padding: 1rem 1rem 0.2rem; }
/* A video with its description. The description is the video in words. */
.demo { margin: 1.6rem 0 2rem; }
.demo video { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); }
.demo figcaption { margin-top: 0.7rem; color: var(--quiet); font-size: 0.95rem; }
pre {
  margin: 0 0 1rem;
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  border: 1px solid rgba(127, 141, 179, 0.3);
  border-radius: 12px;
  background: var(--sunk);
  color: var(--paper);
  font-size: 0.9rem;
  line-height: 1.5;
  tab-size: 4;
}
pre code { font-size: inherit; color: inherit; }
pre.term { font-size: 0.75rem; }
/* A command, marked up by tools/site. What is typed first is heavy, its
   options take the accent, and the punctuation steps back. None of these is a
   colour that carries data. */
pre.cmd .tk { font-weight: 700; }
pre.cmd .tf { color: var(--gold); }
pre.cmd .ts { color: var(--gold); }
pre.cmd .to, pre.cmd .tc { color: var(--mist); }
.grades { margin: 0 0 1rem; }
.grades div { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.grades div:last-child { border-bottom: 0; }
.grades dt { font-family: var(--mono); font-weight: 700; }
.grades dd { margin: 0; }
.fixes { margin: 0; }
.fixes dt { margin: 1.2rem 0 0.45rem; font-weight: 700; }
.fixes dd { margin: 0; }
.fixes dd p { color: var(--quiet); }

.limits, .sources { margin: 0; padding-left: 1.2rem; }
.limits li, .sources li { margin-bottom: 0.8rem; }

/* ------------------------------------------------------------------ footer */

.foot { margin-top: 0; padding: clamp(2.4rem, 5vw, 3.4rem) var(--gutter) 2.4rem; font-size: 0.97rem; }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3rem; max-width: var(--wide); margin: 0 auto; }
/* The offer of help, over the footer's lists. */
.foot-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2.5rem; max-width: var(--wide); margin: 0 auto 2.6rem; padding: 1.4rem 1.6rem; border: 1px solid var(--line); border-radius: 16px; background-color: var(--raised); }
.foot-help div { flex: 1 1 22rem; min-width: 0; }
.foot-help p { max-width: 44rem; margin: 0; color: var(--paper); }
.foot-about p { margin: 0 0 0.8rem; color: var(--mist); max-width: 24rem; }
.foot-about .mark { color: var(--paper); font-size: 1.05rem; }
.foot h2 { margin: 0 0 0.7rem; color: var(--mist); font-family: var(--mono); font-size: 0.84rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.foot ul { margin: 0; padding: 0; list-style: none; }
.foot li { margin-bottom: 0.45rem; }
.foot li a { color: var(--paper); text-decoration: none; }
.foot li a:hover { text-decoration: underline; }
.foot-small { max-width: var(--wide); margin: 2.2rem auto 0; padding-top: 1.3rem; border-top: 1px solid var(--line); color: var(--mist); font-size: 0.9rem; }

.tip {
  position: fixed;
  z-index: 40;
  max-width: 17rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--slate);
  border-radius: 10px;
  background: var(--sunk);
  color: var(--paper);
  font-size: 0.9rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tip b { display: block; }
.tip span { color: var(--mist); }

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

@media (max-width: 1000px) {
  .tiles.five { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}
@media (max-width: 860px) {
  .dh { grid-template-columns: 1fr; }
  .dims { grid-template-columns: 1fr; }
  .eve { grid-template-columns: 1fr; }
  .downloads { grid-template-columns: 1fr; }
  .tiles.three { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
}
@media (max-width: 1039px) {
  /* The bar's links need about a thousand pixels in one row, so below that
     they fold away. Without the menu button, which needs a script, the bar becomes two rows
     and stays at the top of the page, where it does not take a fifth of a
     small screen while reading. */
  .bar { position: static; flex-wrap: wrap; }
  .bar nav { flex: 1 0 100%; margin-left: -0.6rem; }
  .bar ul { flex-wrap: wrap; }
  .bar::after { content: none; }
  html { scroll-padding-top: 1rem; }

  /* With it, the bar is one short row that stays in view, and the links open
     under it as a list laid over the page, so nothing below moves. */
  .bar.has-menu { position: sticky; }
  @supports (animation-timeline: scroll()) {
    .bar.has-menu::after { content: ""; }
  }
  html:has(.bar.has-menu) { scroll-padding-top: 4.5rem; }
  .bar.has-menu { column-gap: 0.7rem; }
  .bar.has-menu .bar-go { order: 1; margin-left: auto; }
  .bar.has-menu .bar-go + .menu-button, .bar.has-menu .menu-button { order: 2; }
  .bar.has-menu:has(.bar-go) .menu-button { margin-left: 0; }
  .bar.has-menu .menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    margin: -0.25rem -0.4rem -0.25rem auto;
    padding: 0.4rem 0.85rem 0.4rem 0.7rem;
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: transparent;
    color: var(--paper);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
  }
  .menu-button svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .menu-button .menu-cross, .menu-button[aria-expanded="true"] .menu-bars { display: none; }
  .menu-button[aria-expanded="true"] .menu-cross { display: inline; }
  .bar.has-menu .menu-button[aria-expanded="true"] { background: var(--paper); border-color: var(--paper); color: var(--ground); }
  .bar.has-menu nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 4.5rem);
    margin: 0;
    padding: 0 calc(var(--gutter) - 0.9rem);
    overflow-y: auto;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(5, 10, 26, 0.5);
  }
  .bar.has-menu.open nav { display: block; }
  .bar.has-menu ul { flex-direction: column; flex-wrap: nowrap; gap: 0.15rem; padding: 0.6rem 0 0.8rem; }
  .bar.has-menu li a { padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 1.05rem; }
}
@media (max-width: 430px) {
  /* Room for the way to the checker beside the menu button. The button keeps
     its sign, and its name is still read out. */
  .bar.has-menu .menu-button { padding: 0.4rem 0.65rem; }
  .bar.has-menu .menu-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 640px) {
  :root { --gutter: 1.1rem; }
  body { font-size: 1.05rem; }
  #bb-canvas { aspect-ratio: 4 / 3; }
  .bar ul { gap: 0; }
  .bar li a { padding: 0.45rem 0.38rem; font-size: 0.85rem; }
  .hero::after { background: rgba(10, 20, 48, 0.8); }
  .stats { grid-template-columns: 1fr; }
  .locks { grid-template-columns: 1fr; gap: 0.8rem; }
  .lock-join { display: none; }
  .bytes-row { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row img { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-link.next { text-align: left; }
  .foot-inner { grid-template-columns: 1fr; }
  th, td { padding-right: 0.5rem; }
  table.bars td.meter { width: 46%; min-width: 7rem; }
  .twin table { font-size: 0.88rem; }
  .twin thead th { white-space: normal; vertical-align: bottom; }
  /* The rows keep the site's number and its result. What sat between them
     moves under the number, so nothing has to be scrolled sideways for. */
  .lookup tr > :nth-child(2), .lookup tr > :nth-child(3) { display: none; }
  .lookup .folded { display: block; white-space: normal; }
  .lookup .result { white-space: normal; }
  .gist p { font-size: 1.12rem; }
}

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

@media print {
  .bar, .lesson-nav, .hero-links, .skip { display: none; }
  .fig { box-shadow: none; break-inside: avoid; }
}
