/* Page-level layouts: home, articles, features, comparisons. */

/* Home */
.hero { padding-block: 64px 48px; }
.hero > .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.hero h1 { margin: 0 0 20px; font-size: var(--fs-display); line-height: 1.06; }
.hero .lede { margin: 0 0 28px; color: var(--ink-2); font-size: var(--fs-lede); line-height: 1.55; max-width: 34em; }
.hero .install { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .install .cmd { flex: 0 1 auto; }
.meta-line { margin: 16px 0 0; color: var(--muted); font-size: var(--fs-small); }
.home .fig { margin-bottom: 24px; }

.sec { padding-top: var(--section); }
.sec h2, .band h2 { margin: 0 0 8px; font-size: var(--fs-h2); line-height: 1.15; }
.sec .intro, .band .intro { margin: 0 0 32px; max-width: 40em; }
.sec .intro.wide, .band .intro.wide { max-width: none; }
.sec h2 + .bento { margin-top: 32px; } /* no subtitle: the cards sit where a subtitle would end */



.band { margin-top: var(--section); padding-block: 64px; background: var(--band); color: var(--on-band); }
.band h2 { color: var(--on-band-strong); }
.band .intro { color: var(--on-band-muted); }
.band a { color: var(--mint); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 48px; margin: 0; }
/* Trust band: the six facts on a review sheet, with a large grey shield behind its top-right corner. */
.band .intro { position: relative; z-index: 1; }
.band .sheet-wrap { position: relative; margin-top: 44px; }
.band .sheet-shield { position: absolute; z-index: 0; right: 36px; top: -166px; width: 240px; height: 240px; fill: none; stroke: var(--band-line); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.band .sheet { position: relative; z-index: 1; padding: 36px 40px; border: 1px solid var(--band-line); background: var(--sheet); }
.facts dt { margin-bottom: 6px; color: var(--ink); font: 600 18px var(--serif); }
.facts dd { margin: 0; color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 860px) { .band .sheet { padding: 28px 22px 26px; } .band .sheet-shield { display: none; } }

.visual { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.sec .visual .intro { margin-bottom: 12px; }
.visual .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.visual-steps .small { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-small); }

@media (max-width: 980px) {
  .hero > .wrap, .visual { grid-template-columns: 1fr; gap: 28px; }
  .facts { grid-template-columns: 1fr; gap: 28px; }
  .sec { padding-top: 48px; }
  .band { margin-top: 48px; }
}
@media (max-width: 520px) { .hero { padding-top: 40px; } }
/* Phones and tablets: each card grid is a run of cells divided by 1px hairlines (the grid's gaps over a
   line-coloured background), running edge to edge. Cells pad their content by the gutter, so text lines
   up with the page, and tint on hover. Laptops draw the same grids with borders, in their own block. */
@media (max-width: 1023px) {
  :is(.bento, .steps, .qs.cards, .fgrid, .sgrid, .views, .routes) { gap: 1px; margin-inline: calc(-1 * var(--gutter)); border-block: 1px solid var(--line); background: var(--line); }
  :is(.bento, .steps, .qs.cards, .fgrid, .sgrid, .views, .routes) > * { min-width: 0; border: 0; border-radius: 0; background: var(--paper); transition: background-color .15s ease; }
  :is(.bento, .steps, .qs.cards, .fgrid, .sgrid, .routes) > li:hover, .views > figure:hover { background: var(--paper-2); }
  .bento .qcard { padding: 22px var(--gutter); border: 0; background: transparent; }
  main .steps > li { min-height: 0; padding: 24px var(--gutter); }
  .qs.cards .la { padding: 20px var(--gutter) 0; }
  .qs.cards .la, .qs.cards > li:hover .la { background: transparent; }
  .qs.cards .txt { padding: 16px var(--gutter) 24px; }
  :is(.fcard, .scard) { border: 0; }
  :is(.fcard, .scard) .shot { padding: 20px var(--gutter) 0; border: 0; background: transparent; }
  :is(.fcard, .scard) .shot img { border: 1px solid var(--line); }
  :is(.fcard-txt, .scard-txt) { padding: 16px var(--gutter) 22px; }
  .views > figure { padding: 20px var(--gutter) 24px; }
  .routes li { padding: 22px var(--gutter); }
}

/* Home below laptop width: every section has the same space above and below its content, and the
   sections meet edge to edge (the laptop layout pads them evenly in its own block). */
@media (max-width: 1023px) {
  .home main > section { margin: 0; }
  .home main > .sec { padding-block: 48px; }
  .home .demo .fig { margin-bottom: 0; }
  .home .foot { margin-top: 0; }
}

/* Grid items may shrink below their content (long commands scroll inside their box). */
.hero > .wrap > *, .qs > li > *, .visual > *, .steps > li, .facts > div { min-width: 0; }

/* Article pages (problems, features, comparisons, posts) */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; padding-top: 28px; }
.article-main { min-width: 0; }
.crumbs { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); }
.article-main h1 { margin: 0 0 16px; font-size: var(--fs-h1); line-height: 1.08; }
.article-main .lede { margin: 0 0 16px; font-size: 20px; line-height: 1.55; max-width: 36em; }
.article-main .meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 32px; color: var(--muted); font-size: 14px; }
.article-main .fig { margin-bottom: 8px; }
.article-main h2 { margin: 48px 0 12px; font-size: var(--fs-h2-article); line-height: 1.2; }
.article-main .body p, .article-main .body li { max-width: 38em; }
.article-main .body ol, .article-main .body ul { padding-left: 22px; }
.article-main .body li { margin-bottom: 10px; padding-left: 4px; }
.article-main .body .cmd { margin: 10px 0 4px; max-width: 100%; }
.article-main .body code { color: var(--ink); }
.article-main sup a { text-decoration: none; font-size: 0.75em; }
.article-main .limits h2 { margin-top: 0; }
.article-side > * { min-width: 0; }
.article-side { position: sticky; top: 24px; align-self: start; display: grid; gap: 28px; padding-top: 8px; font-size: var(--fs-small); }
.article-side .try { padding: 14px; border: 1px solid var(--line); }
/* Room for the command in wider system monospace fonts (Linux, macOS) too. */
.article-side .cmd { gap: 8px; padding-left: 10px; }
.article-side .cmd .copy { padding: 0 8px; }
.article-side .try p { margin: 0 0 12px; }
.article-side .try .small { margin: 10px 0 0; }
.article-side .cmd code { font-size: 13.5px; }
.side-h { margin: 0 0 8px; color: var(--muted); font: 600 13.5px var(--sans); letter-spacing: 0; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.toc a, .article-side .related a { color: var(--ink-2); text-decoration: none; }
.toc a:hover, .article-side .related a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 980px) {
  .article { grid-template-columns: 1fr; gap: 40px; }
  .article-side { position: static; }
}

