:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --surface: #fff;
  --ink: #172033;
  --muted: #475569;
  --link: #1747a6;
  --line: #cbd5e1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #172033;
    --ink: #f1f5f9;
    --muted: #cbd5e1;
    --link: #a5c4ff;
    --line: #475569;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.125rem/1.65 system-ui, sans-serif; }
a { color: var(--link); text-underline-offset: .2em; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
nav, main { width: min(100% - 2.5rem, 52rem); margin-inline: auto; }
nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
main { padding-block: clamp(2.5rem, 7vw, 5rem); }
header { margin-bottom: 2.5rem; }
h1, h2 { line-height: 1.14; letter-spacing: -.025em; text-wrap: balance; }
h1 { margin: .25em 0; font-size: clamp(2.4rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.55rem, 4vw, 2.15rem); }
p { max-width: 70ch; }
.byline, figcaption { color: var(--muted); font-size: .95rem; }
.intro { font-size: clamp(1.15rem, 3vw, 1.35rem); }
figure { margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
figure img { display: block; width: 100%; height: auto; }
figcaption { padding: .8rem 1rem; }
section { margin-top: 2.8rem; }
footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

h3 { margin: 2rem 0 .75rem; font-size: 1.25rem; line-height: 1.3; }
code { padding: .08em .24em; border-radius: .25rem; background: var(--surface); overflow-wrap: anywhere; font-size: .88em; }
.pipeline { margin-block: 1rem 1.5rem; }
.pipeline figcaption { border-bottom: 1px solid var(--line); font-weight: 600; }
.pipeline ol { display: grid; grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); gap: 1.4rem; margin: 0; padding: 1rem; list-style: none; }
.pipeline li { position: relative; padding: .75rem; border: 1px solid var(--line); border-radius: .55rem; font-size: .9rem; }
.pipeline li + li::before { content: "→" / ""; position: absolute; inset-inline-start: -1.15rem; top: .7rem; color: var(--link); }
.pipeline li span { display: block; margin-top: .25rem; color: var(--muted); }
@media (max-width: 44rem) {
  .pipeline ol { grid-template-columns: 1fr; }
  .pipeline li + li::before { content: "↓" / ""; inset-inline-start: 1rem; top: -1.4rem; }
}

.article-links { display: flex; flex-wrap: wrap; gap: .55rem 1.25rem; padding: 0; list-style: none; font-size: .95rem; }
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .85rem; }
.screenshot-grid figure { min-width: 0; }
.screenshot-grid a { display: block; padding: .5rem; background: #10141d; }
.screenshot-grid img { aspect-ratio: 4 / 3; object-fit: contain; }
.screenshot-grid a:focus-visible { outline-offset: -3px; }
.screenshot-grid figcaption { padding: .65rem .8rem; }
.example-steps { padding-left: 1.4rem; }
.example-steps li { padding-left: .3rem; }
.example-steps p { margin: .25rem 0 1rem; }
.example-table { width: 100%; table-layout: fixed; overflow-wrap: anywhere; margin-block: 1rem 2rem; border-collapse: collapse; text-align: left; font-size: .9rem; }
.example-table caption { padding: .5rem 0; text-align: left; color: var(--muted); }
.example-table th, .example-table td { border-bottom: 1px solid var(--line); padding: .55rem .45rem; vertical-align: top; }
.example-table thead { background: var(--surface); }
#screenshots .screenshot-grid:first-of-type img { aspect-ratio: 3 / 4; }
@media (min-width: 46rem) {
  #screenshots .screenshot-grid:first-of-type { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
