/* self-hosted variable fonts — no CDN requests, ever */
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-vf.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-vf.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-vf.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --color-bg: #090c0d;
  --color-surface: #0f1416;
  --color-surface-raised: #1b2426;
  --color-surface-sunken: #070a0b;
  --color-text: #edf3f0;
  --color-text-muted: #a8b4ae;
  --color-text-subtle: #7f8d86;
  --color-border: #56675f;
  /* diagram objects sit on the lighter raised fill, so they need a lighter
     border than --color-border to clear 3:1 on the inside face */
  --color-border-strong: #647870;
  /* terminal chrome only — deliberately quieter than a real boundary */
  --color-frame: #2f3b36;
  --color-divider: #202a28;
  --color-focus: #b9ead3;
  --color-action: #8bd5b3;
  --color-action-hover: #a5e3c6;
  --color-action-pressed: #73bd9d;
  --color-on-action: #07120d;
  --color-warning: #e0bc78;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --type-code: "JetBrains Mono", ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --shell: 73.75rem;
  --prose: 45rem;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-action);
  color: var(--color-on-action);
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-bg);
  box-shadow: 0 0 0 4px var(--color-focus);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(-160%);
  border: 1px solid var(--color-action);
  border-radius: 4px;
  background: var(--color-action);
  color: var(--color-on-action);
  font-weight: 700;
  text-decoration: none;
}

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

.shell {
  width: min(100% - 48px, var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
}

.nav-shell {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  align-items: center;
  border-radius: 4px;
}

.brand img {
  width: 220px;
  height: 40px;
}

.nav-links {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 28px;
}

.nav-links a,
.text-link,
.site-footer a {
  min-height: 32px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}

.nav-links a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
}

.nav-links a:hover,
.text-link:hover,
.site-footer a:hover {
  color: var(--color-text);
  text-decoration-color: var(--color-action);
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 19px;
  border: 1px solid var(--color-action);
  border-radius: 4px;
  background: var(--color-action);
  color: var(--color-on-action);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.button:hover {
  border-color: var(--color-action-hover);
  background: var(--color-action-hover);
  transform: translateY(-1px);
}

.button:active {
  border-color: var(--color-action-pressed);
  background: var(--color-action-pressed);
  transform: translateY(0);
}

.button-small {
  min-height: 44px;
  padding: 9px 14px;
  font-size: 0.84rem;
}

.hero {
  padding: 112px 0 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  align-items: center;
  gap: clamp(56px, 8vw, 112px);
}

.release-label,
.section-kicker {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-family: var(--type-code);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.release-label span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--color-warning);
  background: transparent;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

h1 {
  max-width: 12ch;
  margin-bottom: 28px;
  font-size: clamp(2.75rem, 5.4vw, 4rem);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 3.7vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.hero-lead {
  max-width: 43rem;
  margin-bottom: 10px;
  color: var(--color-text);
  font-size: 1.14rem;
}

.hero-detail {
  max-width: 42rem;
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* the two scope corrections: loopback-only, one provider */
.hero-detail-quiet {
  margin-top: 14px;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.84rem;
}

.hero-actions {
  display: flex;
  margin-top: 34px;
  align-items: center;
  gap: 22px;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
}

.release-warning {
  margin: 16px 0 0;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.78rem;
  line-height: 1.55;
}

.release-warning strong {
  color: var(--color-warning);
  font-weight: 650;
}

.hero-trace {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-sunken);
  font-family: var(--type-code);
}

.trace-bar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-subtle);
  font-size: 0.72rem;
}

.trace-bar::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border: 1px solid var(--color-text-subtle);
  content: "";
}

.trace-title {
  margin-right: auto;
}

.trace-state {
  color: var(--color-action);
}

.trace-body {
  display: grid;
  gap: 13px;
  padding: 25px 22px 27px;
  font-size: 0.78rem;
}

.trace-line {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 12px;
}

.trace-key {
  color: var(--color-text-subtle);
}

.trace-key::before {
  color: var(--color-action);
  content: "> ";
}

.trace-value {
  overflow-wrap: anywhere;
  color: var(--color-text-muted);
}

.trace-value.accent {
  color: var(--color-action);
}

.trace-value.safe {
  color: var(--color-text);
}

.trace-rule {
  height: 1px;
  margin: 5px 0;
  background: var(--color-divider);
}

.how,
.boundary,
.status,
.faq,
.final-cta {
  border-top: 1px solid var(--color-divider);
}

.how {
  padding: 96px 0 104px;
}

.section-intro {
  max-width: var(--prose);
}

.section-intro > p:last-child {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 1.03rem;
}

.flow-figure {
  margin: 48px 0 0;
}

