:root {
  --surface: #ffffff;
  --surface-low: #f6f3f2;
  --surface-high: #eae7e7;
  --ink: #1b1c1c;
  --muted: #594139;
  --line: #e1bfb5;
  --dot: #dedede;
  --primary: #ab3500;
  --orange: #ff6b35;
  --yellow: #ffd167;
  --blue: #2b6485;
  --blue-light: #6ba0c4;
  --border: 1px solid var(--ink);
  --dot-offset: 0px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --display: "Hanken Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 19px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--orange) 0 50%, var(--yellow) 50% 75%, var(--blue-light) 75% 100%);
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--primary);
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 1rem;
  left: 1rem;
  padding: 0.55rem 0.8rem;
  color: white;
  background: var(--primary);
  border: var(--border);
  transform: translateY(-190%);
}

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

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

.site-shell::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0 0 0 18rem;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.2px);
  background-position: 0 var(--dot-offset);
  background-size: 40px 40px;
}

.sidebar {
  position: sticky;
  z-index: 1;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2.2rem 1.5rem;
  background: var(--surface-low);
  border-right: var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  color: #5f1900;
  background: var(--orange);
  border: var(--border);
  font: 700 1.25rem/1 var(--display);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 0.04rem;
  color: var(--muted);
  font: 700 0.72rem/1.4 var(--mono);
  text-transform: uppercase;
}

.nav-label {
  margin: 2.2rem 0 0.7rem;
  color: var(--muted);
  font: 700 0.72rem/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar nav > a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.45rem;
  margin: 0 -0.45rem;
  padding: 0.5rem 0.45rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
  text-decoration: none;
}

.sidebar nav > a span {
  color: var(--muted);
  font: 600 0.72rem/1.9 var(--mono);
}

.sidebar nav > a:hover,
.sidebar nav > a:focus,
.placeholder-links a:hover,
.placeholder-links a:focus {
  color: white;
  background: var(--blue);
}

.sidebar [aria-current="page"] {
  color: #5f1900 !important;
  background: var(--orange) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: 4px 4px 0 var(--ink);
}

.sidebar [aria-current="page"] span,
.sidebar [aria-current="page"] small {
  color: #5f1900;
}

.placeholder-links {
  border-left: 2px dashed var(--line);
}

.placeholder-links > a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-left: 0.55rem;
  padding: 0.4rem 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.placeholder-links small {
  color: var(--muted);
  font: 600 0.6rem/2 var(--mono);
  text-transform: uppercase;
}

.section-nav {
  margin: 0.8rem 0 1.2rem;
  padding: 0.65rem 0 0.15rem 0.8rem;
  border-left: 3px solid var(--blue-light);
  list-style: none;
}

.section-nav li {
  margin: 0;
}

.section-nav a {
  display: block;
  padding: 0.2rem 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  text-decoration: none;
}

.section-nav .section-nav-level-3 a {
  padding-left: 1rem;
  font-size: 0.66rem;
}

.section-nav a:hover,
.section-nav a[aria-current="location"] {
  color: var(--ink);
  background: var(--yellow);
}

