/* agent-sentinel site styles.
   No external requests: fonts are served from fonts/.

   THE SYSTEM. Read this before changing anything.

   Look     Paper and marker. A framed page on grid paper, thick outlines,
            hard offset shadows, square corners, a few tilted stickers and
            highlighter marks. Nothing is blurred, glowing or softly rounded.
            The only curves are pills (999px) on the fact badges.

   Themes   Dark is the default. Light applies when the system asks for it or
            the visitor picks it (data-theme on the html element).
            Outlines are mint on dark and black on light (--border).

   Color    Four accents, each with one job. Text on an accent is always black.
              mint    allowed, safe, the primary action
              pink    blocked, hostile, danger
              yellow  ask a human, attention, section stickers, "you are here"
              cyan    information, links, hover

   Lines    3px on boxes, 2px on chips, marks and dividers, 4px on the page
            frame and the two hero blocks. Dividers inside a box are dashed.

   Shadows  Solid, no blur, same offset on both axes, sized by the element:
              3px  chips, tags, markers        (--sh-1)
              4px  buttons, small boxes        (--sh-2)
              6px  cards                       (--sh-3)
              8px  feature blocks, caution box (--sh-4)
              10px hero card, closing band     (--sh-5)
            Default shadow color is the outline. A card may set --shadow to an
            accent so neighbours differ. Fills (title bars, tiles, chips,
            marks) always carry their accent's job; when a grid cannot keep
            neighbours apart that way, vary the shadow, not the fill.
            Mint-filled blocks use --pop.

   Tilt     Stickers and notes only, between -8 and 6 degrees, mostly 1 to 3.
            Never on body text and never on a control.

   States   Hover turns a control cyan and lifts it 2px; a press pushes it
            flat. The current nav link and the open tab are yellow. Focus is
            a 3px ring in the text color (white on dark, black on light and
            on yellow), offset 3px. With reduced motion nothing moves. In
            forced colors the open tab and the current link use Highlight.

   Type     Space Grotesk for text and headings, Space Mono for labels,
            chips, table heads and code, Caveat for three handwritten notes.

   Space    One scale: 4 8 12 16 24 32 48 64 (--space-1 to --space-8).

   Islands  Two surfaces keep their own colors in both themes and re-declare
            the tokens for their children: "screens" (code, terminal, verdict:
            always dark, mint lines) and the yellow closing band and mint
            feature panel (always black ink). */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.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: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/space-mono-400-latin.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: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-mono-700-latin.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: "Caveat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/caveat-700-latin.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;
}

/* ---------- Design tokens ---------- */

:root {
  color-scheme: dark;

  --outer-bg: #0a0a0a;
  --bg: #1a1a1a;
  --card: #2a2a2a;
  --text: #ffffff;
  --muted: #c4c4c4;
  --border: #a8e6cf;
  --grid-line: rgba(255, 255, 255, 0.06);
  --tint: rgba(255, 255, 255, 0.1);
  --frame-shadow: rgba(0, 0, 0, 0.35);
  --link: #66d9ef;
  --focus: #ffffff;
  --pop: #ffd93d;

  --cyan: #66d9ef;
  --yellow: #ffd93d;
  --mint: #a8e6cf;
  --pink: #ff6b9d;
  --ink: #000000;
  --ink-soft: #1f1f1f;

  --screen: #0d0d0d;
  --screen-bar: #2a2a2a;
  --screen-text: #ffffff;
  --screen-muted: #c4c4c4;
  --screen-line: #a8e6cf;
  --screen-tint: rgba(255, 255, 255, 0.1);
  --tok-key: #66d9ef;
  --tok-str: #ffd93d;

  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Cascadia Code", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --text-3xl: clamp(2.125rem, 1.2rem + 3.9vw, 3.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --bw: 3px;
  --sh-1: 3px;
  --sh-2: 4px;
  --sh-3: 6px;
  --sh-4: 8px;
  --sh-5: 10px;

  --frame-gap: 18px;
  --container: 68.375rem;
  --gutter: 1.75rem;
  --header-h: 4.5rem;
  --section-pad: clamp(var(--space-7), 6vw, var(--space-8));
  --measure: 42rem;
  --code-bar-h: 2.75rem;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --outer-bg: #d0d0d0;
    --bg: #ffffff;
    --card: #ffffff;
    --text: #000000;
    --muted: #3d3d3d;
    --border: #000000;
    --grid-line: rgba(0, 0, 0, 0.07);
    --tint: rgba(0, 0, 0, 0.08);
    --frame-shadow: rgba(0, 0, 0, 0.35);
    --link: #000000;
    --focus: #000000;
    --pop: #000000;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --outer-bg: #d0d0d0;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #000000;
  --muted: #3d3d3d;
  --border: #000000;
  --grid-line: rgba(0, 0, 0, 0.07);
  --tint: rgba(0, 0, 0, 0.08);
  --frame-shadow: rgba(0, 0, 0, 0.35);
  --link: #000000;
  --focus: #000000;
  --pop: #000000;
}

@media (max-width: 39.99em) {
  :root {
    --frame-gap: 8px;
    --gutter: 1.125rem;
    --header-h: 4.25rem;
  }
}

