/* 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 */
.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); }
.button-lg { padding: 0.8rem 1.3rem; }

@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; }
@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 */
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. */
.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 */
.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; }
.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; }
.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); }
.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); }
}

.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); }
.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-contact { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 2px solid var(--accent); }
.article-contact h2, .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 */
.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; }
}
