/* The docs (abso-website issue 320, src/docs/page.ts): the pages at the side, the page, its sections beside it.
   The marketing pages' look on the site's tokens: Recursive, dark, terminals as figures. A row of pages on a phone. */

main.page:has(> .dk) {
	max-width: none;
	padding: 0;
}
.dk {
	--dk-orange: var(--agent-2);
	display: grid;
	grid-template-columns: 168px minmax(0, 1fr);
	column-gap: 56px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 56px 24px 96px;
	color: var(--ink);
}

/* ---------- the pages ---------- */
.dk-nav {
	position: sticky;
	top: 24px;
	align-self: start;
}
.dk-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.dk-nav li a {
	display: block;
	padding: 7px 0 7px 14px;
	border-left: 2px solid var(--rule);
	font: 550 15px / 22px var(--font-sans);
	color: var(--muted);
	text-decoration: none;
}
.dk-nav li a:hover {
	color: var(--ink);
}
.dk-nav li a[aria-current="page"] {
	border-left-color: var(--dk-orange);
	color: var(--ink);
	font-weight: 680;
}
.dk-nav-raw {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 28px 0 0;
	padding-left: 16px;
	font: 500 12px / 18px var(--font-mono);
}
.dk-nav-raw a {
	color: var(--faint);
}

/* ---------- the page ---------- */
.dk-page {
	display: grid;
	grid-template-columns: minmax(0, 720px) 180px;
	grid-template-rows: auto auto 1fr auto;
	column-gap: 56px;
	align-items: start;
	min-width: 0;
}
.dk-head,
.dk-toc-m,
.dk-body,
.dk-next {
	grid-column: 1;
	min-width: 0;
}
.dk-head h1 {
	margin: 0;
	font: 780 clamp(34px, 4.2vw, 50px) / 1.05 var(--font-sans);
	letter-spacing: -0.03em;
	text-wrap: balance;
}
.dk-lead {
	margin: 18px 0 0;
	max-width: 62ch;
	font: 400 19px / 30px var(--font-sans);
	color: var(--ink);
	opacity: 0.88;
}

/* The page's sections: beside it, sticky. */
.dk-toc {
	grid-column: 2;
	grid-row: 1 / -1;
	position: sticky;
	top: 24px;
	padding-top: 10px;
}
.dk-toc p,
.dk-toc-m summary {
	margin: 0 0 10px;
	font: 600 12px / 16px var(--font-mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--faint);
}
.dk-toc ol,
.dk-toc-m ol {
	margin: 0;
	padding: 0;
	list-style: none;
}
.dk-toc li a,
.dk-toc-m li a {
	display: block;
	padding: 4px 0;
	font: 500 14px / 20px var(--font-sans);
	color: var(--muted);
	text-decoration: none;
}
.dk-toc li a:hover,
.dk-toc-m li a:hover {
	color: var(--ink);
}
.dk-toc-m {
	display: none;
}

