/* owlgit base: the reset, the type, links and focus, the page grid at three sizes, the components every page is
   made of (card, list row, chip, button, field, section head, divider, footer), the filter panel that
   js/filters.js draws, the series row, the item page head, and the rule for less motion.
   Every value comes from css/tokens.css. Phone below 48rem, tablet 48rem to 79.9375rem, desktop 80rem and up. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-4);
  scrollbar-gutter: stable;   /* the scrollbar's room kept on every page, one that scrolls or not, so nothing moves sideways between them */
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  font-optical-sizing: auto;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-theme) var(--ease), color var(--dur-theme) var(--ease);
}
main { flex: 1 0 auto; display: block; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, picture, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
::selection { background: var(--current-bg); color: var(--current-fg); }

/* ---------- Type: the headings and the figures in the display face, the rest in the interface face ---------- */
.t-display, h1, .t-h1, h2, .t-h2, h3, .t-h3, .figure { font-family: var(--font-display); font-optical-sizing: auto; }
.t-display, h1, .t-h1, h2, .t-h2, h3, .t-h3 { color: var(--text); text-wrap: balance; }
/* the line under a page's title (a collection's, a list's, a series', a post's): even lines when it wraps, never a short tail */
.collection-lead, .list-lead, .series-lead, .item-line { text-wrap: balance; }
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
h1, .t-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-h1); letter-spacing: var(--ls-h1); }
h2, .t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-h2); letter-spacing: var(--ls-h2); }
h3, .t-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-h3); letter-spacing: var(--ls-h3); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-body); }
small, .t-small { font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-small); }
.t-caption { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-caption); letter-spacing: var(--ls-caption); }
.t-muted { color: var(--text-muted); }
code, kbd, samp, pre, .t-code { font-family: var(--font-code); font-size: var(--fs-code); line-height: var(--lh-code); font-weight: var(--fw-code); }
pre { overflow-x: auto; }
.num { font-variant-numeric: tabular-nums; }

/* Arabic: its own face, its own weights, never letter-spaced (spacing breaks the joins); a heading in Arabic too */
:lang(ar), [dir="rtl"], :is(h1, h2, h3):lang(ar), :is(h1, h2, h3) [lang="ar"] { font-family: var(--font-ar); letter-spacing: 0; }
:is(.t-display, h1, .t-h1, h2, .t-h2, h3, .t-h3):is(:lang(ar), [dir="rtl"]),
:is(.t-display, h1, .t-h1, h2, .t-h2, h3, .t-h3) :is(:lang(ar), [dir="rtl"]) { font-weight: 600; }
.t-caption:lang(ar) { font-weight: var(--fw-caption-ar); }
[dir="rtl"] { text-align: start; }

/* measures */
.measure { max-width: var(--measure-long); }
.measure-lead { max-width: var(--measure-lead); }
.measure-title { max-width: var(--measure-title); }

/* ---------- Links and focus ---------- */
a {
  color: var(--link);
  text-decoration-line: none;
  text-decoration-thickness: var(--hairline-w);
  text-underline-offset: 0.125rem;
  transition: color var(--dur-hover) var(--ease), background-color var(--dur-hover) var(--ease);
}
a:hover { text-decoration-line: underline; }
a:active { color: var(--current-fg); }
.prose a { text-decoration-line: underline; }
:focus-visible {
  outline: 0.125rem solid var(--focus-ring);
  outline-offset: 0.125rem;
  transition: outline-color var(--dur-focus) var(--ease);
}
:focus:not(:focus-visible) { outline: none; }

/* hidden from the eye, kept for screen readers */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
/* the first stop for the keyboard: straight to the page's content */
.skip {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-button);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; color: var(--on-primary); text-decoration: none; }

/* ---------- Icons: one Lucide sprite in the header, 1.75px strokes at every size ---------- */
.i {
  flex: none;
  width: var(--icon-20);
  height: var(--icon-20);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--stroke-20);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i-24 { width: var(--icon-24); height: var(--icon-24); stroke-width: var(--stroke-24); }