/* Short windows (phones held sideways, zoomed pages): a lower header. */
@media (max-height: 30em) {
  :root {
    --header-h: 3.5rem;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Clears the sticky header, and is deep enough that "#top" lands at 0. */
  scroll-padding-top: calc(var(--header-h) + var(--frame-gap) + 0.75rem);
  /* Focus scrolling stops above the back-to-top button: its 46px, its offset
     and a margin. */
  scroll-padding-bottom: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  padding: var(--frame-gap);
  background: var(--outer-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* The framed sheet of grid paper everything sits on. */
.page {
  max-width: 87.5rem;
  margin-inline: auto;
  border: 4px solid var(--border);
  background-color: var(--bg);
  /* One 22px tile, repeated: a repeating gradient across the whole tall sheet
     renders its vertical lines unevenly. */
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: var(--sh-5) var(--sh-5) 0 var(--frame-shadow);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
  /* Keeps a paragraph from ending on one stray word, where supported. */
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

a:hover {
  background: var(--cyan);
  color: var(--ink);
  text-decoration-color: var(--ink);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

svg {
  display: block;
}

code,
pre {
  font-family: var(--font-mono);
  /* Code is shown character for character: no arrows made from "->" or "://". */
  font-variant-ligatures: none;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  background: var(--tint);
  font-size: 0.84em;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* A flag or a command's name never breaks at its hyphens: "-" / "-help"
   reads as another flag. It marks one word, never a whole command, so a
   long command still wraps at its spaces. */
.nowrap {
  white-space: nowrap;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

[hidden] {
  display: none !important;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 200;
  padding: 0.6rem 1.1rem;
  border: var(--bw) solid var(--ink);
  background: var(--yellow);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--ink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-300%);
}

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

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- Highlighter marks, stickers, handwritten notes ---------- */

/* A phrase run over with a marker. Black text on the accent, in both themes. */
.hl {
  padding: 0.05em 0.4em;
  border: 2px solid var(--border);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hl--mint {
  background: var(--mint);
}

.hl--pink {
  background: var(--pink);
}

.hl--cyan {
  background: var(--cyan);
}

/* A short note in handwriting with a drawn arrow. Three on the page. */
.scribble {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  width: -moz-fit-content;
  width: fit-content;
  /* A note never widens the page: where its box is narrow, it wraps. */
  max-width: 100%;
  color: var(--text);
  font-family: var(--font-hand);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: normal;
  transform: rotate(-3deg);
}

.scribble__arrow {
  flex: none;
  width: 2.75rem;
  height: 2.25rem;
  margin-top: 0.55rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Small tilted chips that overlap the corners of the hero card. */
.sticker {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.875rem;
  padding: 0.5rem 1.25rem;
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn:hover {
  background: var(--cyan);
  color: var(--ink);
}

.btn--primary {
  background: var(--mint);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--pop);
  color: var(--ink);
}

.btn--small {
  min-height: 2.75rem;
  padding: 0.35rem 0.9rem;
  font-size: var(--text-sm);
}

.btn .icon {
  width: 1rem;
  height: 1rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.icon-btn:hover {
  background: var(--cyan);
  color: var(--ink);
}

.icon-btn .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Phones: buttons in a row share its width, so a wrapped row is not ragged. */
@media (max-width: 39.99em) {
  .hero__actions .btn,
  .btn-row .btn,
  .cta-row .btn {
    flex: 1 1 auto;
  }
}

/* Pressable: hover lifts toward you, a press pushes it flat on the page. */
@media (prefers-reduced-motion: no-preference) {
  .btn:hover,
  .icon-btn:hover,
  .to-top:hover,
  .tabs__tab:hover {
    transform: translate(-2px, -2px);
  }

  .btn:hover,
  .to-top:hover,
  .tabs__tab:not([aria-selected="true"]):hover {
    box-shadow: var(--sh-3) var(--sh-3) 0 var(--border);
  }

  .btn--primary:hover {
    box-shadow: var(--sh-3) var(--sh-3) 0 var(--pop);
  }

  .icon-btn:hover {
    box-shadow: var(--sh-3) var(--sh-3) 0 var(--border);
  }

  .btn:active,
  .icon-btn:active,
  .to-top:active,
  .tabs__tab:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--border);
  }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: var(--bw) solid var(--border);
  background: var(--card);
}

/* The row may wrap (large text, user text spacing). The brand's auto margin
   takes the free space on its own row; a row the buttons wrap onto is
   pushed to the right. From 73em the name, the eight section links and the
   two buttons share one row, with about 20px to spare at 1168px. */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  background: none;
  color: var(--text);
}

/* The square monogram block. */
.brand__mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: var(--bw) solid var(--border);
  background: var(--mint);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--yellow);
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.brand__mark .icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.25;
}

/* The logo lifts like a control; nothing rotates on hover. */
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .brand__mark {
    transform: translate(-2px, -2px);
    box-shadow: var(--sh-3) var(--sh-3) 0 var(--yellow);
  }
}

.brand__name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-header .brand {
  margin-right: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.3rem 0.4rem;
  border: 2px solid transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  border-color: var(--border);
  background: var(--cyan);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
}

/* The section on screen, set by site.js: a highlighter box. */
.site-nav a[aria-current] {
  border-color: var(--border);
  background: var(--yellow);
  color: var(--ink);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn--github {
  background: var(--cyan);
  color: var(--ink);
}

.theme-toggle__moon {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle__sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-toggle__moon {
    display: block;
  }
}

:root[data-theme="light"] .theme-toggle__sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle__moon {
  display: block;
}

.menu-btn {
  display: none;
}

.menu-btn__close {
  display: none;
}

.menu-btn[aria-expanded="true"] .menu-btn__open {
  display: none;
}

.menu-btn[aria-expanded="true"] .menu-btn__close {
  display: block;
}

.menu-btn[aria-expanded="true"] {
  background: var(--yellow);
  color: var(--ink);
}

/* Reading progress, driven by site.js: a solid bar along the header's foot. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  overflow: hidden;
  pointer-events: none;
}

.progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Controls that only work with JavaScript stay hidden without it. */
html:not(.js) .theme-toggle,
html:not(.js) .menu-btn,
html:not(.js) .copy,
html:not(.js) .tabs__list,
html:not(.js) .progress,
html:not(.js) .to-top {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .progress {
    display: none;
  }
}

@media (max-width: 72.99em) {
  .site-header__inner {
    gap: var(--space-2) var(--space-3);
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
    margin: 0;
    padding-bottom: var(--space-3);
  }

  .site-nav__list {
    flex-wrap: wrap;
  }

  html.js .menu-btn {
    display: inline-flex;
  }

  /* With JavaScript the links become a panel that drops below the header. */
  html.js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* The last link stays inside the window, below the frame gap too; dvh
       leaves out the area under a phone's toolbar, where supported. */
    max-height: calc(100vh - var(--header-h) - var(--frame-gap) - var(--space-2));
    max-height: calc(100dvh - var(--header-h) - var(--frame-gap) - var(--space-2));
    padding: var(--space-2) var(--gutter) var(--space-5);
    overflow-y: auto;
    /* A focused link's ring stays inside the scrolling panel. */
    scroll-padding-block: var(--space-2);
    border-top: var(--bw) solid var(--border);
    border-bottom: var(--bw) solid var(--border);
    background: var(--card);
    box-shadow: 0 var(--sh-3) 0 var(--frame-shadow);
  }

  html.js .site-nav.is-open {
    display: block;
  }

  html.js .site-nav__list {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
  }

  html.js .site-nav li + li {
    border-top: 2px dashed var(--border);
  }

  html.js .site-nav a {
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    padding: var(--space-2) var(--space-3);
    border: 0;
    font-size: 1.0625rem;
    font-weight: 700;
  }

  html.js .site-nav a:hover {
    box-shadow: none;
  }

  html:not(.js) .site-header {
    position: static;
  }

  html:not(.js) .site-nav a {
    padding-block: var(--space-3);
  }
}

/* Short, wide windows (phones held sideways): the menu in two columns, so
   every link fits on the screen. */
@media (max-height: 30em) and (min-width: 30em) and (max-width: 72.99em) {
  html.js .site-nav__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-5);
  }

  html.js .site-nav li + li {
    border-top: 0;
  }

  html.js .site-nav li:nth-child(n + 3) {
    border-top: 2px dashed var(--border);
  }
}

/* Very short windows (400% zoom, small phones sideways): the header scrolls
   away with the page. Relative, not static, so the open menu stays on top. */
@media (max-height: 22em) {
  html {
    scroll-padding-top: var(--space-4);
  }

  .site-header {
    position: relative;
  }
}

@media (max-width: 26em) {
  .site-header__inner {
    gap: var(--space-2) 0.625rem;
  }

  .site-header__actions {
    gap: 0.625rem;
  }

  .brand {
    gap: var(--space-2);
  }

  .brand__name {
    font-size: 0.875rem;
  }
}

/* Phones: the GitHub button keeps its icon and drops its word. */
@media (max-width: 32em) {
  .btn--github {
    width: 2.75rem;
    padding: 0;
  }

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

/* Under 389px the three buttons no longer fit beside the name. The repository
   link is in the hero and the footer too. */
@media (max-width: 24.3em) {
  .site-header .btn--github {
    display: none;
  }
}

/* Below 340px (small phones, 400% zoom): a narrower gutter and tighter gaps
   keep the name and the buttons on one row. No control gets smaller. */
@media (max-width: 21.25em) {
  :root {
    --gutter: var(--space-3);
  }

  .site-header__inner,
  .site-header__actions {
    column-gap: var(--space-2);
  }
}

/* Back to top, shown by site.js after the first screen. A utility, so it
   wears the card color, not an accent. On wide screens it stays on the sheet. */
.to-top {
  position: fixed;
  right: max(1.75rem, env(safe-area-inset-right), calc((100vw - 87.5rem) / 2 + 2rem));
  bottom: max(1.75rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2.875rem;
  min-height: 2.875rem;
  padding: 0 0.875rem;
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s, transform 0.12s ease, box-shadow 0.12s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.to-top:hover {
  background: var(--cyan);
  color: var(--ink);
}

.to-top .icon {
  width: 1.125rem;
  height: 1.125rem;
  stroke-width: 2.5;
}

/* Below 1280px it is a square with the arrow only, so it covers less text. */
@media (max-width: 79.99em) {
  .to-top {
    padding: 0;
  }

  .to-top__label {
    display: none;
  }
}

@media (max-width: 39.99em) {
  .to-top {
    right: max(1.125rem, env(safe-area-inset-right));
    bottom: max(1.125rem, env(safe-area-inset-bottom));
  }
}

/* Phones, while the header sticks: its brand link already goes back to the
   top, and the button would only cover the words being read. It stays on
   very short windows, where the header scrolls away. */
@media (max-width: 39.99em) and (min-height: 22.01em) {
  .to-top {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(var(--space-7), 6vw, var(--space-8)) clamp(var(--space-6), 5vw, var(--space-7));
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
}

.hero__copy {
  min-width: 0;
  max-width: 40rem;
}

/* The status tag above the headline. */
.hero__eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-5);
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  border: 2px solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

.pill {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.6;
}

.pill--accent {
  background: var(--mint);
  color: var(--ink);
}

h1 {
  font-size: var(--text-3xl);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero__lead {
  max-width: 36rem;
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.95;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.hero__install {
  position: relative;
  margin-top: var(--space-6);
}

.scribble--install {
  margin: 0 var(--space-4) 0.1rem auto;
}

/* Beside the buttons once they stop sharing the row's width. */
@media (min-width: 40em) {
  .scribble--install {
    position: absolute;
    right: var(--space-5);
    bottom: 100%;
    margin: 0 0 -0.15rem;
  }
}

/* Pill tags, each with its own small shadow. */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: var(--space-6);
  list-style: none;
}

.badge {
  padding: 0.3rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

.hero__note {
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* The picture: a policy file with one rule of each kind. */
.hero__art {
  justify-self: start;
  width: 100%;
  max-width: 24rem;
  margin-left: 0.75rem;
  padding-right: 1.25rem;
}

.rulecard {
  position: relative;
  border: 4px solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-5) var(--sh-5) 0 var(--cyan);
}

.rulecard__bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.7rem var(--space-4) 0.7rem 3.5rem;
  border-bottom: var(--bw) solid var(--border);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
}

.rulecard__rules {
  display: grid;
  gap: 1.1rem;
  padding: 1.35rem 1.35rem 1.9rem 1.1rem;
  list-style: none;
}

.rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem var(--space-3);
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: var(--bw) solid var(--border);
  background: var(--bg);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--shadow, var(--border));
}

.rule--allow {
  --shadow: var(--mint);
}

.rule--ask {
  --shadow: var(--yellow);
}

.rule--block {
  --shadow: var(--pink);
}

.rule__tool {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
}

.rule__then {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.rule__then .icon {
  width: 0.8rem;
  height: 0.8rem;
}

.sticker--code {
  top: -1.5rem;
  left: -1.4rem;
  background: var(--cyan);
  transform: rotate(-8deg);
}

.sticker--term {
  top: 44%;
  right: -2.1rem;
  background: var(--mint);
  transform: rotate(6deg);
}

.sticker--lock {
  bottom: -1.1rem;
  left: -1.6rem;
  padding: 0.5rem;
  background: var(--pink);
  transform: rotate(-5deg);
}

.sticker--lock .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.rulecard__tag {
  position: absolute;
  right: -1rem;
  bottom: -1.2rem;
  z-index: 2;
  padding: 0.3rem 0.8rem;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  transform: rotate(2deg);
}

@media (max-width: 29.99em) {
  .hero__art {
    margin-left: 0.5rem;
    padding-right: 1rem;
  }

  .rulecard__rules {
    padding: 1.2rem 1.1rem 1.8rem 0.9rem;
  }

  .rule {
    column-gap: var(--space-2);
    padding: 0.6rem;
  }

  .rule__tool {
    font-size: 0.8125rem;
  }

  .sticker--code {
    left: -0.9rem;
  }

  .sticker--term {
    right: -1.4rem;
  }

  .sticker--lock {
    left: -1rem;
  }

  .rulecard__tag {
    right: -0.6rem;
  }
}

/* Below 340px the gutter is 6px narrower (see the header). The picture keeps
   the size and place it has with the wider gutter, so its stickers stay
   clear of the frame. */
@media (max-width: 21.25em) {
  .hero__art {
    margin-left: 0.875rem;
    padding-right: 1.75rem;
  }
}

/* Laptops and tablets held sideways: the picture beside the headline, lead
   and buttons; the install command, the badges and the note run below. */
@media (min-width: 62em) and (max-width: 72.99em) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) 21rem;
    column-gap: var(--space-7);
    row-gap: 0;
    align-items: start;
  }

  .hero__copy {
    display: contents;
  }

  .hero__copy > * {
    grid-column: 1;
  }

  .hero__eyebrow {
    justify-self: start;
  }

  .hero__art {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    margin-left: 0;
  }

  .hero__copy > .hero__install,
  .hero__copy > .badges,
  .hero__copy > .hero__note {
    grid-column: 1 / -1;
  }

  .hero__install,
  .hero__copy > .badges {
    max-width: 40rem;
  }
}

/* Two columns only once the headline and the install command both fit beside the picture. */
@media (min-width: 73em) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: var(--space-7);
  }

  .hero__art {
    justify-self: center;
    max-width: 23.5rem;
    margin-left: 0;
    padding-right: 0;
  }
}

