@font-face {
  font-family: "iA Writer Quattro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/quattro-400.woff2") format("woff2");
}

@font-face {
  font-family: "iA Writer Quattro";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/quattro-400i.woff2") format("woff2");
}

@font-face {
  font-family: "iA Writer Quattro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/quattro-700.woff2") format("woff2");
}

@font-face {
  font-family: "iA Writer Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "iA Writer Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/mono-700.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #f6f5ed;
  --fg: #151515;
  --muted: #5f625a;
  --line: #d3d0bf;
  --line-strong: #999681;
  --accent: #004c9e;
  --accent-visited: #663d86;
  --panel: #fffdf3;
  --sidebar: #ebe8d9;
  --code: #e9e6d6;
  --mark: #ffe08a;
  --focus: #ad5700;
  --body: "iA Writer Quattro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "iA Writer Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --uc1: #1f9e4d;
  --uc2: #d63d7d;
  --uc3: #0e7fd0;
  --uc4: #c08a00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151613;
    --fg: #eeeeDF;
    --muted: #b6b29f;
    --line: #3d3c33;
    --line-strong: #66624f;
    --accent: #8eb8ff;
    --accent-visited: #c4a0ff;
    --panel: #1d1e19;
    --sidebar: #202117;
    --code: #28291f;
    --mark: #5b4a12;
    --focus: #f4a340;
    --uc1: #3fd57a;
    --uc2: #f06fa6;
    --uc3: #5fb2f2;
    --uc4: #e9bc3f;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  line-height: 1.48;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.16em;
}

a:visited {
  color: var(--accent-visited);
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: text-decoration-color 150ms ease;
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--mark);
  color: var(--fg);
}

time {
  font-style: italic;
}

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

h1,
h2,
h3,
.site-name,
.site-nav,
.eyebrow,
.metadata,
.catalog-row time,
.tag-list,
.tag-cloud,
.section-heading span,
button,
input,
select,
code,
pre,
dt {
  font-family: var(--mono);
}

h1 {
  margin-bottom: 0.55rem;
  font-size: 1.55rem;
  line-height: 1.18;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  line-height: 1.22;
}

h2,
h3 {
  scroll-margin-top: 1rem;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

p,
ul,
ol,
dl,
pre,
blockquote,
table {
  margin-bottom: 1rem;
}

code,
pre {
  font-size: 0.92em;
}

code {
  background: var(--code);
  padding: 0.06rem 0.22rem;
}

pre {
  position: relative;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: var(--code);
  padding: 0.85rem;
}

pre[data-language] {
  padding-top: 1.75rem;
}

pre[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  left: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0;
  line-height: 1;
  padding: 0.28rem 0.42rem;
  text-transform: uppercase;
}

pre code {
  background: transparent;
  padding: 0;
}

.copy-code {
  position: absolute;
  top: 0.32rem;
  right: 0.32rem;
  background: var(--panel);
  color: var(--fg);
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0;
  padding: 0.26rem 0.38rem;
}

pre:hover .copy-code,
pre:focus-within .copy-code {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .copy-code {
    opacity: 1;
  }
}

.token.comment {
  color: var(--muted);
}

.token.string,
.token.attr-value {
  color: var(--accent-visited);
}

.token.keyword,
.token.builtin {
  color: var(--accent);
  font-weight: 700;
}

.token.function {
  color: var(--focus);
}

.token.number,
.token.boolean {
  color: var(--accent);
}

.token.operator {
  color: var(--fg);
}

.token.variable {
  color: var(--focus);
}

blockquote {
  border-left: 0.25rem solid var(--line-strong);
  color: var(--muted);
  margin-left: 0;
  padding-left: 0.85rem;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--code);
  font-family: var(--mono);
}

hr {
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin: 1.25rem 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 10;
  transform: translateY(-160%);
  background: var(--panel);
  border: 2px solid var(--fg);
  color: var(--fg);
  padding: 0.45rem 0.65rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line-strong);
  background: var(--sidebar);
  padding: 1rem;
}

.site-id {
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
}

.site-name {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--fg);
  font-weight: 750;
}

.site-name:visited {
  color: var(--fg);
}

.site-id p,
.sidebar-note p,
.sidebar-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.sidebar-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.sidebar-search label,
.search-form label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-search label {
  grid-column: 1 / -1;
}

input,
select,
button {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  background: var(--panel);
  color: var(--fg);
  padding: 0.34rem 0.42rem;
}

button {
  background: var(--fg);
  color: var(--panel);
  cursor: pointer;
  font-weight: 700;
  padding: 0.34rem 0.55rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0;
  color: var(--fg);
  font-size: 0.9rem;
}

.site-nav a:visited {
  color: var(--fg);
}

.sidebar-note {
  border-top: 1px solid var(--line-strong);
  margin-top: 1.25rem;
  padding-top: 0.85rem;
}

.sidebar-footer {
  border-top: 1px solid var(--line-strong);
  margin-top: 1rem;
  padding-top: 0.75rem;
}

.sidebar-footer a,
.sidebar-footer a:visited {
  color: var(--muted);
}

.content {
  width: min(100%, 74rem);
  padding: 1.2rem 1.5rem 2.5rem;
}

.intro {
  border-bottom: 2px solid var(--fg);
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
}

.intro p:last-child {
  margin-bottom: 0;
}