/* Hub lists (problems, features, compare) */
.hub { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.hub > li { padding: 22px 0; border-bottom: 1px solid var(--line); }
.hub h2 { margin: 0 0 6px; font-size: var(--fs-h3); line-height: 1.25; }
.hub h2 a { color: var(--ink); text-decoration: none; }
.hub h2 a:hover { text-decoration: underline; }
.hub p { margin: 0; max-width: 44em; }

/* Comparison tables */
.table-wrap { overflow-x: auto; margin: 16px 0 8px; border: 1px solid var(--line); }
.compare-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table thead th { background: var(--paper-2); color: var(--ink); font-weight: 600; }
.compare-table tbody th { color: var(--ink); font-weight: 600; width: 26%; }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }
.compare-table .src { font-size: 13.5px; white-space: nowrap; }

/* Changelog */
.changelog section { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 32px; }
.changelog .release + .release { margin-top: 20px; }
.changelog ul { padding-left: 22px; }
.changelog li { margin-bottom: 8px; max-width: 44em; }

/* Samples */
.sample-index ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 0; padding: 0; }
.sample { margin-top: 40px; }
.sample-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; }
.sample-head > * { min-width: 0; }
.sample .kicker { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.sample h1 { margin: 0 0 10px; }
.sample .lede { margin: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 16px 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 0; color: var(--ink); font: 600 20px var(--serif); }
.sample .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.found { padding: 20px 22px; background: var(--paper-2); }
.found h2 { margin: 0 0 10px; font-size: 19px; }
.found ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.found li { display: grid; gap: 4px; }
.found p { margin: 0; font-size: 15.5px; }
.ftag { color: var(--ink); font-size: 13px; font-weight: 600; }
.views-h { margin: 36px 0 16px; font-size: 20px; }
.views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
/* An odd last view (the wide exported-diagram pair) spans both columns, so no cell is left empty;
   its image runs the full width with the caption below. */
.views > figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
.views figcaption { margin-top: 10px; font-size: var(--fs-small); color: var(--ink-2); }
.views figcaption strong { color: var(--ink); }
@media (max-width: 860px) { .sample-head, .views { grid-template-columns: 1fr; gap: 24px; } }
.vsteps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 15.5px; }
.vsteps .cmd { margin-top: 8px; }
.vsteps > li { min-width: 0; }

/* Question cards (src/_data/questions.json): the question, a line drawing of the lineage it answers
   (lib/lineage-art.js), the answer and a community quote. The Problems page shows them as small cards
   without the quote (.qs.cards). */