.i-18 { width: var(--icon-18); height: var(--icon-18); stroke-width: var(--stroke-18); }
.i-16 { width: var(--icon-16); height: var(--icon-16); stroke-width: var(--stroke-16); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* the mark: the logo's own two blues, recoloured by the theme through --logo-1 and --logo-2 */
.mark { display: block; flex: none; width: auto; height: 2rem; aspect-ratio: 934 / 823; }
/* the lockup: the mark with the site's name in the logo's own lettering, recoloured the same way */
.lockup { display: block; flex: none; width: auto; height: 2rem; aspect-ratio: 1797 / 481; }

/* ---------- The page grid ---------- */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}
main.page { padding-block: var(--section-gap); }
.grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: var(--gutter);
}
.span-full { grid-column: 1 / -1; }
.section + .section { margin-top: var(--section-gap); }
/* the cards of a list: three a row on a desktop, two on a tablet, one on a phone */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
@media (max-width: 79.9375rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 47.9375rem) { .cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Card: one item (a content card: the raised colour, a border, the soft shadow) ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 11rem;
  padding: var(--space-4);
  background: var(--surface-raised);
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  transition: background-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease), border-color var(--dur-theme) var(--ease);
}
/* the picture on a 16:9 stage, whole, never cropped */
.card-media { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-image); background: var(--surface); }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-title { font-size: 1.125rem; line-height: 1.5rem; font-weight: 650; letter-spacing: var(--ls-h3); color: var(--link); }
.card-title a { color: inherit; text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card answers */
.card-title a:focus-visible { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.card-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 0.8125rem; line-height: 1.125rem; font-weight: var(--fw-small); color: var(--text-muted); }
.card-ar { margin-left: var(--space-2); font-size: var(--fs-small); font-weight: 600; color: var(--text); }
.card-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.card-chips .chip { max-width: 100%; height: auto; min-height: 1.75rem; padding-block: 0.3125rem; white-space: normal; overflow-wrap: anywhere; }   /* a long chip wraps in its card, never wider than it (a game's practice: its topic, Bakr, 2026-11-07) */
.card-date { margin-top: auto; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-caption); letter-spacing: var(--ls-caption); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.card:hover { box-shadow: var(--shadow-2); }
.card:active { background: var(--current-bg); box-shadow: var(--shadow-1); transition-duration: var(--dur-active); }
/* a compact card (the related things on an item's page): a small picture or the category's icon, then the words */
.card-compact { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); column-gap: var(--space-3); align-items: start; min-height: 0; padding: var(--space-3); }
.card-compact:has(.card-thumb-icon) { grid-template-columns: 1.5rem minmax(0, 1fr); }
.card-thumb { display: grid; place-items: center; width: 5.5rem; height: 3.5rem; overflow: hidden; border-radius: var(--r-row); background: var(--surface); box-shadow: inset 0 0 0 var(--hairline-w) var(--hairline); }
.card-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.card-thumb-icon { width: 1.5rem; height: 1.5rem; margin-top: 0.125rem; background: none; box-shadow: none; color: var(--text-muted); }
.card-body { display: grid; gap: var(--space-1); min-width: 0; }
.card-compact .card-title { font-size: 0.9375rem; line-height: 1.25rem; }
.card-compact .card-line { -webkit-line-clamp: 1; line-clamp: 1; }
@media (max-width: 47.9375rem) { .card { min-height: 10.5rem; padding: var(--space-3); } .card-media { border-radius: var(--r-row); } }
/* the courses' cards (Bakr, 2026-11-06), on a category's list and on the home: the route's icon small where a card
   has no picture, the facts computed from its lessons in a line */
.courses-cards .card { min-height: 0; }
.courses-cards .card-media-icon { place-items: center; width: 2.75rem; height: 2.75rem; aspect-ratio: auto; border-radius: var(--r-image); box-shadow: inset 0 0 0 var(--hairline-w) var(--hairline); color: var(--link); }
.courses-cards .card-media-icon .i { width: 1.375rem; height: 1.375rem; }
.courses-cards .card-facts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; }

/* ---------- List row ---------- */
.list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-row);
  transition: background-color var(--dur-hover) var(--ease);
}
.list-row-main { display: grid; gap: var(--space-1); min-width: 0; }
.list-row-title { font-size: var(--fs-body); line-height: 1.5rem; font-weight: 600; color: var(--link); }
.list-row-title a { color: inherit; text-decoration: none; }
.list-row-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.list-row-title a:focus-visible { outline: none; }
.list-row:has(.list-row-title a:focus-visible) { outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.list-row-line { font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-small); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.list-row-date { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-caption); letter-spacing: var(--ls-caption); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-row:hover { background: var(--surface); }
.list-row:active { background: var(--current-bg); transition-duration: var(--dur-active); }
@media (max-width: 47.9375rem) { .list-row { min-height: 5rem; padding-inline: var(--space-3); } }

/* ---------- Chip: a label, a filter value ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.75rem;
  padding-inline: 0.625rem;
  border: 0;
  border-radius: var(--r-chip);
  background: var(--surface);
  box-shadow: inset 0 0 0 var(--hairline-w) var(--hairline);   /* a chip stays visible on a surface of its own colour */
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
a.chip:hover, button.chip:hover { background: var(--surface-raised); color: var(--link); text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current], .chip.is-selected { background: var(--current-bg); color: var(--current-fg); }
.chip:active { transition-duration: var(--dur-active); }
.chip.is-plain { background: transparent; }   /* a tag with no page of its own yet (rules.limits.tagPagesFrom): words, not a way */

/* status: its colour on the words and a 6px dot, never a coloured background */
.status { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; }
.status::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: currentColor; }
.status-live { color: var(--status-live); }
.status-beta { color: var(--status-beta); }
.status-progress { color: var(--status-progress); }
.status-archived { color: var(--status-archived); }

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 2.75rem;
  padding-inline: var(--space-4);
  border: var(--hairline-w) solid transparent;
  border-radius: var(--r-button);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transition-duration: var(--dur-active); }
.btn .i { width: var(--icon-18); height: var(--icon-18); stroke-width: var(--stroke-18); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-active); color: var(--on-primary); }
.btn-secondary, .btn-icon { background: var(--surface-raised); border-color: var(--hairline); color: var(--text); }
.btn-secondary:hover, .btn-icon:hover { background: var(--surface); color: var(--text); }
.btn-secondary:active, .btn-icon:active, .btn-icon[aria-pressed="true"] { background: var(--current-bg); color: var(--text); }
.btn-icon { width: 2.75rem; padding: 0; }
.btn-icon .i { width: var(--icon-20); height: var(--icon-20); stroke-width: var(--stroke-20); }
.btn-text { height: 2rem; padding-inline: var(--space-2); border: 0; border-radius: var(--r-row); background: none; color: var(--link); font-size: 0.8125rem; line-height: 1.125rem; font-weight: 600; }
.btn-text:hover { background: var(--surface-raised); color: var(--link); }