/* ---------- Live panel ---------- */

/* Under the hero: the project on GitHub, the visitor's own time and, when
   they ask, their weather. site.js fills it in, so without JavaScript it is
   hidden. A card with a cyan sticker (information) on its top edge; its three
   parts stand side by side from 62em, two above one from 40em, and stacked
   on phones, with dashed lines between them. */
.live {
  padding-block: var(--space-5) var(--space-6);
}

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

.live__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--border);
}

.live__tag {
  position: absolute;
  top: -1.05rem;
  left: var(--space-5);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.1rem 0.6rem;
  border: 2px solid var(--border);
  background: var(--cyan);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

/* A square light. It blinks four times when the panel first comes into view
   (site.js adds is-seen), under five seconds, then holds still. */
.live__dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .live.is-seen .live__dot {
    animation: live-blink 1.2s steps(1, end) 4;
  }
}

@keyframes live-blink {
  50% {
    opacity: 0;
  }
}

.live__part {
  min-width: 0;
  padding: var(--space-5);
}

.live__part--time,
.live__part--weather {
  border-top: 2px dashed var(--border);
}

.live__label {
  margin-bottom: var(--space-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.live__wait {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* The stars and forks share a row; the last change and the tests take one each. */
.live__stats {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: var(--space-1) var(--space-5);
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.live__wide {
  flex-basis: 100%;
}

/* A link here underlines its words, not the chip beside them, and is at
   least 28px tall. */
.live__link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: 1.75rem;
  text-decoration: none;
}

.live__link-text {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.live__link > .icon {
  width: 1rem;
  height: 1rem;
}

.live__ago {
  color: var(--muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

/* The clocks: digits in Space Mono, so the width holds as they change. */
.live__clock,
.live__utc-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live__clock {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
}

/* The zone and UTC each take a line at every width, so a long zone name
   never moves the UTC line. */
.live__zone {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.live__utc {
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
}

.live__button[aria-disabled="true"] {
  cursor: progress;
}

/* While it works, the button stays pressed flat on the page. */
@media (prefers-reduced-motion: no-preference) {
  .live__button[aria-disabled="true"],
  .live__button[aria-disabled="true"]:hover {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--border);
  }
}

/* Under the privacy note. An empty result keeps its place in the page, so
   screen readers hear what arrives in it, and adds no space. From the click
   on it holds room for a whole answer, so the page moves once, with the
   click, and not again when the answer comes. No transition: with reduced
   motion every element gets a 0.01ms one, which would bring the margin a
   frame after the room and move the page twice. */
.live__weather {
  transition: none;
}

.live__weather:not(:empty) {
  min-height: 6.5rem;
  margin-top: var(--space-4);
}

.live__reading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
}

.live__temp {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
}

.live__more {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.live__message {
  font-size: var(--text-sm);
  line-height: 1.5;
}

.live__privacy {
  max-width: 34rem;
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

@media (min-width: 40em) {
  .live__panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Side by side, the waiting line holds the room the stats will take, so
     on a screen tall enough to show the panel nothing moves when they come. */
  .live__wait,
  .live__stats {
    min-height: 7rem;
  }

  .live__part--time {
    border-top: 0;
    border-left: 2px dashed var(--border);
  }

  .live__part--weather {
    grid-column: 1 / -1;
  }
}

/* The clock's column is never narrower than its longest time, in any locale. */
@media (min-width: 62em) {
  .live__panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(min-content, 0.75fr) minmax(0, 1.3fr);
  }

  .live__part--weather {
    grid-column: auto;
    border-top: 0;
    border-left: 2px dashed var(--border);
  }
}

@media (max-width: 29.99em) {
  .live__part {
    padding-inline: var(--space-4);
  }

  .live__tag {
    left: var(--space-4);
  }
}

/* ---------- In plain words ---------- */

/* An icon on a colored square. On most cards it hangs over the top edge. */
.tile-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: var(--bw) solid var(--border);
  background: var(--tile, var(--yellow));
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
}

.tile-icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.plain {
  padding-block: var(--space-6) var(--space-5);
}

.plain__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
  list-style: none;
}

.plain__item {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--tile);
}

.plain__item:nth-child(1) {
  --tile: var(--pink);
}

.plain__item:nth-child(2) {
  --tile: var(--cyan);
}

.plain__item:nth-child(3) {
  --tile: var(--yellow);
}

.plain__item .tile-icon {
  position: absolute;
  top: -1.45rem;
  left: 1.25rem;
  transform: rotate(-5deg);
}

.plain__item:nth-child(2) .tile-icon {
  transform: rotate(4deg);
}

.plain__item:nth-child(3) .tile-icon {
  transform: rotate(-2deg);
}

.plain__title {
  font-size: var(--text-lg);
  line-height: 1.3;
}

.plain__item p {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (min-width: 56.25em) {
  .plain__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-pad);
}

/* The heading may run a little wider than the paragraph under it. */
.section__head {
  max-width: 48rem;
  margin-bottom: var(--space-7);
}

/* The numbered label: a yellow sticker pressed on at a slight angle. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: 0.3rem 1rem;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}

.section:nth-of-type(even) .eyebrow {
  transform: rotate(1deg);
}

.eyebrow__num {
  flex: none;
  padding-right: var(--space-3);
  border-right: 2px solid var(--ink);
  letter-spacing: 0.02em;
}

h2 {
  font-size: var(--text-2xl);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.section__lead {
  max-width: var(--measure);
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.8;
}

h3 {
  font-size: var(--text-lg);
}

/* Headings that open a block inside a section sit one step above card titles. */
.security h3,
.trust-title,
.demo__title,
.contribute h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

/* ---------- Grid and cards ---------- */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

@media (min-width: 40em) {
  .grid--2,
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62em) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Two columns leave a third card alone on its row; let it fill the row. */
@media (min-width: 40em) and (max-width: 61.99em) {
  .card--tablet-wide {
    grid-column: 1 / -1;
  }
}

/* The feature cards hold the longest text: three columns only from 1200px. */
@media (min-width: 62em) and (max-width: 74.99em) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features .card--tablet-wide {
    grid-column: 1 / -1;
  }
}

/* A card that fills its row keeps a readable line length. */
.card--tablet-wide > p {
  max-width: var(--measure);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--shadow, var(--border));
}

.card p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.card__title {
  font-size: var(--text-lg);
  line-height: 1.25;
}

/* The three problems: a numbered sticker on each corner. */
.problems {
  counter-reset: problem;
  row-gap: var(--space-7);
}

.problems .card {
  padding-top: var(--space-6);
  counter-increment: problem;
}

.problems .card::before {
  content: counter(problem);
  content: counter(problem) / "";
  position: absolute;
  top: -1.25rem;
  right: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: var(--bw) solid var(--border);
  background: var(--pink);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  transform: rotate(5deg);
}

.problems .card:nth-child(2)::before {
  transform: rotate(-4deg);
}

.problems .card:nth-child(3)::before {
  transform: rotate(3deg);
}

.problems .card__title {
  padding-right: 2.5rem;
}

.example {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 2px dashed var(--border);
}

.card .example {
  font-size: var(--text-sm);
  line-height: 1.95;
}

.example__label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* Hostile text is always marked in pink. */
.example q {
  padding: 0.05em 0.4em;
  border: 2px solid var(--border);
  background: var(--pink);
  color: var(--ink);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Attack story ---------- */

/* A timeline: one dashed line, a square marker per step, a card beside it. */
.story {
  --node: 2.5rem;
  position: relative;
  display: grid;
  gap: var(--space-6);
  list-style: none;
}

.story::before {
  content: "";
  position: absolute;
  left: calc(var(--node) / 2 - 2px);
  top: var(--space-5);
  bottom: var(--space-5);
  border-left: 4px dashed var(--border);
}

.story__step {
  position: relative;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  column-gap: var(--space-5);
  align-items: start;
}

.story__node {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--node);
  height: var(--node);
  margin-top: 1.25rem;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
}

.story__step--stop .story__node {
  background: var(--mint);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--pop);
}

