:root {
  --paper: #f3eedf;
  --paper-deep: #e5dcc4;
  --panel: #faf6ea;
  --code: #e9e0c8;
  --line: #b4aa92;
  --line-strong: #726756;
  --ink: #1d211b;
  --muted: #5d6458;
  --link: #174ea6;
  --link-visited: #5a4389;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --mono: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.65;
  text-wrap: pretty;
  background-color: var(--paper);
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      to bottom,
      rgba(114, 103, 86, 0.028),
      rgba(114, 103, 86, 0.028) 1px,
      transparent 1px,
      transparent 28px
    );
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

code,
kbd,
pre,
.doc-path,
.doc-tag,
.nav-kicker,
.box-title,
dt {
  font-family: var(--mono);
}

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

.sidebar {
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--line);
  background: rgba(250, 246, 234, 0.72);
}

.sidebar-stack {
  position: sticky;
  top: 1rem;
}

.brand-block,
.nav-block,
.meta-box {
  border: 1px solid var(--line);
  background: var(--panel);
}

.brand-block {
  padding: 0.95rem 1rem 1rem;
}

.doc-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand {
  margin: 0.45rem 0 0.35rem;
  font-family: var(--sans);
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.brand-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.nav-block,
.meta-box {
  margin-top: 0.9rem;
}

.nav-kicker,
.box-title {
  margin: 0;
  padding: 0.7rem 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  background: rgba(229, 220, 196, 0.7);
}

.nav-link {
  display: block;
  padding: 0.72rem 0.85rem;
  color: var(--ink);
  font-family: var(--sans);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background-color 120ms ease;
}

.nav-link:last-child {
  border-bottom: 0;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--paper-deep);
}

.nav-link small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.9rem;
}

.meta-box p,
.meta-box ul {
  margin: 0;
  padding: 0.85rem;
}

.plain-list {
  list-style: none;
}

.plain-list li + li {
  margin-top: 0.4rem;
}

.document {
  padding: 2rem clamp(1rem, 3vw, 2.75rem) 3rem;
}

.document-inner {
  width: min(100%, 72rem);
}

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

.doc-path {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.page-title {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.lead {
  width: min(100%, 58rem);
  margin: 0.85rem 0 0;
  font-size: 1.08rem;
}

.section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section h2 {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 1.45rem;
}

.section h3 {
  margin: 1.15rem 0 0.55rem;
  font-family: var(--sans);
  font-size: 1.08rem;
}

.section p,
.section li,
.section td,
.section th,
.section dd {
  max-width: 72ch;
}

ul,
ol {
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.35rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
  width: min(100%, 62rem);
}

.panel-card {
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-card h3,
.panel-card p {
  margin-top: 0;
}

.panel-card h3 {
  margin-bottom: 0.45rem;
}

.panel-card p:last-child,
.panel-card ul:last-child {
  margin-bottom: 0;
}

.callout {
  width: min(100%, 58rem);
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  background: rgba(229, 220, 196, 0.48);
}

table {
  width: min(100%, 60rem);
  border-collapse: collapse;
  background: var(--panel);
}

caption {
  margin-bottom: 0.55rem;
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
}

th,
td {
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-family: var(--sans);
  background: var(--paper-deep);
}

pre {
  width: min(100%, 60rem);
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--code);
  line-height: 1.5;
}

code {
  padding: 0 0.18rem;
  background: rgba(233, 224, 200, 0.72);
}

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

dl {
  width: min(100%, 58rem);
  display: grid;
  grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr);
  gap: 0.45rem 1rem;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
}

dd {
  margin: 0;
}

.footer-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--sans);
}

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

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

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

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-stack {
    position: static;
  }

  .document {
    padding-top: 1.35rem;
  }

  dl {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
