/* Modern landing page for www.openbsd.org — static only, no JS. */

:root {
	--bg: #ffffff;
	--fg: #16181d;
	--muted: #5b6470;
	--line: #e4e8ee;
	--card: #f6f8fb;
	--accent: #005a9c;
	--accent-dark: #003f6e;
	--blue: #005a9c;
	--blue-dark: #003f6e;
	--red: #005a9c;
	--green: #008100;
	--radius: 14px;
	--maxw: 1080px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
		Arial, sans-serif;
	--mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

.skip {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--fg);
	color: var(--bg);
	padding: 8px 14px;
	z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* Header */

.site-header {
	border-bottom: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(8px);
	position: sticky;
	top: 0;
	z-index: 50;
}

.site-header .wrap {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 20px;
}

.brand {
	font-size: 1.35rem;
	text-decoration: none;
	color: var(--fg);
	white-space: nowrap;
}
.brand i { color: var(--blue); font-style: italic; }
.brand b { color: var(--accent); }

.site-nav {
	margin-left: auto;
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}
.site-nav a {
	text-decoration: none;
	color: var(--fg);
	font-size: 0.92rem;
	font-weight: 600;
	padding: 8px 12px;
	border-radius: 8px;
}
.site-nav a:hover { background: var(--card); }
.site-nav a.cta {
	background: var(--accent);
	color: #fff;
}
.site-nav a.cta:hover { background: var(--accent-dark); }

/* Unofficial community notice */

.unofficial {
	max-width: var(--maxw);
	margin: 14px auto 0;
	padding: 8px 20px;
	font-size: 0.82rem;
	color: var(--muted);
	text-align: center;
}
.unofficial strong { color: var(--fg); font-weight: 700; }

/* Layout */

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

.hero {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 40px;
	align-items: center;
	padding: 56px 20px 40px;
	max-width: var(--maxw);
	margin: 0 auto;
}

.badge {
	display: inline-block;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--accent-dark);
	background: #e8f1f8;
	border: 1px solid #b9d4e8;
	border-radius: 999px;
	padding: 5px 14px;
	margin: 0 0 16px;
}

.hero h1 {
	font-size: clamp(2rem, 4.5vw, 3.1rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin: 0 0 16px;
}

.lede {
	font-size: 1.12rem;
	color: var(--muted);
	margin: 0 0 24px;
	max-width: 34em;
}
.lede strong { color: var(--fg); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

.btn {
	display: inline-block;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.95rem;
	padding: 11px 22px;
	border-radius: 10px;
	border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--fg); background: #fff; }
.btn-ghost:hover { border-color: var(--fg); color: var(--fg); }

.callout {
	border-left: 4px solid var(--accent);
	background: var(--card);
	border-radius: 0 10px 10px 0;
	padding: 12px 16px;
	font-size: 0.95rem;
	margin: 0;
	max-width: 34em;
}

.hero-art { text-align: center; }
.hero-art img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	background: var(--card);
}
.hero-art figcaption {
	font-size: 0.82rem;
	color: var(--muted);
	margin-top: 8px;
}

/* Cards */

.section { padding: 28px 0; }
.section h2 {
	font-size: 1.45rem;
	letter-spacing: -0.01em;
	margin: 0 0 6px;
}
.section .sub { color: var(--muted); margin: 0 0 20px; }

.grid-4 {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.grid-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
}
.card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.card p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.card a { font-weight: 600; }

.release {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.release .card { background: #fff; }
.release code {
	font-family: var(--mono);
	font-size: 0.85em;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 1px 6px;
	white-space: nowrap;
}
.meta-list { margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.92rem; }
.meta-list li + li { margin-top: 6px; }

.funding {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	background: #101319;
	color: #eef1f5;
	border-radius: var(--radius);
	padding: 26px 28px;
}
.funding h2 { margin: 0 0 6px; }
.funding p { margin: 0; color: #b9c1cc; max-width: 44em; }
.funding .btn-primary { flex-shrink: 0; }

.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pills a {
	display: inline-block;
	text-decoration: none;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--fg);
	font-size: 0.88rem;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 999px;
}
.pills a:hover { border-color: var(--blue); color: var(--blue); }

.site-footer {
	border-top: 1px solid var(--line);
	margin-top: 36px;
	padding: 22px 0 40px;
	color: var(--muted);
	font-size: 0.86rem;
}
.site-footer .wrap {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	align-items: baseline;
}
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }

/* Subproject homepages with sidebar nav (html#project-main) */

html#project-main body {
	height: 100%;
	max-width: 100%;
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	top: 0;
	display: table;
	padding: 0;
	margin: 0;
}

html#project-main nav,
html#project-main article,
html#project-main figure,
html#project-main aside {
	display: table-cell;
	padding: 4px;
}

html#project-main nav,
html#project-main figure {
	border-right: 11px solid;
	background-color: #6BBDD6;
	border-color: #007B9C;
}

html#project-main nav header {
	margin: 0;
	font-size: 15pt;
	font-weight: bolder;
	white-space: nowrap;
}

html#project-main nav ul {
	margin-top: 0;
	margin-bottom: 1em;
	padding-left: 0;
}

html#project-main nav li {
	list-style-type: none;
	list-style-position: inside;
	margin-left: 0.5em;
}

html#project-main article h2 {
	margin: 0;
	text-align: center;
}

html#project-main main,
html#project-main footer {
	display: table-row;
}

html#project-main nav {
	vertical-align: top;
}

html#project-main figure,
html#project-main aside {
	vertical-align: bottom;
}