/* ---------- Field: search, select ---------- */
.field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 2.75rem;
  padding-inline: var(--space-3);
  background: var(--surface-raised);
  border: var(--line);
  border-radius: var(--r-field);
  color: var(--text-muted);
  transition: border-color var(--dur-hover) var(--ease), background-color var(--dur-theme) var(--ease);
}
.field:hover { border-color: var(--current-fg); }
.field:focus-within { border-color: var(--current-fg); outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.field .i { width: var(--icon-18); height: var(--icon-18); stroke-width: var(--stroke-18); }
.field :is(input, select) {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.5rem;
  font-weight: 400;
}
.field input::placeholder { color: var(--text-muted); opacity: 1; }
.field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.field select { appearance: none; cursor: pointer; }
.field-search { width: min(100%, 20rem); }
.field-select { min-width: 10rem; }

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  min-height: 3rem;
  margin-bottom: var(--space-4);
}
.section-title { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-h2); letter-spacing: var(--ls-h2); color: var(--text); }
.section-count { font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-small); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.section-action { margin-left: auto; }
/* an empty place is its section head with the count 0 and nothing after it: no sentence, no picture, no filler */

/* ---------- The path line: Home, the parents, the page itself (every page below the home) ---------- */
.path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
  margin-bottom: var(--space-6);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 450;
  color: var(--text-muted);
}
.path a { display: inline-block; padding: var(--space-1) 0.125rem; border-radius: var(--r-key); color: var(--text-muted); }
.path a:hover { color: var(--link); }
.path [aria-current] { max-width: 24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 550; }
.path-sep { color: var(--text-muted); opacity: 0.6; }
@media (max-width: 47.9375rem) {
  .path { margin-bottom: var(--space-4); font-size: 0.8125rem; line-height: 1.125rem; }
  .path [aria-current] { max-width: 14rem; }
}

