/* FehrCoding
   Colour only through the tokens below. Light is "paper & cobalt", dark is "ink & violet". */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* Tailwind CSS 4 palette (theme.css, v4.3.3). Only the shades used here. */
  --stone-50: oklch(98.5% 0.001 106.423); --stone-100: oklch(97% 0.001 106.424); --stone-200: oklch(92.3% 0.003 48.717);
  --stone-400: oklch(70.9% 0.01 56.259); --stone-600: oklch(44.4% 0.011 73.639); --stone-900: oklch(21.6% 0.006 56.043);
  --zinc-100: oklch(96.7% 0.001 286.375); --zinc-400: oklch(70.5% 0.015 286.067); --zinc-600: oklch(44.2% 0.017 285.786);
  --zinc-800: oklch(27.4% 0.006 286.033); --zinc-900: oklch(21% 0.006 285.885); --zinc-950: oklch(14.1% 0.005 285.823);
  --blue-50: oklch(97% 0.014 254.604); --blue-300: oklch(80.9% 0.105 251.813); --blue-400: oklch(70.7% 0.165 254.624);
  --blue-500: oklch(62.3% 0.214 259.815); --blue-600: oklch(54.6% 0.245 262.881); --blue-700: oklch(48.8% 0.243 264.376);
  --blue-800: oklch(42.4% 0.199 265.638); --blue-950: oklch(28.2% 0.091 267.935);
  --red-400: oklch(70.4% 0.191 22.216); --red-700: oklch(50.5% 0.213 27.518);
  --green-400: oklch(79.2% 0.209 151.711); --green-700: oklch(52.7% 0.154 150.069);
  --amber-50: oklch(98.7% 0.022 95.277); --amber-300: oklch(87.9% 0.169 91.605);
  --amber-700: oklch(55.5% 0.163 48.998); --amber-950: oklch(27.9% 0.077 45.635);

  /* Light: stone paper, blue ink. */
  --page: var(--stone-50);
  --surface: #fff;
  --surface-2: var(--stone-100);
  --text: var(--stone-900);
  --text-2: var(--stone-600);
  --accent: var(--blue-700);
  --accent-hover: var(--blue-800);
  --accent-soft: var(--blue-50);
  --button: var(--blue-700);
  --button-hover: var(--blue-800);
  --button-text: #fff;
  --separator: var(--stone-200);
  --line: var(--stone-400);
  --grid: var(--stone-100);
  --focus: var(--blue-600);
  --bad: var(--red-700);
  --good: var(--green-700);
  --todo: var(--amber-700);
  --todo-soft: var(--amber-50);

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-1: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --step-2: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --step-3: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
  --small: 0.9rem;
  --read: 42rem;
  --container: 1000px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  --radius: 4px;
}

