@font-face {
  font-family: "Instrument Sans";
  src: url("/instrument-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #111311;
  --ink-soft: #1b1e1b;
  --paper: #f8f9f6;
  --paper-bright: #ffffff;
  --paper-dim: #e7e9e4;
  --paper-code: #eef0ec;
  --muted: #626961;
  --quiet: #858b84;
  --rule: #d5d9d3;
  --rule-strong: #afb6ad;
  --live: #49675a;
  --static: #303530;
  --adaptive: #8f4c48;
  --type: #8b6b2f;
  --policy: var(--live);
  --header-height: 52px;
  --left-rail: 248px;
  --right-rail: 218px;
  --content-max: 960px;
  font-family: "Instrument Sans", Arial, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

body[data-execution-mode="static"] {
  --policy: var(--static);
}

body[data-execution-mode="adaptive"] {
  --policy: var(--adaptive);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

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

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--policy);
  outline-offset: 2px;
}

code,
pre,
kbd,
.gray-wordmark {
  font-family: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

code {
  font-size: 0.9em;
}

pre {
  margin: 0;
  overflow: auto;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.68;
  tab-size: 4;
}

.workspace-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: minmax(310px, var(--left-rail)) minmax(0, 1fr) auto;
  align-items: center;
  height: var(--header-height);
  border-bottom: 1px solid #303530;
  background: var(--ink);
  color: var(--paper);
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 16px;
  border-right: 1px solid #303530;
}

.gray-wordmark {
  color: var(--paper);
  font-size: 0.94rem;
  font-weight: 760;
  text-decoration: none;
}

.gray-wordmark span {
  color: #939b92;
}

.identity-rule {
  width: 1px;
  height: 18px;
  background: #414641;
}

.publisher-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b6bcb5;
  font-size: 0.74rem;
  text-decoration: none;
}

.publisher-mark img {
  width: 16px;
  height: 16px;
  filter: invert(1);
  opacity: 0.82;
}

.publisher-mark:hover {
  color: var(--paper);
}

.header-location {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 18px;
  color: #aab0aa;
  font-size: 0.75rem;
}

.header-location strong {
  color: var(--paper);
  font-weight: 580;
}

.search-shortcut {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 156px;
  height: 100%;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid #303530;
  background: transparent;
  color: #bcc2bb;
  cursor: pointer;
  text-align: left;
}

.search-shortcut:hover {
  background: var(--ink-soft);
  color: var(--paper);
}

kbd {
  margin-left: auto;
  color: #858d84;
  font-size: 0.68rem;
}

.mobile-nav-toggle {
  display: none;
  width: auto;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #414641;
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 650;
}

.docs-workspace {
  display: grid;
  grid-template-columns: var(--left-rail) minmax(0, 1fr) var(--right-rail);
  min-height: calc(100vh - var(--header-height));
}

.docs-nav,
.page-rail {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: rgba(248, 249, 246, 0.96);
}

.docs-nav {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--rule);
}

.nav-search {
  padding: 15px 14px 14px;
  border-bottom: 1px solid var(--rule);
}

.nav-search label,
.api-search span {
  display: block;
  margin-bottom: 6px;
  color: var(--quiet);
  font-size: 0.68rem;
  font-weight: 620;
}

.nav-search input,
.api-search input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  outline: none;
  background: var(--paper-bright);
  color: var(--ink);
  font-size: 0.78rem;
}

.nav-search input::placeholder,
.api-search input::placeholder {
  color: var(--quiet);
}

.nav-search input:focus,
.api-search input:focus {
  border-color: var(--policy);
}

.nav-tree {
  padding: 8px 0 18px;
}

.nav-group {
  padding: 12px 10px 5px;
}

.nav-group > span {
  display: block;
  padding: 0 6px 5px;
  color: var(--quiet);
  font-size: 0.65rem;
  font-weight: 660;
}

.nav-group a {
  display: block;
  padding: 5px 7px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.77rem;
  text-decoration: none;
}

