/* Copyright (c) 2026 Cernanto. All rights reserved. */
/* SPDX-License-Identifier: LicenseRef-Cernanto-Proprietary */

/* JetBrains Mono is under the SIL Open Font License 1.1, published beside
   the files as /assets/fonts/jetbrains-mono-license.txt. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-400.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-600.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* One neutral and one accent. The grounds are warm paper and the inks are the
   logo's navy in three tones. Orange fills and marks; where it has to be read
   as text on a light ground it is the darker --accent-text. */
:root {
  color-scheme: light dark;
  --ground: #f5f4f0;
  --surface: #fbfaf7;
  --sunken: #eeede8;
  --ink: #131b2c;
  --ink-secondary: #4a566e;
  --ink-muted: #5c6880;
  --accent: #ff8a1f;
  --accent-text: #9a4e15;
  --on-accent: #131b2c;
  --border: #dbdde1;
  --border-strong: #c3c8d0;
  --light-only: block;
  --dark-only: none;
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 6px;
  --motion: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:
    'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, Menlo, monospace;
  --gutter: 1.5rem;
  --site-width: 67.5rem;
  --measure: 68ch;
  --band: clamp(4rem, 9vw, 7rem);
  --header: 4.5rem;
  font-family: var(--font-body);
}

/* The dark theme stands in two places: where the system asks for it and the
   visitor has not chosen light, and where the visitor chose it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #0a0e18;
    --surface: #121826;
    --sunken: #070a12;
    --ink: #e7eaf0;
    --ink-secondary: #a7b0bf;
    --ink-muted: #8e98aa;
    --accent-text: #ff8a1f;
    --border: #232b3b;
    --border-strong: #343e52;
    --light-only: none;
    --dark-only: block;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ground: #0a0e18;
  --surface: #121826;
  --sunken: #070a12;
  --ink: #e7eaf0;
  --ink-secondary: #a7b0bf;
  --ink-muted: #8e98aa;
  --accent-text: #ff8a1f;
  --border: #232b3b;
  --border-strong: #343e52;
  --light-only: none;
  --dark-only: block;
}

:root[data-theme='light'] {
  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-inline-size: 0;
  background: var(--ground);
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img {
  max-inline-size: 100%;
  block-size: auto;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong,
b {
  color: var(--ink);
  font-weight: 600;
}

a :is(strong, b) {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

:where([id]) {
  scroll-margin-top: calc(var(--header) + 1.25rem);
}

button {
  font: inherit;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-feature-settings:
    'liga' 0,
    'calt' 0;
  tab-size: 2;
}

code,
kbd,
samp {
  color: var(--ink);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

a code {
  color: inherit;
}

pre code {
  font-size: inherit;
}

.container {
  inline-size: min(var(--site-width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 10;
  inset-block-start: 0.75rem;
  inset-inline-start: var(--gutter);
  padding: 0.55rem 1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

/* Header */

.site-header {
  position: sticky;
  z-index: 5;
  inset-block-start: 0;
  border-block-end: 1px solid var(--border);
  background: var(--ground);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  backdrop-filter: saturate(120%) blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-block-size: var(--header);
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  text-decoration: none;
}

.logo {
  inline-size: auto;
  max-inline-size: none;
  block-size: 2.5rem;
}

.logo-light {
  display: var(--light-only);
}

.logo-dark {
  display: var(--dark-only);
}

.site-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  margin-inline-start: 1rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-block: 0.45rem;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--motion) var(--ease);
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

.project-link svg {
  flex: none;
  inline-size: 1.05rem;
  block-size: 1.05rem;
}

/* A footer link with a mark stays in the line of text it stands in: its
   words share the line's baseline with the words beside it, and the mark
   is set against them. */
.footer-inner .project-link {
  white-space: nowrap;
}

.footer-inner .project-link svg {
  margin-inline-end: 0.15rem;
  vertical-align: -0.22em;
}

.theme-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  inline-size: 2.125rem;
  block-size: 2.125rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  transition:
    color var(--motion) var(--ease),
    border-color var(--motion) var(--ease);
}

.theme-toggle:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.theme-toggle svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .moon {
  display: var(--light-only);
}

.theme-toggle .sun {
  display: var(--dark-only);
}

.install-link,
.proof-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color var(--motion) var(--ease),
    filter var(--motion) var(--ease);
}

.install-link {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.install-link:hover {
  filter: brightness(1.05);
}

.proof-link {
  border-color: var(--border-strong);
  color: var(--ink);
}

.proof-link:hover {
  border-color: var(--ink-muted);
}

/* Homepage: an opening, then one band a subject, a hairline between */

.homepage {
  padding-block-start: clamp(3rem, 7vw, 5rem);
}

/* The opening: the promise, what Cernanto is, and the way in */

.hero {
  max-inline-size: 58rem;
  margin-inline: auto;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.08;
}

.hero-tagline {
  max-inline-size: 46rem;
  margin: 1.5rem auto 0;
  color: var(--ink);
  font: 400 clamp(1.1rem, 2vw, 1.3rem) / 1.45 var(--font-display);
  text-wrap: balance;
}

.hero-title {
  display: block;
  font-weight: 600;
}

.hero-clause {
  display: inline-block;
  max-inline-size: 100%;
}

/* The accent goes on the words that carry the claim, on a line of their own
   where they close the promise. */
.hl-answer {
  color: var(--accent-text);
}

.hero h1 > .hl-answer {
  display: block;
}

/* The opening's two ways on: the install, and the example under it */
.band-opening > p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 2.25rem 0 0;
}

.band-opening > p > a {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
  transition:
    border-color var(--motion) var(--ease),
    filter var(--motion) var(--ease);
}

.band-opening > p > a:hover {
  border-color: var(--ink-muted);
}

