:root {
  --paper: #f2f2f2;
  --panel: #ffffff;
  --ink: #181818;
  --mute: #595959;
  --faint: #dcdcdc;
  --line: #868686;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --bar: 60px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121212;
    --panel: #1a1a1a;
    --ink: #eaeaea;
    --mute: #9d9d9d;
    --faint: #2c2c2c;
    --line: #6b6b6b;
  }
}
:root[data-theme="dark"] {
  --paper: #121212;
  --panel: #1a1a1a;
  --ink: #eaeaea;
  --mute: #9d9d9d;
  --faint: #2c2c2c;
  --line: #6b6b6b;
}
html { scroll-padding-top: calc(var(--bar) + 1rem); }

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
h1, h2, h3 { font-weight: 300; font-stretch: 90%; letter-spacing: -0.02em; line-height: 1; margin: 0; }
p { margin: 0 0 1em; max-width: 68ch; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.875em; font-weight: 400; }
b, strong { font-weight: 500; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

/* Title bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  min-height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem clamp(1rem, 3vw, 1.5rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-weight: 400; font-stretch: 90%; font-size: 1.5rem; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.tag.alpha { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.1rem 0.5rem; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cmd { display: flex; align-items: stretch; min-width: 0; max-width: min(62vw, 820px); border: 1px solid var(--line); background: var(--panel); }
.cmd .label { padding: 0.4rem 0.75rem; border-right: 1px solid var(--line); font-size: 0.875rem; color: var(--mute); white-space: nowrap; display: flex; align-items: center; }
.cmd code { display: block; flex: 1; min-width: 0; padding: 0.45rem 0.75rem; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
.cmd button { font: inherit; font-size: 0.875rem; font-weight: 400; cursor: pointer; border: 0; border-left: 1px solid var(--line); background: var(--ink); color: var(--paper); padding: 0.4rem 0.9rem; transition: background-color 120ms linear, color 120ms linear; min-width: 5.5rem; }
.cmd button:hover { background: var(--paper); color: var(--ink); }

/* Layout and sidebar */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.content { min-width: 0; }
.sidebar {
  position: sticky; top: var(--bar);
  height: calc(100dvh - var(--bar) - env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
  padding: 1.25rem 1.25rem 1.5rem;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.side-top { display: none; align-items: center; justify-content: space-between; gap: 1rem; }
.side-top span { font-weight: 400; }
.menu-btn { display: none; }
.side-nav { display: flex; flex-direction: column; flex: 1; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li { margin: 0; }
.side-nav .group { font-size: 0.96875rem; font-weight: 500; color: var(--ink); margin: 1.1rem 0 0.35rem; padding: 0.9rem 0.75rem 0; border-top: 1px solid var(--line); white-space: pre; }
.side-nav .group::before { content: "[ "; color: var(--mute); font-weight: 350; }
.side-nav .group::after { content: " ]"; color: var(--mute); font-weight: 350; }
.side-nav .group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.side-nav a {
  display: block; text-decoration: none; padding: 0.28rem 0.75rem 0.28rem 1.5rem; font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: background-color 120ms linear, color 120ms linear;
}
.side-nav a:hover, .side-nav a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.side-nav a:focus-visible { outline-offset: 1px; }
/* Search */
.search { margin-bottom: 1rem; }
.search label { display: block; font-size: 0.8125rem; color: var(--mute); margin-bottom: 0.3rem; }
.search-box { display: flex; border: 1px solid var(--line); background: var(--panel); }
.search-box input { flex: 1; min-width: 0; font: inherit; font-size: 0.9375rem; font-weight: 350; color: var(--ink); background: transparent; border: 0; padding: 0.4rem 0.6rem; }
.search-box input:focus { outline: none; }
.search-box:focus-within { outline: 1px solid var(--ink); outline-offset: 2px; }
.search-box kbd { align-self: center; margin-right: 0.5rem; border: 1px solid var(--faint); padding: 0 0.35rem; font-size: 0.75rem; color: var(--mute); }
.results { list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid var(--line); background: var(--panel); }
.results[hidden] { display: none; }
.results li { border-bottom: 1px solid var(--faint); }
.results li:last-child { border-bottom: 0; }
.results a { display: block; padding: 0.5rem 0.65rem; text-decoration: none; transition: background-color 120ms linear, color 120ms linear; }
.results a:hover, .results a:focus-visible, .results a.first { background: var(--ink); color: var(--paper); outline: none; }
.results .r-title { display: block; font-size: 0.9375rem; font-weight: 400; }
.results .r-where { display: block; font-size: 0.75rem; color: var(--mute); }
.results .r-snip { display: block; font-size: 0.8125rem; line-height: 1.35; color: var(--mute); margin-top: 0.2rem; }
.results a:hover .r-where, .results a:hover .r-snip, .results a.first .r-where, .results a.first .r-snip, .results a:focus-visible .r-snip { color: var(--faint); }
.results mark { background: transparent; color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 0.15em; }
.results .none { padding: 0.6rem 0.65rem; font-size: 0.875rem; color: var(--mute); }
.side-nav.searching ul { display: none; }
.side-foot { margin-top: auto; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.side-foot p { margin: 0.75rem 0 0; color: var(--mute); }
.side-nav .side-foot a { display: inline; padding: 0; border: 0; font-size: inherit; text-decoration: underline; }
.side-nav .side-foot a:hover { background: transparent; color: var(--ink); }

/* Buttons */
.btn {
  font: inherit; font-weight: 400; font-size: 1rem;
  display: inline-block; cursor: pointer; text-decoration: none; line-height: 1.2;
  padding: 0.75rem 1.25rem;
  background: var(--ink); color: var(--paper); border: 1px solid var(--line);
  transition: background-color 120ms linear, color 120ms linear;
}
.btn:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.9375rem; }

/* Landing */
.hero { border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 3.5vw, 3rem); padding-top: clamp(1.25rem, 3.5vh, 2.5rem); padding-bottom: clamp(1.25rem, 3.5vh, 2.5rem); align-items: center; }
.hero p.lead { font-size: clamp(1.0625rem, 0.9vw + 0.5rem, 1.3125rem); font-weight: 300; line-height: 1.42; color: var(--ink); }
.hero p { color: var(--mute); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.1rem; }
.features { list-style: none; margin: 1.1rem 0 0; padding: 0; border: 1px solid var(--line); background: var(--panel); font-size: 0.9375rem; line-height: 1.4; }
.features li { display: grid; grid-template-columns: 1.25rem 1fr; padding: 0.3rem 0.9rem; border-bottom: 1px solid var(--faint); }
.features li:last-child { border-bottom: 0; }
.features li::before { content: "—"; color: var(--mute); }
@media (min-width: 1181px) {
  /* The landing is one screen: everything above the first wiki topic fits below the title bar. */
  .hero .wrap { min-height: calc(100dvh - var(--bar)); }
}
.alpha-note { border: 1px solid var(--line); background: var(--panel); margin-top: 1.1rem; }
.alpha-note p { margin: 0; padding: 0.6rem 0.9rem; font-size: 0.875rem; line-height: 1.4; color: var(--ink); border-bottom: 1px solid var(--line); max-width: none; }
.alpha-note p b { font-weight: 500; }
.versions { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.versions > div { padding: 0.55rem 0.9rem; border-right: 1px solid var(--line); }
.versions > div:last-child { border-right: 0; }
.versions dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.versions dd { margin: 0; }
.versions dd b { display: block; font-weight: 300; font-stretch: 90%; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; }
.versions dd span { display: block; font-size: 0.8125rem; line-height: 1.3; color: var(--mute); }
.platforms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.platforms li { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.55rem 0.25rem; border-right: 1px solid var(--line); font-size: 0.75rem; color: var(--mute); text-align: center; line-height: 1.2; }
.platforms li:last-child { border-right: 0; }
.platforms svg.wide { width: 64px; height: 22px; }
.platforms svg { width: 22px; height: 22px; fill: currentColor; color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.tag { display: inline-block; border: 1px solid var(--line); padding: 0.15rem 0.6rem; font-size: 0.875rem; }
.tag.solid { background: var(--ink); color: var(--paper); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--panel); margin-top: 1.5rem; }
.stats > div { padding: 0.7rem 0.9rem; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-weight: 300; font-stretch: 90%; font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1.1; }
.stats span { font-size: 0.875rem; color: var(--mute); line-height: 1.35; display: block; margin-top: 0.25rem; }

figure { margin: 0; }
.device { border: 1px solid var(--line); background: var(--panel); }
/* Tested devices: the slides share one cell, and each fills it, so the box is the size of the largest. */
.devices .slides { display: grid; }
.devices .slide { grid-area: 1 / 1; display: flex; flex-direction: column; visibility: hidden; opacity: 0;
                  transition: opacity 0.4s ease, visibility 0s linear 0.4s; }
.devices .slide.on { visibility: visible; opacity: 1; transition: opacity 0.4s ease; }
.devices .slide .device-info { flex: 1; }
.devices .slide .specs { align-content: start; }
@media (prefers-reduced-motion: reduce) { .devices .slide, .devices .slide.on { transition: none; } }
.device .shot { position: relative; }
.shot .dev-prev, .shot .dev-next { position: absolute; top: 50%; transform: translateY(-50%); width: 2.25rem; height: 2.25rem;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 1.25rem;
  line-height: 1; cursor: pointer; opacity: 0.55; transition: opacity 0.2s ease, border-color 0.2s ease; z-index: 1; }
.shot .dev-prev { left: 0.75rem; }
.shot .dev-next { right: 0.75rem; }
.device:hover .dev-prev, .device:hover .dev-next, .shot .dev-prev:focus-visible, .shot .dev-next:focus-visible { opacity: 1; }
.shot .dev-prev:hover, .shot .dev-next:hover { border-color: var(--ink); }
.dev-dots { display: inline-flex; gap: 0.45rem; margin-left: auto; }
.dev-dots button { width: 0.55rem; height: 0.55rem; padding: 0; border-radius: 50%; border: 1px solid var(--mute); background: transparent; cursor: pointer; }
.dev-dots button[aria-current="true"] { background: var(--ink); border-color: var(--ink); }
.device .shot { padding: 1rem 1.5rem 0.25rem; }
.device img { width: 100%; max-width: 340px; height: auto; aspect-ratio: 1 / 1; object-fit: contain; margin: 0 auto; }
@media (min-width: 1181px) {
  /* On a short screen the picture shrinks, keeping its proportions: after the rule above, so that its width wins. */
  .device img { width: auto; max-height: max(56px, calc(100dvh - var(--bar) - 30rem)); }
}
@media (min-width: 1181px) and (max-height: 900px) {
  /* Short screens: the box keeps inside the view; the picture shrinks first, the text a little. */
  .hero .wrap { align-items: start; padding-top: 1rem; padding-bottom: 1rem; }
  .device img { max-height: max(44px, calc(100dvh - var(--bar) - 38.5rem)); }
  .device .shot { padding: 0.5rem 1rem 0.25rem; }
  .device figcaption { padding: 0.4rem 0.9rem; }
  .platforms li { padding: 0.35rem 0.25rem; gap: 0.2rem; }
  .device-info > * { padding: 0.6rem 0.8rem; }
  .specs { font-size: 0.75rem; row-gap: 0.15rem; }
  .device-info h3 { margin-bottom: 0.35rem; }
  .how p { font-size: 0.8125rem; line-height: 1.38; margin-bottom: 0.45em; }
}
.device figcaption { border-top: 1px solid var(--line); padding: 0.6rem 0.9rem; font-size: 0.875rem; display: flex; align-items: center; gap: 1rem; }
.device figcaption span:first-child { text-transform: uppercase; letter-spacing: 0.06em; color: var(--mute); }
.device-info { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.device-info { grid-template-columns: 1.25fr 1fr; }
.device-info > * { padding: 0.8rem 0.9rem; }
.device-info > :first-child { border-right: 1px solid var(--line); }
.device-info h3 { font-size: 1rem; font-weight: 400; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.specs { margin: 0; font-size: 0.8125rem; line-height: 1.35; display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; row-gap: 0.3rem; }
.specs dt { color: var(--mute); white-space: nowrap; }
.specs dd { margin: 0; }
.how p { font-size: 0.875rem; line-height: 1.45; color: var(--ink); margin-bottom: 0.6em; }
.how p:last-child { margin-bottom: 0; }

/* Wiki sections */
.section { border-bottom: 1px solid var(--line); }
.section > .wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem); padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.section h2 { font-size: 2rem; }
.section .sub { color: var(--mute); font-size: 0.9375rem; margin-top: 0.75rem; max-width: 24ch; }
.kicker { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); margin-bottom: 0.6rem; }
.prose { min-width: 0; }
.prose h3 { font-size: 1.375rem; margin: 2.25rem 0 0.85rem; }
.prose > h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.25rem; max-width: 70ch; }
.prose li { margin: 0 0 0.4em; }
.prose li::marker { color: var(--mute); }
.prose p code, .prose li code, .prose td code, .prose dd code { border: 1px solid var(--faint); padding: 0 0.25em; background: var(--panel); white-space: nowrap; }
pre { background: var(--panel); border: 1px solid var(--line); padding: 0.85rem 1rem; margin: 0 0 1.25rem; overflow-x: auto; line-height: 1.5; tab-size: 4; }
pre .c { color: var(--mute); }
.note { color: var(--mute); font-size: 0.9375rem; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); margin-bottom: 1.25rem; }
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 0.96875rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--faint); font-weight: 350; }
thead th { font-weight: 500; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 120ms linear, color 120ms linear; }
tbody tr:hover { background: var(--ink); color: var(--paper); }
tbody tr:hover code { background: transparent; border-color: var(--line); }
td.k { white-space: nowrap; font-weight: 400; }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--panel); margin-bottom: 1.25rem; }
.cols > div { padding: 1.25rem; border-right: 1px solid var(--line); }
.cols > div:last-child { border-right: 0; }
.cols h3 { font-size: 1.375rem; margin: 0 0 0.75rem; }
.cols p { margin: 0; color: var(--mute); }

