/* Tessri site. Three colours in the usual proportions: the ground (about 70%) is the page, light or dark; the band
   (about 30%) carries the header on every page and the hero on the landing page, and returns as the buttons and the
   panels' command bars; the small remainder is the mark, the wordmark's dot, links and labels, a highlighted number,
   the selected step and the one call to action. The palette is the value block below and nothing else: the identity's
   violet as the band, so the mark and the report keep their colour; lavender for links and labels; lime for the call
   to action, the dot and highlights. The landing page sits on sixteen columns with 32px gutters, so the hero's two
   columns, the cards and the example's two columns share one set of column lines; the one glass layer is the brief
   in the hero, over the band. Headings by size and tracking rather than weight, hairline cards for the parallel things
   and space for the rest, prose no wider than 740px. Dark is the first reading, light the equal second; the system
   setting decides unless the visitor picks. The type is Inter and Commit Mono, served from fonts/ next to their
   notices (SIL Open Font License); the icons are Lucide's, inlined by the build (ISC, icons/LICENSE). No request
   leaves the page. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Commit Mono";
  src: url("fonts/commit-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Commit Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --band: #5a46c2;
  --band-ink: #ffffff;
  --band-ink-2: #dcd6ff;
  --band-muted: rgba(255, 255, 255, 0.6);
  --band-line: rgba(255, 255, 255, 0.28);
  --band-well: rgba(20, 14, 48, 0.3);
  --band-selection: rgba(212, 245, 90, 0.4);
  --band-dots: rgba(255, 255, 255, 0.2);
  --band-deep: #251c66;
  --glass: rgba(255, 255, 255, 0.78);
  --mark: #ffffff;
  --dot: #d4f55a;

  --bg: #faf9fd;
  --bg-2: #f0eef8;
  --panel: #ffffff;
  --code-bg: #f4f2fb;
  --tile: rgba(90, 70, 194, 0.1);
  --ink: #17151e;
  --ink-2: #4e4863;
  --muted: #7b7590;
  --line: rgba(90, 70, 194, 0.18);
  --line-soft: rgba(90, 70, 194, 0.1);
  --accent-text: #5544b4;
  --highlight: #5544b4;
  --button: #5a46c2;
  --button-text: #ffffff;
  --cta: #d4f55a;
  --cta-text: #17151e;
  --selection: rgba(90, 70, 194, 0.2);
  --shadow: 0 12px 32px rgba(23, 21, 30, 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d1a;
    --bg-2: #171424;
    --panel: #151222;
    --code-bg: #130f20;
    --tile: rgba(176, 160, 255, 0.14);
    --ink: #f0eef6;
    --ink-2: #c1bacf;
    --muted: #8b86a0;
    --line: rgba(220, 214, 255, 0.15);
    --line-soft: rgba(220, 214, 255, 0.08);
    --accent-text: #b0a0ff;
    --highlight: #d4f55a;
    --button: #5a46c2;
    --button-text: #ffffff;
    --cta: #d4f55a;
    --cta-text: #0f0d1a;
    --selection: rgba(176, 160, 255, 0.3);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    --glass: rgba(21, 18, 34, 0.8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f0d1a;
  --bg-2: #171424;
  --panel: #151222;
  --code-bg: #130f20;
  --tile: rgba(176, 160, 255, 0.14);
  --ink: #f0eef6;
  --ink-2: #c1bacf;
  --muted: #8b86a0;
  --line: rgba(220, 214, 255, 0.15);
  --line-soft: rgba(220, 214, 255, 0.08);
  --accent-text: #b0a0ff;
  --highlight: #d4f55a;
  --button: #5a46c2;
  --button-text: #ffffff;
  --cta: #d4f55a;
  --cta-text: #0f0d1a;
  --selection: rgba(176, 160, 255, 0.3);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --glass: rgba(21, 18, 34, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection); }

a { color: var(--accent-text); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }

.icon { width: 1em; height: 1em; flex: none; stroke-width: 1.75; }

code, pre, kbd, .mono { font-family: var(--mono); letter-spacing: 0; }

code {
  font-size: 0.875em;
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg-2);
  overflow-wrap: anywhere;
}

pre {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 21px;
  overflow-x: auto;
  contain: inline-size;  /* a long line scrolls inside the block and never widens the page: on a phone the layout viewport would otherwise grow to the longest line */
  tab-size: 4;
}

