/* mdbase.dev: a quiet technical reference */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Azeret+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: light;

  --color-canvas: oklch(99.5% 0.002 255);
  --color-surface: oklch(99.5% 0.002 255);
  --color-surface-subtle: oklch(97.5% 0.004 255);
  --color-surface-code: oklch(97.5% 0.004 255);
  --color-text: oklch(21% 0.018 255);
  --color-text-soft: oklch(39% 0.016 255);
  --color-text-muted: oklch(54% 0.014 255);
  --color-border: oklch(92% 0.006 255);
  --color-border-strong: oklch(82% 0.008 255);
  --color-accent: oklch(45% 0.105 238);
  --color-accent-strong: oklch(35% 0.09 238);
  --color-success: oklch(43% 0.09 153);
  --color-violet: oklch(44% 0.075 294);
  --color-on-accent: oklch(98% 0.004 255);
  --color-scrim: oklch(21% 0.018 255 / 0.22);
  --paper: var(--color-surface);
  --paper-soft: var(--color-surface-subtle);
  --paper-code: var(--color-surface-code);
  --ink: var(--color-text);
  --ink-soft: var(--color-text-soft);
  --ink-muted: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --accent: var(--color-accent);
  --accent-dark: var(--color-accent-strong);
  --green: var(--color-success);
  --violet: var(--color-violet);

  --sans: 'Atkinson Hyperlegible', 'Segoe UI', sans-serif;
  --mono: 'Azeret Mono', 'SFMono-Regular', 'Cascadia Code', monospace;

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;

  --radius: 3px;
  --measure: 72ch;
  --page: 64rem;
  --sidebar: 17rem;
  --header: 4rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-canvas: oklch(17.5% 0.012 255);
  --color-surface: oklch(19.5% 0.012 255);
  --color-surface-subtle: oklch(23.5% 0.014 255);
  --color-surface-code: oklch(23.5% 0.014 255);
  --color-text: oklch(92% 0.008 255);
  --color-text-soft: oklch(80% 0.01 255);
  --color-text-muted: oklch(68% 0.012 255);
  --color-border: oklch(29% 0.012 255);
  --color-border-strong: oklch(40% 0.014 255);
  --color-accent: oklch(73% 0.105 238);
  --color-accent-strong: oklch(80% 0.085 238);
  --color-success: oklch(75% 0.085 153);
  --color-violet: oklch(76% 0.075 294);
  --color-on-accent: oklch(17% 0.012 255);
  --color-scrim: oklch(5% 0.008 255 / 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --color-canvas: oklch(17.5% 0.012 255);
    --color-surface: oklch(19.5% 0.012 255);
    --color-surface-subtle: oklch(23.5% 0.014 255);
    --color-surface-code: oklch(23.5% 0.014 255);
    --color-text: oklch(92% 0.008 255);
    --color-text-soft: oklch(80% 0.01 255);
    --color-text-muted: oklch(68% 0.012 255);
    --color-border: oklch(29% 0.012 255);
    --color-border-strong: oklch(40% 0.014 255);
    --color-accent: oklch(73% 0.105 238);
    --color-accent-strong: oklch(80% 0.085 238);
    --color-success: oklch(75% 0.085 153);
    --color-violet: oklch(76% 0.075 294);
    --color-on-accent: oklch(17% 0.012 255);
    --color-scrim: oklch(5% 0.008 255 / 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + var(--space-xl));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.04rem;
  line-height: 1.66;
}

.site-page {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
}

.site-page > main {
  flex: 1;
}

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

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  margin: var(--space-2xl) 0 var(--space-lg);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

h2 {
  margin: var(--space-2xl) 0 var(--space-md);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--line);
  font-size: 1.65rem;
}

h3 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: 1.2rem;
}

h4 {
  margin: var(--space-lg) 0 var(--space-xs);
  font-size: 1.05rem;
}

h5,
h6 {
  margin: var(--space-md) 0 var(--space-xs);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

p {
  margin-bottom: var(--space-md);
}

strong {
  font-weight: 700;
}

a {
  color: var(--accent-dark);
  text-decoration-color: color-mix(in oklch, var(--accent) 28%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition:
    color 160ms var(--ease),
    text-decoration-color 160ms var(--ease),
    background-color 160ms var(--ease),
    border-color 160ms var(--ease);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

hr {
  margin: var(--space-xl) 0;
  border: 0;
  border-top: 1px solid var(--line);
}

ul,
ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.3rem;
}

li > ul,
li > ol {
  margin-top: 0.3rem;
}

blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-soft);
}

