/* fieldtrip.sh. Every value here comes from DESIGN.md: read it first, and add
   to it before adding anything here. check_design.py enforces it. */

/* ---------------------------------------------------------------- tokens */
:root {
  /* raw colours: the only hex codes in this file */
  --paper: #f4f1e8; --card: #fffdf6; --ink: #1b1b1f; --ink-dim: #6b665e;
  --line: #d9d4c7; --line-strong: #8a857b;
  --yellow: #f4bb0a; --yellow-dark: #dca608; --red: #d0201a; --green: #2a7449; --road: #3a3a40;
  --night: #0d1a3a; --night-text: #e9e6dc; --night-dim: #8b93b0; --night-line: #22305a;
  --headlight: #fff0be;   /* illustration only: the night bus's beam */

  /* roles, day */
  --text: var(--ink); --text-dim: var(--ink-dim);
  --surface: var(--paper); --surface-raised: var(--card);
  --action: var(--yellow); --action-hover: var(--yellow-dark);
  --border: var(--ink); --divider: var(--line);
  --mark-pass: var(--green); --mark-fail: var(--red); --mark-skip: var(--line-strong);

  /* type: size / line height */
  --font: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --t-title: 40px; --l-title: 48px;
  --t-heading: 24px; --l-heading: 32px;
  --t-intro: 20px; --l-intro: 30px;
  --t-body: 16px; --l-body: 26px;
  --t-small: 14px; --l-small: 22px;
  --t-label: 12px; --l-label: 16px;

  /* space: a 4px grid */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-16: 64px; --s-20: 80px;
  --section: var(--s-16);

  --hairline: 1.5px;   /* the house border: off the 4px grid on purpose */
}
@media (max-width: 760px) {
  :root { --t-title: 28px; --l-title: 36px; --t-heading: 20px; --l-heading: 28px; --t-intro: 17px; --l-intro: 26px; --section: var(--s-10); }
}
/* night: the same roles, swapped */
.night {
  --text: var(--night-text); --text-dim: var(--night-dim);
  --surface: var(--night); --surface-raised: var(--night);
  --border: var(--night-text); --divider: var(--night-line); --mark-skip: var(--night-dim);
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--text); font: var(--t-body)/var(--l-body) var(--font); }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-20); }
/* Centre on a whole pixel. With an odd window width, plain auto margins start the
   page half a pixel in, and the pixel wordmark goes soft on 1x screens. Browsers
   without round() keep the line above. */
.wrap { margin-left: max(0px, round(down, calc((100% - 1120px) / 2), 1px)); margin-right: auto; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* type roles */
h1 { font-size: var(--t-title); line-height: var(--l-title); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: var(--t-heading); line-height: var(--l-heading); font-weight: 600; margin: 0; }
.sub { font-size: var(--t-intro); line-height: var(--l-intro); max-width: 46em; margin: var(--s-3) 0 0; }
.small, .foot { font-size: var(--t-small); line-height: var(--l-small); color: var(--text-dim); }
.label { font-size: var(--t-label); line-height: var(--l-label); }
.caps { font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.dim { color: var(--text-dim); }
code.c { background: var(--surface-raised); border: 1px solid var(--divider); padding: 0 var(--s-1); font: inherit; }
.foot { margin-top: var(--s-10); max-width: 60em; }

/* layout helpers: spacing only from the scale */
main > section, .block { margin-top: var(--section); }
.page-top { padding-top: var(--section); }
.measure { max-width: 46em; } .measure-wide { max-width: 52em; }
.scroll-x { overflow-x: auto; }
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); } .mt-10 { margin-top: var(--s-10); }
.crumb + h1, .crumb + .name-row { margin-top: var(--s-2); }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-16); }
.hero > *, .two > * { min-width: 0; }
@media (min-width: 761px) { section.two.three { grid-template-columns: repeat(3, 1fr); gap: var(--s-10); } }