pre code { font-size: inherit; padding: 0; border: 0; background: none; overflow-wrap: normal; }

/* Code, read as the reader reads it: the command and the keywords in the accent, strings in ink, comments quiet. */
.tk-k { color: var(--accent-text); }
.tk-s { color: var(--ink); }
.tk-c { color: var(--muted); }
.tk-f { color: var(--ink-2); }
.tk-n { color: var(--highlight); }
.tk-p { color: var(--muted); user-select: none; }

.code { position: relative; }
.code .copy.mini {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  padding: 0;
  justify-content: center;
  color: var(--muted);
  border-color: var(--line);
  background: var(--code-bg);
  opacity: 0;
}
.code:hover .copy.mini, .code .copy.mini:focus-visible, .code .copy.mini.done { opacity: 1; }
.code .copy.mini:hover { color: var(--ink); border-color: var(--ink-2); }

h1, h2, h3 {
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: 40px; line-height: 46px; letter-spacing: -0.025em; }
h2 { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; }
h3 { font-size: 18px; line-height: 26px; letter-spacing: -0.012em; }

p { margin: 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* The band, carrying the header on every page and the hero on the landing page */

.sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--band);
  color: var(--band-ink);
}
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--band-dots) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 110% at 28% 0%, #000 10%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 110% at 28% 0%, #000 10%, transparent 100%);
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(255, 255, 255, 0.1), transparent 62%),
    radial-gradient(640px 320px at 100% 110%, rgba(212, 245, 90, 0.14), transparent 60%);
}
.sky a { color: var(--band-ink); }
.sky a:focus-visible, .sky button:focus-visible { outline-color: var(--band-ink); }
.sky ::selection { background: var(--band-selection); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--band-ink);
  font-size: 21px;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.wordmark:hover { text-decoration: none; }
.wordmark svg { width: 24px; height: 24px; color: var(--mark); flex: none; }
.wordmark .dot { color: var(--dot); }

.top nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.top nav a { display: inline-flex; align-items: center; gap: 4px; color: var(--band-ink-2); }
.top nav a .icon { width: 14px; height: 14px; opacity: 0.8; }
.top nav a:hover { color: var(--band-ink); text-decoration: none; }
.top nav a[aria-current="page"] { color: var(--band-ink); }

.theme {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--band-line);
  border-radius: 9px;
  background: transparent;
  color: var(--band-ink-2);
  cursor: pointer;
}

.theme:hover { color: var(--band-ink); border-color: var(--band-ink); }
.theme .icon { width: 16px; height: 16px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

/* Landing: sixteen columns, 32px gutters, 1312px at most. The hero, the cards and the example snap to these column
   lines; the three steps of "how" divide their row evenly. */

.home .wrap { max-width: 1376px; padding-left: 32px; padding-right: 32px; }
.home .grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); column-gap: 32px; }
.home .sky { background: linear-gradient(112deg, var(--band) 0%, var(--band) 42%, var(--band-deep) 100%); }

.hero { padding-top: 40px; padding-bottom: 64px; row-gap: 40px; align-items: start; }
.hero .pitch { grid-column: 1 / -1; }
.hero.with-handoff .pitch { grid-column: span 7; }

/* The mark, as liquid metal when WebGL is there (liquid.js adds `live`), still otherwise. */
.visual { position: relative; width: 72px; height: 72px; margin: 0 0 22px -4px; }
.visual::before {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212, 245, 90, 0.18), rgba(255, 255, 255, 0.06) 55%, transparent 100%);
  filter: blur(10px);
}
.visual svg { position: absolute; inset: 12%; width: 76%; height: 76%; color: var(--band-ink); opacity: 0.92; }
.visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.visual.live svg { display: none; }
.visual.live canvas { display: block; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--band-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--band-ink-2);
  font-size: 13px;
  letter-spacing: 0;
}
.facts .icon { width: 14px; height: 14px; color: var(--dot); }

