/* The blog's pages (src/blog.js): the site's palette and display face, set for reading. */
@font-face {
  font-family: Lora; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/lora-latin-wght.woff) format("woff");
}
@font-face {
  font-family: Lora; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(/fonts/lora-latin-wght-italic.woff) format("woff");
}
:root {
  color-scheme: dark;
  --background: oklch(15.5% .03 272);
  --foreground: oklch(93% .015 85);
  --muted-foreground: oklch(70% .025 82);
  --primary: oklch(79% .125 82);
  --border: oklch(79% .125 82 / .16);
  --code-background: oklch(19% .03 272);
  --font-display: Lora, ui-serif, Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 1.0625rem/1.7 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-underline-offset: .2em; }
a:hover { opacity: .85; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 2px; }

header.site, footer.site, main {
  width: min(44rem, 100% - 32px);
  margin-inline: auto;
}
header.site {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem;
  padding-block: 1.5rem;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
}
header.site nav { display: flex; gap: 1.25rem; }
header.site nav a { color: var(--muted-foreground); text-decoration: none; }
header.site nav a:hover { color: var(--foreground); }
.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: .32em; text-decoration: none;
}
main { padding-block: 2rem 4rem; }
footer.site {
  padding-block: 2rem 3rem; border-top: 1px solid var(--border);
  color: var(--muted-foreground); font-size: .85rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: .25rem 0 1rem; }
h2 { font-size: 1.6rem; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
h4 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.lede { color: var(--muted-foreground); font-size: 1.15rem; margin: 0 0 1rem; }
.meta { color: var(--muted-foreground); font-size: .9rem; margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted-foreground); }
.crumbs a { color: inherit; }

.posts { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2rem; }
.posts article { padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.posts h2 { margin: 0 0 .35rem; font-size: 1.5rem; }
.posts h2 a { color: var(--foreground); text-decoration: none; }
.posts h2 a:hover { color: var(--primary); }
.posts p { margin: .5rem 0 0; }

article header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.body { overflow-wrap: break-word; }
.body img { max-width: 100%; height: auto; border-radius: 8px; }
.body blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 3px solid var(--primary); color: var(--muted-foreground); font-style: italic;
}
.body code {
  font: .9em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-background); padding: .1em .35em; border-radius: 4px;
}
.body pre {
  overflow-x: auto; padding: 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--code-background);
}
.body pre code { padding: 0; background: none; }
.body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.body th, .body td { border: 1px solid var(--border); padding: .4rem .65rem; text-align: left; }
.body hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* The book-a-demo card (demoCard in src/blog.js): held at the foot of the screen, quiet enough to
   read past; its X checks the hidden checkbox before it, which hides it. */
.demo-close { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.demo-close:checked + .demo { display: none; }
.demo {
  position: sticky; bottom: .75rem; z-index: 10; display: grid; gap: .6rem;
  margin-top: 3rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: oklch(15.5% .03 272 / .96); backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px oklch(0% 0 0 / .25);
  color: var(--muted-foreground); font-size: .85rem; line-height: 1.5;
}
.demo-head { display: flex; align-items: center; gap: .75rem; }
.demo h2 { flex: 1; margin: 0; font-size: 1rem; color: var(--foreground); }
.demo label {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin: -.25rem;
  border-radius: 4px; color: var(--muted-foreground); font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.demo label:hover { color: var(--foreground); background: var(--border); }
.demo-close:focus-visible + .demo label { outline: 2px solid var(--primary); outline-offset: 2px; }
.demo ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: .35rem; }
.demo li { counter-increment: step; display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.demo li::before {
  content: counter(step); display: grid; place-items: center; flex-shrink: 0;
  width: 1.25rem; height: 1.25rem; border: 1px solid var(--border); border-radius: 50%;
  color: var(--primary); font-size: .7rem;
}
.demo-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.demo-foot p { margin: 0; }
.demo-foot p a { color: var(--foreground); }
.demo-button {
  padding: .35rem .85rem; border: 1px solid var(--primary); border-radius: 6px;
  font-weight: 500; text-decoration: none; white-space: nowrap;
}
.demo-button:hover { background: oklch(79% .125 82 / .12); opacity: 1; }
@media (min-width: 40rem) {
  .demo { bottom: 1rem; }
  .demo ol { grid-template-columns: repeat(3, auto); justify-content: start; gap: 1.5rem; }
}