/* ---------------------------------------------------------------- page shell */
header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding-top: var(--s-6); flex-wrap: wrap; }
header .wm { height: 24px; width: 96px; display: block; }
nav a { display: inline-block; text-decoration: none; margin-left: var(--s-3); padding: 0 var(--s-1); white-space: nowrap; }   /* 26px tall: a 24px tap target */
nav a:hover, nav a[aria-current] { background: var(--action); }
.crumb { font-size: var(--t-small); line-height: var(--l-small); color: var(--text-dim); }
.crumb a { display: inline-block; padding: var(--s-1) 0; text-decoration: none; }   /* 30px tall */
.prevnext { display: flex; justify-content: space-between; border-top: var(--hairline) solid var(--border); margin-top: var(--s-16); padding-top: var(--s-4); }
.prevnext a { text-decoration: none; display: inline-block; padding: var(--s-1) 0; }   /* 26px tall */
footer { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding-top: var(--s-16); font-size: var(--t-small); line-height: var(--l-small); color: var(--text-dim); }
footer .wm { height: 16px; width: 64px; filter: invert(1); }
.paper-foot { border-top: var(--hairline) solid var(--border); margin-top: var(--s-16); padding: var(--s-6) 0 var(--s-10); }
.paper-foot .wm { filter: none; }
.foot-links { display: flex; gap: var(--s-4); font-size: var(--t-small); line-height: var(--l-small); }
.foot-links a { display: inline-block; padding: var(--s-1) 0; color: inherit; text-decoration: none; } .foot-links a:hover { text-decoration: underline; }   /* 30px tall */

/* ---------------------------------------------------------------- command box and copy buttons */
.cmd { display: flex; border: var(--hairline) solid var(--border); background: var(--surface-raised); }
.cmd code { flex: 1; min-width: 0; padding: var(--s-3) var(--s-4); font: inherit; font-weight: 600; overflow-wrap: anywhere; }
.cmd:focus-within { outline: 2px solid var(--text); outline-offset: 3px; }
/* copy, big: the yellow one in the command box */
.cmd button { font: inherit; border: 0; border-left: var(--hairline) solid var(--border); background: var(--action); width: calc(4ch + 28px); padding: 0; text-align: center; flex: none; cursor: pointer; color: var(--ink); transition: background-color .12s, transform .06s; }
.cmd button:hover { background: var(--action-hover); }
.cmd button:active { transform: translateY(1px); }
/* copy, small: Try asking, docs pages */
.try .say button, .doc-copy { flex: none; font: inherit; font-size: var(--t-small); line-height: var(--l-small); color: var(--text); background: var(--surface-raised); border: var(--hairline) solid var(--border); padding: 0 var(--s-2); cursor: pointer; transition: background-color .12s; }
.try .say button:hover, .doc-copy:hover { background: var(--action); color: var(--ink); }

/* ---------------------------------------------------------------- buttons, chips, labels */
.btn { display: inline-block; padding: var(--s-2) var(--s-4); background: var(--action); color: var(--ink); border: var(--hairline) solid var(--border); box-shadow: 3px 3px 0 var(--border); font-weight: 600; text-decoration: none; margin-right: var(--s-4); transition: background-color .12s, transform .06s, box-shadow .06s; }
.btn:hover { background: var(--action-hover); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.chip, .search { font: inherit; font-size: var(--t-small); line-height: var(--l-small); color: var(--text); background: var(--surface-raised); border: var(--hairline) solid var(--border); padding: var(--s-1) var(--s-3); cursor: pointer; }
.chip { transition: background-color .12s, transform .06s; }
.chip:hover { background: var(--surface); } .chip[aria-pressed="true"]:hover { background: var(--action-hover); }
.chip:active { transform: translateY(1px); }
.chip .box { color: var(--text-dim); font-weight: 600; margin-right: var(--s-2); }
.chip[aria-pressed="true"] { background: var(--action); }
.chip[aria-pressed="true"] .box { color: var(--text); }
a.chip { text-decoration: none; }
a.chip[aria-current] { background: var(--action); }
.search { cursor: text; min-width: 160px; }
.search::placeholder { color: var(--text-dim); }
.chips a.all { align-self: center; text-decoration: none; font-size: var(--t-small); padding: var(--s-1); }
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-8); }
/* the one bordered label: Try asking's "asks you first", road signs, the honk */
.tag, .stop .sign, .vig .vsign, .honk { font-size: var(--t-label); line-height: var(--l-label); border: var(--hairline) solid var(--border); background: var(--surface-raised); padding: var(--s-1) var(--s-2); white-space: nowrap; }