/* Dark: zinc surfaces, the same blue family (lighter shades for contrast). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: var(--zinc-950); --surface: var(--zinc-900); --surface-2: var(--zinc-900);
    --text: var(--zinc-100); --text-2: var(--zinc-400);
    --accent: var(--blue-400); --accent-hover: var(--blue-300); --accent-soft: var(--blue-950);
    --button: var(--blue-600); --button-hover: var(--blue-500); --button-text: #fff;
    --separator: var(--zinc-800); --line: var(--zinc-600); --grid: var(--zinc-900); --focus: var(--blue-400);
    --bad: var(--red-400); --good: var(--green-400); --todo: var(--amber-300); --todo-soft: var(--amber-950);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: var(--zinc-950); --surface: var(--zinc-900); --surface-2: var(--zinc-900);
  --text: var(--zinc-100); --text-2: var(--zinc-400);
  --accent: var(--blue-400); --accent-hover: var(--blue-300); --accent-soft: var(--blue-950);
  --button: var(--blue-600); --button-hover: var(--blue-500); --button-text: #fff;
  --separator: var(--zinc-800); --line: var(--zinc-600); --grid: var(--zinc-900); --focus: var(--blue-400);
  --bad: var(--red-400); --good: var(--green-400); --todo: var(--amber-300); --todo-soft: var(--amber-950);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font-sans); font-size: var(--step-0); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--step-3); letter-spacing: -0.025em; line-height: 1.08; }
h2 { font-size: var(--step-2); margin-bottom: 0.75em; }
h3 { font-size: var(--step-0); }
h4 { font-size: var(--step-0); }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.3em; border-radius: 3px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
.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; }
.muted { color: var(--text-2); }
.small { font-size: var(--small); }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.narrow > *, .narrow-block { max-width: var(--read); }
.lead { font-size: var(--step-1); color: var(--text-2); line-height: 1.5; max-width: 38em; }
.h-small { font-size: var(--step-0); font-weight: 600; letter-spacing: 0; }
.crumb { font-size: var(--small); color: var(--text-2); margin-bottom: 1.5rem; }
.crumb a { color: inherit; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--button); color: var(--button-text); padding: 0.6rem 1rem; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; }

/* Buttons */
.button { display: inline-flex; align-items: center; min-height: 46px; padding: 0.65em 1.25em; background: var(--button); color: var(--button-text); border: 1.5px solid var(--button); border-radius: var(--radius); font: inherit; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--button-hover); border-color: var(--button-hover); color: var(--button-text); }
.button-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.button-quiet:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.button-small { min-height: 38px; padding: 0.4em 0.9em; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.text-link { font-weight: 500; }

/* Wordmark */
.wordmark { display: inline-flex; align-items: baseline; gap: 0; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.wordmark-fehr { font-weight: 600; color: var(--text); }
.wordmark-coding { font-weight: 400; color: var(--text-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--page); border-bottom: 1px solid var(--separator); }
.site-header-inner { max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding: 0.6rem var(--gutter); display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.site-logo { text-decoration: none; margin-right: auto; padding: 0.4rem 0; }
.nav-desktop ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-desktop a, .nav-mobile-panel nav a { display: block; padding: 0.45rem 0.7rem; color: var(--text); text-decoration: none; font-weight: 500; font-size: 1rem; }
.nav-desktop a:hover { color: var(--accent); }
.nav-desktop a[aria-current="page"], .nav-mobile-panel nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em; }
.header-tools { display: flex; align-items: center; gap: 0.6rem; }
.lang-link { font-size: 0.9rem; font-weight: 500; color: var(--text-2); text-decoration: none; padding: 0.4rem; border: 1px solid transparent; border-radius: var(--radius); line-height: 1; min-height: 34px; display: inline-flex; align-items: center; }
.lang-link:hover { color: var(--accent); border-color: var(--accent); }
.lang-link.is-unavailable { color: var(--text-2); border-style: dashed; cursor: not-allowed; }
.theme-toggle { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 34px; padding: 0 0.4rem; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-size: 0.9rem; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--text-2); }
.theme-toggle svg { display: none; }
.theme-toggle[data-mode="system"] .icon-system, .theme-toggle[data-mode="light"] .icon-light, .theme-toggle[data-mode="dark"] .icon-dark { display: block; }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary { list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 500; font-size: 0.95rem; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile[open] summary { border-color: var(--accent); color: var(--accent); }
.nav-mobile-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); width: min(19rem, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); padding: 0.6rem; }
.nav-mobile-panel ul { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.nav-mobile-panel nav a { padding: 0.75rem 0.7rem; font-size: 1.05rem; }
.nav-mobile-panel .header-tools { border-top: 1px solid var(--separator); padding-top: 0.6rem; flex-wrap: wrap; }
@media (max-width: 960px) {
  .nav-desktop, .header-tools-desktop { display: none; }
  .nav-mobile { display: block; }
  .site-header-inner { gap: 0.6rem; }
}

/* Sections */
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--separator); }
.block { margin-block: clamp(2.5rem, 2rem + 2vw, 4rem); }
.block:first-child { margin-top: 0; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 0; }
.hero + .section { border-top: 0; }
.identity { display: flex; align-items: center; gap: 0.75rem; color: var(--text-2); margin-bottom: 1.25rem; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); max-width: 16em; }
.hero-intro { font-size: var(--step-1); color: var(--text-2); line-height: 1.5; max-width: 34em; margin-bottom: 1.5rem; }
.hero-intro p { margin-bottom: 0.4em; }

