@layer norn.components {
		norn-link-button {
			display: inline-flex;
			max-inline-size: 100%;

			& a[data-variant] {
				--_state: 0%;
				--_bg: transparent;
				--_border: transparent;
				box-sizing: border-box;
				display: inline-flex;
				align-items: center;
				gap: var(--norn-space-xs, 0.5rem);
				min-block-size: var(--norn-ui-control-height, 2.25rem);
				padding: var(--norn-space-2xs, 0.25rem) var(--norn-space-m, 1.25rem);
				border: 1px solid var(--_border);
				border-radius: var(--norn-ui-border-radius, 6px);
				background-color: color-mix(in oklab, currentcolor var(--_state), var(--_bg));
				color: var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
				font-weight: 600;
				line-height: 1.3;
				overflow-wrap: anywhere;
				text-decoration: none;

				&:hover {
					--_state: var(--norn-ui-state-hover, 8%);
				}

				&:active {
					--_state: var(--norn-ui-state-press, 12%);
				}
			}

			/* The surrounding text color, for a secondary or quiet button. The primary rule below keeps its own. */
			& a[data-tone="current"] {
				color: inherit;
			}

			/* A square at the control height: the icon alone shows, and the label is read but not shown. */
			& a[data-icon-only] {
				justify-content: center;
				inline-size: var(--norn-ui-control-height, 2.25rem);
				padding: 0;
			}

			& a > [data-label] {
				position: absolute;
				inline-size: 1px;
				block-size: 1px;
				overflow: hidden;
				clip-path: inset(50%);
				white-space: nowrap;
			}

			& a[data-variant="primary"] {
				--_bg: var(--norn-ui-accent, #2346d4);
				color: var(--norn-text-on-accent, color(from var(--norn-ui-accent, #2346d4) xyz-d65 calc(0.95047 * clamp(0, calc((0.1791 - y) * 1000000), 1)) clamp(0, calc((0.1791 - y) * 1000000), 1) calc(1.08883 * clamp(0, calc((0.1791 - y) * 1000000), 1))));
			}

			& a[data-variant="secondary"] {
				--_border: var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
			}

			@media (pointer: coarse) {
				& a[data-variant] {
					min-block-size: 2.75rem;
				}

				& a[data-icon-only] {
					inline-size: 2.75rem;
				}
			}

			@media (prefers-reduced-motion: no-preference) {
				& a[data-variant] {
					transition: background-color var(--norn-ui-motion-duration, 150ms) var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1));
				}
			}

			/* The primary button stays filled, since the browser would turn its fill into the page color. */
			@media (forced-colors: active) {
				& a[data-variant="primary"] {
					border-color: LinkText;
					background-color: LinkText;
					color: Canvas;
					forced-color-adjust: none;

					&:focus-visible {
						outline-color: CanvasText;
					}
				}

				& a[data-variant="secondary"] {
					border-color: LinkText;
					color: LinkText;
				}

				/* A clear border would be drawn in the text color, so the quiet button's takes the page's. */
				& a[data-variant="quiet"] {
					border-color: Canvas;
					color: LinkText;
				}
			}
		}
	}
@layer norn.components {
		norn-icon {
			display: inline-flex;
			flex: none;
			vertical-align: -0.125em;

			& svg {
				inline-size: var(--norn-ui-icon-s, 1em);
				block-size: var(--norn-ui-icon-s, 1em);

				&[data-size="m"] {
					inline-size: var(--norn-ui-icon-m, 1.25rem);
					block-size: var(--norn-ui-icon-m, 1.25rem);
				}

				&:not([data-project]) {
					fill: none;
					stroke: currentcolor;
					stroke-linecap: round;
					stroke-linejoin: round;
					stroke-width: 2;
				}

				&[data-project] {
					fill: currentcolor;
				}
			}

			& > :not(svg) {
				position: absolute;
				inline-size: 1px;
				block-size: 1px;
				overflow: hidden;
				clip-path: inset(50%);
				white-space: nowrap;
			}

			& [data-fill] {
				fill: currentcolor;
				stroke: none;
			}

			&:dir(rtl) [data-mirror] {
				transform: scaleX(-1);
			}
		}
	}
@layer norn.components {
		norn-fact-list {
			display: block;

			& ul {
				display: flex;
				flex-wrap: wrap;
				gap: var(--norn-space-xs, 0.5rem) var(--norn-space-m, 1.25rem);
				margin: 0;
				padding: 0;
				list-style: none;
				color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				font-size: var(--norn-font-size-s, 0.875rem);

				&[data-gap="s"] {
					row-gap: var(--norn-space-s, 0.75rem);
				}

				&[data-gap="m"] {
					row-gap: var(--norn-space-m, 1.25rem);
				}

				&[data-gap="l"] {
					row-gap: var(--norn-space-l, 2rem);
				}
			}

			& li {
				display: inline-flex;
				align-items: center;
				gap: var(--norn-space-2xs, 0.25rem);
				max-inline-size: 100%;
				line-height: 1.5;
				overflow-wrap: anywhere;
			}

			& norn-icon {
				color: var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
			}
		}
	}
@layer norn.components {
		norn-copy-button {
			display: inline-flex;
			max-inline-size: 100%;

			& button {
				--_state: 0%;
				box-sizing: border-box;
				display: inline-flex;
				align-items: center;
				min-block-size: var(--norn-ui-control-height, 2.25rem);
				max-inline-size: 100%;
				padding: 0 var(--norn-space-xs, 0.5rem);
				border: 0;
				border-radius: var(--norn-ui-border-radius, 6px);
				background-color: color-mix(in oklab, currentcolor var(--_state), var(--_bg, transparent));
				color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				font: inherit;
				font-size: var(--norn-font-size-s, 0.875rem);
				overflow-wrap: anywhere;
				text-align: start;
				cursor: pointer;

				&[hidden] {
					display: none;
				}

				&[data-surface="base"] {
					--_bg: var(--norn-surface-base, light-dark(#ffffff, #101216));
				}

				&[data-surface="raised"] {
					--_bg: var(--norn-surface-raised, light-dark(hsl(40, 14%, 96%), #242932));
				}

				&[data-surface="code"] {
					--_bg: var(--norn-surface-code, light-dark(hsl(40, 14%, 94%), #2c313b));
				}

				&:hover {
					--_state: var(--norn-ui-state-hover, 8%);
				}

				&:active {
					--_state: var(--norn-ui-state-press, 12%);
				}

				&[data-state="copied"] {
					color: var(--norn-status-success, light-dark(#0b6b3a, #7ed6a1));
				}

				&[data-state="failed"] {
					color: var(--norn-status-danger, light-dark(#b42318, #ff8a80));
				}
			}

			/* The copy icon and the check share a cell, and so do the three texts, so the button is as wide for one as for another. */
			& [data-icons],
			& [data-label] {
				display: inline-grid;
			}

			& [data-icons] > norn-icon,
			& [data-label] > span {
				grid-area: 1 / 1;
			}

			& [data-label] {
				margin-inline-start: var(--norn-space-2xs, 0.25rem);
			}

			& button:not([data-state="copied"]) [data-icons] > norn-icon:last-child,
			& button[data-state="copied"] [data-icons] > norn-icon:first-child,
			& [data-label] > span:not([data-active]) {
				visibility: hidden;
			}

			/* A compact button is only its icon until the pointer or focus is on it, or it has a result to show. */
			& button[data-compact]:not(:hover, :focus-visible, [data-state]) [data-label] {
				inline-size: 0;
				margin: 0;
				overflow: hidden;
				white-space: nowrap;
			}

			& [role="status"] {
				position: absolute;
				inline-size: 1px;
				block-size: 1px;
				overflow: hidden;
				clip-path: inset(50%);
				white-space: nowrap;
			}

			@media (pointer: coarse) {
				& button {
					min-block-size: 2.75rem;
				}
			}

			@media (prefers-reduced-motion: no-preference) {
				& button {
					transition: background-color var(--norn-ui-motion-duration, 150ms) var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1));
				}
			}

			@media print {
				display: none;
			}
		}
	}
@layer norn.components {
		norn-code-block {
			display: block;

			/* The caption sits above the code. The copy button shares the code's cell, over its top end corner. */
			& figure {
				display: grid;
				grid-template-columns: minmax(0, 1fr);
				margin: 0;
			}

			& figure:has(> figcaption) {
				row-gap: var(--norn-space-xs, 0.5rem);
			}

			& figcaption {
				grid-area: 1 / 1;
				color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				font-family: var(--norn-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
				font-size: var(--norn-font-size-s, 0.875rem);
			}

			& norn-copy-button {
				grid-area: 2 / 1;
				z-index: 1;
				justify-self: end;
				align-self: start;
				margin: var(--norn-space-2xs, 0.25rem);
			}

			& pre {
				box-sizing: border-box;
				grid-area: 2 / 1;
				margin: 0;
				overflow-x: auto;
				padding: var(--norn-space-m, 1.25rem);
				border-radius: var(--norn-ui-border-radius, 6px);
				background: var(--norn-surface-code, light-dark(hsl(40, 14%, 94%), #2c313b));
				color: var(--norn-code-text, var(--norn-text-base, light-dark(#16181d, #eceef3)));
				font-family: var(--norn-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
				font-size: var(--norn-font-size-s, 0.875rem);
				line-height: 1.5;
			}

			/* With the copy button showing, the code's scrolling area stops short of it. A transparent border is outside the scrolling area and under the background, so no code runs beneath the button. The button sits at the figure's end, and the code is always left to right, so a right-to-left page takes the border on the other side. */
			& figure:has(> norn-copy-button > button:not([hidden])) {
				--_chip: calc(2 * var(--norn-space-xs, 0.5rem) + var(--norn-ui-icon-s, 1em) + var(--norn-space-2xs, 0.25rem) + var(--norn-space-xs, 0.5rem));
			}

			& figure:has(> norn-copy-button > button:not([hidden])) > pre {
				border-inline-end: var(--_chip) solid transparent;
			}

			& figure:dir(rtl):has(> norn-copy-button > button:not([hidden])) > pre {
				border-inline-end: 0;
				border-inline-start: var(--_chip) solid transparent;
			}

			& code {
				padding: 0;
				background: none;
				font: inherit;
			}

			/* A frame with a header bar for the caption, for `@chrome="terminal"`. `:where()` keeps each rule as specific as the plain one it follows, so a container's rules still win. */
			& figure:where([data-chrome="terminal"]),
			& figure:where([data-chrome="terminal"]):has(> figcaption) {
				overflow: hidden;
				row-gap: 0;
				border-radius: var(--norn-ui-border-radius, 6px);
			}

			& figure:where([data-chrome="terminal"]) > figcaption {
				box-sizing: border-box;
				display: flex;
				align-items: center;
				block-size: 2rem;
				padding-inline: var(--norn-space-s, 0.75rem);
				background: var(--norn-surface-raised, light-dark(hsl(40, 14%, 96%), #242932));
			}

			& figure:where([data-chrome="terminal"]) > pre {
				border-radius: 0;
			}

			/* Colors for the ranges the script registers, set on `code` as Firefox ignores them on an ancestor. Plain text without Custom Highlight API support. */
			& code::highlight(tok-comment) {
				color: var(--norn-code-comment, light-dark(#566070, #9aa3b5));
			}

			& code::highlight(tok-string) {
				color: var(--norn-code-string, light-dark(#0b6b3a, #7ed6a1));
			}

			& code::highlight(tok-keyword) {
				color: var(--norn-code-keyword, light-dark(#6b2fc2, #c4a3ff));
			}

			& code::highlight(tok-function) {
				color: var(--norn-code-function, light-dark(#1b4fc4, #8fb0ff));
			}

			& code::highlight(tok-number) {
				color: var(--norn-code-number, light-dark(#9a4a00, #ffb36b));
			}

			& code::highlight(tok-flag) {
				color: var(--norn-code-flag, light-dark(#00687a, #5ccfe0));
			}

			& code::highlight(tok-punctuation) {
				color: var(--norn-code-punctuation, var(--norn-text-muted, light-dark(#4b5160, #a4abba)));
			}

			@media print {
				break-inside: avoid;

				& pre {
					white-space: pre-wrap;
				}
			}
		}
	}
@layer norn.components {
		norn-hero {
			display: block;

			& > header {
				--_width: var(--norn-layout-width, 64rem);
				display: grid;
				grid-auto-flow: row;
				align-content: start;
				gap: var(--norn-space-m, 1.25rem);
				inline-size: min(100% - 2 * var(--norn-space-m, 1.25rem), var(--_width));
				margin-inline: auto;
				padding-block: var(--norn-space-xl, 4rem) var(--norn-space-l, 2rem);
			}

			& > header[data-width="measure"] {
				--_width: var(--norn-text-measure, 40em);
			}

			& > header > h1 {
				display: flex;
				flex-direction: column;
				gap: var(--norn-space-xs, 0.5rem);
				margin: 0;
				font-family: var(--norn-font-heading, var(--norn-font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
				font-size: clamp(2rem, 5vw, 3.25rem);
				line-height: 1.15;
				overflow-wrap: anywhere;
				text-wrap: balance;
			}

			& > header > h1 > :first-child {
				font-size: 1.15em;
			}

			& > header > h1 > :last-child:not(:first-child) {
				color: var(--norn-text-accent, light-dark(oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 82%, black) min(l, 0.5) c h), oklch(from color-mix(in oklch, var(--norn-ui-accent, #2346d4) 55%, white) max(l, 0.72) c h)));
				font-size: 0.55em;
				font-weight: 400;
			}

			& > header > p {
				max-inline-size: var(--norn-text-measure, 40em);
				margin: 0;
				color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				font-size: var(--norn-font-size-l, 1.25rem);
				text-wrap: pretty;
			}

			& > header > nav ul {
				display: flex;
				flex-wrap: wrap;
				gap: var(--norn-space-s, 0.75rem);
				margin: 0;
				padding: 0;
				list-style: none;
			}

			@media print {
				& > header > nav {
					display: none;
				}

				& > header {
					gap: var(--norn-space-s, 0.75rem);
					padding-block: var(--norn-space-m, 1.25rem);
				}
			}
		}
	}