:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --line: #dedede;
  --soft: #f5f5f3;
  --soft-2: #ececea;
  --copy: #353535;
  --lead: #454545;
  --nav-text: #555555;
  --quiet: #888888;
  --strong-line: #b8b8b8;
  --header-bg: rgba(255, 255, 255, 0.94);
  --modal-border: #aaaaaa;
  --input-border: #bbbbbb;
  --focus-ring: rgba(0, 0, 0, 0.08);
  --panel-shadow: rgba(0, 0, 0, 0.2);
  --header-height: 76px;
  --left-width: 256px;
  --right-width: 220px;
  --content-width: 760px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #101010;
  --ink: #f3f3f0;
  --muted: #aaa9a4;
  --line: #30302e;
  --soft: #191918;
  --soft-2: #272725;
  --copy: #d2d1cc;
  --lead: #c4c3be;
  --nav-text: #bebdb8;
  --quiet: #8e8d88;
  --strong-line: #595956;
  --header-bg: rgba(16, 16, 16, 0.94);
  --modal-border: #4b4b48;
  --input-border: #555552;
  --focus-ring: rgba(255, 255, 255, 0.1);
  --panel-shadow: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 30px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transition: top 140ms ease;
}

.skip-link:focus {
  top: 10px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(100%, 1500px);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: url(#frog-pixel-outline);
}

html[data-theme="dark"] .brand-logo {
  filter: none;
}

.pixel-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.brand-label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-spacer {
  flex: 1;
}

.search-trigger {
  width: min(330px, 34vw);
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.search-trigger:hover {
  border-color: var(--strong-line);
  color: var(--ink);
}

.search-trigger svg,
.icon-link svg,
.menu-toggle svg,
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.key-hint {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--quiet);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.icon-link,
.menu-toggle,
.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-link:hover,
.menu-toggle:hover,
.theme-toggle:hover {
  border-color: var(--line);
  background: var(--soft);
}

.menu-toggle {
  display: none;
}

.theme-toggle .moon-icon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

.docs-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: var(--left-width) minmax(0, var(--content-width)) var(--right-width);
  justify-content: center;
  column-gap: 52px;
}

.left-sidebar,
.right-sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  overflow: auto;
  scrollbar-width: thin;
}

.left-sidebar {
  padding: 32px 14px 40px 0;
  border-right: 1px solid var(--line);
}

.right-sidebar {
  padding: 38px 0 40px 20px;
  border-left: 1px solid var(--line);
}

.nav-group + .nav-group {
  margin-top: 28px;
}

.nav-heading,
.toc-heading {
  margin: 0 0 9px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-list,
.toc-list,
.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: block;
  margin: 2px 0;
  padding: 8px 11px;
  border-radius: 5px;
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 530;
  line-height: 1.35;
  text-decoration: none;
}

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

.nav-link.active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 680;
}

.sidebar-note {
  margin: 34px 12px 0;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.55;
}

.doc-content {
  min-width: 0;
  padding: 66px 0 72px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.doc-content h1 {
  max-width: 700px;
  margin: 0;
  padding: 0 0 32px;
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 790;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.lead {
  max-width: 690px;
  margin: 0;
  color: var(--lead);
  font-size: 19px;
  line-height: 1.65;
}

.page-rule {
  margin: 42px 0 44px;
  border: 0;
  border-top: 1px solid var(--line);
}

.doc-content h2 {
  margin: 56px 0 17px;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.28;
}

.doc-content h3 {
  margin: 36px 0 12px;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.doc-content p {
  margin: 0 0 18px;
  color: var(--copy);
}

.doc-content strong {
  color: var(--ink);
}

.doc-content ul,
.doc-content ol {
  margin: 16px 0 23px;
  padding-left: 24px;
  color: var(--copy);
}

.doc-content li {
  margin: 7px 0;
  padding-left: 4px;
}

.text-link {
  font-weight: 650;
}

.tag-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--nav-text);
  font-size: 12px;
  font-weight: 650;
}

.doc-grid {
  margin: 26px 0 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.doc-card {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--strong-line);
  background: var(--soft);
}

.doc-card-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 730;
}

.doc-card-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.callout {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--ink);
  background: var(--soft);
}

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

.callout-title {
  margin: 0 0 4px !important;
  color: var(--ink) !important;
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-media {
  position: relative;
  min-height: 340px;
  margin: 32px 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--soft);
  overflow: hidden;
}

.hero-media img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0.22;
  filter: url(#frog-pixel-outline);
}

html[data-theme="dark"] .hero-media img {
  filter: none;
}

