/* PayMe Legal — "The Clear Counter"
 * Design tokens mirrored from web-dashboard/DESIGN.md.
 * Hand-written CSS: this site has no build step and ships no JavaScript. */

/* ---------- Fonts (self-hosted: no third-party CDN request from a privacy page) ---------- */
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('./fonts/poppins-latin-400-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('./fonts/poppins-latin-500-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('./fonts/poppins-latin-600-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('./fonts/poppins-latin-700-normal.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
	--navy-ink: #06283d;
	--navy-deep: #041c2b;
	--action-blue: #2d69f5;
	--sky-info: #59c1f8;
	--success-green: #16b364;
	--warning-amber: #fb9c0c;
	--error-red: #f04438;

	--canvas: #f4f6fa;
	--paper: #ffffff;
	--tile: #f1f5fa;
	--ink-text: #212636;
	--slate-text: #667085;
	--hairline: #dcdfe4;

	--heading: var(--navy-ink);
	--link: var(--action-blue);

	--radius-sm: 8px;
	--radius-md: 10px;
	--radius-lg: 18px;
	--radius-xl: 20px;

	--shadow-card: 0 5px 22px 0 rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.06);
	--shadow-whisper: 0 1px 2px rgba(12, 36, 56, 0.04);

	--measure: 72ch;
	--gutter: 24px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--canvas: #090a0b;
		--paper: #121517;
		--tile: #1a1f23;
		--ink-text: #e7eaee;
		--slate-text: #9aa4b2;
		--hairline: #262b30;

		--heading: #f2f5f8;
		--link: #7ba1ff;

		--shadow-card: 0 5px 22px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.07);
		--shadow-whisper: 0 1px 2px rgba(0, 0, 0, 0.3);
	}
}

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

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--canvas);
	color: var(--ink-text);
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

:focus-visible {
	outline: 2px solid var(--action-blue);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Skip link — keyboard users shouldn't tab through the whole ToC to reach the text. */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 10px 18px;
	background: var(--navy-ink);
	color: #fff;
	border-radius: var(--radius-md);
	font-weight: 600;
}

.skip-link:focus {
	left: 16px;
	top: 16px;
	text-decoration: none;
}

/* ---------- Top bar + hero share one paper surface (no grey/white seam) ---------- */
.band {
	background: var(--paper);
}

.band--ruled {
	border-bottom: 1px solid var(--hairline);
}

.wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 64px;
}

.topbar__logo {
	display: flex;
	align-items: center;
}

.topbar__logo img {
	height: 26px;
	width: auto;
	display: block;
}

.topbar__logo img.logo--dark {
	display: none;
}

@media (prefers-color-scheme: dark) {
	.topbar__logo img.logo--light {
		display: none;
	}
	.topbar__logo img.logo--dark {
		display: block;
	}
}

.topbar__nav {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.topbar__nav a {
	padding: 8px 12px;
	border-radius: var(--radius-md);
	color: var(--slate-text);
	font-size: 0.875rem;
	font-weight: 500;
	transition: background-color 180ms ease, color 180ms ease;
}

.topbar__nav a:hover {
	background: var(--tile);
	color: var(--ink-text);
	text-decoration: none;
}

.topbar__nav a[aria-current='page'] {
	color: var(--heading);
	font-weight: 600;
}

/* ---------- Hero ---------- */
.hero {
	padding: 40px 0 44px;
}

.hero__back {
	display: inline-block;
	margin-bottom: 16px;
	font-size: 0.875rem;
	font-weight: 500;
}

.hero h1 {
	margin: 0;
	color: var(--heading);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.hero__lede {
	margin: 12px 0 0;
	max-width: var(--measure);
	color: var(--slate-text);
	font-size: 1rem;
}

.hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin-top: 20px;
	font-size: 0.8125rem;
	color: var(--slate-text);
}

.hero__meta strong {
	color: var(--ink-text);
	font-weight: 600;
}

/* ---------- Layout: sticky contents rail + document ---------- */
.main {
	padding: 32px 0 72px;
}

.layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

@media (max-width: 900px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
}

.toc {
	position: sticky;
	top: 24px;
	font-size: 0.875rem;
}

@media (max-width: 900px) {
	.toc {
		position: static;
		background: var(--paper);
		border-radius: var(--radius-lg);
		box-shadow: var(--shadow-card);
		padding: 16px 18px;
	}
}

.toc__title {
	margin: 0 0 10px;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 2.5;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--slate-text);
}

.toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: toc;
}

.toc li {
	counter-increment: toc;
}

.toc a {
	display: block;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	color: var(--slate-text);
	line-height: 1.4;
	transition: background-color 180ms ease, color 180ms ease;
}

.toc a::before {
	content: counter(toc) '. ';
	color: var(--slate-text);
	opacity: 0.6;
}