.flow {
  width: 100%;
  height: auto;
  color: var(--color-text);
  font-family: var(--type-code);
}

/* the wide trace is never scaled down — below its natural width the stacked
   version takes over, so 12px labels always render at 12px */
.flow-wide {
  max-width: 1120px;
}

.flow-compact {
  display: none;
}

.flow-frame {
  fill: var(--color-surface-sunken);
  stroke: var(--color-frame);
  stroke-width: 2;
}

.flow-box {
  fill: var(--color-surface-raised);
  stroke: var(--color-border-strong);
  stroke-width: 2;
}

.flow-box-active {
  fill: var(--color-surface-raised);
  stroke: var(--color-action);
}

.flow-divider {
  fill: none;
  stroke: var(--color-frame);
  stroke-width: 2;
}

.flow-dot {
  fill: none;
  stroke: var(--color-text-subtle);
  stroke-width: 1.5;
}

.flow-window,
.flow-number,
.flow-arrow-label {
  fill: var(--color-text-subtle);
  font-size: 12px;
}

.flow-number {
  fill: var(--color-action);
  font-weight: 700;
}

.flow-label {
  fill: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.flow-copy {
  fill: var(--color-text-muted);
  font-size: 12px;
}

.flow-code {
  fill: var(--color-action);
  font-size: 12px;
}

.flow-arrow {
  fill: none;
  stroke: var(--color-action);
  stroke-width: 2;
}

.flow-figure figcaption {
  max-width: 58rem;
  margin: 15px 0 0;
  color: var(--color-text-subtle);
  font-size: 0.82rem;
}

.steps {
  display: grid;
  margin: 58px 0 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 22px;
  padding: 27px 0 30px;
  border-bottom: 1px solid var(--color-border);
}

.step-number {
  color: var(--color-action);
  font-family: var(--type-code);
  font-size: 0.78rem;
}

.steps h3 {
  max-width: 40rem;
}

.steps p {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 0.96rem;
}

.steps-note {
  max-width: 48rem;
  margin: 24px 0 0;
  color: var(--color-text-subtle);
  font-size: 0.9rem;
}

.pin-block {
  margin: 56px 0 0;
  padding: 32px 32px 28px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.pin-block h3 {
  margin: 0 0 4px;
}

.pin-list {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  margin: 0;
  column-gap: 24px;
}

.pin-list dt {
  padding: 11px 0;
  border-top: 1px solid var(--color-divider);
  color: var(--color-action);
  font-family: var(--type-code);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.pin-list dd {
  margin: 0;
  padding: 11px 0;
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  font-size: 0.94rem;
}

.pin-list dt:first-of-type,
.pin-list dt:first-of-type + dd {
  border-top: 0;
}

.pin-note {
  max-width: 48rem;
  margin: 22px 0 0;
  color: var(--color-text-subtle);
  font-size: 0.88rem;
}

.boundary,
.status,
.faq {
  padding: 96px 0;
}

.boundary-grid,
.status-grid,
.faq-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(56px, 9vw, 120px);
  align-items: start;
}

.boundary-intro h2 {
  max-width: 12ch;
}

.boundary-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
}

.boundary-table section {
  padding: 27px 25px 29px;
}

.boundary-table section + section {
  border-left: 1px solid var(--color-border);
}

.boundary-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.boundary-heading h3 {
  margin-bottom: 0;
}

.boundary-symbol {
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.85rem;
}

.boundary-symbol-lock {
  color: var(--color-action);
}

.boundary-table ul {
  display: grid;
  gap: 12px;
  margin: 23px 0 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  list-style: none;
}

.boundary-table li {
  position: relative;
  padding-left: 18px;
}

.boundary-table li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-action);
  content: "—";
}

.status {
  background: var(--color-surface-sunken);
}

.status-list {
  margin: 0;
}

.status-list > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0 22px;
  border-top: 1px solid var(--color-border);
}

.status-list > div:last-child {
  border-bottom: 1px solid var(--color-border);
}

