/* ==========================================================================
   wasukira.com — design system
   1. Fonts   2. Tokens (light / dark)   3. Base   4. Layout
   5. Header & footer   6. Home   7. Lists & sidebar   8. Article
   9. Prose   10. Code   11. Utilities
   To change colours, edit the tokens in section 2 (both themes).
   ========================================================================== */

/* 1. Fonts — self-hosted variable fonts (SIL Open Font License) ---------- */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens ---------------------------------------------------------------- */
:root {
  /* Type */
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-name: clamp(2.25rem, 1.7rem + 2.2vw, 2.875rem);    /* 36 → 46px */
  --fs-title: clamp(2rem, 1.55rem + 1.8vw, 2.5rem);       /* 32 → 40px */
  --fs-list-title: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem); /* 22 → 26px */
  --fs-h2: clamp(1.3125rem, 1.2rem + 0.4vw, 1.5rem);      /* 21 → 24px */
  --fs-h3: 1.1875rem;                                     /* 19px */
  --fs-body: 1.0625rem;                                   /* 17px */
  --fs-ui: 0.9375rem;                                     /* 15px */
  --fs-nav: 0.875rem;                                     /* 14px */
  --fs-meta: 0.8125rem;                                   /* 13px */
  --fs-code: 0.875rem;

  /* Space (4px scale) */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;

  --wrap: 70rem;          /* 1120px */
  --gutter: 1rem;         /* 16px on phones, grows below */
  --measure: 47.5rem;     /* 760px article body */
  --radius: 6px;

  /* Light theme */
  color-scheme: light;
  --bg: #FAFAF9;
  --text: #1C2024;
  --text-2: #525860;
  --muted: #686E77;       /* brief: #717780 — darkened to meet WCAG AA (4.9:1) */
  --rule: #E2E4E7;
  --rule-strong: #C9CDD2;
  --accent: #176B60;
  --accent-hover: #0F4F47;
  --code-bg: #F0F1F2;
  --code-text: #1C2024;
  --selection: #CFE6E1;
  --sun-display: none;
  --moon-display: block;

  /* Syntax (light) — each ≥ 4.5:1 on --code-bg */
  --syn-comment: #646A72;
  --syn-keyword: #8B3A9E;
  --syn-string: #1A6B3C;
  --syn-number: #9C4A00;
  --syn-function: #1F5BA8;
  --syn-type: #7A5200;
  --syn-punct: #3C4249;
  --syn-deleted: #B3261E;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121416;
    --text: #E8EAED;
    --text-2: #B0B5BC;
    --muted: #969DA6;
    --rule: #2C3035;
    --rule-strong: #41464D;
    --accent: #6EC7B7;
    --accent-hover: #9BDACE;
    --code-bg: #1C2024;
    --code-text: #E1E4E8;
    --selection: #23514A;
    --sun-display: block;
    --moon-display: none;
    --syn-comment: #8E959E;
    --syn-keyword: #D6A6F5;
    --syn-string: #9BD3A6;
    --syn-number: #F2B47E;
    --syn-function: #8EB8F5;
    --syn-type: #E8C987;
    --syn-punct: #C3C8CE;
    --syn-deleted: #FF8A80;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121416;
  --text: #E8EAED;
  --text-2: #B0B5BC;
  --muted: #969DA6;
  --rule: #2C3035;
  --rule-strong: #41464D;
  --accent: #6EC7B7;
  --accent-hover: #9BDACE;
  --code-bg: #1C2024;
  --code-text: #E1E4E8;
  --selection: #23514A;
  --sun-display: block;
  --moon-display: none;
  --syn-comment: #8E959E;
  --syn-keyword: #D6A6F5;
  --syn-string: #9BD3A6;
  --syn-number: #F2B47E;
  --syn-function: #8EB8F5;
  --syn-type: #E8C987;
  --syn-punct: #C3C8CE;
  --syn-deleted: #FF8A80;
}

@media (min-width: 40em) { :root { --gutter: 1.5rem; } }

/* 3. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s5);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-ui);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-wrap: break-word;
}
main { flex: 1 0 auto; outline: none; }
::selection { background: var(--selection); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}
p, ul, ol, figure, blockquote { margin: 0; }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

hr, .rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* 4. Layout ---------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s7);
  padding-block: var(--s6) var(--s8);
}
@media (min-width: 60em) {
  .columns {
    grid-template-columns: minmax(0, 3fr) minmax(14rem, 1fr);  /* ≈ 75 / 25 */
    gap: var(--s8);
    padding-top: var(--s7);
  }
}

