/*
 * Sorell Documentation — online version.
 * Same tokens as the landing page (landing/assets/css/landing.css), tuned for long reading.
 */

:root {
	--paper: #f4f1ea;
	--surface: #fafaf8;
	--ink: #181818;
	--muted: #66645f;
	--line: rgba(24, 24, 24, 0.16);
	--line-strong: rgba(24, 24, 24, 0.72);
	--accent: #a84f3d;

	--sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--serif: "Iowan Old Style", Baskerville, "Times New Roman", serif;
	--mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

	--header-h: 3.5rem;
	--sidebar-w: 17rem;
	--pad: clamp(1rem, 3vw, 3rem);
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	color: var(--ink);
	background: var(--paper);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
}

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

[id] {
	scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.skip-link {
	position: absolute;
	z-index: 100;
	top: 0.75rem;
	left: 0.75rem;
	padding: 0.75rem 1rem;
	color: var(--paper);
	background: var(--ink);
	font-size: 0.875rem;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

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

.micro {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

.num {
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.dot {
	color: var(--accent);
	font-size: 0.6em;
	vertical-align: 0.2em;
}

.link-line {
	padding-bottom: 0.15em;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 1px;
	text-decoration: none;
	transition: background-size 0.4s var(--ease), color 0.2s ease;
}

.link-line:hover,
.link-line:focus-visible {
	background-size: 100% 1px;
}

.link-line--strong {
	background-size: 100% 1px;
}

.link-line--strong:hover,
.link-line--strong:focus-visible {
	color: var(--accent);
}

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

.doc-header {
	position: sticky;
	z-index: 40;
	top: 0;
	border-bottom: 1px solid var(--line);
	background: var(--paper);
}

.doc-header__inner {
	display: flex;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	max-width: 82.5rem;
	min-height: var(--header-h);
	margin-inline: auto;
	padding-inline: var(--pad);
}

.doc-brand {
	display: flex;
	gap: 0.9rem;
	align-items: baseline;
	text-decoration: none;
}

.doc-brand__name {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.doc-brand__label {
	color: var(--muted);
	font-family: var(--serif);
	font-size: 1rem;
	font-style: italic;
}

.doc-header__right {
	display: flex;
	gap: 1.75rem;
	align-items: center;
}

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

/* ------------------------------------------------------------------ Layout */

.doc-layout {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	max-width: 82.5rem;
	margin-inline: auto;
	padding-inline: var(--pad);
}

.doc-sidebar {
	position: sticky;
	top: var(--header-h);
	align-self: start;
	height: calc(100vh - var(--header-h));
	overflow-y: auto;
	padding: 2.5rem 1.5rem 2.5rem 0;
	border-right: 1px solid var(--line);
}

.doc-toc-toggle {
	display: none;
}

.doc-toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line-strong);
}

.doc-toc a {
	position: relative;
	display: flex;
	gap: 0.85rem;
	align-items: baseline;
	padding: 0.55rem 0 0.55rem 0;
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.9375rem;
	line-height: 1.35;
	text-decoration: none;
	transition: color 0.2s ease, padding-left 0.3s var(--ease);
}

.doc-toc a:hover,
.doc-toc a:focus-visible {
	color: var(--ink);
}

.doc-toc a[aria-current="true"] {
	padding-left: 0.75rem;
	color: var(--ink);
	font-weight: 600;
}

.doc-toc a[aria-current="true"]::before {
	position: absolute;
	top: 0.6rem;
	bottom: 0.6rem;
	left: 0;
	width: 2px;
	background: var(--accent);
	content: "";
}

.doc-toc a[aria-current="true"] .num {
	color: var(--accent);
}

/* ----------------------------------------------------------------- Content */

.doc-content {
	min-width: 0;
	padding: clamp(2.5rem, 5vw, 4.5rem) 0 4rem clamp(2rem, 5vw, 5rem);
}

.doc-content > * {
	max-width: 46rem;
}

.doc-intro {
	padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.doc-kicker {
	display: flex;
	gap: 0.6em;
	align-items: center;
	margin: 0;
	color: var(--muted);
}

.doc-title {
	margin: 1.25rem 0 0;
	font-size: clamp(2.75rem, 6.5vw, 5.25rem);
	font-weight: 700;
	letter-spacing: -0.055em;
	line-height: 0.92;
}

.doc-title em {
	display: block;
	font-family: var(--serif);
	font-style: italic;
	font-weight: 400;
	letter-spacing: -0.03em;
}

.doc-lead {
	margin: 1.75rem 0 0;
	color: var(--muted);
	font-size: 1.1875rem;
	line-height: 1.6;
}

.doc-section {
	padding-block: 2.75rem 1rem;
	border-top: 1px solid var(--line-strong);
}

.doc-section__num {
	margin: 0;
}

.doc-section h2 {
	margin: 0.5rem 0 1.25rem;
	font-size: clamp(1.85rem, 3.4vw, 2.6rem);
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1.05;
}

.doc-section h3 {
	margin: 2.25rem 0 0.6rem;
	font-size: 1.1875rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.3;
}

.doc-section p,
.doc-section ul,
.doc-section ol {
	margin: 0 0 1.1rem;
}

.doc-section ul {
	padding-left: 1.15rem;
}

.doc-section ul li::marker {
	color: var(--accent);
}

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

.doc-section a:not(.link-line) {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.doc-section a:not(.link-line):hover {
	color: var(--ink);
}

strong {
	font-weight: 600;
}

.steps {
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps li {
	position: relative;
	padding: 0.6rem 0 0.6rem 2.6rem;
	border-top: 1px solid var(--line);
	counter-increment: step;
}

.steps li:last-child {
	border-bottom: 1px solid var(--line);
}

.steps li + li {
	margin-top: 0;
}

.steps li > strong:first-child {
	display: block;
}

.shot {
	margin: 0.9rem 0 1.4rem;
}

.shot a {
	display: block;
}

.shot img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--line);
	background: var(--surface);
}

.shot figcaption {
	margin-top: 0.45rem;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.02em;
}

.result {
	padding: 0.75rem 1rem;
	border-left: 1px solid var(--line-strong);
	background: var(--surface);
}

.steps li::before {
	position: absolute;
	top: 0.85rem;
	left: 0;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.75rem;
	content: counter(step, decimal-leading-zero);
}

code {
	padding: 0.1em 0.35em;
	border: 1px solid var(--line);
	background: var(--surface);
	font-family: var(--mono);
	font-size: 0.85em;
	overflow-wrap: anywhere;
}

.note {
	padding: 0.9rem 1.1rem;
	border-left: 2px solid var(--accent);
	background: var(--surface);
	font-size: 0.975rem;
}

.table-wrap {
	max-width: 100%;
	margin: 0 0 1.25rem;
	overflow-x: auto;
	border: 1px solid var(--line);
	background: var(--surface);
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.55;
}

th,
td {
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

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

th {
	color: var(--muted);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
}

td:first-child {
	font-weight: 600;
	white-space: nowrap;
}

.faq {
	padding-top: 0.25rem;
}

.faq + .faq {
	border-top: 1px solid var(--line);
}

.faq h3 {
	margin-top: 1.25rem;
}

.doc-support-link a:not([data-configured]) {
	display: none;
}

.doc-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	align-items: center;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line-strong);
}

.doc-footer__copy {
	margin: 0 0 0 auto;
	color: var(--muted);
}

/* -------------------------------------------------------------- Responsive */

@media (max-width: 63.99rem) {
	.doc-layout {
		display: block;
		padding-inline: 0;
	}

	.doc-sidebar {
		z-index: 30;
		height: auto;
		max-height: calc(100vh - var(--header-h));
		padding: 0 var(--pad);
		border-right: 0;
		border-bottom: 1px solid var(--line);
		background: var(--paper);
	}

	.js .doc-toc-toggle {
		display: flex;
		gap: 0.75rem;
		align-items: center;
		width: 100%;
		min-height: 3rem;
		padding: 0;
		border: 0;
		color: var(--ink);
		background: none;
		font: 600 0.6875rem/1.2 var(--sans);
		letter-spacing: 0.12em;
		text-align: left;
		text-transform: uppercase;
		cursor: pointer;
	}

	.doc-toc-toggle__current {
		overflow: hidden;
		color: var(--muted);
		font-family: var(--serif);
		font-size: 0.95rem;
		font-style: italic;
		font-weight: 400;
		letter-spacing: 0;
		text-overflow: ellipsis;
		text-transform: none;
		white-space: nowrap;
	}

	.doc-toc-toggle__icon {
		position: relative;
		flex: none;
		width: 0.75rem;
		height: 0.75rem;
		margin-left: auto;
	}

	.doc-toc-toggle__icon::before,
	.doc-toc-toggle__icon::after {
		position: absolute;
		top: 50%;
		left: 0;
		width: 100%;
		height: 1px;
		background: currentColor;
		content: "";
		transition: transform 0.3s var(--ease);
	}

	.doc-toc-toggle__icon::after {
		transform: rotate(90deg);
	}

	.doc-toc-toggle[aria-expanded="true"] .doc-toc-toggle__icon::after {
		transform: rotate(0deg);
	}

	.js .doc-toc {
		display: none;
		max-height: calc(100vh - var(--header-h) - 3rem);
		overflow-y: auto;
		padding-bottom: 1.25rem;
	}

	.js .doc-toc.is-open {
		display: block;
	}

	html:not(.js) .doc-sidebar {
		position: static;
		max-height: none;
		padding-block: 1.5rem;
	}

	.doc-content {
		padding: 2.5rem var(--pad) 3rem;
	}

	.doc-content > * {
		max-width: 46rem;
		margin-inline: auto;
	}
}

@media (max-width: 35.99rem) {
	body {
		font-size: 1rem;
	}

	.doc-header__version {
		display: none;
	}

	.doc-brand__label {
		font-size: 0.95rem;
	}

	.doc-lead {
		font-size: 1.0625rem;
	}

	th,
	td {
		padding: 0.6rem 0.7rem;
	}

	td:first-child {
		white-space: normal;
	}

	.doc-footer__copy {
		margin-left: 0;
	}
}

@media print {
	.doc-header,
	.doc-sidebar,
	.skip-link {
		display: none;
	}

	.doc-layout {
		display: block;
	}

	.doc-content {
		padding: 0;
	}
}