/* ---------- A page with a side rail: the main column and, on a desktop, the rail at the right ---------- */
.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; column-gap: var(--space-12); align-items: start; }
.main-col { min-width: 0; }
/* a fact with its icon (a row's, a card's, the app strip's) */
.row-fact { display: inline-flex; align-items: center; gap: 0.3125rem; font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; color: var(--text); white-space: nowrap; }
.row-fact .i { flex: none; width: 0.875rem; height: 0.875rem; color: var(--link); }
.has-rail > .page-top { grid-column: 1 / -1; min-width: 0; }   /* the page's top (its path line and head) across the page; the content and the rail start together under it */
.has-rail > .band { grid-column: 1 / -1; }   /* a list's band across the page; under it the content (the count, the find box, the sort and the filter on top of its entries) and the rail start together */
.rail { display: grid; gap: var(--space-6); min-width: 0; }   /* it stays in place: it scrolls with the page (Bakr, 2026-11-01) */
.rail-block { min-width: 0; }
.rail-title { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-family: var(--font-ui); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.rail-title .i { color: var(--link); }
/* a block that folds: its title is the switch, its caret turns; folded, it is its title alone */
.rail-fold > summary { list-style: none; cursor: pointer; border-radius: var(--r-key); }
.rail-fold > summary::-webkit-details-marker { display: none; }
.rail-fold > summary:hover { color: var(--text); }
.rail-fold > summary:focus-visible { outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.rail-caret { margin-inline-start: auto; color: var(--text-muted) !important; transition: transform var(--dur-hover) var(--ease); }
.rail-fold:not([open]) > summary { margin-bottom: 0; }
.rail-fold:not([open]) .rail-caret { transform: rotate(-90deg); }
.rail-series { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.rail-series li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: var(--space-3); font-size: var(--fs-small); line-height: var(--lh-small); }
.rail-series-place { flex-basis: 100%; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-muted); }   /* the series' own place, under its name */
.rail-series a { font-weight: 600; }
.rail-series small { flex: none; font-size: var(--fs-caption); color: var(--text-muted); }
/* the course's contents on a lesson's rail (Bakr, 2026-11-07): the course, then its modules and their lessons numbered
   through it, the lesson open marked */
.rail-course { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--space-3); margin-bottom: var(--space-3); font-size: var(--fs-small); line-height: var(--lh-small); }
.rail-course a { font-weight: 650; }
.rail-course small { font-size: var(--fs-caption); color: var(--text-muted); }
.rail-toc, .rail-toc-lessons { display: grid; margin: 0; padding: 0; list-style: none; }
.rail-toc { gap: var(--space-3); }
.rail-toc-lessons { gap: 0.125rem; }
.rail-toc-mname { display: block; margin-bottom: 0.25rem; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; color: var(--text-muted); }
.rail-toc-lessons a { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: var(--space-2); padding: 0.25rem 0.5rem; border-radius: var(--r-key); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text); text-decoration: none; }
.rail-toc-lessons a:hover { background: var(--surface-raised); color: var(--link); }
.rail-toc-lessons a[aria-current="page"] { background: var(--current-bg); color: var(--current-fg); font-weight: 650; }
.rail-toc-n { font-family: var(--font-code); font-size: 0.75rem; line-height: inherit; }
.rail-related { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.rail-all { margin-top: var(--space-2); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 550; }
.topic-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.chip-sub { background: var(--surface-raised); color: var(--text); }
/* where a post or a series lives, in a list that mixes places (js: none; src/build/render.mjs placeChip) */
.chip-place { gap: 0.3125rem; background: var(--surface-raised); color: var(--text); }
.chip-place .i { width: 0.875rem; height: 0.875rem; color: var(--link); }
a.chip-place:hover { color: var(--link); }
.chip-place[data-tint] .i, a.chip-place[data-tint]:hover { color: var(--tint); }   /* a place of a collection with its own colour */

/* a collection's badge (src/site.json collections.<id>.badge, "Coming Soon!"): its words in its colour on a wash of it */
.badge { display: inline-flex; align-items: center; height: 1.5rem; padding-inline: 0.625rem; border-radius: 999px; background: color-mix(in srgb, var(--tint, var(--link)) 12%, var(--page)); box-shadow: inset 0 0 0 var(--hairline-w) color-mix(in srgb, var(--tint, var(--link)) 45%, var(--page)); color: var(--tint, var(--link)); font-family: var(--font-ui); font-size: var(--fs-caption); line-height: 1rem; font-weight: 650; letter-spacing: 0.02em; white-space: nowrap; }
/* a lesson's place in a course (src/build/render.mjs chips, Bakr, 2026-11-06): the route's icon, then where it stands; a long name ends in an ellipsis rather than push the row wider */
.chip-course { gap: 0.3125rem; max-width: 100%; }
.chip-course .i { flex: none; width: 0.875rem; height: 0.875rem; color: var(--link); }
.chip-course span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.series-where { margin-top: var(--space-1); }
.chip-sub .i { color: var(--link); }
.chip-sub small { font-size: inherit; line-height: inherit; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chip-sub:hover { color: var(--link); }
/* the latest things as commits on a spine: a node each, the day, the title, where it lives */
.log { --log-gap: var(--space-4); display: grid; gap: var(--log-gap); margin: 0; padding: 0; list-style: none; }
.log-item { position: relative; min-width: 0; padding-left: 2rem; }
.log-item::before { content: ""; position: absolute; left: 0.4375rem; top: 0.5rem; bottom: calc(-1 * var(--log-gap)); width: 0.125rem; background: var(--rail); }   /* the spine, on to the next node */
.log-item:last-child::before { display: none; }   /* the spine ends at the last node */
.log-item .node { position: absolute; z-index: 1; top: 0.25rem; left: 0; width: 1rem; height: 1rem; border-radius: 50%; background: var(--node-bg); box-shadow: 0 0 0 0.1875rem var(--page); }
.log-date { font-family: var(--font-code); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.log-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 0.125rem; font-size: var(--fs-small); line-height: 1.25rem; font-weight: 650; letter-spacing: 0; color: var(--link); }
.log-title a { color: inherit; }
.log-title a::after { content: ""; position: absolute; inset: 0; }   /* the whole commit answers */
.log-title a:focus-visible { outline: none; }
.log-item:has(.log-title a:focus-visible) { outline: 0.125rem solid var(--focus-ring); outline-offset: 0.25rem; border-radius: var(--r-row); }
.log-ar { margin-left: var(--space-2); font-size: var(--fs-caption); font-weight: 600; color: var(--text); }
.log-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 0.125rem; font-size: 0.8125rem; line-height: 1.125rem; color: var(--text-muted); }
.log-where { margin-top: 0.25rem; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-muted); }
/* a section's lead: a centred title with its accent and a line under it */
.section-lead { max-width: 40rem; margin: 0 auto var(--space-8); text-align: center; }
.section-title-big { font-size: 2.25rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.section-title-big .accent { color: var(--link); }
.section-sub { margin-top: var(--space-3); font-size: 1.0625rem; line-height: 1.625rem; color: var(--text-muted); }
@media (max-width: 79.9375rem) {
  .has-rail { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-10); }
  .rail { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding-top: var(--space-8); border-top: var(--line); }   /* one block a page: the course's contents or the related posts */
  .rail-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); }
  .rail-related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-title-big { font-size: 2rem; }
}
@media (max-width: 47.9375rem) {
  .has-rail { row-gap: var(--space-8); }
  .rail { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding-top: var(--space-6); }
  .rail-toc, .rail-related { grid-template-columns: minmax(0, 1fr); }
  .section-lead { margin-bottom: var(--space-6); }
  .section-title-big { font-size: 1.75rem; }
  .section-sub { font-size: 1rem; line-height: 1.5rem; }
}

/* ---------- Hairline divider ---------- */
hr, .divider { height: var(--hairline-w); margin-block: var(--space-4); border: 0; background: var(--hairline); }

/* ---------- Footer: a band across the whole page in the bar's surface, its content on the page grid. The site's
   map in columns (each collection with its icon, its name and its categories; then series, topics and the feed),
   compact, and under it the lockup with the tagline and the year ---------- */