.nav-group a:hover {
  color: var(--ink);
}

.nav-group a.active {
  border-left-color: var(--policy);
  background: var(--paper-dim);
  color: var(--ink);
  font-weight: 620;
}

.docs-content {
  min-width: 0;
  border-right: 1px solid var(--rule);
  background: rgba(248, 249, 246, 0.84);
}

.language-intro,
.reference-section {
  width: min(100% - 64px, var(--content-max));
  margin: 0 auto;
}

.language-intro {
  padding: 42px 0 52px;
}

.breadcrumb {
  margin: 0 0 27px;
  color: var(--quiet);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
}

.intro-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
}

.section-label {
  margin: 0 0 7px;
  color: var(--policy);
  font-size: 0.7rem;
  font-weight: 690;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 4vw, 3.15rem);
  font-weight: 720;
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 670;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 640;
  line-height: 1.4;
}

.language-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.language-facts div {
  min-width: 0;
  padding: 8px 12px;
  border-right: 1px solid var(--rule);
}

.language-facts div:last-child {
  border-right: 0;
}

.language-facts dt,
.policy-contract dt {
  color: var(--quiet);
  font-size: 0.62rem;
}

.language-facts dd,
.policy-contract dd {
  margin: 1px 0 0;
  font-size: 0.72rem;
  font-weight: 620;
}

.intro-copy {
  max-width: 720px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.execution-demo {
  margin: 0;
  border: 1px solid var(--rule-strong);
  background: var(--paper-bright);
}

.demo-bar,
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 0 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
}

.demo-bar {
  min-height: 42px;
  padding: 0;
}

.demo-file {
  display: flex;
  gap: 18px;
  min-width: 0;
  padding: 0 12px;
}

.demo-file span:last-child {
  overflow: hidden;
  color: var(--quiet);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-mode-selector {
  display: flex;
  align-self: stretch;
  border-left: 1px solid var(--rule);
}

.demo-mode-selector button {
  min-width: 76px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 640;
}

.demo-mode-selector button:last-child {
  border-right: 0;
}

.demo-mode-selector button:hover {
  background: var(--paper-dim);
  color: var(--ink);
}

.demo-mode-selector button.active {
  background: var(--policy);
  color: #ffffff;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(230px, 0.8fr);
}

.code-surface {
  min-height: 286px;
  padding: 21px;
  background: var(--paper-code);
}

.response-surface {
  min-width: 0;
  border-left: 1px solid var(--rule);
  background: var(--paper-bright);
}

.response-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 39px;
  padding: 0 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--quiet);
  font-size: 0.67rem;
}

.response-surface > pre {
  min-height: 146px;
  padding: 18px;
}

.policy-contract {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-top: 1px solid var(--rule);
}

.policy-contract div {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--rule);
}

.policy-contract div:last-child {
  border-right: 0;
}

.syntax-comment {
  color: #7b827a;
}

.syntax-string {
  color: #49675a;
}

.syntax-variable {
  color: #343a35;
  font-weight: 650;
}

.syntax-number,
.syntax-keyword {
  color: var(--adaptive);
}

.syntax-call {
  color: var(--type);
}

.reference-section {
  padding: 54px 0 60px;
  border-top: 1px solid var(--rule-strong);
}

.reference-heading {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(250px, 1.25fr);
  column-gap: 38px;
  margin-bottom: 25px;
}

.reference-heading .section-label {
  grid-column: 1 / -1;
}

.reference-heading > p:last-child {
  align-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.command-sequence {
  position: relative;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.command-sequence > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

.command-sequence > div:last-of-type {
  border-bottom: 0;
}

.command-sequence span {
  color: var(--quiet);
  font: 0.66rem "SFMono-Regular", Consolas, monospace;
}

.command-sequence code {
  font-size: 0.8rem;
}

.copy-command {
  position: absolute;
  top: 8px;
  right: 0;
  min-width: 58px;
  min-height: 28px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--paper-bright);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
}

.copy-command:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.syntax-note {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.1fr);
  margin-top: 24px;
  border: 1px solid var(--rule);
}