.qs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.qs > li { border: 1px solid var(--line); background: var(--paper-2); padding: 26px 28px; }
.qs h2, .qs h3 { margin: 0 0 10px; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.18; }
.qs h2 a, .qs h3 a { color: var(--ink); text-decoration: none; }
.qs h2 a:hover, .qs h3 a:hover { text-decoration: underline; }
.qs .txt p { margin: 0; font-size: 15.5px; line-height: 1.55; }
.qs .la { display: block; width: 100%; height: auto; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.qs .la .la-mask { fill: var(--paper); }
.qs .quote { margin: 0; padding-left: 16px; border-left-width: 2px; }
.qs .quote p { font-size: 16px; line-height: 1.5; }
.qs .quote cite { font-size: 13px; }
/* Features page: a grid of cards, each a screenshot above the view's name and description. Two columns
   from 720px, the last card across both when the count is odd. The name's link covers the card. */
.fgrid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.prose .fgrid > li { max-width: none; }
.fcard { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); background: var(--paper-2); transition: background-color .15s ease; }
.fcard .shot { border-bottom: 1px solid var(--line); background: var(--paper); }
.fcard .shot img { display: block; width: 100%; height: auto; }
.fcard-txt { padding: 18px 22px 22px; }
.prose .fcard h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; }
.fcard h2 a { color: var(--ink); text-decoration: none; }
.fcard h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fcard h2 a:focus-visible { outline: none; }
.fcard:focus-within { outline: 2px solid var(--teal); outline-offset: -2px; }
.prose .fcard p { margin: 0; max-width: none; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
@media (min-width: 720px) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Home: the live problems' community quotes in a bento grid. The longest quote gets the tall cell,
   the first and the last question the wide ones. Each card is one link to its problem page. */
.bento { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 2.2vh, 20px); grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "a a b" "c d b" "e f f"; }
.bento > .b-a { grid-area: a; } .bento > .b-b { grid-area: b; } .bento > .b-c { grid-area: c; }
.bento > .b-d { grid-area: d; } .bento > .b-e { grid-area: e; } .bento > .b-f { grid-area: f; }
.qcard { display: flex; height: 100%; box-sizing: border-box; padding: clamp(14px, 2.6vh, 24px) clamp(18px, 2vw, 28px); border: 1px solid var(--line); background: var(--paper-2); color: inherit; text-decoration: none; transition: border-color .15s ease; }
.qcard:hover { border-color: var(--teal); }
.qcard .quote { display: flex; flex-direction: column; margin: 0; padding-left: 0; border-left: 0; }
/* Type follows the window's height as well as its width, so the grid fits one laptop screen. */
.qcard .quote p { margin: 0; font-size: clamp(14px, min(2.1vh, 1.3vw), 18px); line-height: 1.45; }
.qcard .quote cite { margin-top: auto; padding-top: clamp(8px, 1.4vh, 14px); font-size: clamp(12px, 1.6vh, 13.5px); }
.bento > :is(.b-a, .b-b) .quote p { font-size: clamp(16px, min(2.7vh, 1.7vw), 24px); line-height: 1.4; }
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "a a" "b c" "b d" "e f"; }
}
@media (min-width: 1024px) and (min-height: 640px) and (max-height: 819px) {
  .home main > section[aria-labelledby="qs-h"] { padding-block: 32px; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "c" "d" "e" "f"; }
  .qcard .quote p, .bento > :is(.b-a, .b-b) .quote p { font-size: 17px; }
  .qcard { padding: 22px 22px; }
}
/* Problems page: a grid of cards, each the drawing across the top, a divider, then the question and
   its answer. Three across
   on laptops, two on tablets, one on phones. */
.qs.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none; margin-top: 32px; }
.qs.cards > li { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
/* The question's link covers the whole card, so the drawing opens the page too. */
.qs.cards h2 a::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.qs.cards h2 a:focus-visible { outline: none; }
.qs.cards > li:focus-within { outline: 2px solid var(--teal); outline-offset: -2px; }
.qs.cards .la { order: -1; aspect-ratio: 3 / 2; padding: 22px; border: 0; border-radius: 0; }
.qs.cards .txt { padding: 22px 28px 28px; }
.qs.cards h2, .prose .qs.cards h2 { font-size: 23px; line-height: 1.22; }
@media (max-width: 1000px) { .qs.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .qs.cards { grid-template-columns: minmax(0, 1fr); } }
.prose .qs > li, .prose .qs p { max-width: none; }
.prose .qs h2 { margin: 0 0 10px; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.18; }
.prose .lede.wide { max-width: none; }
/* Setup steps: three numbered steps, the last two with their command. */
.steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps > li { position: relative; z-index: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 240px; padding: 28px; border: 1px solid var(--line); background: var(--paper-2); }
.steps h3, .steps p, .steps .cmd { position: relative; }
.steps h3 { margin: 0 0 8px; font-size: 20px; }
.steps p { margin: 0 0 16px; font-size: 15.5px; }
.steps .cmd { margin-top: auto; background: var(--paper); }
@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .steps > li { min-height: 0; }
}

/* Demo: the Lineage figure in its own band, set apart from the hero. */
.demo { padding-block: 56px; background: var(--paper-2); border-block: 1px solid var(--line); }
.tour { background: var(--paper-2); } /* the same band as the demo */
.demo .fig .shot { background: var(--paper); border-radius: 0; }
.demo h2 { margin: 0 0 24px; font-size: var(--fs-h2); line-height: 1.15; }
.demo .wrap > * { max-width: 880px; margin-inline: auto; }
.demo + .sec { margin-top: 0; }