.alert { border: 1px solid var(--line); background: var(--panel); padding: 0.85rem 1rem; max-width: 72ch; margin-bottom: 1.25rem; }
.alert b { display: block; font-weight: 500; }
.alert.dashed { border-style: dashed; }

.steps { counter-reset: s; list-style: none; padding: 0 !important; border: 1px solid var(--line); background: var(--panel); max-width: none !important; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.5rem; padding: 0.7rem 1rem; margin: 0 !important; border-bottom: 1px solid var(--faint); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(s); font-variant-numeric: tabular-nums; color: var(--mute); }

.pre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--panel); margin: 0 0 1.75rem; }
.pre > div { padding: 0.8rem 1rem; border-right: 1px solid var(--line); }
.pre > div:last-child { border-right: 0; }
.pre h4 { margin: 0 0 0.45rem; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.pre h4::before { content: "[ "; color: var(--mute); font-weight: 350; }
.pre h4::after { content: " ]"; color: var(--mute); font-weight: 350; }
.pre ul { margin: 0 !important; padding-left: 1.05rem !important; font-size: 0.875rem; line-height: 1.45; }
.pre li { margin: 0 0 0.35em !important; }
.pre .warn { background: var(--paper); }
@media (max-width: 1180px) {
  .pre { grid-template-columns: 1fr; }
  .pre > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .pre > div:last-child { border-bottom: 0; }
}
.qa { border: 1px solid var(--line); background: var(--panel); margin: 0 0 1.25rem; }
.qa > div { padding: 0.85rem 1rem; border-bottom: 1px solid var(--faint); }
.qa > div:last-child { border-bottom: 0; }
.qa dt { font-weight: 500; margin-bottom: 0.3rem; }
.qa dd { margin: 0; color: var(--mute); }
.qa dd p { margin: 0 0 0.5em; }
.qa dd p:last-child { margin: 0; }

.demo { border: 1px solid var(--line); background: var(--panel); margin: 0 0 1.75rem; }
.demo video { display: block; width: 100%; height: auto; background: #000; }
.demo figcaption { border-top: 1px solid var(--line); padding: 0.75rem 1rem; font-size: 0.9375rem; }
.demo figcaption b { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.demo figcaption p { margin: 0 0 0.5em; color: var(--mute); max-width: none; }
.demo figcaption p:last-child { margin: 0; }
.diagram { border: 1px solid var(--line); background: var(--panel); margin-bottom: 1.25rem; overflow-x: auto; }
.diagram svg { min-width: 640px; width: 100%; height: auto; }
.diagram figcaption { border-top: 1px solid var(--line); padding: 0.6rem 0.9rem; font-size: 0.875rem; color: var(--mute); }
.dia rect { fill: var(--panel); stroke: var(--ink); stroke-width: 1; }
.dia rect.solid { fill: var(--ink); }
.dia line, .dia path { stroke: var(--ink); stroke-width: 1; fill: none; }
.dia .dash { stroke-dasharray: 4 4; stroke: var(--line); }
.dia text { fill: var(--ink); font-family: Archivo, Arial, sans-serif; font-size: 14px; font-weight: 400; }
.dia text.m { fill: var(--mute); font-size: 12.5px; font-weight: 350; }
.dia text.inv { fill: var(--paper); }
.dia text.t { font-size: 16px; }

/* Footer */
footer .wrap { display: grid; grid-template-columns: 220px 1fr 1fr; gap: clamp(1rem, 4vw, 3rem); padding-top: 2rem; padding-bottom: 2.5rem; font-size: 0.9375rem; }
footer p { margin: 0 0 0.25rem; }
footer .mute { color: var(--mute); }

/* Responsive */
@media (max-width: 1180px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .device img { max-width: 360px; }
}
@media (max-width: 1000px) {
  .section > .wrap { grid-template-columns: 1fr; }
  .section .sub { max-width: none; }
  .cols { grid-template-columns: 1fr; }
  .cols > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .cols > div:last-child { border-bottom: 0; }
  footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  html { scroll-padding-top: 1rem; }
  body { overflow-x: hidden; }
  .topbar { position: static; flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .brand { justify-content: space-between; width: 100%; }
  .cmd { max-width: 100%; width: 100%; }
  .cmd code { font-size: 0.75rem; }
  .layout { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0.75rem 1rem; overflow: visible; }
  .side-top { display: flex; }
  .menu-btn { display: inline-block; }
  .side-nav { display: none; margin-top: 1rem; }
  .side-nav.open { display: flex; }
  .side-nav.searching { display: flex; }
  .results { max-height: 50vh; overflow-y: auto; }
  .pre { grid-template-columns: 1fr; }
  .pre > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .pre > div:last-child { border-bottom: 0; }
  .features li { display: block; padding-left: 1.5rem; position: relative; word-break: normal; overflow-wrap: break-word; }
  .features li::before { position: absolute; left: 0.6rem; top: 0.3rem; }
  .features li code { white-space: nowrap; }
}
@media (max-width: 600px) {
  .device-info { grid-template-columns: 1fr; }
  .device-info > :first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .cmd .label { display: none; }
  .versions { grid-template-columns: 1fr; }
  .versions > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .versions > div:last-child { border-bottom: 0; }
  .platforms { grid-template-columns: repeat(3, 1fr); }
  .platforms li:nth-child(3) { border-right: 0; }
  .platforms li:nth-child(4), .platforms li:nth-child(5) { border-top: 1px solid var(--line); }
  .platforms li:last-child { border-right: 0; }
.platforms svg.wide { width: 64px; height: 22px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- PersonalWebsiteV4 additions, in the same hairline style ---- */
.topbar .cmd { max-width: min(62vw, 460px); }
.hero .kicker { margin-bottom: 0.9rem; }
.hero h1 { font-size: clamp(2.25rem, 4.2vw, 3.75rem); margin-bottom: 1rem; }
.hero h1 small { display: block; font-size: 1rem; font-weight: 350; letter-spacing: 0; color: var(--mute); margin-top: 0.6rem; font-stretch: 100%; }
.versions.two { grid-template-columns: repeat(2, 1fr); }
.portrait img { width: 100%; max-width: 340px; height: auto; aspect-ratio: 1 / 1; object-fit: cover; margin: 0 auto; filter: grayscale(1) contrast(1.05); transition: filter 0.4s ease; }
.portrait:hover img { filter: none; }
.portrait .shot { padding: 1.25rem 1.5rem; }
@media (min-width: 1181px) { .portrait img { width: auto; max-height: max(160px, calc(100dvh - var(--bar) - 26rem)); } }
.platforms.four { grid-template-columns: repeat(4, 1fr); }
.platforms a { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-decoration: none; color: var(--mute); width: 100%; }
.platforms li { padding: 0; transition: background-color 120ms linear; }
.platforms li a { padding: 0.6rem 0.25rem; }
.platforms li:hover { background: var(--ink); }
.platforms li:hover a, .platforms li:hover svg { color: var(--paper); }
.platforms svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Project lists */
.plist { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--line); background: var(--panel); }
.plist li { border-bottom: 1px solid var(--faint); }
.plist li:last-child { border-bottom: 0; }
.plist a { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr) auto; gap: 0.5rem 1.25rem; align-items: baseline; padding: 0.8rem 1rem; text-decoration: none; transition: background-color 120ms linear, color 120ms linear; }
.plist a:hover, .plist a:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.plist .p-name { font-weight: 400; font-size: 1.125rem; font-stretch: 90%; letter-spacing: -0.01em; }
.plist .p-what { color: var(--mute); font-size: 0.9375rem; line-height: 1.4; }
.plist .p-meta { color: var(--mute); font-size: 0.8125rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plist a:hover .p-what, .plist a:hover .p-meta, .plist a:focus-visible .p-what, .plist a:focus-visible .p-meta { color: var(--faint); }
.plist .p-go::after { content: " →"; }
@media (max-width: 700px) { .plist a { grid-template-columns: 1fr; gap: 0.2rem; } }

/* Project pages */
.article .wrap { padding-top: clamp(1.5rem, 4vw, 2.75rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.crumbs { font-size: 0.875rem; color: var(--mute); margin-bottom: 1.5rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin: 0 0.4rem; }
.article h1 { font-size: clamp(2rem, 4vw, 3.25rem); margin-bottom: 1rem; }
.article .lead { font-size: clamp(1.0625rem, 0.9vw + 0.5rem, 1.3125rem); font-weight: 300; line-height: 1.42; max-width: 60ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border: 1px solid var(--line); background: var(--panel); margin: 1.5rem 0; }
.facts > div { padding: 0.6rem 0.9rem; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.facts dd { margin: 0.15rem 0 0; font-size: 0.9375rem; line-height: 1.35; }
@media (max-width: 700px) { .facts > div { border-right: 0; border-bottom: 1px solid var(--line); } .facts > div:last-child { border-bottom: 0; } }
.article .prose { max-width: 78ch; margin-top: 2rem; }
.article .prose h2 { font-size: 1.75rem; margin: 2.75rem 0 0.9rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.article .prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.article .prose h3 { font-size: 1.25rem; font-weight: 400; margin: 2rem 0 0.6rem; }
.article .prose p, .article .prose ul, .article .prose ol { max-width: 70ch; }
.shotfig { border: 1px solid var(--line); background: var(--panel); margin: 1.5rem 0; }
.shotfig img, .shotfig video { width: 100%; height: auto; display: block; }
.shotfig.narrow { max-width: 300px; }
.shotfig.mid { max-width: 520px; }
.shotfig figcaption { border-top: 1px solid var(--line); padding: 0.55rem 0.9rem; font-size: 0.875rem; color: var(--mute); }
.shots { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.shots .shotfig { margin: 0 0 1.5rem; flex: 1 1 220px; }
.partlinks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.25rem 0 1.25rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--panel); margin-top: 3rem; }
.pager a { display: block; padding: 0.8rem 1rem; text-decoration: none; transition: background-color 120ms linear, color 120ms linear; }
.pager a:hover { background: var(--ink); color: var(--paper); }
.pager a + a, .pager span + a { border-left: 1px solid var(--line); text-align: right; }
.pager small { display: block; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.pager a:hover small { color: var(--faint); }
.contact-list { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--line); background: var(--panel); }
.contact-list li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); border-bottom: 1px solid var(--faint); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list span { padding: 0.7rem 1rem; color: var(--mute); font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; }
.contact-list a { padding: 0.7rem 1rem; text-decoration: none; overflow-wrap: anywhere; transition: background-color 120ms linear, color 120ms linear; }
.contact-list a:hover { background: var(--ink); color: var(--paper); }
blockquote { margin: 0 0 1.25rem; padding: 0.85rem 1rem; border: 1px solid var(--line); border-left-width: 3px; background: var(--panel); max-width: 72ch; }
blockquote p { margin: 0; }
footer { border-top: 1px solid var(--line); }
@media (max-width: 860px) { .topbar .cmd { max-width: 100%; } }
@media (max-width: 600px) {
  .platforms.four { grid-template-columns: repeat(4, 1fr); }
  .platforms.four li:nth-child(3) { border-right: 1px solid var(--line); }
  .platforms.four li:nth-child(4) { border-top: 0; }
}
.features a { text-decoration: none; }
.features a:hover { text-decoration: underline; }
.embed { border: 1px solid var(--line); background: var(--panel); margin: 1.5rem 0; max-width: 506px; }
.embed iframe { display: block; width: 100%; height: 628px; border: 0; }
.embed figcaption { border-top: 1px solid var(--line); padding: 0.55rem 0.9rem; font-size: 0.875rem; color: var(--mute); }

/* Mermaid diagrams */
.chart { border: 1px solid var(--line); background: var(--panel); margin: 1.5rem 0; overflow-x: auto; }
.chart pre.mermaid { margin: 0; border: 0; background: transparent; padding: 1rem; color: var(--mute); font-size: 0.8125rem; }
.chart pre.mermaid[hidden] { display: none; }
.chart .drawn { padding: 1.25rem 1rem; text-align: center; }
.chart .drawn svg { max-width: 100%; height: auto; margin: 0 auto; }
.chart figcaption { border-top: 1px solid var(--line); padding: 0.55rem 0.9rem; font-size: 0.875rem; color: var(--mute); }
.article .prose .toc { list-style: none; padding: 0; border: 1px solid var(--line); background: var(--panel); max-width: none; columns: 2; column-gap: 0; }
.article .prose .toc li { margin: 0; break-inside: avoid; }
.article .prose .toc a { display: block; padding: 0.4rem 0.9rem; text-decoration: none; font-size: 0.9375rem; transition: background-color 120ms linear, color 120ms linear; }
.article .prose .toc a:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 700px) { .article .prose .toc { columns: 1; } }
.unreleased { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); border: 1px solid var(--line); padding: 0.05rem 0.4rem; margin-left: 0.5rem; vertical-align: middle; font-weight: 400; font-stretch: 100%; white-space: nowrap; }
.article .prose table { margin: 0; }
.hero h1 { margin-bottom: 0.6rem; }
.hero p.role { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin: 0 0 0.25rem; }
.hero p.aka { color: var(--mute); margin: 0 0 1rem; }