/* ---------------------------------------------------------------- marks and status */
ul.boxes { list-style: none; margin: var(--s-4) 0 0; padding: 0; }
ul.boxes li { display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px dashed var(--divider); }
ul.boxes li:last-child { border-bottom: 1px dashed var(--divider); }
ul.boxes li::before { content: "✓"; flex: none; width: 18px; height: 18px; line-height: 16px; text-align: center; border: var(--hairline) solid var(--border); font-weight: 700; font-size: var(--t-body); color: var(--mark-pass); margin-top: var(--s-1); }
ul.boxes.no li::before { content: "✗"; color: var(--mark-fail); }
ul.boxes.ask li::before { content: "–"; color: var(--text); }
ul.boxes b { font-weight: 600; display: block; }
ul.boxes.inline b { display: inline; }
ul.boxes span { color: var(--text-dim); font-size: var(--t-small); line-height: var(--l-small); }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: var(--s-2); vertical-align: -1px; }
.dot.passed { background: var(--mark-pass); } .dot.failed { background: var(--mark-fail); } .dot.untested, .dot.none { background: var(--mark-skip); }
.nights { display: flex; gap: var(--s-1); margin-top: var(--s-4); }
.nights i { width: 14px; height: 28px; border: 1px solid var(--divider); background: var(--surface-raised); }
.nights i.passed { background: var(--mark-pass); border-color: var(--mark-pass); }
.nights i.failed { background: var(--mark-fail); border-color: var(--mark-fail); }
.nights i.none { background: var(--mark-skip); border-color: var(--mark-skip); }
small.why { display: block; font-size: var(--t-small); line-height: var(--l-small); color: var(--text-dim); font-weight: 400; white-space: normal; }
small.why.bad { color: var(--mark-fail); }
.counts { display: flex; gap: var(--s-6); flex-wrap: wrap; align-items: center; margin-top: var(--s-6); font-size: var(--t-small); line-height: var(--l-small); }