/* 5. Header & footer ------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--s4);
  top: -3rem;
  z-index: 10;
  padding: var(--s2) var(--s4);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-size: var(--fs-nav);
}
.skip-link:focus { top: var(--s3); color: var(--bg); }

.site-header { border-bottom: 1px solid var(--rule); }
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  min-height: 4rem;
  padding-block: var(--s3);
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.wordmark:hover { color: var(--text); }
.wordmark__dot { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s4);
}
.site-nav__list {
  display: flex;
  gap: var(--s5);
  list-style: none;
  padding: 0;
}
.site-nav__list a {
  display: inline-block;
  padding-block: var(--s2);
  font-size: var(--fs-nav);
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid transparent;
}
.site-nav__list a:hover { color: var(--text); }
.site-nav__list a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }

.site-nav__tools { display: flex; align-items: center; gap: var(--s1); }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.icon-button:hover { color: var(--text); background: var(--code-bg); }
.theme-toggle { display: none; }
.js .theme-toggle { display: inline-flex; }
.icon-sun { display: var(--sun-display); }
.icon-moon { display: var(--moon-display); }

@media (max-width: 26em) {
  .site-nav { width: 100%; justify-content: space-between; }
  .site-nav__list { gap: var(--s4); }
}

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--fs-meta);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3) var(--s5);
  padding-block: var(--s6);
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  list-style: none;
  padding: 0;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--accent); }

/* 6. Home identity --------------------------------------------------------- */
.identity {
  text-align: center;
  padding-block: var(--s7) var(--s6);
}
@media (min-width: 40em) { .identity { padding-block: var(--s8) var(--s7); } }
.identity__name {
  font-size: var(--fs-name);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.identity__disciplines {
  margin-top: var(--s3);
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.identity__tagline {
  max-width: 34rem;
  margin: var(--s3) auto 0;
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-2);
}
.identity__location {
  margin-top: var(--s3);
  font-size: var(--fs-meta);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* 7. Lists & sidebar ------------------------------------------------------- */
.label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s2);
}
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--accent-hover); }

.meta {
  font-size: var(--fs-meta);
  color: var(--muted);
  line-height: 1.6;
}
.meta .sep { margin-inline: 0.4em; }

.post-list { border-top: 1px solid var(--rule); margin-top: var(--s4); }
.post-item {
  padding-block: var(--s6);
  border-bottom: 1px solid var(--rule);
}
.post-item__title {
  font-size: var(--fs-list-title);
  line-height: 1.25;
}
.post-item__title a { color: var(--text); }
.post-item__title a:hover { color: var(--accent); }
.post-item__series {
  margin-top: var(--s2);
  font-size: var(--fs-meta);
  color: var(--muted);
}
.post-item__excerpt {
  margin-top: var(--s3);
  font-size: var(--fs-ui);
  line-height: 1.7;
  color: var(--text-2);
  max-width: 44rem;
}
.post-item .meta { margin-top: var(--s3); }
.read-more { font-weight: 500; white-space: nowrap; }
.more-link { margin-top: var(--s5); font-size: var(--fs-ui); font-weight: 500; }

.year-group + .year-group { margin-top: var(--s7); }

.sidebar { font-size: var(--fs-ui); }
.sidebar__section + .sidebar__section {
  margin-top: var(--s6);
  padding-top: var(--s6);
  border-top: 1px solid var(--rule);
}
.portrait {
  width: 100%;
  max-width: 200px;
  border-radius: var(--radius);
  filter: grayscale(1);
  background: var(--code-bg);
}
.sidebar__bio { margin-top: var(--s4); color: var(--text-2); line-height: 1.65; }
.sidebar__bio + .sidebar__bio { margin-top: var(--s2); }
.sidebar__more { margin-top: var(--s3); font-size: var(--fs-nav); font-weight: 500; }