.syntax-note pre {
  padding: 18px;
  border-right: 1px solid var(--rule);
  background: var(--paper-code);
}

.syntax-note > div {
  align-self: center;
  padding: 20px;
}

.syntax-note strong {
  font-size: 0.86rem;
}

.syntax-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.reference-list {
  border-top: 1px solid var(--ink);
}

.feature-card {
  display: grid;
  grid-template-columns: 112px minmax(200px, 0.88fr) minmax(250px, 1.12fr);
  gap: 18px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.feature-card[hidden] {
  display: none;
}

.reference-kind,
.api-kind {
  color: var(--policy);
  font-size: 0.68rem;
  font-weight: 660;
}

.feature-card p,
.api-detail p,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-state {
  padding: 18px 0;
  color: var(--muted);
}

.tutorial-shell,
.api-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  background: var(--paper-bright);
}

.tutorial-tabs,
.api-list {
  max-height: 590px;
  overflow-y: auto;
  padding: 7px;
  border-right: 1px solid var(--rule);
  background: var(--paper-code);
}

.tutorial-tabs button,
.api-list button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.73rem;
  text-align: left;
}

.tutorial-tabs button:hover,
.api-list button:hover {
  color: var(--ink);
}

.tutorial-tabs button.active,
.api-list button.active {
  border-left-color: var(--policy);
  background: var(--paper-bright);
  color: var(--ink);
  font-weight: 630;
}

.code-panel,
.api-detail {
  min-width: 0;
}

.code-toolbar button {
  min-width: 48px;
  min-height: 27px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-bright);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.67rem;
}

.code-toolbar button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.code-panel > pre {
  min-height: 394px;
  padding: 20px;
  background: var(--paper-code);
}

.guide-index {
  border-top: 1px solid var(--ink);
}

.guide-index a {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 57px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.guide-index a:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guide-index span,
.guide-index i {
  color: var(--quiet);
  font-size: 0.68rem;
  font-style: normal;
}

.guide-index strong {
  font-size: 0.84rem;
  font-weight: 620;
}

.api-search {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid var(--rule);
}

.api-list-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--rule);
  background: var(--paper-code);
}

.api-list-pane .api-list {
  flex: 1;
  border-right: 0;
}

.api-list small {
  display: block;
  color: var(--quiet);
  font-size: 0.64rem;
}

.api-list button > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-detail {
  padding: 24px;
}

.api-detail h3 {
  margin: 4px 0 0;
  font: 600 1.25rem "SFMono-Regular", Consolas, monospace;
}

.signature {
  margin: 18px 0;
  padding: 13px;
  border-left: 3px solid var(--policy);
  background: var(--paper-code);
  white-space: pre-wrap;
}

.api-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 18px;
}

.api-meta span {
  padding: 3px 6px;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.65rem;
}

.page-rail {
  padding: 18px 14px;
}

