/* The stylesheet of every page of the web site (docs/architecture.md, "Web site"). One dark theme, in the
   colours of the Play listing's feature graphic and of the app. */

:root {
	color-scheme: dark;
	--navy-deep: #0b0b2c;		/* the feature graphic's gradient, darkest to lightest */
	--navy: #1c1c66;
	--navy-light: #2a2a8c;
	--amber: #ffbb00;			/* the 9 of the name, and the key names in the app's help */
	--blue: #00bbff;			/* the mathematics in the app's help */
	--text: #e4e6ff;
	--muted: #a9acd6;
	--line: rgba(228, 230, 255, 0.14);
	--gutter: 16px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--navy-deep);
	color: var(--text);
	font: 1.0625rem/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	overflow-wrap: anywhere;		/* the e-mail address, on a narrow screen with a large font: anywhere, not break-word, so that it also lets the footer, a flex item, narrow */
}

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

a:focus-visible {
	outline: 2px solid var(--amber);
	outline-offset: 3px;
}

h1, h2, h3 {
	color: #ffffff;
	line-height: 1.2;
}

h2 {
	margin: 0 0 16px;
	font-size: 1.75rem;
}

.nine {
	color: var(--amber);
}

/* the header's and the footer's row: the name or the copyright on the left, the links on the right */
.bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	max-width: 68rem;
	margin: 0 auto;
	padding: 16px var(--gutter);
}

.bar nav {
	display: flex;
	gap: 24px;
}

.bar nav a {
	color: var(--text);
	text-decoration: none;
}

.bar nav a:hover, .bar nav a[aria-current] {
	color: #ffffff;
	text-decoration: underline;
	text-underline-offset: 6px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #ffffff;
	font-size: 1.25rem;
	font-weight: 800;
	text-decoration: none;
}

.brand img {
	border-radius: 8px;
}

header.site {
	border-bottom: 1px solid var(--line);
}

/* the landing page's header: the name, the pitch and the phone on the feature graphic's gradient */
header.masthead {
	border-bottom: 0;
	background: linear-gradient(115deg, var(--navy-light), var(--navy) 50%, var(--navy-deep));
}

.hero {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 48px;
	max-width: 68rem;
	margin: 0 auto;
	padding: 24px var(--gutter) 64px;
}

.hero h1 {
	margin: 0;
	font-size: clamp(4rem, 14vw, 7.5rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
}

.hero p {
	max-width: 34rem;
}

.tagline {
	margin: 8px 0 24px;
	font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 24px;
	margin-top: 32px;
}

.button {
	padding: 12px 22px;
	border-radius: 10px;
	background: var(--amber);
	color: #000000;
	font-weight: 700;
	text-decoration: none;
}

.button:hover {
	background: #ffcc33;
}

/* the screen capture, in a black frame with rounded corners like the phone's */
.phone {
	width: 260px;
	height: auto;
	border: 8px solid #000000;
	border-radius: 32px;
	box-shadow: 0 0 0 1px #3a3a7a, 0 24px 64px rgba(0, 0, 0, 0.55);
}

main section {
	max-width: 68rem;
	margin: 0 auto;
	padding: 56px var(--gutter);
}

main section + section {
	border-top: 1px solid var(--line);
}

/* a key sequence, each key drawn as the app draws its keys */
.keys {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 24px 0;
}

kbd {
	min-width: 2.75em;
	padding: 10px 14px;
	border: 1px solid #444444;
	border-radius: 10px;
	background: linear-gradient(to bottom, #3c3c3c, #101010);
	color: #ffffff;
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1;
	text-align: center;
}

.features {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));	/* one column where 17rem does not fit, as at 320 px with a large font */
	gap: 16px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.features li {
	padding: 20px 22px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.03);
}

.features h3 {
	margin: 0 0 6px;
	font-size: 1.125rem;
}

.features p {
	margin: 0;
	color: var(--muted);
}

/* two sections' worth side by side */
.pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
}

/* the privacy policy and the help: one column of text */
.text {
	max-width: 44rem;
	margin: 0 auto;
	padding: 40px var(--gutter) 64px;
}

.text h1 {
	margin: 0 0 8px;
	font-size: 2.25rem;
}

.text h2 {
	margin: 2em 0 0.5em;
	font-size: 1.3rem;
}

.meta {
	color: var(--muted);
}

/* the app's help, which tools/site.js puts in help.html: key names amber and mathematics blue, as in the app */
.help .FuncMarkup {
	color: var(--amber);
}

.help .MathMarkup {
	color: var(--blue);
}

/* as in the app, a key name, an expression and the keys a table row describes stay on one line. Where they do not
   fit, as with a large font on a narrow screen, the key sequence or the table scrolls sideways on its own, and the
   page does not. */
.help .FuncMarkup, .help .MathMarkup, .help td:first-child {
	white-space: nowrap;
}

/* a key sequence set apart from the text: indented as in the app on a wide screen, less on a phone */
.help .KeySequence {
	margin-left: min(6rem, 10%);
	overflow-x: auto;
}

/* the table element is the box that scrolls, and its row group is the table, at least as wide as the column */
.help table {
	display: block;
	margin: 16px 0;
	overflow-x: auto;
}

.help tbody {
	display: table;
	width: 100%;
	border-collapse: collapse;
}

.help td {
	padding: 8px 16px 8px 0;
	border-top: 1px solid var(--line);
	vertical-align: top;
}

.help summary {
	color: var(--blue);
	cursor: pointer;
}

/* the third-party notices, 80 columns at most: as in the app (decision D19), smaller print rather than reflowed
   licence text. A monospaced character is about 0.6 em wide, so 80 columns take 48 em; 50 leaves room for the fonts
   that are wider. A line that still does not fit wraps. */
.Notices {
	color: var(--muted);
	font-family: ui-monospace, 'Roboto Mono', Menlo, Consolas, monospace;
	font-size: min(0.75rem, (100vw - 2 * var(--gutter)) / 50);
	line-height: 1.5;
	white-space: pre-wrap;
}

footer.site {
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.9375rem;
}

footer.site .bar {
	padding-top: 24px;
	padding-bottom: 32px;
}

@media (max-width: 760px) {
	.hero, .pair {
		grid-template-columns: 1fr;
	}

	.hero {
		gap: 40px;
		padding-bottom: 48px;
	}

	.phone {
		justify-self: center;
		width: min(240px, 70vw);
	}

	main section {
		padding-top: 40px;
		padding-bottom: 40px;
	}
}
