/* Shared stylesheet for jantinebroek.me */

:root {
	--bg: #fafaf9;
	--card: #ffffff;
	--text: #1a1b19;
	--muted: #5f625d;
	--rule: #e2e3df;
	--accent: #4d699b;
	--accent-hover: #364a6d;
	--accent-2: #b0601f;
	--node: #4d699b;
	--line: rgba(77, 105, 155, 0.25);
	--code-bg: #efefec;
	--serif: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;  /* body text */
	--sans: var(--serif);
	--mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;  /* name, small labels and numbers */
	--wide: 68rem;
	--measure: 42rem;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #141513;
		--card: #1b1c19;
		--text: #ece7dc;
		--muted: #a39d91;
		--rule: #2d2e2a;
		--accent: #7e9cd8;
		--accent-hover: #abbfe6;
		--accent-2: #ffa066;
		--node: #7e9cd8;
		--line: rgba(126, 156, 216, 0.25);
		--code-bg: #23241f;
	}
}

:root[data-theme="dark"] {
	--bg: #141513;
	--card: #1b1c19;
	--text: #ece7dc;
	--muted: #a39d91;
	--rule: #2d2e2a;
	--accent: #7e9cd8;
	--accent-hover: #abbfe6;
	--accent-2: #ffa066;
	--node: #7e9cd8;
	--line: rgba(126, 156, 216, 0.25);
	--code-bg: #23241f;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--serif);
	font-size: 1.0625rem;
	line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

/* ---------- Page frame ---------- */

.wrap {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0 1.5rem;
}

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	padding: 1.75rem 0;
	font-family: var(--sans);
}

.site-name {
	font-weight: 650;
	letter-spacing: -0.01em;
	color: var(--text);
	text-decoration: none;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	font-size: 0.95rem;
	color: var(--muted);
	text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

.site-nav a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-color: var(--accent-2);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.4em;
}

.site-footer {
	margin-top: 5rem;
	padding: 1.5rem 0 3rem;
	border-top: 1px solid var(--rule);
	font-family: var(--sans);
	font-size: 0.85rem;
	color: var(--muted);
}

.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0 0 0.5rem;
	padding: 0;
	list-style: none;
}

.site-footer p { margin: 0; }

/* ---------- Shared pieces ---------- */

h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; }

.label {
	margin: 4rem 0 1.25rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
	font-family: var(--sans);
	font-size: 0.78rem;
	font-weight: 650;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent-2);
}

.links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--sans);
	font-size: 0.95rem;
}

.more { font-family: var(--sans); font-size: 0.95rem; }

.page-title {
	margin: 3rem 0 1rem;
	font-size: clamp(2rem, 4vw, 2.8rem);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.page-title em { color: var(--accent); }

.page-intro {
	max-width: var(--measure);
	margin: 0 0 1rem;
	color: var(--muted);
}

/* ---------- Homepage ---------- */

.hero {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 2rem;
	align-items: center;
	padding: 3rem 0 2rem;
}

.hero h1 {
	margin: 0 0 1.5rem;
	font-size: clamp(2.1rem, 4.4vw, 3.4rem);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.02em;
}

.hero h1 em { color: var(--accent); }

.hero p {
	max-width: 34rem;
	margin: 0 0 1.25rem;
	color: var(--muted);
}

.hero svg { display: block; width: 100%; height: auto; }

/* Picture cards (writing) */
.cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
}

.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: 10px;
	color: var(--text);
	text-decoration: none;
	transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

.card .thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	background: #fff;
	border-bottom: 1px solid var(--rule);
}

.card .thumb img { max-width: 88%; max-height: 85%; }

.card .card-title {
	padding: 0.9rem 1rem 1.1rem;
	font-weight: 600;
	line-height: 1.3;
}

.card .card-meta {
	display: block;
	margin-top: 0.35rem;
	font-family: var(--sans);
	font-size: 0.8rem;
	font-weight: 400;
	color: var(--muted);
}

/* Learning-path teaser */
.learn-teaser p { max-width: var(--measure); margin: 0; }
.learn-teaser .route { margin-bottom: 0; }

/* ---------- Publications ---------- */

.pubs { margin: 0; padding: 0; list-style: none; }

.pubs li {
	display: grid;
	grid-template-columns: 4rem 1fr;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.pubs .year {
	padding-top: 0.15rem;
	font-family: var(--sans);
	font-size: 0.9rem;
	color: var(--muted);
}

.pubs .pub-title { display: block; }
.pubs .authors { display: block; font-size: 0.9rem; color: var(--muted); }
.pubs .authors strong { color: var(--text); font-weight: 600; }
.pubs .venue { display: block; font-size: 0.9rem; font-style: italic; color: var(--muted); }

/* ---------- Articles (explainers) ---------- */

.article {
	max-width: var(--measure);
	margin: 0 auto;
}

.article header { margin: 3rem 0 2rem; }

.article .series {
	margin: 0 0 0.5rem;
	font-family: var(--sans);
	font-size: 0.8rem;
	font-weight: 650;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent-2);
}