.hero-media-copy {
  position: absolute;
  inset: auto 18px 16px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

.hero-media-copy strong {
  color: var(--ink);
}

.link-row {
  margin: 24px 0 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 20px;
}

.link-row a {
  font-size: 14px;
  font-weight: 680;
}

.link-muted {
  color: var(--quiet);
  font-size: 14px;
}

.component-section {
  margin: 0;
  padding: 34px 0 16px;
  border-top: 1px solid var(--line);
}

.component-section h3 {
  margin-top: 0;
  text-transform: uppercase;
}

.component-section p {
  max-width: 720px;
}

.case-study {
  margin: 0;
  padding: 42px 0 18px;
  border-top: 1px solid var(--line);
}

.case-study h2 {
  margin-top: 0;
}

.case-study p {
  max-width: 720px;
}

.status {
  display: inline-block;
  margin-right: 7px;
  padding: 2px 7px;
  border: 1px solid var(--strong-line);
  color: var(--ink);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

.status.experimental {
  border-style: dashed;
}

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

.gallery-grid {
  margin: 26px 0 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.gallery-grid-large {
  grid-template-columns: 1fr;
  gap: 38px;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 5 / 3;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #ffffff;
  object-fit: contain;
  image-rendering: pixelated;
}

.gallery-photo img {
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  image-rendering: auto;
}

.gallery-item-tall img {
  width: min(100%, 760px);
  height: auto;
  aspect-ratio: auto;
  margin-inline: auto;
  border: 0;
  background: transparent;
}

.gallery-item figcaption {
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

code {
  padding: 0.14em 0.36em;
  border-radius: 4px;
  background: var(--soft-2);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.code-block {
  position: relative;
  margin: 23px 0 28px;
  border: 1px solid #2e2e2e;
  border-radius: 7px;
  background: #151515;
  overflow: hidden;
}

.code-label {
  padding: 8px 14px;
  border-bottom: 1px solid #343434;
  color: #999;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  color: #f2f2f2;
  font-size: 13px;
  line-height: 1.65;
}

.code-block pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.copy-code {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 3px 8px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #202020;
  color: #bbb;
  font-size: 11px;
  cursor: pointer;
}

.copy-code:hover {
  color: #fff;
}

.page-nav {
  margin-top: 66px;
  padding-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.page-nav-link {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}

.page-nav-link.next {
  text-align: right;
}

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

.page-nav-kicker {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-nav-title {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 680;
}

.toc-link {
  display: block;
  padding: 5px 0;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}

.toc-link.level-3 {
  padding-left: 12px;
}

.toc-link:hover,
.toc-link.active {
  color: var(--ink);
}

.toc-link.active {
  font-weight: 680;
}

.toc-empty {
  color: var(--quiet);
  font-size: 12px;
}

.doc-footer {
  margin-top: 42px;
  color: var(--quiet);
  font-size: 12px;
}

.nav-scrim {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 45;
  display: none;
  background: rgba(0, 0, 0, 0.28);
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: start center;
  padding: 12vh 20px 20px;
  background: rgba(0, 0, 0, 0.38);
}

.search-modal.open {
  display: grid;
}

.search-panel {
  width: min(620px, 100%);
  max-height: 70vh;
  border: 1px solid var(--modal-border);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 20px 70px var(--panel-shadow);
  overflow: hidden;
}

.search-input-wrap {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.search-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

.search-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.search-results {
  max-height: 50vh;
  padding: 8px;
  overflow: auto;
}

.search-result-link {
  display: block;
  padding: 12px 13px;
  border-radius: 6px;
  text-decoration: none;
}

.search-result-link:hover,
.search-result-link:focus {
  background: var(--soft);
  outline: none;
}

.search-result-title {
  display: block;
  font-size: 14px;
  font-weight: 720;
}

.search-result-copy {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.search-empty {
  padding: 22px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: var(--left-width) minmax(0, var(--content-width));
    column-gap: 48px;
  }

  .right-sidebar {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 68px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 10px;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-label {
    display: none;
  }

  .search-trigger {
    width: 38px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
  }

  .search-trigger span,
  .key-hint {
    display: none;
  }

  .docs-shell {
    display: block;
    padding: 0 22px;
  }

  .left-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 50;
    width: min(310px, 84vw);
    height: auto;
    padding: 24px 18px 40px;
    border-right: 1px solid var(--line);
    background: var(--paper);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .left-sidebar {
    transform: translateX(0);
  }

  body.nav-open .nav-scrim {
    display: block;
  }

  .doc-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 48px 0 64px;
  }
}

@media (max-width: 560px) {
  .brand-copy {
    display: none;
  }

  .header-spacer {
    min-width: 0;
  }

  .doc-content h1 {
    font-size: 41px;
  }

  .lead {
    font-size: 17px;
  }

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

  .hero-media {
    min-height: 260px;
  }

  .hero-media-copy {
    display: block;
  }

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

  .page-nav {
    grid-template-columns: 1fr;
  }

  .page-nav-link.next {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