.hero h1 { font-size: 58px; line-height: 62px; letter-spacing: -0.035em; color: var(--band-ink); max-width: 760px; }
.hero .lede { margin-top: 22px; font-size: 19px; line-height: 29px; color: var(--band-ink-2); max-width: 680px; }
.hero.with-handoff h1 { font-size: 46px; line-height: 50px; letter-spacing: -0.03em; }
.hero.with-handoff .lede { margin-top: 18px; font-size: 17px; line-height: 27px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--button);
  background: var(--button);
  color: var(--button-text);
  font-size: 15px;
  font-weight: 500;
}
.button .icon { width: 16px; height: 16px; }

.button:hover { text-decoration: none; opacity: 0.9; }
.button.cta { background: var(--cta); border-color: var(--cta); color: var(--cta-text); padding-right: 14px; }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button.quiet:hover { border-color: var(--ink-2); opacity: 1; }
.sky .button.quiet { color: var(--band-ink); border-color: var(--band-line); }
.sky .button.quiet:hover { border-color: var(--band-ink); }

.install {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 12px 10px 12px 16px;
  border: 1px solid var(--band-line);
  border-radius: 12px;
  background: var(--band-well);
  max-width: 640px;
}

.install code { border: 0; background: none; padding: 0; font-size: 14px; color: var(--band-ink); }
.install code .prompt { color: var(--band-muted); user-select: none; }

.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 30px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--band-line);
  border-radius: 7px;
  background: transparent;
  color: var(--band-ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.copy .icon { width: 14px; height: 14px; }
.copy .check { display: none; }
.copy.done .check { display: block; }
.copy.done .copy-icon { display: none; }
.copy:hover { color: var(--band-ink); border-color: var(--band-ink); }

.hero .note { margin-top: 14px; font-size: 14px; line-height: 20px; color: var(--band-ink-2); max-width: 680px; }
.hero .note code { display: inline-block; white-space: nowrap; max-width: 100%; color: var(--band-ink); background: rgba(255, 255, 255, 0.1); border-color: var(--band-line); }

/* The handoff: the brief of the latest change, as the page's one glass layer over the band, read in three steps. The
   selected step carries the accent; the steps are tabs with script and three stacked sections without it. */

.handoff {
  grid-column: span 9;
  position: relative;
  min-width: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: var(--shadow);
  overflow: hidden;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .handoff { background: var(--panel); }
}
.handoff a { color: var(--accent-text); }
.handoff a:focus-visible, .handoff button:focus-visible { outline-color: var(--accent-text); }
.handoff:focus { outline: none; }
.handoff:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.handoff ::selection { background: var(--selection); }
.handoff .body { padding: 18px 22px 20px; }
.handoff .scope { font-size: 14px; line-height: 21px; color: var(--ink-2); }
.handoff .scope strong { color: var(--ink); font-weight: 500; }

.steps-bar { display: flex; gap: 2px; margin: 14px 0 0; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 42px;
  padding: 0 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.step .n {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tile);
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 11px;
}
.step:hover { color: var(--ink); }
.step[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--cta); }
.step[aria-selected="true"] .n { background: var(--cta); color: var(--cta-text); }
.step:focus-visible { outline-offset: -3px; border-radius: 6px; }

.step-panel { padding-top: 14px; }
.step-panel[hidden] { display: none; }
.step-name { margin-top: 14px; font-size: 15px; line-height: 22px; }
.handoff.js .step-name { display: none; }
.step-panel .caption { font-size: 13px; line-height: 19px; color: var(--muted); }
.step-panel .output { margin-top: 10px; }

/* What a line of the brief rests on: a candidate is a path, a run is a record */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  margin-right: 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
  white-space: nowrap;
}
.tag.guess { border: 1px dashed var(--accent-text); color: var(--accent-text); }
.tag.fact { background: var(--button); color: var(--button-text); }

.handoff .more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  line-height: 20px;
  color: var(--ink-2);
}
.handoff .more p { flex: 1 1 300px; }
.handoff .more .button { height: 36px; padding: 0 14px; font-size: 14px; }
.handoff .button.quiet { color: var(--ink); border-color: var(--line); }
.handoff .button.quiet:hover { border-color: var(--ink-2); }