.story__step--hostile .story__node,
.story__step--if .story__node {
  background: var(--pink);
}

.story__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  min-width: 0;
  padding: var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--shadow, var(--border));
}

.story__step--stop .story__body {
  --shadow: var(--mint);
}

.story__step--hostile .story__body,
.story__step--if .story__body {
  --shadow: var(--pink);
}

/* Dashed where the story turns hypothetical. */
.story__step--if .story__body {
  border-style: dashed;
}

.story__text {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  justify-items: start;
  min-width: 0;
}

.story__text p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The step label: a colored chip at the top of the card. */
.story__text .story__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--space-2);
  padding: 0.15rem 0.6rem;
  border: 2px solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-transform: uppercase;
}

.story__step--stop .story__kicker {
  background: var(--mint);
}

.story__step--hostile .story__kicker,
.story__step--if .story__kicker {
  background: var(--pink);
}

.story__kicker .icon {
  width: 0.875rem;
  height: 0.875rem;
  stroke-width: 2.25;
}

.story__title {
  font-size: 1.25rem;
  line-height: 1.25;
}

/* "Stopped here": a mint sticker. */
.story__text .story__stop {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: var(--space-3);
  padding: 0.3rem 0.7rem;
  border: 2px solid var(--border);
  background: var(--mint);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--pop);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.4;
  transform: rotate(-1deg);
}

.story__stop .icon {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1em;
  stroke-width: 2.25;
}

.story__visual {
  min-width: 0;
}

.scribble--story {
  margin: -0.35rem var(--space-5) 0.25rem auto;
  transform: rotate(-4deg);
}

/* Two of the pictures only repeat their step's words. Phones skip them. */
@media (max-width: 39.99em) {
  .story__visual--extra {
    display: none;
  }
}

@media (min-width: 56.25em) {
  .story__body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
    padding: var(--space-6);
  }

  .story__visual {
    align-self: center;
  }
}