code {
  padding: 0.08em 0.32em;
  border-radius: var(--radius);
  color: var(--accent-dark);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.84em;
}

pre {
  position: relative;
  overflow-x: auto;
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-code);
  scrollbar-color: var(--line-strong) transparent;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.82rem;
  line-height: 1.62;
}

pre code .comment { color: var(--ink-muted); }
pre code .keyword { color: var(--violet); }
pre code .string { color: var(--green); }
pre code .number { color: var(--accent); }
pre code .key { color: var(--accent-dark); }

pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.45rem;
  right: 0.65rem;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.66rem;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  scrollbar-color: var(--line-strong) transparent;
}

thead {
  border-bottom: 1px solid var(--line-strong);
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
}

td {
  border-bottom: 1px solid var(--line);
}

/* Shared header */

.landing-header,
.spec-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

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

.mdbase-mark {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  overflow: visible;
}

.mdbase-mark-ink {
  fill: currentColor;
}

.mdbase-mark-accent {
  fill: var(--accent);
}

.landing-nav {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 0;
}

.spec-header-actions {
  display: flex;
  height: 100%;
  margin-left: auto;
  align-items: center;
  gap: 0.35rem;
}

.theme-menu {
  position: relative;
  flex: 0 0 auto;
}

.theme-menu > summary {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  list-style: none;
  cursor: pointer;
}

.theme-menu > summary::-webkit-details-marker {
  display: none;
}

.theme-menu > summary:hover,
.theme-menu[open] > summary {
  color: var(--ink);
  background: var(--paper-soft);
}

.theme-menu > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-menu__icon {
  display: block;
  width: 0.875rem;
  height: 0.875rem;
}

.theme-menu__icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}

.theme-menu__icon path {
  fill: currentColor;
}