section.band { padding: 88px 0 0; }

.label {
  display: block;
  color: var(--accent-text);
  font-size: 12.5px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.band h2 { margin-top: 14px; max-width: 740px; }
.band .intro { margin-top: 14px; color: var(--ink-2); max-width: 740px; font-size: 17px; line-height: 27px; }

.tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--tile);
  color: var(--accent-text);
  flex: none;
}
.tile .icon { width: 20px; height: 20px; }

.questions { margin-top: 40px; row-gap: 32px; }

/* Card size is the weight of the thing: the page that hands a change over is the large card, its four sources the small ones. */
.questions article {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.questions .lead { grid-column: span 8; grid-row: span 2; background: linear-gradient(165deg, var(--bg-2), var(--panel) 70%); }
.questions .lead h3 { font-size: 24px; line-height: 31px; letter-spacing: -0.02em; }
.questions .lead p { font-size: 16px; }
.questions h3 { margin-top: 18px; }
.questions p { margin-top: 8px; color: var(--ink-2); }
.questions .cmd { display: block; margin-top: auto; padding-top: 18px; }
.questions .cmd code { color: var(--ink); }

/* The page's sections, in its order */
.sections { list-style: none; margin: 22px 0 0; padding: 0; counter-reset: sec; }
.sections li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 20px;
}
.sections li::before { counter-increment: sec; content: counter(sec); grid-row: span 2; padding-top: 1px; font-family: var(--mono); font-size: 12px; color: var(--accent-text); }
.sections b { font-weight: 500; color: var(--ink); }
.sections span { color: var(--ink-2); }

.example { margin-top: 32px; row-gap: 24px; align-items: start; }
.example .panel { grid-column: 1 / -1; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.example.with-drawing .panel { grid-column: span 10; }
.example .after { grid-column: 1 / -1; margin-top: 0; color: var(--ink-2); max-width: 740px; }

/* The reach of the file, drawn from the analysis: each edge in the kind of evidence behind it */
.drawing { grid-column: span 6; position: sticky; top: 24px; margin: 0; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.drawing figcaption { font-size: 13px; line-height: 19px; color: var(--muted); }
.drawing figcaption code { font-size: 12px; }
.drawing .key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.drawing .key span { display: inline-flex; align-items: center; gap: 8px; }
.drawing .key span::before { content: ""; width: 22px; border-top: 1.5px solid var(--accent-text); }
.drawing .key .k-guess::before { border-top-style: dashed; border-top-color: var(--ink-2); }
.blueprint { display: block; width: 100%; height: auto; margin-top: 12px; font-family: var(--mono); }
.bp-head { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--muted); }
.bp-count { font-size: 11px; fill: var(--accent-text); }
.bp-label { font-size: 11.5px; fill: var(--ink-2); }
.bp-node { fill: var(--accent-text); }
.bp-target .bp-node { fill: var(--highlight); }
.bp-target .bp-label { fill: var(--ink); font-weight: 500; }
.bp-more { font-size: 11px; fill: var(--muted); }
.bp-edge { fill: none; stroke: var(--line); stroke-width: 1; }
.bp-edge.kind-import, .bp-edge.kind-package { stroke: var(--accent-text); opacity: 0.55; }
.bp-edge.kind-string, .bp-edge.kind-dynamic, .bp-edge.kind-config, .bp-edge.kind-unknown { stroke: var(--ink-2); stroke-dasharray: 3 3; opacity: 0.7; }
.drawing .tests { margin-top: 12px; font-size: 13.5px; line-height: 20px; color: var(--ink-2); }
.drawing .tests b { color: var(--ink); font-weight: 500; }
.drawing .tests code { font-size: 12px; }

.cmdline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--band);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 20px;
  color: var(--band-muted);
}
.cmdline .dots { display: inline-flex; gap: 6px; }
.cmdline .dots i { display: block; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.cmdline .dots i:first-child { background: var(--dot); }
.cmdline b { color: var(--band-ink); font-weight: 400; }
.output { max-width: none; font-size: 15px; line-height: 23px; color: var(--ink-2); }
.example .output { padding: 20px 22px 22px; }
.output > * + * { margin-top: 12px; }
.output strong { color: var(--ink); font-weight: 500; }
.output ul { padding-left: 20px; }
.output li + li { margin-top: 4px; }
.output table { font-size: 14px; line-height: 20px; width: auto; min-width: 60%; font-variant-numeric: tabular-nums; }
.output th, .output td { padding-right: 28px; white-space: nowrap; }
.output td:nth-child(2) { white-space: normal; }
.handoff .output { font-size: 14.5px; line-height: 22px; }
.handoff .output > * + * { margin-top: 10px; }
.handoff .output table { font-size: 13px; line-height: 18px; min-width: 100%; }
.handoff .output th, .handoff .output td { padding-right: 16px; }
.handoff .output th { padding-top: 0; }
.handoff .output td:nth-child(3), .handoff .output td:nth-child(5), .handoff .output td:nth-child(6) { white-space: normal; }
.handoff .output td:nth-child(2) { white-space: nowrap; }
.handoff .output th:nth-child(3), .handoff .output td:nth-child(3) { min-width: 150px; }
.handoff .output ul { padding-left: 18px; }

.how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.how > div { padding: 26px 26px 24px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--bg-2); }
.how .lead { grid-column: 1 / -1; background: var(--panel); border-color: var(--line); }
.how .lead p { margin: 0; font-size: 17px; line-height: 27px; max-width: 820px; }
.how .head { display: flex; align-items: center; justify-content: space-between; }
.how .num { color: var(--accent-text); font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }
.how h3 { margin-top: 18px; }
.how p { margin-top: 8px; color: var(--ink-2); }
.how + .intro { margin-top: 32px; }

