:root{
  --pl:32px;
  --pr:32px;
  --gp:32px;
  --mw:800px;
  /* width of a single grid column (used for paragraph indent) */
  --col: calc((var(--mw) - var(--pl) - var(--pr) - 11 * var(--gp)) / 12);
}

/* second of two adjacent paragraphs is indented by one column */
p + p {
  text-indent: calc(var(--col) + var(--gp));
}
/* code blocks */
.codebox{
  background:#f5f5f5;
  border:1px solid #ddd;
  padding:16px;
  padding-right:56px;
  font-family:monospace;
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:anywhere;
  margin-bottom:16px;
  margin-top: 16px;
  position: relative;
  display: flex;
  min-height: 56px;
  height: 160px;
}

.codebox + .codebox {
  margin-bottom: 8px;  
}

code {
  font-size: 12px;
  line-height: 16px;
  transform: translateY(3px);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

button {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #ccc;
  padding: 4px;
}

body {
  /* paper-coloured 16×16 grid */
  background-color: #f4f1ea;
  background-image:
    linear-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .05) 1px, transparent 1px);
  background-size: 8px 8px;
    background-position:
        calc((100vw - 800px) / 2) 0,
        calc((100vw - 800px) / 2) 0;
}

h1 {
  font-size: 80px;
  line-height: 80px;
  letter-spacing: -0.03em;
  padding-top: 0px;
  transform: translateY(-4px);
}

li a.is-active {
  opacity: .3;
}

/* divider inset by the container padding, so it matches the grid/content width */
.thread {
  position: absolute;
  height: 1px;
  bottom: 0;
  left: var(--pl);
  right: var(--pr);
  border-bottom: dashed 1px #999;
}

/* ---- header navigation ---- */
.brand {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: -0.02em;
}

/* nav bar lives in a single .c-12 grid column so it stays aligned to the grid */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.menu {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* language dropdown now lives as the last item inside .menu */
.menu .lang-li {
  display: flex;
  align-items: baseline;
}

.menu a:hover {
  text-decoration: underline;
}

.menu a.is-active {
  opacity: .3;
}

/* ---- language dropdown ---- */
.lang-dd {
  position: relative;
}

.lang-dd__btn {
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  position: static;
}

.lang-dd__list {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 130px;
  margin: 8px 0 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd;
  z-index: 20;
  display: none;
}

.lang-dd__btn[aria-expanded="true"] + .lang-dd__list {
  display: block;
}

.lang-dd__list li {
  margin-bottom: 4px;
}

.lang-dd__list li:last-child {
  margin-bottom: 0;
}

.lang-dd__list a:hover {
  text-decoration: underline;
}

/* index list (page table of contents, dotted leaders) */
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-list li {
  margin-bottom: 8px;
}

.index-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.index-list a:hover .i-label {
  text-decoration: underline;
}

.i-num {
  font-variant-numeric: tabular-nums;
  opacity: .5;
}

.i-dots {
  flex: 1 1 auto;
  border-bottom: 1px dotted #999;
  transform: translateY(-4px);
}

.i-label {
  white-space: nowrap;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  font-size: 12px;
  opacity: 0.7;
}