/* Diagram plates */
.plate { margin: 0; background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); padding: clamp(0.75rem, 0.5rem + 1vw, 1.25rem); }
.plate figcaption { margin-top: 0.75rem; font-size: var(--small); color: var(--text-2); line-height: 1.45; }
.diagram { display: block; width: 100%; height: auto; font-family: var(--font-sans); }
.d-grid { stroke: var(--grid); stroke-width: 1; }
.d-boundary { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 6 5; }
.d-node rect { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.d-node-external rect { fill: var(--surface-2); stroke: var(--line); }
rect.d-node, .d-node-emphasis { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.75; }
.d-node-evidence rect, rect.d-node-evidence { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.d-flow { fill: none; stroke: var(--text-2); stroke-width: 1.5; }
.d-flow-dashed { stroke-dasharray: 5 4; }
.d-accent-stroke { stroke: var(--accent); }
.d-arrowhead { fill: var(--text-2); }
.d-line-thin { stroke: var(--separator); stroke-width: 1; fill: none; }
.d-label { font-size: 15px; fill: var(--text); }
.d-strong { font-weight: 600; }
.d-small { font-size: 13px; fill: var(--text-2); }
.d-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; fill: var(--text-2); }
.d-accent-fill { fill: var(--accent); }
.d-lifeline { stroke: var(--line); stroke-width: 1.25; stroke-dasharray: 4 4; fill: none; }
.d-bracket { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.d-activation { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.25; }
.d-activation-bad { fill: var(--surface); stroke: var(--bad); }
.d-bad-fill { fill: var(--bad); }
.d-tag { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.d-marker circle { fill: var(--accent); }
.d-marker text { font-family: var(--font-mono); font-size: 12px; font-weight: 500; fill: var(--surface); }
.d-legend text { font-size: 14px; fill: var(--text); }
.d-mono-strong { font-family: var(--font-mono); font-weight: 500; fill: var(--accent); }

/* Heading column + body */
.row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem 3rem; align-items: start; }
.row > h2 { font-size: var(--step-1); margin: 0.15em 0 0.75em; }
.row-body { max-width: var(--read); }
.row-body > :last-child { margin-bottom: 0; }
@media (max-width: 800px) { .row { grid-template-columns: 1fr; } }

/* Home: situations, projects */
.situations p { margin-bottom: 1.25em; }
.situations strong { font-weight: 600; }
.scope-main { font-size: var(--step-1); font-weight: 500; line-height: 1.4; margin-top: 2rem; margin-bottom: 0.5em; }
.projects { list-style: none; padding: 0; margin: 0; max-width: var(--read); }
.projects li { padding: 1rem 0; border-top: 1px solid var(--separator); }
.projects li:first-child { border-top: 0; padding-top: 0; }

.projects h3 { font-size: var(--step-1); margin-bottom: 0.3em; }
.projects p { margin-bottom: 0.4em; }
.project-study { font-weight: 500; margin-bottom: 0.4em; }
.project-featured h3 { font-size: var(--step-2); }
.project-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.95rem; color: var(--text-2); }
.project-meta a { font-weight: 500; }
.projects-full { max-width: none; }
.projects-full .project-body { max-width: var(--read); }
.project-with-media { display: grid; grid-template-columns: minmax(0, var(--read)) minmax(0, 1fr); gap: 1rem 2.5rem; align-items: start; }
.project-figure { margin: 0.25rem 0 0; }
.project-shots { display: flex; gap: 0.75rem; align-items: flex-start; }
.project-shots img { flex: 1 1 0; min-width: 0; max-width: 280px; border: 1px solid var(--separator); border-radius: var(--radius); }
.project-figure figcaption { font-size: var(--small); color: var(--text-2); margin-top: 0.5rem; }
.project-media-row { grid-template-columns: 1fr; }
/* Screenshots with a dark variant follow the site theme, including a manual choice. */
.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-dark { display: block; }
  :root:not([data-theme="light"]) .shot-light { display: none; }
}
:root[data-theme="dark"] .shot-dark { display: block; }
:root[data-theme="dark"] .shot-light { display: none; }
.project-media-row .project-shots .shot { flex: 1 1 0; min-width: 0; max-width: 200px; margin: 0; }
.project-media-row .project-shots img { max-width: 100%; }
.shot figcaption { font-size: 0.85rem; color: var(--text-2); margin-top: 0.35rem; line-height: 1.35; }
.project-name { font-size: var(--small); color: var(--text-2); margin: -0.2rem 0 0.5rem; }
.project-name strong { color: var(--text); font-weight: 600; }
.projects-full h3 { font-size: var(--step-1); }
@media (max-width: 860px) { .project-with-media { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .project-media-row .project-shots { flex-wrap: wrap; } .project-media-row .project-shots img { flex-basis: calc(50% - 0.4rem); } }
.key-point { font-weight: 600; font-size: var(--step-1); color: var(--text); }
pre { font-family: var(--font-mono); font-size: 0.92rem; line-height: 1.55; white-space: pre; overflow-x: auto; background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1.25em; }
pre code { background: none; padding: 0; font-size: inherit; }
.person-with-photo { display: grid; grid-template-columns: 12rem 1fr; gap: 2rem; align-items: start; }
.portrait-mini { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.portrait-large { border-radius: var(--radius); object-fit: cover; aspect-ratio: 600 / 790; width: 100%; max-width: 18rem; height: auto; margin-bottom: 1.5rem; }
.example-context { margin: 0.25em 0 0.75em; }
.cv-contact { color: var(--text-2); }
.cv-entry { margin-bottom: 1.5rem; }
.cv .cv-entry h3 { margin: 0.2em 0 0.35em; }
.cv-when, .cv-tech { color: var(--text-2); font-size: 0.9em; margin: 0; }
.cv-when { font-variant-numeric: tabular-nums; }
.cv-entry ul { margin: 0.25em 0 0.5em; }
@media (max-width: 640px) { .person-with-photo { grid-template-columns: 1fr; } }

/* Retry demo */
.tangle { background: var(--surface-2); }
.tangle + .section { border-top: 0; }
.tangle .narrow-block { margin-bottom: 2rem; }
.tangle-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(1.5rem, 1rem + 2vw, 3rem); align-items: start; }
.tangle .diagram .d-small { font-size: 15px; }
.tangle .diagram .d-label { font-size: 17px; }
.tangle:not(.is-enhanced) .tangle-grid { grid-template-columns: minmax(0, 1fr); max-width: var(--read); }
.trace { list-style: none; counter-reset: trace; padding: 0; margin: 0 0 1rem; font-size: 0.95rem; }
.trace li { counter-increment: trace; position: relative; padding: 0.35rem 0 0.35rem 2.2rem; }
.trace li::before { content: counter(trace); position: absolute; left: 0; top: 0.35rem; width: 1.5rem; text-align: right; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); padding-top: 0.15em; }
.trace-bad { color: var(--bad); font-weight: 500; }
.tangle-note { font-size: var(--small); color: var(--text-2); }
.tangle-lab { background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius); padding: clamp(1rem, 0.75rem + 1.5vw, 1.75rem); }
.tangle-lab[hidden] { display: none; }
.tangle-choices { border: 0; padding: 0; margin: 1.25rem 0 1rem; }
.tangle-choices legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.choice { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.55rem 0; cursor: pointer; }
.choice input { margin-top: 0.3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--button); flex: none; }
.choice-text { display: grid; gap: 0.1rem; }
.choice-label { font-weight: 500; line-height: 1.35; }
.choice-hint { font-size: var(--small); color: var(--text-2); }
.tangle-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tangle-results:empty { display: none; }
.tangle-results { margin-top: 1.5rem; border-top: 1px solid var(--separator); padding-top: 1.25rem; }
.results-title { margin-bottom: 1rem; }
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; }
.case h4 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.case .trace { font-size: 0.88rem; }
.case-result { margin: 0; font-size: 0.92rem; }
.case-result div { display: flex; gap: 0.5rem; }
.case-result dt { color: var(--text-2); }
.case-result dd { margin: 0; }
.case-good .case-result div:last-child dd { color: var(--good); font-weight: 500; }
.case-bad .case-result div:last-child dd { color: var(--bad); font-weight: 500; }
.invoice-count { font-weight: 600; margin-right: 0.35rem; }
.invoice-chip { display: inline-block; font-family: var(--font-mono); font-size: 0.78rem; padding: 0 0.35em; margin-right: 0.25rem; border: 1px solid var(--line); border-radius: 3px; }
.verdict { margin-top: 1.25rem; }
.invariant { font-weight: 600; }
.trace-in { animation: trace-in 220ms ease-out both; }
@keyframes trace-in { from { opacity: 0; } to { opacity: 1; } }
.explanation { margin-top: 2rem; max-width: var(--read); }
.explanation summary { cursor: pointer; padding: 0.5rem 0; font-weight: 600; color: var(--accent); }
.explanation-body { padding-top: 0.5rem; }
.explanation-body h3 { font-size: var(--step-1); }
@media (max-width: 900px) { .tangle-grid { grid-template-columns: 1fr; } }