.evidence { margin-top: 36px; display: grid; gap: 16px; max-width: 740px; }
.evidence blockquote { margin: 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--accent-text); color: var(--ink-2); }
.evidence blockquote b { color: var(--highlight); font-weight: 500; }
.evidence blockquote .src { display: block; margin-top: 6px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

ol.steps { margin: 36px 0 0; padding: 0; list-style: none; counter-reset: step; max-width: 740px; display: grid; gap: 22px; }
ol.steps li { position: relative; padding-left: 46px; color: var(--ink-2); }
ol.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tile);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
}
ol.steps li b { color: var(--ink); font-weight: 500; }
ol.steps pre { margin-top: 10px; }

footer.foot {
  margin-top: 104px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

footer.foot .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 17px; letter-spacing: -0.02em; font-weight: 500; }
footer.foot .brand svg { width: 20px; height: 20px; color: var(--accent-text); }
footer.foot .brand .dot { color: var(--accent-text); }
footer.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer.foot a { color: var(--ink-2); }

/* Guide */

.wrap.guide { max-width: 1280px; }
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding: 40px 0 0; }
.demo-page { padding-top: 40px; }

.guide-nav { position: sticky; top: 24px; align-self: start; font-size: 14px; line-height: 20px; }
.guide-nav summary { display: none; }
.guide-nav .group, .toc .group { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 10px; }
.guide-nav ul { list-style: none; margin: 0 0 22px; padding: 0; }
.guide-nav li { margin: 0; }
.guide-nav a { display: block; padding: 5px 0 5px 12px; color: var(--ink-2); border-left: 1px solid var(--line-soft); }
.guide-nav a:hover { color: var(--ink); text-decoration: none; }
.guide-nav a[aria-current="page"] { color: var(--ink); border-left: 2px solid var(--accent-text); padding-left: 11px; font-weight: 500; }

.toc { display: none; position: sticky; top: 24px; align-self: start; font-size: 13px; line-height: 18px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--muted); border-left: 1px solid var(--line-soft); }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a[aria-current="true"] { color: var(--ink); border-left: 2px solid var(--accent-text); padding-left: 11px; }

