:root {
  --bg: #fff;
  --bg-alt: #f6f5f4;
  --fg: #2e3436;
  --fg-dim: #5e5c64;
  --accent: #3584e4;
  --accent-fg: #fff;
  --card: #fff;
  --border: #deddda;
  --nav-bg: #fff;
  --hero-a: #e8f1fc;
  --hero-b: #fff;
  --footer-bg: #241f31;
  --footer-fg: #deddda;
  --win-bg: #fafafa;
  --win-side: #ebebeb;
  --win-head: #ebebeb;
  --win-sel: #d4d4d4;
  --code-bg: #241f31;
  --code-fg: #f6f5f4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --bg-alt: #242424;
    --fg: #ededed;
    --fg-dim: #b0aeb5;
    --accent: #78aeed;
    --accent-fg: #1e1e1e;
    --card: #2a2a2a;
    --border: #3d3d3d;
    --nav-bg: #1e1e1e;
    --hero-a: #1d2a3c;
    --hero-b: #1e1e1e;
    --footer-bg: #131118;
    --win-bg: #242424;
    --win-side: #303030;
    --win-head: #303030;
    --win-sel: #454545;
  }
}
* { box-sizing: border-box; }
/* One fluid root size drives everything (type, spacing, widths, images).
 * 16px on small phones, 18px at about 1200px wide, then growing steadily:
 * about 23px at 1080p, 36px at 4K and 63px at 8K. */
html {
  scroll-behavior: smooth;
  font-size: clamp(16px, 9.6px + 0.7vw, 400px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--fg);
  font-family: Cantarell, "Adwaita Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}
a { color: var(--accent); }
.wrap { max-width: 57.7778rem; margin: 0 auto; padding: 0 1.1111rem; }
.narrow { max-width: 40rem; }

/* nav */
nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; gap: 1.3333rem; height: 3.5556rem; }
nav .brand { display: flex; align-items: center; gap: 0.5556rem; font-weight: 800; font-size: 1.1111rem; color: var(--fg); text-decoration: none; }
nav .brand img { width: 1.8889rem; height: 1.8889rem; }
nav ul { list-style: none; display: flex; gap: 1.2222rem; margin: 0 0 0 auto; padding: 0; font-size: 0.8889rem; }
nav ul a { color: var(--fg); text-decoration: none; font-weight: 500; }
nav ul a:hover { color: var(--accent); }

/* hero */
.hero {
  background: linear-gradient(180deg, var(--hero-a), var(--hero-b));
  text-align: center;
  padding: 4.8889rem 0 4rem;
}
.hero img.logo { width: 7.1111rem; height: 7.1111rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.1; margin: 1.1111rem 0 0.8889rem; font-weight: 800; letter-spacing: -0.02em; }
.hero p.lede { font-size: 1.3rem; color: var(--fg-dim); max-width: 35.5556rem; margin: 0 auto 1.7778rem; }
.btn {
  display: inline-block; padding: 0.6667rem 1.5556rem; border-radius: 55.5rem;
  background: var(--accent); color: var(--accent-fg);
  text-decoration: none; font-weight: 700; font-size: 0.9444rem; margin: 0.2222rem;
}
.btn.alt { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn:hover { filter: brightness(1.08); }

/* sections */
section { padding: 4.4444rem 0; }
section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.2; margin: 0 0 1.3333rem; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; margin: 0 0 0.4444rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; color: var(--accent); margin-bottom: 0.4444rem; }
.center { text-align: center; }
.center.narrow { margin-left: auto; margin-right: auto; }
p { margin: 0 0 1.1em; }
.dim { color: var(--fg-dim); }

blockquote {
  margin: 1.7778rem 0; padding: 0.4444rem 0 0.4444rem 1.3333rem;
  border-left: 0.2778rem solid var(--accent);
  font-size: 1.5rem; line-height: 1.4; font-weight: 700;
}

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5556rem, 1fr)); gap: 1.3333rem; margin-top: 2.2222rem; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5556rem;
}
.card p { margin: 0; color: var(--fg-dim); font-size: 0.9167rem; }
.card .num {
  display: inline-flex; width: 2.2222rem; height: 2.2222rem; border-radius: 50%;
  align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg); font-weight: 800; margin-bottom: 0.7778rem;
}