.intro-copy {
  max-width: 68ch;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.article-context {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-context a,
.article-context a:visited {
  color: var(--muted);
}

.panel {
  border-top: 1px solid var(--line-strong);
  margin-bottom: 1.25rem;
  padding-top: 0.75rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

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

.catalog-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(10rem, 1fr) minmax(12rem, 1.2fr) minmax(9rem, 15rem);
  gap: 0.75rem;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 0.38rem 0;
}

.catalog-row:hover {
  background: var(--panel);
}

.catalog-row time,
.catalog-row p,
.catalog-row span {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.catalog-title {
  font-weight: 700;
}

.compact .catalog-row {
  padding-block: 0.3rem;
}

.tag-list,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-list li {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.tag-list a,
.tag-cloud a {
  color: var(--accent);
}

.tag-cloud {
  gap: 0.45rem 0.75rem;
}

.tag-cloud a {
  font-size: 0.9rem;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(9rem, 12rem) auto;
  gap: 0.5rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
  padding-bottom: 0.7rem;
}

.search-form label:first-of-type {
  grid-column: 1;
  grid-row: 1;
}

.search-form input {
  grid-column: 1;
  grid-row: 2;
}

.search-form label:nth-of-type(2) {
  grid-column: 2;
  grid-row: 1;
}

.search-form select {
  grid-column: 2;
  grid-row: 2;
}

.search-form button {
  grid-column: 3;
  grid-row: 2;
}

.search-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-results {
  margin-top: 0.5rem;
}

.search-result p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

mark {
  background: var(--mark);
  color: var(--fg);
  padding-inline: 0.08rem;
}

.tag-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.tag-index li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 0.45rem 0.55rem;
}

.tag-index span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: nowrap;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.section-grid a {
  display: grid;
  gap: 0.2rem;
  min-height: 5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  padding: 0.65rem;
}

.section-grid a:visited {
  color: var(--fg);
}

.section-grid strong {
  font-family: var(--mono);
  font-size: 1rem;
}

.section-grid span {
  color: var(--muted);
  font-size: 0.88rem;
}

.article {
  max-width: 72ch;
  margin-inline: auto;
}

.article-header {
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
}

.lede {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1rem;
  text-wrap: balance;
}

.metadata,
.spec-list {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.metadata div,
.spec-list div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.32rem 0;
}

.metadata dt,
.spec-list dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.metadata dd,
.spec-list dd {
  margin: 0;
}

.prose > * {
  max-width: 70ch;
}

.prose {
  line-height: 1.55;
}

.prose h2 {
  border-top: 1px solid var(--line);
  margin-top: 1.45rem;
  padding-top: 0.7rem;
}

.header-anchor {
  color: inherit;
  text-decoration: none;
}

.header-anchor::after {
  color: var(--muted);
  content: "#";
  font-size: 0.78em;
  margin-left: 0.35rem;
  opacity: 0;
}

.header-anchor:hover::after,
.header-anchor:focus-visible::after {
  opacity: 1;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.18rem;
}

.toc {
  border-block: 1px solid var(--line);
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  font-size: 0.92rem;
}

.toc summary {
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 700;
}

.toc ol {
  margin: 0.55rem 0 0;
  padding-left: 1.3rem;
}

.toc li + li {
  margin-top: 0.18rem;
}

.prose a[href^="http"]::after {
  content: "↗";
  color: var(--muted);
  font-size: 0.78em;
  margin-left: 0.12rem;
}

.prev-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  border-top: 1px solid var(--line-strong);
  margin-top: 1.4rem;
  padding-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.86rem;
}

.prev-next-newer {
  text-align: right;
}

.prev-next-older:last-child {
  grid-column: 1 / -1;
}

.prev-next-newer:first-child {
  grid-column: 1 / -1;
}

.related-content {
  border-top: 1px solid var(--line-strong);
  margin-top: 1.4rem;
  padding-top: 0.75rem;
}

.related-content p,
.related-content ul {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .site-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .content {
    padding: 1rem;
  }

  .article {
    margin-inline: 0;
  }

  .site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
  }

  .site-nav a {
    border-bottom: 0;
    padding: 0;
  }

  .sidebar-note {
    display: none;
  }

  .catalog-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.55rem 0;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form label:first-of-type,
  .search-form input,
  .search-form label:nth-of-type(2),
  .search-form select,
  .search-form button {
    grid-column: 1;
    grid-row: auto;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .prev-next {
    grid-template-columns: 1fr;
  }

  .prev-next-newer {
    text-align: left;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.35rem;
  }

  .metadata div,
  .spec-list div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: #000000;
    --line: #000000;
    --line-strong: #000000;
    --accent: #000000;
    --accent-visited: #000000;
    --panel: #ffffff;
    --sidebar: #ffffff;
    --code: #ffffff;
    --mark: #ffffff;
    --focus: #000000;
  }

  * {
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html {
    font-size: 11pt;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  a,
  a:visited {
    color: #000000;
    text-decoration-color: #000000;
  }

  .site-shell {
    display: block;
    min-height: 0;
  }

  .sidebar,
  .sidebar-search,
  .search-form,
  .sidebar-footer,
  .copy-code,
  .prev-next {
    display: none !important;
  }

  .content {
    width: auto;
    padding: 0;
  }

  .article {
    max-width: none;
    margin: 0;
  }

  .article-header,
  .related-content {
    border-color: #000000;
  }

  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
  }

  details.toc:not([open]) > :not(summary) {
    display: block !important;
  }

  pre,
  table {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  pre {
    overflow: visible;
    border-color: #000000;
    white-space: pre-wrap;
  }

  pre[data-language]::before {
    border-color: #000000;
  }

  table {
    display: table;
    overflow: visible;
    width: 100%;
  }
}