/* ---------------------------------------------------------------- tables, two kinds */
/* 1. data table: drawn like box-drawing characters. Real <table>s, so cells never run into each other. */
table.typed { border-collapse: collapse; width: 100%; border: var(--hairline) solid var(--border); outline: var(--hairline) solid var(--border); outline-offset: 3px; font-size: var(--t-small); line-height: var(--l-small); }
table.typed th, table.typed td { text-align: left; vertical-align: top; padding: var(--s-2) var(--s-3); overflow-wrap: break-word; color: var(--text); white-space: normal; }
table.typed th { font-size: var(--t-label); line-height: var(--l-label); font-weight: 600; border-bottom: 3px solid var(--border); border-left: var(--hairline) solid var(--border); }
table.typed td { border-bottom: var(--hairline) solid var(--border); border-left: var(--hairline) solid var(--border); }
table.typed th:first-child, table.typed td:first-child { border-left: 0; }
table.typed tr.g td { background: var(--surface-raised); font-size: var(--t-label); line-height: var(--l-label); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
table.typed tr.g a { color: inherit; text-decoration: none; }
table.typed tr.g a:hover { background: var(--action); }
table.typed tr.g .n { font-weight: 400; color: var(--text-dim); margin-left: var(--s-2); }
table.typed tr[hidden] { display: none; }
table.typed td.ck, table.typed th.ck { text-align: center; }
table.typed .ph { display: none; }
table.checks.typed td:last-child, table.vtable.typed td:last-child { color: var(--text-dim); }
/* the data table on night: the home page's board. Same type and marks, dividers instead of a box. */
table.board { border-collapse: collapse; width: 100%; font-size: var(--t-small); line-height: var(--l-small); }
table.board th, table.board td { text-align: center; padding: var(--s-2); border-bottom: 1px solid var(--divider); white-space: nowrap; }
table.board th { font-weight: 600; color: var(--text-dim); font-size: var(--t-label); line-height: var(--l-label); }
table.board th:first-child, table.board td:first-child { text-align: left; }
table.board td + td { color: var(--mark-skip); }
table.board td .dot { margin: 0; }
table.board tr.more td { padding-top: var(--s-3); }
table.board tr.more a { color: inherit; }
/* board squares: click one and a small card says what ran (.pop, made by BOARD_JS) */
table.board td.ck { cursor: pointer; -webkit-tap-highlight-color: transparent; }
table.board td.ck .dot { transition: transform .08s; }
table.board td.ck:hover .dot, table.board td.ck.on .dot, table.board td.ck:focus-visible .dot { transform: scale(1.4); }
table.board td.ck.on .dot, table.board td.ck:focus-visible .dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
table.board.day td a { text-decoration: none; font-weight: 600; }
table.board.typed th, table.board.typed td { padding: var(--s-2) var(--s-3); }
table.board.typed td + td { color: var(--text); }
table.board.checks th { text-align: left; }
h2 + table.typed, h2 + .scroll-x { margin-top: var(--s-4); }
table.board.checks td { white-space: normal; text-align: left; vertical-align: top; }
table.board.checks td:first-child { white-space: nowrap; width: 8em; }
table.board.checks td:last-child { color: var(--text-dim); }
/* version history: words wrap, the "what went wrong" column is quiet */
table.vtable td { white-space: normal; text-align: left; } table.vtable td .dot { margin-right: var(--s-2); }
table.vtable td:last-child { color: var(--text-dim); overflow-wrap: anywhere; }
table.board.cmds td:first-child { white-space: nowrap; }
table.vtable td .dot { margin-right: var(--s-2); }
table.vtable td:last-child { overflow-wrap: anywhere; }
/* 2. fact list: a few facts about one thing */
table.facts { border-collapse: collapse; margin: var(--s-4) 0 var(--s-2); width: 100%; font-size: var(--t-small); line-height: var(--l-small); }
table.facts th { text-align: left; font-weight: 400; color: var(--text-dim); padding: var(--s-1) var(--s-4) var(--s-1) 0; vertical-align: top; width: 1%; white-space: nowrap; }
table.facts td { padding: var(--s-1) 0; overflow-wrap: anywhere; }

/* the tools list (a data table) */
table.tools-table { table-layout: fixed; margin-top: var(--s-8); }
.tools-table col.c-tool { width: 24%; } .tools-table col.c-can { width: 28%; } .tools-table col.c-needs { width: 30%; } .tools-table col.c-st { width: 18%; }
.tools-table tr.t-row { cursor: pointer; }
.tools-table tr.t-row:hover td { background: var(--surface-raised); }
.tools-table td a { text-decoration: none; }
.tools-table td b { font-weight: 600; display: block; font-size: var(--t-body); line-height: var(--l-body); }
.tools-table td small { display: block; font-size: var(--t-small); color: var(--text-dim); }
/* versions */
ul.vlist { list-style: none; padding: 0; margin: var(--s-2) 0 0; font-size: var(--t-small); line-height: var(--l-small); }
ul.vlist li { padding: var(--s-1) 0; border-top: 1px dashed var(--divider); display: flex; gap: var(--s-3); }
ul.vlist li a { font-weight: 600; min-width: 6.5em; }
.v-works, .v-fails, .v-mixed { color: var(--text-dim); }

/* ---------------------------------------------------------------- terminal blocks, questions, Try asking */
pre.term { margin: 0; font: var(--t-small)/var(--l-small) var(--font); background: var(--surface-raised); border: var(--hairline) solid var(--border); padding: var(--s-4); overflow-x: auto; }
pre.term .ok { color: var(--mark-pass); font-weight: 600; }
pre.term .bad { color: var(--mark-fail); font-weight: 600; }
pre.term .ln { display: block; padding-left: 2ch; text-indent: -2ch; }   /* a mark line; wraps under its words */
pre.term.diagram { margin: 0 0 var(--s-6); box-shadow: 4px 4px 0 var(--divider); }
.qs { margin: var(--s-4) 0 0; }
.qs > div { display: grid; grid-template-columns: 300px 1fr; gap: var(--s-6); padding: var(--s-3) 0; border-top: 1px solid var(--divider); }
.qs > div:last-child { border-bottom: 1px solid var(--divider); }
.qs h3 { font-size: inherit; font-weight: 600; margin: 0; }
.qs p { margin: 0; }
ul.try-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; }
ul.try-list li { padding: var(--s-3) 0; border-top: 1px dashed var(--divider); }
ul.try-list li:last-child { border-bottom: 1px dashed var(--divider); }
.try .say { display: flex; align-items: baseline; gap: var(--s-3); justify-content: space-between; }
.try q { font-weight: 600; quotes: "\201C" "\201D"; }
.try .runs { margin-top: var(--s-1); font-size: var(--t-small); line-height: var(--l-small); color: var(--text-dim); display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); align-items: baseline; }
.try .runs code { font: inherit; overflow-wrap: anywhere; }
.try .runs code::before { content: "runs  "; white-space: pre; }
.try .runs .tag { color: var(--text); }
ol.steps { margin: var(--s-2) 0 0; padding-left: 1.4em; } ol.steps li { margin: 0 0 var(--s-2); padding-left: var(--s-1); }