.band-opening > p > a:first-child {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.band-opening > p > a:first-child:hover {
  border-color: transparent;
  filter: brightness(1.05);
}

/* A band: its label, its claim, a few lines under it, then what shows it */

.band {
  position: relative;
  margin-block-start: var(--band);
  padding-block-start: var(--band);
}

.band-opening {
  margin-block-start: 0;
  padding-block-start: 0;
}

/* The example stands right under the opening as its proof, no rule between. */
.band-proof {
  margin-block-start: clamp(3.5rem, 7vw, 5rem);
  padding-block-start: 0;
}

/* A hairline across the whole viewport, drawn as a clipped shadow so that it
   adds nothing to the page's width. */
.band:not(.band-opening, .band-proof)::before {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--border);
  box-shadow: 0 0 0 100vmax var(--border);
  clip-path: inset(0 -100vmax);
  content: '';
}

.band-label {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font: 600 0.95rem/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.band > h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.1vw, 2rem);
  line-height: 1.18;
  text-align: center;
}

/* A heading of several sentences breaks between them before it breaks inside
   one: a sentence stays whole on its line while the line holds it. */
.band > h2 > .sentence {
  display: inline-block;
}

.band > h3 {
  margin: 3.5rem 0 0;
  font-size: 1.3rem;
  text-align: center;
}

/* A centred paragraph's lines are evened, so that it is not left with a word
   or two alone on its last line. */
.band > p {
  max-inline-size: 66ch;
  margin: 1.25rem auto 0;
  text-align: center;
  text-wrap: balance;
}

.band > h2 + p {
  font-size: 1.1rem;
}

.band > ul + p {
  margin-block-start: 2rem;
}

.band > p:last-child {
  max-inline-size: 80ch;
  margin-block-start: 2rem;
  font-size: 0.95rem;
}

.band > .terminal {
  max-inline-size: 46rem;
  margin: 2.5rem auto 0;
  text-align: start;
}

.band:is(.band-compiler, .band-judgment, .band-runtime) > .terminal {
  max-inline-size: 58rem;
}

.band > .terminal + p {
  margin-block-start: 1rem;
  font-size: 0.95rem;
}

/* Several runs of one file in one well, a rule between them */
.excerpt-runs pre + pre {
  margin-block-start: 0.9rem;
  padding-block-start: 0.9rem;
  border-block-start: 1px dashed var(--border-strong);
}

/* A page's own lines over the code the compile made of them: the well of the
   lines, then the well of the code, each run of it under what it is. */
.band > .clauses {
  max-inline-size: 58rem;
  margin: 2.5rem auto 0;
  text-align: start;
}

.band > .clauses + p {
  margin-block-start: 1.5rem;
}

.clauses > .terminal {
  margin-block: 0 1rem;
}

.clauses > .proof-actions {
  margin-block-start: 1rem;
}

/* Over a run: the kind of thing it is, and the clause of the page it came
   from. A call to a model carries the accent, and plain code a hairline. */
.run-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
  margin: 1.2rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.terminal-head + .run-label {
  margin-block-start: 0.8rem;
}

.run-label + pre {
  margin-block-start: 0.35rem;
}

.run-kind {
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--ink);
  font: 600 0.72rem/1.5 var(--font-mono);
}

/* A run that asks one of Cernanto's agents is named in the accent, in the
   thin outline a run of plain code has: a label, never a button. */
.run-kind.is-model {
  color: var(--accent-text);
}

/* What a page says of an account, beside the steps its agent asks with */
.band > .ask-pair {
  max-inline-size: 58rem;
  margin: 2.5rem auto 0;
  text-align: start;
}

.band > .ask-pair + p {
  margin-block-start: 1.5rem;
}

.ask-pair blockquote {
  margin: 0;
}

.ask-pair .comparison-state p:first-of-type {
  font-size: 1rem;
}

.ask-pair .comparison-state .ask-help {
  margin-block: 0 0.6rem;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.9rem;
}