.article h1 {
	margin: 0 0 0.75rem;
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.12;
}

.article .byline {
	margin: 0;
	font-family: var(--sans);
	font-size: 0.9rem;
	color: var(--muted);
}

.article h2 { margin: 2.5rem 0 0.75rem; font-size: 1.45rem; }
.article h3 { margin: 2rem 0 0.5rem; font-size: 1.2rem; }

.article .term { color: var(--accent); font-weight: 600; }

.article figure { margin: 2rem 0; }

.article figure img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	padding: 0.75rem;
	background: #fff;
	border-radius: 6px;
}

.article figcaption {
	margin-top: 0.6rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.article img { max-width: 100%; height: auto; }

.article .further {
	margin-top: 3rem;
	padding: 1.25rem 1.5rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: 10px;
}

.article .further h2 {
	margin: 0 0 0.5rem;
	font-family: var(--sans);
	font-size: 0.85rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.article .further ul { margin: 0; padding-left: 1.2rem; }

.series-nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
	font-family: var(--sans);
	font-size: 0.95rem;
}

.series-nav .next { margin-left: auto; text-align: right; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
	.hero { grid-template-columns: 1fr; }
	.hero svg { max-width: 340px; margin: 0 auto; }
	.cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
	body { font-size: 1.0625rem; }
	.wrap { padding: 0 1rem; }
	.cards { grid-template-columns: 1fr; }
	.pubs li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* Explainer details */
.article .equation { display: block; margin: 1.25rem 0; text-align: center; }
.article .equation img { max-width: 100%; height: auto; background: #fff; padding: 0.5rem; border-radius: 6px; }
.article .caution { color: var(--accent-2); }

.page-outro { margin-top: 3rem; }

/* ---------- Learning path ---------- */

/* Route map: shared stages, then one row per track, then extras */
.route {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 0.4rem;
	margin: 1.5rem 0 2rem;
	font-family: var(--sans);
	font-size: 0.9rem;
}

.route .branch {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-left: 0.2rem;
	padding-left: 0.8rem;
	border-left: 2px solid var(--muted);
}

.branch-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
}

.route-extra {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.4rem;
	margin-left: auto;
}

.route .chip {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.86rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--text);
	text-decoration: none;
}

.route .chip:hover { border-color: var(--accent); }
.route .chip[aria-current="page"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.route .arrow { color: var(--muted); }

.route .chip b,
.num {
	display: inline-grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--accent);
	color: var(--bg);
	font-family: var(--sans);
	font-size: 0.8rem;
}

.route .chip.base b,
.num.base {
	background: var(--bg);
	border: 1.5px solid var(--text);
	color: var(--text);
}

.route .chip.alt b,
.num.alt { background: var(--accent-2); }

.route .chip.extra b,
.num.extra { background: var(--muted); }

.stage-card .card-track {
	margin: -0.3rem 0 0;
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 650;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

/* Overview: one card per stage */
.stage-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

.stage-card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.1rem 1.2rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: 12px;
}

.stage-card h2 {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
	font-size: 1.3rem;
	font-weight: 500;
}

.stage-card > p { margin: 0; font-size: 1rem; color: var(--muted); }

.stage-card .meta-row {
	margin: 0;
	font-family: var(--sans);
	font-size: 0.85rem;
	color: var(--text);
}

.meta-row .k,
.ready-label {
	display: block;
	margin-bottom: 0.15rem;
	font-family: var(--sans);
	font-size: 0.7rem;
	font-weight: 650;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--sans);
	font-size: 0.78rem;
}

.chips li {
	padding: 0.15rem 0.6rem;
	background: var(--bg);
	border: 1px solid var(--rule);
	border-radius: 999px;
}

.stage-card .open {
	margin-top: auto;
	font-family: var(--sans);
	font-size: 0.9rem;
	font-weight: 600;
}

/* Stage page */
.crumb { margin: 2rem 0 0; font-family: var(--sans); font-size: 0.85rem; }
.stage-no { color: var(--muted); }

.subject details summary {
	padding: 0.45rem 0;
	cursor: pointer;
	font-family: var(--sans);
	font-size: 0.85rem;
	color: var(--accent);
}

