/* SPDX-License-Identifier: GPL-3.0-or-later
 *
 * One stylesheet, no framework, no web fonts, no third-party requests of any
 * kind. A site for a privacy tool has no business loading a CDN: every remote
 * asset is a request that tells someone else you were here.
 *
 * Typography is monospace throughout, from the fonts the reader already has.
 *
 * In plain words
 *
 * This is what the site looks like: the spacing, the type, the buttons, the
 * diagrams and the animations.
 *
 * There is no framework and no font downloaded from anywhere else. Every
 * remote thing a page loads is a request that tells somebody else you were
 * here, and a site for a privacy tool has no business making them. The type
 * you see is one you already have.
 */

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

html {
  scroll-behavior: smooth;

  /* Tell the browser this page is dark, so *native* controls follow.
   *
   * Without it, the `<select>` for the colour scheme, the `<progress>` bar in
   * the verifier and the file input all render in the platform's light styling
   * on a dark page -- a white dropdown list on a near-black background. It is
   * the one part of the page CSS cannot reach, and one declaration fixes it on
   * every engine. The value is set per theme in themes.css, beside the colours
   * it has to agree with, so the two cannot drift apart; this is the default
   * for the moment before a theme is applied.
   */
  color-scheme: dark;

  /* iOS inflates font sizes in landscape unless told not to. On a monospace
   * layout with fixed column widths that silently breaks the alignment the
   * whole design depends on. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "SF Mono",
               "DejaVu Sans Mono", Consolas, ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--accent); }

/* `:focus-visible` arrived in Safari 15.4. Before that this selector is invalid
 * and the *whole rule* is dropped, so a keyboard user on an older iPhone got no
 * focus ring at all -- the page became unnavigable without a pointer. The plain
 * `:focus` rule below is the fallback, and is written first so that
 * `:focus-visible` overrides it where it is understood. They are separate rules
 * on purpose: one invalid selector must not take the other down with it. */
a:focus,
button:focus,
select:focus,
input:focus,
summary:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Where `:focus-visible` is supported, drop the ring for pointer clicks only. */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
select:focus:not(:focus-visible),
input:focus:not(:focus-visible),
summary:focus:not(:focus-visible) {
  outline: none;
}
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Two declarations, and the order matters.
   *
   * `color-mix` arrived in Safari 16.2, Firefox 113 and Chrome 111 -- all 2023.
   * An engine older than that treats the whole declaration as invalid and
   * *drops it*, and with nothing before it the header had no background at all:
   * a sticky bar with the page scrolling visibly through the text. The solid
   * colour below is the fallback, and browsers that understand `color-mix`
   * simply take the second declaration. */
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);

  /* Safari only unprefixed `backdrop-filter` in version 18 (late 2024). Every
   * iPhone on iOS 17 or earlier needs the `-webkit-` form, and without it the
   * translucent header simply has no blur -- which, combined with the
   * `color-mix` fallback above, is why that fallback is opaque rather than
   * translucent. */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);

  /* On a notched iPhone in landscape the header would otherwise run under the
   * rounded corner and the sensor housing. `env()` is zero everywhere it does
   * not apply, so this costs nothing on a desktop. */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.06em; }
/* `image-rendering: pixelated` is for pixel art being *enlarged*. Every image
 * on this site is shrunk instead -- the icon is a 32 px source drawn at 26 px --
 * and nearest-neighbour shrinking does not blend rows, it deletes them. See the
 * note on `.hero img.banner`, where deleting rows made the claims unreadable. */
.brand img { width: 26px; height: 26px; }
.brand a { color: var(--fg); border: 0; }

