:root {
	--ground: #f1f4f0;
	--paper: #fafbf8;
	--ink: #17221e;
	--muted: #65716c;
	--faint: #8b9691;
	--rule: #cad2cd;
	--soft-rule: #e1e6e2;
	--moss: #286247;
	--moss-soft: #dce9e1;
	--oxide: #9a4b32;
	--code: #e7ece8;
	--shadow: rgb(23 34 30 / 8%);
	color-scheme: light;
	font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ground: #111714;
		--paper: #171e1a;
		--ink: #e5ebe7;
		--muted: #9ba7a1;
		--faint: #75817b;
		--rule: #35413b;
		--soft-rule: #27312c;
		--moss: #80c49b;
		--moss-soft: #20382b;
		--oxide: #e08a69;
		--code: #202a25;
		--shadow: rgb(0 0 0 / 24%);
		color-scheme: dark;
	}
}

* {
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
}
body {
	margin: 0;
	background:
		linear-gradient(
			90deg,
			transparent 0 3.5rem,
			var(--soft-rule) 3.5rem calc(3.5rem + 1px),
			transparent calc(3.5rem + 1px)
		),
		var(--ground);
	color: var(--ink);
	font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

a {
	color: inherit;
}
a:focus-visible {
	outline: 2px solid var(--oxide);
	outline-offset: 4px;
	border-radius: 2px;
}
.skip-link {
	position: fixed;
	z-index: 20;
	top: 0.75rem;
	left: 0.75rem;
	padding: 0.55rem 0.8rem;
	background: var(--ink);
	color: var(--paper);
	transform: translateY(-180%);
}
.skip-link:focus {
	transform: translateY(0);
}
.progress {
	position: fixed;
	z-index: 10;
	inset: 0 auto auto 3.5rem;
	width: 2px;
	height: 100vh;
	pointer-events: none;
}
.progress::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background: var(--oxide);
	transform: scaleY(var(--progress, 0));
	transform-origin: top;
}
.layout {
	display: grid;
	grid-template-columns: 14rem minmax(0, 52rem);
	gap: clamp(2.5rem, 6vw, 6rem);
	width: min(100% - 4rem, 78rem);
	margin: 0 auto;
	padding: 4rem 0 7rem;
}
.rail {
	position: sticky;
	top: 2rem;
	align-self: start;
	max-height: calc(100vh - 4rem);
	overflow: auto;
	scrollbar-width: thin;
}
.rail-label,
.eyebrow,
.meta,
.section-number,
.reference-key {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.rail-label {
	margin: 0 0 0.8rem;
	color: var(--faint);
	font-size: 0.67rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.rail ol {
	margin: 0;
	padding: 0 0 0 1rem;
	border-left: 1px solid var(--rule);
	list-style: none;
}
.rail li {
	margin: 0;
}
.rail a {
	position: relative;
	display: grid;
	grid-template-columns: 1.8rem 1fr;
	gap: 0.35rem;
	padding: 0.28rem 0;
	color: var(--muted);
	font-size: 0.76rem;
	line-height: 1.25;
	text-decoration: none;
	transition: color 140ms ease;
}
.rail a::before {
	content: "";
	position: absolute;
	top: 0.65rem;
	left: calc(-1rem - 4px);
	width: 7px;
	height: 7px;
	border: 1px solid var(--ground);
	border-radius: 50%;
	background: transparent;
	transform: scale(0.5);
	transition: background 140ms ease, transform 140ms ease;
}
.rail a span {
	color: var(--faint);
}
.rail a:hover,
.rail a[aria-current="true"] {
	color: var(--ink);
}
.rail a[aria-current="true"]::before {
	background: var(--oxide);
	transform: scale(1);
}
.document {
	min-width: 0;
}
.hero {
	position: relative;
	padding: clamp(2rem, 5vw, 4rem);
	overflow: hidden;
	border: 1px solid var(--rule);
	background: var(--paper);
	box-shadow: 0 1.2rem 3rem var(--shadow);
}
.hero::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 5rem;
	height: 5rem;
	background: linear-gradient(135deg, transparent 49.5%, var(--oxide) 50%);
	opacity: 0.9;
}
.eyebrow {
	margin: 0 0 1.15rem;
	color: var(--moss);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
h1 {
	max-width: 12ch;
	margin: 0;
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: clamp(2.35rem, 7vw, 5.25rem);
	font-weight: 500;
	letter-spacing: -0.075em;
	line-height: 0.93;
	overflow-wrap: anywhere;
}
.dek {
	max-width: 36rem;
	margin: 1.7rem 0 2rem;
	color: var(--muted);
	font-size: clamp(1.05rem, 2vw, 1.3rem);
	line-height: 1.45;
}
.meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1.25rem;
	align-items: center;
	color: var(--muted);
	font-size: 0.74rem;
}
.authorship {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.8rem 2rem;
	margin: 1.35rem 0 0;
	padding: 1.15rem 0 0;
	border-top: 1px solid var(--soft-rule);
}
.authorship > div {
	min-width: 0;
}
.authorship dt {
	margin-bottom: 0.15rem;
	color: var(--faint);
	font-size: 0.64rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.authorship dd {
	color: var(--ink);
	font-size: 0.84rem;
	overflow-wrap: anywhere;
}
.authorship a {
	text-underline-offset: 0.18em;
}
.status {
	padding: 0.18rem 0.45rem;
	border: 1px solid var(--moss);
	color: var(--moss);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.source-link {
	color: var(--ink);
	text-underline-offset: 0.2em;
}
.mobile-toc {
	display: none;
}
article {
	padding: 1rem clamp(0rem, 3vw, 2rem) 0;
}
.rfc-section {
	padding: 2.7rem 0 0.35rem;
	border-top: 1px solid var(--rule);
	scroll-margin-top: 1rem;
}
.rfc-section:first-child {
	border-top: 0;
}
.rfc-section.abstract {
	margin: 2rem 0 1rem;
	padding: 2rem;
	border: 0;
	background: var(--moss-soft);
}
h2,
h3 {
	margin: 0;
	font-weight: 600;
	line-height: 1.2;
	text-wrap: balance;
}
h2 {
	font-size: clamp(1.45rem, 3vw, 2rem);
}
h3 {
	margin-top: 2rem;
	font-size: 1.05rem;
}
h2 a,
h3 a {
	display: grid;
	grid-template-columns: 2.8rem minmax(0, 1fr);
	gap: 0.6rem;
	align-items: baseline;
	text-decoration: none;
}
h3 a {
	grid-template-columns: 3.4rem minmax(0, 1fr);
}
.section-number {
	color: var(--oxide);
	font-size: 0.65em;
	font-weight: 500;
	letter-spacing: 0;
}
article p {
	margin: 1rem 0;
}
article ol,
article ul {
	margin: 1rem 0 1.25rem;
	padding-left: 1.35rem;
}
article li {
	margin: 0.5rem 0;
	padding-left: 0.25rem;
}
article li::marker {
	color: var(--oxide);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82em;
	font-weight: 600;
}
.spec-list {
	columns: 2 15rem;
	gap: 2rem;
	padding: 1.1rem 1.2rem 1.1rem 2.5rem;
	border: 1px solid var(--soft-rule);
	background: var(--paper);
}
.spec-list li {
	break-inside: avoid;
}
code,
pre,
.normative {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
}
code {
	padding: 0.08em 0.28em;
	border-radius: 2px;
	background: var(--code);
	font-size: 0.86em;
}
pre {
	margin: 1.25rem 0;
	padding: 1rem 1.2rem;
	overflow-x: auto;
	border-left: 3px solid var(--moss);
	background: var(--code);
	font-size: 0.79rem;
	line-height: 1.55;
	tab-size: 4;
}
pre code {
	padding: 0;
	background: transparent;
	font-size: inherit;
}
.normative {
	color: var(--moss);
	font-size: 0.88em;
	font-weight: 600;
	letter-spacing: 0.015em;
}
.definitions {
	display: grid;
	gap: 0;
	margin: 1.2rem 0;
	border-top: 1px solid var(--soft-rule);
}
.definitions > div {
	display: grid;
	grid-template-columns: minmax(8rem, 0.34fr) 1fr;
	gap: 1.25rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--soft-rule);
}
dt {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82rem;
	font-weight: 600;
}
dd {
	margin: 0;
	color: var(--muted);
}
.citation {
	color: var(--moss);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.8em;
	font-weight: 600;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
.section-reference {
	color: inherit;
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.86em;
	font-weight: 500;
	text-decoration-color: var(--oxide);
	text-underline-offset: 0.18em;
}
.reference {
	display: grid;
	grid-template-columns: 8rem minmax(0, 1fr);
	gap: 1rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--soft-rule);
	scroll-margin-top: 1rem;
}
.reference:target {
	margin-inline: -0.8rem;
	padding-inline: 0.8rem;
	background: var(--moss-soft);
}
.reference-key {
	color: var(--oxide);
	font-size: 0.75rem;
	font-weight: 600;
}
.reference p {
	margin: 0;
}
.url {
	overflow-wrap: anywhere;
	text-underline-offset: 0.18em;
}
.document-footer {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 4rem;
	padding: 1.2rem 0;
	border-top: 1px solid var(--rule);
	color: var(--muted);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.72rem;
}

@media (max-width: 900px) {
	body {
		background: var(--ground);
	}
	.progress {
		left: 0;
	}
	.layout {
		display: block;
		width: min(100% - 2rem, 54rem);
		padding-top: 1rem;
	}
	.rail {
		display: none;
	}
	.mobile-toc {
		display: block;
		margin: 1rem 0 0;
		border: 1px solid var(--rule);
		background: var(--paper);
	}
	.mobile-toc summary {
		padding: 0.75rem 1rem;
		cursor: pointer;
		font-family: "IBM Plex Mono", ui-monospace, monospace;
		font-size: 0.78rem;
		font-weight: 600;
	}
	.mobile-toc ol {
		columns: 2 12rem;
		margin: 0;
		padding: 0 1rem 1rem 2.5rem;
	}
	.mobile-toc li {
		break-inside: avoid;
		margin: 0.25rem 0;
	}
	.mobile-toc a {
		font-size: 0.82rem;
	}
	article {
		padding-inline: 0;
	}
}

@media (max-width: 560px) {
	.layout {
		width: min(100% - 1.25rem, 54rem);
	}
	.hero {
		padding: 1.5rem;
	}
	.hero::after {
		width: 3rem;
		height: 3rem;
	}
	h1 {
		font-size: clamp(2rem, 13vw, 3.25rem);
	}
	.rfc-section.abstract {
		margin-top: 1rem;
		padding: 1.25rem;
	}
	h2 a,
	h3 a {
		display: block;
	}
	.section-number {
		display: block;
		margin-bottom: 0.3rem;
	}
	.definitions > div,
	.reference {
		grid-template-columns: 1fr;
		gap: 0.35rem;
	}
	.authorship {
		grid-template-columns: 1fr;
	}
	.spec-list {
		columns: 1;
	}
	.mobile-toc ol {
		columns: 1;
	}
	.document-footer {
		display: block;
	}
}

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

@media print {
	body {
		background: white;
		color: black;
		font-size: 10pt;
	}
	.rail, .mobile-toc, .progress, .skip-link {
		display: none;
	}
	.layout {
		display: block;
		width: auto;
		padding: 0;
	}
	.hero {
		padding: 0 0 2rem;
		border: 0;
		box-shadow: none;
	}
	.hero::after {
		display: none;
	}
	article {
		padding: 0;
	}
	.rfc-section {
		break-before: auto;
	}
	a {
		text-decoration: none;
	}
}
