/* twisla's experiments: every style for the home page and the posts. Posts have no CSS of their own. */
  :root {
    --bg: #ECEFF4;
    --surface: #E5E9F0;
    --line: #D8DEE9;
    --text: #2E3440;
    --heading: #2E3440;
    --muted: #4C566A;
    --accent: #5E81AC;
    --frost: #88C0D0;
    --yellow: #EBCB8B;
    --red: #BF616A;
    --green: #6E8F57;
    --code-bg: #2E3440;
    --code-text: #D8DEE9;
    --code-dim: #7B88A1;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #2E3440; --surface: #3B4252; --line: #434C5E; --text: #D8DEE9; --heading: #ECEFF4;
      --muted: #A9B3C4; --accent: #88C0D0; --code-bg: #242933; --code-dim: #6D7A93; --green: #A3BE8C;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #2E3440; --surface: #3B4252; --line: #434C5E; --text: #D8DEE9; --heading: #ECEFF4;
    --muted: #A9B3C4; --accent: #88C0D0; --code-bg: #242933; --code-dim: #6D7A93; --green: #A3BE8C;
    color-scheme: dark;
  }

  *, *::before, *::after { box-sizing: inherit; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); text-underline-offset: 3px; }
  a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  strong { color: var(--heading); }

  /* Site navigation, on every page */
  nav.site {
    max-width: 42rem; margin: 0 auto; padding: 1.25rem 1.25rem .9rem;
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1.5rem;
    border-bottom: 1px solid var(--line);
    font: 500 .85rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  }
  nav.site .name { color: var(--heading); font-weight: 800; text-decoration: none; }
  nav.site ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; }
  nav.site ul a { color: var(--muted); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; }
  nav.site ul a:hover { color: var(--accent); }
  nav.site ul a[aria-current="page"] { color: var(--heading); border-bottom: 2px solid var(--accent); padding-bottom: .15rem; }
  .post { max-width: 42rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; display: grid; gap: 1.1rem; }
  .post > * { margin: 0; min-width: 0; }

  /* Header: the reader's own log line, then the title */
  .masthead { display: grid; gap: 1rem; margin-bottom: .6rem; }
  .masthead > * { margin: 0; }
  .uid {
    justify-self: start;
    display: inline-flex; flex-wrap: wrap; gap: .25rem .7rem; align-items: baseline;
    background: var(--code-bg); color: var(--code-dim);
    border-radius: 10px; padding: .55rem .9rem;
    font: 500 .85rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  }
  .uid b { color: #A3BE8C; font-weight: 800; letter-spacing: .02em; }
  .post h1 {
    font-size: clamp(1.9rem, 5.5vw, 2.8rem); line-height: 1.1; font-weight: 800;
    letter-spacing: -0.025em; color: var(--heading); text-wrap: balance;
  }
  .dek { font-size: 1.15rem; color: var(--muted); }
  .byline {
    display: flex; flex-wrap: wrap; gap: .2rem 1.1rem;
    padding-top: .9rem; border-top: 1px solid var(--line);
    font: 500 .8rem/1.5 "JetBrains Mono", ui-monospace, monospace; color: var(--muted);
  }

  .post h2 {
    font-size: 1.55rem; line-height: 1.25; font-weight: 800; letter-spacing: -0.015em;
    color: var(--heading); margin-top: 1.6rem; text-wrap: balance;
  }
  .post h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; color: var(--heading); margin-top: .6rem; }

  code {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .86em; background: var(--surface); padding: .1em .35em; border-radius: 4px;
  }

  /* The cast of components */
  .cast { border-top: 1px solid var(--line); }
  .cast div { display: grid; grid-template-columns: 10.5rem 1fr; gap: 1rem; padding-block: .85rem; border-bottom: 1px solid var(--line); }
  .cast dt { font-weight: 700; color: var(--heading); }
  .cast dt span { display: block; margin-top: .15rem; font: 500 .74rem/1.4 "JetBrains Mono", ui-monospace, monospace; color: var(--muted); font-weight: 400; }
  .cast dd { margin: 0; }
  @media (max-width: 560px) { .cast div { grid-template-columns: 1fr; gap: .2rem; } }

  /* Diagrams: inline SVG (diagram shortcode). Below --min-width a diagram scrolls
     sideways instead of shrinking; without one, it fits the column and scrolls on phones. */
  figure.arch { display: grid; gap: .75rem; margin-block: .8rem; }
  .arch .canvas { overflow-x: auto; background: var(--surface); border-radius: 14px; padding: 1.25rem; color: var(--text); }
  .arch svg { display: block; width: 100%; min-width: var(--min-width, 0); height: auto; }
  @media (max-width: 560px) { .arch svg { min-width: var(--min-width, 520px); } }
  .arch figcaption { font-size: .9rem; color: var(--muted); }

  /* One scan, step by step */
  /* Numbered steps (steps shortcode around a Markdown list with a blank line between items) */
  .steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; counter-reset: step; }
  .steps li { counter-increment: step; display: grid; grid-template-columns: 1.8rem 1fr; gap: .6rem; }
  .steps li::before { content: counter(step) "."; font-weight: 800; color: var(--accent); line-height: 1.65; }
  .steps p { margin: 0; }

  /* Status badge (a post's status front matter) */
  .status {
    justify-self: start; display: inline-flex; gap: .5rem; align-items: center;
    font: 600 .75rem/1.3 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase;
    color: var(--heading); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem;
  }
  .status::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--yellow); }

  /* A section that starts folded (details shortcode) */
  details.more { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  details.more > summary {
    cursor: pointer; list-style: none; padding: 1rem 1.25rem;
    font-weight: 800; font-size: 1.1rem; color: var(--heading);
  }
  details.more > summary::-webkit-details-marker { display: none; }
  details.more > summary::before { content: "▸"; display: inline-block; width: 1.2rem; color: var(--accent); transition: transform .15s ease; }
  details.more[open] > summary::before { transform: rotate(90deg); }
  details.more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 14px; }
  .more-body { padding: 0 1.25rem 1.25rem; display: grid; gap: 1.1rem; }
  .more-body > * { margin: 0; min-width: 0; }
  .more-body h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; color: var(--heading); margin-top: .8rem; }
  .more-body h4 { font: 600 .75rem/1.3 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: .4rem; }
  .more-body pre {
    margin: 0; overflow-x: auto; padding: 1rem 1.15rem;
    background: var(--code-bg); color: var(--code-text); border-radius: 10px;
    font: 400 .82rem/1.6 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .more-body pre code { background: none; padding: 0; font-size: inherit; white-space: pre; color: inherit; }
  .more-body table { font-size: .9rem; }
  @media (prefers-reduced-motion: reduce) { details.more > summary::before { transition: none; } }

  /* Keys to press */
  kbd {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85em;
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
    padding: .05em .4em; background: var(--surface); color: var(--heading);
  }

  /* Code in a title (a title_html front matter): the command itself, in red */
  .post h1 code, .posts h3 code { background: none; padding: 0; color: var(--red); font-size: .95em; }

  /* The sign (sign shortcode, and the home page's post count) */
  .sign {
    border: 3px solid var(--heading); border-radius: 14px;
    padding: 1rem 1.3rem; background: var(--surface);
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  }
  .sign .label { font-weight: 800; font-size: clamp(1.05rem, 3.6vw, 1.35rem); line-height: 1.15; color: var(--heading); }
  .sign .label small { display: block; margin-top: .35rem; font-weight: 500; font-size: .9rem; color: var(--muted); }
  .sign .count {
    font: 800 clamp(2.6rem, 10vw, 3.8rem)/1 "JetBrains Mono", ui-monospace, monospace;
    color: #A3BE8C; background: var(--code-bg); border-radius: 10px; padding: .45rem .8rem;
    font-variant-numeric: tabular-nums;
  }
  .sign.red .count { color: var(--red); }
  @media (max-width: 480px) { .sign { padding: .9rem 1rem; } }

  .aside { border-left: 3px solid var(--yellow); padding: .2rem 0 .2rem 1rem; color: var(--muted); }

  /* Code */
  /* Every code block, captioned (code shortcode) or plain (a fenced block) */
  .code { display: grid; gap: .5rem; margin: 0; }
  .post pre {
    margin: 0; overflow-x: auto; padding: 1rem 1.15rem;
    background: var(--code-bg); color: var(--code-text); border-radius: 10px;
    font: 400 .85rem/1.65 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .post pre code { background: none; padding: 0; font-size: inherit; white-space: pre; border-radius: 0; color: inherit; }
  .code figcaption { font-size: .9rem; color: var(--muted); }

  /* Photos and video */
  figure.media { display: grid; gap: .6rem; justify-items: center; margin: .4rem 0; }
  figure.media img, figure.media video {
    display: block; max-width: 100%; height: auto; max-height: 34rem; width: auto;
    border-radius: 10px; background: var(--surface);
  }
  figure.media.landscape img { max-height: none; width: 100%; }
  figure.media a.full { display: block; width: 100%; cursor: zoom-in; border-radius: 10px; }
  figure.media a.full:hover img { outline: 2px solid var(--accent); outline-offset: 2px; }
  figure.media figcaption { font-size: .9rem; color: var(--muted); justify-self: stretch; }

  .tablewrap { overflow-x: auto; }
  table { border-collapse: collapse; width: 100%; font-size: .95rem; }
  th, td { text-align: left; vertical-align: top; padding: .55rem .8rem .55rem 0; border-bottom: 1px solid var(--line); }
  th { font: 600 .72rem/1.3 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  td:first-child { font-weight: 700; color: var(--heading); white-space: nowrap; }

  .signoff { color: var(--muted); border-top: 1px solid var(--line); padding-top: 1.25rem; }

  @media (max-width: 480px) {
    body { font-size: 1rem; }
    .post { padding-top: 1.25rem; }
    .arch .canvas { padding: 1rem .75rem; }
  }

  /* Code highlighting (config.toml: highlight_theme = "css") */
  .z-comment { color: var(--code-dim); }
  .z-string { color: #A3BE8C; }
  /* Shell: the grammar calls every bare argument a string; only quoted ones are */
  code[data-lang="shellscript"] .z-string:not(.z-quoted) { color: inherit; }
  .z-constant.z-numeric, .z-constant.z-language { color: #B48EAD; }
  .z-entity.z-name.z-tag, .z-keyword { color: #81A1C1; }

  /* Home page */
  main.index { max-width: 42rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
  .index a { color: var(--accent); text-underline-offset: 3px; }
  .index a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

  .index header { margin-bottom: 2.75rem; }
  .index h1 {
    font-size: clamp(2.1rem, 7vw, 3.2rem); line-height: 1.05; font-weight: 800;
    letter-spacing: -0.03em; color: var(--heading); margin: 0 0 .8rem;
  }
  .index .lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 2rem; max-width: 36rem; }

  .index h2.section {
    font: 600 .75rem/1.3 "JetBrains Mono", ui-monospace, monospace;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    margin: 0 0 .9rem;
  }
  .index ol.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
  .index .posts article {
    position: relative;
    display: grid; gap: .45rem;
    padding: 1.2rem 1.3rem 1.25rem;
    background: var(--surface); border-radius: 14px;
    transition: transform .15s ease;
  }
  .index .posts article:hover { transform: translateY(-2px); }
  .index .posts .meta {
    display: flex; flex-wrap: wrap; gap: .2rem .9rem;
    font: 500 .78rem/1.4 "JetBrains Mono", ui-monospace, monospace; color: var(--muted);
  }
  .index .posts h3 { margin: 0; font-size: 1.4rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; color: var(--heading); text-wrap: balance; }
  .index .posts h3 a { color: inherit; text-decoration: none; }
  /* The whole card is the link. */
  .index .posts h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
  .index .posts h3 a:focus-visible { outline: none; }
  .index .posts article:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
  .index .posts p { margin: 0; }
  .index .posts .read { color: var(--accent); font-weight: 700; font-size: .95rem; }
  .index .posts code {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88em;
    background: var(--code-bg); color: #BF616A; padding: .05em .35em; border-radius: 5px;
  }

  .index footer { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.25rem; color: var(--muted); font-size: .9rem; }

  @media (prefers-reduced-motion: reduce) { .posts article { transition: none; } .posts article:hover { transform: none; } }
  @media (max-width: 480px) {
    main.index { padding-top: 2rem; }
    .index body { font-size: 1rem; }
    .index .posts article { padding: 1.05rem 1.05rem 1.1rem; }
  }