nav.links { display: flex; gap: 14px; flex-wrap: wrap; }
nav.links a {
  color: var(--muted);
  font-size: 13px;
  /* WCAG 2.5.8 asks for a 24 by 24 CSS pixel target. These links were 22 px
   * tall, which is small enough to mis-tap on a phone -- and mis-tapping in a
   * nine-item row means landing on the wrong section rather than nothing. The
   * padding is vertical only, so the row's visual rhythm is unchanged. */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
nav.links a:hover { color: var(--accent); }

/* ---------- header on a phone ---------- */
/*
 * Nine navigation links at 375 px wrap onto four rows, and because the header
 * is `position: sticky` that cost 165 px -- a fifth of an iPhone screen,
 * permanently, on every scroll position. Measured, not guessed.
 *
 * The answer is to stop wrapping and scroll the row sideways instead: one line,
 * every link still reachable, and the header back to a single row. The
 * scrollbar is hidden because on a touch device there is nothing to grab
 * anyway, and `-webkit-overflow-scrolling` keeps the momentum that iOS
 * otherwise drops on a nested scroller.
 */
@media (max-width: 760px) {
  .top .wrap {
    /* Two rows, deliberately. The brand and the theme picker alone are about
     * 290 px of a 375 px screen, so trying to fit the navigation beside them
     * left it 43 px wide -- a scroller showing most of one link, which is worse
     * than either wrapping or scrolling. Row one is the identity and the
     * control; row two is the navigation, at full width. */
    flex-wrap: wrap;
    gap: 8px 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .brand { flex: none; }
  .brand a { font-size: 14px; }
  .theme-pick { flex: none; margin-left: auto; max-width: 46vw; }

  nav.links {
    /* Force the row break, then fill it.
     *
     * `order` is needed as well as the `100%` basis: the navigation comes
     * *before* the theme picker in the source (which is the right reading
     * order), so a full-width nav in source order pushed the picker onto a
     * third row and the header back up to 113 px. Ordering it last puts the
     * brand and the picker together on row one and the nav alone on row two,
     * without changing the document order a screen reader follows. */
    order: 3;
    flex: 1 0 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    /* `min-width: 0` is what lets a flex item become a scroll container at
     * all: the default `min-width: auto` makes it refuse to be narrower than
     * its own contents, so it would push the page sideways instead. */
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    /* No visible scrollbar: there is nothing to grab on a touch screen, and a
     * bar under a 24 px row of links costs more than it explains. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }
  nav.links::-webkit-scrollbar { display: none; }
  nav.links a { white-space: nowrap; }
}

/*
 * Anchor targets must clear the sticky header.
 *
 * Without this, following `#download` from the navigation scrolls the heading
 * to y=0 -- which is *underneath* the header, so the reader lands on a section
 * whose title they cannot see. `scroll-margin-top` is the property that exists
 * for exactly this and needs no JavaScript.
 *
 * The offset is a variable rather than a number because the header is not one
 * height. Measured in a browser it is 133px at desktop widths, 171px where the
 * navigation wraps to three rows, 115px on a phone and 81px on the reference
 * pages, and this rule used to say 90px for all of them. `js/teleport.js`
 * measures the header and sets `--anchor-offset` from it; the value below is
 * what applies for the frame before that runs, and on the pages that carry no
 * scripts.
 *
 * Every id, not a list of element names. The old list was `section`, `h2` and
 * `h3`, which left every `h4` on the releases page and every roadmap entry
 * with no offset at all.
 */
:root { --anchor-offset: 147px; }

[id] { scroll-margin-top: var(--anchor-offset); }

/*
 * Where you landed, for a moment.
 *
 * A fragment jump moves the page without moving anything the eye can follow,
 * so on a dense page it is not obvious which heading was asked for. This
 * outlines it and lets the outline fade.
 *
 * The outline is a plain declaration and the fade is an animation, which is
 * deliberate: under `prefers-reduced-motion` the rule at the top of this file
 * collapses the animation and the outline is simply there for the two seconds
 * the class is applied. Nobody loses the cue for having asked for less
 * movement.
 */
.landed {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 4px;
  animation: landed-fade 2s ease-out 1 forwards;
}

@keyframes landed-fade {
  0%   { outline-color: var(--accent); }
  70%  { outline-color: var(--accent); }
  100% { outline-color: transparent; }
}

.theme-pick {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

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

/* The gutter is 20 px, the same as `.wrap`, because the hero is the one
 * section that is not inside one. On a desktop nothing changes -- the banner
 * and the tagline are capped at 860 and 640 px and centre themselves long
 * before the padding matters. On a 390 px phone it was the difference between
 * a paragraph with a margin and one whose first and last characters touched
 * both edges of the screen. Seen, not deduced: the layout measured clean
 * because nothing overflowed; it simply had no room around it. */
.hero { padding: 54px 20px 34px; text-align: center; }

/* The `<picture>` these rules sized is gone -- the hero banner is drawn in CSS
 * now, further down this file. What is worth keeping from them is the finding,
 * because it applies to every image this site scales down and the next one will
 * hit it too:
 *
 * `image-rendering: pixelated` is for pixel art being *enlarged*. banner.png is
 * 1280 px wide and was drawn at about 343 on a phone, a 3.7x reduction.
 * Nearest-neighbour sampling keeps roughly one row in four and drops the rest,
 * so the one- and two-pixel strokes of the banner's own text lost more than
 * half their rows: "THE VOICEPRINT IS DESTROYED. THE WORDS STAY READABLE."
 * rendered as "TIE VOICEPRIN IS DESTOYED. THE WORDS STAY EDGRE." The first
 * thing a phone reader saw was this project's own claims, illegible. That was
 * finding F-37, and it is the reason the banner is text today. */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.tagline { color: var(--muted); margin: 22px auto 0; max-width: 640px; }
.tagline strong { color: var(--fg); }

/* Staggered entrance. Each element declares its own delay via --i. */
.stagger > * {
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- the banner, drawn in CSS ---------- */
/*
 * The hero banner used to be `assets/banner-animated.png` behind a `<picture>`.
 * It is now live text with a CSS animation over it, and the picture has moved
 * to the README, where a hundred different clients have to draw it and only a
 * GIF reaches all of them.
 *
 * Three things are better as text than as pixels, and all three were already
 * written down elsewhere in this stylesheet before this banner existed:
 *
 *   - **It follows the reader's palette.** An image is baked in one theme and
 *     the site has nine. Every colour below is a token.
 *   - **Its claims can be read aloud, selected and searched.** Finding F-37 was
 *     this project's own claims rendered illegibly inside an image at phone
 *     width. Text cannot have that failure.
 *   - **It honours `prefers-reduced-motion`.** The global rule at the top of
 *     this file reaches every animation here. It cannot reach inside a PNG,
 *     which is why the old markup needed a media query on a `<source>`.
 *
 * And it has no soundbar. The waveform is the site's motif and it is used
 * twice more further down the page -- in the demonstration and in the mark
 * itself -- so a third one at the top was the loudest thing on the page
 * competing with the two that carry meaning.
 *
 * Nothing here needs JavaScript. With scripts off the reader is served the GIF
 * instead, from a `<noscript>` in the markup: they chose the edition of this
 * site that runs nothing, and one picture is a simpler thing to be served than
 * a page of rules. `html:not(.js)` hides this one, and `html.js` is set by a
 * blocking script in `<head>`, so there is no frame in which both are visible.
 */

.bn {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 32px 26px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--bg-inset);
  /* The same faint 16 px grid the drawn banner has, and for the same reason:
   * texture that does not compete with the wordmark. Two repeating gradients
   * rather than an image, so it costs no request and follows the theme. */
  background-image:
    repeating-linear-gradient(0deg, var(--bg-soft) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, var(--bg-soft) 0 1px, transparent 1px 16px);
}

html:not(.js) .bn { display: none; }

.bn-mark {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-soft);
  padding: 3px;
  box-sizing: content-box;
}

.bn-word {
  position: relative;
  margin: 0;
  font-size: clamp(30px, 7.4vw, 62px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg);
}

/*
 * The veil. A blurred copy of the wordmark, drifting and fading behind the
 * sharp one: the same letters, unresolvable. It is the only illustration on
 * this page of what the tool actually does to a voice, and it is one
 * pseudo-element.
 *
 * `attr()` for content is the one form of `attr()` every engine has supported
 * since forever -- the typed version that takes a unit is not, and is not used
 * here. The copy is `aria-hidden` by construction: generated content of a
 * decorative pseudo-element is not in the accessibility tree.
 */
.bn-word::after {
  content: attr(data-word);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-2);
  filter: blur(7px);
  opacity: 0.42;
  pointer-events: none;
  animation: bn-veil 6.5s ease-in-out infinite alternate;
}

@keyframes bn-veil {
  from { transform: translate(-6px, 0) scaleX(1.008); opacity: 0.24; }
  to   { transform: translate(7px, 0) scaleX(0.994); opacity: 0.5; }
}

/* A slow band of light crossing the whole card. Under the wordmark's stacking
 * order on purpose: it should pass behind the letters, not wash them out. */
.bn-sweep {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(100deg,
              transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.075;
  animation: bn-sweep 9s linear infinite;
}

@keyframes bn-sweep {
  from { transform: translateX(-120%); }
  to   { transform: translateX(400%); }
}

.bn-sub {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: clamp(11px, 2.1vw, 17px);
  letter-spacing: 0.16em;
}

.bn-claim {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(10px, 1.7vw, 14px);
  letter-spacing: 0.08em;
}

.bn-lines {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: clamp(10px, 1.7vw, 14px);
  letter-spacing: 0.08em;
}
.bn-lines li { margin: 2px 0; }
.bn-ok    { color: var(--ok); }
.bn-cyan  { color: var(--cyan); }
.bn-muted { color: var(--muted); }

/* The hairline along the bottom edge, which the drawn banner has as a solid
 * bar. Here it carries the same light the sweep does, half a cycle behind it,
 * so the card reads as one moving thing rather than two. */
.bn-rule {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg,
              var(--accent) 0%, var(--accent-2) 50%, var(--accent) 100%);
  background-size: 200% 100%;
  animation: bn-rule 9s linear infinite;
}

@keyframes bn-rule {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}

/*
 * The banner under reduced motion: calmer, not frozen.
 *
 * The global rule at the top of this file stops every animation for a reader
 * whose system asks for less movement, and for the rest of the page that is
 * right. The banner was the exception people noticed: frozen, it read as
 * broken rather than as calm. So for those readers two of its three motions
 * keep running at well under half their usual speed, the light crossing behind
 * the wordmark and the line along the bottom edge, and the drifting blurred
 * copy of the word stays still. Nothing flashes and nothing moves fast.
 *
 * Moving for longer than five seconds earns a way to stop it (WCAG 2.2.2), so
 * the same readers get a pause button, `.bn-pause` below, which `banner.js`
 * wires up. Everyone else sees the banner exactly as before and no button.
 *
 * `.bn .bn-sweep` outranks the global `*` rule because both are `!important`
 * and this selector is more specific. A browser that does not understand the
 * media query never applies any of this, and so shows the full banner, which
 * is the intended default.
 */
@media (prefers-reduced-motion: reduce) {
  .bn .bn-sweep,
  .bn .bn-rule {
    animation-duration: 24s !important;
    animation-iteration-count: infinite !important;
  }
  .bn.bn-paused .bn-sweep,
  .bn.bn-paused .bn-rule {
    animation-play-state: paused !important;
  }
  html.js .bn-pause { display: inline-block; }
}

.bn-pause {
  display: none;
  margin: 8px auto 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.bn-pause:hover { color: var(--fg); }
.bn-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The `<noscript>` copy, which is the README's GIF. Sized like the drawing it
 * stands in for so the page does not change shape between the two editions. */
.bn-fallback {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ---------- the journey: a file in, a file out ---------- */
/*
 * One eight-second cycle, shared by every part. Each element animates for its
 * own share of the cycle and rests for the rest of it, positioned by `--at` in
 * the markup rather than by a stack of delay classes here -- so the sequence
 * can be re-timed by reading the numbers in `index.html` in order.
 *
 * `animation-delay` is positive rather than negative on purpose. A negative
 * delay starts an animation part-way through, which means the first pass of
 * the sequence plays out of order before settling; a positive one simply waits,
 * and the loop is in step from the first cycle a reader ever sees.
 *
 * The reduced-motion rule at the top of this file collapses all of it. What is
 * left is the three cards, side by side, with their labels -- which is the
 * whole point of the picture. The motion is the ordering, not the meaning.
 */

.journey { margin: 18px 0 0; }

.jr-flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jr-step {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  gap: 8px;
}

.jr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-inset);
  animation: jr-card 8s ease-in-out infinite;
  animation-delay: var(--at, 0s);
}

@keyframes jr-card {
  0%          { border-color: var(--border); background: var(--bg-inset); }
  3%          { border-color: var(--accent); background: var(--bg-soft); }
  18%         { border-color: var(--accent); background: var(--bg-soft); }
  32%, 100%   { border-color: var(--border); background: var(--bg-inset); }
}

.jr-name {
  color: var(--fg);
  font-size: 14px;
  word-break: break-all;
}
.jr-fact { color: var(--muted); font-size: 12.5px; }
.jr-key { display: inline-block; min-width: 9ch; }
.jr-fact b { color: var(--fg); font-weight: 700; }
.jr-warn { color: var(--warn) !important; }
.jr-ok { color: var(--ok) !important; }

/* Two lines of room whether the caption needs two or one. The captions sit
 * *below* the cards in a column, so a caption that wraps makes its card
 * shorter than the others -- three boxes of three different heights, for a
 * reason that is nothing to do with what they say. */
.jr-caption {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 3em;
}

.jr-engine { align-items: flex-start; }
.jr-mark {
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
}

/* The ring is the only part that is not a label: it is the moment the work
 * happens, and it needs to read as a moment rather than as a state. A spreading
 * shadow rather than a spinner, because a spinner means "waiting for something
 * else" and this is not waiting for anything. */
.jr-ring {
  position: absolute;
  /* Longhands before the shorthand. `inset` arrived in Safari 14.1, and an
   * engine older than that drops the whole declaration -- see the note on the
   * legal overlay, where the same gap has real consequences. */
  top: -1px;
  right: -1px;
  bottom: -1px;
  left: -1px;
  inset: -1px;
  border-radius: 9px;
  pointer-events: none;
  animation: jr-ring 8s ease-out infinite;
  animation-delay: var(--at, 0s);
}

@keyframes jr-ring {
  0%        { box-shadow: 0 0 0 0 var(--accent-2); opacity: 0.5; }
  22%       { box-shadow: 0 0 0 14px var(--accent-2); opacity: 0; }
  23%, 100% { box-shadow: 0 0 0 0 var(--accent-2); opacity: 0; }
}

.jr-link {
  position: relative;
  flex: 0 0 auto;
  width: clamp(34px, 7vw, 86px);
  margin-top: 26px;
  align-self: flex-start;
  height: 2px;
  background: var(--border);
}

/* The travelling packet. `left` rather than a transform: the distance is a
 * percentage of a container whose width is a `clamp()`, and a transform
 * percentage resolves against the moving dot instead -- which put the whole
 * journey inside eight pixels. */
.jr-packet {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: jr-packet 8s cubic-bezier(0.4, 0, 0.3, 1) infinite;
  animation-delay: var(--at, 0s);
}
.jr-packet-out { background: var(--accent-2); }

@keyframes jr-packet {
  0%        { left: 0; opacity: 0; }
  4%        { left: 0; opacity: 1; }
  17%       { left: calc(100% - 10px); opacity: 1; }
  21%, 100% { left: calc(100% - 10px); opacity: 0; }
}

/* The mark and the words are centred against each other by the layout rather
 * than by a `vertical-align` nudge. The nudge was a number that happened to
 * look right at one font size and stopped being right at any other, which is
 * how the mark ended up sitting oddly beside the text. */
.jr-offline {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* A prohibition sign, drawn as SVG.
 *
 * It was two boxes -- a bordered circle and a rotated `::after` bar -- and the
 * bar was placed by arithmetic against the box model. That arithmetic was
 * wrong three times running: a 17px bar starting at the ring's left edge sat
 * two pixels right of centre with four hanging off the side; centring it and
 * giving it the ring's own diameter left the square corners crossing the ring,
 * because a rectangle's corners are further from its centre than its edge
 * midpoints; shortening it to clear them stopped it mid-stroke so it no longer
 * reached the ring at all.
 *
 * Each attempt fixed the previous symptom and produced the next, which is the
 * signal that the approach rather than the number was wrong. SVG has none of
 * this: the circle and the line are geometry, the two endpoints are the circle
 * radius at 45 degrees, and a round cap puts the furthest point of each end on
 * the bar's own axis, exactly on the outer edge of the stroke. Symmetric by
 * construction, at any zoom and any subpixel position, with no numbers left to
 * get wrong. */
.jr-offline-mark {
  flex: none;
  color: var(--err);
}

.journey figcaption {
  margin-top: 20px;
  color: var(--muted);
  max-width: 68ch;
  line-height: 1.65;
}
.journey figcaption strong { color: var(--fg); }

/* Stacked on a narrow screen, with the connectors turned on their side. The
 * cards are the content; the arrangement is not worth a horizontal scroll. */
@media (max-width: 700px) {
  .jr-flow { flex-direction: column; align-items: stretch; }
  .jr-step { flex: none; }
  .jr-link {
    width: 2px;
    height: 30px;
    margin: 0 0 0 22px;
    align-self: flex-start;
  }
  .jr-packet { animation-name: jr-packet-down; top: 0; left: -4px; }
  @keyframes jr-packet-down {
    0%        { top: 0; opacity: 0; }
    4%        { top: 0; opacity: 1; }
    17%       { top: calc(100% - 10px); opacity: 1; }
    21%, 100% { top: calc(100% - 10px); opacity: 0; }
  }
}

/* ---------- the demonstration ---------- */
/*
 * A voice going in, the mark lighting as it passes, an unidentifiable wave
 * coming out. Pure CSS: it follows the reader's theme, needs no download, and
 * works in the scripts-off edition.
 *
 * Deliberately far below the hero. The banner already animates, and two
 * waveforms moving at once was a real defect -- each made the other look like
 * decoration, which is why one of them was removed from the hero in the first
 * place. These two are never on screen together.
 */
.demo { margin: 0; }

.demo-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 22px;
}

.demo-side { flex: 1 1 0; min-width: 0; }

.demo-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 78px;
  /* The bars are the picture, so they get the inset background the rest of the
   * site uses for a panel rather than sitting on the page. */
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 10px;
}

.demo-wave span {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  /* A height before the animation starts, and `backwards` so the delay holds
   * the first keyframe rather than nothing.
   *
   * Without both, a bar whose `animation-delay` has not elapsed has no height
   * at all -- these are flex children in a centred row, so "no height" means
   * "not drawn". Delays here run to 3.7s, so for the first several seconds
   * after the page loaded, most of the waveform was simply absent. It looked
   * like a five-bar picture that mysteriously filled in later, and nothing in
   * the CSS reads as wrong. Found by photographing the section. */
  height: 14%;
  animation: demo-bar var(--t, 2s) ease-in-out infinite backwards;
  animation-delay: var(--d, 0ms);
}

/* Left: one animation, one duration, delays increasing by a fixed step, so the
 * crest walks along the row. That regularity *is* the voiceprint. */
.demo-clean span { background: var(--accent); }

/* Right: each bar keeps its own duration as well as its own delay, so they
 * never line up again. Same heights, same energy, no shared structure. */
.demo-veiled span { background: var(--accent-2); }

@keyframes demo-bar {
  0%, 100% { height: 14%; opacity: 0.75; }
  50%      { height: 88%; opacity: 1; }
}

.demo-core {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* What happens between the two waveforms, in order, one step lighting at a
 * time.
 *
 * The middle of this picture used to be the mark on its own, glowing, and the
 * caption summarised the whole engine as the word "discarded". That is true
 * and it is one word for six things, and the one it names is the third of
 * them. A reader looking at the picture could not see that the audio is
 * framed first, that the phase is measured before it is thrown away, that the
 * pitch mapping is a separate step and is the *other* reason there is no
 * inverse, or that the modulation is rolled on an interval.
 *
 * So the steps are drawn, in the same style as everything else here: no
 * script, no image, one animation, and it follows the reader's theme.
 *
 * The cycle is six seconds and each step holds the light for one of them, so
 * the sequence reads at about the pace somebody reads a short line. Faster
 * looked like flickering; slower and the reader has moved on. */
.demo-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  /* The longest label decides this, and it must not decide the whole row: the
   * two waveforms are `flex: 1 1 0` and this is `flex: 0 0 auto`, so a wide
   * core takes its width off both of them. */
  max-width: 26ch;
}

.demo-stages li {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  animation: demo-step 6s linear infinite backwards;
  animation-delay: calc(var(--s) * 1s);
}

.demo-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  animation: demo-step-dot 6s linear infinite backwards;
  animation-delay: calc(var(--s) * 1s);
}

/* Colour and nothing else: a step that moved or grew would push the labels
 * around, and six labels jostling for six seconds is a picture nobody reads. */
@keyframes demo-step {
  0%, 15%   { color: var(--fg); }
  17%, 100% { color: var(--muted); }
}

@keyframes demo-step-dot {
  0%, 15%   { background: var(--accent); box-shadow: 0 0 7px 1px var(--accent); }
  17%, 100% { background: var(--border); box-shadow: none; }
}

/* The numbered account under the picture, which says the same six things at
 * length. The picture names them; this one explains them. */
.demo-steps {
  margin: 0 0 10px;
  padding-left: 20px;
  max-width: 68ch;
}
.demo-steps li { margin: 0 0 8px; }

.demo-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  padding: 4px;
  animation: demo-glow 2s ease-in-out infinite;
}

