:root {
  color-scheme: light;
  --paper: #fafafa;
  --ink: #242424;
  --muted: #616161;
  --link: #285e9c;
  --line: #dedede;
  --code: #f0f0f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1b1b1b;
  --ink: #e6e6e6;
  --muted: #adadad;
  --link: #93bce9;
  --line: #393939;
  --code: #242424;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #1b1b1b;
    --ink: #e6e6e6;
    --muted: #adadad;
    --link: #93bce9;
    --line: #393939;
    --code: #242424;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, pre:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { line-height: 1.3; font-weight: 500; }
h1 { margin: 0 0 16px; font-size: 40px; letter-spacing: -0.025em; }
h2 { margin: 0 0 22px; font-size: 25px; letter-spacing: -0.015em; }
h3 { margin: 0; font-size: 20px; font-weight: 600; }
.site-shell { width: min(100% - 48px, 920px); margin-inline: auto; }
.site-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 24px;
  font-size: 16px;
}
.wordmark { margin-right: auto; color: var(--ink); font-weight: 600; text-decoration: none; }
.theme-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
}
.theme-toggle:hover { color: var(--ink); background: var(--code); }
.theme-toggle[hidden] { display: none; }
.intro { padding-top: 24px; }
.intro h1 { max-width: 24ch; }
main p { max-width: 70ch; }
.content-section { margin-top: 72px; }
.intro + .content-section { margin-top: 48px; }
.project { margin-bottom: 56px; }
.project + .project { padding-top: 48px; }
.project:last-child { margin-bottom: 0; }
.project h2 { margin: 0; font-size: 20px; font-weight: 600; }
.project h3 a, .project h2 a { color: var(--ink); }
.project-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 24px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.project-meta { margin: 0; color: var(--muted); font: 13px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.pipeline-example, .jit-diagram { margin: 24px 0 20px; }
.pipeline-example pre { margin: 0; padding: 24px; border-left: 2px solid var(--line); }
.shell-command { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
figcaption { max-width: 75ch; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.jit-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin: 0; padding: 20px 0; list-style: none; }
.jit-flow li { position: relative; }
.jit-flow li:not(:last-child)::after {
  position: absolute;
  top: 15px;
  left: 8ch;
  right: 0;
  border-top: 1px solid var(--muted);
  content: "";
}
.jit-flow li + li::before {
  position: absolute;
  left: -40px;
  top: 11px;
  width: 32px;
  height: 8px;
  background: var(--muted);
  clip-path: polygon(0 40%, 85% 40%, 85% 0, 100% 50%, 85% 100%, 85% 60%, 0 60%);
  content: "";
}
.jit-flow strong { display: block; font: 500 19px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.jit-flow span { color: var(--muted); font-size: 14px; }
.header-nav { display: flex; gap: 20px; }
.header-nav a { color: var(--muted); text-decoration: none; }
.header-nav a:hover { color: var(--ink); text-decoration: underline; }
.header-nav a[aria-current] { color: var(--ink); }
.back-link { margin-bottom: 20px; font-size: 16px; }
.back-link a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; }
.back-link a:hover { color: var(--ink); text-decoration: underline; }
.project-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 16px; }
.page-heading { padding-top: 48px; }
.page-heading + .content-section { margin-top: 36px; }
.prose { margin-top: 24px; }
pre {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--code);
  overflow-x: auto;
  font-size: 16px;
  line-height: 1.6;
}
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  padding-block: 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 0; }
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  background: var(--paper);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

@media (max-width: 600px) {
  .site-shell { width: calc(100% - 40px); }
  .site-header { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: center; padding-top: 20px; }
  .wordmark { grid-area: 1 / 1; }
  .theme-toggle { grid-area: 1 / 2; justify-self: end; }
  .header-nav { grid-area: 2 / 1 / 2 / -1; flex-wrap: wrap; gap: 12px; font-size: 15px; }
  .intro { padding-top: 24px; }
  .page-heading { padding-top: 28px; }
  .project-heading { flex-wrap: wrap; gap: 6px; }
  .project-meta { flex-basis: 100%; }
  .pipeline-example pre { padding: 18px 14px; }
  .jit-flow { gap: 26px; }
  .jit-flow li + li::before { left: -26px; width: 18px; top: 8px; }
  .jit-flow li:not(:last-child)::after { top: 12px; left: 7ch; }
  .jit-flow strong { font-size: 15px; }
  .jit-flow span { font-size: 12px; }
  h1 { font-size: 34px; }
  body { font-size: 16px; }
  .content-section { margin-top: 48px; }
  .intro + .content-section { margin-top: 32px; }
  .project { margin-bottom: 44px; }
  pre { padding: 12px; font-size: 13px; }
}