/* Samples page: a bento grid. One big card beside two small ones, then mirrored. The heading link
   covers the whole card, so the card is one click target and one link for screen readers. */
.sgrid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  grid-template-areas: "b1 b1 s1" "b1 b1 s2" "s3 b2 b2" "s4 b2 b2"; }
.scard { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.scard:hover { border-color: var(--ink-2); }
.sgrid .a-b1 { grid-area: b1; } .sgrid .a-b2 { grid-area: b2; } .sgrid .a-s1 { grid-area: s1; } .sgrid .a-s2 { grid-area: s2; } .sgrid .a-s3 { grid-area: s3; } .sgrid .a-s4 { grid-area: s4; }
.scard .shot { border-bottom: 1px solid var(--line); background: var(--paper); }
.scard .shot img { display: block; width: 100%; height: auto; }
.scard.small .shot { max-height: 150px; overflow: hidden; }
.scard-txt { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 20px; }
.prose .scard h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.scard.big h2 { font-size: 28px; }
.scard h2 a { color: var(--ink); text-decoration: none; }
.scard h2 a::after { content: ""; position: absolute; inset: 0; }
.scard h2 a:focus-visible { outline: none; }
.scard:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.prose .scard p { margin: 0; max-width: none; font-size: 15px; }
.prose .sgrid > li { max-width: none; }
@media (max-width: 900px) {
  .sgrid { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .sgrid > li[class] { grid-area: auto; }
  .scard.small .shot { max-height: none; }
}

/* Home on laptops and desktops: the hero, demo and questions fill the screen; setup, trust and the
   embed section are as tall as their content. Scrolling snaps from one section to the next. A
   section taller than the screen still scrolls through before the next snap. Phones, small
   windows and short screens scroll freely. */
@media (min-width: 1024px) and (min-height: 640px) {
  html:has(body.home) { scroll-snap-type: y mandatory; }
  .home main > section { display: flex; flex-direction: column; justify-content: center; margin: 0; padding-block: 56px; scroll-snap-align: start; }
  .home main > section > .wrap { width: 100%; }
  .home main > :is(.demo, .sec):not(.fit) { min-height: 100vh; }
  .home main > .hero { min-height: calc(100vh - 65px); scroll-snap-align: none; } /* the header above it is the snap point, so it stays in view */
  .home .foot { margin-top: 0; scroll-snap-align: end; }
  .home .top { scroll-snap-align: start; }
}
@media (min-width: 1024px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) {
  html:has(body.home) { scroll-behavior: smooth; }
}

/* Home on laptops: a hairline frame. Lines at the outer edge of the content column through every
   section, a line between sections, and a small plus where they cross. */
@media (min-width: 1024px) {
  .home main > section { position: relative; }
  .home main > .sec { border-top: 1px solid var(--line); }
  .home main > section > .wrap { position: relative; z-index: 1; }
  .home main > section::before { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: max(0px, (100% - var(--wrap)) / 2); right: max(0px, (100% - var(--wrap)) / 2); border-inline: 1px solid var(--line); pointer-events: none; }
  .home main > .band::before { border-color: var(--band-line); }
  .home main > section:not(.hero)::after { content: ""; position: absolute; z-index: 2; top: -6px; height: 11px; left: calc(max(0px, (100% - var(--wrap)) / 2) - 5px); right: calc(max(0px, (100% - var(--wrap)) / 2) - 5px); background: var(--plus) left center / 11px 11px no-repeat, var(--plus) right center / 11px 11px no-repeat; pointer-events: none; }
  /* The hero's own lines: one down the middle of the column gap for the section's full height, and a
     strip around the install row from the frame to that line (1200px and up), with the command box and
     the button as its cells. A plus marks where the strip meets a cell's edge. The gap is 56px, so its middle is 28px in. */
  .home main > .hero { padding-block: 0; }
  /* Two equal columns; the right one, from the centre line to the frame, takes the answer card's colour.
     Placed in grid column 2 with no end line, the line's box runs to the wrap's padding edge, which is
     the frame; 1px in leaves the frame line showing. */
  .home main > .hero > .wrap { flex: 1 0 auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-block: 56px; align-content: center; align-items: center; }
  .home main > .hero > .wrap::after { content: ""; position: absolute; z-index: -1; grid-column: 2; top: 0; bottom: 0; left: -28px; right: 1px; border-left: 1px solid var(--line); background: var(--paper-2); pointer-events: none; }
  .home .hero .answer { border: 0; border-radius: 0; background: transparent; }
}
/* Home demo on laptops: the captions sit in a hairline strip under the video, running from frame to
   frame, with a divider at each caption's edge that continues the video's sides, and a plus where a
   divider meets the strip (none at the frame). The demo's wrap is a size container, so 100cqw is its content width: the strip reaches
   the frame by half the leftover width plus the gutter. */
@media (min-width: 1024px) {
  .home .demo > .wrap { container-type: inline-size; }
  .home .demo .fig .shot { border-bottom: 0; }
  .home .demo .fig figcaption { margin-top: 0; }
  .home .demo .fig figcaption ol { position: relative; gap: 0; margin: 0; }
  .home .demo .fig figcaption ol::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc((100% - 100cqw) / 2 - var(--gutter)); right: calc((100% - 100cqw) / 2 - var(--gutter)); border-block: 1px solid var(--line); pointer-events: none; }
  .home .demo .fig figcaption li { position: relative; padding: 16px 18px; border-left: 1px solid var(--line); }
  .home .demo .fig figcaption li:last-child { border-right: 1px solid var(--line); }
  .home .demo .fig figcaption li::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -5px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .demo .fig figcaption li:last-child::after { background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; }
}
/* Home bento on laptops: the cards become cells of a hairline grid that reaches the frame on both
   sides. Each cell draws its right and bottom lines (the frame stands in at the outer edges), and a
   plus where its lines meet another cell's (none at the frame); the left column's quotes line up with
   the heading. */
@media (min-width: 1024px) {
  .home .bento { gap: 0; margin-inline: calc(-1 * var(--gutter)); border-top: 1px solid var(--line); }
  .home .bento > li { position: relative; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .home .bento > :is(.b-b, .b-f) { border-right: 0; }
  .home .bento > :is(.b-b, .b-d, .b-f)::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -6px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .bento > .b-d::after { background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat; }
  .home .bento .qcard { padding: clamp(14px, 2.6vh, 26px) clamp(18px, 2.2vw, 30px); border: 0; border-radius: 0; background: transparent; transition: background-color .15s ease; }
  .home .bento .qcard:hover { background: var(--paper-2); }
  .home .bento .qcard:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
  .home .bento > :is(.b-a, .b-c, .b-e) .qcard { padding-left: var(--gutter); }
  .home .bento > :is(.b-b, .b-f) .qcard { padding-right: var(--gutter); }
}
/* Home setup on laptops: the three steps sit in a hairline strip from frame to frame, with a divider
   between them. A plus marks each of the four places a divider meets a line; the ::after box runs from
   the first divider to the second, so its corners are those joins (the steps are equal thirds). */
@media (min-width: 1024px) {
  .home .steps { gap: 0; }
  .home .steps::before { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); border-block: 1px solid var(--line); pointer-events: none; }
  .home .steps::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -5px; left: calc(100% / 3 - 5px); width: calc(100% / 3 + 11px); background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .steps > li { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .home .steps > li + li, .home .steps > li:first-child { border-left: 1px solid var(--line); }
  .home .steps > li:last-child { border-right: 1px solid var(--line); }
  /* Plus marks at the strip's two top corners. */
  .home .steps > li:first-child::after { content: ""; position: absolute; z-index: 2; top: -5px; left: -6px; width: 11px; height: 11px; background: var(--plus) center / 11px 11px no-repeat; pointer-events: none; }
  .home .steps > li:last-child::after { content: ""; position: absolute; z-index: 2; top: -5px; right: -6px; width: 11px; height: 11px; background: var(--plus) center / 11px 11px no-repeat; pointer-events: none; }
  /* The two commands are cells of their own strip: lines above and below from the first divider to the
     frame (each line reaches its step's edges, 28px out), with a plus at each command's corners. */
  .home .steps .cmd { position: relative; min-height: 0; padding: 10px 10px 10px 16px; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: transparent; }
  .home .steps .cmd::before { content: ""; position: absolute; top: 0; bottom: 0; left: -29px; right: -29px; border-block: 1px solid var(--line); pointer-events: none; }
  .home .steps > li:last-child .cmd::before { right: calc(-29px - var(--gutter)); }
  .home .steps .cmd::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -6px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; pointer-events: none; }
  /* The last command's box reaches the strip's right edge (28px padding + 1px border out), so it also
     marks where that edge crosses the command strip's lines. */
  .home .steps > li:last-child .cmd::after { right: -34px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right 29px top / 11px 11px no-repeat, var(--plus) right 29px bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; }
}
/* Home trust band on laptops: the six facts sit in a hairline grid. The lines above and below run from
   frame to frame; the sheet's edges, the column dividers and the line between the rows stay inside it.
   Plus marks: the sheet's four corners (on .facts) and where the two dividers meet each line (on the
   cells of columns 2 and 3). The sheet keeps the band's colour, so the shield peeks over its top only. */
@media (min-width: 1024px) {
  .home .band .sheet { padding: 0; border: 0; border-radius: 0; background: var(--band); }
  .home .band .sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); border-block: 1px solid var(--band-line); pointer-events: none; }
  .home .band .facts { position: relative; gap: 0; border-inline: 1px solid var(--band-line); }
  .home .band .facts::after { content: ""; position: absolute; z-index: 2; top: -5px; bottom: -5px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .band .facts > div { position: relative; padding: 28px 32px; border-left: 0; }
  .home .band .facts dt { color: var(--on-band-strong); }
  .home .band .facts dd { color: var(--on-band-muted); }
  .home .band .facts > div:nth-child(3n + 2), .home .band .facts > div:nth-child(3n) { border-left: 1px solid var(--band-line); }
  .home .band .facts > div:nth-child(-n + 3) { border-bottom: 1px solid var(--band-line); }
  .home .band .facts > div:nth-child(2)::after, .home .band .facts > div:nth-child(3)::after { content: ""; position: absolute; z-index: 2; top: -5px; bottom: -5px; left: -6px; width: 11px; background: var(--plus) center top / 11px 11px no-repeat, var(--plus) center bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .band .facts > div:nth-child(1)::after { content: ""; position: absolute; z-index: 2; bottom: -5px; left: -6px; width: 11px; height: 11px; background: var(--plus) center / 11px 11px no-repeat; pointer-events: none; }
  .home .band .facts > div:nth-child(3)::before { content: ""; position: absolute; z-index: 2; bottom: -5px; right: -6px; width: 11px; height: 11px; background: var(--plus) center / 11px 11px no-repeat; pointer-events: none; }
  .home .band .facts > div:nth-child(5)::after, .home .band .facts > div:nth-child(6)::after { content: ""; position: absolute; z-index: 2; bottom: -5px; left: -6px; width: 11px; height: 11px; background: var(--plus) center / 11px 11px no-repeat; pointer-events: none; }
}
/* Home embed section on laptops: a line down the middle of the 48px column gap for the section's full
   height; the buttons sit in a strip from the frame to that line, the command in one from that line to
   the frame (it starts 20px into its list), each with a plus at its cells' corners. */
@media (min-width: 1024px) {
  .home main > #visual { padding-block: 0; }
  .home main > #visual > .wrap { flex: 1 0 auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-block: 56px; }
  .home main > #visual > .wrap::after { content: ""; position: absolute; grid-column: 2; top: 0; bottom: 0; left: -24px; border-left: 1px solid var(--line); pointer-events: none; }
  .home .visual .actions { position: relative; gap: 0; flex-wrap: nowrap; }
  .home .visual .actions::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: -24px; border-block: 1px solid var(--line); pointer-events: none; }
  .home .visual .actions .btn { position: relative; border: 0; border-right: 1px solid var(--line); border-radius: 0; }
  .home .visual .actions .btn:first-child { border-left: 1px solid var(--line); }
  .home .visual .actions .btn::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -6px; right: -6px; width: 11px; background: var(--plus) center top / 11px 11px no-repeat, var(--plus) center bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .visual .actions .btn:first-child::after { left: -6px; width: auto; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; }
  .home .visual .cmd { position: relative; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: transparent; }
  .home .visual .cmd::before { content: ""; position: absolute; top: 0; bottom: 0; left: -45px; right: calc(-1 * var(--gutter)); border-block: 1px solid var(--line); pointer-events: none; }
  .home .visual .cmd::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -6px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; pointer-events: none; }
}
/* The install strip needs the room of a 1200px window; below that the command and button keep their boxes. */
@media (min-width: 1200px) {
  .home .hero .install { position: relative; gap: 0; align-items: stretch; flex-wrap: nowrap; }
  .home .hero .install::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: -28px; border-block: 1px solid var(--line); pointer-events: none; }
  .home .hero .install .cmd { position: relative; gap: 8px; min-height: 0; padding: 12px 10px 12px 12px; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: transparent; }
  /* Both commands fit, uv's longer one too, in wider system monospace fonts (Linux, macOS). */
  .home .hero .install .cmd code { font-size: 14px; }
  .home .hero .install .cmd .copy { padding: 0 8px; }
  .home .hero .install .cmd::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -5px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; pointer-events: none; }
  .home .hero .install .btn { position: relative; height: auto; padding-inline: 16px; border: 0; border-right: 1px solid var(--line); border-radius: 0; }
  .home .hero .install .btn:hover { background: var(--paper-2); }
  .home .hero .install .btn::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -5px; right: -6px; width: 11px; background: var(--plus) center top / 11px 11px no-repeat, var(--plus) center bottom / 11px 11px no-repeat; pointer-events: none; }
}