/* The glow is a box-shadow rather than a filter: `filter` on an image forces a
 * new compositing layer on every frame in several engines, and this is a
 * decoration that must never cost a reader a dropped frame. */
@keyframes demo-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  /* Two declarations, and the order matters -- the same rule the sticky header
   * follows. `color-mix` arrived in 2023; an engine older than that drops the
   * whole declaration, and with nothing before it the mark simply never lights.
   * The plain colour is the fallback; newer engines take the second. */
  50%      { box-shadow: 0 0 18px 2px var(--accent);
             box-shadow: 0 0 18px 2px color-mix(in srgb, var(--accent) 55%, transparent); }
}

.demo-label {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.demo-label-veiled { color: var(--accent-2); }

.demo figcaption { color: var(--muted); max-width: 68ch; }
.demo figcaption p { margin: 0 0 10px; }
.demo figcaption strong { color: var(--fg); }

/* On a narrow screen the three parts stack, and the mark turns on its side so
 * it still reads as "through here" rather than as a third panel. */
@media (max-width: 640px) {
  .demo-flow { flex-direction: column; gap: 12px; }
  .demo-side { width: 100%; }
  /* The mark turns on its side so it still reads as "through here" rather than
   * as a third panel. Only the mark: rotating the core would take the six
   * labels with it, and sideways text is not a label. */
  .demo-mark { transform: rotate(90deg); }
  .demo-stages { max-width: none; }
}

/* Motion reduced: the bars hold a readable spread of heights and the mark
 * stops glowing. The picture still makes its point -- one row even, one row
 * ragged -- because the *arrangement* carries the meaning, not the movement.
 *
 * Unlike the fact strip this needs no visibility override: a bar's resting
 * state is a height, not `opacity: 0`. Stated because the two look alike and
 * the difference is exactly what made the other one need an exception. */
@media (prefers-reduced-motion: reduce) {
  /* Every step lit, rather than every step dark. The list is the content here
   * and the sequence is the decoration, so with the movement gone the reader
   * should still be able to read all six. */
  .demo-stages li { animation: none; color: var(--fg); }
  .demo-dot { animation: none; background: var(--accent); box-shadow: none; }
  .demo-wave span { animation: none; height: 60%; }
  .demo-clean span { height: 62%; }
  .demo-veiled span:nth-child(odd) { height: 34%; }
  .demo-veiled span:nth-child(3n) { height: 84%; }
  .demo-veiled span:nth-child(4n) { height: 22%; }
  .demo-mark { animation: none; }
}

/* ---------- the questions page ---------- */
/*
 * The contents list at the top of the questions page. Two columns on a wide
 * screen, because twenty questions in one column is a page of links somebody
 * scrolls past to reach the first answer, and one column on a narrow one,
 * where two would be four words wide each.
 */
.faq-list { margin: 0 0 26px; }
.faq-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 30px;
}
.faq-list li {
  margin: 0 0 7px;
  /* A question must not be split down the middle of the page. */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.faq-list a { color: var(--muted); border: 0; }
.faq-list a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .faq-list ul { columns: 1; }
}