/* Contact */
.big-email { font-size: var(--step-2); font-weight: 500; overflow-wrap: anywhere; margin-block: 0.5rem 1rem; }

/* Pages */
.page-head { padding-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); padding-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); max-width: 18em; }
.page-body { padding-bottom: var(--section); }
.prose > * { max-width: var(--read); }
.prose h2 { margin-top: 2em; }
.service-list { margin: 0; display: grid; gap: 1rem; }
.service-list dt { font-weight: 600; margin-bottom: 0.2rem; }
.service-list dd { margin: 0; color: var(--text-2); }
.narrow-block h3 { margin-top: 1.5em; margin-bottom: 0.25em; }
.price { font-weight: 600; }
.code-source { font-size: var(--small); color: var(--text-2); margin-top: -0.75em; }
.prose li code { overflow-wrap: anywhere; font-size: 0.8em; }
.prose > pre { max-width: 100%; }
.facts-list { list-style: none; padding: 0; margin: 0 0 1.5em; }
.facts-list li { padding: 0.55rem 0; border-top: 1px solid var(--separator); }
.facts-list li:last-child { border-bottom: 1px solid var(--separator); }

.study-plate-row { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 2.5rem; align-items: start; margin-bottom: 2rem; }
@media (max-width: 900px) { .study-plate-row { grid-template-columns: 1fr; } }
.study-body { padding-bottom: var(--section); }
.facts { margin: 0; }
.facts > div { padding: 0.6rem 0; border-bottom: 1px solid var(--separator); }
.facts dt { font-size: var(--small); color: var(--text-2); }
.facts dd { margin: 0; }
.ph-block { background: var(--todo-soft); border: 1px dashed var(--todo); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0 0 1.25rem; }
.ph-tag { display: block; font-size: 0.75rem; font-weight: 600; color: var(--todo); }
.ph-block p { margin: 0; }