/* Home features tour. Phones, small windows and pages without the script: a list, each view's
   screenshot under its text. Laptops: the list on the left and one screenshot on the right; the
   section is one screen tall per view and site.js highlights the view whose step is on screen. */
.tour-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 40px; }
.tour-list h3 { margin: 0 0 6px; font-size: var(--fs-h3); }
.tour-list h3 a { color: inherit; text-decoration: none; }
.tour-list h3 a:hover { text-decoration: underline; }
.tour-list p { margin: 0; color: var(--ink-2); }
.tour-shot { margin-top: 16px; }
.tour-shot img, .tour-view img { display: block; width: 100%; height: auto; }
.tour-shot img { border: 1px solid var(--line); }
.tour-view, .tour-marks { display: none; }
/* Screenshots in pairs: the light one in the light theme, the dark one in the dark theme, by the
   system setting or the theme button. The hidden one is never downloaded (loading="lazy"). */
:root img.th-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img.th-light { display: none; }
  :root:not([data-theme="light"]) img.th-dark { display: block; }
}
:root[data-theme="dark"] img.th-light { display: none; }
:root[data-theme="dark"] img.th-dark { display: block; }

@media (min-width: 1024px) and (min-height: 640px) {
  .home main > .tour.live { display: block; box-sizing: content-box; height: calc(var(--tour-steps, 5) * 100vh); min-height: 0; padding: 0; scroll-snap-align: none; }
  /* The heading, then the screenshot centred and as large as the screen height allows, then the five
     views in one row with the teal line along the top of the selected one. The panel starts at a
     fixed distance from the top, so it does not shift when the selected view's text changes height. */
  .tour.live { --tour-chrome: 360px; }
  .tour.live .tour-stick { position: sticky; top: 0; height: 100vh; padding-top: 7vh; }
  .tour.live .tour-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "view" "side"; }
  .tour.live .tour-grid > h2 { grid-area: h; margin-bottom: 32px; }
  .tour.live .tour-side { grid-area: side; margin-top: 0; }
  .tour.live .tour-view { border-bottom: 0; }
  /* The selected view takes 40% of the row and shows its text; the other four take 15% and show their name. */
  /* The row is a hairline strip right under the screenshot: lines above and below from frame to frame,
     a divider at each view's edge, and a plus where a divider meets a line (none at the frame). */
  .tour.live .tour-list { position: relative; display: flex; gap: 0; margin-top: 0; }
  .tour.live .tour-list::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); border-block: 1px solid var(--line); pointer-events: none; }
  .tour.live .tour-list > li { position: relative; flex: 0 0 15%; min-width: 0; box-sizing: border-box; padding: 14px 18px 16px; border-left: 1px solid var(--line); cursor: pointer; }
  .tour.live .tour-list > li:last-child { border-right: 1px solid var(--line); }
  .tour.live .tour-list > li::after { content: ""; position: absolute; z-index: 2; top: -6px; bottom: -5px; left: -6px; right: -6px; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; pointer-events: none; }
  .tour.live .tour-list > li:last-child::after { background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat, var(--plus) right top / 11px 11px no-repeat, var(--plus) right bottom / 11px 11px no-repeat; }
  .tour.live .tour-list > li.on { flex-basis: 40%; }
  .tour.live .tour-list > li:not(.on) p { display: none; }
  .tour.live .tour-list > li::before { content: ""; position: absolute; z-index: 1; left: -1px; right: 0; top: 0; height: 2px; }
  .tour.live .tour-list > li.on::before { background: var(--teal); }
  .tour.live .tour-list h3 { margin-bottom: 4px; color: var(--muted); font-size: 20px; font-weight: 500; }
  .tour.live .tour-list p { color: var(--muted); font-size: 15px; line-height: 1.5; }
  .tour.live .tour-list > li.on h3 { color: var(--ink); font-weight: 600; }
  .tour.live .tour-list > li.on p { color: var(--ink-2); }
  .tour.live .tour-shot { display: none; }
  .tour.live .tour-view { grid-area: view; justify-self: center; width: min(100%, calc((100vh - var(--tour-chrome)) * 16 / 9)); display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: var(--paper); }
  .tour.live .tour-view > .tour-pic { position: absolute; inset: 0; opacity: 0; }
  .tour.live .tour-view > .tour-pic.on { opacity: 1; }
  .tour.live .tour-view img { height: 100%; object-fit: cover; object-position: center top; }
  .tour.live .tour-marks { display: grid; grid-auto-rows: 100vh; position: absolute; inset: 0; pointer-events: none; }
  .tour.live .tour-marks > div { scroll-snap-align: start; }
}
/* Shorter laptop screens: tighter type. */
@media (min-width: 1024px) and (min-height: 640px) and (max-height: 819px) {
  .tour.live { --tour-chrome: 310px; }
  .tour.live .tour-stick { padding-top: 5vh; }
  .tour.live .tour-list > li { padding-block: 10px 12px; }
  .tour.live .tour-list h3 { margin-bottom: 2px; font-size: 17px; }
  .tour.live .tour-list p { font-size: 14px; line-height: 1.45; }
}
@media (min-width: 1024px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) {
  .tour.live .tour-view > .tour-pic { transition: opacity .3s ease; }
  .tour.live .tour-list h3 { transition: color .2s ease; }
  .tour.live .tour-list > li { transition: flex-basis .4s ease; }
  .tour.live .tour-list > li.on p { animation: tour-text-in .4s ease both; }
}
@keyframes tour-text-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------------------------------------
   The home page's hairline pattern on the other pages (the frame, square corners and the route
   cells are in components.css, which every page loads). Laptops: lists and grids become cells
   divided by hairlines that reach the frame, and a plus marks each place two lines meet inside the
   frame (none on the frame itself). Every cell pads both sides by the gutter, so the outer ones line
   up with the page heading. */

