/* Fonts (self-hosted, SIL OFL) */
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-sans); font-size: var(--step-0); line-height: 1.6; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.15; margin: 0 0 var(--space-2); }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 600; }
@media (min-width: 768px) { h1 { font-size: var(--step-4); } }
p, ul, ol { margin: 0 0 var(--space-2); }
a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* Layout helpers */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--space-2); }
@media (min-width: 768px) { .wrap { padding-inline: var(--space-4); } }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--accent); color: var(--on-accent); padding: var(--space-1) var(--space-2); }
.skip-link:focus { left: var(--space-2); }

/* Buttons */
/* @macro button: The main call-to-action button. Put it on an a element with a path or https href, inside a p with class button-row. */
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0.55rem 1rem; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(1.05); }
/* @macro button-lg: Added beside button for a larger button, for the one action a block is about. */
.button-lg { padding: 0.8rem 1.3rem; }
/* @macro button-row: A paragraph that holds one or more buttons side by side and wraps them on a narrow screen. */
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }

/* Macros: every expanded macro sits in this box, so a layer positioned inside it can never cover the rest of the page */
/* @macro macro-box: The wrapper around every expanded macro (added by the system, never written in markup); a positioned layer is held inside it. */
.macro-box { position: relative; overflow: hidden; isolation: isolate; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Logo */
.wordmark-svg { display: block; height: 22px; width: auto; }
.wordmark-svg .slash { fill: var(--accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 60px; }
.wordmark { display: inline-flex; color: var(--fg); text-decoration: none; padding-block: var(--space-1); }
/* Sections add links: no link breaks inside, the nav wraps to a second row instead of overflowing. */
.nav-desktop { display: none; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--space-1) var(--space-3); }
.nav-desktop a { white-space: nowrap; }
.nav-desktop a:not(.button) { color: var(--muted); text-decoration: none; }
.nav-desktop a:not(.button):hover { color: var(--fg); }
.nav-mobile summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0.35rem 0.9rem; border: 1px solid var(--fg); border-radius: 4px; cursor: pointer; list-style: none; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: 0 var(--space-2) var(--space-2); }
.nav-mobile nav a { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-family: var(--font-serif); font-size: var(--step-1); text-decoration: none; }
.nav-mobile nav a:last-child { border-bottom: 0; }
/* The theme button sits after the menu: the wordmark takes the free space so the button and the menu stay on the right. */
.header-inner > .wordmark { margin-right: auto; }
@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
}

/* Front page */
.hero { padding-block: var(--space-5) var(--space-4); }
.hero h1 { max-width: 18ch; }
.hero .lead { max-width: 46ch; color: var(--muted); font-size: var(--step-1); }
.hero .lead p:last-child { color: var(--fg); font-size: var(--step-0); font-weight: 600; }

/* Page hero with an illustration beside the heading (ps doc:uli61i653k74v7naftfr) */
.prose > .page-hero.has-illustration { max-width: none; }
.page-hero.has-illustration { display: grid; gap: var(--space-3); align-items: center; margin-bottom: var(--space-3); }
.page-hero-text > :last-child { margin-bottom: 0; }
.page-hero-art { width: 100%; max-width: 560px; height: auto; }
@media (min-width: 820px) { .page-hero.has-illustration { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-4); } }
/* On content pages the heading is short: anchor it to the drawing's baseline and keep the drawing smaller. */
.prose .page-hero.has-illustration { align-items: end; }
.prose .page-hero-art { max-width: 420px; justify-self: end; }

/* Spot drawings beside headings: ### Heading {.spot-name} in the content Markdown */
:is(h2, h3)[class*="spot-"] { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: var(--space-2); align-items: center; }
:is(h2, h3)[class*="spot-"]::before { content: ""; width: 56px; height: 56px; background-position: center; background-size: contain; background-repeat: no-repeat; }
.spot-integration::before { background-image: url(img/illustrations/spot-integration.svg); }
.spot-sheet::before { background-image: url(img/illustrations/spot-sheet.svg); }
.spot-ai::before { background-image: url(img/illustrations/spot-ai.svg); }
.spot-tool::before { background-image: url(img/illustrations/spot-tool.svg); }
.spot-poc::before { background-image: url(img/illustrations/spot-poc.svg); }
.spot-coin::before { background-image: url(img/illustrations/spot-coin.svg); }
.spot-net::before { background-image: url(img/illustrations/spot-net.svg); }
.spot-key::before { background-image: url(img/illustrations/spot-key.svg); }
.spot-wrench::before { background-image: url(img/illustrations/spot-wrench.svg); }
.spot-book::before { background-image: url(img/illustrations/spot-book.svg); }
.spot-change::before { background-image: url(img/illustrations/spot-change.svg); }
.spot-small::before { background-image: url(img/illustrations/spot-small.svg); }