.toc a:hover {
	background: var(--tile);
	color: var(--ink-text);
	text-decoration: none;
}

/* ---------- Document card ---------- */
.doc {
	background: var(--paper);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-card);
	padding: 40px;
}

@media (max-width: 600px) {
	.doc {
		padding: 24px 20px;
		border-radius: var(--radius-lg);
	}
}

.doc > *:first-child {
	margin-top: 0;
}

.doc > *:last-child {
	margin-bottom: 0;
}

.doc section {
	scroll-margin-top: 24px;
}

.doc section + section {
	margin-top: 40px;
	padding-top: 40px;
	border-top: 1px solid var(--hairline);
}

.doc h2 {
	margin: 0 0 16px;
	color: var(--heading);
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.doc h3 {
	margin: 28px 0 10px;
	color: var(--heading);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.doc p,
.doc li {
	max-width: var(--measure);
}

.doc p {
	margin: 0 0 14px;
}

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

.doc li {
	margin-bottom: 8px;
}

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

.doc strong {
	font-weight: 600;
	color: var(--ink-text);
}

.doc hr {
	border: 0;
	border-top: 1px solid var(--hairline);
	margin: 32px 0;
}

/* ---------- Data tables (what we collect / who we share with) ---------- */
.table-scroll {
	overflow-x: auto;
	margin: 0 0 16px;
	border-radius: var(--radius-md);
	border: 1px solid var(--hairline);
}

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

thead th {
	background: var(--tile);
	color: var(--slate-text);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-align: left;
	padding: 10px 14px;
	white-space: nowrap;
	border-bottom: 1px solid var(--hairline);
}

tbody td {
	padding: 12px 14px;
	vertical-align: top;
	border-bottom: 1px solid var(--hairline);
}

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

tbody td:first-child {
	font-weight: 600;
	color: var(--ink-text);
	white-space: nowrap;
}

/* ---------- Callouts ---------- */
.note {
	background: var(--tile);
	border-radius: var(--radius-md);
	padding: 16px 18px;
	margin: 0 0 16px;
	box-shadow: var(--shadow-whisper);
}

.note p:last-child {
	margin-bottom: 0;
}

.note__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--slate-text);
}

/* ---------- TODO placeholder: deliberately impossible to miss ----------
 * These mark facts that were not verifiable from the codebase (KVK, address,
 * VAT, phone). scripts/check-placeholders.sh fails if any survive to go-live. */
.todo {
	display: inline-block;
	background: var(--warning-amber);
	color: #2b1a00;
	font-weight: 600;
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
	padding: 1px 8px;
	border-radius: 6px;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

.todo::before {
	content: '⚠ TODO — ';
	font-weight: 700;
}

/* ---------- Contact block ---------- */
.contact {
	background: var(--tile);
	border-radius: var(--radius-lg);
	padding: 20px 22px;
	box-shadow: var(--shadow-whisper);
}

.contact dl {
	display: grid;
	grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
	gap: 8px 20px;
	margin: 0;
	font-size: 0.9375rem;
}

@media (max-width: 520px) {
	.contact dl {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}
	.contact dd {
		margin-bottom: 10px;
	}
}

.contact dt {
	color: var(--slate-text);
	font-weight: 500;
}

.contact dd {
	margin: 0;
	color: var(--ink-text);
	font-weight: 600;
}

/* ---------- Index page cards ---------- */
.doc-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.doc-card {
	display: block;
	height: 100%;
	background: var(--paper);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	padding: 24px;
	color: inherit;
	transition: transform 180ms ease;
}

.doc-card:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

.doc-card h2 {
	margin: 0 0 8px;
	color: var(--heading);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.doc-card p {
	margin: 0 0 14px;
	color: var(--slate-text);
	font-size: 0.875rem;
	line-height: 1.57;
}

.doc-card__cta {
	color: var(--link);
	font-size: 0.875rem;
	font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
	border-top: 1px solid var(--hairline);
	background: var(--paper);
	padding: 28px 0;
}

.footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.8125rem;
	color: var(--slate-text);
}

.footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
}

/* ---------- Print: legal documents get saved as PDF ---------- */
@media print {
	:root {
		--canvas: #fff;
		--paper: #fff;
		--shadow-card: none;
	}

	.topbar__nav,
	.toc,
	.skip-link,
	.hero__back {
		display: none;
	}

	body {
		font-size: 11pt;
	}

	.doc {
		padding: 0;
		box-shadow: none;
	}

	.layout {
		grid-template-columns: 1fr;
	}

	.doc section {
		break-inside: avoid-page;
	}

	a[href^='http']::after {
		content: ' (' attr(href) ')';
		font-size: 0.85em;
		color: #555;
	}

	.todo {
		border: 1px solid #000;
	}
}
