/*
 * Revio — documentation (docs/index.html). Uses the tokens and components of main.css.
 * 1. Hero   2. Layout and table of contents   3. Article   4. Figures   5. Callouts, steps, tables, code   6. Mobile
 */

/* 1. Hero ------------------------------------------------------------------ */
.docs-hero {
	background: var(--hero);
	color: var(--hero-text);
}

.docs-hero__inner {
	padding-block: clamp(40px, 6vw, 72px);
}

.docs-hero__title {
	margin-top: 14px;
	font-family: var(--font-heading);
	font-size: clamp(36px, 5.4vw, 60px);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.03em;
}

.docs-hero__lead {
	max-width: 720px;
	margin-top: 16px;
	font-size: clamp(16px, 1.6vw, 18px);
	color: var(--hero-muted);
}

.docs-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}

.docs-hero__meta li {
	padding: 6px 12px;
	border: 1px solid var(--hero-line);
	border-radius: 99px;
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--hero-muted);
}

/* 2. Layout and table of contents ------------------------------------------ */
.docs {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 56px;
	align-items: start;
	padding-block: 48px 96px;
}

.toc {
	position: sticky;
	top: calc(var(--header-height) + 24px);
	max-height: calc(100vh - var(--header-height) - 48px);
	overflow-y: auto;
	font-size: 14px;
	scrollbar-width: thin;
}

.toc__summary {
	display: none;
}

.toc__title {
	margin-bottom: 10px;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}

.toc__list {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 2px;
	counter-reset: toc;
}

.toc__link {
	display: flex;
	gap: 10px;
	padding: 7px 12px;
	border-radius: var(--r-sm);
	font-weight: 600;
	color: var(--text);
	text-decoration: none;
	counter-increment: toc;
}

.toc__link::before {
	content: counter(toc, decimal-leading-zero);
	font-family: var(--font-mono);
	font-weight: 500;
	color: var(--muted);
}

.toc__link:hover {
	background: var(--surface);
}

.toc__link[aria-current="true"] {
	background: var(--surface);
	box-shadow: inset 3px 0 0 var(--text);
}

.toc__sub {
	display: grid;
	margin: 2px 0 6px 40px;
}

.toc__sub a {
	padding: 4px 0;
	font-size: 13px;
	color: var(--muted);
	text-decoration: none;
}

.toc__sub a:hover {
	color: var(--text);
}

/* 3. Article --------------------------------------------------------------- */
.doc {
	min-width: 0;
	font-size: 16.5px;
	line-height: 1.7;
}

.doc-section + .doc-section {
	margin-top: 72px;
	padding-top: 56px;
	border-top: 1px solid var(--line);
}

.doc-section__eyebrow {
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.doc h2 {
	margin-top: 6px;
	font-family: var(--font-heading);
	font-size: clamp(28px, 3.4vw, 38px);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.doc h3 {
	margin: 40px 0 0;
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

.doc h4 {
	margin: 24px 0 0;
	font-size: 16px;
	font-weight: 700;
}

.doc p,
.doc ul,
.doc ol {
	margin-top: 14px;
}

.doc ul,
.doc ol {
	padding-left: 22px;
}

.doc ul {
	list-style: disc;
}

.doc li + li {
	margin-top: 6px;
}

.doc li::marker {
	color: var(--muted);
}

.doc a {
	font-weight: 600;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.doc code {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--soft);
	font-family: var(--font-mono);
	font-size: 0.86em;
	overflow-wrap: anywhere;
}

.doc kbd {
	padding: 2px 7px;
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: 6px;
	background: var(--surface);
	font-family: var(--font-mono);
	font-size: 0.84em;
}

.path {
	display: inline;
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	font-weight: 600;
	white-space: nowrap;
}

.lead {
	font-size: 18px;
	color: var(--muted);
}

/* 4. Figures --------------------------------------------------------------- */
.figure {
	margin-top: 22px;
}

.figure__frame {
	display: block;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	background: var(--surface);
	box-shadow: 0 18px 40px -30px rgb(13 27 30 / 0.45);
	cursor: zoom-in;
}

.figure__frame img {
	width: 100%;
	height: auto;
}

.figure--narrow {
	max-width: 520px;
}

.figure--medium {
	max-width: 760px;
}

.figure figcaption {
	margin-top: 10px;
	font-size: 14px;
	color: var(--muted);
}

.figures {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.figures .figure {
	margin-top: 22px;
}

/* 5. Callouts, steps, tables, code ----------------------------------------- */
.callout {
	display: flex;
	gap: 14px;
	margin-top: 22px;
	padding: 16px 20px;
	border-radius: var(--r-md);
	background: var(--surface);
	box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 1px var(--line);
	font-size: 15.5px;
}

.callout p {
	margin: 0;
}

.callout p + p {
	margin-top: 8px;
}

.callout__label {
	flex: none;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 2.2;
}

.callout--warn {
	box-shadow: inset 4px 0 0 #e0864a, inset 0 0 0 1px var(--line);
}

.steps {
	display: grid;
	gap: 14px;
	margin-top: 20px !important;
	padding: 0 !important;
	list-style: none !important;
	counter-reset: step;
}

.steps > li {
	position: relative;
	margin: 0 !important;
	padding-left: 46px;
	counter-increment: step;
}

.steps > li::before {
	content: counter(step);
	position: absolute;
	top: 1px;
	left: 0;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--text);
	color: var(--bg);
	font-family: var(--font-mono);
	font-size: 14px;
	font-weight: 700;
}

.table-wrap {
	margin-top: 20px;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	background: var(--surface);
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.table th,
.table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.table tr:last-child td {
	border-bottom: 0;
}

.table th {
	background: var(--soft);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.table td:first-child {
	min-width: 170px;
	font-weight: 600;
}

.code {
	margin-top: 18px;
	padding: 18px 20px;
	overflow-x: auto;
	border-radius: var(--r-md);
	background: var(--hero);
	color: var(--hero-text);
	font-family: var(--font-mono);
	font-size: 13.5px;
	line-height: 1.65;
	tab-size: 4;
}

.code code {
	padding: 0;
	background: none;
	font-size: inherit;
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.card {
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	background: var(--surface);
}

.card__title {
	font-weight: 700;
}

.card__text {
	margin-top: 4px !important;
	font-size: 14.5px;
	color: var(--muted);
	line-height: 1.55;
}

/* Zoomed screenshot */
.zoom {
	width: min(1400px, 96vw);
	max-width: none;
	max-height: 94vh;
	padding: 0;
	border: 0;
	border-radius: var(--r-md);
	background: transparent;
}

.zoom::backdrop {
	background: rgb(5 11 12 / 0.86);
}

.zoom img {
	width: 100%;
	height: auto;
	border-radius: var(--r-md);
	cursor: zoom-out;
}

/* 6. Mobile ---------------------------------------------------------------- */
@media (max-width: 960px) {
	.docs {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
		padding-top: 28px;
	}

	.toc {
		position: static;
		max-height: none;
		padding: 4px 16px;
		border: 1px solid var(--line);
		border-radius: var(--r-md);
		background: var(--surface);
	}

	.toc__summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 52px;
		font-weight: 700;
		cursor: pointer;
		list-style: none;
	}

	.toc__summary::-webkit-details-marker {
		display: none;
	}

	.toc__summary::after {
		content: "+";
		font-family: var(--font-mono);
		font-size: 20px;
	}

	.toc[open] .toc__summary::after {
		content: "−";
	}

	.toc__title {
		display: none;
	}

	.toc__nav {
		padding-bottom: 12px;
	}

	.figures {
		grid-template-columns: minmax(0, 1fr);
	}
}