.note-list { list-style: none; padding: 0; }
.note-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--separator); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }
.note-list time { font-size: var(--small); color: var(--text-2); }
.note-list p { flex-basis: 100%; margin: 0; color: var(--text-2); }

.language-choice { padding-block: clamp(4rem, 3rem + 6vw, 8rem); max-width: 40rem; }
.language-list { list-style: none; padding: 0; }
.language-list li { border-top: 1px solid var(--separator); }
.language-list li:last-child { border-bottom: 1px solid var(--separator); }
.language-list a { display: grid; gap: 0.15rem; padding: 1.25rem 0; text-decoration: none; color: var(--text); }
.language-list a:hover .lc-name { color: var(--accent); }
.lc-name { font-size: var(--step-2); font-weight: 600; }
.lc-sub { color: var(--text-2); }
.notfound { padding-bottom: var(--section); }

/* Footer */
.site-footer { border-top: 1px solid var(--separator); }
.site-footer-inner { max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding: 2rem var(--gutter) 2.5rem; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 2rem; font-size: 0.95rem; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer nav a { color: var(--text); }
.site-footer nav a:hover { color: var(--accent); }
.footer-small { font-size: var(--small); color: var(--text-2); }

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

@media print {
  :root { --page: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --text-2: #333; --accent: #000; --separator: #bbb; --line: #666; --grid: #eee; }
  .site-header, .site-footer, .theme-toggle, .tangle-lab, .skip-link { display: none !important; }
  .cv-entry, .facts-list li { break-inside: avoid; }
  .cv h2 { break-after: avoid; }
  body { font-size: 11pt; }
  .section { padding-block: 1.5rem; }
  a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .plate { break-inside: avoid; }
}

/* Homepage work section: one main project with its diagram, one with its screenshot. */
.home-work h2 { margin-bottom: 1.5rem; }
.work-main { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem 2.5rem; align-items: start; }
.work-main-text { max-width: var(--read); }
@media (max-width: 860px) { .work-main { grid-template-columns: 1fr; } }
.work-main h3 { font-size: var(--step-2); margin-bottom: 0.4em; }
.work-main-figure { margin: 0; }
.work-second { display: grid; grid-template-columns: minmax(0, var(--read)) minmax(0, 1fr); gap: 1rem 2.5rem; align-items: start; padding-block: 2.5rem; border-bottom: 1px solid var(--separator); }
.work-second h3 { font-size: var(--step-1); }
.work-second-figure { margin: 0; }
.work-second-figure img { max-width: 260px; width: 100%; border: 1px solid var(--separator); border-radius: var(--radius); }
.work-second-figure figcaption { font-size: var(--small); color: var(--text-2); margin-top: 0.5rem; }
.work-more { margin-top: 1rem; color: var(--text-2); }
.work-note { grid-template-columns: minmax(0, var(--read)); }
.work-note h3 a { color: var(--text); text-decoration: none; }
.work-note h3 a:hover { color: var(--accent); text-decoration: underline; }
.note-label { font-size: var(--small); color: var(--text-2); margin-bottom: 0.4rem; }
.home-contact .big-email { margin-top: 0; }
@media (max-width: 860px) { .work-second { grid-template-columns: 1fr; } }

/* Homepage demo teaser. */
.demo-teaser { background: var(--surface-2); }
.demo-teaser-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.5rem 2.5rem; align-items: start; }
.demo-teaser .plate { max-width: none; }
@media (max-width: 860px) { .demo-teaser-grid { grid-template-columns: 1fr; } }
.home-contact { border-top: 0; }

/* Simplified diagram: larger labels, numbered legend underneath. */
.diagram-simple .d-label { font-size: 18px; }
.diagram-simple .d-small { font-size: 15px; }
.diagram-legend { margin: 0.75rem 0 0; padding-left: 1.4rem; font-size: 0.95rem; }
.diagram-legend li { margin-bottom: 0.2rem; }
.diagram-key { font-size: var(--small); color: var(--text-2); margin: 0.4rem 0 0; }
.project-own { font-size: var(--small); color: var(--text-2); margin: -0.2rem 0 0.6rem; }
.home-note { border-top: 1px solid var(--separator); padding-block: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }
.home-note .h-note { margin-bottom: 0.25rem; }
.note-lead { color: var(--text-2); margin: 0; }

/* The demo stays usable but takes less room than the real work. */
.tangle { padding-block: clamp(2rem, 1.5rem + 2vw, 3rem); }
.tangle .narrow-block { margin-bottom: 1.25rem; }
.tangle .plate { max-width: 460px; }

/* Owner-written intro: first paragraph as lead, the rest at reading size. */
.hero-intro { max-width: 40em; }
.hero-intro p + p { font-size: var(--step-0); color: var(--text); }

/* Note pages: room before the footer. */
.note .prose { padding-bottom: var(--section); }
.h-note { font-size: var(--step-1); }
.h-note a { color: var(--text); text-decoration: none; }
.h-note a:hover { color: var(--accent); text-decoration: underline; }
.aside-topic { color: var(--text-2); font-style: italic; }
.test-refs { margin: -0.25rem 0 1.5rem; font-size: var(--small); }
.test-refs summary { cursor: pointer; color: var(--accent); }
.test-refs ul { margin: 0.5rem 0 0; }
.test-refs code { overflow-wrap: anywhere; }

/* Deliverable examples on Services. */
.example { margin: 0.25rem 0 2rem; }
.example-title { font-weight: 600; margin: 0 0 0.1rem; }
.example-more { margin-top: 0.5rem; }
.example-more summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 0.95rem; }
.example-more .excerpt { margin-top: 0.5rem; }
.example-meta { font-size: var(--small); color: var(--text-2); margin: 0 0 0.5rem; }
.excerpt { margin: 0; padding: 0.9rem 1.1rem; background: var(--surface); border: 1px solid var(--separator); border-left: 3px solid var(--accent); border-radius: var(--radius); font-size: 0.95rem; }
.excerpt p:last-child, .excerpt ul:last-child { margin-bottom: 0; }
.work-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 1.5rem 0 0; font-weight: 500; }