/* ---------- the recorded terminal ---------- */
/*
 * `website/js/sessions.js` replays a recorded session into `#cli-demo`, on the
 * page rather than in an overlay.
 *
 * What this replaced was three times its size: an overlay, a card, a mode
 * picker, and the parts of a hand-drawn model of the desktop application --
 * meters, drop zones, checkboxes, a fake title bar with a fake offline badge.
 * That model was a drawing of an interface published beside photographs of the
 * same interface, and the photographs are the ones a reader can check.
 *
 * The rules that remain use the palette tokens and nothing else, so the
 * terminal follows the reader's theme, and nothing here animates a property
 * that causes layout.
 */

.term {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 9px; height: 9px; border-radius: 50%; }
.term-name { color: var(--muted); font-size: 12px; margin-left: 6px; }

.term-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.term-btn {
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 11px;
  cursor: pointer;
}
.term-btn:hover { color: var(--fg); border-color: var(--accent); }
.term-btn-on { color: var(--accent); border-color: var(--accent); }

/* Replaying and skipping are a different kind of action from the five titles
   beside them, so they are pushed to the far end rather than sitting in the
   list as two more things to choose between. */
.term-btn-do { color: var(--fg); }
.term-btn-do + .term-btn-do { margin-left: 0; }
.term-picks > .term-btn-do:nth-last-child(2) { margin-left: auto; }

/* The one-line description of the recording being played, between the picker
   and the terminal, so somebody who clicked a title knows what they are about
   to watch before it starts. */
.term-note {
  margin: 0;
  padding: 10px 14px 0;
  color: var(--muted);
  font-size: 13px;
}

/* The output scrolls in its own box. A help screen is forty lines and the
   section must not grow to whatever the longest one happens to be. */
.term-out {
  margin: 0;
  padding: 12px 14px;
  max-height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg-inset);
  border: 0;
  border-radius: 0;
  white-space: pre;
  /* It scrolls and it takes focus, so it needs a visible focus ring: a
     keyboard reader has to be able to tell which box the arrow keys move. */
  outline-offset: -2px;
}

/* ---------- tooltips ---------- */
/*
 * `data-tip` on any element, shown on hover and on keyboard focus. No
 * JavaScript, so the scripts-off edition behaves identically.
 *
 * Deliberately *not* the `title` attribute. `title` is unstyleable, appears
 * after a delay the reader cannot change, never appears on a touch device, and
 * is announced by some screen readers in addition to whatever else the element
 * says. Where both existed the reader got two boxes on a desktop and the same
 * sentence twice through a screen reader.
 *
 * Nothing a reader actually needs is stored only here. A tooltip expands an
 * abbreviation or names a unit; it never carries the point of a sentence,
 * because on a phone it does not exist.
 */
[data-tip] {
  position: relative;
  /* The dotted underline is the affordance. Without it a tooltip is a secret:
   * hover-only information with nothing indicating there is anything to hover.
   * `text-decoration` rather than a border, so it follows descenders and wraps
   * with the text. */
  text-decoration: underline dotted var(--muted);
  text-underline-offset: 3px;
  cursor: help;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  /* Anchored to the element's left edge, not centred.
   *
   * Centring looks better in isolation and overflows the viewport the moment
   * the annotated word is near the left margin -- which was exactly what
   * happened to the `Argon2id` tooltip in the left-hand column, half of it
   * off-screen. Found by rendering the page with the tooltip forced open;
   * nothing about the CSS looks wrong on its own.
   *
   * Left-anchoring cannot overflow on the left at all, and the width cap keeps
   * it inside a column on the right. `.tip-right` is the opt-out for a term
   * genuinely close to the right edge. */
  left: 0;
  transform: translate(0, 4px);
  z-index: 40;

  /* Monospace and the site palette, as asked. Sized in ch so the box is a
   * predictable number of characters wide whatever the reader's font. */
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 34ch;
  padding: 7px 10px;
  text-align: left;
  text-decoration: none;

  color: var(--fg);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);

  opacity: 0;
  visibility: hidden;
  /* `visibility` is in the transition on purpose: without it the box stays in
   * the accessibility tree and stays hoverable while invisible, so a pointer
   * passing through empty space triggers a tooltip that is not there. */
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.14s;
  pointer-events: none;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s;
}

/* For a term close to the right edge, where a left-anchored box would run off
 * that side instead. */
[data-tip].tip-right::after { left: auto; right: 0; }

/*
 * On a phone there is no edge left to anchor to.
 *
 * The box is `width: max-content` capped at 34ch -- about 255 px -- and it is
 * anchored to the left of the annotated word. In a 312 px column with the word
 * two thirds of the way along, that put its right edge at 433 px on a 390 px
 * screen: half the tooltip off the side, and, because a `visibility: hidden`
 * box still takes part in layout, the *front page itself* scrolling sideways by
 * 82 px whether anybody hovered anything or not. Measured with
 * `tools/render/probe.py overflow --width 390`, which is also how the cause was
 * narrowed from "something on the page" to one paragraph in one card.
 *
 * Pinned to the bottom of the viewport instead: full width, nothing to run off,
 * and out from under the finger that opened it. `position: fixed` also takes
 * the box out of the scrollable overflow entirely, which is what removes the
 * 82 px.
 *
 * The query is 900 px rather than the site's usual 760 because this is not a
 * phone problem: it is a *narrow column* problem, and the columns keep
 * narrowing until the page reaches its full 900 px width. A tablet at 768 was
 * still 75 px over. Above 900 the layout stops changing, the measurements are
 * clean, and `.tip-right` remains the opt-out for a term genuinely close to
 * the right-hand edge.
 */
@media (max-width: 900px) {
  [data-tip]::after {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    width: auto;
    max-width: none;
    transform: translate(0, 6px);
  }
  [data-tip].tip-right::after { left: 12px; right: 12px; }
  [data-tip]:hover::after,
  [data-tip]:focus-visible::after { transform: translate(0, 0); }
}

/* The global reduced-motion rule collapses the transition, which is correct
 * here: the box appears at once rather than sliding, and it still appears.
 * Unlike the fact strip, the resting state of a tooltip is *meant* to be
 * hidden, so no override is needed -- stated because the two components look
 * alike and the difference is the whole reason one needed an exception. */