/* split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.1111rem; align-items: center; }
.split.wide { grid-template-columns: 1fr 1.5fr; }
@media (max-width: 820px) { .split, .split.wide { grid-template-columns: 1fr; gap: 32px; } }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 0.7778rem; border: 1px solid var(--border); box-shadow: 0 0.6667rem 2.2222rem rgba(0,0,0,.18); }
.shot figcaption, .caption { font-size: 0.7778rem; color: var(--fg-dim); margin-top: 0.6667rem; text-align: center; }
.full-shot { margin-top: 2.2222rem; }
kbd { font-family: inherit; font-size: .85em; font-weight: 700; padding: 2px 0.4444rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 0.3333rem; background: var(--card); white-space: nowrap; }
.note { border-left: 0.2778rem solid var(--accent); background: var(--bg-alt); padding: 0.7778rem 1.1111rem; border-radius: 0 0.6667rem 0.6667rem 0; margin: 1.3333rem 0; font-size: 0.9167rem; }
.note p:last-child { margin-bottom: 0; }
.thanks { text-align: center; }
.thanks p { font-size: 1.15rem; }
h3.doc { margin-top: 2.2em; font-size: 1.5rem; }
.toc { background: var(--bg-alt); border-radius: 0.7778rem; padding: 1rem 1.5556rem; margin: 1.5556rem 0 0.4444rem; font-size: 0.8889rem; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: 2px 0; }
/* compare */
table { width: 100%; border-collapse: collapse; margin-top: 1.7778rem; font-size: 0.8889rem; background: var(--card); border-radius: 0.7778rem; overflow: hidden; border: 1px solid var(--border); }
th, td { padding: 0.7778rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); font-weight: 800; }
tr:last-child td { border-bottom: 0; }

pre {
  background: var(--code-bg); color: var(--code-fg);
  padding: 1rem 1.2222rem; border-radius: 0.7778rem; overflow-x: auto;
  font-size: 0.8056rem; line-height: 1.5;
}
code { font-family: "Source Code Pro", ui-monospace, "SF Mono", Menlo, monospace; }
p code, li code { background: var(--bg-alt); padding: 2px 0.3333rem; border-radius: 0.3333rem; font-size: .88em; }
ul.plain { padding-left: 1.2em; }
ul.plain li { margin-bottom: .5em; }

footer { background: var(--footer-bg); color: var(--footer-fg); padding: 3.1111rem 0; font-size: 0.8333rem; }
footer a { color: var(--footer-fg); }
footer .cols { display: flex; flex-wrap: wrap; gap: 1.7778rem; justify-content: space-between; }
footer p { margin: 0 0 .6em; }

/* The menu is the same on every page and on every screen size. */
nav ul a[aria-current="page"] { color: var(--accent); font-weight: 700; }
@media (max-width: 820px) {
  nav .wrap { gap: 0.6667rem; }
  nav .brand span, nav .brand { font-size: 1rem; }
  nav ul { gap: 0.7778rem; font-size: 0.7778rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
}
section[id], h3[id] { scroll-margin-top: 4.4444rem; }

/* Screenshot lightbox */
.shot img { cursor: zoom-in; }
.shot img:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
html.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1.3333rem; background: rgba(0, 0, 0, .82);
  cursor: zoom-out;
  animation: lightbox-in .15s ease-out;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.6667rem; }
.lightbox img { display: block; max-width: min(100%, 83.3333rem); max-height: calc(100vh - 6.1111rem); width: auto; height: auto; border-radius: 0.6667rem; box-shadow: 0 1.1111rem 3.3333rem rgba(0,0,0,.6); cursor: default; }
.lightbox figcaption { color: #fff; font-size: 0.8333rem; text-align: center; }
.lightbox-close {
  position: absolute; top: 0.7778rem; right: 1rem;
  width: 2.4444rem; height: 2.4444rem; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.6667rem; line-height: 1; cursor: pointer;
}
.lightbox-close:hover, .lightbox-close:focus-visible { background: rgba(255,255,255,.3); outline: 2px solid #fff; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }

/* Code inside a dark block keeps the block's colours, even within list items. */
pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }

/* Media never overflows; wide content scrolls instead of breaking the page. */
img, svg, video { max-width: 100%; height: auto; }
pre { max-width: 100%; }
code { overflow-wrap: anywhere; }
pre code { overflow-wrap: normal; }
@media (max-width: 820px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  section { padding: 3.5rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
  .btn { padding: 0.7rem 1.4rem; }
  .shot img { border-radius: 0.6rem; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 1rem; }
  blockquote { font-size: 1.25rem; }
}
/* Very large screens: keep lines readable and give the layout more room. */
@media (min-width: 2400px) {
  .wrap { max-width: 62rem; }
}
@media (min-width: 5000px) {
  .wrap { max-width: 68rem; }
}

/* On very narrow screens the logo alone stands in for the name, so the whole menu fits. */
@media (max-width: 480px) {
  nav .brand { font-size: 0; gap: 0; }
  nav .wrap { gap: 0.6rem; }
  nav ul { margin-left: auto; gap: 0.7rem; font-size: 0.8rem; }
}
@media (max-width: 380px) {
  nav .brand img { width: 1.4rem; height: 1.4rem; }
  nav ul { gap: 0.5rem; font-size: 0.72rem; }
  nav .wrap { padding: 0 0.6rem; }
}