@media (max-width: 29.99em) {
  .story {
    --node: 1.75rem;
    gap: var(--space-6);
  }

  .story__step {
    column-gap: var(--space-3);
  }

  .story__node {
    font-size: var(--text-sm);
  }

  .story__body {
    padding: var(--space-4);
  }
}

.story__after {
  max-width: var(--measure);
  margin-top: var(--space-7);
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.9;
}

/* Small mock windows used inside the story. */
.mock {
  border: var(--bw) solid var(--border);
  background: var(--bg);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
}

.mock__bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.25rem;
  padding: 0.35rem var(--space-4);
  border-bottom: var(--bw) solid var(--border);
  background: var(--cyan);
  color: var(--ink);
}

/* The web page in the story looks ordinary: a plain bar. Only the hidden line is pink. */
.mock--page .mock__bar {
  background: var(--card);
  color: var(--text);
}

.mock__icon {
  width: 0.95rem;
  height: 0.95rem;
}

.mock__label {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Phones: the address in the bar stays on one line. */
@media (max-width: 29.99em) {
  .mock__bar {
    gap: var(--space-2);
    padding-inline: var(--space-3);
  }

  .mock__label {
    font-size: 0.6875rem;
  }
}

@media (max-width: 24.5em) {
  .mock__bar .terminal__dots {
    display: none;
  }
}

.mock__body {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.mock__say {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 600;
}

.mock__url {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.mock__h {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: 700;
}

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

/* Placeholder lines of text on the mock page. */
.mock__skel {
  display: block;
  height: 0;
  margin-block: 0.2rem;
  border-top: 3px dashed var(--muted);
}

.mock__skel--short {
  width: 62%;
}

/* The hostile line: a pink highlighter box. */
.mock__hidden {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border: 2px solid var(--border);
  background: var(--pink);
  color: var(--ink);
}

.mock__tag {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mock__hidden code {
  padding: 0;
  background: none;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
}

.log {
  list-style: none;
}

.log li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.log li + li {
  border-top: 2px dashed var(--border);
}

.log__tool {
  min-width: 5.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
}

.log__why {
  flex: 1 1 12rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* ---------- Screens: code, terminal, verdict ---------- */

/* Dark in both themes. The box takes the page's outline; everything inside
   it gets the dark-surface tokens. */
.code,
.terminal,
.verdict {
  min-width: 0;
  border: var(--bw) solid var(--border);
  background: var(--screen);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--shadow, var(--cyan));
  color: var(--screen-text);
}

.code > *,
.terminal > *,
.verdict > * {
  --border: var(--screen-line);
  --text: var(--screen-text);
  --muted: var(--screen-muted);
  --card: var(--screen-bar);
  --tint: var(--screen-tint);
  --focus: var(--screen-text);
  --pop: var(--yellow);
}

/* One decision: the call, the verdict chip and the reason. */
.verdict {
  --shadow: var(--pink);
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--shadow);
}

.story__step--if .verdict {
  --shadow: var(--yellow);
}

.verdict__call {
  padding: 0;
  background: none;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.verdict__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.verdict__reason {
  flex: 1 1 12rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* Status chips: chunky, in the color of the decision, always with a word. */
.status {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  border: 2px solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
}

.status .icon {
  width: 0.8125rem;
  height: 0.8125rem;
  stroke-width: 3;
}

.status--ok {
  background: var(--mint);
  color: var(--ink);
}

.status--bad {
  background: var(--pink);
  color: var(--ink);
}

.status--ask {
  background: var(--yellow);
  color: var(--ink);
}

/* ---------- Diagram ---------- */

.diagram {
  margin: 0 0 var(--space-7);
  padding: clamp(1rem, 3vw, 2rem);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-4) var(--sh-4) 0 var(--border);
}

/* Phones: the drawing sits on the paper and gets the whole column, so its
   words are drawn larger. Its own boxes keep their outlines and shadows. */
@media (max-width: 29.99em) {
  .diagram {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
}

.diagram__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.diagram__svg--tall {
  display: none;
  max-width: 22rem;
  margin-inline: auto;
}

@media (max-width: 61.99em) {
  .diagram__svg--wide {
    display: none;
  }

  .diagram__svg--tall {
    display: block;
  }
}

.dg-shadow {
  fill: var(--border);
}

.dg-shadow--cyan {
  fill: var(--cyan);
}

.dg-box {
  fill: var(--bg);
  stroke: var(--border);
  stroke-width: 3;
}

.dg-core {
  fill: var(--bg);
  stroke: var(--border);
  stroke-width: 4;
}

.dg-chip {
  fill: var(--card);
  stroke: var(--border);
  stroke-width: 3;
}

.dg-tag {
  fill: var(--yellow);
  stroke: var(--border);
  stroke-width: 3;
}

.dg-num {
  stroke: var(--border);
  stroke-width: 2;
}

.dg-num--1 {
  fill: var(--mint);
}

.dg-num--2 {
  fill: var(--cyan);
}

.dg-num--3 {
  fill: var(--yellow);
}

.dg-num-text {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-anchor: middle;
}

.dg-title {
  fill: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.dg-sub {
  fill: var(--muted);
  font-size: 14px;
}

.dg-center {
  text-anchor: middle;
}

.dg-name {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.dg-flow {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
}

.dg-head {
  fill: var(--text);
}

.dg-flow-label {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

.dg-flow-label.dg-end {
  text-anchor: end;
}

.dg-flow-label.dg-start {
  text-anchor: start;
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  list-style: none;
}

@media (min-width: 56.25em) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

.step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: center;
  align-content: start;
}

.step p {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The same three colors as the numbers in the diagram above. */
.step:nth-child(1) .step__num {
  background: var(--mint);
}

.step:nth-child(2) .step__num {
  background: var(--cyan);
}

/* Square number markers, shared by the steps, quick start and callouts. */
.callout__num,
.step__num,
.qs__num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0;
}

.callout__num {
  width: 1.6rem;
  height: 1.6rem;
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  font-size: var(--text-xs);
}

/* ---------- Terminal demo ---------- */

.demo {
  margin-top: var(--space-8);
}

.demo__lead {
  max-width: var(--measure);
  margin-top: var(--space-2);
  margin-bottom: var(--space-5);
  color: var(--muted);
}

.scribble--demo {
  margin: 0 var(--space-5) 0.2rem auto;
}

@media (min-width: 62em) {
  .scribble--demo {
    margin-top: -3.4rem;
  }
}

/* Phones: smaller notes that stay inside their card. */
@media (max-width: 29.99em) {
  .scribble {
    font-size: 1.5rem;
  }

  .scribble--story,
  .scribble--demo {
    margin-right: 0;
  }
}

.terminal {
  box-shadow: var(--sh-4) var(--sh-4) 0 var(--cyan);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--code-bar-h);
  padding: 0.5rem var(--space-4);
  border-bottom: var(--bw) solid var(--border);
  background: var(--card);
}

/* Window buttons, as three small squares. */
.terminal__dots {
  display: inline-flex;
  gap: 0.35rem;
}

.terminal__dots span {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--border);
  background: var(--pink);
}

.terminal__dots span:nth-child(2) {
  background: var(--yellow);
}

.terminal__dots span:nth-child(3) {
  background: var(--mint);
}

/* On a yellow bar the squares are plain white with black outlines. */
.rulecard__bar .terminal__dots span {
  border-color: var(--ink);
  background: #ffffff;
}

.terminal__title {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
}

.terminal__title::before {
  content: "$ ";
  color: var(--mint);
}

.terminal__lines {
  list-style: none;
}

.tline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
}

.tline + .tline {
  border-top: 2px dashed var(--border);
}

.tline__call {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.tline__reason {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.4;
  text-wrap: pretty;
}

.tline__reason:empty {
  display: none;
}

/* Phones: the call, the chip and the reason each get their own row. */
@media (max-width: 29.99em) {
  .tline {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Three columns only once every call and every reason fits on one line. */
@media (min-width: 73em) {
  .tline {
    grid-template-columns: minmax(0, 1fr) 6.75rem minmax(0, 23.5rem);
    gap: var(--space-4);
  }

  .tline__call {
    grid-column: auto;
  }
}

/* ---------- Features ---------- */

.features {
  row-gap: var(--space-6);
}

.feature__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* In the features grid each card has a colored title bar. */
.features .feature {
  padding: 0;
  gap: 0;
}

.features .feature > * {
  margin-inline: var(--space-5);
}

.features .feature > * + * {
  margin-top: var(--space-3);
}

.features .feature > :last-child {
  margin-bottom: var(--space-5);
}

.features .feature .feature__head {
  margin: 0 0 var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--bw) solid var(--border);
  background: var(--tile, var(--yellow));
  color: var(--ink);
}

.features .tile-icon {
  width: auto;
  height: auto;
  border: 0;
  background: none;
  box-shadow: none;
}

.feature--cyan {
  --tile: var(--cyan);
}

.feature--yellow {
  --tile: var(--yellow);
}

.feature--pink {
  --tile: var(--pink);
}

.feature--mint {
  --tile: var(--mint);
}

.card .feature__sum {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.45;
}

/* The policy card: a mint panel beside its list, because it is the part to rely on. */
.features .feature--wide {
  grid-column: 1 / -1;
  box-shadow: var(--sh-4) var(--sh-4) 0 var(--pop);
}

.features .feature--wide > *,
.features .feature--wide > :last-child {
  margin: 0;
}

.feature__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: var(--bw) solid var(--border);
  background: var(--mint);
  color: var(--ink);
}

.feature__main > * {
  --border: var(--ink);
  --text: var(--ink);
  --muted: var(--ink);
}

.features .feature--wide .feature__head {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.features .feature--wide .card__title {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

.feature__main p {
  line-height: 1.8;
}

.ticks {
  column-gap: var(--space-6);
  padding: var(--space-5);
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.ticks li {
  position: relative;
  padding-left: var(--space-6);
  break-inside: avoid;
}

.ticks li + li {
  margin-top: var(--space-3);
}

/* A ticked box, drawn with borders. */
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  background: var(--mint);
}

.ticks li::after {
  content: "";
  position: absolute;
  left: 0.39rem;
  top: calc(0.25em + 0.16rem);
  width: 0.34rem;
  height: 0.62rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (min-width: 40em) {
  .ticks {
    columns: 2;
  }
}

/* Side by side in the three-column grid: the panel is exactly one column wide. */
@media (min-width: 75em) {
  .features .feature--wide {
    display: grid;
    grid-template-columns: calc((100% - 2 * var(--space-6)) / 3) minmax(0, 1fr);
    align-items: stretch;
  }

  .feature__main {
    justify-content: center;
    padding: var(--space-6);
    border-right: var(--bw) solid var(--border);
    border-bottom: 0;
  }

  .ticks {
    align-self: center;
    padding: var(--space-6);
  }
}

.cmds {
  display: grid;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 0.9375rem;
}

.cmds > div {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: baseline;
}

.cmds dd {
  margin: 0;
}

/* Use cases: the icon hangs over the top edge, at a slight angle. */
.usecases {
  row-gap: var(--space-7);
}

.usecases .card {
  padding-top: var(--space-6);
}

.usecases .tile-icon {
  position: absolute;
  top: -1.45rem;
  left: 1.25rem;
  transform: rotate(-4deg);
}

.usecases .card:nth-child(even) .tile-icon {
  transform: rotate(3deg);
}

.usecases .card:nth-child(1) {
  --tile: var(--mint);
}

.usecases .card:nth-child(2) {
  --tile: var(--cyan);
  --shadow: var(--cyan);
}

/* "Data rules" are deny rules: pink. The audit card is yellow, as the audit
   log is everywhere else on the page. */
.usecases .card:nth-child(3) {
  --tile: var(--pink);
  --shadow: var(--pink);
}

.usecases .card:nth-child(4) {
  --tile: var(--yellow);
  --shadow: var(--yellow);
}

/* The third row: no card shares its color with the one above it. */
.usecases .card:nth-child(5) {
  --tile: var(--cyan);
  --shadow: var(--cyan);
}

.usecases .card:nth-child(6) {
  --tile: var(--mint);
}

.usecases .card p {
  line-height: 1.75;
}

/* ---------- Code blocks ---------- */

/* A grid of two rows, the bar and the code, so the edge cues below can
   cover the code row alone however tall the bar grows. */
.code {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* A label too long for its bar wraps, and the copy button drops below it,
   still on the right. One-line bars stay 44px. */
.code__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  row-gap: var(--space-2);
  min-height: var(--code-bar-h);
  padding: 0.3125rem 0.5rem 0.3125rem var(--space-4);
  border-bottom: var(--bw) solid var(--border);
  background: var(--card);
}

.code__label {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.copy {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 5.5rem;
  min-height: 1.875rem;
  margin-left: auto;
  padding: 0.15rem 0.625rem;
  border: 2px solid var(--border);
  background: var(--screen);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Grows the touch target to 44px without changing the bar's height. */
.copy::after {
  content: "";
  position: absolute;
  inset: -0.5rem -0.25rem;
}

.copy:hover {
  background: var(--cyan);
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .copy:active {
    box-shadow: none;
    transform: translate(var(--sh-1), var(--sh-1));
  }
}

.copy.is-copied {
  background: var(--mint);
  color: var(--ink);
}

/* A long line scrolls inside its own block and never widens the page. */
pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--screen-line) transparent;
}

pre:focus-visible {
  outline-offset: -5px;
}

/* Edge cues, switched on by site.js while there is more code to either side:
   the text fades into the screen and a small chevron points the way. */
.code::before,
.code::after {
  position: absolute;
  /* An absolute child of a grid takes its grid area as its containing block. */
  grid-row: 2;
  grid-column: 1;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 2.75rem;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.code::before {
  content: "\2039";
  content: "\2039" / "";
  left: 0;
  justify-content: flex-start;
  padding-left: 0.3rem;
  background: linear-gradient(to left, transparent, var(--screen) 60%);
}

.code::after {
  content: "\203A";
  content: "\203A" / "";
  right: 0;
  justify-content: flex-end;
  padding-right: 0.3rem;
  background: linear-gradient(to right, transparent, var(--screen) 60%);
}

.code.has-more-start::before,
.code.has-more-end::after {
  opacity: 1;
}

/* Without JavaScript, a mint edge shows that a block scrolls. */
html:not(.js) .code pre {
  background:
    linear-gradient(to right, var(--screen) 40%, transparent) left center / 3rem 100% no-repeat local,
    linear-gradient(to left, var(--screen) 40%, transparent) right center / 3rem 100% no-repeat local,
    linear-gradient(var(--screen-line), var(--screen-line)) left center / 4px 100% no-repeat scroll,
    linear-gradient(var(--screen-line), var(--screen-line)) right center / 4px 100% no-repeat scroll;
}

.t-k {
  color: var(--tok-key);
}

.t-s {
  color: var(--tok-str);
}

.t-c {
  color: var(--screen-muted);
}

/* A side note: a yellow bar means "mind this". */
.note {
  max-width: 34rem;
  margin-top: var(--space-5);
  padding-left: var(--space-4);
  border-left: 4px solid var(--yellow);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Code in small print stays at the 12px floor. */
.example code,
.note code {
  font-size: 0.9em;
}

/* Numbered markers beside lines of a code block. They are generated content,
   so they are not part of the text that gets copied. */
.code--marked pre {
  position: relative;
  padding-left: 2.75rem;
}

.ln::before {
  content: attr(data-n);
  content: attr(data-n) / "";
  position: absolute;
  left: 0.7rem;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

/* ---------- Quick start ---------- */

.qs {
  display: grid;
  gap: var(--space-8);
}

.qs__step {
  min-width: 0;
}

.qs__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

.qs__text {
  max-width: var(--measure);
  margin-bottom: var(--space-5);
  color: var(--muted);
  line-height: 1.8;
}

/* Stacked: each command line is shown whole, without scrolling, on a desktop. */
.qs__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  max-width: 40rem;
}

/* On a narrow screen the tabs wrap onto more rows, so every one stays in view. */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 2px 6px var(--space-3) 2px;
}

.tabs__tab {
  flex: none;
  min-height: 2.875rem;
  padding: 0.5rem var(--space-4);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tabs__tab:hover {
  background: var(--cyan);
  color: var(--ink);
}

/* The open tab is pressed in and marked yellow. */
.tabs__tab[aria-selected="true"] {
  background: var(--yellow);
  box-shadow: none;
  color: var(--ink);
  transform: translate(4px, 4px);
}

.tabs__tab:focus-visible {
  outline-offset: -6px;
}

.tabs__tab[aria-selected="true"]:focus-visible,
.tabs__tab:hover:focus-visible {
  outline-color: var(--ink);
}

/* No wider than its widest code block and the padding around it. */
.tabs__panel {
  min-width: 0;
  max-width: calc(48rem + 2 * var(--space-6) + 2 * var(--bw));
  margin-top: var(--space-2);
  padding: var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--border);
}

.tabs__panel > * + * {
  margin-top: var(--space-4);
}

.tabs__panel > p:not(.note) {
  max-width: var(--measure);
  color: var(--muted);
}

/* Wide enough for the longest line, and no wider. */
.tabs__panel > .code {
  max-width: 48rem;
}

.tabs__panel > .code + p {
  margin-top: var(--space-5);
}

.tabs__heading {
  font-size: var(--text-lg);
}

@media (min-width: 56.25em) {
  .tabs__panel {
    padding: var(--space-6);
  }
}

/* Without JavaScript every panel is shown, one after another. */
html:not(.js) .tabs__panel + .tabs__panel {
  margin-top: var(--space-6);
}

/* The policy example: code first, then numbered notes that point at its lines. */
.policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.policy__main {
  min-width: 0;
}

.policy .code {
  --shadow: var(--yellow);
}

/* Stacked: code, then its numbered notes, then the closing tip. */
@media (max-width: 74.99em) {
  .policy__main {
    display: contents;
  }

  .policy .callouts {
    order: 2;
  }

  .policy .note {
    order: 3;
    margin-top: 0;
  }
}

@media (min-width: 75em) {
  .policy {
    grid-template-columns: minmax(0, 44.5rem) minmax(0, 1fr);
  }
}

.callouts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
}

.callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding-block: var(--space-3);
  border-top: 2px dashed var(--border);
}

.callout:first-child {
  padding-top: 0;
  border-top: 0;
}

.callout__key {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 700;
}

.callout__key + p {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

@media (min-width: 40em) and (max-width: 74.99em) {
  .callouts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
  }

  .callout:nth-child(2) {
    padding-top: 0;
    border-top: 0;
  }
}

/* ---------- Security model ---------- */

.security {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

@media (min-width: 56.25em) {
  .security {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-6);
  }
}

.security__col {
  min-width: 0;
}

/* A plain bordered box for a block of prose or a list. */
.panel {
  padding: var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--shadow, var(--border));
}

@media (min-width: 56.25em) {
  .panel,
  .limits {
    padding: var(--space-6);
  }
}

.security__intro {
  margin-top: var(--space-2);
  color: var(--muted);
}

.guarantees {
  margin-top: var(--space-4);
  list-style: none;
  counter-reset: guarantee;
}

.guarantees li {
  position: relative;
  min-height: 3.6rem;
  padding: var(--space-3) 0 var(--space-3) var(--space-7);
  border-top: 2px dashed var(--border);
  counter-increment: guarantee;
}

.guarantees li::before {
  content: "G" counter(guarantee);
  position: absolute;
  left: 0;
  top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 1.75rem;
  border: 2px solid var(--border);
  background: var(--mint);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--pop);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Phones: the G chip starts the first line instead of indenting the whole
   item, so the text gets the full width below it. */
@media (max-width: 29.99em) {
  .guarantees li {
    padding-left: 0;
  }

  .guarantees li::before {
    position: static;
    float: left;
    height: 1.5rem;
    margin: 0.05rem var(--space-3) 0 0;
  }
}

.security__after {
  padding-top: var(--space-4);
  border-top: 2px dashed var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* A caution note: yellow shadow, and a sticker that says to read it. */
.limits {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-4) var(--sh-4) 0 var(--yellow);
  /* Links to #limits stop low enough to show the sticker above the box. */
  scroll-margin-top: var(--space-5);
}

.limits__sticker {
  position: absolute;
  top: -1.15rem;
  right: 1.25rem;
  padding: 0.2rem 0.8rem;
  border: var(--bw) solid var(--border);
  background: var(--pink);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(3deg);
}

.limits__list {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.75;
}

.limits__list li {
  position: relative;
  padding-left: var(--space-6);
}

/* A pink box with a minus: something it does not do. */
.limits__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  background: var(--pink);
}

/* The minus is a border, so it survives Windows forced colors. */
.limits__list li::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: calc(0.3em + 0.47rem);
  width: 0.5rem;
  height: 0;
  border-top: 2px solid var(--ink);
}

.limits__more {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 2px dashed var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
}

.trust-title {
  margin-top: var(--space-8);
  margin-bottom: var(--space-5);
}

.table-wrap {
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  vertical-align: top;
}

.table thead th {
  border-bottom: var(--bw) solid var(--border);
  background: var(--cyan);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table tbody tr + tr > * {
  border-top: 2px dashed var(--border);
}

.table tbody th {
  width: 34%;
  font-weight: 700;
}

.table tbody td {
  color: var(--muted);
}

.table .status {
  min-width: 3.75rem;
  justify-content: center;
}

/* Framework mapping (#frameworks): the IDs under each risk, in small print,
   and the "Limit:" label in each row. These tables keep the three columns of
   .table, so on phones they stack the way the trust table does. */
.map__ids {
  display: block;
  margin-top: var(--space-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.map__label {
  color: var(--text);
  font-weight: 700;
}

.table--map td p + p {
  margin-top: var(--space-2);
}

/* Up to small tablets the table reads as stacked rows: the party, then the
   chip and the reason. */
@media (max-width: 47.99em) {
  .table,
  .table tbody,
  .table tbody th,
  .table tbody td {
    display: block;
  }

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

  .table tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-2) var(--space-3);
    align-items: start;
    padding: var(--space-4);
  }

  .table tbody tr + tr {
    border-top: 2px dashed var(--border);
  }

  .table tbody tr > *,
  .table tbody tr + tr > * {
    padding: 0;
    border-top: 0;
  }

  .table tbody th {
    grid-column: 1 / -1;
    width: auto;
  }

  /* The mapping's explanations are long: they take the full width under
     the chip. */
  .table--map tbody td + td {
    grid-column: 1 / -1;
  }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

.cta-row__note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ---------- Contribute ---------- */

.contribute {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

@media (min-width: 56.25em) {
  .contribute {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-7);
  }
}

/* A to-do list: a yellow marker in front of each open task. It is filled, so
   it does not look like a checkbox to tick. */
.tasks {
  margin-top: var(--space-4);
  list-style: none;
}

.tasks li {
  position: relative;
  display: grid;
  gap: 0.125rem;
  padding: var(--space-3) 0 var(--space-3) var(--space-6);
  border-top: 2px dashed var(--border);
}

.tasks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--border);
  background: var(--yellow);
}

.tasks span {
  color: var(--muted);
  font-size: 0.9375rem;
}

.contribute__side {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5);
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--border);
}

@media (min-width: 56.25em) {
  .contribute__side {
    padding: var(--space-6);
  }
}

.contribute__side p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.contribute__side .code {
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--cyan);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.contribute__side .btn-row {
  margin-top: var(--space-2);
}

/* The buttons share each row they wrap onto, so no button sits alone. */
.contribute__side .btn-row .btn {
  flex: 1 1 auto;
}

/* ---------- FAQ ---------- */

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.faq-layout .section__head {
  margin-bottom: 0;
}

@media (min-width: 62em) {
  .faq-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.85fr);
    gap: var(--space-7);
  }

  .faq-layout .section__head {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
  }
}

