/* Tau — site stylesheet.
   Overrides mofo's built-in CSS. No external requests: system fonts only,
   syntax colours applied to classes baked in at build time. */

:root {
	color-scheme: light dark;

	--ink: #16181d;
	--ink-soft: #4a5058;
	--ink-faint: #767d87;
	--paper: #fbfaf8;
	--paper-2: #f3f1ec;
	--paper-3: #eae7e0;
	--line: #e0dcd3;
	--line-strong: #cfc9bd;

	--accent: #0e7c66;
	--accent-2: #b45309;
	--accent-soft: rgba(14, 124, 102, 0.10);

	--code-bg: #f7f5f1;
	--code-line: #e5e1d8;

	--t-com: #8b8f8a;
	--t-kw: #7c3aed;
	--t-bi: #0e7490;
	--t-fn: #1d4ed8;
	--t-str: #15803d;
	--t-num: #b45309;
	--t-const: #b91c1c;
	--t-fld: #92400e;
	--t-op: #5b6069;
	--t-pun: #8d9199;
	--t-id: #23262c;
	--t-shp: #0e7c66;

	--sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif Pro", Georgia, serif;
	--mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "DejaVu Sans Mono", monospace;

	--measure: 44rem;
	--wide: 62rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ink: #e7e5e0;
		--ink-soft: #a8aab0;
		--ink-faint: #7e828b;
		--paper: #101216;
		--paper-2: #161920;
		--paper-3: #1c202a;
		--line: #262b35;
		--line-strong: #333a47;

		--accent: #3fd0a8;
		--accent-2: #f0b160;
		--accent-soft: rgba(63, 208, 168, 0.12);

		--code-bg: #14171d;
		--code-line: #242a34;

		--t-com: #6a727f;
		--t-kw: #c792ea;
		--t-bi: #56b6c2;
		--t-fn: #7cb1f5;
		--t-str: #9ece6a;
		--t-num: #e0a072;
		--t-const: #f07178;
		--t-fld: #e5c07b;
		--t-op: #9aa1ad;
		--t-pun: #737b88;
		--t-id: #dcdfe4;
		--t-shp: #3fd0a8;
	}
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	letter-spacing: 0.005em;
	text-rendering: optimizeLegibility;
}

.container {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0 1.75rem 5rem;
}

/* prose keeps a comfortable measure, code and cards may run wider */
.container > p,
.container > ul,
.container > ol,
.container > blockquote,
.container > h1,
.container > h2,
.container > h3,
.container > h4,
.note,
.toc,
.lede { max-width: var(--measure); }

pre.code { max-width: 52rem; }

/* ---------- navigation ---------- */

.nav {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 1.4rem 0 2.6rem;
	display: flex;
	align-items: baseline;
	gap: 1.25rem;
	flex-wrap: wrap;
	font-size: 0.94rem;
}

.nav .brand {
	font-family: var(--serif);
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-right: auto;
	color: var(--ink);
	text-decoration: none;
}

.nav .brand span { color: var(--accent); }

.nav a {
	color: var(--ink-soft);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding-bottom: 2px;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a.is-current { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- headings and text ---------- */

h1, h2, h3, h4 {
	font-family: var(--serif);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.2;
	color: var(--ink);
}

h1 { font-size: 2.4rem; margin: 2.2rem 0 1rem; }
h2 {
	font-size: 1.6rem;
	margin: 3.2rem 0 0.9rem;
	padding-top: 1.4rem;
	border-top: 1px solid var(--line);
}
h3 { font-size: 1.18rem; margin: 2.1rem 0 0.6rem; }
h4 { font-size: 1rem; margin: 1.6rem 0 0.4rem; }

h2 + h3 { margin-top: 1.2rem; }

p { margin: 0 0 1.1rem; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

strong { font-weight: 650; }

ul, ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--ink-faint); }

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

blockquote {
	margin: 1.5rem 0;
	padding: 0.2rem 0 0.2rem 1.1rem;
	border-left: 2px solid var(--accent);
	color: var(--ink-soft);
	font-family: var(--serif);
	font-size: 1.05rem;
}

.lede {
	font-size: 1.12rem;
	color: var(--ink-soft);
}

.note {
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-left: 2px solid var(--accent);
	border-radius: 0 6px 6px 0;
	padding: 0.9rem 1.1rem;
	margin: 1.6rem 0;
	font-size: 0.95rem;
	color: var(--ink-soft);
}

.note b, .note strong { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
	max-width: var(--wide);
	margin: 0 auto 1rem;
	padding: 1rem 0 0.5rem;
}

.hero .glyph {
	font-family: var(--serif);
	font-size: 4.5rem;
	line-height: 1;
	color: var(--accent);
	display: block;
	margin-bottom: 0.6rem;
}

.hero h1 {
	font-size: clamp(2.2rem, 6vw, 3.4rem);
	margin: 0 0 0.8rem;
	max-width: 20ch;
}

.hero .sub {
	font-size: 1.15rem;
	color: var(--ink-soft);
	max-width: 54ch;
	margin: 0 0 1.8rem;
}

.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 2.4rem; }