.status-list dt {
  color: var(--color-text);
  font-family: var(--type-code);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-list dd {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.faq-list details {
  border-top: 1px solid var(--color-border);
}

.faq-list details:last-child {
  border-bottom: 1px solid var(--color-border);
}

.faq-group {
  margin: 44px 0 0;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-group:first-child {
  margin-top: 0;
}

.faq-list summary {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 0;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  flex: 0 0 auto;
  color: var(--color-action);
  font-family: var(--type-code);
  content: "+";
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  max-width: 49rem;
  margin: 0;
  padding: 2px 32px 23px 0;
  color: var(--color-text-muted);
  font-size: 0.94rem;
}

code {
  color: var(--color-action);
  font-family: var(--type-code);
  font-size: 0.9em;
}

.final-cta {
  padding: 80px 0;
}

.cta-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 56px;
  padding: 46px 48px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.cta-panel h2 {
  max-width: 18ch;
  margin-bottom: 14px;
}

.cta-panel > div > p:not(.section-kicker, .release-warning) {
  max-width: 42rem;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

[aria-current="page"] {
  color: var(--color-text);
  text-decoration-color: var(--color-action);
}

.legal-main {
  padding: 88px 0 104px;
}

.legal-shell {
  max-width: 50rem;
}

.legal-hero {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--color-border);
}

.legal-hero h1 {
  max-width: 15ch;
}

.legal-lead {
  max-width: 43rem;
  margin-bottom: 18px;
  color: var(--color-text-muted);
  font-size: 1.12rem;
}

.legal-date {
  margin: 0;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.82rem;
}

.legal-copy section {
  padding: 34px 0 37px;
  border-bottom: 1px solid var(--color-border);
}

.legal-copy h2 {
  margin-bottom: 14px;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.legal-copy p {
  max-width: 45rem;
  margin-bottom: 14px;
  color: var(--color-text-muted);
  font-size: 1rem;
}

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

.legal-copy a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-text);
  text-decoration-color: var(--color-action);
  text-underline-offset: 4px;
}

.legal-copy strong {
  color: var(--color-text);
}

.legal-launch-note {
  font-family: var(--type-code);
  line-height: 1.7;
}

/* ---- documentation ------------------------------------------------------ */

.docs-main {
  padding: 56px 0 88px;
}

.docs-shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}

.docs-rail {
  position: sticky;
  top: 96px;
}

.docs-rail p {
  margin: 0 0 12px;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-rail ol {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-divider);
  list-style: none;
}

.docs-rail a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.docs-rail a:hover {
  color: var(--color-text);
}

.docs-rail a[aria-current="page"] {
  color: var(--color-action);
}

.docs-body {
  max-width: 50rem;
  min-width: 0;
}

.docs-body h1 {
  max-width: 20ch;
  font-size: clamp(2.1rem, 3.8vw, 2.9rem);
}

.docs-lead {
  max-width: var(--prose);
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.docs-body h2 {
  margin-top: 56px;
  font-size: clamp(1.4rem, 2.3vw, 1.75rem);
}

.docs-body h3 {
  margin-top: 32px;
  font-size: 1.02rem;
}

.docs-body p,
.docs-body li {
  color: var(--color-text-muted);
}

.docs-body > ul,
.docs-body > ol {
  max-width: var(--prose);
  padding-left: 20px;
}

.docs-body li {
  margin-bottom: 7px;
}

/* the id lives on the heading, so the link is the affordance, not the target */
.anchor {
  margin-left: 10px;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.78em;
  text-decoration: none;
  opacity: 0;
}

.docs-body h2:hover .anchor,
.docs-body h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.docs-banner {
  margin: 0 0 40px;
  padding: 14px 18px;
  border: 1px solid var(--color-warning);
  border-radius: 4px;
  color: var(--color-warning);
  font-family: var(--type-code);
  font-size: 0.82rem;
  line-height: 1.65;
}

.code-figure {
  margin: 22px 0 26px;
}

.code-figure pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface-sunken);
  color: var(--color-text);
  font-family: var(--type-code);
  font-size: 0.82rem;
  line-height: 1.8;
  tab-size: 2;
}

.code-figure code {
  color: inherit;
  font-size: inherit;
}

/* select-friendly: the marker is generated, so copying a line never picks
   up the "$" — no clipboard JS needed, and the gate forbids <button> */
.code-figure .cmd::before {
  content: "$ ";
  color: var(--color-text-subtle);
  user-select: none;
}

.code-figure .out {
  color: var(--color-text-subtle);
}

.code-figure .cm {
  color: var(--color-text-subtle);
  font-style: italic;
}

.code-figure figcaption {
  margin-top: 9px;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
}

.callout {
  margin: 26px 0;
  padding: 17px 20px 18px;
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: 4px;
}

.callout p {
  margin: 0;
  font-size: 0.94rem;
}

.callout p + p {
  margin-top: 9px;
}

.callout strong {
  color: var(--color-text);
}

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

.callout-warn strong {
  color: var(--color-warning);
}

.callout-danger {
  border-color: var(--color-warning);
  border-left-width: 3px;
  background: rgba(224, 188, 120, 0.06);
}

.callout-danger strong {
  color: var(--color-warning);
}

.spec-table {
  width: 100%;
  margin: 20px 0 26px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.spec-table caption {
  margin-bottom: 10px;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  text-align: left;
}

.spec-table th,
.spec-table td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--color-divider);
  text-align: left;
  vertical-align: top;
}