/* ---------- the text ---------- */
.dk-body {
	font: 400 16px / 27px var(--font-sans);
	color: var(--syn-plain);
}
.dk-body > :first-child {
	margin-top: 36px;
}
.dk-body h2 {
	margin: 56px 0 14px;
	padding-top: 28px;
	border-top: 1px solid var(--rule);
	font: 720 26px / 32px var(--font-sans);
	letter-spacing: -0.02em;
	color: var(--ink);
	scroll-margin-top: 16px;
}
.dk-body h3 {
	margin: 32px 0 8px;
	font: 650 18px / 24px var(--font-sans);
	color: var(--ink);
	scroll-margin-top: 16px;
}
.dk-body a.dk-anchor {
	color: inherit;
	text-decoration: none;
}
.dk-body a.dk-anchor:hover {
	text-decoration: underline;
	text-decoration-color: var(--faint);
}
.dk-body p {
	margin: 14px 0 0;
	max-width: 68ch;
}
.dk-body ul,
.dk-body ol {
	margin: 14px 0 0;
	padding-left: 22px;
	max-width: 68ch;
}
.dk-body li {
	margin: 6px 0 0;
	padding-left: 4px;
}
.dk-body li::marker {
	color: var(--faint);
}
.dk-body .dk-li-1 {
	margin-left: 22px;
}
.dk-body strong {
	color: var(--ink);
	font-weight: 650;
}
.dk-body a,
.dk-lead a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--rule-strong);
	text-underline-offset: 3px;
}
.dk-body a:hover,
.dk-lead a:hover {
	text-decoration-color: var(--ink);
}
.dk-body :not(pre) > code {
	padding: 1px 5px;
	border-radius: 4px;
	background: var(--raised);
	font: 450 0.88em / 1 var(--font-mono);
	color: var(--ink);
	overflow-wrap: anywhere;
}
.dk-body blockquote {
	margin: 18px 0 0;
	padding: 2px 0 2px 16px;
	border-left: 2px solid var(--dk-orange);
}
.dk-body hr {
	margin: 40px 0;
	border: 0;
	border-top: 1px solid var(--rule);
}
.dk-scroll {
	margin: 18px 0 0;
	overflow-x: auto;
}
.dk-body table {
	border-collapse: collapse;
	font-size: 15px;
	line-height: 22px;
}
.dk-body th,
.dk-body td {
	padding: 8px 16px 8px 0;
	border-bottom: 1px solid var(--rule);
	text-align: left;
	vertical-align: top;
}
.dk-body th {
	font-weight: 650;
	color: var(--ink);
}

/* ---------- terminals: what was typed and what came back ---------- */
.dk-term {
	margin: 20px 0 0;
	min-width: 0;
	background: #0b0d10;
	border: 1px solid var(--rule);
	border-radius: var(--radius-card);
	overflow: hidden;
}
.dk-term-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 20px;
	padding: 8px 10px 8px 16px;
	border-bottom: 1px solid var(--rule);
	font: 600 12px / 16px var(--font-mono);
	color: var(--muted);
}
.dk-term pre {
	margin: 0;
	padding: 16px 16px 18px;
	overflow-x: auto;
	font: 400 13px / 21px var(--font-mono);
	color: var(--syn-plain);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	tab-size: 4;
}
.dk-term .dk-cmd {
	color: var(--ink);
	font-weight: 550;
}
.dk-term .dk-p,
.dk-term .dk-note {
	color: var(--faint);
	font-weight: 400;
}
.dk-term .held {
	color: var(--warn);
	font-weight: 600;
}
.dk-term .ok {
	color: var(--pass);
}
.dk-term figcaption {
	padding: 10px 16px;
	border-top: 1px solid var(--rule);
	font: 500 12px / 18px var(--font-sans);
	color: var(--faint);
}
.dk-copy {
	flex: none;
	padding: 3px 10px;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: transparent;
	font: 600 12px / 16px var(--font-mono);
	color: var(--muted);
	cursor: pointer;
}
.dk-copy:hover {
	border-color: var(--rule-strong);
	color: var(--ink);
}
.dk-copy[data-copied] {
	color: var(--pass);
}
.dk-copy[hidden] {
	display: none;
}

.dk-next {
	margin: 64px 0 0;
	padding-top: 24px;
	border-top: 1px solid var(--rule);
	font: 650 17px / 24px var(--font-sans);
}
.dk-next a {
	color: var(--ink);
	text-decoration: none;
}
.dk-next a:hover span {
	color: var(--dk-orange);
}

/* ---------- narrower: the sections go under the title ---------- */
@media (max-width: 1100px) {
	.dk-page {
		grid-template-columns: minmax(0, 1fr);
	}
	.dk-toc {
		display: none;
	}
	.dk-toc-m {
		display: block;
		margin: 24px 0 0;
		padding: 12px 0;
		border-top: 1px solid var(--rule);
		border-bottom: 1px solid var(--rule);
	}
	.dk-toc-m summary {
		margin: 0;
		cursor: pointer;
	}
	.dk-toc-m ol {
		padding-top: 8px;
	}
}

