:root {
  color-scheme: dark;
  --bg: #0e1623;
  --surface: #142033;
  --surface-alt: #19263a;
  --grid-major: #31445d;
  --grid-minor: #223146;
  --ink: #eef3f7;
  --ink-muted: #c8d2dc;
  --ink-dim: #8d9aaa;
  --line-bright: #9bb7d3;
  --measure: #80adc7;
  --revision: #d6b35f;
  --sidebar: clamp(190px, 18vw, 230px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(155, 183, 211, .045) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(155, 183, 211, .035) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, Arial, system-ui, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.boot-text {
  margin: 24px;
  color: var(--ink-muted);
}

.mobile-bar {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 18px;
  border-right: 1px solid var(--grid-major);
  background: rgba(12, 22, 36, .98);
  overflow-y: auto;
  z-index: 10;
}

.brand {
  margin-bottom: 18px;
  color: var(--line-bright);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 1px solid var(--line-bright);
  vertical-align: -3px;
  background:
    linear-gradient(45deg, transparent 46%, var(--line-bright) 47% 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--line-bright) 47% 53%, transparent 54%);
}

.nav {
  display: grid;
  gap: 2px;
}

.nav a {
  display: block;
  padding: 9px 0;
  color: var(--ink-muted);
  font-size: .86rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.is-current {
  color: var(--measure);
  border-bottom-color: var(--measure);
  outline: none;
}

.nav a.is-current::before {
  content: "> ";
  color: var(--line-bright);
}

main {
  min-width: 0;
  padding: clamp(18px, 4vw, 42px);
}

.page {
  width: min(100%, 920px);
  margin: 0;
}

header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--grid-major);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--measure);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1.08;
}

.intro {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: .92rem;
  line-height: 1.7;
}

.page-body {
  scroll-margin-top: 16px;
  margin-top: 28px;
  max-width: 100%;
  overflow-x: auto;
}

h2 {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grid-major);
  color: var(--line-bright);
  font-size: .92rem;
}

h3 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.3;
}

p,
li,
td,
th,
footer {
  color: var(--ink-muted);
  font-size: .9rem;
  line-height: 1.7;
}

ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

code,
pre {
  font-family: "Lucida Console", "Courier New", ui-monospace, monospace;
}

code {
  color: var(--measure);
}

pre {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--grid-minor);
  background: rgba(20, 32, 51, .92);
  color: var(--measure);
  font-size: .76rem;
  line-height: 1.55;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  border: 1px solid var(--grid-minor);
  background: rgba(20, 32, 51, .92);
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--grid-minor);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--line-bright);
  font-size: .76rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.swatch {
  border: 1px solid var(--grid-minor);
  background: rgba(20, 32, 51, .92);
}

.swatch-color {
  height: 46px;
  border-bottom: 1px solid var(--grid-minor);
  background: var(--color);
}

.swatch-text {
  padding: 9px;
  color: var(--ink-muted);
  font-size: .76rem;
  line-height: 1.45;
}

.rule-list {
  list-style: disc;
  padding-left: 20px;
}

footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--grid-major);
}

.menu-button {
  display: none;
}

@media (max-width: 760px) {
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--grid-major);
    background: rgba(12, 22, 36, .98);
  }

  .mobile-bar strong {
    color: var(--line-bright);
    max-width: calc(100% - 76px);
    font-size: .78rem;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
    min-width: 54px;
    height: 34px;
    border: 1px solid var(--grid-major);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(80vw, 280px);
    transform: translateX(-104%);
    transition: transform .18s ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open main::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 8;
    background: rgba(0, 0, 0, .58);
  }

  main {
    padding: 18px;
  }
}

@media (max-width: 960px) and (min-width: 761px) {
  :root {
    --sidebar: 180px;
  }

  main {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .swatches {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 8px;
  }
}