.theme-menu__options {
  position: absolute;
  z-index: 110;
  top: calc(100% + 0.4rem);
  right: 0;
  display: grid;
  width: 7.5rem;
  padding: 0.3rem;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.theme-menu__options button {
  display: grid;
  width: 100%;
  min-height: 1.9rem;
  padding: 0 0.5rem;
  align-items: center;
  grid-template-columns: 1fr auto;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 2px;
  font: 400 0.66rem/1 var(--mono);
  text-align: left;
  cursor: pointer;
}

.theme-menu__options button::after {
  width: 0.3rem;
  height: 0.3rem;
  content: "";
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.theme-menu__options button:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.theme-menu__options button[aria-pressed="true"] {
  color: var(--ink);
}

.theme-menu__options button[aria-pressed="true"]::after {
  opacity: 1;
}

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

.landing-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
}

.landing-nav a:hover,
.landing-nav .nav-active {
  color: var(--ink);
}

.landing-nav .nav-cta {
  min-height: 2.5rem;
  padding: 0;
  border: 0;
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.25em;
}

.landing-nav .nav-cta:hover {
  background: transparent;
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* Landing page */

.hero {
  padding: calc(var(--header) + 7rem) var(--space-xl) 7rem;
}

.hero-inner {
  width: min(var(--page), 100%);
  margin: 0 auto;
}

.hero-version,
.tag,
.section-kicker {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.hero-version {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.tag {
  padding: 0;
  border: 0;
  color: var(--accent-dark);
}

.hero h1 {
  max-width: 12ch;
  margin: 0 0 var(--space-lg);
  font-size: clamp(3.2rem, 8vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.hero-sub {
  max-width: 40rem;
  margin-bottom: var(--space-xl);
  color: var(--ink-soft);
  font-size: 1.25rem;
  line-height: 1.52;
}

.hero-actions,
.runtime-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 2.75rem;
  padding: 0 var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.btn-primary:hover {
  border-color: var(--ink-muted);
  background: var(--paper);
  color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink-muted);
  background: var(--paper);
  color: var(--accent-dark);
}

.landing-section,
.runtime-section {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
  border-top: 1px solid var(--line);
}

.landing-section {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  column-gap: var(--space-2xl);
}

.landing-section > .section-kicker {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-top: 0.25rem;
}

.landing-section > .section-title,
.landing-section > .section-intro {
  grid-column: 2;
}

.landing-section > :not(.section-kicker):not(.section-title):not(.section-intro) {
  grid-column: 1 / -1;
}

.section-title {
  margin: 0 0 var(--space-md);
  padding: 0;
  border: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
}

.section-intro,
.eco-hero-sub {
  max-width: 44rem;
  margin-bottom: var(--space-xl);
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.58;
}

/* Ecosystem */

.eco-hero {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: calc(var(--header) + 5rem) var(--space-xl) 4rem;
}

.eco-hero .section-title {
  max-width: 12ch;
  font-size: clamp(2.8rem, 7vw, 5rem);
}

.eco-section {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
  border-top: 1px solid var(--line);
}

.eco-section-header {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: baseline;
  margin-bottom: var(--space-xl);
}

.eco-section-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.65rem;
}

.eco-section-header p {
  margin: 0;
  color: var(--ink-soft);
}

.eco-list {
  border-bottom: 1px solid var(--line);
}

.eco-item {
  display: grid;
  grid-template-columns: 7rem 14rem minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: start;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--line);
}

.eco-kind {
  padding-top: 0.15rem;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.eco-name {
  margin: 0;
  font-size: 1.08rem;
}

.eco-description {
  margin: 0;
  color: var(--ink-soft);
}

.eco-link {
  padding-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Specification reader */

.spec-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.spec-version {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  white-space: nowrap;
}

.spec-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--header);
}

.spec-sidebar {
  position: fixed;
  inset: var(--header) auto 0 0;
  z-index: 50;
  width: var(--sidebar);
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
  border-right: 1px solid var(--line);
  background: var(--paper-soft);
  scrollbar-color: var(--line-strong) transparent;
}

.sidebar-group {
  margin-bottom: var(--space-lg);
}

.sidebar-group-label {
  margin-bottom: var(--space-sm);
  padding: 0 var(--space-sm);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.sidebar-link {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: baseline;
  min-height: 2.2rem;
  padding: 0.42rem var(--space-sm);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.35;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--ink);
  background: transparent;
}

.sidebar-link.active {
  color: var(--accent-dark);
  background: transparent;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
}

.sidebar-link .num {
  color: var(--ink-muted);
  font-size: 0.64rem;
}

.spec-mobile-links {
  display: none;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}

.spec-mobile-links a {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 var(--space-sm);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.spec-content {
  grid-column: 2;
  width: min(calc(var(--measure) + 6rem), 100%);
  min-width: 0;
  justify-self: center;
  padding: var(--space-2xl) var(--space-2xl) 7rem;
}

.spec-section {
  margin-bottom: 7rem;
}

.spec-section > h1:first-child {
  margin: 0 0 var(--space-2xl);
  padding: 0;
  border: 0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.035em;
}

.spec-section h1[id],
.spec-section h2[id],
.spec-section h3[id] {
  scroll-margin-top: calc(var(--header) + var(--space-xl));
}

.anchor {
  position: absolute;
  margin-left: -1.1em;
  color: var(--line-strong);
  font-family: var(--mono);
  font-size: 0.75em;
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}

.spec-section h1,
.spec-section h2,
.spec-section h3 {
  position: relative;
}

.spec-section h1:hover .anchor,
.spec-section h2:hover .anchor,
.spec-section h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.sidebar-toggle {
  display: none;
  min-height: 2.25rem;
  padding: 0 var(--space-sm);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  cursor: pointer;
}

.sidebar-scrim {
  display: none;
}

/* Runtime */

.runtime-hero {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: calc(var(--header) + 6rem) var(--space-xl) 6rem;
}

.runtime-hero-copy {
  width: min(44rem, 100%);
}

.runtime-hero-copy h1 {
  max-width: 12ch;
  margin: var(--space-md) 0 var(--space-lg);
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.runtime-hero-copy p {
  max-width: 40rem;
  color: var(--ink-soft);
  font-size: 1.16rem;
  line-height: 1.55;
}

.runtime-hero-actions {
  margin-top: var(--space-xl);
}

.runtime-section > .section-kicker {
  margin-bottom: var(--space-md);
}

.runtime-flow {
  margin-top: var(--space-2xl);
  padding: 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.runtime-flow li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--space-lg);
  margin: 0;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--line);
}

.runtime-flow li > span {
  padding-top: 0.2rem;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.runtime-flow h3 {
  margin: 0 0 var(--space-xs);
}

.runtime-flow p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.runtime-example {
  display: grid;
  grid-template-columns: minmax(20rem, 1.15fr) minmax(15rem, 0.85fr);
  gap: var(--space-2xl);
  align-items: start;
  margin-top: var(--space-2xl);
}

.runtime-example pre {
  margin: 0;
}

.runtime-example-copy {
  padding-top: var(--space-xs);
}

.runtime-example-copy p {
  margin: 0 0 var(--space-lg);
  color: var(--ink-soft);
}

.runtime-source-link {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
}

/* Legal pages */

.legal-page {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: calc(var(--header) + 5rem) var(--space-xl) 7rem;
}

.legal-page-header {
  max-width: var(--measure);
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--line);
}

.legal-page-header h1 {
  max-width: 14ch;
  margin: var(--space-md) 0 var(--space-lg);
  font-size: clamp(2.8rem, 7vw, 5rem);
  letter-spacing: -0.04em;
}

.legal-page-summary {
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1.58;
}

.legal-page-date {
  margin: var(--space-lg) 0 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.legal-content {
  max-width: var(--measure);
}

.legal-content > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-content h2,
.legal-content h3 {
  scroll-margin-top: calc(var(--header) + var(--space-xl));
}

.legal-content .anchor {
  display: none;
}

/* Footer */

.landing-footer {
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--line);
}

.landing-footer p {
  width: min(var(--page), 100%);
  margin: 0 auto;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-align: left;
}

.landing-footer a {
  color: var(--ink-soft);
}

/* Responsive */

@media (max-width: 64rem) {
  .spec-layout {
    display: block;
  }

  .spec-sidebar {
    inset: var(--header) auto 0 0;
    width: min(20rem, calc(100vw - 3rem));
    border-right: 1px solid var(--line-strong);
    transform: translateX(-105%);
    transition: transform 220ms var(--ease);
  }

  .spec-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
  }

  .sidebar-scrim {
    position: fixed;
    inset: var(--header) 0 0;
    z-index: 40;
    display: block;
    width: 100%;
    border: 0;
    background: var(--color-scrim);
  }

  .sidebar-scrim[hidden] {
    display: none;
  }

  .spec-mobile-links {
    display: block;
  }

  .spec-content {
    width: min(calc(var(--measure) + 4rem), 100%);
    padding: var(--space-2xl) var(--space-xl) 6rem;
  }

  .spec-header .landing-nav {
    display: none;
  }

  .spec-header-actions {
    gap: var(--space-sm);
  }

}

@media (max-width: 46rem) {
  .landing-header,
  .spec-header {
    padding: 0 var(--space-md);
  }

  .landing-nav {
    gap: var(--space-sm);
  }

  .landing-nav .hide-mobile {
    display: none;
  }

  .hero,
  .runtime-hero {
    padding: calc(var(--header) + 4.5rem) var(--space-lg) 5rem;
  }

  .hero h1,
  .runtime-hero-copy h1 {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .landing-section,
  .runtime-section {
    padding: var(--space-3xl) var(--space-lg);
  }

  .landing-section {
    grid-template-columns: 1fr;
  }

  .landing-section > .section-kicker,
  .landing-section > .section-title,
  .landing-section > .section-intro,
  .landing-section > :not(.section-kicker):not(.section-title):not(.section-intro) {
    grid-column: 1;
  }

  .landing-section > .section-kicker {
    grid-row: auto;
    margin-bottom: var(--space-md);
  }

  .runtime-example {
    grid-template-columns: 1fr;
  }

  .eco-hero {
    padding: calc(var(--header) + 4rem) var(--space-lg) 4rem;
  }

  .eco-section {
    padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
  }

  .legal-page {
    padding: calc(var(--header) + 4rem) var(--space-lg) 5rem;
  }

  .legal-page-header {
    margin-bottom: var(--space-2xl);
  }

  .eco-section-header {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .eco-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-xs) var(--space-md);
    padding: 1.25rem 0;
  }

  .eco-item .eco-kind {
    grid-column: 1 / -1;
  }

  .eco-item .eco-name {
    grid-column: 1;
  }

  .eco-item .eco-description {
    grid-column: 1 / -1;
  }

  .eco-item .eco-link {
    grid-column: 2;
    grid-row: 2;
  }

  .spec-content {
    padding: var(--space-xl) var(--space-lg) 5rem;
  }

  .spec-section {
    margin-bottom: 5rem;
  }

  .anchor {
    display: none;
  }
}

@media (max-width: 36rem) {
  .landing-header .landing-nav a:not(.nav-cta) {
    display: none;
  }

  .landing-nav {
    gap: var(--space-xs);
  }

  .spec-version {
    display: none;
  }

  .hero-actions,
  .runtime-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

}

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

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

@media print {
  body {
    color: oklch(20% 0.01 255);
    background: oklch(98% 0.004 88);
  }

  .landing-header,
  .spec-header,
  .spec-sidebar,
  .sidebar-toggle,
  .sidebar-scrim {
    display: none;
  }

  .spec-layout {
    display: block;
    padding: 0;
  }

  .spec-content {
    width: auto;
    padding: 0;
  }

  a {
    color: inherit;
  }
}
