/* The site's one stylesheet. Mobile first: the rules outside a media query
   are for phones; wider screens only add (from 48rem, tablet width). */

:root {
	--bg: #f7f8fa;
	--fg: #16181d;
	--muted: #5b6270;
	/* The logo's colours (logo/make_logo.py: BLUE, GREEN, and their lighter
	   tones on dark): its blue for links and the button, a brighter one on
	   hover; its green only for marks, as text it would be too pale. */
	--accent: #1e3a8a;
	--accent-hover: #1d4ed8;
	--green: #10b981;
	--on-accent: #ffffff;
	--line: #e2e5ea;
	--field: #ffffff;
	--band: #ffffff;
	--hover: rgba(30, 58, 138, .07);
	--danger: #c0262d;
	--shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .12);
	--radius: .5rem;
	/* The page's frame: header, running text and footer end on the same line
	   on a wide window. As narrow as the full menu allows (it stands beside
	   the wordmark from 48rem on), so that lines of text stay readable. */
	--frame: 48rem;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #111317;
		--fg: #eceef2;
		--muted: #9aa1ad;
		--accent: #6d9bff;
		--accent-hover: #93b4ff;
		--green: #34d399;
		--on-accent: #0b1020;
		--line: #2a2f37;
		--field: #181b20;
		--band: #171a1f;
		--hover: rgba(109, 155, 255, .12);
		--danger: #ff7b7b;
		--shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .5);
	}
}

/* The typeface: Roboto (OFL, see /fonts/LICENSE.txt), served from here, so
   that the site looks the same on every device and no visitor's address goes
   to a font service. Two parts: basic Latin, which every page needs, and the
   extended Latin that the browser only loads for a character from it (a name
   such as Łukasz in the form). One variable file each carries every weight
   (Roboto has more: a width axis, and Roboto Flex, Mono, Slab and Serif
   beside it; we use none of them yet).
   Until it has arrived, the text shows in the system's font (swap). */
