@font-face {
  font-family: "netfyr Sans";
  src: url("../assets/netfyrsans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "netfyr Mono";
  src: url("../assets/netfyrmono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  --sidebar-width: 231px;
  --sidebar: #f3f0ea;
  --selected: #e9e4dc;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-ui-mode]) body {
    --sidebar: #1c1815;
    --selected: #3c3128;
  }
}

:root[data-ui-mode="dark"] body {
  --sidebar: #1c1815;
  --selected: #3c3128;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--soft);
}

.icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 27px 18px 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  line-height: 1.5;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}

.brand .flame-svg {
  display: block;
  width: 155px;
  max-width: 100%;
  height: auto;
}

.brand-subtitle {
  margin: -2px 0 0 52px;
  color: var(--muted);
  font-size: 11px;
}

.section-navigation {
  margin: 35px 0 30px;
}

.nav-label {
  margin: 0 12px 8px;
  color: var(--muted);
  font: 400 9px/1.5 "netfyr Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-divider {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  margin-bottom: 3px;
  padding: 10px 12px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.nav-link .icon {
  width: 17px;
  height: 17px;
}

.nav-link:hover {
  background: var(--soft);
  color: var(--text);
}

.nav-link[aria-current] {
  background: var(--selected);
  color: var(--text);
  font-weight: 600;
}

.nav-link[aria-current]::before {
  position: absolute;
  left: -18px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}

.nav-link[aria-current] .icon {
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px 8px 22px;
  border-top: 1px solid var(--line);
}

.sidebar-footer .nav-label {
  margin: 0 0 8px;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--text);
}

.sidebar-footer .icon {
  width: 13px;
  height: 13px;
}

.workspace {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 42px;
  border-bottom: 1px solid var(--line);
  background: var(--background);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb strong {
  color: var(--text);
}

.breadcrumb strong {
  font-weight: 400;
}

.breadcrumb [aria-hidden] {
  opacity: 0.45;
}

.topbar > .ui-theme-toggle {
  margin-left: auto;
}

.mobile-menu,
.mobile-close {
  display: none;
}

.page-layout {
  --page-gutter: 55px;
  max-width: calc(82ch + 2 * var(--page-gutter));
  min-width: 0;
  margin: 0 auto;
  padding: 43px var(--page-gutter) 0;
  overflow-wrap: anywhere;
}

.article-header {
  margin-bottom: 34px;
}

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 10px;
  font-size: 44px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 18px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

p {
  margin: 0 0 18px;
}

.page-meta {
  color: var(--muted);
  font-size: 11px;
}

.article-body > section {
  margin-top: 42px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.article-body > section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

h2[id],
h3[id] {
  scroll-margin-top: 12px;
}

ul,
ol {
  margin: 0 0 22px;
  padding-inline-start: 24px;
}

li {
  margin-bottom: 10px;
  padding-inline-start: 4px;
}

li::marker {
  color: var(--accent);
}

.stages > li {
  margin-bottom: 28px;
  padding-inline-start: 10px;
}

.stages > li:last-child {
  margin-bottom: 0;
}

.lifecycle-diagram {
  container-type: inline-size;
  margin: 24px 0 32px;
}

.lifecycle-diagram figcaption,
caption {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.lifecycle-flow {
  display: grid;
  gap: 24px;
  padding: 0;
  list-style: none;
}

.lifecycle-flow li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.flow-number {
  color: var(--muted);
  font: 400 11px/1.5 "netfyr Mono", monospace;
}

.flow-arrow {
  position: absolute;
  bottom: -24px;
  left: 50%;
  color: var(--accent);
  font-size: 20px;
  line-height: 1.2;
  transform: translateX(-50%) rotate(90deg);
}

.flow-feedback {
  margin: 18px 0 0;
  font-size: 12px;
}

.flow-feedback > span {
  color: var(--accent);
}

@container (min-width: 46rem) {
  .lifecycle-flow {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 22px;
  }

  .lifecycle-flow li {
    flex-direction: column;
    align-items: start;
    gap: 8px;
    padding: 14px 12px;
    font-size: 12px;
  }

  .flow-arrow {
    top: 50%;
    right: -22px;
    bottom: auto;
    left: auto;
    width: 22px;
    text-align: center;
    transform: translateY(-50%);
  }
}

.note {
  margin-block: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
}

.note p {
  margin: 0;
}

.note-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.note-warning > .icon {
  margin-top: 3px;
  color: var(--accent);
}

code {
  font-family: "netfyr Mono", ui-monospace, monospace;
  font-size: 0.9em;
}

.code-block {
  position: relative;
  margin: 22px 0;
  padding: 20px 72px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.code-block pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  border-radius: inherit;
  font-size: 14px;
}

.copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.copy-code:hover {
  background: var(--soft);
  color: var(--text);
}

.copy-code:focus-visible,
.code-block pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.copy-code svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  z-index: 35;
  bottom: 24px;
  left: calc(50% + var(--sidebar-width) / 2);
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--text);
  color: var(--background);
  box-shadow: 0 5px 30px #00000025;
  font-size: 13px;
  line-height: 1.5;
  transform: translateX(-50%);
}

dl {
  margin: 22px 0;
}

dt {
  margin-top: 18px;
  color: var(--accent);
}

dd {
  margin: 6px 0 0;
}

dd > :last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  margin-block: 22px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-weight: 400;
}

