:root {
  --bg: #ffffff;
  --fg: #000000;
  --dim: #5c5c5c;
  --rule: #d9d9d9;
  --well: #f4f4f4;
  --hls: #0049c7;
  --mp4: #b34700;
  --uln: #007a3d;
  --old: #5c5c5c;
  --hlsjs: #c8102e;
}
@media (prefers-color-scheme: dark) {
  :root {
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --dim: #a6a6a6;
  --rule: #333333;
  --well: #171717;
  --hls: #6b9dff;
  --mp4: #ff8f3d;
  --uln: #3dd68c;
  --old: #a6a6a6;
  --hlsjs: #ff6b7a;
  }
}
/* Colour tokens are generated by build.ts, checked against WCAG AA. */
:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}
html {
  font:
    15px / 1.45 "Helvetica Neue",
    Helvetica,
    Arial,
    system-ui,
    sans-serif;
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0 auto;
  max-width: 1100px;
  padding: 0 16px 48px;
}
a {
  color: inherit;
  text-underline-offset: 2px;
}
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px 0 12px;
  border-bottom: 2px solid var(--fg);
}
header > span {
  font-weight: 700;
}
header nav {
  display: flex;
  gap: 16px;
}
h1,
h2,
h3 {
  margin: 40px 0 8px;
  line-height: 1.2;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--fg);
}
h3 {
  font-size: 15px;
  margin-top: 28px;
}
p {
  margin: 8px 0;
  max-width: 72ch;
}
pre,
code {
  font:
    13px / 1.5 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
}
pre {
  background: var(--well);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 12px 0;
}
:not(pre) > code {
  background: var(--well);
  padding: 0 3px;
}
.dim,
.file,
footer {
  color: var(--dim);
}
footer {
  margin-top: 48px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}

.tag {
  display: inline-block;
  vertical-align: middle;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--c);
}
h1 .tag {
  vertical-align: 0.4em;
}
.key {
  color: var(--c);
  font-weight: 700;
  white-space: nowrap;
}
.key::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  background: var(--c);
}
.legend .key {
  margin-right: 16px;
}

table {
  border-collapse: collapse;
  margin: 8px 0;
  display: block;
  overflow-x: auto;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 5px 20px 5px 0;
  border-bottom: 1px solid var(--rule);
}
thead th {
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  border-bottom: 1px solid var(--fg);
}
tbody th {
  font-weight: 400;
  color: var(--dim);
  white-space: nowrap;
}
.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td:first-child {
  white-space: nowrap;
}
details {
  margin: 24px 0 0;
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
summary {
  cursor: pointer;
  color: var(--dim);
}

.step {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 12px;
  border-top: 2px solid var(--fg);
}

/* The examples' own markup: just enough layout for their class names. */
.demo {
  position: relative;
  margin: 16px 0;
  padding: 12px;
  border: 2px solid var(--fg);
  min-height: 120px;
}
.demo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.demo video,
.demo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}
.demo button {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 4px 10px;
  margin: 8px 8px 0 0;
  cursor: pointer;
}
.demo button:has(video) {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  text-align: left;
}
.demo h1,
.demo h2 {
  margin: 6px 0 0;
  border: 0;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.demo span {
  display: block;
  margin-top: 6px;
}

.strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.strip .card {
  flex: 0 0 80%;
  scroll-snap-align: center;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.demo button.card {
  max-width: 640px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: #000;
  color: #fff;
}
.lightbox video {
  height: calc(100% - 48px);
  object-fit: contain;
}

.boot-screen,
.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.landing {
  position: relative;
}
.landing h1 {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: #fff;
}

.film {
  position: relative;
}
.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
}
.controls button {
  margin: 0;
  background: transparent;
  border-color: #fff;
}
.controls input {
  flex: 1;
  min-width: 120px;
}
.controls span {
  margin: 0;
}