.site-foot { margin-top: auto; padding-top: var(--space-10); }
.site-foot-band {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-top: var(--hairline-w) solid var(--rail);   /* the rail's colour on the line, as the design picker had it */
  transition: background-color var(--dur-theme) var(--ease), border-color var(--dur-theme) var(--ease);
}
.site-foot-band > :not(.band-wm) { position: relative; z-index: 1; }
.site-foot-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));   /* the five collections and Also */
  column-gap: var(--space-6);
  row-gap: var(--space-4);
  padding: var(--space-6) var(--band-pad) var(--space-5);
}
.site-foot-col { min-width: 0; }
.site-foot-title { margin-bottom: var(--space-1); font-family: var(--font-ui); font-size: var(--fs-small); line-height: 1.375rem; font-weight: 650; color: var(--text); }
.site-foot-title a { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text); text-decoration: none; border-radius: var(--r-key); }
.site-foot-title .i { color: var(--link); }
.site-foot-title a:hover { color: var(--link); text-decoration: underline; }
.site-foot-col ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.site-foot-col ul a { display: inline-block; color: var(--text-muted); font-size: 0.8125rem; line-height: 1.375rem; font-weight: 450; text-decoration: none; border-radius: var(--r-key); }
.site-foot-col ul a:hover { color: var(--link); text-decoration: underline; }
.site-foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  min-height: 3.5rem;
  padding: var(--space-2) var(--band-pad);
  border-top: var(--line);
  transition: border-color var(--dur-theme) var(--ease);
}
.site-foot-mark { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--text-muted); text-decoration: none; border-radius: var(--r-row); }
.site-foot-mark:hover { text-decoration: none; }
.site-foot-mark .lockup { height: 1.5rem; }
.site-foot-tag { font-size: 0.75rem; line-height: 1rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.site-foot-year { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 450; color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 79.9375rem) { .site-foot-map { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 47.9375rem) { .site-foot { padding-top: var(--space-8); } .site-foot-map { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: var(--space-5) var(--space-4); } .site-foot-in { min-height: 3.5rem; padding-block: var(--space-3); } }

/* ---------- Keycap ---------- */
kbd.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  min-height: 1.25rem;
  padding-inline: 0.3125rem;
  border-radius: var(--r-key);
  background: var(--surface);
  box-shadow: inset 0 0 0 var(--hairline-w) var(--hairline);
  color: var(--text);
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 600;
}

/* ---------- Filter panel (js/filters.js): the button beside the count, the chosen values, the groups ---------- */
.fl { display: contents; }
.fl-open {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 2.75rem;
  padding-inline: var(--space-4);
  border: var(--line);
  border-radius: var(--r-button);
  background: var(--surface-raised);
  color: var(--text);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 600;
  transition: background-color var(--dur-hover) var(--ease);
}
.fl-open:hover { background: var(--surface); }
.fl-open[aria-expanded="true"], .fl-open:active { background: var(--current-bg); }
.fl-open span { text-transform: capitalize; }
.fl-open b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-open svg, .fl-find svg {
  flex: none;
  width: var(--icon-18);
  height: var(--icon-18);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--stroke-18);
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* a chosen value beside the button: a selected chip, one click from going */
.fl-on {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.75rem;
  padding-inline: 0.625rem;
  border: 0;
  border-radius: var(--r-chip);
  background: var(--current-bg);
  color: var(--current-fg);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
}
.fl-on i { font-style: normal; font-size: 0.875rem; line-height: 1; }
.fl-on:hover { background: var(--surface-raised); color: var(--link); }
/* the panel opens on its own row under the head and pushes the page down */
.fl-panel {
  position: relative;
  flex: 1 0 100%;
  order: 10;
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-1);
  padding: var(--space-4);
  border: var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.fl-group { display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: start; column-gap: var(--space-3); }
.fl-name { padding-block: 0.375rem; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 650; color: var(--text); }
.fl-values { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.fl-values button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.75rem;
  padding-inline: 0.625rem;
  border: 0;
  border-radius: var(--r-chip);
  background: var(--surface);
  box-shadow: inset 0 0 0 var(--hairline-w) var(--hairline);
  color: var(--text-muted);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.fl-values button:hover { background: var(--surface-raised); color: var(--link); }
.fl-values button[aria-pressed="true"] { background: var(--current-bg); color: var(--current-fg); box-shadow: none; }
.fl-values small { font-size: inherit; line-height: inherit; font-weight: 450; font-variant-numeric: tabular-nums; opacity: 1; }
.fl-clear {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  height: 2rem;
  padding-inline: var(--space-2);
  border: 0;
  border-radius: var(--r-row);
  background: none;
  color: var(--link);
  font-size: 0.8125rem;
  line-height: 1.125rem;
  font-weight: 600;
}
.fl-clear::first-letter { text-transform: uppercase; }
.fl-clear:hover { background: var(--surface-raised); }
.fl-panel:has(.fl-clear) .fl-group:first-child { padding-right: 7rem; }
/* the find box beside the filter, a field */
.fl-find {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: min(100%, 20rem);
  height: 2.75rem;
  padding-inline: var(--space-3);
  border: var(--line);
  border-radius: var(--r-field);
  background: var(--surface-raised);
  color: var(--text-muted);
  transition: border-color var(--dur-hover) var(--ease);
}
.fl-find:hover { border-color: var(--current-fg); }
.fl-find:focus-within { border-color: var(--current-fg); outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.fl-find input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: var(--fs-body); line-height: 1.5rem; }
.fl-find input::placeholder { color: var(--text-muted); opacity: 1; }
.fl-find input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.fl-x { flex: none; width: 2rem; height: 2rem; border: 0; border-radius: var(--r-row); background: none; color: var(--text-muted); font-size: 1.125rem; line-height: 1; }
.fl-x:hover { background: var(--surface); color: var(--text); }
@media (max-width: 79.9375rem) { .fl-panel { margin-bottom: 0; } }
@media (max-width: 47.9375rem) {
  .fl-panel { gap: 0.875rem; padding: 0.875rem; border-radius: var(--r-current); }
  .fl-group { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2); }
  .fl-name { padding-block: 0; }
  .fl-clear { position: static; justify-self: end; margin-top: calc(var(--space-3) - 0.875rem); }
  .fl-panel:has(.fl-clear) .fl-group:first-child { padding-right: 0; }
  .fl-find { width: 100%; flex: 1 0 100%; }
}

/* ---------- A series: its parts as commit nodes on a rail (the logo's own motif) ----------
   Desktop and tablet: the numbered nodes sit on a horizontal rail above the cards, a short stem down to each card,
   and a vertical trunk at the leading edge joins the rows of a series that wraps (it runs behind the first column's
   cards). Phone: one vertical spine at the left, the cards hanging off it. A part hidden by a filter leaves its
   gap in the rail: no connector is drawn across it. The block is a section band on the surface colour. */
.series {
  --series-gap: var(--space-4);
  padding: var(--space-4);
  border: var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.series-title { font-size: 1.125rem; line-height: 1.5rem; font-weight: 650; color: var(--text); }
.series-title a { color: var(--link); border-radius: var(--r-key); }
.series-line { margin-top: var(--space-1); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-muted); }
.series-parts {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));   /* as many columns as its parts fill (render.mjs sets --cols) */
  gap: var(--series-gap);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}