/* ---------------------------------------------------------------- home */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-16); align-items: end; padding-top: var(--section); }
.hero p.sub { margin: var(--s-4) 0 var(--s-6); }
.caption { min-height: 1.7em; margin: var(--s-3) 0 0; max-width: 46em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-foot { display: flex; gap: var(--s-6); align-items: center; margin-top: var(--s-6); flex-wrap: wrap; }
.pick-foot .cmd { flex: 0 1 auto; max-width: 100%; }

/* ---------------------------------------------------------------- road and bus (illustration: positions are drawing, not spacing) */
.road { position: relative; height: 200px; margin-top: var(--s-6); touch-action: pan-y; overflow: hidden; }   /* the bus comes in from behind the edge */
.asphalt { position: absolute; left: 0; right: 0; bottom: 18px; height: 46px; background: var(--road); }
.asphalt::after { content: ""; position: absolute; left: 0; right: 0; top: 21px; height: 3px; background: repeating-linear-gradient(90deg, var(--yellow) 0 18px, transparent 18px 36px); }
.curb { position: absolute; left: 0; right: 0; bottom: 64px; height: 2px; background: var(--ink); }
.stop { position: absolute; bottom: 66px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.stop .pole { width: 2px; height: 44px; background: var(--ink); }
.stop.here .sign, .stop:hover .sign { background: var(--action); }
.stop.more .sign { background: var(--ink); color: var(--paper); font-weight: 600; }
.stop.more { transform: translateX(-100%); align-items: flex-end; }
.bus { position: absolute; bottom: 26px; left: 0; width: 174px; transform: translateX(-50%); cursor: grab; user-select: none; touch-action: none; z-index: 2; }
.bus svg { display: block; width: 100%; height: auto; overflow: visible; }
.bus.dragging { cursor: grabbing; }
.bus .s { display: none; }
.bus[data-f="0"] .s0, .bus[data-f="1"] .s1, .bus[data-f="2"] .s2, .bus[data-f="3"] .s3 { display: inline; }
/* bounce off for now. To bring it back: .bus.driving[data-b="1"] .body { transform: translateY(-1px); }  (1px = one bus pixel) */
.bus.rock[data-dir="1"] .body { transform: translateX(1px); }
.bus.rock[data-dir="-1"] .body { transform: translateX(-1px); }
.bus .sign { transform-box: fill-box; transform-origin: center; transition: transform .12s steps(2); }
.bus.arm .sign { transform: scale(1.2); }
.honk { position: absolute; bottom: 150px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 3; }
.honk.on { opacity: 1; }
/* the tool-page vignette */
.vig { position: relative; height: 150px; overflow: hidden; }
.vig .asph { position: absolute; left: 0; right: 0; bottom: 12px; height: 40px; background: var(--road); }
.vig .asph::after { content: ""; position: absolute; left: 0; right: 0; top: 19px; height: 3px; background: repeating-linear-gradient(90deg, var(--yellow) 0 16px, transparent 16px 32px); background-position: var(--scroll, 0) 0; }
.vig .curb { bottom: 52px; }
.vig .vbus { left: 18%; bottom: 22px; transform: none; cursor: pointer; touch-action: auto; z-index: 1; }
.vstop { position: absolute; inset: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .js .vstop { transform: translateX(110vw); } }   /* start off to the right, so it never flashes at the finish */
.vig .vpole { position: absolute; left: calc(18% + 192px); bottom: 54px; width: 2px; height: 60px; background: var(--ink); }
.vig .vsign { position: absolute; left: calc(18% + 193px); bottom: 114px; transform: translateX(-50%); background: var(--action); }
.vig .nb { position: absolute; top: 0; left: 0; font-size: var(--t-small); line-height: var(--l-small); color: var(--text-dim); z-index: 2; }
.vig .nb a { text-decoration: none; display: inline-block; padding: 1px 0; }   /* 24px tall */
/* the night drive: the bus stays put and the world goes by */
.night { background: var(--surface); color: var(--text); margin-top: var(--s-20); padding: var(--s-16) 0 var(--s-10); overflow: hidden; }
.cruise { position: relative; height: 96px; margin-top: var(--s-6);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 80%, transparent); mask-image: linear-gradient(90deg, transparent, black 12%, black 80%, transparent); }
.cruise .nbus { position: absolute; left: 22%; bottom: 8px; width: 174px; }
.cruise .nbus svg { display: block; width: 100%; height: auto; filter: brightness(.62) saturate(.85); }
.cruise .nbus .s { opacity: 0; animation: turn .32s steps(1) infinite; }
.cruise .nbus .s1 { animation-delay: -.24s; } .cruise .nbus .s2 { animation-delay: -.16s; } .cruise .nbus .s3 { animation-delay: -.08s; }
@keyframes turn { 0% { opacity: 1; } 25%, 100% { opacity: 0; } }
.cruise .lane { position: absolute; left: 0; right: 0; bottom: 2px; height: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--night-text) 55%, transparent) 18px, transparent 18px) 0 0 / 54px 3px repeat-x; animation: slide .5s linear infinite; }
@keyframes slide { to { background-position: -54px 0; } }
.cruise .beam { position: absolute; left: calc(22% + 168px); bottom: 14px; width: 230px; height: 44px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--headlight) 50%, transparent), transparent); clip-path: polygon(0 38%, 100% 0, 100% 100%, 0 62%);
  animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .9; } 50% { opacity: 1; } 62% { opacity: .82; } 66% { opacity: .97; } }