.faq {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.faq__item {
  border: var(--bw) solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
}

.faq__item[open] {
  box-shadow: var(--sh-3) var(--sh-3) 0 var(--cyan);
}

.faq__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 3.75rem;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}

.faq__summary::-webkit-details-marker {
  display: none;
}

.faq__summary:focus-visible {
  outline-offset: -6px;
}

.faq__q {
  font-size: 1.0625rem;
  line-height: 1.35;
  text-wrap: pretty;
}

/* The square open and close button. */
.faq__icon {
  box-sizing: content-box;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0.4rem;
  border: 2px solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-1) var(--sh-1) 0 var(--border);
  color: var(--ink);
  stroke-width: 2.5;
}

.faq__summary:hover .faq__icon {
  background: var(--cyan);
}

.faq__item[open] .faq__summary {
  border-bottom: 2px dashed var(--border);
}

.faq__item[open] .faq__icon {
  background: var(--cyan);
  box-shadow: none;
  transform: translate(var(--sh-1), var(--sh-1)) rotate(180deg);
}

.faq__a {
  max-width: 40rem;
  padding: var(--space-4);
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Closing call to action ---------- */

.cta {
  padding-block: var(--space-6) var(--section-pad);
}

/* The boldest block on the page: yellow, thick outline, the biggest shadow.
   Everything inside it is drawn in black ink in both themes. */
.cta__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 4px solid var(--border);
  background: var(--yellow);
  box-shadow: var(--sh-5) var(--sh-5) 0 var(--border);
  color: var(--ink);
}