.spec-table thead th {
  border-bottom-color: var(--color-border);
  color: var(--color-text);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spec-table tbody th {
  color: var(--color-action);
  font-family: var(--type-code);
  font-size: 0.82rem;
  font-weight: 400;
  white-space: nowrap;
}

.spec-table td {
  color: var(--color-text-muted);
}

.table-scroll {
  overflow-x: auto;
}

.docs-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--color-divider);
}

.docs-pager a {
  color: var(--color-action);
  font-size: 0.94rem;
  text-decoration: none;
}

.docs-pager a:hover {
  text-decoration: underline;
}

.docs-pager span {
  display: block;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-pager .next {
  margin-left: auto;
  text-align: right;
}

.site-footer {
  padding: 28px 0 34px;
  border-top: 1px solid var(--color-divider);
}

.footer-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
  color: var(--color-text-subtle);
  font-family: var(--type-code);
  font-size: 0.75rem;
}

.site-footer a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  font-size: inherit;
}

/* 1168 = the wide viewBox (1120) + the shell gutter (48). Below this the wide
   trace would have to scale down, so swap to the stacked one instead. */
@media (max-width: 1167.98px) {
  .flow-wide {
    display: none;
  }

  .flow-compact {
    display: block;
    width: min(100%, 30rem);
    margin-inline: auto;
  }
}

@media (max-width: 920px) {
  .site-header {
    position: static;
  }

  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  /* the rail becomes a plain index at the top of the page; sticky is useless
     once the header stops sticking */
  .docs-rail {
    position: static;
  }

  .docs-rail ol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0 28px;
  }

  .docs-main {
    padding: 40px 0 72px;
  }

  .anchor {
    display: none;
  }

  .nav-shell {
    flex-wrap: wrap;
    gap: 0 16px;
    padding-block: 8px;
  }

  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 12px;
  }

  .nav-links a {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .nav-shell .button {
    margin-left: auto;
  }

  .hero-grid,
  .boundary-grid,
  .status-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 64px 0 76px;
  }

  .hero-trace {
    max-width: 42rem;
  }

  .boundary-grid,
  .status-grid,
  .faq-grid {
    gap: 42px;
  }

  .boundary-intro h2 {
    max-width: 16ch;
  }

  h1 {
    max-width: 16ch;
  }

  .release-warning,
  .flow-figure figcaption,
  .steps p,
  .boundary-table ul,
  .status-list dd,
  .faq-list summary,
  .faq-list details p {
    font-size: 1rem;
  }

  .legal-main {
    padding: 64px 0 80px;
  }

  .legal-hero h1 {
    max-width: 17ch;
  }
}

@media (max-width: 660px) {
  .shell {
    width: min(100% - 32px, var(--shell));
  }

  .pin-block {
    padding: 24px 20px 20px;
  }

  .pin-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .pin-list dd {
    padding-top: 0;
    border-top: 0;
  }

  .pin-list dt {
    padding-bottom: 2px;
  }

  .nav-shell {
    min-height: 66px;
    gap: 10px;
  }

  .brand img {
    width: 174px;
    height: auto;
  }

  .button-small {
    min-height: 44px;
    padding: 9px 11px;
    font-size: 0.76rem;
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero-grid {
    gap: 36px;
  }

  h1 {
    max-width: none;
    margin-bottom: 22px;
    font-size: clamp(2.25rem, 9.8vw, 2.55rem);
  }

  .hero-actions {
    flex-wrap: wrap;
    margin-top: 26px;
    gap: 10px 18px;
  }

  .trace-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .how,
  .boundary,
  .status,
  .faq {
    padding: 72px 0;
  }

  .trace-body {
    gap: 11px;
    padding: 21px 18px 23px;
    font-size: 0.875rem;
  }

  .steps li {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .boundary-table {
    grid-template-columns: 1fr;
  }

  .boundary-table section + section {
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }

  .status-list > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .final-cta {
    padding: 56px 0;
  }

  .cta-panel {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 31px 24px 26px;
  }

  .cta-panel .button {
    width: 100%;
  }

  .legal-main {
    padding: 48px 0 64px;
  }

  .legal-hero {
    padding-bottom: 36px;
  }

  .legal-hero h1 {
    max-width: none;
  }

  .legal-lead {
    font-size: 1rem;
  }

  .legal-date {
    font-size: 0.875rem;
  }

  .legal-copy section {
    padding: 28px 0 31px;
  }

  .footer-shell > [aria-hidden="true"] {
    display: none;
  }
}

@media (max-width: 380px) {
  .brand img {
    width: 158px;
  }

  .button-small {
    padding-inline: 9px;
    font-size: 0.72rem;
  }
}

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

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