.cruise .puff { position: absolute; left: calc(22% - 4px); bottom: 14px; width: 6px; height: 6px; background: color-mix(in srgb, var(--night-dim) 50%, transparent); opacity: 0; animation: puff 1.8s steps(6) infinite; }
.cruise .puff.p2 { animation-delay: .9s; width: 4px; height: 4px; bottom: 17px; }
@keyframes puff { 0% { opacity: .7; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(-48px, -10px) scale(2); } }
@media (prefers-reduced-motion: reduce) { .cruise *, .cruise *::before, .cruise *::after { animation: none !important; } .cruise .nbus .s0 { opacity: 1; } .bus .sign { transition: none; } }

/* ---------------------------------------------------------------- tool page */
.tool-top { display: grid; grid-template-columns: 1fr 460px; gap: var(--s-16); align-items: end; padding-top: var(--section); }
.tool-top > * { min-width: 0; }
.name-row { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.name-row .st { font-size: var(--t-small); line-height: var(--l-small); }
.tool-top p.built { margin: var(--s-2) 0 0; }
.tool-top p.sub { margin: var(--s-4) 0 var(--s-6); }

/* ---------------------------------------------------------------- popover */
.pop { position: fixed; z-index: 50; max-width: min(300px, calc(100vw - 24px)); padding: var(--s-2) var(--s-3); background: var(--card); color: var(--ink);
  border: var(--hairline) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: var(--t-small)/var(--l-small) var(--font); }
.pop-h { font-weight: 600; margin-bottom: var(--s-1); }
.pop-st { font-weight: 400; padding: 0 var(--s-1); margin-left: var(--s-1); color: var(--card); }
.pop-st.passed { background: var(--green); } .pop-st.failed { background: var(--red); } .pop-st.not-run { background: var(--ink-dim); }
.pop code { display: block; font: inherit; color: var(--ink-dim); overflow-wrap: anywhere; }
.pop div:last-child:not(.pop-h) { color: var(--ink-dim); }

/* ---------------------------------------------------------------- Last good version */
.kg pre.term { margin-top: var(--s-2); }
form.lost .cmd { margin-top: var(--s-2); max-width: 32em; }
form.lost input { flex: 1; min-width: 0; padding: var(--s-3) var(--s-4); font: inherit; border: 0; background: transparent; color: var(--text); }
form.lost input:focus { outline: none; }
form.lost .cmd button { width: auto; padding: 0 var(--s-4); white-space: nowrap; }

/* ---------------------------------------------------------------- docs */
.docs section { margin-top: var(--s-10); max-width: 760px; }
.docs h2 { margin-top: var(--s-10); margin-bottom: var(--s-3); }
.docs p { margin: 0 0 var(--s-3); }
.docs pre.term { margin: 0 0 var(--s-4); }
.docs table.board { margin: var(--s-1) 0 var(--s-4); display: block; overflow-x: auto; }
.docs table.board td { white-space: normal; text-align: left; }
.docs table.board td + td { color: var(--text); }
.docs code.c { overflow-wrap: anywhere; }
.docs .cmd { margin: 0 0 var(--s-4); }
.docs .prevnext { margin-top: var(--s-10); }
.docs-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr) 170px; gap: var(--s-10); padding-top: var(--s-10); }
.docs-grid > * { min-width: 0; }
.docs-grid .docs { max-width: 720px; }
.doc-nav, .doc-toc { position: sticky; top: var(--doc-top, 100px); align-self: start; font-size: var(--t-small); line-height: var(--l-small); max-height: calc(100vh - var(--doc-top, 100px) - 16px); overflow-y: auto; }
.doc-nav ul, .doc-toc ul { list-style: none; margin: var(--s-1) 0 var(--s-4); padding: 0; }
.doc-nav li a, .doc-toc li a { display: block; padding: var(--s-1) var(--s-2); text-decoration: none; color: var(--text); }
.doc-nav li a:hover, .doc-toc li a:hover { background: var(--surface-raised); }
.doc-nav li a[aria-current] { background: var(--action); font-weight: 600; }
.doc-group { font-size: var(--t-label); line-height: var(--l-label); font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; padding: 0 var(--s-2); margin-top: var(--s-2); }
.doc-search { display: flex; align-items: center; border: var(--hairline) solid var(--border); background: var(--surface-raised); margin-bottom: var(--s-4); }
.doc-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; padding: var(--s-2); color: var(--text); }
.doc-search input:focus { outline: none; } .doc-search:focus-within { outline: 2px solid var(--text); outline-offset: 3px; }
.doc-search kbd { font: inherit; font-size: var(--t-label); color: var(--text-dim); padding: 0 var(--s-2); }
button.doc-search { width: 100%; font: inherit; font-size: var(--t-small); color: var(--text-dim); text-align: left; cursor: pointer; justify-content: space-between; padding: var(--s-2) 0 var(--s-2) var(--s-2); }
button.doc-search:hover { color: var(--text); }
.doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-6); }
.doc-head h1 { margin: 0; }
ul.doc-links { padding-left: 0; list-style: none; } ul.doc-links li { padding: var(--s-2) 0; border-top: 1px dashed var(--divider); } ul.doc-links li:last-child { border-bottom: 1px dashed var(--divider); }
ul.doc-links a { font-weight: 600; margin-right: var(--s-2); }
@media (max-width: 960px) { .docs-grid { grid-template-columns: 170px minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 760px) { .docs-grid { grid-template-columns: 1fr; gap: var(--s-6); padding-top: var(--s-6); } .doc-nav { position: static; } .doc-nav ul { display: flex; flex-wrap: wrap; gap: var(--s-1); } }
/* docs: the top bar and both side columns stay put; only the page in the middle scrolls */
body.docs-page { --doc-top: 92px; }
.doc-top { position: sticky; top: 0; z-index: 20; background: var(--surface); padding-bottom: var(--s-4); max-width: none; margin-left: 0; }
.doc-top header { max-width: 960px; margin: 0 auto; }
.doc-top header { margin-left: max(0px, round(down, calc((100% - 960px) / 2), 1px)); margin-right: auto; }
body.docs-page .docs-grid { padding-top: var(--s-6); padding-bottom: var(--s-20); }
@media (max-width: 760px) { .doc-top { position: static; } }
/* the palette (docs search) */
.palette { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--ink) 25%, transparent); display: flex; align-items: flex-start; justify-content: center; padding: 12vh var(--s-4) var(--s-4); }
.palette[hidden] { display: none; }
.pal-box { width: min(560px, 100%); background: var(--card); border: var(--hairline) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.pal-box input { width: 100%; font: inherit; padding: var(--s-3) var(--s-4); border: 0; border-bottom: var(--hairline) solid var(--ink); background: transparent; color: var(--ink); }
.pal-box input:focus { outline: none; }
.pal-box ul { list-style: none; margin: 0; padding: var(--s-2); max-height: 50vh; overflow-y: auto; }
.pal-box li { padding: var(--s-2) var(--s-3); cursor: pointer; font-size: var(--t-small); line-height: var(--l-small); }
.pal-box li b { display: block; }
.pal-box li span { color: var(--ink-dim); }
.pal-box li[aria-selected="true"] { background: var(--action); }
.pal-box li[aria-selected="true"] span { color: var(--ink); }
.pal-box li.none { color: var(--ink-dim); cursor: default; }
.pal-box mark { background: none; color: var(--ink); font-weight: 600; text-decoration: underline; }
.pal-foot { border-top: 1px solid var(--line); padding: var(--s-2) var(--s-3); font-size: var(--t-label); line-height: var(--l-label); color: var(--ink-dim); }

/* ---------------------------------------------------------------- 404 */
.nf { grid-template-columns: minmax(0, 40em); }
.nf-road { margin-top: var(--s-10); }
.nf-road .bus { cursor: default; }

/* ---------------------------------------------------------------- the design page (/design/) */
.sw { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-4); margin-top: var(--s-4); }
.sw div { border: var(--hairline) solid var(--border); background: var(--surface-raised); }
.sw i { display: block; height: 56px; border-bottom: var(--hairline) solid var(--border); }
.sw p { margin: 0; padding: var(--s-2); font-size: var(--t-small); line-height: var(--l-small); }
.type-row { display: grid; grid-template-columns: 9em 1fr; gap: var(--s-4); align-items: baseline; padding: var(--s-3) 0; border-top: 1px dashed var(--divider); }
.space-row { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-1) 0; font-size: var(--t-small); }
.space-row i { display: block; height: 12px; background: var(--action); border: 1px solid var(--border); }
.specimen { border: 1px dashed var(--divider); padding: var(--s-6); margin-top: var(--s-4); }