.cta__panel > * {
  --border: var(--ink);
  --text: var(--ink);
  --muted: var(--ink);
  --card: #ffffff;
  --focus: var(--ink);
  --pop: var(--ink);
}

.cta__copy {
  min-width: 0;
}

.cta__copy h2 {
  font-size: clamp(1.875rem, 1.3rem + 2.4vw, 2.75rem);
}

.cta__copy p {
  max-width: 34rem;
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.6;
}

.cta__action {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

@media (min-width: 73em) {
  .cta__panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 38.25rem);
    gap: var(--space-6) var(--space-7);
    align-items: start;
  }

  .cta__copy {
    display: contents;
  }

  .cta__copy h2 {
    grid-column: 1 / -1;
  }

  .cta__copy p {
    margin-top: 0;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: var(--space-6);
  border-top: var(--bw) solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Room under the last links for the back-to-top button, on a page that has
   one, wherever it shows: with JavaScript, and not on a phone while the
   header sticks ("not all and" negates both conditions together). */
@media not all and (max-width: 39.99em) and (min-height: 22.01em) {
  html.js .page:has(~ .to-top) .site-footer {
    padding-bottom: var(--space-8);
  }
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.site-footer__brand {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

.site-footer__brand .brand {
  margin-bottom: var(--space-2);
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
}

.site-footer__nav a {
  display: inline-block;
  padding-block: var(--space-1);
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

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

/* Touch screens and narrow windows get full 44px targets. */
@media (pointer: coarse), (max-width: 39.99em) {
  .site-footer__nav ul {
    row-gap: 0;
  }

  .site-footer__nav a {
    padding-block: 0.7rem;
  }
}

/* Side by side only once the seven links fit on one row beside the text. */
@media (min-width: 75em) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .site-footer__nav ul {
    justify-content: flex-end;
  }
}

/* ---------- 404 page ---------- */

.notfound {
  display: grid;
  align-content: center;
  min-height: calc(100vh - var(--header-h) - 11rem);
  padding-block: var(--space-8);
}

.notfound__card {
  position: relative;
  max-width: 40rem;
  padding: clamp(1.75rem, 5vw, 3rem);
  border: 4px solid var(--border);
  background: var(--card);
  box-shadow: var(--sh-5) var(--sh-5) 0 var(--pink);
}

.notfound .notfound__code {
  position: absolute;
  top: -1.3rem;
  left: 1.5rem;
  margin: 0;
  padding: 0.25rem 0.9rem;
  border: var(--bw) solid var(--border);
  background: var(--pink);
  box-shadow: var(--sh-2) var(--sh-2) 0 var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.notfound p {
  max-width: 34rem;
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.8;
}

.notfound .btn-row {
  margin-top: var(--space-6);
}

/* ---------- Forced colors ---------- */

/* Windows forced colors drop fills and shadows: mark the open tab and the
   current section with the system highlight. */
@media (forced-colors: active) {
  .tabs__tab[aria-selected="true"],
  .site-nav a[aria-current] {
    forced-color-adjust: none;
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }

  /* Their focus ring is in system colors too: inside the open tab, on its
     Highlight; outside the current link, on the page. */
  .tabs__tab[aria-selected="true"]:focus-visible {
    outline-color: HighlightText;
  }

  .site-nav a[aria-current]:focus-visible {
    outline-color: CanvasText;
  }

  .site-nav a:not([aria-current]) {
    border-color: Canvas;
  }

  /* The live light is a fill, which forced colors would drop. */
  .live__dot {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

/* ---------- Motion and print ---------- */

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

@media print {
  body {
    padding: 0;
  }

  .page {
    border: 0;
    background-image: none;
    box-shadow: none;
  }

  .site-header,
  .skip-link,
  .copy,
  .to-top,
  .hero__art,
  .scribble,
  .live {
    display: none !important;
  }

  .section {
    padding-block: 1.5rem;
  }
}

/* ---------- Additions: hero fit, quick start, 404 ---------- */

/* Under the lead: the setups it works with, in plain text. */
.hero__fit {
  max-width: 36rem;
  margin-top: var(--space-4);
  color: var(--text);
  font-weight: 600;
  line-height: 1.6;
}

/* The hook commands are the longest lines on the page: this panel and its
   code take the full width, so on a desktop the preview shows whole. */
#panel-claude-code,
#panel-claude-code > .code {
  max-width: none;
}

/* "Set up a client by hand": a closed box in the FAQ's style inside a tab. */
.tabs__panel > .more {
  max-width: 48rem;
}

.more .faq__q {
  font-weight: 700;
}

.more__body {
  padding: var(--space-4);
}

.more__body > * + * {
  margin-top: var(--space-4);
}

.more__body > p {
  color: var(--muted);
}

/* Step 4 of the quick start: as wide as a tab's code, and no wider. */
.qs__step > .code {
  max-width: 48rem;
}

/* The 404 page: links straight to the sections people look for. */
.notfound__nav {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 2px dashed var(--border);
}

.notfound__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  list-style: none;
}

.notfound__nav a {
  display: inline-block;
  padding-block: 0.7rem;
}