.series-parts::before { content: ""; position: absolute; left: 0.6875rem; top: 0.6875rem; bottom: 0; width: 0.125rem; background: var(--rail); }   /* the trunk */
.series-parts > li { position: relative; z-index: 1; min-width: 0; padding-top: 2.25rem; }   /* the node (24px) and its stem (12px) above the card; the slot is what the node and the link's reach anchor to */
.series-parts > li::before { content: ""; position: absolute; left: 0; right: calc(-1 * var(--series-gap)); top: 0.6875rem; height: 0.125rem; background: var(--rail); }   /* the rail, across the gap to the next node */
.series-parts > li:last-child::before { right: 0; }
.part-num {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--node-bg);
  color: var(--node-fg);
  font-family: var(--font-code);
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.part-num::after { content: ""; position: absolute; top: 100%; left: calc(50% - 0.0625rem); width: 0.125rem; height: 0.75rem; background: var(--rail); }   /* the stem */
.part-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 6.25rem;
  padding: var(--space-3);
  border: var(--line);
  border-radius: var(--r-image);
  background: var(--surface-raised);
  color: var(--text);
  transition: box-shadow var(--dur-hover) var(--ease);
}
.part-card:hover { box-shadow: var(--shadow-2); }
.part-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 600;
  color: var(--link);
}
.part-title a { color: inherit; text-decoration: none; }
.part-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.part-title a:focus-visible { outline: none; }
.part-card:has(.part-title a:focus-visible) { outline: 0.125rem solid var(--focus-ring); outline-offset: 0.125rem; }
.part-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.375rem; margin-top: auto; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-muted); }
.part-meta { column-gap: var(--space-3); }
.part-meta > span { display: inline-flex; align-items: center; gap: 0.25rem; }
.part-meta .i { flex: none; width: 0.8125rem; height: 0.8125rem; color: var(--link); }   /* each fact its icon, no dot between them */
.part-card[aria-current] { box-shadow: inset 0 0 0 var(--hairline-w) var(--current-fg); }
@media (max-width: 79.9375rem) {
  .series { --series-gap: var(--space-3); }
  .series-title { font-size: 1.0625rem; }
  .series-parts { grid-template-columns: repeat(var(--cols-t, 3), minmax(0, 1fr)); }
}
@media (max-width: 47.9375rem) {
  .series { padding: 0.875rem; border-radius: var(--r-current); }
  .series-title { font-size: var(--fs-body); line-height: 1.375rem; }
  /* one column: the spine at the left, every node on it, the card from 48px */
  .series-parts { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-top: 0.625rem; }
  .series-parts > li { padding: 0 0 0 3rem; }
  .series-parts > li::before { display: none; }
  .series-parts > li:last-child::after { content: ""; position: absolute; left: 0; top: 1.5rem; bottom: 0; width: 1.5rem; background: var(--surface); }   /* the spine ends at the last node */
  .part-num::after { top: calc(50% - 0.0625rem); left: 100%; width: 0.75rem; height: 0.125rem; }   /* the stem runs sideways */
  .part-card { min-height: 5.25rem; }
}