/* ---------- the cycling fact line ---------- */
/*
 * One line at a time, changing every 3.6 seconds: slow enough to read
 * without becoming something the reader has to wait for.
 *
 * Pure CSS, so it works in the no-JavaScript edition, follows whichever palette
 * the reader has chosen, and costs no bytes beyond the text itself. The
 * alternative -- an animated image -- would be minutes long at this pace,
 * would bake one theme in, and would put this project's own claims inside a
 * picture where they cannot be selected, searched or read aloud. Finding F-37
 * was exactly that, rendered illegibly.
 *
 * Every fact shares one keyframe and differs only by delay. The percentages
 * below are one slot of 26, so they are tied to the number of `.fact`
 * elements in the page: `--fact-count` records it and a site test compares the
 * two, because adding a line without widening the cycle would overlap two
 * messages -- readable in neither.
 */
.facts {
  --fact-count: 26;
  --fact-cycle: 93.6s;
  position: relative;
  margin: 26px auto 0;
  max-width: 640px;
  /* Reserve the line's height so nothing below it moves as messages swap.
   * Two lines' worth: the longest of these wraps on a narrow phone. */
  min-height: 3.2em;
}

.fact {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  color: var(--c, var(--muted));
  font-size: 14px;
  line-height: 1.6;
  opacity: 0;
  animation: fact-cycle var(--fact-cycle) linear infinite;
  animation-delay: calc(var(--f) * var(--fact-cycle) / var(--fact-count));
  /* `opacity` and `transform` only -- the two properties that animate without
   * a layout pass, which is the rule the rest of this stylesheet follows. */
  will-change: opacity, transform;
}

@keyframes fact-cycle {
  0%            { opacity: 0; transform: translateY(5px); }
  0.385%     { opacity: 1; transform: none; }
  2.923%   { opacity: 1; transform: none; }
  3.308%    { opacity: 0; transform: translateY(-5px); }
  100%          { opacity: 0; transform: translateY(-5px); }
}

/* The global reduced-motion rule at the top of this file collapses every
 * animation to 0.01ms, which for this component would end every message at its
 * final keyframe -- opacity 0 -- and leave the line blank. So the preference is
 * handled explicitly here: no cycling, and the first fact simply stays.
 *
 * This is the same trap as an animated image ignoring the preference. A
 * blanket rule that neutralises motion has to be checked against components
 * whose *resting* state is invisible. */
@media (prefers-reduced-motion: reduce) {
  .fact { animation: none; opacity: 0; transform: none; }
  .fact:first-child { opacity: 1; }
  .facts { min-height: 0; }
}

/* ---------- the veil animation ---------- */
/* Bars start even and blue on the left, fragment and shift purple to the
 * right: the product in one picture, matching the icon. Pure CSS. */

/* The bars now live inside a figure in the walkthrough rather than in the hero.
 * They were directly beneath the animated banner, so the page opened with two
 * waveforms animating at once -- redundant, and each made the other look like
 * decoration. Beside the sentence about the voiceprint being destroyed they
 * illustrate it instead. */
.veil-figure { margin: 14px 0 18px; }
.veil-figure figcaption {
  color: var(--muted);
  font-size: 13px;
  max-width: 62ch;
  margin-top: 4px;
}

.veil { display: flex; gap: 3px; justify-content: flex-start; align-items: center;
        height: 54px; margin: 0 0 8px; }
.veil span {
  width: 5px;
  border-radius: 2px;
  background: var(--accent);
  /* Same reason as `.demo-wave span`: without a resting height and
   * `backwards`, every bar whose delay has not elapsed is undrawn. The delays
   * here only reach 500 ms so it was half a second of a partial figure rather
   * than several seconds, which is why it went unnoticed. */
  height: 16%;
  animation: pulse 1.9s ease-in-out infinite backwards;
}
.veil span.veiled { background: var(--accent-2); opacity: 0.85; }

@keyframes pulse {
  0%, 100% { height: 16%; }
  50%      { height: 82%; }
}

/* ---------- reveal on scroll ---------- */
/* Scoped to html.js, which theme.js sets from a blocking head script. Without
 * JavaScript these rules never apply and the content is simply visible, and the
 * one failure mode a reveal effect must not have.
 *
 * Only opacity and transform are animated, so the compositor handles it
 * without a layout pass. `prefers-reduced-motion` is already neutralised
 * globally at the top of this file, and reveal.js additionally skips the
 * observer entirely in that case. */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- the walkthrough ---------- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 0; }

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 46px;
  margin: 0;
}
/* The connecting rail, drawn once per step rather than as a separate element. */
.step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }

.step::after {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.step h3 { margin: 2px 0 6px; color: var(--fg); }
.step p  { margin: 0; color: var(--muted); font-size: 13.5px; }
.step pre { margin: 10px 0 0; }

/* Two panels side by side: what the window shows, what the shell does. */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* A key/value strip for the "two passwords" comparison. */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.compare > div {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
}
.compare .lock  { border-left-color: var(--accent); }
.compare .vault { border-left-color: var(--accent-2); }
.compare h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--fg); letter-spacing: 0.03em; }
.compare p  { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */

/* `align-items` is declared, not defaulted. A flex row that does not say
 * leaves it at `stretch`, so one button that wraps to two lines on a narrow
 * viewport makes every button beside it taller. Buttons in a row are the one
 * place that shows immediately. */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--bg-inset); }
.btn:active { transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.08); }

/* ---------- sections ---------- */

section { padding: 40px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: 0; }

h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 30px; letter-spacing: 0.04em; margin: 0 0 8px; }
h2 { font-size: 20px; color: var(--accent); margin: 0 0 16px; letter-spacing: 0.03em; }
h3 { font-size: 15px; color: var(--accent-2); margin: 22px 0 8px; }
h4 { font-size: 13.5px; color: var(--cyan); margin: 16px 0 6px; letter-spacing: 0.02em; }

.lede { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.note {
  border-left: 3px solid var(--warn);
  background: var(--bg-soft);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
}
.note.good { border-left-color: var(--ok); }
.note.bad  { border-left-color: var(--err); }
.note p:first-child { margin-top: 0; }
.note p:last-child  { margin-bottom: 0; }

code, pre, kbd { font-family: inherit; }

code:not(pre code) {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
  color: var(--cyan);
}

pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }

/* A reference table has a column of item names that cannot be broken -- they
 * are code -- so its narrowest possible width can exceed the column it is in.
 * `display: block` makes the element its own sideways scroller, and the rows
 * inside are laid out by an anonymous table box.
 *
 * What that costs, measured rather than assumed: a table is now **content**
 * width rather than column width. On the security page the tables come out at
 * 820 px inside an 860 px column, so the row rules stop forty pixels short of
 * the text above them. `width: 100%` does not change it -- tried, measured,
 * still 820 -- because the shrink happens on the anonymous table inside, not on
 * the block. Forty pixels of rule against a page that no longer scrolls
 * sideways on a phone is a trade worth making, but it is a trade, and an
 * earlier version of this comment claimed nothing changed on a desktop.
 *
 * Deliberately not inside a width query. The reference pages keep a 200 px
 * contents column until 720 px, so a tablet at 768 gives a table *less* room
 * than a phone does: with this scoped to 760, `chain.html` still scrolled to
 * 908 px at a viewport of 768. Measured, then unscoped. */
table {
  display: block;
  width: auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--accent); font-weight: 700; }

/* `DeidConfig::reseed_range_is_finer_than_a_frame` is one unbreakable word
 * 385 px wide, and a phone column is about 300. `break-word` breaks a word only
 * when it would otherwise overflow, so ordinary code spans are untouched --
 * and a `<code>` inside a `<pre>` is excluded, because a code block scrolls
 * sideways on purpose and breaking its lines would change what they say. */
code { overflow-wrap: break-word; }
pre code { overflow-wrap: normal; }

/* `anywhere` rather than `break-word`, and only inside a table cell.
 *
 * The two differ in exactly one way that matters here: `break-word` breaks a
 * long word when it would overflow, but it does *not* count that break when the
 * browser works out how narrow the element could possibly be. `anywhere` does.
 * A table's width comes from that number, so with `break-word` the items table
 * still insisted on 658 px and scrolled sideways inside a 630 px column on a
 * desktop -- measured, after the rule above was already in place. With
 * `anywhere` the same table fits its column and breaks an identifier only in
 * the cells that actually need it. */
td code, th code { overflow-wrap: anywhere; }

ul, ol { padding-left: 22px; }
li { margin: 5px 0; }

/* ---------- verifier ---------- */

.tool { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }

.drop {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.drop:hover, .drop.hot { border-color: var(--accent); color: var(--fg); background: var(--bg-inset); }

input[type="text"] {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  padding: 9px 11px;
  margin-top: 10px;
}

.hash {
  font-size: 12.5px;
  word-break: break-all;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  color: var(--cyan);
}

.verdict { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-weight: 700; }
/* `background: var(--bg-soft)` first, as the fallback for engines that drop the
 * `color-mix` line -- see the header rule for the full reasoning. The verdict
 * is the single most important thing this page ever says, so it must not be
 * unreadable anywhere. */
.verdict.match { background: var(--bg-soft); background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border: 1px solid var(--ok); }
.verdict.fail  { background: var(--bg-soft); background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); border: 1px solid var(--err); }

progress { width: 100%; height: 6px; margin-top: 12px; }

/* ---------- repo panel ---------- */

.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 14px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 22px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- the repository panel, while it loads ---------- */
/* The fetch is opt-in and can take a moment over a slow link, so the panel
 * says so with movement rather than leaving four em dashes sitting there
 * looking like the answer. Only opacity and transform are animated. */

.repo-loading .stat b,
.repo-loading #repo-desc {
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}

/* Each panel piece arrives with the same rise the hero uses, staggered by its
 * own --i so the stats do not all land at once. */
.repo-in { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.repo-in { animation-delay: calc(var(--i, 0) * 60ms); }

/* The spinner on the button itself, so the control that was pressed is the
 * thing that shows it is working. */
.btn .spin {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.readme { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 6px 20px 20px; }
/* Rendered from README.md, so the sizes are whatever the file uses and are
 * capped at the column width -- i.e. shrunk. Same reason as the banner. */
.readme img { max-width: 100%; height: auto; border-radius: 8px; }
.readme h1 { font-size: 22px; } .readme h2 { font-size: 17px; } .readme h3 { font-size: 14px; }
.readme blockquote {
  margin: 14px 0; padding: 10px 16px;
  border-left: 3px solid var(--accent); background: var(--bg-inset); color: var(--muted);
}

/* syntax highlighting, deliberately small, applied by js/markdown.js */
.tok-kw   { color: var(--accent-2); }
.tok-str  { color: var(--ok); }
.tok-num  { color: var(--warn); }
.tok-com  { color: var(--muted); font-style: italic; }
.tok-fn   { color: var(--cyan); }
.tok-attr { color: var(--warn); }

/* ---------- the screenshot gallery ---------- */

/* The gallery of window captures.
 *
 * The gap was 22px, which is close enough to the space inside each picture's
 * own padding that the pictures read as one continuous field rather than as
 * ten separate windows. Every capture is now the same height, so they tile
 * exactly and that crowding is more obvious rather than less.
 *
 * 40px between columns and 48px between rows: more down than across, because
 * each figure carries a caption under it, and a row gap that only matched the
 * column gap put the next picture as close to a caption as the caption is to
 * the picture it describes. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  column-gap: 40px;
  row-gap: 48px;
  margin: 32px 0 0;
}

.shot, .cast { margin: 0; }

/* `height: auto` beside the width/height attributes on the element: the
 * attributes give the browser the aspect ratio before the bytes arrive, so the
 * page does not jump as each picture loads, and this stops that ratio being
 * applied as a fixed pixel height once it has. */
/* No border, no radius and no background behind these.
 *
 * The corners are in the file. `tools/shots/round.py` rounds them into the
 * alpha channel, because the README is rendered by GitHub, which strips styles
 * from images, and a picture that is only round on the website is not round.
 *
 * Once the shape is in the pixels, painting it again here does harm rather
 * than nothing. `border-radius` on an `img` clips the content box, and these
 * are displayed at roughly a third of their captured width, so the file's
 * 14-pixel radius arrives on screen as about five while a fixed 9 here would
 * cut into the picture past it. A `background` is worse: it shows through the
 * corners the file made transparent, as a wedge of inset colour in each one.
 * And a square 1px border crosses the rounded corner it is meant to follow.
 *
 * The captures already carry the application's own window frame, which is the
 * edge a reader sees. */
.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption, .cast figcaption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 8px;
}
.shot figcaption strong { color: var(--fg); }

.casts { margin: 20px 0 0; }
.cast { margin: 0 0 20px; }
/* The drawings carry their own width and height, exactly as the flowcharts do,
 * so they render at their own size and scale down on a narrow screen rather
 * than being blown up on a wide one. The scroll is the safety net. */
.cast { overflow-x: auto; }
.cast img { display: block; max-width: 100%; height: auto; }

/* ---------- wiki ---------- */

.wiki-layout { display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: start; }
.toc { position: sticky; top: 74px; font-size: 13px; }
.toc a { display: block; color: var(--muted); padding: 3px 0; border: 0; }
.toc a:hover, .toc a.active { color: var(--accent); }
/* A grid item's default `min-width: auto` means it refuses to be narrower
 * than its own contents, and one `<table>` of items has a min-content width of
 * 658 px. So on a 390 px phone the column stayed 658 px wide and took the whole
 * reference page sideways with it -- headings, paragraphs and all. Measured
 * with `tools/render/probe.py overflow --width 390`, which named the table.
 *
 * `min-width: 0` is the same fix the navigation row already carries, for the
 * same reason, and it is what lets the scroll containers below actually
 * contain anything. */
.wiki-layout > * { min-width: 0; }

@media (max-width: 720px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}

/* The flowcharts carry their own width and height and a max-width of 100 %,
   so a drawing renders at its own size on a desktop and scales *down* on a
   narrow screen -- never up. Before that they were width="100%" with no
   intrinsic size, which scaled a 4490 px canvas into a 630 px column at
   0.147 and rendered 13 px labels under two pixels tall. The scroll below is
   the safety net for a single box wider than the column: better a diagram the
   reader can push sideways than a page that scrolls sideways underneath it. */
.diagram { margin: 14px 0; overflow-x: auto; }
.diagram svg { display: block; margin: 0 auto; }

/* The roadmap's items, each addressable on its own.
 *
 * A roadmap item is the unit people talk about this project in, and until
 * these anchors existed the only way to point at one was to send the whole
 * page and say which paragraph. The number is the link because the number is
 * already there and already unique: adding a separate link glyph beside it
 * would be two things where one will do.
 *
 * The link is quiet until the row is hovered or the link itself is focused.
 * Permalinks that shout are a distraction on a list of a hundred, and ones
 * that only appear on hover are unreachable by keyboard, so both. */
ul.items { list-style: none; padding-left: 0; }
ul.items li {
  margin: 0 0 10px;
  padding-left: 44px;
  text-indent: -44px;
}
.item-link {
  display: inline-block;
  min-width: 34px;
  color: var(--muted);
  text-decoration: none;
  text-indent: 0;
  opacity: 0.55;
  transition: opacity 120ms ease, color 120ms ease;
}
ul.items li:hover .item-link,
tr:hover > td .item-link,
.item-link:hover,
.item-link:focus-visible {
  opacity: 1;
  color: var(--accent);
}
/* The explanation after the name, one step back so the name is scannable in
   a long list without the explanation being hidden from anybody who wants it. */
.item-detail { color: var(--muted); }
/* A row or item arrived at by its own link says so, otherwise following a
   permalink into a list of a hundred lands you nowhere in particular. */
ul.items li:target,
tr:target > td {
  background: var(--bg-inset);
}
ul.items li:target { box-shadow: -8px 0 0 var(--bg-inset), 8px 0 0 var(--bg-inset); }
h3:target { color: var(--accent); }

/* Every box in a flowchart is a link, and on these pages it goes to the file's
 * source on this site rather than off to GitHub. That is worth making obvious,
 * and it costs one hover state and no script.
 *
 * `stroke-width` and `fill` rather than a colour: the outline already carries
 * the box's role -- a way in, a public function, a private helper -- and
 * repainting it would throw that away for the one box the reader is pointing
 * at. The transition is neutralised by the global reduced-motion rule at the
 * top of this file. */
.diagram a { cursor: pointer; }
.diagram a rect { transition: stroke-width 0.12s ease, fill 0.12s ease; }
.diagram a:hover rect { stroke-width: 3; fill: var(--bg); }
.diagram a:focus rect { stroke-width: 3; fill: var(--bg); }

/* ---------- a source file, on this site ---------- */

/* `white-space: normal` on the block and `pre` on each line, which looks
 * backwards and is not. Every line is its own element so it can be numbered
 * and marked, and the newlines *between* those elements are markup rather than
 * content: left as `pre` each one draws a second, empty line and the whole
 * file comes out double-spaced.
 *
 * With no stylesheet at all this degrades to a plain `<pre>` of inline spans
 * under the browser's own `white-space: pre`, which renders the file correctly
 * and loses only the numbers. */
pre.src {
  white-space: normal;
  padding: 12px 0;
  counter-reset: srcline;
  overscroll-behavior-x: contain;
}

/* `width: max-content` with a floor of the full column. A block child of a
 * sideways scroller is only as wide as the *visible* box, so a marked line
 * stopped being marked the moment the reader scrolled right -- the highlight
 * ended where the column did, in the middle of the code it was meant to be
 * pointing at. */
.src .ln {
  display: block;
  white-space: pre;
  width: max-content;
  min-width: 100%;
  min-height: 1.55em;
  border-left: 3px solid transparent;
}

/* The number stays put while the line scrolls under it. It is a pseudo-element
 * so that selecting the code and copying it does not take the numbers with it,
 * which is the thing that makes a numbered listing useless to paste. */
.src .ln::before {
  counter-increment: srcline;
  content: counter(srcline);
  display: inline-block;
  width: 3.4em;
  margin-right: 1em;
  text-align: right;
  color: var(--muted);
  background: var(--bg-inset);
  position: sticky;
  left: 0;
  -webkit-user-select: none;
  user-select: none;
}

/* The mark, and it is `:target` rather than script: it works with JavaScript
 * off, it survives a bookmark, and it is the browser's own idea of where the
 * reader asked to be. A line number marks its line. A box in a diagram marks
 * the whole function, because a function is what the reader clicked on. */
.src .ln:target,
.src .src-item:target .ln {
  background: var(--bg-soft);
  border-left-color: var(--accent);
}

details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  background: var(--bg-soft);
}
summary { cursor: pointer; color: var(--accent); }