@font-face {
	font-family: "Roboto";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("/fonts/roboto-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Roboto";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("/fonts/roboto-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	font: 1rem/1.6 Roboto, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Header and footer are bands across the whole window; .wrap centres
   their content, and the page's, in the frame. */
.wrap {
	width: 100%;
	max-width: var(--frame);
	margin-inline: auto;
	padding-inline: 1.25rem;
}
main {
	flex: 1;
	padding-block: 1rem 3rem;
}

h1 {
	margin: 0 0 .75rem;
	font-size: clamp(1.5rem, 5vw, 1.85rem);
	line-height: 1.15;
	letter-spacing: -.02em;
}
h2 {
	margin: 2rem 0 .5rem;
	font-size: 1.25rem;
	line-height: 1.3;
}
h3 {
	margin: 1.5rem 0 .4rem;
	font-size: 1.05rem;
	line-height: 1.3;
}
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lead {
	font-size: 1.15rem;
	color: var(--muted);
}
.note {
	font-size: .85rem;
	color: var(--muted);
}

/* Header: a band; in it the logo left, menu and language menu right */

body > header {
	background: var(--band);
	border-bottom: 1px solid var(--line);
}
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1rem;
}
/* The wide wordmark (static/wordmark.svg) where it fits beside the menu
   button, from 20rem up; on narrower phones the compact
   logo instead, GH over "Systems" (static/logo.svg). They come from
   logo/make_lockups.py and logo/make_logo.py, lighter in dark mode. The menu stays
   behind its button until it fits beside the wordmark (48rem, see the end). */
.brand {
	display: flex;
	align-items: center;
	flex: none;
}
/* On phones the wordmark grows with the screen: as wide as the room beside
   the menu button allows (the screen less gutters, button and a gap, 6.25rem;
   the wordmark is 10.08 times as wide as high), from 1.25rem to 1.75rem high. */
.brand-name { display: none; height: clamp(1.25rem, (100vw - 6.25rem) / 10.08, 1.75rem); width: auto; }
.mark {
	display: block;
	flex: none;
	height: 1.925rem;
	width: auto;
}
@media (min-width: 20rem) {
	.brand-name { display: block; }
	.mark { display: none; }
}
.site-nav {
	display: flex;
	align-items: center;
	gap: .5rem;
}

/* The menu side by side, from 48rem on; below it is the dropdown behind the
   menu button instead (.menu-narrow). */
.menu-wide { display: none; }
.menu-wide a {
	display: block;
	padding: .4rem .6rem;
	border-radius: var(--radius);
	color: var(--fg);
	text-decoration: none;
	white-space: nowrap;
}
.menu-wide a:hover { background: var(--hover); color: var(--fg); }
/* The current page: in the logo's blue, underlined with its green bar. */
.menu-wide a[aria-current],
.menu-narrow a[aria-current] {
	color: var(--accent);
	text-decoration: underline 2px var(--green);
	text-underline-offset: .4em;
}
.menu-wide a[aria-current] { font-weight: 600; }

/* Dropdowns (language menu, menu on phones): a <details> whose list opens
   below its button, over the page. site.js closes them on a click elsewhere. */
.dropdown { position: relative; }
.dropdown summary {
	display: flex;
	align-items: center;
	gap: .4rem;
	padding: .45rem .6rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font-size: .9rem;
	line-height: 1;
	list-style: none;
	cursor: pointer;
	user-select: none;
}
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary:hover { background: var(--hover); }
.dropdown ul {
	position: absolute;
	right: 0;
	top: calc(100% + .35rem);
	z-index: 10;
	min-width: 11rem;
	margin: 0;
	padding: .35rem 0;
	list-style: none;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.dropdown a {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .6rem 1rem;
	color: var(--fg);
	text-decoration: none;
}
.dropdown a:hover,
.dropdown a:focus-visible { background: var(--hover); color: var(--fg); }
.dropdown a[aria-current] { font-weight: 600; }

/* A chevron that turns when the language menu, or the submenu, opens. */
.lang-menu summary::after,
.submenu summary::after {
	content: "";
	width: .4rem;
	height: .4rem;
	margin-left: .15rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	opacity: .6;
	transform: translateY(-2px) rotate(45deg);
	transition: transform .2s;
}
.lang-menu[open] summary::after,
.submenu details[open] summary::after { transform: translateY(1px) rotate(-135deg); }

/* The language menu only beside the menu side by side (48rem, see the end);
   below that the languages are the dropdown's last entry, a submenu that
   folds out in place, its entries indented. */
.lang-menu { display: none; }
.submenu {
	margin-top: .35rem;
	padding-top: .35rem;
	border-top: 1px solid var(--line);
}
.dropdown .submenu summary {
	gap: .6rem;
	padding: .6rem 1rem;
	border: 0;
	border-radius: 0;
	font-size: inherit;
	line-height: inherit;
}
.submenu summary::after { margin-left: auto; }
.dropdown .submenu ul {
	position: static;
	min-width: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
.submenu ul a { padding-left: 2rem; }

.menu-narrow summary { padding: .4rem; }
.menu-narrow svg { display: block; width: 1.25rem; height: 1.25rem; }

.flag {
	width: 1.25rem;
	height: .75rem;
	object-fit: cover;
	border-radius: 2px;
	/* a hairline, so white parts of a flag do not dissolve into the page */
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}

/* Forms */

form {
	display: grid;
	gap: 1.1rem;
	margin-top: 1.5rem;
}
label {
	display: grid;
	gap: .35rem;
	font-size: .95rem;
	font-weight: 600;
}
input,
textarea {
	width: 100%;
	padding: .65rem .8rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--field);
	color: var(--fg);
	font: inherit;
	font-weight: 400;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus,
textarea:focus {
	border-color: var(--accent);
	outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent);
	outline-offset: 0;
}
/* Only after someone has left the field, not while the form is still empty. */
input:user-invalid,
textarea:user-invalid { border-color: var(--danger); }
button[type="submit"] {
	padding: .75rem 1.4rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--on-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
button[type="submit"]:hover { background: var(--accent-hover); }

/* The honeypot: out of sight and out of the tab order, but still in the form. */
.hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Footer */

body > footer {
	padding-block: 1.5rem;
	background: var(--band);
	border-top: 1px solid var(--line);
	font-size: .85rem;
	color: var(--muted);
}
body > footer a { color: inherit; }
/* Two blocks: side by side where they fit, the links on a line of their
   own where they do not, never broken inside, so that no dot is left
   hanging; the copyright only breaks on the narrowest phones. */
body > footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .25rem 1.5rem;
}
body > footer .wrap > span:last-child { white-space: nowrap; }

/* From tablet width on */

@media (min-width: 48rem) {
	.site-header { padding-block: 1.25rem; }
	.brand-name { height: 1.9rem; }
	main { padding-block: 1.5rem 4rem; }
	.lead { font-size: 1.3rem; }
	button[type="submit"] { justify-self: start; }
	/* The menu side by side, which fits beside the wordmark from here on in
	   both languages; before that it folds into the menu button. */
	.menu-wide {
		display: flex;
		gap: .15rem;
		margin: 0;
		padding: 0;
		list-style: none;
	}
	.menu-narrow { display: none; }
	.lang-menu { display: block; }
}
