/*  ChemPencil marketing site
    ---------------------------------------------------------------
    Single stylesheet, no external fonts, no JS. Works with reader
    mode. Auto-adapts to light / dark via prefers-color-scheme.       */

:root {
	color-scheme: light dark;

	--fg:            #1a1a1c;
	--fg-muted:      #55555a;
	--bg:            #ffffff;
	--bg-alt:        #f5f5f7;
	--border:        #e4e4e7;
	--accent:        #43c74f;   /* green from the app icon           */
	--accent-strong: #2fa53a;
	--link:          #0071e3;
	--link-hover:    #0080ff;
	--code-bg:       #f1f1f4;
	--shadow:        0 4px 24px rgba(0, 0, 0, .08);

	--radius: 12px;
	--max-width: 1024px;
	--gap: 24px;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	             "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--fg:       #f2f2f4;
		--fg-muted: #a1a1a6;
		--bg:       #0e0e10;
		--bg-alt:   #17171a;
		--border:   #26262b;
		--link:     #4aa8ff;
		--link-hover: #7bc0ff;
		--code-bg:  #202024;
		--shadow:   0 4px 24px rgba(0, 0, 0, .5);
	}
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	color: var(--fg);
	background: var(--bg);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout ---------------------------------------------- */

.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
}

.site-header {
	border-bottom: 1px solid var(--border);
	background: var(--bg);
	position: sticky;
	top: 0;
	z-index: 10;
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
	padding-top: 14px;
	padding-bottom: 14px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
	font-size: 18px;
	color: var(--fg);
	text-decoration: none;
}

.brand img {
	width: 32px;
	height: 32px;
	border-radius: 7px;
	box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

nav.top-nav a {
	color: var(--fg-muted);
	text-decoration: none;
	margin-left: 22px;
	font-size: 15px;
}

nav.top-nav a:hover,
nav.top-nav a:focus {
	color: var(--link-hover);
}

/* ---------- Hero ------------------------------------------------- */

.hero {
	padding: 72px 0 56px;
	text-align: center;
	background:
		radial-gradient(circle at 50% -10%,
			rgba(67, 199, 79, .18) 0%,
			transparent 55%),
		var(--bg);
}

.hero-icon {
	width: 128px;
	height: 128px;
	border-radius: 28px;
	box-shadow: var(--shadow);
	margin-bottom: 22px;
}

.hero h1 {
	font-size: clamp(34px, 5.5vw, 52px);
	line-height: 1.1;
	margin: .2em 0 .15em;
	letter-spacing: -.02em;
}

.hero .tagline {
	color: var(--fg-muted);
	font-size: clamp(17px, 2.2vw, 21px);
	max-width: 620px;
	margin: 0 auto 26px;
}

.badges {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-top: 8px;
}

.badge, .btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: 999px;
	font-weight: 500;
	font-size: 15px;
	text-decoration: none;
	border: 1px solid var(--border);
	color: var(--fg);
	background: var(--bg-alt);
	transition: border-color .15s ease, transform .15s ease;
}

.badge:hover, .btn:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

.btn-primary {
	color: #fff;
	background: var(--accent-strong);
	border-color: var(--accent-strong);
}

.btn-primary:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

/* ---------- Feature grid ---------------------------------------- */

.section {
	padding: 56px 0;
	border-top: 1px solid var(--border);
}

.section h2 {
	font-size: clamp(24px, 3vw, 32px);
	letter-spacing: -.01em;
	margin: 0 0 8px;
}

.section .lead {
	color: var(--fg-muted);
	max-width: 620px;
	margin: 0 0 32px;
}

.feature-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

.feature {
	background: var(--bg-alt);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px 22px 20px;
	transition: border-color .15s ease;
}

.feature:hover { border-color: var(--accent); }

.feature h3 {
	margin: 0 0 8px;
	font-size: 17px;
	letter-spacing: -.005em;
}

.feature p {
	margin: 0;
	color: var(--fg-muted);
	font-size: 14.5px;
}

/* Two-column format lists */

.format-columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px;
	margin-top: 24px;
}

.format-columns h3 { font-size: 15px; margin: 0 0 10px; }
.format-columns ul { margin: 0; padding-left: 20px; color: var(--fg-muted); font-size: 14.5px; }
.format-columns li { margin: 2px 0; }

/* ---------- Article pages (privacy, support) -------------------- */

.article {
	padding: 48px 0 72px;
}

.article h1 {
	font-size: clamp(28px, 4vw, 40px);
	letter-spacing: -.01em;
	margin: 0 0 4px;
}

.article .last-updated {
	color: var(--fg-muted);
	font-size: 14px;
	margin: 0 0 32px;
}

.article h2 {
	font-size: 20px;
	margin-top: 36px;
	margin-bottom: 10px;
	letter-spacing: -.005em;
}

.article p, .article ul { font-size: 15.5px; }

.article code {
	background: var(--code-bg);
	padding: 1px 6px;
	border-radius: 5px;
	font-size: 90%;
}

.article a { color: var(--link); }
.article a:hover { color: var(--link-hover); }

/* ---------- Footer ---------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--border);
	padding: 32px 0;
	font-size: 14px;
	color: var(--fg-muted);
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	align-items: center;
}

.site-footer nav a {
	color: var(--fg-muted);
	text-decoration: none;
	margin-left: 20px;
}

.site-footer nav a:first-child { margin-left: 0; }

.site-footer nav a:hover { color: var(--link-hover); }

/* ---------- Skip link for a11y ---------------------------------- */

.skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent-strong);
	color: #fff;
	padding: 10px 14px;
	border-radius: 6px;
	text-decoration: none;
	z-index: 20;
}

.skip:focus { left: 12px; top: 12px; }

/* ---------- Responsive tweaks ---------------------------------- */

@media (max-width: 640px) {
	nav.top-nav a { margin-left: 14px; font-size: 14px; }
	.site-footer .container { flex-direction: column; align-items: flex-start; }
	.site-footer nav { margin-top: 6px; }
	.site-footer nav a:first-child { margin-left: 0; }
	.site-footer nav a { margin-left: 0; margin-right: 16px; }
}