/* ---------- the releases page ---------- */

/* Every release is a closed row until somebody opens it, so the list reads as
 * a list of versions rather than as one release with the rest of the page
 * behind it. The summary carries the version and a one-line description, and
 * has to look like a row you can click rather than a paragraph that happens to
 * be blue. */
.release > summary {
  font-size: 15px;
  padding: 4px 0;
  /* The version and its description sit on one line at any width the line
   * fits, and wrap as a block rather than around the marker when it does not. */
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.release > summary .muted { font-weight: 400; font-size: 13.5px; }
.release > summary strong { color: var(--fg); }

/* The notes inside a release: a second, quieter box. The files are above it
 * because they are what somebody came for, and several hundred lines of prose
 * in front of a download link is several hundred lines of scrolling. */
.notes {
  background: transparent;
  border-style: dashed;
  margin-top: 14px;
}
.notes > summary { font-size: 14px; }
.notes > summary strong { color: var(--fg); }

/* The tables of files and of documentation scroll inside themselves rather
 * than pushing the page sideways on a phone. */
/*
 * The picture of what changed, at the top of a release.
 *
 * Drawn at 1280x640 by `tools/release/card.py`, which is the shape a link
 * preview is cropped to, and shown here at whatever width the page has.
 * `height: auto` against the declared attributes keeps the space reserved
 * before it loads, so nothing below it moves when it arrives, which is what
 * `tools/site-tests/anchors.test.js` is checking when it insists on a width
 * and a height on every image.
 */
.release-card {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.release table { display: block; overflow-x: auto; max-width: 100%; }

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

footer {
  border-top: 1px solid var(--border);
  /* The extra bottom padding clears the iOS home indicator, which otherwise
   * sits over the last line of the footer. `env()` is zero where it does not
   * apply, so `max()` keeps the desktop spacing unchanged. */
  padding: 28px 0 max(46px, calc(28px + env(safe-area-inset-bottom)));
  color: var(--muted);
  font-size: 12.5px;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

.fp { font-size: 11.5px; word-break: break-all; color: var(--cyan); }

.noscript-banner {
  background: var(--bg-soft);
  border: 1px solid var(--warn);
  border-left-width: 3px;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 20px 0;
}

/* ---------- welcome / legal gate ---------- */

body.legal-locked { overflow: hidden; }

.legal-overlay {
  position: fixed;
  /*
   * Longhands first, then the shorthand.
   *
   * `inset` is Safari 14.1 (early 2021), and an engine older than that treats
   * the declaration as invalid and **drops it**. A `position: fixed` element
   * with no offsets sits wherever it happened to be in the flow, at its own
   * content size -- so this overlay would not cover the page.
   *
   * That matters more here than anywhere else on the site. The gate is shown
   * with `body { overflow: hidden }`, so the failure is not "the modal looks
   * wrong": it is a page the reader cannot scroll, with the thing stopping
   * them not covering the screen. The `color-mix` fallback a few lines down
   * exists for the same reader and the same reason.
   */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  /* The most important fallback on the page.
   *
   * This overlay is shown with `body.legal-locked { overflow: hidden }`, so if
   * its background is missing the reader gets a page that has stopped
   * scrolling with nothing visible to explain why -- an invisible modal, which
   * is indistinguishable from the site being broken. That is what an engine
   * older than Safari 16.2 or Firefox 113 got, because a declaration it cannot
   * parse is a declaration it discards. The opaque colour goes first so there
   * is always *something* there.
   */
  background: var(--bg-inset);
  background: color-mix(in srgb, var(--bg-inset) 82%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;

  /* Keep the dialogue clear of the notch and the home indicator. */
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.legal-box {
  width: min(680px, 100%);

  /* `dvh`, with `vh` as the fallback, and the distinction is not cosmetic.
   *
   * On iOS Safari `100vh` is the viewport height with the browser chrome
   * *collapsed*, which is taller than what you can actually see while the URL
   * bar is expanded. So `88vh` could put the bottom of this box -- which is
   * where the **continue** button is -- below the visible area. And the page
   * behind is deliberately scroll-locked (`body.legal-locked`), so there was
   * no way to scroll down to it: the gate could not be dismissed, on a phone,
   * on first load, which is exactly when everyone meets it.
   *
   * `dvh` is the unit that means "the height you can currently see". Engines
   * without it (Safari before 15.4) take the `vh` line, which is the behaviour
   * as it was -- no worse, and better everywhere else.
   */
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 28px;
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* The box is what `legal.js` focuses when the gate opens, so that no control
 * inside it looks pressed before the reader has done anything. A ring around
 * the whole dialog would say the same wrong thing at a larger size. */
.legal-box:focus { outline: none; }

.legal-box h2 { margin-top: 0; color: var(--accent); letter-spacing: 0.05em; }
.legal-box p { font-size: 13.5px; }
.legal-box ul { font-size: 13px; color: var(--fg); }

.legal-warn {
  border-left: 3px solid var(--warn);
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
}

.legal-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  transition: border-color 0.15s ease;
}
.legal-check:hover { border-color: var(--accent); }
.legal-check input { margin-top: 3px; accent-color: var(--accent); flex: none; }

.legal-fine { color: var(--muted); font-size: 12px; }

#legal-go { width: 100%; justify-content: center; }
#legal-go:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- search ---------- */
/* The motion here is deliberately small. `prefers-reduced-motion` is already
 * neutralised globally at the top of this file, and everything animated below
 * is `opacity` or `transform` only, so the compositor handles it without
 * laying the page out again. */

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

.lead { color: var(--muted); max-width: 68ch; }

/* The element is `<div class="wrap search-page">`, and `.wrap` sets
 * `padding: 0 20px`. A second `padding` *shorthand* here does not add to
 * that -- it replaces it, and the two zeroes took the side gutters away.
 * Invisible at 900 px, where the column is narrower than the screen
 * anyway; on a phone every heading and all 200 index rows ran edge to
 * edge. Found by measuring how close text sits to the screen edge, which
 * is a thing no overflow check can see, because nothing overflowed. */
.search-page { padding: 30px 20px 60px; }
.search-page h1 { margin-bottom: 6px; }

.search-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 10px;
  position: sticky;
  top: var(--header-h, 64px);
  z-index: 5;
  background: var(--bg);
  padding: 8px 0;
}

.search-box { flex: 1 1 320px; display: flex; }

.search-box input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  /* Only the border and the ring move: no layout, no reflow, no jump. */
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  /* Plain colour first: an engine older than 2023 drops a `color-mix`
   * declaration whole, and with nothing before it the focused input would lose
   * its ring entirely (F-30). */
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.22);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.search-box input:disabled { opacity: 0.55; cursor: progress; }

.search-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.search-filters select {
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.search-filters select:hover { border-color: var(--accent); }

.search-count { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }

.search-results { list-style: none; margin: 0; padding: 0; }

.search-results .sr {
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 12px 14px;
  margin: 0 0 8px;
  transition: border-left-color 0.16s ease, transform 0.16s ease;
}
.search-results .sr:hover {
  border-left-color: var(--accent);
  transform: translateX(2px);
}

/* The entrance. 150ms and 5px -- enough to show the list changed, short
 * enough that it is finished before the eye settles on the first result.
 * `search.js` adds `.sr-stagger` only when the shape of the answer changes
 * (a sort, a filter, or the first results after an empty box), never on an
 * ordinary keystroke: replaying a cascade per character reads as flicker. */
.sr-stagger .sr {
  animation: sr-in 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 14ms);
}

@keyframes sr-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.sr-head {
  display: inline-block;
  color: var(--fg);
  font-weight: 700;
  border: 0;
  margin-bottom: 3px;
}
.sr-head:hover { color: var(--accent); }

.sr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.sr-path { word-break: break-all; }
.sr-line { flex: none; }

.sr-kind {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent-2);
}
.sr-kind-doc   { color: var(--ok); }
.sr-kind-rust  { color: var(--accent); }
.sr-kind-test  { color: var(--accent-2); }
.sr-kind-web   { color: var(--cyan, var(--accent)); }
.sr-kind-legal { color: var(--muted); }

.sr-x { color: var(--muted); font-size: 13px; margin: 7px 0 0; }

.search-results mark {
  /* Fallback first, then the theme-aware form -- the order matters, and the
   * reverse silently means the themed colour never applies. */
  background: rgba(122, 162, 247, 0.26);
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--fg);
  border-radius: 3px;
  padding: 0 1px;
}

.search-empty { color: var(--muted); }

/* 760px is the header's own breakpoint, not a round number: below it the header
 * becomes two rows and grows past the offset these controls stick at, so a
 * sticky bar here would sit underneath it. Static is the honest answer on a
 * phone, where a second sticky row would cost screen the page needs (F-34). */
@media (max-width: 760px) {
  .search-controls { position: static; }
  .search-filters select { flex: 1 1 45%; }
}

/* ---------- the JavaScript edition toggle ---------- */
/*
 * A switch, not a link that looks like one, because the thing it controls is a
 * binary state the reader is in: which edition of this site they are being
 * served. `role="switch"` and `aria-checked` are on the anchor so assistive
 * technology reports that state rather than "link, no-js".
 *
 * It is honest about what it does. It does **not** turn JavaScript off in the
 * browser -- nothing on a page can do that -- it moves you between the full
 * site and the HTML-and-CSS edition. The label says "JavaScript" and the title
 * attribute says the rest.
 *
 * Three states:
 *   .js  + on the full site   -> on,  and clicking goes to the no-JS edition
 *   .js  + on the no-JS site  -> off, and clicking comes back
 *   no .js at all             -> off and LOCKED: scripts are not running, so
 *                               there is no way back and the control says so.
 */

/* The two site controls, grouped and set apart from the navigation.
 *
 * The switch used to live among the nav links, where it read as one more
 * destination. It is not: it chooses which *edition* of the site you are
 * served, which is the same kind of choice as the colour scheme. Grouping them
 * says so without a word of explanation. */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
@media (max-width: 760px) {
  /* On a phone the navigation already takes its own row, so the divider would
   * separate the controls from nothing. */
  .controls { margin-left: auto; padding-left: 0; border-left: 0; }

  /* With scripts off the switch grows a note -- "(locked: scripts are not
   * running)" -- which is 257 px of `white-space: nowrap` beside a colour
   * picker. On a 390 px phone that pushed the header, and therefore every
   * page, 90 px sideways. Measured with
   * `tools/render/probe.py overflow --no-js --width 390`, which is a
   * combination nothing had rendered before: the site was checked with
   * scripts off, and separately on a phone, and never both at once.
   *
   * The note stays, in full, because it is the honest explanation of why the
   * switch cannot be moved. It simply takes its own line. */
  .controls { flex-wrap: wrap; row-gap: 4px; }
  .js-toggle { white-space: normal; flex-wrap: wrap; }
  .js-toggle-lock { white-space: normal; }
}

.js-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  min-height: 24px;          /* WCAG 2.5.8, same as the nav links */
  white-space: nowrap;
}
.js-toggle:hover { color: var(--accent); }