.ask-pair ol {
  margin: 0;
  padding-inline-start: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ask-pair li + li {
  margin-block-start: 0.4rem;
}

.band > .refund-panel {
  margin-block-start: 2.25rem;
}

.band > .refund-panel + p {
  margin-block-start: 2.5rem;
}

.refund-panel > :is(h2, h3) {
  margin: 0;
  text-align: center;
}

.refund-panel > h3 {
  font-size: 1.3rem;
}

.refund-context {
  max-inline-size: 62ch;
  margin: 0.9rem auto 0;
  font-size: 1.05rem;
  text-align: center;
  text-wrap: balance;
}

.refund-context span {
  display: block;
}

/* The band opens on what a prompted agent does and, on a line of its own,
   what a compiled policy does: the second stands in the ink, and its claim
   in the accent, the colour of what Cernanto does. The paragraph is wide
   enough for its first sentence to close on its second line, and its lines
   are evened so that none is left with a stray word or two. */
.band-proof > h2 + p {
  max-inline-size: 76ch;
  text-wrap: balance;
}

.band-proof > h2 + p em {
  display: block;
  color: var(--ink);
  font-style: normal;
  text-wrap: balance;
}

.band-proof > h2 + p strong {
  color: var(--accent-text);
  white-space: nowrap;
}

.page-meta {
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.page-meta a {
  color: inherit;
}

/* A post stands under who wrote it and the day it went out, and its card in
   the blog's list carries the day under the title. */
.post-signature {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.section-links li .post-day {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

/* A sentence of a page shown as what it is, source: the lines of its file
   under the file's name, numbered as the file numbers them, the word a
   change edits in the accent. The well is as wide as the figure it stands
   in, between the two answers and the table of checks. */
.source-lines {
  text-align: start;
}

.source-lines ol {
  margin: 0.6rem 0 0;
  padding-inline-start: 2.4rem;
  color: var(--ink);
  font: 400 0.875rem/1.7 var(--font-mono);
}

.source-lines li::marker {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.source-lines li code {
  font-size: inherit;
  white-space: pre-wrap;
}

.source-lines strong {
  color: var(--accent-text);
}

.source-lines .source-more {
  color: var(--ink-muted);
}

/* An agent's own lines where a text speaks of them: the well of the lines,
   and under it the link to them in the release. The lines keep the rhythm
   they have everywhere, whatever a list's items are given around them. */
.source-shown {
  margin-block: 1.5rem;
}

.source-shown > .terminal {
  margin-block: 0;
}

/* The well is as wide as the text column, and a line of the file takes all of
   it before it wraps. */
.source-shown .source-lines ol {
  max-inline-size: none;
}

.source-shown .source-lines li + li {
  margin-block-start: 0;
}

.source-actions {
  margin: 0.6rem 0 0;
}

/* One order asked for in several wordings under one policy: each message a
   customer wrote, over what the reply said and beside the outcome it got,
   every outcome set alike. */
.outcomes {
  position: relative;
  margin-block-start: 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: start;
}

.asked {
  inline-size: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.asked :is(th, td) {
  padding: 0.85rem clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 400;
  text-align: start;
  vertical-align: baseline;
}

.asked thead th {
  padding-block: 1.2rem 0;
}

/* The answers keep one column, as wide as its heading. */
.asked thead th:last-child {
  inline-size: 13rem;
}

.asked tbody tr + tr td {
  border-block-start: 1px solid var(--border);
}

.asked-message {
  display: block;
  color: var(--ink);
  font: 400 1.05rem/1.5 var(--font-display);
  text-wrap: balance;
}

/* A message breaks where it pauses when a line cannot hold all of it: between
   two sentences first, and after a comma inside a sentence that is still too
   long. What takes several lines hangs from the line's top, so the outcome
   beside it stays level with the message's first line. */
.asked-message span {
  display: inline-block;
  vertical-align: top;
}

.asked-reply {
  display: block;
  margin-block-start: 0.45rem;
  color: var(--ink-secondary);
  font: 400 0.9rem/1.5 var(--font-body);
  text-wrap: pretty;
}

.asked-reply-label {
  margin-inline-end: 0.3rem;
}

.asked strong {
  color: var(--ink);
  font: 600 1.3rem/1.3 var(--font-display);
  letter-spacing: -0.01em;
}

.refund-point {
  max-inline-size: 62ch;
  margin: 1.6rem auto 0;
  color: var(--ink);
  font: 400 1.3rem/1.4 var(--font-display);
  text-align: center;
  text-wrap: balance;
}

.proof-grid {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.policy-checks {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: start;
}

/* The table says over its columns which version of the sentence it shows. */
.policy-checks caption {
  padding: 0.9rem clamp(1rem, 2vw, 1.5rem);
  border-block-end: 1px solid var(--border);
  color: var(--ink);
  font-weight: 600;
  text-align: start;
}

.policy-checks :is(th, td) {
  padding: 0.9rem clamp(1rem, 2vw, 1.5rem);
  text-align: start;
}

/* A small label over a figure, a column or a group */
.policy-checks thead th,
.asked thead th,
.asked-reply-label,
.proof-label,
.tool-caption,
.comparison-state :where(h2, h3, h4) {
  color: var(--ink-muted);
  font: 400 0.72rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.policy-checks tbody :is(th, td) {
  border-block-start: 1px solid var(--border);
}

.policy-checks tbody th {
  inline-size: 36%;
  color: var(--ink);
  font-weight: 400;
}

.policy-checks code {
  font-size: 0.88rem;
}

.policy-checks .deciding-check {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.policy-checks .deciding-check th {
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}

.deciding-check code {
  font-weight: 600;
}

.check-note {
  display: block;
  margin-block-start: 0.35rem;
  color: var(--accent-text);
  font: 600 0.68rem/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proof-label {
  display: block;
  margin: 0;
}

.proof-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin: 2rem 0 0;
}

/* What a visitor needs and what Cernanto works with: four cards, each a
   caption, the products under their marks, and a line of what it asks */

.band > .toolchain-groups {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-inline-size: none;
}

.toolchain-groups a {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem 1.4rem;
}

.brand-choice {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.toolchain-groups .brand-mark {
  flex: none;
  inline-size: 2rem;
  block-size: 2rem;
}

/* A drawing that fills less of its square than its neighbours is set larger. */
.toolchain-groups .brand-claude-code {
  inline-size: 2.5rem;
}

.brand-choice img {
  object-fit: contain;
  filter: grayscale(1);
}

.brand-choice strong {
  font: 600 0.85rem/1.3 var(--font-mono);
}

.toolchain-groups a:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.band .tool-note {
  margin-block-start: 1rem;
}

/* The same marks as one slim row under the example, where a visitor first
   asks whether it fits what they have */
.band-works {
  padding-block-start: 3.5rem;
}

.band-works + .band {
  margin-block-start: 3.5rem;
}

.band-works > .band-label {
  margin-block-end: 2rem;
}

.band-works > .toolchain-groups {
  margin-block-start: 0;
}

.band-works > .toolchain-groups > li {
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
}

.band-works .toolchain-groups a {
  align-items: center;
}

.band-works .tool-caption {
  text-align: center;
}

.band-works .brand-choices {
  justify-content: center;
}

/* A band's own marks: a product's beside another's, over a card's title */
.band li > p:first-child > .brand-mark + .brand-mark {
  margin-inline-start: 0.75rem;
}

/* Cards: a band's points and a section's pages */

.band > ul,
.section-links {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.band > ul {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-inline-size: 58rem;
  margin: 2.5rem auto 0;
}

/* Three points stand three to a line, and so do the three examples among the
   steps of a start, which are cards where its questions are a list. */
.band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime) > ul,
.band-begin > ul:has(> li > :is(h3, h4)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-inline-size: none;
}

/* Two points stand two to a line, at the width a pair has in another band,
   so that no place stays empty beside them, and so do four, as two pairs. */
.band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
  > ul:has(> li:nth-child(2):last-child),
.band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
  > ul:has(> li:nth-child(4):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-inline-size: 58rem;
}

/* Five points stand as three and a pair: the pair shares its line in halves,
   so that no place stays empty beside it. */
.band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
  > ul:has(> li:nth-child(5):last-child) {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
  > ul:has(> li:nth-child(5):last-child)
  > li {
  grid-column: span 2;
}

.band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
  > ul:has(> li:nth-child(5):last-child)
  > li:nth-child(n + 4) {
  grid-column: span 3;
}

.band > ul > li,
.section-links li {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.band > ul > li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* A mark stands over the title of the card it belongs to. */
.band li > p:first-child:has(> :is(img, svg)) {
  display: flex;
  align-items: center;
  block-size: 2.5rem;
  margin-block-end: 1rem;
  color: var(--ink);
}

.band li :is(img, svg) {
  display: block;
  flex: none;
  inline-size: 2.25rem;
  block-size: 2.25rem;
}

.band li .npm-wordmark {
  inline-size: 4.7rem;
  block-size: 1.5rem;
}

/* A card's title is a heading one level under the heading over its list, so
   it looks the same whichever of the two levels it is. */
.band li :is(h3, h4),
.section-links li a {
  color: var(--ink);
  font: 600 1.05rem/1.3 var(--font-display);
  letter-spacing: -0.01em;
}

.band li :is(h3, h4) {
  margin: 0 0 0.5rem;
}

.band li p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* A card's links stand at its foot: a later paragraph that holds a link. A
   later paragraph of prose holds none, and is set as the first, a gap above. */
.band li > :is(h3, h4) ~ p + p:has(> a) {
  margin-block-start: auto;
  padding-block-start: 1rem;
  font-size: 0.9rem;
}

.band li > :is(h3, h4) ~ p + p:not(:has(> a)) {
  margin-block-start: 0.75rem;
}

/* A card's credit: the mark of what it rests on, beside the link to it. */
.band li > :is(h3, h4) ~ p + p:has(> .brand-mark) {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
}

/* A row of links: every link stays whole, so a row that takes several lines
   breaks between two links, and its lines are evened. On a page the links
   stand apart by a space, in place of the dot of the page's source, since a
   dot would begin or end a line wherever the row breaks. A row under a band
   may take the band's width, to stand on one line where it can; a row that
   stands at the start of its lines draws back by its first link's space. */
.link-row a {
  display: inline-block;
}

:is(.band, .prose) .link-row {
  line-height: 1.9;
  text-wrap: balance;
}

:is(.band, .prose) .link-row .link-dot {
  display: none;
}

:is(.band, .prose) .link-row a {
  margin-inline: 0.65rem;
}

.band > p.link-row {
  max-inline-size: none;
}

.band li .link-row,
.prose .link-row {
  margin-inline: -0.65rem;
}

/* At a card's foot a row of links keeps the line of a single link, so the
   feet of neighbouring cards stand level. */
.band li .link-row {
  line-height: inherit;
}

/* The firebird carries its name in small letters, so it stands larger. */
.band li .brand-criu {
  inline-size: 3rem;
  block-size: 3rem;
}

/* The questions that close a start are a list of links, a hairline under
   each: the list of the start that holds no card. */
.band-begin > ul:not(:has(> li > :is(h3, h4))) {
  gap: 0 2.5rem;
  margin-block-start: 1.25rem;
}

.band-begin > ul:not(:has(> li > :is(h3, h4))) > li {
  padding: 0.7rem 0;
  border: 0;
  border-block-end: 1px solid var(--border);
  border-radius: 0;
  background: none;
  font-size: 0.95rem;
}

/* Eight questions in the accent weigh the end of the page down: they stand in
   the ink, and take the accent under the pointer or the keyboard. */
.band-begin > ul:not(:has(> li > :is(h3, h4))) > li a {
  color: var(--ink);
  text-decoration-color: var(--border-strong);
}

.band-begin > ul:not(:has(> li > :is(h3, h4))) > li a:is(:hover, :focus-visible) {
  color: var(--accent-text);
  text-decoration-color: currentColor;
}

/* The way in, as the header draws it */
.band-begin > p > a:only-child[href='/install'] {
  display: inline-flex;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: filter var(--motion) var(--ease);
}

.band-begin > p > a:only-child[href='/install']:hover {
  filter: brightness(1.05);
}

/* The road from a page to a package: a step a line, a rule between them */

.steps {
  max-inline-size: 52rem;
  margin: 2.5rem auto 0;
  padding: 1rem 1.5rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--sunken);
}

.steps figcaption {
  display: block;
  margin-block-end: 0.6rem;
}

.steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding-block: 0.5rem;
  padding-inline-start: 1.6rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.steps li::before {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 0.2rem;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  content: '';
}

.steps li:not(:last-child)::after {
  position: absolute;
  inset-block: 1.5rem -1rem;
  inset-inline-start: calc(0.45rem - 0.5px);
  inline-size: 1px;
  background: var(--border-strong);
  content: '';
}

.steps code {
  font-weight: 600;
}

/* A step told in two lines has them evened, so that no word ends it alone. */
.steps li > span {
  text-wrap: balance;
}

/* A recorded run told as its moments: the moment is a few characters, so its
   column is narrow, and what a moment shows of the run stands under its
   words as the run had it. */
.steps.moments {
  max-inline-size: 58rem;
}

.steps.moments li {
  grid-template-columns: 3.5rem minmax(0, 1fr);
}

/* Under the road of a compile, a recorded compile keeps the road's width. */
.band-compiler .steps.moments {
  max-inline-size: 52rem;
}

.steps .moment-shown {
  display: block;
  margin-block-start: 0.35rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.homepage > .page-meta {
  margin-block-start: 2.5rem;
  text-align: center;
}

/* Two cards a line beside the contents, an odd last one taking the line. */
.section-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.5rem 0;
}

.section-links li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* A card is one link, the whole of it: its title's link reaches to the
   card's edges, an arrow in the accent says at rest that it leads somewhere,
   and a pointer or the keyboard on it darkens the frame, turns the title to
   the accent and moves the arrow. */
.section-links li {
  position: relative;
  transition: border-color var(--motion) var(--ease);
}

.section-links li a {
  display: block;
  padding-inline-end: 2rem;
  font-size: 1.1rem;
  text-decoration: none;
  text-wrap: balance;
  transition: color var(--motion) var(--ease);
}

.section-links li a::before {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  content: '';
}

.section-links li a::after {
  position: absolute;
  inset-block-start: 1.5rem;
  inset-inline-end: 1.5rem;
  color: var(--accent-text);
  font: 400 1.1rem/1.3 var(--font-body);
  content: '\2192';
  content: '\2192' / '';
  transition: transform var(--motion) var(--ease);
}

.section-links li:hover,
.section-links li:has(a:focus-visible) {
  border-color: var(--ink-muted);
}

.section-links li a:hover,
.section-links li a:focus-visible {
  color: var(--accent-text);
}

.section-links li a:hover::after,
.section-links li a:focus-visible::after {
  transform: translateX(0.2rem);
}

/* The keyboard's ring stands around the card it would open. */
.section-links li a:focus-visible {
  outline: none;
}

.section-links li:has(a:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.section-links li p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

/* A page of prose, with its contents beside it */

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
  align-items: start;
  gap: clamp(2rem, 6vw, 5rem);
  padding-block-start: clamp(2.5rem, 5vw, 4.5rem);
}

/* A page with no contents column gives its cards and tables the whole width. */
.page-layout:not(:has(> .toc)) {
  grid-template-columns: minmax(0, 1fr);
}

.page-layout:not(:has(> .toc)) .section-links {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.page-layout:not(:has(> .toc)) .section-links li {
  grid-column: auto;
}

.reading {
  min-inline-size: 0;
}

.page-title {
  margin: 0;
  font-size: clamp(1.85rem, 3.4vw, 2.4rem);
  line-height: 1.12;
}

.page-title + .page-meta {
  margin-block: 0.9rem 1.75rem;
}

/* A text written a phrase to a line breaks between its phrases before it
   breaks inside one: a phrase stays whole on its line while the line holds
   it. */
.prose .phrase {
  display: inline-block;
}

.toc {
  position: sticky;
  inset-block-start: calc(var(--header) + 1.5rem);
  max-block-size: calc(100vh - var(--header) - 3rem);
  overflow: auto;
  padding-inline-start: 1.25rem;
  border-inline-start: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mobile-toc {
  display: none;
}

.toc :is(h2, h3, p) {
  margin: 0 0 0.7rem;
  color: var(--ink-muted);
  font: 600 0.7rem/1.4 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ul,
.toc ol,
.mobile-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li + li,
.toc li > ul,
.mobile-toc li {
  margin-block-start: 0.45rem;
}

.toc li > ul {
  padding-inline-start: 0.9rem;
}

.toc a,
.mobile-toc a {
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color var(--motion) var(--ease);
}

.toc a:hover,
.mobile-toc a:hover {
  color: var(--ink);
}

.prose {
  margin-block-start: 1.75rem;
  overflow-wrap: anywhere;
}

.prose :where(p, ul, ol, blockquote, dl) {
  max-inline-size: var(--measure);
}

.prose :where(p, ul, ol, blockquote, dl, table, details) {
  margin-block: 1em;
}

.prose > :first-child {
  margin-block-start: 0;
}

/* A page that opens on an introduction sets it a size up. */
.has-lede > p:first-of-type {
  max-inline-size: 62ch;
  font-size: 1.125rem;
  line-height: 1.55;
}

.prose :where(h1, h2, h3, h4) {
  text-wrap: pretty;
}

.prose :where(h1, h2) {
  margin: 2.75rem 0 0.75rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.2;
}

.prose :where(h3, h4) {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

.prose > :where(h1, h2):first-child {
  margin-block-start: 0;
  padding-block-start: 0;
  border-block-start: 0;
}

.prose :where(ul, ol) {
  padding-inline-start: 1.4rem;
}

.prose li + li {
  margin-block-start: 0.35rem;
}

.prose li::marker {
  color: var(--ink-muted);
}

.prose blockquote {
  margin-inline: 0;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--border-strong);
}

.prose hr {
  block-size: 0;
  margin-block: 2rem;
  border: 0;
  border-block-start: 1px solid var(--border);
}

.prose summary {
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.prose .section-links {
  max-inline-size: none;
  padding-inline-start: 0;
}

.prose .section-links li {
  margin-block-start: 0;
}

/* Tables: hairline rows, the headings in ink */

.table-scroll {
  min-inline-size: 0;
  max-inline-size: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

/* A column is never narrower than its longest word, so no word of a table
   breaks in its middle; a table too wide for its place scrolls inside it.
   Code in a cell breaks after a slash or a hyphen, between the parts of a
   path, and nowhere inside one. */
.prose table,
.table-scroll table {
  inline-size: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: start;
  overflow-wrap: break-word;
}

.prose table code,
.table-scroll table code {
  overflow-wrap: break-word;
}

.prose :is(th, td),
.table-scroll :is(th, td) {
  padding: 0.75rem 1rem 0.75rem 0;
  border-block-end: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.prose th,
.table-scroll th {
  border-color: var(--border-strong);
  color: var(--ink);
  font-weight: 600;
}

/* A picture of the UI. The UI wears this site's own colours, so a picture
   of it in the page's look would melt into the page. It stands as a window
   in the other look: the page carries both pictures and shows the dark UI
   under the light look and the light UI under the dark one. The window's
   bar is drawn here, in the picture's own colours and never the page's, and
   says where the UI opens. */

.shot {
  --shot-ground: #fbfaf7;
  --shot-bar: #eeede8;
  --shot-field: #f5f4f0;
  --shot-line: #dbdde1;
  --shot-edge: #c3c8d0;
  --shot-ink: #5c6880;
  display: block;
  inline-size: fit-content;
  max-inline-size: 100%;
  overflow: hidden;
  border: 1px solid var(--shot-edge);
  border-radius: 10px;
  background: var(--shot-ground);
  box-shadow:
    0 1px 2px rgb(7 10 18 / 0.1),
    0 18px 44px -10px rgb(7 10 18 / 0.35);
}

.shot-dark {
  --shot-ground: #121826;
  --shot-bar: #070a12;
  --shot-field: #0a0e18;
  --shot-line: #232b3b;
  --shot-edge: #343e52;
  --shot-ink: #8e98aa;
}

.shot-on-light {
  display: var(--light-only);
}

.shot-on-dark {
  display: var(--dark-only);
}

.shot-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  block-size: 2.25rem;
  padding-inline: 0.75rem;
  border-block-end: 1px solid var(--shot-line);
  background: var(--shot-bar);
}

.shot-dots {
  display: flex;
  gap: 0.375rem;
}

.shot-dots span {
  inline-size: 0.625rem;
  block-size: 0.625rem;
  border-radius: 50%;
  background: var(--shot-edge);
}

.shot-address {
  padding: 0.1rem 1rem;
  border: 1px solid var(--shot-line);
  border-radius: 999px;
  background: var(--shot-field);
  color: var(--shot-ink);
  font: 400 0.75rem/1.5 var(--font-mono);
}

.shot img {
  display: block;
}

/* A press on the picture opens it large over the page, and a press or Esc
   closes it. The browser does both by itself: no script is asked for. */
.shot-zoom,
.shot-large button {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
}

.shot-zoom {
  cursor: zoom-in;
}

.shot-large {
  max-inline-size: 96vw;
  max-block-size: 94vh;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity var(--motion) var(--ease),
    transform var(--motion) var(--ease),
    overlay var(--motion) allow-discrete,
    display var(--motion) allow-discrete;
}

.shot-large:popover-open {
  opacity: 1;
  transform: none;
}

@starting-style {
  .shot-large:popover-open {
    opacity: 0;
    transform: scale(0.94);
  }
}

.shot-large::backdrop {
  background: rgb(7 10 18 / 0.78);
  backdrop-filter: blur(3px);
}

.shot-large button {
  cursor: zoom-out;
}

.shot-large img {
  block-size: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgb(0 0 0 / 0.55);
}

/* A wide window shows it as large as its file is and the window takes. */
@media (min-width: 48.001rem) {
  .shot-large img {
    inline-size: auto;
    max-inline-size: 96vw;
    max-block-size: 94vh;
  }
}

/* A narrow screen would show it no larger than the page does. There it
   stands at the size the UI has on a screen, which its markup says, and a
   finger moves it; a tap anywhere closes it. */
@media (max-width: 48rem) {
  .shot-large {
    inset: 0;
    inline-size: 100vw;
    block-size: 100dvh;
    max-inline-size: none;
    max-block-size: none;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .shot-large button {
    min-inline-size: 100%;
    min-block-size: 100%;
  }

  .shot-large img {
    max-inline-size: none;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shot-large {
    transition: none;
  }
}

.prose p:has(> .shot) {
  max-inline-size: none;
}

.screenshot {
  margin: 1.5rem 0;
}

.screenshot figcaption {
  margin-block-start: 0.6rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

/* In a band a picture stands in the middle, as the band's wells do. */
.band > .screenshot {
  inline-size: fit-content;
  max-inline-size: 100%;
  margin: 2.5rem auto 0;
}

.band > .screenshot figcaption {
  text-align: center;
}

/* Code: a sunken well, a soft border, the label above */

.terminal,
.prose pre {
  min-inline-size: 0;
  max-inline-size: 100%;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--sunken);
}

.terminal :where(header, .terminal-head) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-block-size: 1.9rem;
}

.code-label {
  color: var(--ink-muted);
  font: 400 0.75rem/1.4 var(--font-mono);
  letter-spacing: 0.04em;
}

.terminal .code-label {
  display: block;
  margin: 0;
}

.terminal pre,
.prose pre {
  color: var(--ink);
  font: 400 0.875rem/1.7 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal pre {
  margin: 0.6rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.prose pre code,
.terminal pre code {
  display: block;
  max-inline-size: 100%;
  white-space: break-spaces;
  overflow-wrap: anywhere;
}

/* The colours of code, by the kind of each piece. They are the UI's own, the
   ones a developer's eye knows from VS Code's light and dark themes, each
   stated once for the two looks. Four light tones are a shade darker here
   than in the UI, which on this ground fall short of 4.5 to 1: the
   comment's, the number's, the type's and the punctuation's. No kind takes
   the accent: orange stays what Cernanto does. */
.tok-keyword {
  color: light-dark(#0000ff, #569cd6);
}

.tok-control {
  color: light-dark(#af00db, #c586c0);
}

.tok-string {
  color: light-dark(#a31515, #ce9178);
}

.tok-comment {
  color: light-dark(#007d00, #6a9955);
}

.tok-number {
  color: light-dark(#087a50, #b5cea8);
}

.tok-type {
  color: light-dark(#22738b, #4ec9b0);
}

.tok-function {
  color: light-dark(#795e26, #dcdcaa);
}

.tok-variable {
  color: light-dark(#001080, #9cdcfe);
}

.tok-regexp {
  color: light-dark(#811f3f, #d16969);
}

.tok-heading {
  color: light-dark(#0451a5, #569cd6);
}

.tok-link {
  color: light-dark(#0451a5, #3794ff);
}

.tok-meta {
  color: light-dark(#656c76, #808080);
}

/* A well of code keeps its lines: a line longer than the well is reached by
   scrolling the well sideways and is never broken, so a diagram, a log, a
   tree and a command with its comment keep their shape. A recorded answer, a
   walkthrough's commands and a page of English are words, and wrap. */
.terminal-lines pre {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  white-space: pre;
  scrollbar-width: thin;
}

.terminal-lines pre code {
  max-inline-size: none;
  white-space: pre;
  overflow-wrap: normal;
}

.transcript-output pre,
.session-output pre {
  color: var(--ink-secondary);
}

.terminal-context,
.terminal-note {
  font-size: 0.875rem;
}

.terminal .terminal-context {
  margin: 0.1rem 0 0.5rem;
}

.terminal .command-input {
  position: relative;
  padding-inline-start: 1.2rem;
}

/* The prompt is a mark of the page, never a character of the command. */
.command-input::before {
  position: absolute;
  inset-block-start: 0.62em;
  inset-inline-start: 0.1rem;
  inline-size: 0.4em;
  block-size: 0.4em;
  border-block-start: 2px solid var(--accent);
  border-inline-end: 2px solid var(--accent);
  transform: rotate(45deg);
  content: '';
}

.session-output {
  margin-block-start: 0.6rem;
  padding-block: 0.45rem;
  padding-inline-start: 1rem;
  border-inline-start: 1px solid var(--border-strong);
}

.session-output pre {
  margin-block-start: 0.15rem;
}

.terminal textarea {
  inline-size: 100%;
  margin-block-start: 0.5rem;
  font-family: var(--font-mono);
}

.copy-command {
  align-self: center;
  min-block-size: 1.9rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink-secondary);
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--motion) var(--ease),
    border-color var(--motion) var(--ease);
}

.copy-command:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

/* One sentence changed and what it did: a plate with the accent's tab */

.comparison-pair {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block: 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.comparison-pair::before,
.outcomes::before {
  position: absolute;
  z-index: 1;
  inset-block-start: -2px;
  inset-inline-start: 1.5rem;
  inline-size: 2.5rem;
  block-size: 0.25rem;
  background: var(--accent);
  content: '';
}

.comparison-state {
  min-inline-size: 0;
  padding: clamp(1.1rem, 2vw, 1.5rem);
}

.comparison-state + .comparison-state {
  border-inline-start: 1px solid var(--border);
}

.comparison-state > :is(h2, h3, h4) {
  margin: 0 0 0.7rem;
  padding: 0;
  border: 0;
  font: 400 0.72rem/1.4 var(--font-mono);
}

.comparison-state p {
  margin-block: 0.6rem;
}

.comparison-state p:first-of-type {
  color: var(--ink);
  font: 400 1.05rem/1.5 var(--font-display);
}

.comparison-state strong {
  color: var(--accent-text);
}

.comparison-state .proof-label {
  margin-block-end: 0.25rem;
}

/* The recorded value may be one word or a whole message. */
.comparison-state .proof-label + strong {
  display: block;
  font: 600 1.3rem/1.3 var(--font-display);
  letter-spacing: -0.01em;
}

.comparison-state :last-child {
  margin-block-end: 0;
}

/* Footer */

.site-footer {
  margin-block-start: var(--band);
  border-block-start: 1px solid var(--border);
  font-size: 0.9rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2rem clamp(2rem, 5vw, 4rem);
  padding-block: 3rem 2.5rem;
  overflow-wrap: anywhere;
}

.footer-inner p {
  max-inline-size: var(--measure);
  margin: 0.4rem 0;
}

/* Under the columns and across the footer's width, centred: whose the name
   and the work are. Its parts stand on one line with a dot between them, and
   where a screen is too narrow for that line each part takes a line of its
   own, so no line begins or ends with a dot. */
.footer-inner .footer-legal {
  grid-column: 1 / -1;
  max-inline-size: none;
  margin: 0;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border);
  color: var(--ink-muted);
  text-align: center;
}

.footer-legal span {
  white-space: nowrap;
}

.footer-legal span + span::before {
  margin-inline-end: 0.28em;
  content: '\00b7';
  content: '\00b7' / '';
}

.footer-inner :is(h2, h3) {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font: 600 0.72rem/1.4 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-inner a {
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color var(--motion) var(--ease);
}

.footer-inner a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-inner nav,
.footer-inner ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Narrower screens */

@media (max-width: 58rem) {
  .header-inner {
    gap: 1rem;
  }

  .site-nav {
    gap: 0.25rem 1.1rem;
    margin-inline-start: 0.25rem;
  }

  .band > .toolchain-groups,
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime) > ul,
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(5):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Five points stand as a pair, one and a pair: the third takes its line. */
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(5):last-child)
    > li,
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(5):last-child)
    > li:nth-child(n + 4) {
    grid-column: auto;
  }

  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(5):last-child)
    > li:nth-child(3) {
    grid-column: 1 / -1;
  }

  .page-layout {
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 13rem);
    column-gap: 2rem;
  }
}

/* Where one row cannot hold the header it takes two, and scrolls away with
   the page: two fixed rows would hold too much of a small screen. */
@media (max-width: 54rem) {
  :root {
    --header: 0rem;
  }

  .site-header {
    position: static;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 0.5rem;
    row-gap: 0.3rem;
    padding-block: 0.75rem 0.5rem;
  }

  .logo {
    block-size: 2.1rem;
  }

  .header-inner > .brand {
    grid-area: 1 / 1;
  }

  .header-inner > .theme-toggle {
    grid-area: 1 / 2;
  }

  .header-inner > .install-link {
    grid-area: 1 / 3;
  }

  .site-nav {
    grid-area: 2 / 1 / auto / -1;
    gap: 0 1.25rem;
    margin-inline-start: 0;
  }
}

@media (max-width: 48rem) {
  :root {
    --gutter: 1rem;
  }

  .page-layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2rem;
  }

  .toc {
    display: none;
  }

  .mobile-toc {
    display: block;
    padding-block: 0.6rem;
    border-block: 1px solid var(--border);
    font-size: 0.94rem;
  }

  .mobile-toc summary {
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
  }

  .mobile-toc nav {
    padding-block: 0.4rem 0.2rem;
  }

  .band > h2 + p {
    font-size: 1.05rem;
  }

  .refund-context {
    font-size: 1rem;
  }
}

@media (max-width: 36rem) {
  .band > ul,
  .band > .toolchain-groups,
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime) > ul,
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(2):last-child),
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(4):last-child),
  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(5):last-child),
  .band-begin > ul:has(> li > :is(h3, h4)),
  .section-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .band:is(.band-compiler, .band-connect, .band-judgment, .band-runtime)
    > ul:has(> li:nth-child(5):last-child)
    > li:nth-child(3) {
    grid-column: auto;
  }

  /* The slim row of marks keeps two groups a line. */
  .band-works > .toolchain-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .band:not(.band-begin, .band-works) > ul > li,
  .band-begin > ul:has(> li > :is(h3, h4)) > li,
  .section-links li {
    padding: 1.2rem;
  }

  .section-links li a::after {
    inset-block-start: 1.2rem;
    inset-inline-end: 1.2rem;
  }

  .steps {
    padding-inline: 1rem;
  }

  .steps li {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 32rem) {
  .footer-legal span {
    display: block;
  }

  .footer-legal span + span::before {
    content: none;
  }
}

@media (max-width: 27rem) {
  .logo {
    block-size: 1.9rem;
  }

  .install-link {
    padding-inline: 0.9rem;
  }

  .site-nav {
    column-gap: 0.7rem;
  }

  .site-nav a {
    font-size: 0.875rem;
  }
}

/* A phone's menu is one line. The link marked for a wide screen leaves it
   there and stays in the footer, where the project's links are listed. */
@media (max-width: 30rem) {
  .site-nav .wide-only {
    display: none;
  }
}

@media (max-width: 24rem) {
  .site-nav .project-link {
    justify-content: center;
    min-inline-size: clamp(1.875rem, 10vw, 2.5rem);
    min-block-size: 2.75rem;
  }

  .site-nav .project-link span {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 39.999rem) {
  .terminal,
  .prose pre {
    padding-inline: 1rem;
  }

  /* The code inside a well keeps the well's own edge, under its label. */
  .terminal pre {
    padding-inline: 0;
  }

  .policy-checks caption {
    display: block;
    padding: 0.8rem 1rem;
  }

  .table-scroll table:has(td[data-label]) thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .table-scroll table:has(td[data-label]) tbody,
  .table-scroll table:has(td[data-label]) tbody tr,
  .table-scroll td[data-label] {
    display: block;
  }

  .table-scroll table:has(td[data-label]) tbody tr {
    padding-block: 0.55rem;
    border-block-end: 1px solid var(--border);
  }

  .table-scroll td[data-label] {
    padding: 0.3rem 0;
    border: 0;
  }

  .table-scroll td[data-label]::before {
    display: block;
    color: var(--ink-muted);
    font: 400 0.72rem/1.4 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .table-scroll table:not(:has(td[data-label])):has(th:nth-child(3)) {
    min-inline-size: 32rem;
  }

  .policy-checks thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .policy-checks,
  .policy-checks tbody,
  .policy-checks tbody :is(tr, th, td) {
    display: block;
    inline-size: 100%;
  }

  .policy-checks tr {
    padding: 0.8rem 1rem;
  }

  .policy-checks tr + tr {
    border-block-start: 1px solid var(--border);
  }

  .policy-checks tbody :is(th, td) {
    padding: 0;
    border: 0;
  }

  .policy-checks td {
    margin-block-start: 0.25rem;
  }

  .policy-checks .deciding-check {
    box-shadow: inset 3px 0 0 var(--accent);
  }

  .policy-checks .deciding-check th {
    box-shadow: none;
  }

  .comparison-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .comparison-state + .comparison-state {
    border-inline-start: 0;
    border-block-start: 1px solid var(--border);
  }

  /* On a narrow screen each answer stands under what was written for it. */
  .asked,
  .asked thead,
  .asked tbody,
  .asked tr,
  .asked :is(th, td) {
    display: block;
    inline-size: 100%;
  }

  .asked thead th:last-child {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .asked thead th:first-child {
    padding: 1rem 1rem 0;
  }

  .asked tbody tr {
    padding: 0.8rem 1rem;
  }

  .asked tbody tr + tr {
    border-block-start: 1px solid var(--border);
  }

  .asked tbody td,
  .asked tbody tr + tr td {
    padding: 0;
    border: 0;
  }

  .asked tbody td:last-child {
    margin-block-start: 0.45rem;
  }

  .refund-point {
    font-size: 1.15rem;
  }
}

@media (pointer: coarse) {
  .install-link,
  .proof-link,
  .copy-command {
    min-block-size: 2.75rem;
  }

  .theme-toggle {
    inline-size: 2.75rem;
    block-size: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .comparison-pair::before,
  .outcomes::before,
  .band:not(.band-opening)::before {
    background: CanvasText;
    box-shadow: none;
  }

  .steps li::before,
  .steps li:not(:last-child)::after {
    background: CanvasText;
  }

  .command-input::before {
    border-color: CanvasText;
  }
}

@media print {
  :root,
  :root[data-theme] {
    color-scheme: light;
    --ground: white;
    --surface: white;
    --sunken: white;
    --ink: black;
    --ink-secondary: #25324d;
    --ink-muted: #4a566e;
    --accent-text: black;
    --border: #a0a0a0;
    --border-strong: #808080;
    --light-only: block;
    --dark-only: none;
    --gutter: 0rem;
  }

  body {
    font-size: 11pt;
  }

  .site-header {
    position: static;
    background: none;
  }

  .site-nav,
  .install-link,
  .theme-toggle,
  .skip-link,
  .copy-command,
  .toc {
    display: none;
  }

  .container,
  .page-layout {
    display: block;
    inline-size: 100%;
  }

  .header-inner {
    display: block;
    min-block-size: auto;
    padding: 0 0 0.8rem;
  }

  .homepage {
    padding-block-start: 1.3rem;
  }

  .band:not(.band-opening) {
    margin-block-start: 1.5rem;
    padding-block-start: 1.5rem;
  }

  .band:not(.band-opening)::before {
    box-shadow: none;
  }

  .hero h1,
  .page-title {
    font-size: 28pt;
  }

  .terminal,
  .comparison-state,
  .band li,
  .steps,
  .shot,
  .prose tr {
    break-inside: avoid;
  }

  /* Paper is light, and so is the picture printed on it: the light UI. */
  .shot {
    box-shadow: none;
  }

  .shot-on-light {
    display: none;
  }

  .shot-on-dark {
    display: block;
  }

  .site-footer {
    margin-block-start: 1.5rem;
  }
}