/* ---------------------------------------------------------------- focus: one ring, everywhere you can Tab to */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
table.board td.ck:focus-visible { outline-offset: -4px; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  .wrap { padding: 0 var(--s-6); }
  header { flex-direction: column; align-items: flex-start; padding-top: var(--s-6); }
  nav a { margin: 0 var(--s-2) 0 0; padding: 0; } nav a:last-child { margin-right: 0; }   /* one line down to 360px */
  .hero, .two, .tool-top { grid-template-columns: 1fr; gap: var(--s-8); }
  .qs > div { grid-template-columns: 1fr; gap: var(--s-1); }
  .cmd code { font-size: var(--t-small); padding: var(--s-3); }
  pre.term:not(.diagram) { white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--s-3); }   /* long lines wrap on a phone instead of hiding off the edge; the ASCII diagram keeps its shape and scrolls */
  .caption .pos { display: none; } .caption { font-size: var(--t-small); }
  .road { height: 150px; }
  .asphalt { height: 38px; bottom: 14px; } .asphalt::after { top: 17px; background: repeating-linear-gradient(90deg, var(--yellow) 0 14px, transparent 14px 28px); }
  .curb { bottom: 52px; }
  .stop { bottom: 54px; } .stop .pole { height: 32px; }
  .stop:not(.here):not(.more) .sign { font-size: 0; padding: 0; width: 12px; height: 12px; }
  .bus { width: 116px; bottom: 20px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--s-6)); padding-right: var(--s-6); }
  .filters .chip { flex: none; }
  .tools-table col.c-needs, .tools-table col.c-st, .tools-table .needs, .tools-table td.s, .tools-table th.st { display: none; }
  .tools-table col.c-tool { width: 46%; } .tools-table col.c-can { width: 54%; }
  table.typed .ph { display: block; margin-top: var(--s-2); font-size: var(--t-small); color: var(--text-dim); }
  .tools-table .ph.st { color: var(--text); white-space: nowrap; }
  table.checks.typed th:last-child, table.checks.typed td:last-child { display: none; }
  table.typed th, table.typed td, table.board.typed th, table.board.typed td { padding: var(--s-2); }
  table.board.typed .ck { padding: var(--s-2) 0; }
  table.board.typed td:first-child, table.board.typed th:first-child { padding: var(--s-2) var(--s-1); }
  table.board th.ck, table.board.typed th.ck { white-space: normal; vertical-align: bottom; } table.board:not(.typed) th:first-child, table.board:not(.typed) td:first-child { padding-left: 0; } table.board:not(.typed) th + th { white-space: normal; vertical-align: bottom; } table.board:not(.typed) th + th, table.board:not(.typed) td + td { padding-left: var(--s-1); padding-right: var(--s-1); }   /* two-line heads, so the board fits a phone */
  .vig { height: 132px; } .vig .nb { display: none; }   /* tall enough for the sign */
  .vig .vbus { width: 116px; left: 10%; bottom: 18px; } .vig .asph { height: 34px; } .vig .curb { bottom: 46px; }
  .vig .vpole { left: calc(10% + 132px); bottom: 48px; height: 48px; } .vig .vsign { left: calc(10% + 133px); bottom: 96px; }
  .nights { gap: 3px; } .nights i { width: 8px; height: 16px; }
}
.outline-room { padding: var(--s-2); margin-left: calc(-1 * var(--s-2)); margin-right: calc(-1 * var(--s-2)); }   /* room for the data table's outer rule */