.btn {
	display: inline-block;
	padding: 0.55rem 1.1rem;
	border-radius: 6px;
	border: 1px solid var(--line-strong);
	color: var(--ink);
	background: var(--paper-2);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 550;
}

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

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

.btn.primary:hover { filter: brightness(1.08); color: var(--paper); }

/* ---------- feature grid ---------- */

.features {
	max-width: var(--wide);
	margin: 2.2rem auto 1rem;
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.feature {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--paper-2);
	padding: 1.1rem 1.2rem;
}

.feature h3 {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
	font-family: var(--sans);
	font-weight: 650;
	letter-spacing: 0;
}

.feature h3::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	margin-right: 0.55rem;
	vertical-align: middle;
}

.feature p { margin: 0; font-size: 0.94rem; color: var(--ink-soft); }

.hero, .features, .nav { width: 100%; max-width: var(--wide); }

/* ---------- code ---------- */

pre.code {
	margin: 1.4rem 0;
	padding: 0;
	border: 1px solid var(--code-line);
	border-radius: 8px;
	background: var(--code-bg);
	overflow: hidden;
	font-family: var(--mono);
	font-size: 0.875rem;
	line-height: 1.62;
	tab-size: 4;
	-moz-tab-size: 4;
}

pre.code[data-label]::before {
	content: attr(data-label);
	display: block;
	font-size: 0.76rem;
	letter-spacing: 0.06em;
	text-transform: lowercase;
	color: var(--ink-faint);
	padding: 0.45rem 0.95rem;
	border-bottom: 1px solid var(--code-line);
	background: var(--paper-2);
}

/* the scroll lives on the code element, so wide lines never move the page
   and never move the label either */
pre.code > code {
	display: block;
	overflow-x: auto;
	padding: 0.95rem 1.1rem;
	font-family: inherit;
	font-size: inherit;
	background: none;
}

p code, li code, td code, h3 code, h2 code, .note code {
	font-family: var(--mono);
	font-size: 0.86em;
	background: var(--accent-soft);
	color: var(--ink);
	padding: 0.1em 0.35em;
	border-radius: 4px;
}

.t-com  { color: var(--t-com); font-style: italic; }
.t-kw   { color: var(--t-kw); }
.t-bi   { color: var(--t-bi); }
.t-fn   { color: var(--t-fn); }
.t-str  { color: var(--t-str); }
.t-num  { color: var(--t-num); }
.t-const{ color: var(--t-const); }
.t-fld  { color: var(--t-fld); }
.t-op   { color: var(--t-op); }
.t-pun  { color: var(--t-pun); }
.t-id   { color: var(--t-id); }
.t-interp { color: var(--accent-2); }
.t-sh-p { color: var(--t-shp); user-select: none; }
.t-sh-cmd { color: var(--t-id); }
.t-sh-out { color: var(--ink-faint); }

/* ---------- tables ---------- */

.table-wrap, table { display: block; overflow-x: auto; }

table {
	border-collapse: collapse;
	width: 100%;
	margin: 1.4rem 0;
	font-size: 0.93rem;
}

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

th { font-weight: 650; color: var(--ink); border-bottom-color: var(--line-strong); }

/* ---------- steps ---------- */

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

.steps > li {
	counter-increment: step;
	padding-left: 2.2rem;
	position: relative;
	margin-bottom: 0.6rem;
}

.steps > li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0.05rem;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 0.8rem;
	font-weight: 650;
	display: grid;
	place-items: center;
}

/* ---------- table of contents ---------- */

.toc {
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 1rem 1.2rem;
	margin: 1.8rem 0 2.4rem;
	background: var(--paper-2);
	font-size: 0.94rem;
}

.toc-title {
	font-family: var(--mono);
	font-size: 0.74rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin-bottom: 0.5rem;
}

.toc ul { columns: 2; column-gap: 2rem; margin: 0; padding-left: 1.1rem; }

@media (max-width: 34rem) {
	.toc ul { columns: 1; }
}

/* ---------- footer ---------- */

.footer {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 1.5rem;
	color: var(--ink-faint);
	font-size: 0.85rem;
	border-top: 1px solid var(--line);
	text-align: center;
}

.pagenav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.2rem;
	border-top: 1px solid var(--line);
	font-size: 0.94rem;
}

@media (max-width: 40rem) {
	body { font-size: 16px; }
	.container { padding: 0 1.1rem 3rem; }
	h1 { font-size: 2rem; }
	h2 { font-size: 1.4rem; }
}
