/* Hammer Developers: the Writer's Desk tokens from hammer.ink, drawn as a blueprint. */

@font-face {
	font-family: 'Kingthings Typewriter';
	src: url('/assets/fonts/Kingthings_Trypewriter_2.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* Courier Prime, JetBrains Mono and Lora are SIL OFL 1.1; their licenses sit beside the files. */
@font-face {
	font-family: 'Courier Prime';
	src: url('/assets/fonts/courier-prime-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Courier Prime';
	src: url('/assets/fonts/courier-prime-latin-700-normal.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'JetBrains Mono';
	src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'JetBrains Mono';
	src: url('/assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Lora';
	src: url('/assets/fonts/lora-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Lora';
	src: url('/assets/fonts/lora-latin-500-normal.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Lora';
	src: url('/assets/fonts/lora-latin-400-italic.woff2') format('woff2');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

:root {
	--primary: #2563eb;
	--primary-dark: #1e40af;
	--accent: #d97706;
	--accent-light: #f59e0b;
	--accent-dark: #b45309;

	--neutral-200: #e7e5e4;
	--neutral-300: #d6d3d1;
	--neutral-400: #a8a29e;
	--neutral-500: #78716c;
	--neutral-600: #57534e;
	--neutral-800: #292524;
	--neutral-900: #1c1917;

	--blueprint: #173a80;
	--blueprint-deep: #0f2350;
	--blueprint-paper: #f3f6fb;
	--blueprint-tint: #eef3fc;
	--blueprint-gold: #fcd34d;
	--on-dark: #dbe6fb;
	--on-dark-muted: #9fb6e6;
	--on-dark-faint: #7d93c4;
	--rule: rgba(30, 64, 175, 0.35);

	--font-display: 'Kingthings Typewriter', 'Courier Prime', monospace;
	--font-label: 'Courier Prime', monospace;
	--font-mono: 'JetBrains Mono', monospace;
	--font-body: 'Lora', Georgia, serif;

	--shadow-sm: 0 1px 3px rgba(15, 35, 80, 0.12);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lift: 0 10px 20px rgba(15, 35, 80, 0.15);
	--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
	scroll-behavior: smooth;
	/* Anchored sections land below the sticky header. */
	scroll-padding-top: 6rem;
}

body {
	font-family: var(--font-body);
	background: var(--blueprint-paper);
	color: var(--neutral-900);
	line-height: 1.7;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--primary-dark);
	text-decoration: none;
	transition: color var(--transition-fast);
}

a:hover {
	color: var(--accent-dark);
}

code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	/* JetBrains Mono would draw >= and == as single glyphs, which misleads in sample code. */
	font-variant-ligatures: none;
}

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

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

.icon {
	width: 1.1em;
	height: 1.1em;
	flex: none;
	vertical-align: -0.15em;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Language switching ---------- */

/* Every language's variant is in the page; the root's data-lang picks one. Only the others are
   hidden, so the shown one keeps whatever display its own class gives it. */
html:not([data-lang="kotlin"]) .lang--kotlin,
html:not([data-lang="rust"]) .lang--rust,
html:not([data-lang="c"]) .lang--c {
	display: none;
}

.lang-tabs {
	display: flex;
	border: 1px solid var(--tab-border);
	border-radius: 3px;
	overflow: hidden;
}

.lang-tabs--dark {
	--tab-border: rgba(255, 255, 255, 0.3);
	--tab-fg: var(--on-dark);
	--tab-active-bg: var(--accent-light);
	--tab-active-fg: var(--blueprint-deep);
}

.lang-tabs--light {
	--tab-border: rgba(30, 64, 175, 0.45);
	--tab-fg: var(--primary-dark);
	--tab-active-bg: var(--primary-dark);
	--tab-active-fg: white;
}

.lang-tabs__tab {
	background: transparent;
	color: var(--tab-fg);
	border: none;
	border-right: 1px solid var(--tab-border);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	padding: 0.3rem 0.75rem;
	cursor: pointer;
}

.lang-tabs__tab:last-child {
	border-right: none;
}

.lang-tabs__tab[aria-pressed="true"] {
	background: var(--tab-active-bg);
	color: var(--tab-active-fg);
}

/* ---------- Header ---------- */

.site-header {
	background: white;
	border-bottom: 2px solid var(--primary-dark);
	padding: 1.25rem 0;
	position: sticky;
	top: 0;
	z-index: 100;
}

.header-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.site-logo {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	color: inherit;
	transition: transform var(--transition-base);
}

.site-logo:hover {
	color: inherit;
	transform: translateY(-2px);
}

.site-logo__mark .icon {
	width: 22px;
	height: 22px;
}

.site-logo__mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: var(--neutral-800);
	color: var(--accent);
}

.site-title {
	font-family: var(--font-display);
	font-size: 1.75rem;
	line-height: 1.2;
}

.site-logo__badge {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--primary-dark);
	border: 1px solid var(--primary-dark);
	padding: 0.15rem 0.5rem;
	border-radius: 3px;
}

.header-nav {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.header-nav__link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.875rem;
	color: var(--neutral-600);
	font-family: var(--font-label);
	font-size: 0.9375rem;
	white-space: nowrap;
	border-radius: 0.375rem;
	border: 2px solid transparent;
	transition: all var(--transition-base);
}

.header-nav__link:hover {
	color: var(--accent);
	background: rgba(217, 119, 6, 0.08);
}

.header-nav__link--primary {
	color: var(--primary);
	border-color: var(--primary);
}

.header-nav__link--primary:hover {
	background: var(--primary);
	color: white;
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.625rem 1.5rem;
	border: 2px solid var(--primary);
	border-radius: 0.375rem;
	background: transparent;
	color: var(--primary);
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	transition: all var(--transition-base);
}

.btn:hover {
	background: var(--primary);
	color: white;
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

.btn--accent {
	background: var(--accent);
	border-color: var(--accent);
	color: white;
}

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

.btn--primary {
	background: var(--neutral-900);
	border-color: var(--neutral-900);
	color: white;
}

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

.btn--on-dark {
	color: white;
	border-color: rgba(255, 255, 255, 0.7);
}

.btn--on-dark:hover {
	background: white;
	border-color: white;
	color: var(--blueprint);
}

.btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: default;
	pointer-events: none;
}

/* ---------- Shared section pieces ---------- */

.blueprint {
	background-color: var(--blueprint);
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
		linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
	color: white;
}

.eyebrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

.eyebrow::before {
	content: '';
	width: 28px;
	height: 2px;
	background: var(--accent);
}

.eyebrow--on-dark {
	color: var(--blueprint-gold);
}

.eyebrow--on-dark::before {
	background: var(--accent-light);
}

.section-title {
	font-family: var(--font-display);
	font-weight: normal;
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1.1;
	color: var(--neutral-900);
	text-wrap: balance;
}

.section-title--on-dark {
	color: white;
}

.lede {
	font-size: 1.0625rem;
	color: var(--neutral-600);
	max-width: 36rem;
}

.lede--on-dark {
	color: var(--on-dark);
}

.badge {
	display: inline-block;
	vertical-align: middle;
	margin-left: 0.4rem;
	padding: 0.05rem 0.45rem;
	border: 1px solid var(--accent-dark);
	border-radius: 3px;
	font-family: var(--font-mono);
	font-size: 0.65rem;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

/* ---------- Hero ---------- */

.hero {
	position: relative;
	overflow: hidden;
	padding: 5rem 2rem 6rem;
	border-bottom: 3px solid var(--accent);
}

/* The drawing's double border. */
.hero__frame,
.hero__frame::after {
	position: absolute;
	inset: 20px;
	border: 1.5px solid rgba(255, 255, 255, 0.55);
	pointer-events: none;
}

.hero__frame::after {
	content: '';
	inset: 5px;
	border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero__inner {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 3rem;
	align-items: end;
}

.hero__copy {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.hero__title {
	font-family: var(--font-display);
	font-weight: normal;
	font-size: clamp(2.75rem, 6vw, 5rem);
	line-height: 1.05;
	text-wrap: balance;
}

.hero__lede {
	font-size: 1.2rem;
	line-height: 1.65;
	color: var(--on-dark);
	max-width: 34rem;
	text-wrap: pretty;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 0.5rem;
}

.dimension {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	max-width: 34rem;
	margin-top: 1rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: #bcd0f5;
}

.dimension__tick {
	width: 1px;
	height: 12px;
	background: currentColor;
}

.dimension__line {
	flex: 1;
	height: 1px;
	background: currentColor;
}

.dimension__label {
	white-space: nowrap;
}

.title-block {
	justify-self: end;
	width: 100%;
	max-width: 400px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	border: 1.5px solid rgba(255, 255, 255, 0.75);
	background: rgba(15, 35, 80, 0.55);
	font-family: var(--font-mono);
	font-size: 0.78rem;
}

.title-block__head {
	grid-column: 1 / -1;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.9rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.title-block__name {
	font-family: var(--font-display);
	font-size: 1.25rem;
}

.title-block__version {
	color: var(--blueprint-gold);
}

.title-block__cell {
	padding: 0.6rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* The head is the first child, so the left-hand cells are the even ones. */
.title-block__cell:nth-child(even) {
	border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.title-block__cell:nth-last-child(-n + 2) {
	border-bottom: none;
}

.title-block__cell dt {
	color: var(--on-dark-muted);
	font-size: 0.65rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* ---------- The sheet below the hero ---------- */

.sheet {
	position: relative;
	flex: 1;
	background-color: var(--blueprint-paper);
	background-image:
		linear-gradient(rgba(30, 64, 175, 0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(30, 64, 175, 0.07) 1px, transparent 1px);
	background-size: 24px 24px;
}

.section {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	padding: 4rem 2rem;
}

.section--last {
	padding-bottom: 6rem;
}

.section--narrow {
	max-width: 720px;
	padding: 6rem 2rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.section__head {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 2.5rem;
	max-width: 40rem;
}

/* ---------- Quick start ---------- */

.quickstart {
	padding-top: 6rem;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
	gap: 3.5rem;
	align-items: start;
}

.quickstart__copy {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.quickstart__panels {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

.steps {
	list-style: none;
	margin-top: 1rem;
}

.steps__item {
	display: grid;
	grid-template-columns: 48px 1fr;
	gap: 1rem;
	padding: 1.1rem 0;
	border-top: 1px dashed var(--rule);
}

.steps__n {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid var(--primary-dark);
	border-radius: 50%;
	background: white;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--primary-dark);
}

.steps__title {
	display: block;
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1.1rem;
}

.steps__body {
	display: block;
	font-size: 0.975rem;
	color: var(--neutral-600);
	line-height: 1.55;
}

.choices {
	display: grid;
	gap: 0.5rem;
	margin-top: 0.6rem;
}

.choice {
	display: grid;
	grid-template-columns: 9.5rem 1fr;
	align-items: start;
	gap: 0.35rem 1rem;
	text-align: left;
	padding: 0.7rem 0.8rem;
	background: white;
	border: 1.5px solid var(--rule);
	border-radius: 4px;
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.choice:hover {
	border-color: var(--primary-dark);
}

.choice[aria-pressed="true"] {
	border-color: var(--primary-dark);
	box-shadow: inset 0 0 0 1px var(--primary-dark);
}

.choice__head {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.choice__name {
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1rem;
}

.choice__tag {
	font-family: var(--font-mono);
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--primary-dark);
}

.choice__text {
	font-size: 0.875rem;
	color: var(--neutral-600);
	line-height: 1.45;
}

@media (max-width: 640px) {
	.choice {
		grid-template-columns: 1fr;
	}
}

.panel-controls {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.terminal {
	background: var(--blueprint-deep);
	border: 1px solid var(--primary-dark);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 10px 15px -3px rgba(15, 35, 80, 0.25), 0 4px 6px -2px rgba(15, 35, 80, 0.15);
}

.terminal__bar,
.code-panel__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	padding: 0.6rem 1rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
}

.terminal__bar {
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	color: var(--on-dark-muted);
}

.terminal__body {
	font-variant-ligatures: none;
	padding: 1.25rem 1.25rem 1.5rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	line-height: 1.8;
	color: #e6edfb;
	word-break: break-word;
}

.terminal__line {
	white-space: pre-wrap;
}

.terminal__prompt {
	color: var(--on-dark-faint);
}

.terminal__line--result {
	color: var(--blueprint-gold);
}

.copy-btn {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 3px;
	color: var(--on-dark);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	padding: 0.3rem 0.6rem;
	cursor: pointer;
	transition: all var(--transition-fast);
}

.copy-btn:hover {
	border-color: var(--accent-light);
	color: var(--blueprint-gold);
}

.code-panel {
	background: white;
	border: 1.5px solid var(--primary-dark);
	border-radius: 6px;
	overflow: hidden;
}

.code-panel__bar {
	border-bottom: 1px solid rgba(30, 64, 175, 0.25);
	background: var(--blueprint-tint);
	color: var(--primary-dark);
}

.code-panel__file {
	padding: 0.75rem 1.25rem 0;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	color: var(--neutral-500);
}

.code-panel__code {
	font-variant-ligatures: none;
	padding: 0.75rem 1.25rem 1.25rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	line-height: 1.7;
	color: var(--neutral-900);
	overflow-x: auto;
}

.code-panel__code code {
	font-size: inherit;
}

.tok-keyword { color: var(--accent-dark); }
.tok-string { color: var(--primary-dark); }
.tok-number { color: #0e7490; }
.tok-comment { color: var(--neutral-500); }

/* ---------- Anatomy ---------- */

.anatomy {
	position: relative;
	background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
	border-radius: 6px;
	padding: 3.5rem clamp(1.5rem, 4vw, 3.5rem);
	box-shadow: 0 20px 25px -5px rgba(15, 35, 80, 0.25);
}

.anatomy__frame {
	position: absolute;
	inset: 12px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 3px;
	pointer-events: none;
}

.anatomy__head {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 2.5rem;
}

.anatomy__parts {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.anatomy a {
	color: var(--blueprint-gold);
}

.part {
	display: grid;
	grid-template-columns: minmax(0, 260px) minmax(40px, 1fr) minmax(0, 460px);
	align-items: center;
}

.part__file {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.9rem 1.1rem;
	border: 1.5px solid white;
	background: rgba(15, 35, 80, 0.6);
	font-family: var(--font-mono);
	font-size: 0.9rem;
}

.part__file .icon {
	color: var(--blueprint-gold);
}

.part__leader {
	display: flex;
	align-items: center;
}

.part__dot {
	width: 7px;
	height: 7px;
	margin-left: -4px;
	border-radius: 50%;
	background: white;
}

.part__dash {
	flex: 1;
	border-top: 1.5px dashed rgba(255, 255, 255, 0.7);
}

.part__tag {
	padding: 0 0.6rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--blueprint-gold);
}

.part__text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding-left: 0.25rem;
}

.part__title {
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1.1rem;
}

.part__body {
	font-size: 0.975rem;
	color: var(--on-dark);
	line-height: 1.55;
}

/* ---------- Extension points ---------- */

.points {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

/* Four cards: all in a row when each spec line fits on one line, else two by two, never three and an
   orphan. */
@media (min-width: 1180px) {
	.points {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 600px) {
	.points {
		grid-template-columns: 1fr;
	}
}

.point {
	position: relative;
	display: flex;
	flex-direction: column;
	background: white;
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
	color: inherit;
	box-shadow: var(--shadow-sm);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.point:hover {
	color: inherit;
	transform: translateY(-3px);
	box-shadow: var(--shadow-lift);
}

.point__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.5rem 1.5rem 1.25rem;
}

.point__icon {
	width: 1.6rem;
	height: 1.6rem;
	color: var(--primary-dark);
}

.point__title {
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1.2rem;
}

.point__text {
	font-size: 0.975rem;
	color: var(--neutral-600);
	line-height: 1.55;
}

.point__example {
	margin-top: auto;
	padding-top: 0.4rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--neutral-500);
}

.point__id {
	position: absolute;
	top: 1.1rem;
	right: 1.25rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--neutral-500);
}

.point__spec {
	padding: 0.5rem 0.9rem;
	border-top: 1px solid var(--rule);
	background: var(--blueprint-tint);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--primary-dark);
	white-space: nowrap;
}

/* ---------- Publish ---------- */

.publish {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
	background: white;
	overflow: hidden;
}

.publish__step {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.75rem 1.5rem;
	/* Drawn on every step and clipped at the right edge, so a wrapped row needs no special case. */
	border-right: 1px dashed var(--rule);
	border-bottom: 1px dashed var(--rule);
	margin: 0 -1px -1px 0;
}

.publish__n {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

.publish__title {
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1.2rem;
}

.publish__body {
	font-size: 0.975rem;
	color: var(--neutral-600);
	line-height: 1.55;
}

.publish__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 2rem;
}

/* ---------- Footer ---------- */

.site-footer {
	background: var(--neutral-900);
	color: var(--neutral-300);
	padding: 3.5rem 2rem 2.5rem;
	border-top: 3px solid var(--primary-dark);
}

.footer-content {
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
}

.footer-nav {
	display: flex;
	gap: 2.5rem;
	flex-wrap: wrap;
	justify-content: center;
}

.footer-nav a {
	position: relative;
	padding-bottom: 0.25rem;
	color: var(--neutral-300);
	font-size: 1.0625rem;
}

.footer-nav a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform var(--transition-base);
}

.footer-nav a:hover {
	color: white;
}

.footer-nav a:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}

.footer-version {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--neutral-400);
}

/* ---------- API reference ---------- */

.ref {
	position: relative;
	max-width: 1440px;
	margin: 0 auto;
	padding: 3rem 2rem 6rem;
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr) 200px;
	gap: 3rem;
	align-items: start;
}

.ref__side,
.ref__toc {
	position: sticky;
	top: 6.5rem;
	max-height: calc(100vh - 8rem);
	overflow-y: auto;
}

.ref__main {
	min-width: 0;
	max-width: 52rem;
}

/* The index has no contents column, so it takes that room too. */
.ref__main--wide {
	grid-column: 2 / -1;
	max-width: none;
}

.ref__head {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding-bottom: 2rem;
	margin-bottom: 2rem;
	border-bottom: 1.5px solid var(--primary-dark);
}

.ref-nav {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: 1.25rem;
	background: white;
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
}

.ref-nav__home {
	font-family: var(--font-label);
	font-weight: 700;
	color: var(--neutral-900);
}

.ref-nav__group {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.ref-nav__label {
	display: block;
	margin-bottom: 0.35rem;
	font-family: var(--font-mono);
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

.ref-nav__link,
.ref__toc a {
	display: block;
	padding: 0.2rem 0 0.2rem 0.6rem;
	border-left: 2px solid transparent;
	font-size: 0.92rem;
	line-height: 1.4;
	color: var(--neutral-600);
}

.ref-nav__link:hover,
.ref__toc a:hover {
	color: var(--primary-dark);
	border-left-color: var(--rule);
}

.ref-nav__link.is-current,
.ref-nav__home.is-current {
	color: var(--primary-dark);
	border-left-color: var(--accent);
	font-weight: 500;
}

.ref__toc {
	display: flex;
	flex-direction: column;
	padding-top: 0.5rem;
}

.ref__toc a {
	font-size: 0.85rem;
}

.ref-index__group {
	margin: 2rem 0 1rem;
	font-family: var(--font-mono);
	font-weight: 400;
	font-size: 0.8rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

.ref-index {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: 1rem;
}

.ref-index__card {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1.25rem 1.4rem;
	background: white;
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
	color: inherit;
	box-shadow: var(--shadow-sm);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.ref-index__card:hover {
	color: inherit;
	transform: translateY(-3px);
	box-shadow: var(--shadow-lift);
}

.ref-index__title {
	font-family: var(--font-label);
	font-weight: 700;
	font-size: 1.1rem;
}

.ref-index__text {
	font-size: 0.95rem;
	color: var(--neutral-600);
	line-height: 1.5;
}

/* ---------- Reference prose ---------- */

.prose {
	font-size: 1.02rem;
	color: var(--neutral-800);
}

.prose > * + * {
	margin-top: 1rem;
}

.prose h2 {
	position: relative;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px dashed var(--rule);
	font-family: var(--font-display);
	font-weight: normal;
	font-size: 1.75rem;
	line-height: 1.2;
	color: var(--neutral-900);
}

.prose h3 {
	position: relative;
	margin-top: 2rem;
	font-family: var(--font-label);
	font-size: 1.2rem;
	color: var(--neutral-900);
}

.prose h4 {
	margin-top: 1.5rem;
	font-family: var(--font-label);
	font-size: 1rem;
}

.prose h2 code,
.prose h3 code {
	font-size: 0.85em;
	color: var(--primary-dark);
}

.anchor {
	position: absolute;
	left: -1.1em;
	color: var(--neutral-400);
	font-family: var(--font-mono);
	font-weight: 400;
	opacity: 0;
	transition: opacity var(--transition-fast);
}

h2:hover > .anchor,
h3:hover > .anchor,
.anchor:focus {
	opacity: 1;
}

.prose a {
	text-decoration: underline;
	text-decoration-color: rgba(30, 64, 175, 0.3);
	text-underline-offset: 3px;
}

.prose ul,
.prose ol {
	padding-left: 1.4rem;
}

.prose li + li {
	margin-top: 0.35rem;
}

.prose :not(pre) > code {
	padding: 0.1em 0.35em;
	background: var(--blueprint-tint);
	border: 1px solid rgba(30, 64, 175, 0.15);
	border-radius: 3px;
	color: var(--neutral-900);
	white-space: nowrap;
}

/* Long dotted paths and signatures break rather than push the column wide. */
.prose td :not(pre) > code {
	white-space: normal;
	overflow-wrap: anywhere;
}

.code-block {
	padding: 1rem 1.25rem;
	background: white;
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	line-height: 1.65;
	overflow-x: auto;
	font-variant-ligatures: none;
}

.code-block code {
	font-size: inherit;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
	background: white;
	border: 1.5px solid var(--primary-dark);
	display: block;
	overflow-x: auto;
}

.prose th {
	text-align: left;
	padding: 0.5rem 0.75rem;
	background: var(--blueprint-tint);
	border-bottom: 1px solid var(--rule);
	font-family: var(--font-mono);
	font-weight: 400;
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--primary-dark);
}

.prose td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px dashed rgba(30, 64, 175, 0.2);
	vertical-align: top;
	line-height: 1.5;
}

.prose tr:last-child td {
	border-bottom: none;
}

.prose blockquote {
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--accent);
	background: rgba(217, 119, 6, 0.06);
}

/* ---------- Kit tabs ---------- */

.kit-tabs {
	margin-top: 1rem;
	padding: 1rem 1.25rem 1.25rem;
	background: var(--blueprint-tint);
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
}

.kit-tabs .lang-tabs {
	display: inline-flex;
	background: white;
}

.kit-tabs__panel > * + * {
	margin-top: 1rem;
}

.kit-tabs__panel {
	margin-top: 1rem;
	scroll-margin-top: 6rem;
}

/* ---------- Operations ---------- */

.op {
	margin-top: 1.5rem;
	padding: 1.25rem 1.4rem;
	background: white;
	border: 1.5px solid var(--primary-dark);
	border-radius: 4px;
	scroll-margin-top: 6rem;
}

.op__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}

.prose .op__name {
	margin: 0;
	font-size: 1.1rem;
}

.op__badge {
	padding: 0.05rem 0.5rem;
	border: 1px solid;
	border-radius: 3px;
	font-family: var(--font-mono);
	font-size: 0.65rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.op__badge--read { color: #047857; }
.op__badge--write { color: var(--accent-dark); }
.op__badge--destructive { color: #b91c1c; background: rgba(185, 28, 28, 0.06); }

.op__scope {
	margin-left: auto;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--neutral-500);
}

.prose .op__desc {
	margin-top: 0.6rem;
}

.op__calls {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.3rem 0.75rem;
	margin-top: 0.75rem;
	font-size: 0.85rem;
}

.op__calls div {
	display: contents;
}

.op__calls dt {
	font-family: var(--font-mono);
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent-dark);
	padding-top: 0.15rem;
}

.op__calls dd {
	margin: 0;
	min-width: 0;
}

.prose .op__calls code {
	white-space: normal;
	overflow-wrap: anywhere;
}

.op__io {
	display: grid;
	gap: 1rem;
	margin-top: 1rem;
}

.op__label {
	display: block;
	margin: 0.75rem 0 0.4rem;
	font-family: var(--font-mono);
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

.op__none {
	font-size: 0.9rem;
	color: var(--neutral-500);
	font-style: italic;
}

.prose .fields {
	display: table;
	font-size: 0.86rem;
}

.fields__name {
	width: 34%;
}

.fields__parent {
	color: var(--neutral-400);
}

.fields__optional {
	font-family: var(--font-mono);
	font-size: 0.65rem;
	color: var(--accent-dark);
}

.fields__type {
	width: 22%;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--primary-dark);
}

@media (max-width: 1200px) {
	.ref {
		grid-template-columns: 200px minmax(0, 1fr);
	}

	.ref__toc {
		display: none;
	}
}

@media (max-width: 860px) {
	.ref {
		grid-template-columns: 1fr;
		padding: 2rem 1rem 4rem;
		gap: 1.5rem;
	}

	.ref__side {
		position: static;
		max-height: none;
	}

	.ref__main--wide {
		grid-column: auto;
	}

	.anchor {
		display: none;
	}

	.fields__name,
	.fields__type {
		width: auto;
	}
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1040px) {
	.header-nav__link--anchor {
		display: none;
	}
}

@media (max-width: 768px) {
	.header-container {
		padding: 0 1rem;
	}

	.site-logo__badge {
		display: none;
	}

	.hero {
		padding: 4rem 1.5rem 4.5rem;
	}

	.hero__frame {
		inset: 10px;
	}

	.title-block {
		justify-self: stretch;
		max-width: none;
	}

	.section {
		padding: 3rem 1rem;
	}

	.quickstart {
		padding-top: 4rem;
	}

	/* The leader line needs room; stacked, the file box heads its description. */
	.part {
		grid-template-columns: 1fr;
		gap: 0.6rem;
	}

	.part__leader {
		display: none;
	}

	.footer-nav {
		flex-direction: column;
		align-items: center;
		gap: 1.25rem;
	}
}

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

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