/* ---------- An item's page: the head, the body, the related items ---------- */
.item-title {
  max-width: 48rem;
  font-size: 2.75rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.item-title:is(:lang(ar), [dir="rtl"]) { font-weight: 600; letter-spacing: 0; }
.item-line {
  max-width: 44rem;
  margin-top: var(--space-3);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.item-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.item-dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.item-body { margin-top: var(--space-8); }
.item-app {
  min-height: 32rem;
  overflow: hidden;
  border: var(--line);
  border-radius: var(--r-card);
}
.prose { max-width: var(--measure-long); }
.prose > * + * { margin-top: 1em; }
.related { margin-top: var(--space-16); }
.related > h2 { margin-bottom: var(--space-4); }
.related .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 79.9375rem) {
  .item-title { max-width: 42rem; font-size: 2.375rem; line-height: 1.15; }
  .item-line { font-size: 1.0625rem; line-height: 1.6; }
  .item-body { margin-top: var(--space-6); }
  .item-app { min-height: 28rem; }
  .prose { max-width: min(42rem, 68ch); }
  .related { margin-top: var(--space-12); }
}
@media (max-width: 47.9375rem) {
  .item-title { max-width: none; font-size: 1.875rem; line-height: 1.17; }
  .item-line { font-size: 1rem; line-height: 1.5rem; }
  .item-chips { gap: 0.375rem; margin-top: var(--space-3); }
  .item-dates { gap: var(--space-3); margin-top: 0.625rem; }
  .item-body { margin-top: var(--space-5); }
  .item-app { min-height: 22rem; }
  .prose { max-width: 68ch; }
  .related { margin-top: var(--space-10); }
  .related > h2 { margin-bottom: var(--space-3); font-size: var(--fs-h3); line-height: var(--lh-h3); }
  .related .cards { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
}

/* ---------- The bar (src/parts/header.html) ----------
   A band across the whole page, 80px, scrolling away with it, its content on the page grid: the mark, the five
   destinations in the middle, then search and theme. Tablet: the same band in two rows, 120px. Phone: one row,
   56px, with the destinations moved to a bar fixed at the foot of the screen. */
.bar {
  position: relative;
  z-index: 50;
  width: 100%;
  height: var(--bar-h);
  margin: 0;
  padding-inline: var(--band-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  color: var(--text);
  background: var(--surface);
  border-bottom: var(--line);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-bar) var(--ease), background-color var(--dur-theme) var(--ease), border-color var(--dur-theme) var(--ease);
}
/* from the tablet up the bar wears a wide border in the primary colour, and under the current destination the bar's
   surface dips into it as a notch (Bakr's choice on the design picker, 2026-10-30). The bar is the theme's on every
   page, a page that opens with a band too: the band starts under it (Bakr, 2026-11-01: the header follows the theme
   chosen, light or dark, everywhere) */
@media (min-width: 48rem) {
  .bar { border-bottom: 2rem solid var(--primary); box-shadow: none; }
  .bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--hairline-w); background: var(--hairline); }   /* a hairline under the destinations, above the border (Bakr, 2026-10-30, the plain style's line) */
  .dest { position: relative; }
  .dest[aria-current]::after { content: ""; position: absolute; top: 100%; left: calc(50% - 0.625rem); margin-top: 0.625rem; border-left: 0.625rem solid transparent; border-right: 0.625rem solid transparent; border-top: 0.625rem solid var(--surface); }
}
@media (min-width: 48rem) and (max-width: 79.9375rem) {
  .dest[aria-current]::after { margin-top: 0.25rem; }
}
body { overflow-x: clip; }   /* a band bleeds to the edges without a sideways scroll */

/* ---------- The band under the bar: the primary colour, 2rem from the tablet up (it was the bar's wide border), and in
   it the page's path, Home and the way down to this page (Bakr, 2026-11-06); a page without a path keeps the band ---------- */
.bar-band { position: relative; z-index: 49; display: flex; align-items: center; min-height: 1.75rem; padding: 0.25rem var(--band-pad); background: var(--primary); color: var(--on-primary); transition: background-color var(--dur-theme) var(--ease); }
.bar-band .path { width: 100%; max-width: var(--page-max); margin: 0 auto; padding-inline: var(--page-pad); font-size: 0.8125rem; line-height: 1.125rem; color: var(--on-primary); }
.bar-band .path a { padding-block: 0; color: var(--on-primary); opacity: 0.85; }
.bar-band .path a:hover { color: var(--on-primary); opacity: 1; }
.bar-band .path a:focus-visible { outline: 0.125rem solid var(--on-primary); outline-offset: 0.125rem; }
.bar-band .path [aria-current] { color: var(--on-primary); font-weight: 600; }
.bar-band .path-sep { color: var(--on-primary); opacity: 0.55; }
@media (min-width: 48rem) {
  .bar { border-bottom: 0; }   /* the band element stands where the border was */
  .bar-band { min-height: 2rem; padding-block: 0; }
}

/* ---------- A band: the dark set on a strip across the whole page, up under the bar, ending on a straight line, with
   the owl mark faint inside it (the watermark). The home's hero and a collection's lead are bands. ---------- */
.band {
  --page: var(--d-page); --surface: var(--d-surface); --surface-raised: var(--d-surface-raised); --current-bg: var(--d-current-bg); --hairline: var(--d-hairline);
  --text: var(--d-text); --text-muted: var(--d-text-muted); --link: var(--d-link); --current-fg: var(--d-current-fg); --focus-ring: var(--d-focus-ring);
  --primary: var(--d-primary); --primary-hover: var(--d-primary-hover); --primary-active: var(--d-primary-active); --on-primary: var(--d-on-primary);
  --node-bg: var(--d-node-bg); --node-fg: var(--d-node-fg); --rail: var(--d-rail); --figure: var(--d-figure);
  --shadow-1: var(--d-shadow-1); --shadow-2: var(--d-shadow-2);
  --logo-1: var(--d-logo-1); --logo-2: var(--d-logo-2);
  --c-off-topics: var(--d-c-off-topics);
  position: relative;
  margin: calc(-1 * var(--bar-h)) calc(50% - 50vw) var(--space-16);   /* up under the bar, out to the edges */
  padding: calc(var(--bar-h) + var(--space-12)) 0 var(--space-12);
  color: var(--text);
  background: var(--page);
}
html[data-theme="dark"] .band { background: var(--surface); }
.band > :not(.band-wm) { position: relative; z-index: 1; }
.band-in { width: 100%; max-width: var(--page-max); margin: 0 auto; padding-inline: var(--page-pad); }
main.page:has(> .band:first-child) { padding-top: 0; }
/* the watermark: the mark in the palette's colours, faint, clipped to its band or to the footer; its size, place,
   strength and mirroring are tokens */