/* Numbered steps: {.steps role="list"} above an ordered list in the content Markdown */
/* @macro steps: Added to an ol (with role list) to number its steps with round badges. */
ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: var(--space-2); align-items: baseline; }
ol.steps > li::before { content: counter(step); display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: var(--step--1); }

.block { padding-block: var(--space-4); border-top: 1px solid var(--line); }
.block > h2 { max-width: var(--measure); }
.block-body > * { max-width: var(--measure); }
.help ul { padding-left: 1.2em; }
.help li { margin-bottom: 0.35rem; }
.examples h3 { margin-top: var(--space-3); padding-top: var(--space-1); border-top: 2px solid var(--accent); }
.fit blockquote, .prose blockquote { margin: 0 0 var(--space-2); padding-left: var(--space-2); border-left: 3px solid var(--accent); font-family: var(--font-serif); font-size: var(--step-1); }
.cta { padding-bottom: var(--space-5); }
.featured .cards, .demos .cards { max-width: 52rem; margin-top: var(--space-3); }
/* The demo badge: on-accent on accent, a pair ContrastTests already guards. */
/* @macro demo-mark: A small accent label on a span, to mark something as a demo or a sample. */
.demo-mark { display: inline-block; margin-bottom: var(--space-1); padding: 0.1rem 0.5rem; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
@media (min-width: 768px) {
  .help ul { columns: 2; column-gap: var(--space-4); max-width: none; }
}
@media (min-width: 1024px) {
  /* The column break drops the top margin of the card that opens column 2, so column 1 must not have one either. */
  .examples .block-body { columns: 2; column-gap: var(--space-4); padding-top: var(--space-3); }
  .examples .block-body > :first-child { margin-top: 0; }
  .examples .block-body > * { max-width: none; }
  .examples h3 { break-after: avoid; }
  .examples p { break-inside: avoid; }
}

/* Article pages */
/* @macro prose: The reading column of an article or a content page. Macro output already sits inside it; do not add it again. */
.prose { padding-block: var(--space-4) var(--space-5); }
.prose > * { max-width: var(--measure); }
.prose h2 { margin-top: var(--space-4); }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li { margin-bottom: 0.35rem; }

/* Sections and article cards */
.breadcrumbs { margin-bottom: var(--space-3); color: var(--muted); font-size: var(--step--1); }
.breadcrumbs a { color: var(--muted); }
.prose > .cards { max-width: 52rem; }
/* @macro cards: A ul or ol of cards laid out as a grid with no bullets. Each li holds one card. */
.cards { display: grid; gap: var(--space-3); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.prose .cards { padding: 0; }
.prose .cards li { margin: 0; }
/* @macro card: One card inside a li of cards: an a element with an optional picture and a div with class card-text. */
.card { display: grid; gap: var(--space-2); color: var(--fg); text-decoration: none; }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
/* @macro card-text: The text part of a card: a short underlined title in a p or strong, then a muted p. */
.card .card-text > :is(h2, h3) { margin: 0 0 var(--space-1); font-size: var(--step-1); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.card:hover .card-text > :is(h2, h3) { text-decoration-color: var(--accent); }
.card .card-text p { margin: 0; color: var(--muted); }
@media (min-width: 760px) {
  .card:has(picture) { grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: var(--space-3); }
}

/* @macro article-lead: A p with a larger muted type size, for an opening sentence. */
.article-lead { color: var(--muted); font-size: var(--step-1); }
.article-hero { margin: var(--space-3) 0 var(--space-4); }
.article-hero img { border-radius: var(--radius); }
/* @macro media: Added to a figure that holds an img, so it gets prose spacing and rounded corners; a figcaption below it is muted. */
.prose figure.media { margin: var(--space-3) 0; }
.prose figure.media img { border-radius: var(--radius); }
.prose figcaption { margin-top: var(--space-1); color: var(--muted); font-size: var(--step--1); }
/* Article tables: full measure, scroll sideways on narrow screens instead of widening the page. */
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: var(--space-2) 0 var(--space-3); font-size: var(--step--1); }
.prose th, .prose td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; border-bottom: 2px solid var(--accent); }
.article-related h2 { margin-top: 0; }
.prose > .article-related { max-width: 52rem; margin-top: var(--space-5); }
.article-related .cards { margin-top: var(--space-3); }

/* Contact form */
/* @macro contact-about: The nearest thing to a callout: a bold p with an accent bar on its left, for one sentence that must stand out. */
.contact-about { padding-left: var(--space-2); border-left: 3px solid var(--accent); font-weight: 600; }
.contact-form { display: grid; gap: var(--space-2); max-width: 40rem; margin-top: var(--space-3); }
.field { display: grid; gap: 0.3rem; }
.field label { font-weight: 600; }
.optional { color: var(--muted); font-weight: 400; }
.field input, .field textarea { width: 100%; min-height: 44px; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--fg); font: inherit; }
.field textarea { min-height: 10rem; resize: vertical; }
.field input.invalid, .field textarea.invalid { border: 2px solid var(--fg); }
.validation-message { font-size: var(--step--1); font-weight: 600; }
.validation-message::before { content: "! "; color: var(--accent); }
.form-note { color: var(--muted); font-size: var(--step--1); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { padding-block: var(--space-3); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.footer-inner p { margin: 0; }
.site-footer a { color: var(--muted); }

/* Portrait */
.prose > .with-portrait { max-width: none; }
.with-portrait > div > * { max-width: var(--measure); }
.portrait { max-width: 320px; margin: 0 0 var(--space-3); border-radius: var(--radius); }
@media (min-width: 1024px) {
  .with-portrait { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
  .with-portrait picture { order: 2; }
  .with-portrait .portrait { margin: 0; }
}

/* The shelf at /bibliotek */
.shelf-page > .shelf-cards, .shelf-page > .shelf-index { max-width: 52rem; }
.shelf-lead { color: var(--muted); }
.shelf-cards, .shelf-index { display: grid; gap: var(--space-3); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.prose .shelf-cards, .prose .shelf-index { padding: 0; }
.prose .shelf-cards li, .prose .shelf-index li { margin: 0; }
.book-card { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-2); align-items: start; }
.book-cover { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: var(--radius); color: var(--fg); font-family: var(--font-serif); font-size: var(--step-3); font-weight: 600; border: 1px solid var(--line); }
.book-cover.tone-0 { background: color-mix(in srgb, var(--accent) 35%, var(--bg)); }
.book-cover.tone-1 { background: color-mix(in srgb, var(--fg) 10%, var(--bg)); }
.book-cover.tone-2 { background: color-mix(in srgb, var(--accent) 60%, var(--bg)); }
.book-cover.tone-3 { background: color-mix(in srgb, var(--fg) 20%, var(--bg)); }
.book-text { min-width: 0; }
.prose .book-text h2 { margin: 0 0 var(--space-1); font-size: var(--step-1); overflow-wrap: anywhere; }
.book-text p { margin: 0 0 var(--space-1); }
.book-intro { color: var(--muted); }
.book-meta { color: var(--muted); font-size: var(--step--1); }
.shelf-index { gap: var(--space-1); }
.shelf-index-count { color: var(--muted); font-size: var(--step--1); }
@media (min-width: 760px) {
  .book-card { grid-template-columns: 6rem minmax(0, 1fr); gap: var(--space-3); }
}
.teaser { font-size: var(--step--1); overflow-wrap: anywhere; }
.teaser-label { display: inline-block; padding: 0 0.4em; border: 1px solid var(--accent); border-radius: var(--radius); font-weight: 600; }
.teaser time { color: var(--muted); }

/* Reading page: the book bar and the entry foot */
/* The book bar is the entry's only header (part:d6fx5cnkfk9qr9ktmf7m): full width and sticky, its content on the text column's edges. */
.book-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line, currentColor); font-size: var(--step--1); }
.book-bar-inner { display: flex; align-items: center; gap: var(--space-3); min-height: 60px; }
.book-bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.book-bar-position { flex: 1; text-align: center; white-space: nowrap; color: var(--muted); }
.book-bar .wordmark { flex: none; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; }
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after { display: block; width: 1.25rem; height: 2px; background: currentColor; content: ""; }
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before { position: absolute; top: -6px; }
.nav-toggle-icon::after { position: absolute; top: 6px; }
.book-bar-tools { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; }

/* The visitor's theme button (part:3i8ysbabbabw9uvwav3q): hidden until theme.js shows it, one icon for the current choice. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--fg); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--accent); }
.theme-icon { display: none; }
.theme-toggle[data-state="auto"] .theme-icon-auto,
.theme-toggle[data-state="light"] .theme-icon-light,
.theme-toggle[data-state="dark"] .theme-icon-dark { display: block; }
.entry-foot { margin-top: var(--space-4); padding-top: var(--space-2); border-top: 1px solid var(--line, currentColor); color: var(--muted); font-size: var(--step--1); }
.entry-foot p { margin: 0 0 var(--space-1); }

/* An entry with layout page (part:mor4s3fi96337iil8jnz): a landing page in its book, built like the front page. The hero band
   reuses .hero and .page-hero; each section of the body is a full-width band (.block) whose content keeps the site's width,
   so a class from the owner (on the root or a sektion) can colour the whole band. Mobile first. */
.layout-page .page-hero-art picture, .layout-page .page-hero-art img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.layout-page .entry-body > section.block { --band-pad: var(--space-2); padding-inline: max(var(--band-pad), calc((100% - var(--wrap)) / 2 + var(--band-pad))); }
.layout-page .entry-body > section.block > :is(h2, h3, h4, p, ul, ol, blockquote) { max-width: var(--measure); }
.layout-page .entry-body > :not(section) { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--space-2); }
.layout-page .entry-body figure.media { margin: var(--space-3) 0; }
.layout-page .entry-body figure.media img { border-radius: var(--radius); }
.layout-page .entry-body figcaption { margin-top: var(--space-1); color: var(--muted); font-size: var(--step--1); }
.layout-page .entry-body table { display: block; overflow-x: auto; border-collapse: collapse; }
.layout-page .entry-foot { margin-bottom: var(--space-4); }
@media (min-width: 768px) {
  .layout-page .entry-body > section.block { --band-pad: var(--space-4); }
  .layout-page .entry-body > :not(section) { padding-inline: var(--space-4); }
}