/* what's a CLI: a Terminal window, drawn flat in the house style. The round window buttons are a picture of a Mac, the one exception to square corners. */
.cli code.c { user-select: all; color: var(--text-dim); }   /* one click selects the whole command */
.cli ul.asks { margin: 0 0 var(--s-3); padding-left: var(--s-6); }
.cli ul.asks li { margin-bottom: var(--s-2); }
.mac { margin: var(--s-4) 0 var(--s-8); border: var(--hairline) solid var(--border); background: var(--surface-raised); box-shadow: 4px 4px 0 var(--border); }
.mac-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--divider); background: var(--surface); }
.mac-dots { display: flex; gap: var(--s-2); }
.mac-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink); background: var(--red); }
.mac-dots i:nth-child(2) { background: var(--yellow); } .mac-dots i:nth-child(3) { background: var(--green); }
.mac-title { font-size: var(--t-small); line-height: var(--l-small); font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.mac-body { margin: 0; padding: var(--s-3) var(--s-4); min-height: 200px; font: var(--t-small)/var(--l-small) var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.mac .cur { display: inline-block; width: .6em; height: 1.15em; vertical-align: text-bottom; background: var(--ink-dim); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mac .cur { animation: none; } }
@media (max-width: 760px) { .mac-title { display: none; } .mac-body { min-height: 140px; } }