.ready {
	margin: 1.5rem 0 0;
	padding: 0.7rem 1rem;
	background: var(--card);
	border-left: 3px solid var(--accent);
	font-size: 1rem;
}

.ready .ready-label { color: var(--accent); }

.syllabus {
	columns: 2;
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.syllabus li {
	position: relative;
	padding: 0.3rem 0 0.3rem 1.6rem;
	break-inside: avoid;
}

.syllabus li::before {
	content: "";
	position: absolute;
	top: 0.8rem;
	left: 0.25rem;
	width: 0.45rem;
	height: 0.45rem;
	background: var(--accent);
	border-radius: 50%;
}

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

.level {
	margin-left: 0.4rem;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-family: var(--sans);
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	vertical-align: 0.15em;
	white-space: nowrap;
}

.level-essential { background: var(--accent); color: var(--bg); }
.level-optional { border: 1px solid var(--rule); color: var(--muted); }

.subject { margin: 0 0 2rem; scroll-margin-top: 1rem; }
.subject h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }

.subject .covers { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--muted); }

.subject .covers span {
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text);
}

.rows {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--rule);
}

.rows li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--rule);
	font-size: 1rem;
}

.rows .name { flex: 1; }
.rows .why { display: block; margin-top: 0.15rem; font-size: 0.92rem; color: var(--muted); }

.rows .t {
	flex: 0 0 auto;
	max-width: 40%;
	font-family: var(--sans);
	font-size: 0.75rem;
	text-align: right;
	color: var(--muted);
}

.rows .rec .name > a { font-weight: 600; }
.rows .star { color: var(--accent-2); }

.pager {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
	font-family: var(--sans);
}

.pager .prev,
.pager .next { display: flex; flex-direction: column; gap: 0.4rem; }
.pager .next { margin-left: auto; align-items: flex-end; text-align: right; }

@media (max-width: 760px) {
	.stage-cards { grid-template-columns: 1fr; }
	.syllabus { columns: 1; }
	.route-extra { justify-content: flex-start; }
	.rows li { flex-direction: column; gap: 0.15rem; }
	.rows .t { max-width: none; text-align: left; }
}

/* Links to other websites open in a new tab */
a.ext::after {
	content: "\00a0↗" / " (opens in a new tab)";
	font-family: var(--sans);
	font-size: 0.8em;
	text-decoration: none;
	display: inline-block;
	color: var(--muted);
}

/* Route map on narrow screens: a vertical list, tracks indented */
@media (max-width: 760px) {
	.route { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
	.route .arrow { display: none; }
	.route .branch { margin-left: 0.6rem; gap: 0.6rem; }
	.branch-row { flex-direction: column; align-items: flex-start; }
	.route-extra { justify-content: flex-start; margin-top: 0.4rem; }
}

/* Proof-based vs practical labels on maths resources */
.style {
	display: inline-block;
	margin-right: 0.4rem;
	padding: 0 0.4rem;
	border-radius: 4px;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.style-proof { background: var(--accent); color: var(--bg); }
.style-practical { border: 1px solid var(--muted); color: var(--muted); }

.style-legend {
	margin: -0.4rem 0 1.4rem;
	font-family: var(--sans);
	font-size: 0.8rem;
	color: var(--muted);
}

/* Going deeper: flow diagram of the mathematical foundations */
.flow-intro { margin: 0 0 1rem; font-size: 1rem; color: var(--muted); max-width: var(--measure); }
.flow-wrap { overflow-x: auto; margin: 0 0 2.5rem; }
.flow { display: block; width: 100%; min-width: 760px; height: auto; }
.flow-node { fill: var(--card); stroke: var(--accent); stroke-width: 1.5; }
.flow a:hover .flow-node { fill: var(--bg); stroke-width: 2.5; }
.flow-label { fill: var(--text); font-family: var(--sans); font-size: 13px; }
.flow-edge { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.flow-arrowhead { fill: var(--muted); }

.specialist { margin: 0 0 1rem; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.specialist li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.specialist .builds-on { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); text-align: right; }

.group-title {
	margin: 2.2rem 0 1rem;
	font-family: var(--sans);
	font-size: 0.85rem;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}

@media (max-width: 760px) {
	.specialist li { flex-direction: column; gap: 0.1rem; }
	.specialist .builds-on { text-align: left; }
}

.stage-card .card-more { margin: 0; font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }

/* ---------- Monospace for the name, small labels and numbers ---------- */

.site-name, .label, .card .card-meta, .pubs .year, .rows .t, .level, .crumb, .stage-no, .num, .route .chip b, .article .series, .article .byline {
	font-family: var(--mono);
	letter-spacing: 0;
}
.site-name { font-weight: 500; }