/* The navigation: a page on a phone, a panel on a desktop. Without script the server renders it open. */
.book-nav { z-index: 20; overflow-y: auto; background: var(--bg); color: var(--fg); padding: var(--space-3); }
.book-nav a { color: var(--fg); }
.book-nav-top { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.book-nav-tabs { display: flex; gap: var(--space-3); border-bottom: 1px solid var(--line); margin-bottom: var(--space-3); }
.book-nav-tabs a { padding: var(--space-1) 0; text-decoration: none; }
.book-nav-tabs a[aria-current="true"] { font-weight: 600; border-bottom: 2px solid var(--fg); }
.book-nav summary { cursor: pointer; font-weight: 600; padding-block: var(--space-1); }
.book-nav-book { margin: 0 0 var(--space-2); }
.book-nav-book > summary { font-size: var(--step-1); }
.nav-entries .nav-entries { margin-left: var(--space-3); }
.nav-entries summary a { font-weight: inherit; }
.nav-entries, .nav-headings { list-style: none; margin: 0; padding: 0; }
.nav-entries > li { margin: 0 0 var(--space-1); }
.nav-entries a[aria-current="page"] { font-weight: 600; }
.nav-headings { margin: var(--space-1) 0 var(--space-1) var(--space-3); font-size: var(--step--1); }
.nav-headings .level-3 { margin-left: var(--space-3); }

@media (max-width: 47.99rem) {
  .book-nav.is-open { position: fixed; inset: 0; background: var(--bg); color: var(--fg); }
  body:has(.book-nav.is-open) { overflow: hidden; }
  /* The book bar is two rows: the wordmark and the icon, then the book and the place in it. */
  .book-bar-inner { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "word toggle" "name pos"; gap: 0 var(--space-2); min-height: 0; padding-block: var(--space-1); }
  .book-bar .wordmark { grid-area: word; justify-self: start; }
  .book-bar-tools { grid-area: toggle; justify-self: end; }
  .book-bar-name { grid-area: name; }
  .book-bar-position { grid-area: pos; text-align: right; }
}

@media (min-width: 48rem) {
  .book-nav.is-open { position: fixed; top: 0; bottom: 0; right: 0; width: 26rem; max-width: 100%; background: var(--bg); color: var(--fg); box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.25); }
}

/* A green hint on the navigation icon until the navigation has been opened once (the class is added by library.js). */
@keyframes nav-hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.55); }
  50% { box-shadow: 0 0 0 0.6rem rgba(46, 160, 67, 0); }
}
.nav-toggle.is-hint { border-radius: 50%; animation: nav-hint 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .nav-toggle.is-hint { animation: none; }
}

/* The install offer (install.js): a small card at the bottom, not modal, never over the reading. */
.install-card { position: fixed; z-index: 6; left: var(--space-2); right: var(--space-2); bottom: var(--space-2); max-width: 26rem; margin-inline: auto; padding: var(--space-2); background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2); }
.install-card p { margin: 0 0 var(--space-2); }
.install-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.button-quiet { background: transparent; color: var(--fg); border: 1px solid var(--line); }