.topic-list, .tag-list { list-style: none; padding: 0; }
.topic-list { margin-top: var(--s3); }
.topic-list > li { padding-block: var(--s1); }
.topic-list a { color: var(--text); }
.topic-list a:hover { color: var(--accent); }
.topic-list .count {
  margin-left: var(--s1);
  font-size: var(--fs-meta);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tag-list { margin: var(--s1) 0 var(--s1) var(--s4); padding-left: var(--s3); border-left: 1px solid var(--rule); }
.tag-list a { font-size: var(--fs-nav); color: var(--text-2); }

/* Mobile: articles first, sidebar after (source order). Show a compact profile. */
@media (max-width: 59.99em) {
  .sidebar { border-top: 1px solid var(--rule); padding-top: var(--s6); }
  .sidebar__profile { display: grid; grid-template-columns: 6rem 1fr; gap: 0 var(--s4); align-items: start; }
  .sidebar__profile picture { grid-row: span 3; }
  .sidebar__profile .sidebar__bio:first-of-type { margin-top: 0; }
}

/* 8. Pages & articles ------------------------------------------------------ */
.page, .article { padding-block: var(--s7) var(--s8); }
.page { max-width: var(--measure); }
.page__header { margin-bottom: var(--s6); }
.page__title { font-size: var(--fs-title); }
.page__lede {
  margin-top: var(--s3);
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 40rem;
}
.columns__main > .page__header { margin-bottom: var(--s5); }
.columns__main .page__header .meta { margin-top: var(--s3); }

.article {
  display: grid;
  grid-template-columns: minmax(0, var(--measure));
  grid-template-areas: "header" "toc" "body" "footer";
}
.article__header { grid-area: header; margin-bottom: var(--s6); }
.article__body { grid-area: body; }
.article__footer { grid-area: footer; }
.toc { grid-area: toc; }
@media (min-width: 72em) {
  .article--toc {
    grid-template-columns: minmax(0, var(--measure)) minmax(12rem, 15rem);
    grid-template-areas: "header ." "body toc" "footer .";
    column-gap: var(--s8);
  }
  .article--toc .toc { align-self: start; position: sticky; top: var(--s5); margin: 0; padding: 0 0 0 var(--s4); border: 0; border-left: 1px solid var(--rule); }
  .article--toc .toc summary { pointer-events: none; list-style: none; }
  .article--toc .toc summary::-webkit-details-marker { display: none; }
}

.article__title { font-size: var(--fs-title); line-height: 1.15; }
.article__subtitle {
  margin-top: var(--s3);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-2);
}
.article__meta { margin-top: var(--s4); }
.article__meta a { color: var(--text-2); }
.article__meta a:hover { color: var(--accent); }
.article__series { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--muted); }

.toc {
  margin-bottom: var(--s6);
  padding: var(--s4) 0;
  border-block: 1px solid var(--rule);
  font-size: var(--fs-nav);
}
.toc summary { cursor: pointer; }
.toc ol { list-style: none; padding: 0; margin: var(--s3) 0 0; }
.toc li { padding-block: 0.2rem; line-height: 1.45; }
.toc .toc__item--3 { padding-left: var(--s4); }
.toc a { color: var(--text-2); }
.toc a:hover, .toc a[aria-current="true"] { color: var(--accent); }

.article__footer { margin-top: var(--s7); }
.article__footer > * + * { margin-top: var(--s6); }
.series, .related, .author-bio { padding-top: var(--s5); border-top: 1px solid var(--rule); }
.series__title { margin-top: var(--s2); font-size: var(--fs-h3); }
.series__list { margin-top: var(--s3); padding-left: 1.25rem; }
.series__list li { padding-block: 0.2rem; }
.series__list li::marker { color: var(--muted); font-size: var(--fs-meta); }
.series__list [aria-current] { color: var(--text); font-weight: 500; }
.related__list { list-style: none; padding: 0; margin-top: var(--s3); }
.related__list li { padding-block: 0.3rem; }
.related__list .meta { margin-left: var(--s2); }

.author-bio { display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--s4); align-items: start; }
.author-bio__photo { width: 4.5rem; border-radius: var(--radius); filter: grayscale(1); }
.author-bio__name { font-size: var(--fs-h3); margin-top: var(--s1); }
.author-bio__name a { color: var(--text); }
.author-bio p:last-child { margin-top: var(--s2); color: var(--text-2); }

.about { display: grid; gap: var(--s5); margin-bottom: var(--s6); }
@media (min-width: 40em) {
  .about { grid-template-columns: 12rem 1fr; gap: var(--s6); align-items: start; }
}
.about .portrait { max-width: 12rem; }
.disclaimer { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--rule); font-size: var(--fs-nav); color: var(--muted); }
.contact-email { font-family: var(--font-serif); font-size: 1.375rem; }

