:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --text: #1c1f24;
  --muted: #5d6673;
  --line: #e2e5ea;
  --accent: #3b7cf6;
  --code: #f1f3f6;
  --bezel: #2a2d33;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --panel: #1b1f26;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --line: #2b313a;
    --accent: #6c9ffb;
    --code: #222831;
    --bezel: #3a3f48;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand span { font-weight: 400; color: var(--muted); }
.flash { margin-left: auto; font-size: 14px; }
.menu { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; padding: 4px 8px; }

.shell { display: flex; max-width: 1240px; margin: 0 auto; }
.side {
  position: sticky; top: 56px; align-self: flex-start;
  width: 250px; flex: none; height: calc(100vh - 56px); overflow-y: auto;
  padding: 20px 16px 40px; border-right: 1px solid var(--line); font-size: 14.5px;
}
.side .group { margin: 18px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side .group:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--text); }
.side li a:hover { background: var(--panel); text-decoration: none; }
.side li a.on { background: var(--panel); color: var(--accent); font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 28px 40px 60px; }
.content h1 { font-size: 32px; line-height: 1.2; margin: 0 0 12px; }
.content h2 { font-size: 23px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.content h3 { font-size: 18px; margin: 26px 0 8px; }
.content p, .content li { max-width: 760px; }
.content .lead { font-size: 18px; color: var(--muted); max-width: 760px; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
pre { background: var(--code); padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; margin: 14px 0; font-size: 15px; display: block; overflow-x: auto; max-width: 100%; }
th, td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--panel); }
blockquote { margin: 16px 0; padding: 8px 16px; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 8px 8px 0; }
blockquote p { margin: 6px 0; }
img { max-width: 100%; height: auto; }

/* Screenshots */
.shot { margin: 18px 0 26px; }
.shot img { display: block; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 18px rgba(0, 0, 0, .08); }
.shot figcaption, .shots figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 18px; margin: 18px 0 28px; }
.shots.wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.shots figure, .shot { margin: 0; }
/* The remote: its 480x800 e-ink screen in a bezel. */
.remote { background: var(--bezel); padding: 14px 14px 30px; border-radius: 22px; max-width: 260px; }
.remote img { border-radius: 4px; border: 0; box-shadow: none; image-rendering: auto; background: #fff; }
figure .remote + figcaption { text-align: center; }
.shots .remote { max-width: none; }
/* The viewport: an 800x480 colour panel in a frame. */
.panel { background: var(--bezel); padding: 12px; border-radius: 10px; }
.panel img { border: 0; border-radius: 2px; box-shadow: none; }
.photo img { border-radius: 10px; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 50px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; }
.pager .next { margin-left: auto; }

@media (max-width: 860px) {
  .menu { display: block; }
  .side { display: none; position: fixed; top: 56px; left: 0; z-index: 4; width: 280px; background: var(--bg); box-shadow: 4px 0 20px rgba(0, 0, 0, .15); }
  .nav-open .side { display: block; }
  .content { padding: 20px 16px 48px; }
  .content h1 { font-size: 27px; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .shots.wide { grid-template-columns: 1fr; }
  .remote { padding: 9px 9px 20px; border-radius: 16px; }
}
