/*
 * wsminer.com -- the one stylesheet every page links.
 *
 * Colors are the Personal app's semantic palette
 * (src/common/theme/ThemeProvider.tsx), so the site and the app look related.
 * Sizes follow the app's 4-point scale and type steps (src/common/theme/tokens.ts).
 */

:root {
	color-scheme: light dark;

	/* Light palette (ThemeProvider light) */
	--background: #ffffff;
	--surface: #f2f2f7;
	--text: #000000;
	--text-secondary: #3c3c4399;
	--separator: #c6c6c8;
	--accent: #007aff;

	/* Spacing (tokens.ts: xs 4, sm 8, md 12, lg 16, xl 24, xxl 32, xxxl 48) */
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 0.75rem;
	--space-lg: 1rem;
	--space-xl: 1.5rem;
	--space-xxl: 2rem;
	--space-xxxl: 3rem;

	/* Radius (tokens.ts: lg 12) */
	--radius: 0.75rem;

	--column: 40rem;
	--gutter: 16px;
}

@media (prefers-color-scheme: dark) {
	:root {
		/* Dark palette (ThemeProvider dark) */
		--background: #000000;
		--surface: #1c1c1e;
		--text: #ffffff;
		--text-secondary: #ebebf599;
		--separator: #38383a;
		--accent: #0a84ff;
	}
}

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

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

body {
	margin: 0;
	background: var(--background);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	font-size: 1rem; /* body 16 */
	line-height: 1.5;
	overflow-wrap: break-word;
}

/* One readable column with 16px side gutters. */
.wrap {
	max-width: calc(var(--column) + 2 * var(--gutter));
	margin: 0 auto;
	padding-left: var(--gutter);
	padding-right: var(--gutter);
}

/* Header */
.site-header {
	border-bottom: 1px solid var(--separator);
}

.site-header .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-sm) var(--space-lg);
	padding-top: var(--space-lg);
	padding-bottom: var(--space-lg);
}

.site-name {
	font-weight: 600;
	color: var(--text);
	text-decoration: none;
}

.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--space-lg);
}

/* A project's own pages (Privacy, Support) sit under its name: smaller, after a divider. */
.subnav {
	display: flex;
	align-items: baseline;
	gap: var(--space-md);
	padding-left: var(--space-lg);
	border-left: 1px solid var(--separator);
	font-size: 0.875rem;
}

.site-nav a {
	text-decoration: none;
}

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

/* Main */
main {
	padding-top: var(--space-xxl);
	padding-bottom: var(--space-xxxl);
}

h1,
h2,
h3 {
	line-height: 1.25;
	margin: 0;
}

h1 {
	font-size: 2rem; /* between title 28 and display 36 */
	font-weight: 700;
}

h2 {
	font-size: 1.375rem; /* heading 22 */
	font-weight: 600;
	margin-top: var(--space-xxl);
}

h3 {
	font-size: 1.125rem; /* subheading 18 */
	font-weight: 600;
	margin-top: var(--space-xl);
}

p,
ul,
ol {
	margin: var(--space-md) 0 0;
}

ul,
ol {
	padding-left: var(--space-xl);
}

li + li {
	margin-top: var(--space-xs);
}

.subtitle {
	margin-top: var(--space-sm);
	font-size: 1.125rem;
	color: var(--text-secondary);
}

.meta {
	margin-top: var(--space-sm);
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.lede {
	margin-top: var(--space-lg);
	font-size: 1.125rem;
}

/* Links */
a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 2px;
}

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

/* Projects entry */
.card {
	display: block;
	margin-top: var(--space-lg);
	padding: var(--space-lg) var(--space-xl);
	background: var(--surface);
	border-radius: var(--radius);
	color: var(--text);
	text-decoration: none;
}

.card:hover {
	text-decoration: none;
}

.card-title {
	display: block;
	font-weight: 600;
	color: var(--accent);
}

.card-text {
	display: block;
	margin-top: var(--space-xs);
}

/* Footer */
.site-footer {
	border-top: 1px solid var(--separator);
	font-size: 0.875rem;
	color: var(--text);
}

.site-footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-sm) var(--space-lg);
	padding-top: var(--space-xl);
	padding-bottom: var(--space-xl);
}

.site-footer p {
	margin: 0;
}

.site-footer nav {
	display: flex;
	gap: var(--space-lg);
}