.band-wm { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.band-wm .mark { position: absolute; left: var(--wm-x); top: var(--wm-y); width: var(--wm-size); height: auto; transform: translate(-50%, -50%) scaleX(var(--wm-flip)); opacity: var(--wm-opacity); }
.site-foot-band .band-wm .mark { left: var(--fwm-x); top: var(--fwm-y); width: var(--fwm-size); transform: translate(-50%, -50%) scaleX(var(--fwm-flip)); opacity: var(--fwm-opacity); }
@media (max-width: 79.9375rem) {
  .band { margin-bottom: var(--space-12); padding-bottom: var(--space-8); }
}
@media (max-width: 47.9375rem) {
  .band { margin-bottom: var(--space-10); padding-bottom: var(--space-6); }
}
.bar-start { display: flex; align-items: center; min-width: 0; justify-self: start; }
.bar-end { display: flex; align-items: center; justify-self: end; }

/* the brand: the lockup (the mark with the site's name) with the tagline under the name, 16px of air after it; the
   mark alone on the narrowest phones */
.bar-mark { display: flex; flex-direction: column; align-items: flex-start; flex: none; margin-right: var(--space-4); border-radius: var(--r-row); color: var(--text-muted); text-decoration: none; }
.bar-mark:hover { text-decoration: none; }
.bar-mark { transform: translate(var(--mark-x), var(--mark-y)); }   /* the mark's shift, a token */
.bar-mark .lockup { height: var(--mark-h); }
.bar-mark .mark-small { display: none; }
.bar-tag { margin: 0.125rem 0 0 calc(var(--mark-h) * 1.3125); font-size: 0.6875rem; line-height: 0.875rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }

/* the five destinations: icon over label, the current one boxed in the current colours */
.bar-dest { display: flex; align-items: center; gap: var(--space-1); }
.dest {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 4.5rem;
  height: 3.75rem;
  border-radius: var(--r-current);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.dest:hover { background: var(--surface-raised); color: var(--text); text-decoration: none; }
.dest:active { background: var(--current-bg); transition-duration: var(--dur-active); }
.dest[aria-current], .dest[aria-current]:hover { background: var(--current-bg); color: var(--current-fg); }
/* a collection with a colour of its own (src/site.json collections.<id>.colour): its icon wears it, and its name too when it is
   the current destination */
.dest[data-tint] .i, .dest[data-tint][aria-current], .dest[data-tint][aria-current]:hover { color: var(--tint); }

/* search and theme */
.bar-acts { display: flex; align-items: center; gap: var(--space-1); }
.bar-btn { background: transparent; border-color: transparent; color: var(--text); }
.bar-btn:hover { background: var(--surface-raised); }
.bar-btn:active { background: var(--current-bg); }
.theme .theme-sun { display: none; }
html[data-theme="dark"] .theme .theme-sun { display: block; }
html[data-theme="dark"] .theme .theme-moon { display: none; }

/* ---------- The bar, tablet: two rows in one surface ---------- */
@media (max-width: 79.9375rem) {
  .bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 3rem 3.5rem;
    row-gap: var(--space-2);
    align-content: center;
    padding: calc(var(--space-1) - var(--hairline-w)) var(--band-pad);
  }
  .bar-start { grid-area: 1 / 1; }
  .bar-end { grid-area: 1 / 2; }
  .bar-dest { grid-area: 2 / 1 / 3 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center; height: 100%; }   /* Home and the collections, a column each */
  .dest { justify-self: center; width: 100%; max-width: 7rem; height: 3.25rem; font-size: var(--fs-caption); line-height: 1rem; }
  .dest .i { width: var(--icon-18); height: var(--icon-18); stroke-width: var(--stroke-18); }
  .bar-tag { margin-left: calc(var(--mark-h) * 1.3); }
}

/* ---------- The bar, phone: one row on top (the mark, search and theme), the destinations at the foot ---------- */
@media (max-width: 47.9375rem) {
  .bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 2.75rem;
    padding: calc(var(--space-1) - var(--hairline-w)) var(--band-pad);
  }
  .bar-start, .bar-end { display: contents; }
  .bar-mark { grid-area: 1 / 1; margin-right: 0; }
  .bar-tag { display: none; }   /* the phone's bar has no room for a second line; the home's sentence says it */
  .bar-acts { grid-area: 1 / 3; gap: 0.125rem; }

  .bar-dest {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--dock-h) + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);   /* the collections, a column each: the lockup is Home on a phone (Bakr, 2026-11-07, the fuller plan 2.1) */
    align-items: stretch;
    gap: 0;
    background: var(--dock-bg);
    border-top: var(--hairline-w) solid var(--dock-hairline);
    transition: background-color var(--dur-theme) var(--ease), border-color var(--dur-theme) var(--ease);
  }
  .bar-dest .dest-home { display: none; }
  .bar-dest .dest { color: var(--dock-text); }
  .bar-dest .dest:hover { background: var(--dock-raised); color: var(--dock-text); }
  .bar-dest .dest:active, .bar-dest .dest[aria-current], .bar-dest .dest[aria-current]:hover { background: var(--dock-current-bg); color: var(--dock-current-fg); }
  .bar-dest .dest[data-tint][aria-current], .bar-dest .dest[data-tint][aria-current]:hover { color: var(--tint); }
  .dest {
    justify-self: stretch;
    width: auto;
    max-width: none;
    height: auto;
    margin: var(--space-1);
    gap: 0.1875rem;
    border-radius: var(--r-button);
    font-size: 0.6875rem;
    line-height: 0.875rem;
  }
  /* the page keeps room for the bar at its foot: 96px, so the last thing on a page is never under it */
  body:has(.bar-dest) { padding-bottom: calc(var(--dock-h) + var(--space-8) + env(safe-area-inset-bottom)); }
}
/* the narrowest phones: the mark alone, so the date, the time and the two buttons keep their room */
@media (max-width: 22.4375rem) {
  .bar-mark .lockup { display: none; }
  .bar-mark .mark-small { display: block; height: var(--mark-h); }
}

/* ---------- Less motion: every change at once, nothing slides ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}