/* ---------- a phone: the pages are a row under the top bar ---------- */
@media (max-width: 760px) {
	.dk {
		grid-template-columns: minmax(0, 1fr);
		padding: 0 16px 72px;
	}
	.dk-nav {
		position: static;
		display: flex;
		align-items: center;
		gap: 16px;
		margin: 0 -16px;
		padding: 0 16px;
		border-bottom: 1px solid var(--rule);
		overflow-x: auto;
	}
	.dk-nav ul {
		display: flex;
		gap: 4px;
	}
	.dk-nav li a {
		display: flex;
		align-items: center;
		min-height: 44px;
		box-sizing: border-box;
		padding: 2px 10px 0;
		border-left: 0;
		border-bottom: 2px solid transparent;
		white-space: nowrap;
	}
	.dk-nav li a[aria-current="page"] {
		border-bottom-color: var(--dk-orange);
	}
	/* The markdown and llms.txt links go to the end of the page, so the four pages fit a 360 px row (issue 340). */
	.dk-nav-raw {
		display: none;
	}
	.dk-raw-foot {
		display: flex !important;
	}
	.dk-head {
		padding-top: 28px;
	}
	.dk-lead {
		font-size: 17px;
		line-height: 27px;
	}
	.dk-body h2 {
		margin-top: 44px;
		font-size: 23px;
		line-height: 29px;
	}
	.dk-term pre {
		padding: 14px 12px 16px;
		font-size: 12.5px;
		line-height: 20px;
	}
	.dk-term-bar {
		padding-left: 12px;
	}
}

/* Commands keep their lines, with their notes beside them; a narrow screen scrolls the block, not the page. */
.dk-term.is-code pre {
	white-space: pre;
	overflow-wrap: normal;
}

/* A terminal that plays (docs.js): each command's measured time beside it, counting while it runs. */
.dk-took {
	margin-left: 12px;
	color: var(--faint);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}
.dk-term.is-playing .dk-ln.is-waiting {
	visibility: hidden;
}
.dk-term .dk-ln.is-running .dk-took {
	color: var(--warn);
}
.dk-term .dk-ln.is-running .dk-took::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 6px;
	border-radius: 50%;
	background: currentColor;
	vertical-align: 1px;
	animation: dk-blink 0.8s steps(2, start) infinite;
}
@keyframes dk-blink {
	to {
		visibility: hidden;
	}
}
.dk-again {
	margin-right: auto;
	margin-left: 16px;
	padding: 0;
	border: 0;
	background: none;
	font: 600 12px / 16px var(--font-mono);
	color: var(--muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	cursor: pointer;
}
.dk-again:hover {
	color: var(--ink);
}

/* A file shown below a page's text, as it is installed (the skill page shows SKILL.md). */
.dk-file {
	margin: 24px 0 0;
	border: 1px solid var(--rule);
	border-radius: var(--radius-card);
	background: var(--surface);
	overflow: hidden;
}
.dk-file .dk-term-bar a {
	color: var(--muted);
	font-weight: 500;
}
.dk-file-meta {
	margin: 0;
	padding: 12px 20px;
	border-bottom: 1px solid var(--rule);
	font: 400 13px / 20px var(--font-mono);
}
.dk-file-meta div {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 12px;
	padding: 3px 0;
}
.dk-file-meta dt {
	color: var(--faint);
}
.dk-file-meta dd {
	margin: 0;
	color: var(--syn-plain);
}
.dk-file-body {
	padding: 4px 20px 24px;
}
.dk-file-body h1 {
	margin: 20px 0 0;
	font: 720 22px / 28px var(--font-sans);
	color: var(--ink);
}
.dk-body .dk-file-body h2 {
	margin: 28px 0 8px;
	padding-top: 0;
	border-top: 0;
	font-size: 18px;
	line-height: 24px;
}
.dk-file-body .dk-term {
	background: var(--paper);
}
@media (max-width: 760px) {
	.dk-file-body,
	.dk-file-meta {
		padding-left: 14px;
		padding-right: 14px;
	}
	.dk-file-meta div {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
}

/* The markdown and llms.txt links at the end of a page: on a phone, where the row at the top has room only for the pages. */
.dk-raw-foot {
	display: none;
	gap: 16px;
	margin: 24px 0 0;
	font: 500 13px / 20px var(--font-mono);
}
.dk-raw-foot a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--muted);
}