#callout {
	color: #E00000;
	font-weight: bold;
	text-align: center;
}

.not-openbsd #callout {
	color: #0000A0;
	font-weight: normal;
}

@media (max-width: 768px) {
	html#project-main body {
		position: static;
		display: block;
	}

	html#project-main main,
	html#project-main footer {
		display: flex;
		flex-direction: column;
	}

	html#project-main nav,
	html#project-main article,
	html#project-main figure,
	html#project-main aside {
		display: block;
	}

	html#project-main article,
	html#project-main aside {
		order: 1;
	}

	html#project-main nav,
	html#project-main figure {
		order: 2;
		text-align: center;
	}

	html#project-main nav {
		border: solid #007B9C;
		border-width: 11px 0;
	}

	html#project-main figure {
		background-color: #FFFFFF;
		border: none;
	}

	html#project-main nav header {
		white-space: normal;
	}

	html#project-main article h2 img {
		height: auto;
		max-width: 100%;
	}
}

/* Content pages (converted legacy pages) */

.page { padding: 36px 0 8px; }
.content { max-width: 880px; }
.content h1 {
	font-size: clamp(1.7rem, 3.5vw, 2.3rem);
	letter-spacing: -0.02em;
	margin: 0 0 16px;
}
.content h2 { font-size: 1.3rem; margin: 2em 0 0.6em; }
.content h3 { font-size: 1.1rem; margin: 1.8em 0 0.5em; color: var(--accent); }
.content h4 { font-size: 1rem; margin: 1.5em 0 0.5em; }
.content p { margin: 0 0 1em; }
.content ul, .content ol, .content dl { margin: 0 0 1em; }
.content li + li { margin-top: 0.35em; }
.content dt { font-weight: 700; }
.content small { color: var(--muted); }
.content hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }
.content img { max-width: 100%; height: auto; }
.content table { border-collapse: collapse; margin: 0 0 1em; }
.content td { padding: 6px 10px; vertical-align: top; }
.content pre { overflow: auto; }
.content .colophon { color: var(--muted); font-size: 0.9rem; }

code {
	font-family: var(--mono);
	font-size: 0.9em;
}

.cmdbox {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: auto;
	padding: 12px 14px;
}

.zebra {
	background: var(--card);
	border: 1px solid var(--line);
	border-collapse: collapse;
}
.zebra tr:nth-child(odd) { background: rgba(0, 90, 156, 0.06); }
.zebra td { border: 1px solid var(--line); padding: 7px; }

#errata strong { color: var(--green); }
#release table.signify { font-family: var(--mono); }
#release table.signify td { padding: 0; }
#release h3 { color: var(--accent); }
#release kbd { font-weight: bolder; }
#release code.reldir { font-family: serif; }

/* Responsive */

@media (max-width: 860px) {
	.hero { grid-template-columns: 1fr; padding-top: 36px; }
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
	.grid-3, .release { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.grid-4 { grid-template-columns: 1fr; }
	.site-header .wrap { flex-wrap: wrap; }
	.site-nav { margin-left: 0; }
}

/* Theme toggle */

.theme-toggle {
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--fg);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 8px 12px;
	margin-left: 4px;
	cursor: pointer;
	white-space: nowrap;
}
.theme-toggle:hover { background: var(--card); }

/* Dark mode: explicit choice (html[data-theme]) wins, otherwise OS preference */

html[data-theme="dark"] {
	--bg: #14161a;
	--fg: #eef0f3;
	--muted: #a9b2bd;
	--line: #2a2f37;
	--card: #1c2026;
	--accent: #6aa9e8;
	--accent-dark: #9fc8ff;
	--blue: #8fc1ff;
	--blue-dark: #c4dcff;
	--red: #6aa9e8;
	--green: #20b700;
}
html[data-theme="dark"] .site-header { background: rgba(20, 22, 26, 0.92); }
html[data-theme="dark"] .badge { background: #16222e; border-color: #2c4a63; color: #9fc8ff; }
html[data-theme="dark"] .btn-ghost { background: transparent; }
html[data-theme="dark"] .release .card, html[data-theme="dark"] .pills a { background: var(--card); }
html[data-theme="dark"] .funding { background: #000; border: 1px solid var(--line); }
html[data-theme="dark"] .hero-art img { background: var(--card); }
html[data-theme="dark"]#project-main nav,
html[data-theme="dark"]#project-main figure { background-color: #123843; border-color: #1e5a73; }

@media (prefers-color-scheme: dark) {
	html:not([data-theme="light"]) {
		--bg: #14161a;
		--fg: #eef0f3;
		--muted: #a9b2bd;
		--line: #2a2f37;
		--card: #1c2026;
		--accent: #6aa9e8;
		--accent-dark: #9fc8ff;
		--blue: #8fc1ff;
		--blue-dark: #c4dcff;
		--red: #6aa9e8;
		--green: #20b700;
	}
	html:not([data-theme="light"]) .site-header { background: rgba(20, 22, 26, 0.92); }
	html:not([data-theme="light"]) .badge { background: #16222e; border-color: #2c4a63; color: #9fc8ff; }
	html:not([data-theme="light"]) .btn-ghost { background: transparent; }
	html:not([data-theme="light"]) .release .card, html:not([data-theme="light"]) .pills a { background: var(--card); }
	html:not([data-theme="light"]) .funding { background: #000; border: 1px solid var(--line); }
	html:not([data-theme="light"]) .hero-art img { background: var(--card); }
	html:not([data-theme="light"])#project-main nav,
	html:not([data-theme="light"])#project-main figure { background-color: #123843; border-color: #1e5a73; }
}