/* 9. Prose ----------------------------------------------------------------- */
.prose {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--text);
}
.prose > * + * { margin-top: 1.25em; }
.prose p, .prose li { hyphens: manual; }
.prose h2 { font-size: var(--fs-h2); margin-top: 2.25em; }
.prose h3 { font-size: var(--fs-h3); margin-top: 1.9em; }
.prose h4 { font-size: var(--fs-body); margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.75em; }
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li > ul, .prose li > ol { margin-top: 0.4em; }
.prose li::marker { color: var(--muted); }
/* Legacy posts list items with typed "•" bullets */
.prose ul.list-unstyled { list-style: none; padding-left: 0; }
.prose strong { font-weight: 600; }

.prose blockquote {
  padding-left: var(--s5);
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-style: italic;
  color: var(--text-2);
}
.prose blockquote > * + * { margin-top: 0.75em; }

.prose figure { margin-block: 2em; }
.prose img { border-radius: var(--radius); }
.prose figcaption, .prose .caption {
  margin-top: var(--s3);
  font-size: var(--fs-meta);
  color: var(--muted);
  text-align: center;
}
/* Diagrams with transparent backgrounds stay legible in dark mode */
.prose img.diagram, .prose figure.diagram img { background: #FFFFFF; padding: var(--s3); border: 1px solid var(--rule); }

.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--fs-ui);
  line-height: 1.5;
}
.prose th, .prose td { padding: var(--s2) var(--s4) var(--s2) 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; border-bottom-color: var(--rule-strong); }
.prose hr { margin-block: 2.5em; }

.heading-anchor {
  margin-left: 0.35em;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--muted);
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.15s ease;
}
:is(h2, h3):hover > .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }
.heading-anchor:hover { color: var(--accent); }
@media (hover: none) { .heading-anchor { opacity: 0.5; } }

.katex-display { overflow-x: auto; overflow-y: hidden; padding-block: var(--s2); }

/* 10. Code ----------------------------------------------------------------- */
code, kbd, samp, pre { font-family: var(--font-mono); font-size: var(--fs-code); font-variant-ligatures: none; }
.prose :not(pre) > code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.85em;
}
.prose pre {
  margin: 0;
  padding: var(--s4) var(--s5);
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
  line-height: 1.6;
  tab-size: 4;
}
.prose .highlighter-rouge, .prose figure.highlight, .code-block { position: relative; }
.prose div.highlight, .prose figure.highlight { margin: 0; }
.copy-code {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-2);
  font: 500 0.75rem/1.4 var(--font-sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
:is(.highlighter-rouge, figure.highlight, .code-block):hover .copy-code,
.copy-code:focus-visible, .copy-code[data-copied] { opacity: 1; }
@media (hover: none) { .copy-code { opacity: 1; } }
.copy-code:hover { color: var(--text); }

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cd, .highlight .ch, .highlight .cpf { color: var(--syn-comment); font-style: italic; }
.highlight .cp { color: var(--syn-comment); }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv, .highlight .ow, .highlight .nt { color: var(--syn-keyword); }
.highlight .kt, .highlight .nc, .highlight .nn, .highlight .ne, .highlight .bp { color: var(--syn-type); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .dl { color: var(--syn-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .mb, .highlight .il, .highlight .no { color: var(--syn-number); }
.highlight .nf, .highlight .fm, .highlight .nb, .highlight .na, .highlight .nd { color: var(--syn-function); }
.highlight .o, .highlight .p, .highlight .pi { color: var(--syn-punct); }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: var(--code-text); }
.highlight .gd { color: var(--syn-deleted); }
.highlight .gi { color: var(--syn-string); }
.highlight .gh, .highlight .gu { color: var(--syn-function); font-weight: 600; }
.highlight .err { color: var(--syn-deleted); }

/* 11. Utilities ------------------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .sidebar, .toc, .copy-code, .heading-anchor, .article__footer .related { display: none !important; }
  body { background: #fff; color: #000; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

/* Inline links inside running text are underlined so they don't rely on colour alone (WCAG 1.4.1). */
.sidebar__bio a, .author-bio p a, .article__meta a, .page__lede a, .disclaimer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.sidebar__bio a:hover, .author-bio p a:hover, .article__meta a:hover { text-decoration-color: currentColor; }

/* Linked diagrams: the figure handles the backing; no link underline on the image. */
.prose figure.diagram a { display: block; text-decoration: none; }
.prose figure.diagram img { width: 100%; }