thead {
  background: var(--surface);
}

th:first-child {
  width: 28%;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 46px;
  padding: 25px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.page-footer a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.page-footer a:hover {
  color: var(--accent);
}

.footer-brand img {
  display: block;
  flex: none;
}

.page-footer .icon {
  width: 13px;
  height: 13px;
}

.skip-link {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 20px;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--text);
  transform: translateY(-200%);
}

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

@media (min-width: 1600px) {
  .page-layout {
    padding-top: 50px;
  }
}

@media (max-width: 1180px) {
  body {
    --sidebar-width: 207px;
  }

  .sidebar {
    padding-inline: 14px;
  }

  .nav-link[aria-current]::before {
    left: -14px;
  }

  .topbar {
    padding-inline: 32px;
  }

  .page-layout {
    --page-gutter: 32px;
    padding-top: 35px;
  }
}

@media (max-width: 980px) {
  body {
    --sidebar-width: 190px;
  }

  .sidebar {
    padding-inline: 11px;
  }

  .nav-link[aria-current]::before {
    left: -11px;
  }

  .topbar {
    padding-inline: 26px;
  }

  .page-layout {
    --page-gutter: 26px;
    padding-top: 30px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 80px;
  }

  .sidebar {
    position: static;
    width: 100%;
    padding: 27px 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .has-guide-navigation .sidebar {
    position: fixed;
    width: 231px;
    max-width: calc(100% - 48px);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease;
  }

  .has-guide-navigation .sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-link[aria-current]::before {
    left: -18px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: #211c1970;
  }

  .mobile-close {
    position: absolute;
    top: 12px;
    right: 8px;
    display: inline-flex;
  }

  .mobile-close:focus-visible {
    outline-offset: -3px;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    min-height: 60px;
    padding: 8px 16px;
    gap: 10px;
  }

  .breadcrumb {
    gap: 8px;
  }

  .breadcrumb > a,
  .breadcrumb > a + span {
    display: none;
  }

  .page-layout {
    --page-gutter: 22px;
    padding-top: 30px;
  }

  h1 {
    font-size: 37px;
  }

  .toast {
    left: 50%;
  }
}

@media (max-width: 520px) {
  .page-layout {
    --page-gutter: 18px;
    padding-top: 26px;
  }

  h1 {
    font-size: 33px;
  }

  h2 {
    font-size: 25px;
  }

  .note {
    padding: 18px;
  }

  .code-block {
    padding-left: 16px;
  }

  th,
  td {
    padding-inline: 8px;
  }

  th:first-child {
    width: 36%;
  }
}

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

  .has-guide-navigation .sidebar {
    transition: none;
  }
}

@media print {
  :root[data-ui-theme] {
    --line: #8b7a6b;
    color-scheme: light;
    color: #211c19;
    background: white;
  }

  .sidebar,
  .sidebar-backdrop,
  .topbar,
  .skip-link,
  .page-footer,
  .copy-code,
  .toast {
    display: none;
  }

  .workspace {
    margin: 0;
  }

  .page-layout {
    padding: 0;
  }

  h1,
  h2,
  h3,
  a,
  dt,
  li::marker,
  .page-meta,
  caption,
  .lifecycle-diagram figcaption,
  .flow-number,
  .flow-arrow,
  .flow-feedback > span {
    color: inherit;
  }

  .note,
  .code-block,
  thead,
  .lifecycle-flow li {
    background: transparent;
  }

  .code-block {
    padding: 20px;
    color: inherit;
  }

  .code-block pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