.prose { max-width: 740px; min-width: 0; margin: 0 auto; }
.prose > * + * { margin-top: 18px; }
.prose h1 { margin-bottom: 8px; }
.prose h1 + p { color: var(--ink-2); font-size: 17px; line-height: 27px; }
.prose h2 { margin-top: 52px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.prose h3 { margin-top: 32px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose .code { margin-top: 18px; }
.prose img { max-width: 100%; }
.prose hr { border: 0; border-top: 1px solid var(--line-soft); margin: 36px 0; }

.table { overflow-x: auto; max-width: 100%; contain: inline-size; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 21px; font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 13px; letter-spacing: 0.01em; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose td code, .prose th code { white-space: nowrap; }
.prose .num { text-align: right; }

.prose .source { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; }

@media (min-width: 1280px) {
  .guide { grid-template-columns: 220px minmax(0, 1fr) 180px; gap: 48px; }
  .toc { display: block; }
}

/* Small screens: eight columns, then four with 16px gutters. The reading comes before any wide drawing. */

@media (max-width: 1056px) {
  .home .grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .hero.with-handoff .pitch, .handoff { grid-column: span 8; }
  .hero { padding-bottom: 56px; }
  .hero.with-handoff h1 { font-size: 52px; line-height: 56px; }
  .questions .lead { grid-column: span 8; grid-row: auto; }
  .example.with-drawing .panel, .drawing { grid-column: span 8; }
  .drawing { position: static; }
}

@media (max-width: 880px) {
  .how { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .handoff { background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .guide { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; }
  .demo-page { padding-top: 16px; }
  .guide-nav { position: static; }
  .guide-nav summary { display: block; cursor: pointer; color: var(--ink-2); padding: 10px 0; border-bottom: 1px solid var(--line-soft); list-style: none; }
  .guide-nav summary::-webkit-details-marker { display: none; }
  .guide-nav details:not([open]) .group, .guide-nav details:not([open]) ul { display: none; }
  .guide-nav ul { margin-top: 14px; }
  .code .copy.mini { opacity: 0.8; }
}

@media (max-width: 672px) {
  .wrap { padding: 0 16px; }
  .home .wrap { padding-left: 16px; padding-right: 16px; }
  .home .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 16px; }
  .hero.with-handoff .pitch, .handoff, .questions article, .questions .lead, .example.with-drawing .panel, .drawing { grid-column: span 4; }
  .top { height: 58px; }
  .top nav { gap: 14px; }
  .hero { padding-top: 32px; padding-bottom: 40px; row-gap: 32px; }
  .visual { width: 56px; height: 56px; margin-bottom: 18px; }
  .facts { margin-bottom: 20px; }
  .hero h1, .hero.with-handoff h1 { font-size: 38px; line-height: 42px; letter-spacing: -0.03em; }
  .hero .lede, .hero.with-handoff .lede { font-size: 17px; line-height: 26px; }
  h1 { font-size: 32px; line-height: 38px; }
  h2 { font-size: 24px; line-height: 30px; }
  section.band { padding-top: 56px; }
  .questions { row-gap: 16px; }
  .questions article, .how > div { padding: 22px 20px 20px; }
  .handoff .body { padding: 14px 16px 16px; }
  .steps-bar { gap: 0; }
  .step { gap: 5px; padding: 0 5px; font-size: 12.5px; }
  .handoff .output th:nth-child(n), .handoff .output td:nth-child(n) { white-space: nowrap; min-width: 0; }
  .cmdline { padding: 10px 16px; }
  .example .output { padding: 16px; }
  .install { flex-direction: column; align-items: stretch; }
  .install code { white-space: normal; overflow-wrap: anywhere; }
  .hero .note code { white-space: normal; }
  footer.foot { margin-top: 64px; }
}

/* Motion: short, eased, once. The hero rises in order and the handoff after it, the mark's tiles settle into place,
   the handoff types its command and then shows what came back, the drawing plots itself as it arrives, sections
   below the fold rise, cards lift under the pointer, and a theme switch crossfades. None of it when the visitor asked
   for less motion, and nothing waits on it: without script every section is visible and the handoff is complete. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .button, .copy, .theme, .step { transition: opacity 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease, background-color 120ms ease; }
  .button:hover { transform: translateY(-1px); }
  .questions article, .how > div { transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
  .questions article:hover { border-color: var(--accent-text); transform: translateY(-2px); box-shadow: var(--shadow); }
  .how > div:hover { border-color: var(--line); }
  :root.switching, :root.switching *, :root.switching *::before { transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease, fill 240ms ease !important; }

  .home .pitch > * { opacity: 0; animation: rise 560ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
  .home .pitch > :nth-child(2) { animation-delay: 70ms; }
  .home .pitch > :nth-child(3) { animation-delay: 140ms; }
  .home .pitch > :nth-child(4) { animation-delay: 210ms; }
  .home .pitch > :nth-child(5) { animation-delay: 280ms; }
  .home .pitch > :nth-child(6) { animation-delay: 350ms; }
  .home .pitch > :nth-child(7) { animation-delay: 420ms; }
  .home .handoff { opacity: 0; animation: rise 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 260ms forwards; }

  .home .wordmark svg rect { transform-box: fill-box; transform-origin: center; animation: tile 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .home .wordmark svg rect:nth-of-type(2) { animation-delay: 60ms; }
  .home .wordmark svg rect:nth-of-type(3) { animation-delay: 120ms; }
  .home .wordmark svg rect:nth-of-type(4) { animation-delay: 180ms; }

  .reveal { opacity: 0; transform: translateY(14px); transition: opacity 640ms ease, transform 640ms cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal.in { opacity: 1; transform: none; }
  .reveal .blueprint { clip-path: inset(0 100% 0 0); }
  .reveal.in .blueprint { animation: plot 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) 300ms forwards; }

  .handoff .body { transition: opacity 480ms ease, transform 480ms cubic-bezier(0.2, 0.7, 0.2, 1); }
  .handoff .body.pending { opacity: 0; transform: translateY(6px); }
  .cmdline .caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--band-ink); animation: blink 1s steps(2, start) infinite; }
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tile { from { opacity: 0; transform: translateY(-6px) scale(0.5); } to { opacity: 1; transform: none; } }
@keyframes blink { to { visibility: hidden; } }
@keyframes plot { to { clip-path: inset(0 0 0 0); } }

/* The front door's working parts: the skip link, the search over the guide, the pager, the not-found page. */

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.skip:focus { top: 12px; }

.search-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 9px 0 10px;
  border: 1px solid var(--band-line);
  border-radius: 9px;
  background: transparent;
  color: var(--band-ink-2);
  cursor: pointer;
  font: inherit;
}
.search-open:hover { color: var(--band-ink); border-color: var(--band-ink); }
.search-open .icon { width: 16px; height: 16px; }
.search-open kbd { font: 500 12px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--band-line); border-radius: 5px; color: var(--band-muted); }

.search { position: fixed; inset: 0; z-index: 60; }
.search[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(23, 21, 30, 0.45); }
.search-panel {
  position: relative;
  width: min(680px, calc(100% - 32px));
  margin: 10vh auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.search-row .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.search-row input::-webkit-search-cancel-button { display: none; }
.search-close { font: 500 12px/1 var(--mono); padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.search-close:hover { color: var(--ink); border-color: var(--ink-2); }
.search ul { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 520px); overflow: auto; }
.search ul:empty { padding: 0; }
.search li a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.search li a:hover, .search li[aria-selected="true"] a { background: var(--bg-2); text-decoration: none; }
.search .where { display: block; font-weight: 500; }
.search .sep { color: var(--muted); font-weight: 400; }
.search .snip { display: block; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.search mark { padding: 0 1px; border-radius: 3px; background: var(--tile); color: inherit; }
.search .hint { margin: 0; padding: 10px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-soft); }
body.searching { overflow: hidden; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px; color: var(--ink); }
.pager a:hover { border-color: var(--line); text-decoration: none; }
.pager a span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager .next { grid-column: 2; text-align: right; }

.notfound { max-width: 640px; padding: 80px 0 40px; }
.notfound .actions { display: flex; gap: 12px; margin-top: 28px; }
.notfound kbd { font: 500 13px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); }

@media (max-width: 672px) {
  .top nav .repo { display: none; }  /* the footer keeps the repository link; the bar keeps Guide, Demo, search and the theme */
  .search-open { width: 34px; padding: 0; justify-content: center; }
  .search-open kbd { display: none; }
  .search-panel { margin-top: 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; text-align: left; }
}