@media (min-width: 1024px) {

  /* Articles and feature pages: a line down the middle of the gap between the text and the side column. */
  .wrap.article::after { content: ""; position: absolute; top: 0; bottom: 0; right: calc(var(--gutter) + 312px); border-left: 1px solid var(--line); pointer-events: none; }
  .wrap.article { position: relative; }

  /* Lists of rows: blog, hub pages, changelog. */
  .prose .hub { margin-inline: calc(-1 * var(--gutter)); }
  .prose .hub > li { padding-inline: var(--gutter); }
  .changelog { margin-inline: calc(-1 * var(--gutter)); }
  .changelog section { padding-inline: var(--gutter); }

  /* Features: two columns of cells. Screenshots sit inside their cell, lined up with the text below;
     every cell pads both sides by the gutter, so the outer ones line up with the page heading. */
  .fgrid { gap: 0; margin-inline: calc(-1 * var(--gutter)); border-top: 1px solid var(--line); }
  .fcard { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
  .fcard:hover { background: var(--paper-2); }
  .fgrid > li:nth-child(odd) { border-left: 1px solid var(--line); } /* over the hover tint, where the frame line runs */
  .fcard .shot { padding: 24px var(--gutter) 0; border-bottom: 0; background: transparent; }
  .fcard .shot img { border: 1px solid var(--line); }
  .fcard-txt { padding: 18px var(--gutter) 28px; }
  .fgrid > li:nth-child(even)::before { content: ""; position: absolute; z-index: 2; pointer-events: none; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; top: -6px; bottom: -6px; left: -6px; width: 11px; }

  /* Problems: three columns of cells. */
  .qs.cards { gap: 0; margin-inline: calc(-1 * var(--gutter)); border-top: 1px solid var(--line); }
  .qs.cards > li { position: relative; overflow: visible; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
  .qs.cards > li:nth-child(3n + 1) { border-left: 1px solid var(--line); } /* over the drawing's background, where the frame line runs */
  .qs.cards > li { transition: background-color .15s ease; }
  .qs.cards > li:hover, .qs.cards > li:hover .la { background: var(--paper-2); }
  .qs.cards > li:hover .la .la-mask { fill: var(--paper-2); }
  .qs.cards .txt { padding-inline: var(--gutter); }
  .qs.cards > li:not(:nth-child(3n + 1))::after { content: ""; position: absolute; z-index: 2; pointer-events: none; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; top: -6px; bottom: -6px; left: -6px; width: 11px; }

  /* Samples: the bento as cells. Areas: "b1 b1 s1" "b1 b1 s2" "s3 b2 b2" "s4 b2 b2". */
  .sgrid { gap: 0; margin-inline: calc(-1 * var(--gutter)); border-top: 1px solid var(--line); }
  .scard { overflow: visible; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; transition: background-color .15s ease; }
  .scard:hover { border-color: var(--line); background: var(--paper-2); }
  /* Each screenshot sits inside its cell, with space above and beside it that matches the text below. */
  .scard .shot { overflow: hidden; padding: 24px var(--gutter) 0; border-bottom: 0; background: transparent; }
  .scard-txt { padding-inline: var(--gutter); }
  .scard .shot img { border: 1px solid var(--line); }
  .sgrid > :is(.a-b1, .a-s3, .a-s4) { border-left: 1px solid var(--line); } /* over the screenshots, where the frame line runs */
  .sgrid > :is(.a-s1, .a-s2, .a-b2)::before { content: ""; position: absolute; z-index: 2; pointer-events: none; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; top: -6px; bottom: -6px; left: -6px; width: 11px; }
  .sgrid > .a-s3::before { content: ""; position: absolute; z-index: 2; pointer-events: none; background: var(--plus) center / 11px 11px no-repeat; bottom: -6px; right: -6px; width: 11px; height: 11px; }

  /* A sample's views: two columns of figures. */
  .views { gap: 0; margin-inline: calc(-1 * var(--gutter)); border-top: 1px solid var(--line); }
  .views > figure { position: relative; padding: 24px 24px 28px; border-bottom: 1px solid var(--line); }
  .views > figure:nth-child(odd) { padding-left: var(--gutter); }
  .views > figure:nth-child(even) { padding-right: var(--gutter); border-left: 1px solid var(--line); }
  .views > figure:last-child:nth-child(odd) { padding-right: var(--gutter); }
  .views > figure:nth-child(even)::after { content: ""; position: absolute; z-index: 2; pointer-events: none; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; top: -6px; bottom: -6px; left: -6px; width: 11px; }


}
