:root {
	--ink: #e8eaeca0;
	--muted: #a6abb060;
	--tagline: #ffffff;
	--rule: #34383c;
	--bg: #000000;
	--tint: #24272a;
	/* Hero backdrop image; overridden per page load by an inline script.
	   AVIF is ~2.5x smaller than the JPEG; browsers without image-set/AVIF
	   fall back to the JPEG declaration above. */
	--hero-jpg: url("images/chem-1.jpg");
	--hero-avif: url("images/chem-1.avif");
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Sticky footer: the body is a full-height column, <main> takes the free space,
   so the footer sits at the bottom of the viewport on short pages and after
   the content on long ones. */
body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--ink);
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	line-height: 1.5;
}

main {
	flex: 1 0 auto;
	width: 100%;
	padding: 2rem;
}

main.home {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
}

/* ── Hero backdrop ──────────────────────────────────────────────────────── */

/* A desert-road photo sits behind the central logo, roughly twice its width.
   It's darkened and desaturated with CSS filters so it keeps the graphite
   mood, and a radial mask fades its edges to transparent — that way it
   blends into the solid page background no matter what --bg is set to.
   Scoped with :has so it only applies to pages whose <main> holds the logo. */
main.home {
	position: relative;
	/* The backdrop is wider than the viewport on small screens; clip it here so
	   it can't trigger horizontal overflow (which shifted content left). */
	overflow: hidden;
	overflow: clip;
}