.rail-block {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.rail-block > span {
  display: block;
  margin-bottom: 7px;
  color: var(--quiet);
  font-size: 0.65rem;
  font-weight: 640;
}

.rail-block > a {
  display: block;
  padding: 3px 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-decoration: none;
}

.rail-block > a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.policy-block strong {
  color: var(--policy);
  font: 650 0.82rem "SFMono-Regular", Consolas, monospace;
}

.policy-block p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.runtime-block pre {
  max-height: 220px;
  padding: 11px;
  border: 1px solid var(--rule);
  background: var(--paper-code);
  font-size: 0.68rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.workspace-footer {
  display: grid;
  grid-template-columns: var(--left-rail) minmax(0, 1fr) var(--right-rail);
  min-height: 62px;
  border-top: 1px solid #303530;
  background: var(--ink);
  color: #aeb5ad;
  font-size: 0.68rem;
}

.workspace-footer > span,
.workspace-footer > div {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid #303530;
}

.workspace-footer a {
  color: var(--paper);
}

.footer-links {
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center;
  gap: 1px;
}

.footer-links a {
  color: #aeb5ad;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--paper);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  :root {
    --right-rail: 0px;
  }

  .docs-workspace {
    grid-template-columns: var(--left-rail) minmax(0, 1fr);
  }

  .page-rail {
    display: none;
  }

  .docs-content {
    border-right: 0;
  }

  .workspace-footer {
    grid-template-columns: var(--left-rail) minmax(0, 1fr);
  }

  .footer-links {
    display: none !important;
  }
}

@media (max-width: 820px) {
  :root {
    --left-rail: 0px;
    --header-height: 52px;
  }

  .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-identity {
    border-right: 0;
  }

  .mobile-nav-toggle {
    display: grid;
    place-items: center;
  }

  .publisher-mark span,
  .identity-rule,
  .header-location,
  .search-shortcut > span {
    display: none;
  }

  .search-shortcut {
    min-width: 58px;
    justify-content: center;
    padding: 0 10px;
  }

  kbd {
    margin: 0;
  }

  .docs-workspace {
    display: block;
  }

  .docs-nav {
    position: fixed;
    z-index: 60;
    top: var(--header-height);
    left: 0;
    width: min(86vw, 310px);
    height: calc(100vh - var(--header-height));
    border-right-color: var(--rule-strong);
    box-shadow: 18px 0 36px rgba(17, 19, 17, 0.16);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.nav-open {
    overflow: hidden;
  }

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

  .language-intro,
  .reference-section {
    width: min(100% - 34px, var(--content-max));
  }

  .language-intro {
    padding-top: 30px;
  }

  .breadcrumb {
    margin-bottom: 20px;
  }

  .intro-heading {
    grid-template-columns: 1fr;
    gap: 21px;
  }

  .language-facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .language-facts div {
    min-width: 0;
    padding-inline: 8px;
  }

  .demo-grid,
  .syntax-note {
    grid-template-columns: 1fr;
  }

  .code-surface {
    min-height: 0;
  }

  .response-surface,
  .syntax-note pre {
    border-top: 1px solid var(--rule);
    border-left: 0;
    border-right: 0;
  }

  .reference-heading {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .feature-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .feature-card p {
    grid-column: 2;
  }

  .workspace-footer {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-footer > span:first-child {
    display: none;
  }
}

@media (max-width: 580px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 2.3rem;
  }

  .intro-copy {
    font-size: 0.94rem;
  }

  .demo-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-file {
    align-items: center;
    min-height: 36px;
  }

  .demo-file span:last-child {
    display: none;
  }

  .demo-mode-selector {
    width: 100%;
    min-height: 40px;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .demo-mode-selector button {
    flex: 1;
  }

  .code-surface {
    box-shadow: inset -20px 0 16px -18px rgba(17, 19, 17, 0.22);
  }

  .language-facts {
    grid-template-columns: 1fr;
  }

  .language-facts div {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .language-facts div:last-child {
    border-bottom: 0;
  }

  .policy-contract {
    grid-template-columns: 1fr;
  }

  .policy-contract div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .policy-contract div:last-child {
    border-bottom: 0;
  }

  .feature-card {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .feature-card p {
    grid-column: auto;
  }

  .tutorial-shell,
  .api-layout {
    grid-template-columns: 1fr;
  }

  .api-list-pane {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .tutorial-tabs,
  .api-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding: 5px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .tutorial-tabs button,
  .api-list button {
    flex: 0 0 auto;
    width: auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .tutorial-tabs button.active,
  .api-list button.active {
    border-left: 0;
    border-bottom-color: var(--policy);
  }

  .guide-index a {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 11px 0;
  }

  .guide-index i {
    display: none;
  }

  .workspace-footer {
    display: block;
    padding: 14px 17px;
  }

  .workspace-footer > span {
    padding: 0;
    border: 0;
  }
}

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

  .docs-nav {
    transition: none;
  }
}