.js-toggle-track {
  position: relative;
  width: 30px;
  height: 16px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-inset);
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.js-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  /* transform only: the compositor moves it without laying the page out. */
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.16s ease;
}

/*
 * ON is driven by `html.js`, not by the `aria-checked` attribute.
 *
 * The attribute is in the markup, and markup cannot know whether scripts run.
 * The first version hardcoded `aria-checked="true"`, so with JavaScript
 * disabled the switch cheerfully reported "on" *while* displaying "scripts are
 * not running" beside it -- a control contradicting itself in the one state it
 * exists to describe.
 *
 * So the honest default is off, in the markup, for everyone; `theme.js` adds
 * `html.js` and upgrades `aria-checked` when it actually runs. A reader with no
 * JavaScript is never told a script is running.
 */
html.js .js-toggle .js-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
html.js .js-toggle .js-toggle-knob {
  transform: translateX(14px);
  background: var(--bg);
}

/* Which word is shown. Two spans rather than one, because CSS can hide an
 * element but cannot rewrite its text, and this has to be right with no script
 * available to rewrite anything. */
.js-when-on { display: none; }
html.js .js-when-on { display: inline; }
html.js .js-when-off { display: none; }

.js-toggle-state { font-variant-numeric: tabular-nums; }

/*
 * Locked. `html.js` is set by `theme.js` from a blocking head script, so its
 * absence means scripts are not running -- which is exactly when this control
 * cannot be used, because moving back to the full site would be moving to a
 * page that needs the thing that is switched off.
 *
 * Written as `html:not(.js)` rather than toggled by script for the obvious
 * reason: script is what is missing.
 */
html:not(.js) .js-toggle {
  cursor: not-allowed;
  opacity: 0.75;
}
html:not(.js) .js-toggle .js-toggle-track {
  border-style: dashed;
}
html:not(.js) .js-toggle-lock { display: inline; }
.js-toggle-lock { display: none; color: var(--muted); }

/* On the no-JavaScript edition the switch is off because that is the edition
 * the reader chose, not because scripts are broken -- so no lock note there.
 * That page carries its own copy of these rules and does not load this file. */

/* --- Looking at a screenshot properly -------------------------------------
 *
 * The captures are 3840 across. In a two-column grid that is about a tenth of
 * their real size, and every word in them is unreadable -- which makes them
 * decoration rather than evidence, and evidence is the point of showing them.
 *
 * So a screenshot opens. Clicking one puts it on a dark backdrop at whatever
 * size the window allows, and clicking again, pressing Escape, or moving focus
 * away closes it.
 *
 * Built with `:target` and a link rather than script, so it works with
 * JavaScript off, which is the same reason the rest of this page is built the
 * way it is. The close control is a real link and the panel is reachable by
 * keyboard.
 */
.shot img {
  cursor: zoom-in;
}

.viewer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  overscroll-behavior: contain;
}

.viewer:target {
  display: flex;
}

.viewer img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

/* The whole backdrop closes it, so a mis-aimed click is not a trap. */
.viewer .dismiss {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  cursor: zoom-out;
}

.viewer .shut {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 1;
  padding: 6px 14px;
  border-radius: 8px;
  font: inherit;
  color: var(--fg);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  text-decoration: none;
}

.viewer .shut:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .viewer { padding: 10px; }
  .viewer .shut { top: 10px; right: 12px; }
}

/* ---------------------------------------------------------------------------
   The walkthrough: photographs of every screen, and the command line as jobs.

   Deliberately plain. The pictures are the content, so the chrome around them
   stays out of the way: a row of tabs, one framed image, and a caption. The
   grid for the command cases collapses to a single column rather than
   shrinking, because a worked example is a sentence and a sentence in a
   40-character column is worse than a taller page.
   --------------------------------------------------------------------------- */

.walk { margin-top: 46px; }

.walk-h {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin: 0 0 8px;
}
.walk-h-cli { margin-top: 44px; }

.walk-lede {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 16px;
  max-width: 70ch;
}

.walk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.walk-tab {
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 11px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.walk-tab:hover { color: var(--fg); border-color: var(--accent); }
.walk-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.walk-tab-on {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.walk-shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-inset);
  padding: 10px;
}
.walk-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.walk-shot figcaption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
  max-width: 70ch;
}

.walk-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.walk-case {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 13px 15px;
}

.walk-case-title {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--fg);
}

.walk-case-cmd {
  display: block;
  font-size: 12.5px;
  color: var(--cyan);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 7px 9px;
  margin-bottom: 9px;
  /* A long command wraps rather than scrolling the page sideways. */
  overflow-wrap: anywhere;
}

.walk-case-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .walk-cases { grid-template-columns: 1fr; }
  .walk-shot { padding: 6px; }
}