.page-column {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.mobile-header {
  display: none;
}

.content {
  width: min(100% - 5rem, 60rem);
  min-height: calc(100vh - 7rem);
  margin: 0 auto;
  padding: 4rem 0 6rem;
  padding-bottom: max(6rem, calc(100vh - 10rem));
}

.content > :first-child {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  scroll-margin-top: 1.5rem;
}

h1 {
  max-width: 18ch;
  margin: 0 0 1.6rem;
  font-size: clamp(3.2rem, 6vw, 5.2rem);
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h2 {
  margin: 4.2rem 0 1.1rem;
  padding-top: 0.7rem;
  border-top: 4px solid var(--orange);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

h3 {
  margin: 2.6rem 0 0.7rem;
  font-size: 1.35rem;
}

h4 {
  margin: 2rem 0 0.6rem;
  font-size: 1.1rem;
}

p,
ul,
ol,
table {
  max-width: 52rem;
}

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

.eyebrow {
  display: inline-block;
  margin: 0 0 1.2rem;
  padding: 0.3rem 0.55rem;
  color: #5f1900;
  background: var(--orange);
  border-radius: 0.25rem;
  font: 700 0.76rem/1.25 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 52rem;
  margin: 0 0 1.7rem;
  padding-left: 1.15rem;
  border-left: 6px solid var(--blue);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 2rem 0 3.2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  padding: 0.65rem 0.95rem;
  align-items: center;
  color: #5f1900;
  background: var(--orange);
  border: var(--border);
  border-radius: 999px;
  font: 750 0.84rem/1.2 var(--mono);
  text-decoration: none;
  text-transform: uppercase;
}

.button:hover {
  color: white;
  background: var(--primary);
}

.button.secondary {
  color: var(--ink);
  background: white;
}

.button.secondary:hover {
  color: white;
  background: var(--blue);
}

.doc-grid,
.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 52rem;
  margin: 2rem 0;
}

.doc-card,
.placeholder-card {
  padding: 1.1rem 1.2rem;
  color: var(--ink);
  background: white;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  text-decoration: none;
}

.doc-card:hover {
  color: var(--ink);
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.doc-card strong,
.placeholder-card strong {
  display: block;
  font: 700 1.3rem/1.2 var(--display);
}

.doc-card span,
.placeholder-card span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.placeholder-card {
  border-style: dashed;
  box-shadow: none;
}

.placeholder-card small,
.status {
  display: inline-block;
  margin-bottom: 0.55rem;
  padding: 0.12rem 0.4rem;
  color: #765900;
  background: var(--yellow);
  font: 700 0.66rem/1.4 var(--mono);
  text-transform: uppercase;
}

blockquote,
.callout {
  max-width: 52rem;
  margin: 2rem 0;
  padding: 1rem 1.15rem;
  color: var(--ink);
  background: var(--surface-low);
  border-left: 6px solid var(--blue);
  border-radius: 0 0.5rem 0.5rem 0;
}

blockquote > :first-child,
.callout > :first-child {
  margin-top: 0;
}

blockquote > :last-child,
.callout > :last-child {
  margin-bottom: 0;
}

.callout.warning {
  border-left-color: var(--primary);
}

.example-preview {
  width: calc(100% - 8px);
  max-width: 52rem;
  margin: 2rem 8px 3.2rem 0;
  overflow: hidden;
  background: white;
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

.example-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 32rem;
  object-fit: contain;
  background: var(--surface-high);
}

.example-preview figcaption {
  padding: 0.75rem 0.9rem;
  color: var(--muted);
  background: var(--surface-low);
  border-top: var(--border);
  font-size: 0.82rem;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
}

:not(pre) > code {
  padding: 0.12em 0.34em;
  color: var(--muted);
  background: var(--surface-high);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
}

.api-signature {
  width: calc(100% - 8px);
  overflow-x: auto;
  margin: 0.8rem 0 1.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface-high);
  border-left: 4px solid var(--blue);
  white-space: nowrap;
}

.api-signature code {
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 0.82rem;
}

div.highlighter-rouge {
  max-width: 100%;
  margin: 1.7rem 8px 2.3rem 0;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.7rem 0;
  padding: 1.2rem 1.3rem;
  color: var(--ink);
  background: white;
  border: 2px solid #17486e;
  border-radius: 3px;
  box-shadow: none;
  font-size: 0.88rem;
  line-height: 1.7;
  tab-size: 2;
}

div.highlighter-rouge pre {
  margin: 0;
}

pre code {
  color: inherit;
  background: transparent;
}

.highlight .c,
.highlight .c1,
.highlight .cm {
  color: #636363;
}

.highlight .k,
.highlight .kn,
.highlight .kc,
.highlight .ow {
  color: #2a77b5;
}

.highlight .s,
.highlight .s1,
.highlight .s2 {
  color: #736aaf;
}

.highlight .m,
.highlight .mi,
.highlight .mf {
  color: #2b994a;
}

.highlight .nf,
.highlight .nc {
  color: #2a77b5;
}

.highlight .n,
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi {
  color: #000000;
}

.highlight .nn,
.highlight .ne,
.highlight .nl {
  color: #000000;
}

.highlight .nb,
.highlight .no {
  color: #000000;
}

.highlight .bp {
  color: #2a77b5;
}

.highlight .na,
.highlight .nt {
  color: #de520c;
}

.highlight .o {
  color: #000000;
}

.highlight .p {
  color: #000000;
}

.highlight .sa,
.highlight .si,
.highlight .se,
.highlight .sr {
  color: #736aaf;
}

.highlight .nd {
  color: #585858;
}

.highlight [data-code-token="parameter"] {
  color: #2b994a;
}

.highlight [data-code-token="call"] {
  color: #e24909;
}

.highlight [data-code-token="attribute"] {
  color: #de520c;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
}

table {
  display: block;
  width: calc(100% - 8px);
  max-width: calc(100% - 8px);
  overflow-x: auto;
  border-collapse: collapse;
  background: white;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
}

td {
  overflow-wrap: anywhere;
}

td code {
  overflow-wrap: normal;
  white-space: nowrap;
}

th {
  background: var(--yellow);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.next-page {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  max-width: 52rem;
  margin-top: 5rem;
  padding: 1rem 1.15rem;
  color: white;
  background: var(--primary);
  border: var(--border);
  border-radius: 0.5rem;
}

.next-page span {
  font: 700 0.76rem/1.7 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.next-page a {
  color: white;
  text-align: right;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 2.5rem;
  color: var(--muted);
  background: var(--surface-low);
  border-top: var(--border);
  font-size: 0.78rem;
}

@media (max-width: 960px) {
  html {
    font-size: 18px;
  }

  .site-shell {
    display: block;
  }

  .site-shell::before {
    inset: 0;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 20;
    top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface-low);
    border-bottom: var(--border);
  }

  .brand.compact .brand-mark {
    width: 2.15rem;
    height: 2.15rem;
  }

  .mobile-nav {
    position: relative;
  }

  .mobile-nav summary {
    cursor: pointer;
    padding: 0.45rem 0.65rem;
    background: var(--yellow);
    border: var(--border);
    font: 700 0.72rem/1.3 var(--mono);
    list-style: none;
    text-transform: uppercase;
  }

  .mobile-nav > div {
    position: absolute;
    right: 0;
    width: min(21rem, calc(100vw - 2rem));
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.6rem;
    background: white;
    border: 2px solid var(--ink);
    box-shadow: 6px 6px 0 var(--ink);
  }

  .mobile-nav a {
    display: block;
    padding: 0.45rem;
    color: var(--ink);
    text-decoration: none;
  }

  .mobile-nav a[aria-current="page"] {
    background: var(--orange);
  }

  .mobile-nav .section-nav {
    margin-left: 0.45rem;
  }

  .content {
    width: min(100% - 2rem, 60rem);
    padding-top: 2.8rem;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(2.6rem, 15vw, 4rem);
  }

  h2 {
    margin-top: 3.4rem;
  }

  .doc-grid,
  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  table {
    width: 100%;
    max-width: 100%;
    min-width: 34rem;
  }

  footer {
    flex-direction: column;
    padding: 1.2rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