main.home:has(> .logo)::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	/* ~200% of the 50rem logo (logo caps at 80vw, backdrop at 160vw) */
	width: 110rem;
	max-width: 160%;
	aspect-ratio: 2 / 1; /* backdrop box; all images/chem-*.jpg are 1920x960 */
	background: var(--hero-jpg) center / cover no-repeat;
	background:
		image-set(
			var(--hero-avif) type("image/avif"),
			var(--hero-jpg) type("image/jpeg")
		)
		center / cover no-repeat;
	filter: brightness(0.7) contrast(1.05) saturate(1.1);
	opacity: 1;
	/* Superellipse-ish fade: two intersecting linear gradients form a
	   rounded-rect blend, plus a wide radial to round the corners — halfway
	   between the old ellipse and the full image rect. Without mask-composite
	   support the layers union (closer to the rect). */
	-webkit-mask-image:
		linear-gradient(to right, transparent, #000 28%, #000 72%, transparent),
		linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent),
		radial-gradient(ellipse 62% 62% at center, #000 55%, transparent 98%);
	mask-image:
		linear-gradient(to right, transparent, #000 28%, #000 72%, transparent),
		linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent),
		radial-gradient(ellipse 62% 62% at center, #000 55%, transparent 98%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
	pointer-events: none;
}

/* Portrait viewports get a taller backdrop so the image follows the screen
   instead of staying a wide desktop-shaped strip. The source remains centered
   and cover-cropped; the broader mask plateau keeps the logo inside the fade. */
@media (max-aspect-ratio: 1 / 1) {
	main.home:has(> .logo)::before {
		aspect-ratio: 1 / 1;
		-webkit-mask-image:
			linear-gradient(to right, transparent, #000 20%, #000 80%, transparent),
			linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent),
			radial-gradient(ellipse 68% 68% at center, #000 55%, transparent 98%);
		mask-image:
			linear-gradient(to right, transparent, #000 20%, #000 80%, transparent),
			linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent),
			radial-gradient(ellipse 68% 68% at center, #000 55%, transparent 98%);
	}
}

/* Keep content (logo, text) above the backdrop */
main.home > * {
	position: relative;
}

.tagline {
	color: var(--tagline);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	font-weight: 600;
	text-align: center;
}
.tagline .makers {
	word-spacing: 0.1rem;
	filter: drop-shadow(0 0 0.5rem var(--bg)) drop-shadow(0 0 0.25rem var(--bg));
}
.tagline a {
	text-decoration: none;
	color: var(--tagline);
	padding: 0.25rem 0.5rem;
	/* Rounded permanently: the outro fades the background out while the mouse
	   is already gone, so the rounding must not be tied to :hover. */
	border-radius: 64px;
	filter: drop-shadow(0 0 0.5rem var(--bg)) drop-shadow(0 0 0.25rem var(--bg));
	/* Outro and intro share these transitions (both 0.3s): on mouse leave the
	   pill fades out as the suffix text fades and the width winds down; on
	   hover the same trio runs in reverse. */
	transition:
		background-color 0.3s ease,
		filter 0.3s ease;
}
.tagline a:hover {
	text-decoration: none;
	background-color: var(--bg);
	filter: drop-shadow(0 0 0.15rem var(--bg)) drop-shadow(0 0 0.25rem var(--bg));
}

/* ".app" suffix: on hover the suffix column widens (0fr → 1fr), the ".app"
   text fades in and the pill background fades in — all at once, a mirrored
   single-stage counterpart of the mouse-leave outro. On mouse-out everything
   runs back at once. An invisible mirror copy of the
   suffix sits before "Makers of" and widens in sync (matched via :has), so
   both ends grow equally and the rest of the tagline doesn't re-centre.
   The inner span is needed so the column can interpolate; overflow:hidden
   keeps the text clipped while narrow. */
.tagline .tld,
.tagline .mirror {
	display: inline-grid;
	grid-template-columns: 0fr;
	vertical-align: bottom;
	transition: grid-template-columns 0.3s ease;
}
.tagline .tld > span,
.tagline .mirror > span {
	overflow: hidden;
	min-width: 0;
	white-space: nowrap;
	text-transform: lowercase;
	opacity: 0;
	transition: opacity 0.3s ease;
}
/* The mirror holds the same ".app" text, hidden; it only contributes width. */
.tagline .mirror {
	visibility: hidden;
}
.tagline:has(a:hover) .tld,
.tagline:has(a:hover) .mirror {
	grid-template-columns: 1fr;
}
.tagline:has(a:hover) .tld > span {
	opacity: 1;
}

.logo {
	display: block;
	width: 50rem;
	max-width: 80%;
	filter: drop-shadow(0 0 0.5rem var(--bg)) drop-shadow(0 0 0.2rem var(--bg));
	color: white;
}

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

/* ── Footer ─────────────────────────────────────────────────────────────── */

/* Two compact blocks side by side (company details left, contact/legal/copyright
   right); they stack into a single centered column on narrow screens. */
.site-footer {
	flex-shrink: 0;
	padding: 1.75rem 2rem 2rem;
	text-align: left;
	font-size: 0.875rem;
	color: var(--muted);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2.25rem 3.5rem;
	align-items: center;
	line-height: 1rem;
}

.site-footer p {
	margin: 0;
}

/* Bot-proofed email: the HTML source stores the address reversed
   ("erawtfos.esdnoc@tcatnoc"); bidi-override flips it back so humans
   read contact@condense.software. Scrapers regexing the raw source
   find no valid address. Note: copying from the page yields the
   reversed string, so the address must be retyped from sight. */
.email {
	unicode-bidi: bidi-override;
	direction: rtl;
}

.site-footer strong {
	color: var(--ink);
	font-weight: 500;
}

.site-footer a {
	color: var(--ink);
	text-decoration: none;
	border-bottom: 1px solid var(--rule);
	transition: border-color 0.15s ease;
}

.site-footer a:hover {
	border-color: var(--ink);
}

.site-footer .footer-block.flag {
	display: flex;
	flex-direction: row;
	gap: 0.5rem;
	align-items: top;
}
.site-footer .footer-block.flag .flag {
	margin-top: 5px;
}
.site-footer .footer-block .flag img {
	display: block; /* drop the inline baseline gap that pushed the flag off-centre */
	height: 41px;
	filter: grayscale(1) brightness(0.75);
	opacity: 0.2;
}

/* ── Legal pages (generated from Markdown by misc/build-condense-legal.py) ─ */

.legal-header {
	max-width: 44rem;
	margin: 0 auto;
	padding: 2rem 2rem 0;
}

.legal-header .logo {
	color: var(--ink);
	width: 25rem;
	max-width: 100%;
	margin-bottom: 1.5rem;
}
.legal-header .logo:hover {
	color: #ffffffd0;
}

article {
	max-width: 44rem;
	margin: 0 auto;
	font-size: 1rem;
}

article h1 {
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.25;
	margin-bottom: 1rem;
}

article h2 {
	font-size: 1.2rem;
	font-weight: 600;
	margin: 2.25rem 0 0.75rem;
}

article h3 {
	font-size: 1rem;
	font-weight: 600;
	margin: 1.5rem 0 0.5rem;
}

article p,
article ul,
article ol,
article blockquote,
.table {
	margin-bottom: 1rem;
}

article ul,
article ol {
	padding-left: 1.5rem;
}

article li {
	margin-bottom: 0.35rem;
}

article blockquote {
	background: var(--tint);
	border-left: 3px solid var(--rule);
	padding: 0.75rem 1rem;
	color: var(--muted);
	font-size: 0.9375rem;
}

article blockquote p:last-child {
	margin-bottom: 0;
}

article hr {
	border: 0;
	border-top: 1px solid var(--rule);
	margin: 2rem 0;
}

article code {
	font-family: inherit;
	background: var(--tint);
	padding: 0.05rem 0.3rem;
	border-radius: 3px;
}

.table {
	overflow-x: auto;
}

article table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.9375rem;
}

article th,
article td {
	border: 1px solid var(--rule);
	padding: 0.5rem 0.75rem;
	text-align: left;
	vertical-align: top;
}

article th {
	background: var(--tint);
	font-weight: 600;
}

@media (max-width: 760px) {
	main,
	.legal-header {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}

	.site-footer {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
		flex-direction: column;
		gap: 0.75rem;
	}
	.site-footer .footer-block.terms {
		text-align: center;
	}
	.site-footer .company-details {
		max-width: 600px;
	}
}
@media (max-width: 500px) {
	.site-footer .company-details {
		max-width: 200px;
	}
}
