/* site.css — every page on the site uses this one stylesheet.

   0 Fonts and accents   1 Tokens   2 Base   3 Header   4 Footer
   5 Shared bits   6 Home   7 Cards and lists   8 Articles   9 Prose
   10 Code   11 Guides   12 Extras   13 Project pipeline */


/* 0. Fonts and accents -----------------------------------------------------
   Google Fonts: IBM Plex Sans (headings and text), IBM Plex Mono (code and labels)
   and Material Symbols (icons). The icon font is cut down to the icons listed
   in icon_names. To use a new icon (fonts.google.com/icons), add its name
   to that list, in alphabetical order. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,400..700;1,400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&icon_names=ac_unit,arrow_back,arrow_downward,arrow_forward,arrow_outward,check,content_copy,dark_mode,deployed_code,dns,edit_note,fact_check,fence,info,key_off,lan,layers,light_mode,lightbulb,lock,menu_book,receipt_long,replay,schedule,skip_next,stacks,terminal,usb,warning&display=block');

/* Accent colours as light-dark(light mode, dark mode). A page picks one with
   data-accent on <html>, e.g. <html lang="en" data-accent="pink">. */
[data-accent="periwinkle"] { --accent: light-dark(#6550D3, #AC9CFC); }
[data-accent="blue"]       { --accent: light-dark(#1D4ED8, #60A5FA); }
[data-accent="pink"]       { --accent: light-dark(#A72AA6, #FF99FE); }
[data-accent="aqua"]       { --accent: light-dark(#087175, #A4F6F9); }
[data-accent="neutral"]    { --accent: var(--text); } /* home page: no colour of its own, the sections carry it */


/* 1. Tokens ----------------------------------------------------------------
   light-dark(light, dark) picks a value from the current colour scheme:
   the system setting, or the theme button (data-theme on <html>). */

:root {
  color-scheme: light dark;

  --bg:        light-dark(#FAFAF9, #0F0F11);
  --surface:   light-dark(#FFFFFF, #18181B);
  --text:      light-dark(#1C1917, #F4F4F5);
  --muted:     light-dark(#5F5A57, #A1A1AA);
  --border:    light-dark(#E7E5E4, #2A2A30);
  --line:      light-dark(#A8A29E, #4A4A55); /* dashed blueprint lines */
  --chip:      light-dark(#F1F0EE, #232328);
  --code-bg:   light-dark(#F3F2F0, #141417);
  --on-accent: light-dark(#FFFFFF, #0F0F11);

  --syn-string:  light-dark(#15803D, #86EFAC);
  --syn-keyword: light-dark(#9D174D, #F9A8D4);
  --syn-prop:    light-dark(#1D4ED8, #93C5FD);
  --syn-number:  light-dark(#B45309, #FDBA74);
  --syn-var:     light-dark(#7E22CE, #D8B4FE);
  --syn-add:     light-dark(#DCFCE7, #052E16);
  --syn-del:     light-dark(#FEE2E2, #450A0A);

  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --wide: 72rem;
  --measure: 42rem;
  /* Blueprint look: square-ish corners and dashed rules between things. */
  --radius: 6px;
  --radius-sm: 4px;
  --rule: 1px dashed var(--line);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* Every element with data-accent gets a soft tint of its own accent. */
[data-accent] { --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent); }


/* 2. Base ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem; /* keeps #anchors clear of the sticky header */
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; } /* soft cross-fade between pages */
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p, li { text-wrap: pretty; }

/* The page column: 72rem wide, with a 24px gutter on small screens. */
.wrap { width: min(100% - 3rem, var(--wide)); margin-inline: auto; }
.narrow { width: min(100% - 3rem, 48rem); margin-inline: auto; }

/* Material Symbols (Google's icon font). */
.icon {
  flex: none;
  display: inline-block;
  font-family: 'Material Symbols Rounded';
  font-size: 1.25rem;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.brand { width: 1.375rem; height: 1.375rem; fill: currentColor; }

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 30;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--on-accent); }


/* 3. Header ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

/* No border: the header floats. Once the page scrolls, a soft shadow fades
   in under it so content doesn't look cut off. CSS only; browsers without
   scroll timelines just keep the borderless header. */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-lift linear both;
    animation-timeline: scroll(root);
    animation-range: 0 4rem;
  }
}
@keyframes header-lift {
  from { box-shadow: 0 0 0 transparent; }
  to   { box-shadow: 0 6px 16px -8px light-dark(rgb(28 25 23 / 0.18), rgb(0 0 0 / 0.6)); }
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.75rem;
}

/* The wordmark is a path, like a shell prompt: ~/bjf goes home and the
   section part (/projects, /blog, ...) goes to that section's index. */
.wm {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.wm a { padding-block: 0.5rem; text-decoration: none; }
.wm a, .wm a:hover { color: var(--text); }
.wm-tilde { color: var(--muted); font-weight: 500; }
.wm .wm-section, .wm .wm-section:hover { color: var(--accent); }
.wm a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a .icon { font-size: 1rem; }
.site-nav a:hover { color: var(--text); background: var(--chip); }
.site-nav a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle[hidden] { display: none; }

/* Phones: a tighter menu so it fits on one line, and a header that scrolls
   away instead of covering a quarter of the screen. */
@media (max-width: 40rem) {
  html { scroll-padding-top: 1rem; }
  .site-header { position: static; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 0.625rem 0.625rem; }
  .theme-toggle { margin-left: 0.25rem; }
}


/* 4. Footer ---------------------------------------------------------------- */

.site-footer { margin-top: 4rem; color: var(--muted); font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1.75rem; }
.site-footer p { margin: 0; }
/* LinkedIn and Mastodon as small icons next to the name. */
.footer-id { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.footer-id .social { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm, 4px); color: var(--muted); }
.footer-id .social:hover { color: var(--text); background: var(--chip); }
.footer-id .brand { width: 1.125rem; height: 1.125rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }


/* 5. Shared bits ----------------------------------------------------------- */

.page { padding-block: 4.5rem 1rem; }
.page-head { margin-bottom: 3rem; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.display {
  margin: 0;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.page-title {
  margin: 0;
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.lead { max-width: 36rem; margin: 1rem 0 0; color: var(--muted); font-size: 1.1875rem; }
.lead p { margin: 0 0 0.75em; }
.lead p:last-child { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); filter: brightness(1.08); }

.icon-tile {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-tile.neutral { background: var(--chip); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.875rem;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.badge {
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.empty { padding-block: 2rem; color: var(--muted); }
.empty a { color: var(--accent); }


/* 6. Home ------------------------------------------------------------------ */

.hero { display: flex; align-items: center; gap: 3rem; padding-block: 5rem 3.5rem; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero .lead { max-width: 34rem; margin-top: 1.5rem; font-size: 1.25rem; line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.hero-photo {
  flex: none;
  display: block;
  width: 13.75rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* The hub: a dashed line from "~/bjf" down to the three sections. Each
   .node has its own data-accent; ::before draws its drop line and
   ::after the dot where it joins the line. */
.hub-section { padding-block: 4.5rem 2rem; }
.hub { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; padding-top: 3rem; }
.hub::before { content: ""; position: absolute; top: 0; left: 16.667%; right: 16.667%; border-top: 2px dashed var(--line); }
.hub-root {
  position: absolute;
  bottom: calc(100% + 1.5rem); /* sits above the line, joined by .hub-root::after */
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
}
.hub-root::after { content: ""; position: absolute; left: calc(50% - 1px); top: calc(100% + 2px); height: 1.5rem; border-left: 2px dashed var(--line); }

.node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.375rem 1.375rem 1.125rem;
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s;
}
.node::before { content: ""; position: absolute; left: 50%; top: -3.125rem; height: 3rem; border-left: 2px dashed var(--line); }
.node::after { content: ""; position: absolute; left: calc(50% - 5px); top: -3.45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.node:hover { border-style: solid; color: inherit; transform: translateY(-2px); }

.node-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.node-name { color: var(--accent); font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.node-art { flex: none; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.node-title { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.node:hover .node-title { color: var(--accent); }


/* Phones: one column, the line runs down the left. */
@media (max-width: 40rem) {
  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 2rem; padding-block: 3rem 2rem; }
  .hero-photo { width: 9rem; }
  .hub { grid-template-columns: 1fr; gap: 1rem; padding: 0 0 0 1.75rem; }
  .hub::before { top: 1.25rem; bottom: 1.25rem; left: 0.375rem; right: auto; border-top: 0; border-left: 2px dashed var(--line); }
  .hub-root { display: none; }
  .node::before { left: -1.5rem; top: 50%; width: 1.375rem; height: 0; border-left: 0; border-top: 2px dashed var(--line); }
  .node::after { left: -1.7rem; top: calc(50% - 5px); }
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.more-link .icon { font-size: 1.125rem; }
.more-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.mini-list { margin: 0; padding: 0; list-style: none; }
.mini-list li { border-top: var(--rule); }
.mini-list a { display: block; padding-block: 1rem; text-decoration: none; }
.mini-list a:hover { color: inherit; }
.mini-list :is(time, .mini-meta) { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 0.8125rem; }
.mini-list .title { display: block; margin-top: 0.125rem; font-family: var(--font-display); font-size: 1.1875rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.mini-list a:hover .title { color: var(--accent); }


/* 7. Cards and lists ------------------------------------------------------- */

.index-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  height: 100%;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
a.card:hover { border-color: var(--accent); color: inherit; transform: translateY(-2px); }
.card-title { margin: 0; font-size: 1.3125rem; line-height: 1.25; letter-spacing: -0.015em; }
a.card:hover .card-title { color: var(--accent); }
.card-text { color: var(--muted); font-size: 1rem; }
.card-text p { margin: 0; }
.card .chips { margin-top: auto; padding-top: 0.375rem; }

/* Project cards: the real logo of the tool a project is built on, in its
   brand colour. The page names it with <meta name="logo" content="nixos">;
   the SVG (Simple Icons, CC0) is used as a mask so CSS can colour it.
   Some colours are lightened or darkened so they show on both grounds. */
.logo { display: block; width: 36px; height: 36px; background: var(--brand, var(--accent)); -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat; }
[data-logo="nixos"]           { --mask: url(/assets/img/logos/nixos.svg);           --brand: light-dark(#5277C3, #7EA3E0); }
/* Linux Containers keeps its own four colours (linuxcontainers.org's logo), so
   it's drawn as a picture instead of a one-colour mask. */
[data-logo="linuxcontainers"] { background: url(/assets/img/logos/linuxcontainers.svg) center / contain no-repeat; -webkit-mask: none; mask: none; }
[data-logo="opentofu"]        { --mask: url(/assets/img/logos/opentofu.svg);        --brand: light-dark(#B89A00, #FFDA18); }
[data-logo="ansible"]         { --mask: url(/assets/img/logos/ansible.svg);         --brand: light-dark(#EE0000, #FF5C5C); }
[data-logo="windows"]         { --mask: url(/assets/img/logos/windows.svg);         --brand: light-dark(#0078D4, #3B9EEA); }
[data-logo="linux"]           { --mask: url(/assets/img/logos/linux.svg);           --brand: light-dark(#1C1917, #F4F4F5); }

/* Links page */
.link-list { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.link-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s;
}
.link-row:hover { border-color: var(--accent); color: inherit; }
.link-text { flex: 1; min-width: 0; }
.link-label { display: block; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.link-host { display: block; overflow-wrap: anywhere; color: var(--muted); font-family: var(--font-mono); font-size: 0.8125rem; }
.link-arrow { color: var(--muted); }
.link-row:hover .link-arrow { color: var(--accent); }

/* Blog index: posts grouped by year */
.post-group + .post-group { margin-top: 4rem; }
.group-title { margin: 0 0 0.5rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.group-about { max-width: 40rem; margin: 0 0 1.5rem; color: var(--muted); }
.year { margin: 3.5rem 0 0.25rem; color: var(--accent); font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; }
.post-list { margin: 0; padding: 0; border-bottom: var(--rule); list-style: none; }
.post-list li { border-top: var(--rule); }
.post-row { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; padding-block: 1.375rem; text-decoration: none; }
.post-row:hover { color: inherit; }
.post-row > time { flex: 0 0 7.5rem; padding-top: 0.25rem; color: var(--muted); font-family: var(--font-mono); font-size: 0.8125rem; }
.post-row-body { flex: 1 1 22rem; min-width: 0; }
.post-row-title { display: block; font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.post-row:hover .post-row-title { color: var(--accent); }
.post-row-summary { display: block; margin-top: 0.375rem; color: var(--muted); font-size: 1rem; }
.post-row .meta { margin-top: 0.5rem; font-family: var(--font-body); }
.post-row .meta .icon, .card .meta .icon { font-size: 1rem; }


/* 8. Articles -------------------------------------------------------------- */

.article { width: min(100% - 3rem, var(--measure)); margin-inline: auto; padding-block: 3.5rem 1rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.back-link .icon { font-size: 1.125rem; }

.article-head { margin: 1.25rem 0 2.5rem; }
.article-title { margin: 0.875rem 0 0; font-size: clamp(2.25rem, 1.7rem + 2.4vw, 3.25rem); line-height: 1.08; letter-spacing: -0.02em; }
.standfirst { margin: 1.125rem 0 0; color: var(--muted); font-size: 1.3125rem; line-height: 1.55; }

/* Project pages: the project's icon sits above its name. */
.project .article-head .icon-tile { width: 56px; height: 56px; margin-bottom: 0.25rem; border-radius: var(--radius); }
.project .article-head .icon-tile .icon { font-size: 1.875rem; }

.post-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 4rem; padding-top: 1.75rem; border-top: var(--rule); }
.post-nav a {
  flex: 1 1 15rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.post-nav a:hover { border-color: var(--accent); color: inherit; }
.post-nav .newer { text-align: right; }
.post-nav-dir { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.8125rem; }
.post-nav-dir .icon { font-size: 1rem; }
.post-nav-title { display: block; margin-top: 0.25rem; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }

/* Reading progress bar (CSS only, where the browser supports scroll timelines). */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
  .progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    display: block;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    animation: read-progress linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes read-progress { to { transform: scaleX(1); } }


/* 9. Prose (the Markdown body of a post) ----------------------------------- */

.prose { font-size: 1.125rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose .table-wrap { margin: 0 0 1.25em; }
.prose h2 { margin: 2em 0 0.6em; font-size: 1.6875rem; }
.prose h3 { margin: 1.75em 0 0.5em; font-size: 1.3125rem; }
.prose h4 { margin: 1.5em 0 0.5em; font-size: 1.0625rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.35em 0; padding-left: 0.25em; }
.prose li > ul, .prose li > ol { margin: 0.35em 0; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose hr { margin: 2.5em 0; border: 0; border-top: var(--rule); }
.prose img { border-radius: var(--radius); }

.prose .anchor { margin-left: 0.3em; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.prose :is(h2, h3, h4):hover .anchor, .prose .anchor:focus-visible { opacity: 1; }

.prose blockquote {
  margin: 1.75em 0;
  padding: 0.25rem 0 0.25rem 1.375rem;
  box-shadow: inset 3px 0 0 var(--accent);
  font-family: var(--font-display);
  font-size: 1.4375rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.prose blockquote p { margin: 0 0 0.5em; }
.prose blockquote p:last-child { margin-bottom: 0; }

/* Callouts: <div class="callout tip">, "callout note" or "callout warning".
   The icon is drawn by ::before, so the HTML stays short. */
.callout {
  --tint: var(--accent);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.875rem;
  margin: 1.5em 0;
  padding: 1rem 1.125rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  font-size: 1rem;
  line-height: 1.65;
}
.callout::before {
  content: 'lightbulb';
  margin-top: 0.2rem;
  color: var(--tint);
  font-family: 'Material Symbols Rounded';
  font-size: 1.25rem;
  line-height: 1;
  font-feature-settings: 'liga';
}
.callout.note::before { content: 'info'; }
.callout.warning { --tint: light-dark(#B45309, #FBBF24); }
.callout.warning::before { content: 'warning'; }
.prose .callout > * { grid-column: 2; margin: 0 0 0.5em; }
.prose .callout > :last-child { margin-bottom: 0; }

.prose :not(pre) > code {
  padding: 0.125em 0.375em;
  border-radius: var(--radius);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.prose th, .prose td { padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--chip); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose .align-center { text-align: center; }
.prose .align-right { text-align: right; }


/* 10. Code blocks -----------------------------------------------------------
   You write <pre><code class="language-bash">…</code></pre>. site.js wraps it
   in <figure class="code"> with a label and a Copy button, and colours it. */

.prose pre {
  margin: 1.5em 0;
  padding: 1rem 1.125rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  tab-size: 4;
}

figure.code { margin: 1.5em 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); }
figure.code pre { margin: 0; border: 0; border-radius: 0; }

figure.code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.625rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.copy .icon { font-size: 1rem; }
.copy:hover { background: var(--chip); color: var(--text); }

.t-c { color: var(--muted); font-style: italic; }
.t-s { color: var(--syn-string); }
.t-k { color: var(--syn-keyword); }
.t-n { color: var(--syn-number); }
.t-v { color: var(--syn-var); }
.t-p { color: var(--syn-prop); }
.t-f { color: var(--accent); font-weight: 600; }
.t-a, .t-d { display: inline-block; min-width: 100%; }
.t-a { background: var(--syn-add); }
.t-d { background: var(--syn-del); }


/* 11. Guides: article with an "On this page" list ---------------------------
   One flex row, reversed so the contents list sits on the right but comes
   first on a phone, where the row wraps. */

.article.guide { width: min(100% - 3rem, var(--wide)); }
.guide .article-head { max-width: 46rem; }

.guide-layout {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end; /* in a reversed row this means "start on the left" */
  gap: 2.5rem 3.5rem;
  padding-top: 2.5rem;
  border-top: var(--rule);
}
.guide-body { flex: 999 1 35rem; min-width: 0; max-width: 46rem; }
.guide-body .prose { font-size: 1.0625rem; }

.toc { flex: 1 1 12.5rem; }
@media (min-width: 60rem) { .toc { position: sticky; top: 5.5rem; max-width: 15rem; } }

.toc-title {
  margin: 0 0 0.625rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc ol { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.toc a { display: block; padding: 0.4375rem 0.75rem; border-radius: var(--radius-sm); color: var(--muted); line-height: 1.4; text-decoration: none; }
.toc .sub a { padding-left: 1.5rem; font-size: 0.875rem; }
.toc a:hover { background: var(--chip); color: var(--text); }
.toc a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }


/* 12. Extras --------------------------------------------------------------- */

.not-found { padding-block: 6rem 2rem; }
.not-found .actions { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-header, .site-footer, .toc, .post-nav, .progress, .copy, .back-link { display: none !important; }
  body { background: #fff; color: #000; }
}


/* 13. Project pipeline ------------------------------------------------------
   A posts.json group with "steps" (see posts.js): numbered boxes in a row,
   joined by dashed arrows in the section colour. ::after draws the dashed
   line out of each box, ::before the arrow head into the next one. On
   narrow screens the boxes stack and the line turns downwards. */

.pipeline-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3rem; margin: 0; padding: 0; list-style: none; }
.pipeline-steps > li { position: relative; }
.pipeline-steps > li:not(:last-child)::after { content: ''; position: absolute; top: 1.9rem; left: 100%; width: 3rem; border-top: 2px dashed var(--accent); }
.pipeline-steps > li:not(:first-child)::before { content: ''; position: absolute; top: calc(1.9rem - 5px); left: -9px; border: 6px solid transparent; border-left: 8px solid var(--accent); }

.step {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.25rem 1.375rem 1.375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.step:hover { border-color: var(--accent); color: inherit; transform: translateY(-2px); }
.step:hover .card-title { color: var(--accent); }
.step .card-title { font-size: 1.1875rem; }
.step .card-text { font-size: 0.9375rem; line-height: 1.55; }
.step .logo { width: 32px; height: 32px; }

.step-num { display: flex; align-items: baseline; gap: 0.625rem; color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.step-num .n { color: var(--accent); font-size: 1.375rem; font-weight: 700; letter-spacing: 0; }

.hands-over { margin-top: auto; padding-top: 0.75rem; border-top: 1px dashed var(--border); font-family: var(--font-mono); font-size: 0.75rem; }
.hands-over span { color: var(--accent); }

@media (max-width: 60rem) {
  .pipeline-steps { grid-template-columns: 1fr; gap: 2.5rem; }
  .pipeline-steps > li:not(:last-child)::after { top: 100%; left: 2.4rem; width: 0; height: 2.5rem; border-top: 0; border-left: 2px dashed var(--accent); }
  .pipeline-steps > li:not(:first-child)::before { top: -9px; left: calc(2.4rem - 5px); border: 6px solid transparent; border-top: 8px solid var(--accent); }
}
